Skip to content

Commit

Permalink
Merge pull request #26 from dumberjs/deps
Browse files Browse the repository at this point in the history
chore: upgrade deps
  • Loading branch information
3cp authored May 18, 2024
2 parents 59cf52b + 919112b commit 964362c
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 125 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, 22]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
6 changes: 3 additions & 3 deletions .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 All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .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 All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .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 All @@ -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
Expand Down
108 changes: 56 additions & 52 deletions __test__/transforms.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(), '<p></p>');
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(), '<p></p>');
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('<p></p>')
}));
jsExt.end(new Vinyl({
path: 'test/b.html',
contents: Buffer.from('<p></p>')
}));
});
});

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(), '<p></p>');
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(), '<p></p>');
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('<p></p>')
}));
jsExt.end(new Vinyl({
path: 'test/b.html',
contents: Buffer.from('<p></p>')
}));
});
});
4 changes: 2 additions & 2 deletions common/babel.config.json__if_babel
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
46 changes: 23 additions & 23 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
25 changes: 11 additions & 14 deletions e2e-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand Down Expand Up @@ -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());
}
Expand All @@ -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;
Expand All @@ -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);
});
});
4 changes: 2 additions & 2 deletions jasmine/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Loading

0 comments on commit 964362c

Please sign in to comment.