-
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
base: main
Are you sure you want to change the base?
chore: Update to Node 20 #6385
Changes from 20 commits
b9b1fca
e173ba7
9ecd8c7
c1d99bb
829125f
bc507dd
57cc9f2
a63767a
13b26a4
bfc1945
d00a0d7
07c6a49
795c55b
f0b6492
56b980a
4fce024
6a7a86d
9760674
6d37be1
96dbf2c
816dda2
899cc56
99ef2eb
cf62730
6c12845
2c6b350
840a3f2
1be8a56
ffbb8e1
8ee2e60
0a7375a
912e8b6
2a445ca
b62f850
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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' |
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' |
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' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.* | ||
20.* |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whats the story with this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spectrum-css/builder had a whole bunch of dependencies we weren't making use of, even transitively, so I got rid of them by making the temp version |
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(); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
}; |
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); | ||
} | ||
}); | ||
}); | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@spectrum-css/component-builder", | ||
"private": true, | ||
"version": "1.0.1", | ||
"description": "The Spectrum CSS component builder", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/adobe/react-spectrum" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/adobe/spectrum-css/issues" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@swc/helpers": "^0.5.0", | ||
"gulp": "^5.0.0", | ||
"gulp-concat": "^2.6.1", | ||
"postcss": "^5.2.18", | ||
"postcss-custom-properties": "^6.0.1", | ||
"postcss-import": "^10.0.0", | ||
"postcss-value-parser": "3.3.1", | ||
"through2": "^3.0.1" | ||
}, | ||
"rsp": { | ||
"type": "cli" | ||
}, | ||
"gitHead": "9b1c059b9e3c769334f8c6880e4a6a041fde1227" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,19 @@ class NumberParserImpl { | |
|
||
constructor(locale: string, options: Intl.NumberFormatOptions = {}) { | ||
this.locale = locale; | ||
// see https://tc39.es/ecma402/#sec-setnfdigitoptions, when using roundingIncrement, the maximumFractionDigits and minimumFractionDigits must be equal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note, this previously threw in Chrome and Node 22 |
||
// by default, they are 0 and 3 respectively, so we set them to 0 if neither are set | ||
if (options.roundingIncrement !== 1 && options.roundingIncrement != null) { | ||
if (options.maximumFractionDigits == null && options.minimumFractionDigits == null) { | ||
options.maximumFractionDigits = 0; | ||
options.minimumFractionDigits = 0; | ||
} else if (options.maximumFractionDigits == null) { | ||
options.maximumFractionDigits = options.minimumFractionDigits; | ||
} else if (options.minimumFractionDigits == null) { | ||
options.minimumFractionDigits = options.maximumFractionDigits; | ||
} | ||
// if both are specified, let the normal Range Error be thrown | ||
} | ||
this.formatter = new Intl.NumberFormat(locale, options); | ||
this.options = this.formatter.resolvedOptions(); | ||
this.symbols = getSymbols(locale, this.formatter, this.options, options); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,14 @@ build().catch(err => { | |
* This is run against the current branch by copying the current branch into a temporary directory and building there | ||
*/ | ||
async function build() { | ||
let backupDir = tempy.directory(); | ||
let archiveDir; | ||
if (argv.githash) { | ||
archiveDir = tempy.directory(); | ||
console.log('checking out archive of', argv.githash, 'into', archiveDir); | ||
await run('sh', ['-c', `git archive ${argv.githash} | tar -x -C ${archiveDir}`], {stdio: 'inherit'}); | ||
|
||
await run('sh', ['-c', `git archive HEAD | tar -x -C ${backupDir}`], {stdio: 'inherit'}); | ||
} | ||
let srcDir = archiveDir ?? path.join(__dirname, '..'); | ||
let distDir = path.join(__dirname, '..', 'dist', argv.output ?? 'branch-api'); | ||
|
@@ -53,6 +56,7 @@ async function build() { | |
// Generate a package.json containing just what we need to build the website | ||
let pkg = { | ||
name: 'rsp-website', | ||
packageManager: "[email protected]", | ||
version: '0.0.0', | ||
private: true, | ||
workspaces: [ | ||
|
@@ -102,6 +106,11 @@ async function build() { | |
|
||
// Copy necessary code and configuration over | ||
fs.copySync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp')); | ||
try { | ||
fs.copySync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp')); | ||
} catch (e) { | ||
fs.copySync(path.join(backupDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp')); | ||
} | ||
fs.copySync(path.join(srcDir, 'postcss.config.js'), path.join(dir, 'postcss.config.js')); | ||
fs.copySync(path.join(srcDir, 'lib'), path.join(dir, 'lib')); | ||
fs.copySync(path.join(srcDir, 'CONTRIBUTING.md'), path.join(dir, 'CONTRIBUTING.md')); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ async function build() { | |
let pkg = { | ||
name: 'react-spectrum-monorepo', | ||
version: '0.0.0', | ||
packageManager: "[email protected]", | ||
private: true, | ||
workspaces: [ | ||
'packages/*/*' | ||
|
@@ -79,6 +80,7 @@ async function build() { | |
let cleanPkg = { | ||
name: 'react-spectrum-monorepo', | ||
version: '0.0.0', | ||
packageManager: "[email protected]", | ||
private: true, | ||
workspaces: [ | ||
'packages/*/*' | ||
|
@@ -161,6 +163,7 @@ async function build() { | |
fs.copySync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev')); | ||
fs.removeSync(path.join(dir, 'packages', 'dev', 'docs')); | ||
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp')); | ||
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp')); | ||
fs.copySync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc')); | ||
fs.copySync(path.join(__dirname, '..', 'postcss.config.js'), path.join(dir, 'postcss.config.js')); | ||
fs.copySync(path.join(__dirname, '..', 'lib'), path.join(dir, 'lib')); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,8 @@ async function build() { | |
workspaces: [ | ||
'packages/@internationalized/string-compiler', | ||
'packages/dev/*', | ||
'packages/@adobe/spectrum-css-temp' | ||
'packages/@adobe/spectrum-css-temp', | ||
'packages/@adobe/spectrum-css-builder-temp' | ||
], | ||
packageManager: '[email protected]', | ||
devDependencies: Object.fromEntries( | ||
|
@@ -125,6 +126,7 @@ async function build() { | |
fs.copySync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev')); | ||
fs.copySync(path.join(__dirname, '..', 'packages', '@internationalized', 'string-compiler'), path.join(dir, 'packages', '@internationalized', 'string-compiler')); | ||
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp')); | ||
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp')); | ||
fs.copySync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc')); | ||
fs.copySync(path.join(__dirname, '..', 'postcss.config.js'), path.join(dir, 'postcss.config.js')); | ||
fs.copySync(path.join(__dirname, '..', 'lib'), path.join(dir, 'lib')); | ||
|
@@ -145,7 +147,7 @@ async function build() { | |
} | ||
|
||
// Only copy babel and parcel patches over | ||
let patches = fs.readdirSync(path.join(__dirname, '..', 'patches')).filter(name => name.startsWith('@babel') || name.startsWith('@parcel') || name.startsWith('@spectrum-css') || name.startsWith('postcss')); | ||
let patches = fs.readdirSync(path.join(__dirname, '..', 'patches')).filter(name => name.startsWith('@babel') || name.startsWith('@parcel') || name.startsWith('postcss')); | ||
for (let patch of patches) { | ||
fs.copySync(path.join(__dirname, '..', 'patches', patch), path.join(dir, 'patches', patch)); | ||
} | ||
|
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