From 919112b72a7fa2b2f88d075538b0a3ac06b246ce Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Sat, 18 May 2024 13:29:54 +1000 Subject: [PATCH] chore: upgrade deps --- .github/workflows/ci.yml | 2 +- .github/workflows/e2e-linux.yml | 6 +- .github/workflows/e2e-macos.yml | 6 +- .github/workflows/e2e-windows.yml | 6 +- __test__/transforms.spec.js | 108 +++++++++++++++-------------- common/babel.config.json__if_babel | 4 +- common/package.json | 46 ++++++------ e2e-test.js | 25 +++---- jasmine/package.json | 4 +- jest/package.json | 10 +-- mocha/package.json | 6 +- package.json | 12 ++-- playwright/package.json | 2 +- react/package.json | 10 +-- tape/package.json | 4 +- 15 files changed, 126 insertions(+), 125 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d93b62..18243fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node_version: [16, 18, 20] + node_version: [20, 22] os: [ubuntu-latest, windows-latest, macOS-latest] steps: diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index 552b6a9..982c375 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: node_version: - - 18 + - 20 os: - ubuntu-latest target_features: @@ -30,9 +30,9 @@ jobs: - react,babel - react,typescript steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - run: npm install diff --git a/.github/workflows/e2e-macos.yml b/.github/workflows/e2e-macos.yml index a2bd028..8f3975e 100644 --- a/.github/workflows/e2e-macos.yml +++ b/.github/workflows/e2e-macos.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: node_version: - - 18 + - 20 os: - macOS-latest target_features: @@ -27,9 +27,9 @@ jobs: - react,babel - react,typescript steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - run: npm install diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index 74aa0a2..78cb863 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: node_version: - - 18 + - 20 os: - windows-latest target_features: @@ -27,9 +27,9 @@ jobs: - react,babel - react,typescript steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - run: npm install diff --git a/__test__/transforms.spec.js b/__test__/transforms.spec.js index f14f863..a08ac1f 100644 --- a/__test__/transforms.spec.js +++ b/__test__/transforms.spec.js @@ -8,66 +8,70 @@ test('Only one append transform', t => { t.is(typeof extTransform, 'function'); }); -test.cb('ext-transform translates .ext file to .js file when typescript is not selected', t => { - const jsExt = extTransform({}, []); - const files = []; +test('ext-transform translates .ext file to .js file when typescript is not selected', async t => { + return new Promise(resolve => { + const jsExt = extTransform({}, []); + const files = []; - jsExt.pipe(new Writable({ - objectMode: true, - write(file, enc, cb) { - files.push(file); - cb(); - } - })); + jsExt.pipe(new Writable({ + objectMode: true, + write(file, enc, cb) { + files.push(file); + cb(); + } + })); - jsExt.on('end', () => { - t.is(files.length, 2); - t.is(files[0].path.replace(/\\/g, '/'), 'test/a.js'); - t.is(files[0].contents.toString(), 'var a = 1;'); - t.is(files[1].path.replace(/\\/g, '/'), 'test/b.html'); - t.is(files[1].contents.toString(), '

'); - t.end(); - }) + jsExt.on('end', () => { + t.is(files.length, 2); + t.is(files[0].path.replace(/\\/g, '/'), 'test/a.js'); + t.is(files[0].contents.toString(), 'var a = 1;'); + t.is(files[1].path.replace(/\\/g, '/'), 'test/b.html'); + t.is(files[1].contents.toString(), '

'); + resolve(); + }) - jsExt.write(new Vinyl({ - path: 'test/a.ext', - contents: Buffer.from('var a = 1;') - })); + jsExt.write(new Vinyl({ + path: 'test/a.ext', + contents: Buffer.from('var a = 1;') + })); - jsExt.end(new Vinyl({ - path: 'test/b.html', - contents: Buffer.from('

') - })); + jsExt.end(new Vinyl({ + path: 'test/b.html', + contents: Buffer.from('

') + })); + }); }); -test.cb('ext-transform translates .ext file to .ts file when typescript is selected', t => { - const jsExt = extTransform({}, ['typescript']); - const files = []; +test('ext-transform translates .ext file to .ts file when typescript is selected', async t => { + return new Promise(resolve => { + const jsExt = extTransform({}, ['typescript']); + const files = []; - jsExt.pipe(new Writable({ - objectMode: true, - write(file, enc, cb) { - files.push(file); - cb(); - } - })); + jsExt.pipe(new Writable({ + objectMode: true, + write(file, enc, cb) { + files.push(file); + cb(); + } + })); - jsExt.on('end', () => { - t.is(files.length, 2); - t.is(files[0].path.replace(/\\/g, '/'), 'test/a.ts'); - t.is(files[0].contents.toString(), 'var a = 1;'); - t.is(files[1].path.replace(/\\/g, '/'), 'test/b.html'); - t.is(files[1].contents.toString(), '

'); - t.end(); - }) + jsExt.on('end', () => { + t.is(files.length, 2); + t.is(files[0].path.replace(/\\/g, '/'), 'test/a.ts'); + t.is(files[0].contents.toString(), 'var a = 1;'); + t.is(files[1].path.replace(/\\/g, '/'), 'test/b.html'); + t.is(files[1].contents.toString(), '

'); + resolve(); + }) - jsExt.write(new Vinyl({ - path: 'test/a.ext', - contents: Buffer.from('var a = 1;') - })); + jsExt.write(new Vinyl({ + path: 'test/a.ext', + contents: Buffer.from('var a = 1;') + })); - jsExt.end(new Vinyl({ - path: 'test/b.html', - contents: Buffer.from('

') - })); + jsExt.end(new Vinyl({ + path: 'test/b.html', + contents: Buffer.from('

') + })); + }); }); diff --git a/common/babel.config.json__if_babel b/common/babel.config.json__if_babel index 9c08f08..8112382 100644 --- a/common/babel.config.json__if_babel +++ b/common/babel.config.json__if_babel @@ -5,8 +5,8 @@ /* @endif */ ], "plugins": [ - ["@babel/plugin-proposal-decorators", { "legacy": true }], - ["@babel/plugin-proposal-class-properties", { "loose": true }], + ["@babel/plugin-proposal-decorators", { "version": "legacy" }], + ["@babel/plugin-transform-class-properties", { "loose": true }], "@babel/plugin-syntax-dynamic-import" ]/* @if jasmine || mocha || tape */, "env": { diff --git a/common/package.json b/common/package.json index 4d7709c..3fa901a 100644 --- a/common/package.json +++ b/common/package.json @@ -11,11 +11,11 @@ "license": "UNLICENSED", "devDependencies": { // @if babel - "@babel/core": "^7.22.5", - "@babel/preset-env": "^7.22.5", + "@babel/core": "^7.24.5", + "@babel/preset-env": "^7.24.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.22.5", + "@babel/plugin-proposal-decorators": "^7.24.1", + "@babel/plugin-transform-class-properties": "^7.24.1", "gulp-babel": "^8.0.0", // @if !evergreen "regenerator-runtime": "0.13.2", @@ -26,39 +26,39 @@ // @endif // @endif - "eslint": "^8.43.0", + "eslint": "^8.57.0", // @if babel - "@babel/eslint-parser": "^7.22.5", + "@babel/eslint-parser": "^7.24.5", // @endif // @if typescript - "typescript": "^5.1.6", - "tslib": "^2.6.0", + "typescript": "^5.4.5", + "tslib": "^2.6.2", "gulp-typescript": "^5.0.1", - "@types/node": "^18.11.18", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", + "@types/node": "^20.12.12", + "@typescript-eslint/eslint-plugin": "^7.9.0", + "@typescript-eslint/parser": "^7.9.0", // @endif - "stylelint": "^15.11.0", + "stylelint": "^16.5.0", // @if css - "stylelint-config-standard": "^34.0.0", + "stylelint-config-standard": "^36.0.0", // @endif // @if sass - "gulp-dart-sass": "^1.0.2", - "node-sass-package-importer": "^5.3.2", - "stylelint-config-standard-scss": "^11.1.0", + "gulp-dart-sass": "^1.1.0", + "node-sass-package-importer": "^5.3.3", + "stylelint-config-standard-scss": "^13.1.0", // @endif // @if less "gulp-less": "^5.0.0", - "stylelint-config-standard-less": "^2.0.0", + "stylelint-config-standard-less": "^3.0.1", // @endif // @if jasmine || tape || mocha - "browser-do": "^4.1.0", + "browser-do": "^5.0.0", // @endif "merge2": "^1.4.1", @@ -67,16 +67,16 @@ "gulp-sourcemaps": "^3.0.0", // @endif - "gulp-postcss": "^9.0.1", - "postcss": "^8.4.24", - "autoprefixer": "^10.4.14", + "gulp-postcss": "^10.0.0", + "postcss": "^8.4.38", + "autoprefixer": "^10.4.19", "postcss-url": "^10.1.3", "connect": "^3.7.0", "connect-history-api-fallback": "^2.0.0", "connect-injector": "^0.4.4", "serve-static": "^1.15.0", - "socket.io": "^4.7.1", + "socket.io": "^4.7.5", "open": "^8.4.2", "cross-env": "^7.0.3", @@ -127,7 +127,7 @@ }, // npm v8 feature to bypass outdated gulp deps "overrides": { - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "glob-stream": "^7.0.0", "glob-parent": "^6.0.2", "micromatch": "^4.0.5" diff --git a/e2e-test.js b/e2e-test.js index f123839..1338cc9 100644 --- a/e2e-test.js +++ b/e2e-test.js @@ -42,7 +42,7 @@ function killProc(proc) { } -function run(command, dataCB, errorCB) { +function run(command, cwd, dataCB, errorCB) { const [cmd, ...args] = command.split(' '); return new Promise((resolve, reject) => { const env = Object.create(process.env); @@ -51,7 +51,7 @@ function run(command, dataCB, errorCB) { // need to reset NODE_ENV back to development because this whole // test is running in NODE_ENV=test which will affect gulp build env.NODE_ENV = 'development'; - const proc = spawn(cmd, args, {env}); + const proc = spawn(cmd, args, {env, cwd}); proc.on('exit', (code, signal) => { if (code && signal !== 'SIGTERM' && !win32Killed.has(proc.pid)) { reject(new Error(cmd + ' ' + args.join(' ') + ' process exit code: ' + code + ' signal: ' + signal)); @@ -109,26 +109,24 @@ skeletons.forEach((features, i) => { test.serial(title, async t => { console.log(title); - process.chdir(folder); const makeCmd = `npx makes ${dir} ${appName} -s ${features.join(',')}`; console.log('-- ' + makeCmd); - await run(makeCmd); + await run(makeCmd, folder); t.pass('made skeleton'); - process.chdir(appFolder); console.log('-- npm i'); - await run('npm i'); + await run('npm i', appFolder); t.pass('installed deps'); if (hasUnitTests) { console.log('-- npm test'); - await run('npm test'); + await run('npm test', appFolder); t.pass('finished unit tests'); } console.log('-- npm run build:dev'); - await run('npm run build:dev', null, + await run('npm run build:dev', appFolder, null, (data, kill) => { t.fail('gulp build failed: ' + data.toString()); } @@ -144,11 +142,11 @@ skeletons.forEach((features, i) => { t.truthy(entryStat.isFile()); console.log('-- npx gulp clean'); - await run('npx gulp clean'); - t.throws(() => fs.statSync(entryPath), null, 'cleaned bundle files'); + await run('npx gulp clean', appFolder); + t.throws(() => fs.statSync(entryPath), undefined, 'cleaned bundle files'); console.log('-- npm start'); - await run(`npm start`, + await run(`npm start`, appFolder, async (data, kill) => { const m = data.toString().match(/Dev server is started at: (\S+)/); if (!m) return; @@ -170,13 +168,12 @@ skeletons.forEach((features, i) => { if (features.includes('playwright')) { console.log('-- npx playwright test --project chromium'); - await run('npx playwright install --with-deps'); - await run('npx playwright test --project chromium'); + await run('npx playwright install --with-deps', appFolder); + await run('npx playwright test --project chromium', appFolder); } await wait(); console.log('-- remove folder ' + appName); - process.chdir(folder); await del(appFolder); }); }); diff --git a/jasmine/package.json b/jasmine/package.json index c8cb31f..85d7ca9 100644 --- a/jasmine/package.json +++ b/jasmine/package.json @@ -1,8 +1,8 @@ { "devDependencies": { - "jasmine-core": "^4.6.0", + "jasmine-core": "^5.1.2", // @if typescript - "@types/jasmine": "^4.3.5", + "@types/jasmine": "^5.1.4", // @endif }, "scripts": { diff --git a/jest/package.json b/jest/package.json index 717e685..3532888 100644 --- a/jest/package.json +++ b/jest/package.json @@ -1,16 +1,16 @@ { "devDependencies": { - "jest": "^29.5.0", + "jest": "^29.7.0", // @if !aurelia - "jest-environment-jsdom": "^29.5.0", + "jest-environment-jsdom": "^29.7.0", // @endif "jest-transform-stub": "^2.0.0", // @if babel - "babel-jest": "^29.5.0", + "babel-jest": "^29.7.0", // @endif // @if typescript - "@types/jest": "^29.5.2", - "ts-jest": "^29.1.0", + "@types/jest": "^29.5.12", + "ts-jest": "^29.1.2", // @endif }, "scripts": { diff --git a/mocha/package.json b/mocha/package.json index d9d4ed8..6f884db 100644 --- a/mocha/package.json +++ b/mocha/package.json @@ -1,9 +1,9 @@ { "devDependencies": { - "mocha": "^10.2.0", - "chai": "^4.3.7", + "mocha": "^10.4.0", + "chai": "^5.1.1", // @if typescript - "@types/mocha": "^10.0.1", + "@types/mocha": "^10.0.6", // @endif }, "scripts": { diff --git a/package.json b/package.json index c8d1c9c..cb39fed 100644 --- a/package.json +++ b/package.json @@ -5,16 +5,16 @@ "description": "'makes' skeleton for creating app using dumber bundler. This package.json file is not required by 'makes', it's only to enable testing on skeletons.", "license": "MIT", "devDependencies": { - "ava": "^3.15.0", + "ava": "^6.1.3", "cross-env": "^7.0.3", "cross-spawn": "^7.0.3", "del": "^6.1.1", - "glob": "^10.3.1", + "glob": "^10.3.15", "makes": "^3.2.0", - "npm-check-updates": "^16.10.13", - "puppeteer": "^20.7.4", - "semver": "^7.5.3", - "standard-changelog": "^3.0.0", + "npm-check-updates": "^16.14.20", + "puppeteer": "^22.9.0", + "semver": "^7.6.2", + "standard-changelog": "^6.0.0", "tree-kill": "^1.2.2", "vinyl": "^3.0.0" }, diff --git a/playwright/package.json b/playwright/package.json index 2421ca3..abce5c3 100644 --- a/playwright/package.json +++ b/playwright/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@playwright/test": "^1.35.1", + "@playwright/test": "^1.44.0", }, "scripts": { "test:e2e": "playwright test" diff --git a/react/package.json b/react/package.json index c43c151..b747a06 100644 --- a/react/package.json +++ b/react/package.json @@ -1,9 +1,9 @@ { "devDependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-test-renderer": "^18.2.0", - "@babel/preset-react": "^7.22.5", - "eslint-plugin-react": "^7.32.2" + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-test-renderer": "^18.3.1", + "@babel/preset-react": "^7.24.1", + "eslint-plugin-react": "^7.34.1" } } diff --git a/tape/package.json b/tape/package.json index b24c68b..f6ef3fe 100644 --- a/tape/package.json +++ b/tape/package.json @@ -1,8 +1,8 @@ { "devDependencies": { - "tape": "^5.6.3", + "tape": "^5.7.5", // @if typescript - "@types/tape": "^5.6.0" + "@types/tape": "^5.6.4" // @endif }, "scripts": {