-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update to Node 20 #6385
Open
snowystinger
wants to merge
34
commits into
main
Choose a base branch
from
node-22
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
chore: Update to Node 20 #6385
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b9b1fca
Update to Node 22
snowystinger e173ba7
go to node 20 instead
snowystinger 9ecd8c7
fix formatting test
snowystinger c1d99bb
run verdaccio build
snowystinger 829125f
turn off verdaccio build
snowystinger bc507dd
try limiting concurrent tests
snowystinger 57cc9f2
try to debug on ci where error happens more
snowystinger a63767a
keep debugging
snowystinger 13b26a4
try a longer timeout
snowystinger bfc1945
remove debugging
snowystinger d00a0d7
turn on verdaccio build
snowystinger 07c6a49
fix lint
snowystinger 795c55b
update yarn lock
snowystinger f0b6492
fix verdaccio and tsdiffer
snowystinger 56b980a
fix node corepack
snowystinger 4fce024
fix forkpoint
snowystinger 6a7a86d
try to fix buildWebsite
snowystinger 9760674
turn verdaccio build back off
snowystinger 6d37be1
fix rebase
snowystinger 96dbf2c
Merge branch 'main' into node-22
snowystinger 816dda2
turn on verdaccio on CI
snowystinger 899cc56
Merge branch 'main' into node-22
snowystinger 99ef2eb
turn off verdaccio again and remove concurrency restriction
snowystinger cf62730
turn back on verdaccio
snowystinger 6c12845
fix spectrum-css local builder
snowystinger 2c6b350
remove obselete patch
snowystinger 840a3f2
fix lint and flakey ssr
snowystinger 1be8a56
remove verdaccio
snowystinger ffbb8e1
update to latest node 20
snowystinger 8ee2e60
Merge branch 'main' into node-22
snowystinger 0a7375a
Merge branch 'main' into node-22
snowystinger 912e8b6
Merge branch 'main' into node-22
snowystinger 2a445ca
Merge branch 'main' into node-22
snowystinger b62f850
Merge branch 'main' into node-22
snowystinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: 'Branch from fork' | ||
description: 'creates a branch based off PR from fork' | ||
runs: | ||
using: 'node18' | ||
using: 'node20' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: 'PR Comment' | ||
description: 'Comment on the PR attached to a commit' | ||
runs: | ||
using: 'node12' | ||
using: 'node20' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: 'Check permissions' | ||
description: 'Checks if commentor has write access or above' | ||
runs: | ||
using: 'node18' | ||
using: 'node20' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.* | ||
20.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
packages/@adobe/spectrum-css-builder-temp/css/lib/varUtils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
|
||
const gulp = require('gulp'); | ||
const postcss = require('postcss'); | ||
const concat = require('gulp-concat'); | ||
const through = require('through2'); | ||
const fsp = require('fs').promises; | ||
const logger = require('gulplog'); | ||
const path = require('path'); | ||
|
||
function getVarsFromCSS(css) { | ||
let variableList = []; | ||
let root = postcss.parse(css); | ||
|
||
root.walkRules((rule, ruleIndex) => { | ||
rule.walkDecls((decl) => { | ||
let matches = decl.value.match(/var\(.*?\)/g); | ||
if (matches) { | ||
matches.forEach(function (match) { | ||
let varName = match.replace(/var\((--[\w-]+),?.*?\)/, '$1').trim(); | ||
if (variableList.indexOf(varName) === -1) { | ||
variableList.push(varName); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
return variableList; | ||
} | ||
|
||
function getVarValues(css) { | ||
let root = postcss.parse(css); | ||
let variables = {}; | ||
|
||
root.walkRules((rule, ruleIndex) => { | ||
rule.walkDecls((decl) => { | ||
variables[decl.prop] = decl.value; | ||
}); | ||
}); | ||
|
||
return variables; | ||
} | ||
|
||
function getClassNames(contents, pkgName) { | ||
let classNames = []; | ||
|
||
if (classNames.length === 0) { | ||
logger.error(`Could not find classNames for ${pkgName}, assuming no classNames`); | ||
classNames.push(''); | ||
} | ||
|
||
logger.debug(`Found classNames ${classNames.join(', ')} for ${pkgName}`); | ||
|
||
return classNames; | ||
} | ||
|
||
function resolveValue(value, vars) { | ||
if (value) { | ||
let match = value.match(/var\((.+),?.*?\)/); | ||
if (match) { | ||
return match[1]; | ||
} | ||
return value; | ||
} | ||
} | ||
|
||
const varDir = path.join(path.dirname(require.resolve('@spectrum-css/vars')), '..'); | ||
|
||
async function readDNAVariables(file) { | ||
let css = await fsp.readFile(path.join(varDir, 'css', file)); | ||
let vars = getVarValues(css); | ||
return vars; | ||
} | ||
|
||
function getVariableDeclarations(classNames, vars) { | ||
let varNames = Object.keys(vars); | ||
if (varNames.length) { | ||
return ` | ||
${classNames.map((className) => `${className}`).join(',\n')} { | ||
${varNames.map((varName) => ` ${varName}: ${vars[varName]};`).join('\n')} | ||
} | ||
`; | ||
} | ||
|
||
return ''; | ||
} | ||
|
||
function getAllVars() { | ||
return new Promise((resolve, reject) => { | ||
let variableList; | ||
|
||
gulp.src([ | ||
`${varDir}/css/themes/*.css`, | ||
`${varDir}/css/scales/*.css`, | ||
`${varDir}/css/components/*.css`, | ||
`${varDir}/css/globals/*.css` | ||
]) | ||
.pipe(concat('everything.css')) | ||
.pipe(through.obj(function getAllVars(file, enc, cb) { | ||
variableList = getVarValues(file.contents.toString()); | ||
|
||
cb(null, file); | ||
})) | ||
.on('finish', () => { | ||
resolve(variableList); | ||
}) | ||
.on('error', reject); | ||
}); | ||
} | ||
|
||
function getAllComponentVars() { | ||
return new Promise((resolve, reject) => { | ||
let variableList; | ||
|
||
gulp.src([ | ||
`${varDir}/css/components/*.css`, | ||
`${varDir}/css/globals/*.css` | ||
]) | ||
.pipe(concat('everything.css')) | ||
.pipe(through.obj(function getAllVars(file, enc, cb) { | ||
variableList = getVarValues(file.contents.toString()); | ||
|
||
cb(null, file); | ||
})) | ||
.on('finish', () => { | ||
resolve(variableList); | ||
}) | ||
.on('error', reject); | ||
}); | ||
} | ||
|
||
exports.getAllComponentVars = getAllComponentVars; | ||
exports.getAllVars = getAllVars; | ||
exports.getVarsFromCSS = getVarsFromCSS; | ||
exports.getVarValues = getVarValues; | ||
exports.getClassNames = getClassNames; | ||
exports.resolveValue = resolveValue; | ||
exports.readDNAVariables = readDNAVariables; | ||
exports.getVariableDeclarations = getVariableDeclarations; |
75 changes: 75 additions & 0 deletions
75
packages/@adobe/spectrum-css-builder-temp/css/plugins/postcss-custom-properties-mapping.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
var valueParser = require('postcss-value-parser'); | ||
let varUtils = require('../lib/varUtils.js'); | ||
|
||
// match custom property inclusions | ||
const customPropertiesRegExp = /(^|[^\w-])var\([\W\w]+\)/; | ||
|
||
let staticVars; | ||
let allVars; | ||
async function fetchVars() { | ||
if (staticVars && allVars) { | ||
return true; | ||
} | ||
|
||
// Read in all static vars | ||
staticVars = Object.assign( | ||
{}, | ||
await varUtils.readDNAVariables('globals/spectrum-staticAliases.css'), | ||
await varUtils.readDNAVariables('globals/spectrum-fontGlobals.css'), | ||
await varUtils.readDNAVariables('globals/spectrum-fontGlobals.css'), | ||
await varUtils.readDNAVariables('globals/spectrum-dimensionGlobals.css'), | ||
await varUtils.readDNAVariables('globals/spectrum-colorGlobals.css'), | ||
await varUtils.readDNAVariables('globals/spectrum-animationGlobals.css') | ||
); | ||
|
||
// Read in all variables so we have the value they resolve to | ||
allVars = await varUtils.getAllComponentVars(); | ||
|
||
return true; | ||
} | ||
|
||
let fetchVarsPromise; | ||
module.exports = function () { | ||
return { | ||
postcssPlugin: 'postcss-custom-properties-mapping', | ||
OnceExit: async function (root, result) { | ||
fetchVarsPromise ??= fetchVars(); | ||
await fetchVarsPromise; | ||
|
||
root.walkRules((rule, ruleIndex) => { | ||
rule.walkDecls((decl) => { | ||
if (customPropertiesRegExp.test(decl.value)) { | ||
let value = valueParser(decl.value); | ||
|
||
value.walk((node, index, nodes) => { | ||
if (node.type === 'function' && node.value === 'var') { | ||
let v = node.nodes[0].value; | ||
|
||
// If the value is static, replace the variable with the value. | ||
// Otherwise, change the variable name to the mapped name. | ||
if (staticVars[v]) { | ||
nodes.splice(index, 1, ...valueParser(`var(${v}, ${staticVars[v]})`).nodes); | ||
} else if (allVars[v]) { | ||
nodes.splice(index, 1, ...valueParser(`var(${v}, ${allVars[v]})`).nodes); | ||
} | ||
} | ||
}); | ||
|
||
decl.value = value.toString(); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
}; |
28 changes: 28 additions & 0 deletions
28
...ges/@adobe/spectrum-css-builder-temp/css/plugins/postcss-custom-properties-passthrough.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
|
||
module.exports = function (opts) { | ||
opts = opts || {}; | ||
|
||
return function (root, result) { | ||
root.walkRules((rule, ruleIndex) => { | ||
rule.walkDecls((decl) => { | ||
if (decl.value.match('xvar(.*?)')) { | ||
decl.value = decl.value.substr(1); | ||
} | ||
if (decl.prop.substr(0, 3) === 'x--') { | ||
decl.prop = decl.prop.substr(1); | ||
} | ||
}); | ||
}); | ||
}; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, was it the SSR tests you mentioned that prompted this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I'm not sure why they take longer now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attempting to fix with maxConcurrency instead, might just be something with how node does concurrency now