Skip to content

Commit

Permalink
Merge pull request #48 from aurelia/deps
Browse files Browse the repository at this point in the history
chore: upgrade deps
  • Loading branch information
3cp authored Oct 23, 2024
2 parents 9ddfb21 + da9e239 commit a8edce7
Show file tree
Hide file tree
Showing 21 changed files with 145 additions and 187 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16, 18, 20]
node_version: [20]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 18
- 20
os:
- ubuntu-latest
target_features:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 18
- 20
os:
- macOS-latest
target_features:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 18
- 20
os:
- windows-latest
target_features:
Expand Down
18 changes: 9 additions & 9 deletions cli-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"del": "^6.1.0",

// @if requirejs
"requirejs": "^2.3.6",
"requirejs": "^2.3.7",
// @endif
// @if alameda
"alameda": "^1.4.0",
Expand All @@ -26,20 +26,20 @@
// @endif

// @if postcss
"gulp-postcss": "^9.0.1",
"postcss": "^8.4.24",
"autoprefixer": "^10.4.14",
"cssnano": "^6.0.1",
"gulp-postcss": "^10.0.0",
"postcss": "^8.4.47",
"autoprefixer": "^10.4.20",
"cssnano": "^7.0.6",
"postcss-url": "^10.1.3",
// @endif

// @if sass
"gulp-dart-sass": "^1.1.0",
"node-sass-package-importer": "^5.3.2",
"node-sass-package-importer": "^5.3.3",
// @endif

// @if stylus
"gulp-stylus": "^3.0.0",
"gulp-stylus": "^3.0.1",
// @endif

// @if htmlmin
Expand All @@ -49,8 +49,8 @@
"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",
"serve-static": "^1.16.2",
"socket.io": "^4.8.0",
"open": "^8.4.0",
"server-destroy": "^1.0.1",

Expand Down
1 change: 1 addition & 0 deletions common/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"no-unused-vars": 0,
// @if typescript
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
// @endif
"no-prototype-builtins": 0,
"no-console": 0,
Expand Down
2 changes: 1 addition & 1 deletion common/babel.config.json__if_babel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"plugins": [
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
["@babel/plugin-proposal-class-properties", { "loose": true }],
["@babel/plugin-transform-class-properties", { "loose": true }],
"@babel/plugin-syntax-dynamic-import"
]
}
31 changes: 15 additions & 16 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,40 @@
"license": "MIT",
// @if ! plugin
"dependencies": {
"aurelia-bootstrapper": "^2.4.0",
"aurelia-bootstrapper": "^2.4.1",
"aurelia-animator-css": "^1.0.4"
},
// @endif
"devDependencies": {
"eslint": "^8.43.0",
"aurelia-cli": "^3.0.1",
"aurelia-cli": "^3.0.3",
"aurelia-testing": "^1.1.0",
"gulp": "^4.0.2",
"gulp-eslint-new": "^1.8.1",
"gulp-eslint-new": "^2.3.0",
"minimatch": "^5.1.2",
"promise-polyfill": "^8.3.0",

// @if plugin
"aurelia-bootstrapper": "^2.4.0",
"aurelia-bootstrapper": "^2.4.1",
"aurelia-animator-css": "^1.0.4",
// @endif

// @if babel
"@babel/eslint-parser": "^7.22.5",
"@babel/plugin-proposal-decorators": "^7.22.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/eslint-parser": "^7.25.8",
"@babel/plugin-proposal-decorators": "^7.25.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.22.5",
"@babel/core": "^7.22.5",
"@babel/register": "^7.18.9",
"regenerator-runtime": "^0.13.11",
"@babel/preset-env": "^7.25.8",
"@babel/core": "^7.25.8",
"@babel/register": "^7.25.7",
"regenerator-runtime": "^0.14.1",
// @endif

// @if typescript
"typescript": "^5.1.6",
"tslib": "^2.6.0",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"typescript": "^5.6.3",
"tslib": "^2.8.0",
"@types/node": "^22.7.8",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
// @endif
},
// @if postcss || babel
Expand Down
88 changes: 36 additions & 52 deletions e2e-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
const spawn = require('cross-spawn');
const fs = require('fs');
const path = require('path');
const del = require('del');
const test = require('ava');
const puppeteer = require('puppeteer');
const kill = require('tree-kill');

async function delay(secs) {
return new Promise((resolve) => {
setTimeout(resolve, secs);
});
}

const isWin32 = process.platform === 'win32';
const dir = __dirname;

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

