Skip to content

Commit a8edce7

Browse files
authoredOct 23, 2024
Merge pull request #48 from aurelia/deps
chore: upgrade deps
2 parents 9ddfb21 + da9e239 commit a8edce7

File tree

21 files changed

+145
-187
lines changed

21 files changed

+145
-187
lines changed
 

‎.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
node_version: [16, 18, 20]
17+
node_version: [20]
1818
os: [ubuntu-latest, windows-latest, macOS-latest]
1919

2020
steps:

‎.github/workflows/e2e-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
node_version:
22-
- 18
22+
- 20
2323
os:
2424
- ubuntu-latest
2525
target_features:

‎.github/workflows/e2e-macOS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
node_version:
19-
- 18
19+
- 20
2020
os:
2121
- macOS-latest
2222
target_features:

‎.github/workflows/e2e-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
node_version:
19-
- 18
19+
- 20
2020
os:
2121
- windows-latest
2222
target_features:

‎cli-bundler/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"del": "^6.1.0",
44

55
// @if requirejs
6-
"requirejs": "^2.3.6",
6+
"requirejs": "^2.3.7",
77
// @endif
88
// @if alameda
99
"alameda": "^1.4.0",
@@ -26,20 +26,20 @@
2626
// @endif
2727

2828
// @if postcss
29-
"gulp-postcss": "^9.0.1",
30-
"postcss": "^8.4.24",
31-
"autoprefixer": "^10.4.14",
32-
"cssnano": "^6.0.1",
29+
"gulp-postcss": "^10.0.0",
30+
"postcss": "^8.4.47",
31+
"autoprefixer": "^10.4.20",
32+
"cssnano": "^7.0.6",
3333
"postcss-url": "^10.1.3",
3434
// @endif
3535

3636
// @if sass
3737
"gulp-dart-sass": "^1.1.0",
38-
"node-sass-package-importer": "^5.3.2",
38+
"node-sass-package-importer": "^5.3.3",
3939
// @endif
4040

4141
// @if stylus
42-
"gulp-stylus": "^3.0.0",
42+
"gulp-stylus": "^3.0.1",
4343
// @endif
4444

4545
// @if htmlmin
@@ -49,8 +49,8 @@
4949
"connect": "^3.7.0",
5050
"connect-history-api-fallback": "^2.0.0",
5151
"connect-injector": "^0.4.4",
52-
"serve-static": "^1.15.0",
53-
"socket.io": "^4.7.1",
52+
"serve-static": "^1.16.2",
53+
"socket.io": "^4.8.0",
5454
"open": "^8.4.0",
5555
"server-destroy": "^1.0.1",
5656

‎common/.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"no-unused-vars": 0,
3535
// @if typescript
3636
"@typescript-eslint/no-unused-vars": 0,
37+
"@typescript-eslint/no-explicit-any": 0,
3738
// @endif
3839
"no-prototype-builtins": 0,
3940
"no-console": 0,

‎common/babel.config.json__if_babel

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"plugins": [
99
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
10-
["@babel/plugin-proposal-class-properties", { "loose": true }],
10+
["@babel/plugin-transform-class-properties", { "loose": true }],
1111
"@babel/plugin-syntax-dynamic-import"
1212
]
1313
}

‎common/package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,40 @@
99
"license": "MIT",
1010
// @if ! plugin
1111
"dependencies": {
12-
"aurelia-bootstrapper": "^2.4.0",
12+
"aurelia-bootstrapper": "^2.4.1",
1313
"aurelia-animator-css": "^1.0.4"
1414
},
1515
// @endif
1616
"devDependencies": {
1717
"eslint": "^8.43.0",
18-
"aurelia-cli": "^3.0.1",
18+
"aurelia-cli": "^3.0.3",
1919
"aurelia-testing": "^1.1.0",
2020
"gulp": "^4.0.2",
21-
"gulp-eslint-new": "^1.8.1",
21+
"gulp-eslint-new": "^2.3.0",
2222
"minimatch": "^5.1.2",
2323
"promise-polyfill": "^8.3.0",
2424

2525
// @if plugin
26-
"aurelia-bootstrapper": "^2.4.0",
26+
"aurelia-bootstrapper": "^2.4.1",
2727
"aurelia-animator-css": "^1.0.4",
2828
// @endif
2929

3030
// @if babel
31-
"@babel/eslint-parser": "^7.22.5",
32-
"@babel/plugin-proposal-decorators": "^7.22.5",
33-
"@babel/plugin-proposal-class-properties": "^7.18.6",
31+
"@babel/eslint-parser": "^7.25.8",
32+
"@babel/plugin-proposal-decorators": "^7.25.7",
3433
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
35-
"@babel/preset-env": "^7.22.5",
36-
"@babel/core": "^7.22.5",
37-
"@babel/register": "^7.18.9",
38-
"regenerator-runtime": "^0.13.11",
34+
"@babel/preset-env": "^7.25.8",
35+
"@babel/core": "^7.25.8",
36+
"@babel/register": "^7.25.7",
37+
"regenerator-runtime": "^0.14.1",
3938
// @endif
4039

4140
// @if typescript
42-
"typescript": "^5.1.6",
43-
"tslib": "^2.6.0",
44-
"@types/node": "^18.11.18",
45-
"@typescript-eslint/eslint-plugin": "^5.60.1",
46-
"@typescript-eslint/parser": "^5.60.1",
41+
"typescript": "^5.6.3",
42+
"tslib": "^2.8.0",
43+
"@types/node": "^22.7.8",
44+
"@typescript-eslint/eslint-plugin": "^8.11.0",
45+
"@typescript-eslint/parser": "^8.11.0",
4746
// @endif
4847
},
4948
// @if postcss || babel

