Skip to content

Commit 084a25a

Browse files
authored
Merge pull request #48 from ember-codemods/pnpm
Drop support for node < 20, start using pnpm, update puppeteer, and swap to vitest
2 parents cf2bb9b + b2e9f86 commit 084a25a

File tree

13 files changed

+15921
-14400
lines changed

13 files changed

+15921
-14400
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,32 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
build:
11-
10+
lint:
1211
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: pnpm
19+
- run: pnpm install
20+
- run: pnpm lint
1321

22+
build:
23+
runs-on: ubuntu-latest
1424
strategy:
25+
fail-fast: false
1526
matrix:
16-
node-version: [14.x, 16.x, 18.x]
27+
node-version: [20.x, 22.x, 24.x]
1728

1829
steps:
19-
- uses: actions/checkout@v2
20-
- uses: volta-cli/action@v1
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
- run: yarn install --frozen-lockfile
24-
- run: yarn lint:js
25-
- run: yarn test
30+
- uses: actions/checkout@v4
31+
- uses: pnpm/action-setup@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: pnpm
36+
- run: pnpm install
37+
- run: pnpm dlx puppeteer browsers install chrome
38+
- run: pnpm test

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/gather/gather-single-telemetry.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const puppeteer = require('puppeteer');
22
const { setTelemetryWithKey } = require('../utils/telemetry');
33

4-
const DEFAULT_PUPPETEER_ARGS = { ignoreHTTPSErrors: true };
4+
const DEFAULT_PUPPETEER_ARGS = {
5+
ignoreHTTPSErrors: true,
6+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
7+
};
58

69
module.exports = async function gatherSingleTelemetry(url, options = {}, gatherFn, ...args) {
710
const browser = await puppeteer.launch(DEFAULT_PUPPETEER_ARGS);

lib/gather/gather-single-telemetry.test.js renamed to lib/gather/gather-single-telemetry.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const { getTelemetry } = require('../utils/telemetry');
44
const APP_TIMEOUT = 100000;
55
const TELEMETRY_KEY = 'single-telemetry';
66

7+
import { describe, beforeAll, test, afterAll, expect } from 'vitest';
8+
79
function resolverWithoutArgs() {
810
return { foo: 'bar' };
911
}

lib/gather/gather-telemetry.test.js renamed to lib/gather/gather-telemetry.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const { getTelemetry } = require('../utils/telemetry');
44
const analyzeEmberObject = require('../gather/analyze-ember-object');
55
const APP_TIMEOUT = 100000;
66

7+
import { describe, test, beforeAll, afterAll, expect } from 'vitest';
8+
79
function helper(possibleEmberObject) {
810
if (
911
possibleEmberObject &&

lib/utils/get-module-path-for.test.js renamed to lib/utils/get-module-path-for.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { getModulePathFor } = require('./get-module-path-for');
22

3+
import { describe, test, expect } from 'vitest';
4+
35
describe('getModulePathFor', () => {
46
const addonPaths = {
57
'/User/whomever/some-app/lib/special-sauce': 'special-sauce',

lib/utils/telemetry.test.js renamed to lib/utils/telemetry.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { getTelemetry, setTelemetry, setTelemetryWithKey, getTelemetryFor } = require('./telemetry');
22

3+
import { describe, test, expect } from 'vitest';
4+
35
describe('get/set Telemetry', () => {
46
test('can get the set telemetry', () => {
57
let fakeTelemetry = {

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
],
1212
"main": "lib/index.js",
1313
"scripts": {
14-
"lint:js": "eslint .",
15-
"test": "jest . --verbose --no-watchman --runInBand --forceExit"
14+
"lint": "eslint .",
15+
"test": "vitest --no-file-parallelism"
1616
},
1717
"jest": {
1818
"testEnvironment": "node"
1919
},
2020
"dependencies": {
2121
"fs-extra": "^8.1.0",
2222
"git-repo-info": "^2.1.0",
23-
"puppeteer": "^15.3.2",
23+
"puppeteer": "^24.22.0",
2424
"sync-disk-cache": "^1.3.3",
2525
"walk-sync": "^2.0.2"
2626
},
@@ -30,13 +30,13 @@
3030
"eslint-plugin-node": "^10.0.0",
3131
"eslint-plugin-prettier": "^3.1.1",
3232
"execa": "^2.1.0",
33-
"jest": "^24.9.0",
3433
"prettier": "^1.18.2",
3534
"release-it": "^14.2.1",
36-
"release-it-lerna-changelog": "^3.1.0"
35+
"release-it-lerna-changelog": "^3.1.0",
36+
"vitest": "^3.2.4"
3737
},
3838
"engines": {
39-
"node": "10.* || >= 12.*"
39+
"node": "20.* || 22.* || >= 24.*"
4040
},
4141
"publishConfig": {
4242
"registry": "https://registry.npmjs.org"
@@ -56,8 +56,5 @@
5656
"tokenRef": "GITHUB_AUTH"
5757
}
5858
},
59-
"volta": {
60-
"node": "12.21.0",
61-
"yarn": "1.22.10"
62-
}
59+
"packageManager": "pnpm@10.17.0+sha512.fce8a3dd29a4ed2ec566fb53efbb04d8c44a0f05bc6f24a73046910fb9c3ce7afa35a0980500668fa3573345bd644644fa98338fa168235c80f4aa17aa17fbef"
6360
}

0 commit comments

Comments
 (0)