// Somehow taskkill on windows would not send SIGTERM signal to proc,
Expand All @@ -32,7 +35,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);
Expand All @@ -41,8 +44,9 @@ 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});
proc.on('exit', (code, signal) => {
const proc = spawn(cmd, args, {env, cwd});
proc.on('exit', async (code, signal) => {
await delay(1);
if (code && signal !== 'SIGTERM' && !win32Killed.has(proc.pid)) {
reject(new Error(cmd + ' ' + args.join(' ') + ' process exit code: ' + code + ' signal: ' + signal));
} else {
Expand All @@ -55,33 +59,26 @@ function run(command, dataCB, errorCB) {
if (dataCB) {
dataCB(data, () => {
console.log(`-- kill "${command}"`);
killProc(proc);
setTimeout(() => killProc(proc), 500);
});
}
});
proc.stderr.on('data', data => {
process.stderr.write(data);
// Ingore webpack warning
if (data.toString().includes('DeprecationWarning')) return;
// Skip webpack5 deprecation warning.
if (data.toString().toLowerCase().includes('deprecation')) return;
// Skip BABEL warning (used by dumber bundler) when reading @aurelia/runtime-html
if (data.toString().includes('The code generator has deoptimised the styling')) return;
if (errorCB) {
errorCB(data, () => {
console.log(`-- kill "${command}"`);
killProc(proc);
setTimeout(() => killProc(proc), 500);
});
}
})
});
}

async function takeScreenshot(url, filePath) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);
await new Promise(r => setTimeout(r, 6000));
await page.screenshot({path: filePath});
await browser.close();
}

const targetCLI = (process.env.TARGET_CLI || null);

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

test.serial(title, async t => {
console.log(title);
process.chdir(folder);

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

patchPackageJson(appFolder, targetCLI);

console.log('-- npm i');
await run('npm i');
await run('npm i', appFolder);
t.pass('installed deps');

console.log('-- npm test');
await run('npm test');
await run('npm test', appFolder);
t.pass('finished unit tests');

console.log('-- npx au generate attribute NewThing');
await run('npx au generate attribute NewThing', null,
await run('npx au generate attribute NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate attribute failed: ' + data.toString());
}
);
t.pass('generated attribute');

console.log('-- npx au generate component NewThing .');
await run('npx au generate component NewThing .', null,
await run('npx au generate component NewThing .', appFolder, null,
(data, kill) => {
t.fail('au generate component failed: ' + data.toString());
}
);
t.pass('generated component');

console.log('-- npx au generate element NewThing');
await run('npx au generate element NewThing', null,
await run('npx au generate element NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate element failed: ' + data.toString());
}
);
t.pass('generated element');

console.log('-- npx au generate value-converter NewThing');
await run('npx au generate value-converter NewThing', null,
await run('npx au generate value-converter NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate value-converter failed: ' + data.toString());
}
);
t.pass('generated value-converter');

console.log('-- npx au generate binding-behavior NewThing');
await run('npx au generate binding-behavior NewThing', null,
await run('npx au generate binding-behavior NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate binding-behavior failed: ' + data.toString());
}
);
t.pass('generated binding-behavior');

console.log('-- npx au generate task NewThing');
await run('npx au generate task NewThing', null,
await run('npx au generate task NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate task failed: ' + data.toString());
}
);
t.pass('generated task');

console.log('-- npx au generate generator NewThing');
await run('npx au generate generator NewThing', null,
await run('npx au generate generator NewThing', appFolder, null,
(data, kill) => {
t.fail('au generate generator failed: ' + data.toString());
}
);
t.pass('generated generator');

console.log('-- npm run build');
await run('npm run build', null,
await run('npm run build', appFolder, null,
(data, kill) => {
t.fail('build failed: ' + data.toString());
}
Expand All @@ -242,36 +237,25 @@ skeletons.forEach((features, i) => {
if (!m) return;
const url = m[1];
t.pass(m[0]);

try {
if (!process.env.GITHUB_ACTIONS) {
console.log('-- take screenshot');
await takeScreenshot(url, path.join(folder, appName + '.png'));
}
kill();
} catch (e) {
t.fail(e.message);
kill();
}
kill();
};

// Webpack5 now prints Loopback: http://localhost:5000 in stderr!
await run('npm start', runE2e, runE2e);
await run('npm start', appFolder, runE2e, runE2e);

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);
}

if (process.platform === 'linux' && features.includes('docker')) {
console.log('-- npm run docker:build');
await run(`npm run docker:build`);
await run(`npm run docker:build`, appFolder);
t.pass('passed docker:build');
}

console.log('-- remove folder ' + appName);
process.chdir(folder);
await del(appFolder);
await fs.promises.rm(appFolder, {recursive: true});
});
});
Loading

0 comments on commit a8edce7

Please sign in to comment.