‎e2e-test.js

+36-52
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@
77
const spawn = require('cross-spawn');
88
const fs = require('fs');
99
const path = require('path');
10-
const del = require('del');
1110
const test = require('ava');
12-
const puppeteer = require('puppeteer');
1311
const kill = require('tree-kill');
1412

13+
async function delay(secs) {
14+
return new Promise((resolve) => {
15+
setTimeout(resolve, secs);
16+
});
17+
}
18+
1519
const isWin32 = process.platform === 'win32';
16-
const dir = __dirname;
1720

18-
const folder = path.join(dir, 'test-skeletons');
21+
const folder = path.join(__dirname, 'test-skeletons');
1922
console.log('-- cleanup ' + folder);
20-
del.sync(folder);
23+
fs.rmSync(folder, {recursive: true, force: true});
2124
fs.mkdirSync(folder);
2225

2326
// Somehow taskkill on windows would not send SIGTERM signal to proc,
@@ -32,7 +35,7 @@ function killProc(proc) {
3235
}
3336

3437

35-
function run(command, dataCB, errorCB) {
38+
function run(command, cwd, dataCB, errorCB) {
3639
const [cmd, ...args] = command.split(' ');
3740
return new Promise((resolve, reject) => {
3841
const env = Object.create(process.env);
@@ -41,8 +44,9 @@ function run(command, dataCB, errorCB) {
4144
// need to reset NODE_ENV back to development because this whole
4245
// test is running in NODE_ENV=test which will affect gulp build
4346
env.NODE_ENV = 'development';
44-
const proc = spawn(cmd, args, {env});
45-
proc.on('exit', (code, signal) => {
47+
const proc = spawn(cmd, args, {env, cwd});
48+
proc.on('exit', async (code, signal) => {
49+
await delay(1);
4650
if (code && signal !== 'SIGTERM' && !win32Killed.has(proc.pid)) {
4751
reject(new Error(cmd + ' ' + args.join(' ') + ' process exit code: ' + code + ' signal: ' + signal));
4852
} else {
@@ -55,33 +59,26 @@ function run(command, dataCB, errorCB) {
5559
if (dataCB) {
5660
dataCB(data, () => {
5761
console.log(`-- kill "${command}"`);
58-
killProc(proc);
62+
setTimeout(() => killProc(proc), 500);
5963
});
6064
}
6165
});
6266
proc.stderr.on('data', data => {
6367
process.stderr.write(data);
64-
// Ingore webpack warning
65-
if (data.toString().includes('DeprecationWarning')) return;
68+
// Skip webpack5 deprecation warning.
69+
if (data.toString().toLowerCase().includes('deprecation')) return;
70+
// Skip BABEL warning (used by dumber bundler) when reading @aurelia/runtime-html
71+
if (data.toString().includes('The code generator has deoptimised the styling')) return;
6672
if (errorCB) {
6773
errorCB(data, () => {
6874
console.log(`-- kill "${command}"`);
69-
killProc(proc);
75+
setTimeout(() => killProc(proc), 500);
7076
});
7177
}
7278
})
7379
});
7480
}
7581

76-
async function takeScreenshot(url, filePath) {
77-
const browser = await puppeteer.launch();
78-
const page = await browser.newPage();
79-
await page.goto(url);
80-
await new Promise(r => setTimeout(r, 6000));
81-
await page.screenshot({path: filePath});
82-
await browser.close();
83-
}
84-
8582
const targetCLI = (process.env.TARGET_CLI || null);
8683

8784
const targetFeatures = (process.env.TARGET_FEATURES || '').toLowerCase().split(',').filter(p => p);
@@ -154,82 +151,80 @@ skeletons.forEach((features, i) => {
154151

155152
test.serial(title, async t => {
156153
console.log(title);
157-
process.chdir(folder);
158154

159-
const makeCmd = `npx makes ${dir} ${appName} -s ${features.join(',')}`;
155+
const makeCmd = `npx makes ${__dirname} ${appName} -s ${features.join(',')}`;
160156
console.log('-- ' + makeCmd);
161-
await run(makeCmd);
157+
await run(makeCmd, folder);
162158
t.pass('made skeleton');
163-
process.chdir(appFolder);
164159

165160
patchPackageJson(appFolder, targetCLI);
166161

167162
console.log('-- npm i');
168-
await run('npm i');
163+
await run('npm i', appFolder);
169164
t.pass('installed deps');
170165

171166
console.log('-- npm test');
172-
await run('npm test');
167+
await run('npm test', appFolder);
173168
t.pass('finished unit tests');
174169

175170
console.log('-- npx au generate attribute NewThing');
176-
await run('npx au generate attribute NewThing', null,
171+
await run('npx au generate attribute NewThing', appFolder, null,
177172
(data, kill) => {
178173
t.fail('au generate attribute failed: ' + data.toString());
179174
}
180175
);
181176
t.pass('generated attribute');
182177

183178
console.log('-- npx au generate component NewThing .');
184-
await run('npx au generate component NewThing .', null,
179+
await run('npx au generate component NewThing .', appFolder, null,
185180
(data, kill) => {
186181
t.fail('au generate component failed: ' + data.toString());
187182
}
188183
);
189184
t.pass('generated component');
190185

191186
console.log('-- npx au generate element NewThing');
192-
await run('npx au generate element NewThing', null,
187+
await run('npx au generate element NewThing', appFolder, null,
193188
(data, kill) => {
194189
t.fail('au generate element failed: ' + data.toString());
195190
}
196191
);
197192
t.pass('generated element');
198193

199194
console.log('-- npx au generate value-converter NewThing');
200-
await run('npx au generate value-converter NewThing', null,
195+
await run('npx au generate value-converter NewThing', appFolder, null,
201196
(data, kill) => {
202197
t.fail('au generate value-converter failed: ' + data.toString());
203198
}
204199
);
205200
t.pass('generated value-converter');
206201

207202
console.log('-- npx au generate binding-behavior NewThing');
208-
await run('npx au generate binding-behavior NewThing', null,
203+
await run('npx au generate binding-behavior NewThing', appFolder, null,
209204
(data, kill) => {
210205
t.fail('au generate binding-behavior failed: ' + data.toString());
211206
}
212207
);
213208
t.pass('generated binding-behavior');
214209

215210
console.log('-- npx au generate task NewThing');
216-
await run('npx au generate task NewThing', null,
211+
await run('npx au generate task NewThing', appFolder, null,
217212
(data, kill) => {
218213
t.fail('au generate task failed: ' + data.toString());
219214
}
220215
);
221216
t.pass('generated task');
222217

223218
console.log('-- npx au generate generator NewThing');
224-
await run('npx au generate generator NewThing', null,
219+
await run('npx au generate generator NewThing', appFolder, null,
225220
(data, kill) => {
226221
t.fail('au generate generator failed: ' + data.toString());
227222
}
228223
);
229224
t.pass('generated generator');
230225

231226
console.log('-- npm run build');
232-
await run('npm run build', null,
227+
await run('npm run build', appFolder, null,
233228
(data, kill) => {
234229
t.fail('build failed: ' + data.toString());
235230
}
@@ -242,36 +237,25 @@ skeletons.forEach((features, i) => {
242237
if (!m) return;
243238
const url = m[1];
244239
t.pass(m[0]);
245-
246-
try {
247-
if (!process.env.GITHUB_ACTIONS) {
248-
console.log('-- take screenshot');
249-
await takeScreenshot(url, path.join(folder, appName + '.png'));
250-
}
251-
kill();
252-
} catch (e) {
253-
t.fail(e.message);
254-
kill();
255-
}
240+
kill();
256241
};
257242

258243
// Webpack5 now prints Loopback: http://localhost:5000 in stderr!
259-
await run('npm start', runE2e, runE2e);
244+
await run('npm start', appFolder, runE2e, runE2e);
260245

261246
if (features.includes('playwright')) {
262247
console.log('-- npx playwright test --project chromium');
263-
await run('npx playwright install --with-deps');
264-
await run('npx playwright test --project chromium');
248+
await run('npx playwright install --with-deps', appFolder);
249+
await run('npx playwright test --project chromium', appFolder);
265250
}
266251

267252
if (process.platform === 'linux' && features.includes('docker')) {
268253
console.log('-- npm run docker:build');
269-
await run(`npm run docker:build`);
254+
await run(`npm run docker:build`, appFolder);
270255
t.pass('passed docker:build');
271256
}
272257

273258
console.log('-- remove folder ' + appName);
274-
process.chdir(folder);
275-
await del(appFolder);
259+
await fs.promises.rm(appFolder, {recursive: true});
276260
});
277261
});

0 commit comments

Comments
 (0)