diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8e2e5f3..318bc67 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,13 +11,20 @@ jobs: config: - runs-on: ubuntu-latest node-version: '18.12.0' # LTS + CODE_TEST: 'test-legacy' - runs-on: ubuntu-latest - node-version: '18.18.0' # LTS (current) + node-version: '18.18.2' # LTS + CODE_TEST: 'test-legacy' + + - runs-on: ubuntu-latest + node-version: '20.9.0' # LTS (current) + CODE_TEST: 'test-legacy' CODE_CHECK: 1 - runs-on: ubuntu-latest - node-version: '20.8.0' + node-version: '21.1.0' # Latest + CODE_TEST: 'test' runs-on: ${{ matrix.config.runs-on }} @@ -36,11 +43,11 @@ jobs: - name: Build run: npm run build - - name: Test CJS - run: npm run test:cjs - - name: Test ESM - run: npm run test:esm + run: npm run ${{ matrix.config.CODE_TEST }}:esm + + - name: Test CJS + run: npm run ${{ matrix.config.CODE_TEST }}:cjs - name: Lint run: npm run lint @@ -63,7 +70,7 @@ jobs: - name: Node uses: actions/setup-node@v3 with: - node-version: '18.18.0' + node-version: '20.9.0' registry-url: https://registry.npmjs.org/ - name: Dependencies diff --git a/.nvmrc b/.nvmrc index 02c8b48..f3f52b4 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.0 +20.9.0 diff --git a/package.json b/package.json index 726edef..e5f2aa0 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,15 @@ "build:esm": "babel --env-name esm -x .ts -s true -d esm --out-file-extension .mjs src", "build:cjs": "babel --env-name cjs -x .ts -s true -d cjs --out-file-extension .js src", "build": "npm run build:dts && npm run build:esm && npm run build:cjs", - "test:esm": "node -r source-map-support/register --test esm", - "test:cjs": "node -r source-map-support/register --test cjs", + "test-legacy:esm": "node -r source-map-support/register --test esm", + "test-legacy:cjs": "node -r source-map-support/register --test cjs", + "test-legacy": "npm run test-legacy:esm && npm run test-legacy:cjs", + "test:esm": "node -r source-map-support/register --test 'esm/**/*.mjs'", + "test:cjs": "node -r source-map-support/register --test 'cjs/**/*.js'", "test": "npm run test:esm && npm run test:cjs", + "all-legacy:esm": "npm run clean && npm run build:esm && npm run test-legacy:esm && npm run lint && npm run formatted", + "all-legacy:cjs": "npm run clean && npm run build:cjs && npm run test-legacy:cjs && npm run lint && npm run formatted", + "all-legacy": "npm run clean && npm run build && npm run test-legacy && npm run lint && npm run formatted", "all:esm": "npm run clean && npm run build:esm && npm run test:esm && npm run lint && npm run formatted", "all:cjs": "npm run clean && npm run build:cjs && npm run test:cjs && npm run lint && npm run formatted", "all": "npm run clean && npm run build && npm run test && npm run lint && npm run formatted",