diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0897335..d9b5b32 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -22,6 +22,7 @@ module.exports = getESLintConfig({ rules: { 'no-use-before-define': 0, 'import/named': 0, + 'import/no-unresolved': 0, '@typescript-eslint/no-shadow': 0, '@typescript-eslint/ban-ts-comment': 0 // We do need our ts-ignores } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e567b4c..82b7922 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: - v* +permissions: + contents: read + jobs: check_branch: runs-on: ubuntu-22.04 @@ -12,7 +15,7 @@ jobs: should_build: ${{ steps.permitted.outputs.result }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Fetch remote branches run: | @@ -30,7 +33,7 @@ jobs: echo "result=${result}" >> "$GITHUB_OUTPUT" release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: check_branch permissions: contents: write @@ -42,19 +45,34 @@ jobs: NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version-file: '.nvmrc' + + - name: Enable Corepack / Yarn 4 + run: | + corepack enable + corepack prepare yarn@4.13.0 --activate + yarn -v + + - name: Cache Yarn Berry artifacts + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: - cache: 'yarn' + path: | + ~/.yarn/berry/cache + .yarn/install-state.gz + key: ${{ runner.os }}-yarn4-${{ hashFiles('yarn.lock', '.yarnrc.yml', 'package.json') }} - name: Install dependencies - run: yarn + run: yarn install --immutable - name: Build packages run: npm run build - - - name: Run tests from transpiled code - run: npx ocular-test dist + + - name: Run release test suite + run: yarn test - name: Login to NPM run: npm config set "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03bb1ba..0e00d4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,41 +7,60 @@ on: - master pull_request: +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-22.04 + timeout-minutes: 15 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Setup Node (with Corepack) + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - cache: "yarn" + node-version-file: '.nvmrc' - - name: Install dependencies + - name: Enable Corepack / Yarn 4 run: | - yarn install - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false + corepack enable + corepack prepare yarn@4.13.0 --activate + yarn -v + + - name: Cache Yarn Berry artifacts + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/.yarn/berry/cache + .yarn/install-state.gz + key: ${{ runner.os }}-yarn4-${{ hashFiles('yarn.lock', '.yarnrc.yml', 'package.json') }} + + - name: Install dependencies + run: yarn install --immutable - name: Build code - run: | - yarn build + run: yarn build - name: Run tests - run: | - yarn test ci - + run: yarn test ci + - name: Run lint - run: | - yarn lint + run: yarn lint - name: Build website run: | cd website - yarn install + yarn install --immutable yarn build - - name: Coveralls - uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # v1.2.5 + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 5847d22..9c409c4 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -5,6 +5,9 @@ on: branches: - '*-release' +permissions: + contents: read + jobs: check_branch: runs-on: ubuntu-22.04 @@ -12,7 +15,7 @@ jobs: should_deploy: ${{ endsWith(github.ref, steps.get_version.outputs.latest) }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Get version id: get_version @@ -23,7 +26,7 @@ jobs: echo "latest=${LATEST}-release" >> "$GITHUB_OUTPUT" deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: check_branch permissions: @@ -32,25 +35,41 @@ jobs: if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_deploy }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} - - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1 + + - name: Setup Node (with Corepack) + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version-file: '.nvmrc' + + - name: Enable Corepack / Yarn 4 + run: | + corepack enable + corepack prepare yarn@4.13.0 --activate + yarn -v + + - name: Cache Yarn Berry artifacts + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: - cache: 'yarn' + path: | + ~/.yarn/berry/cache + .yarn/install-state.gz + key: ${{ runner.os }}-yarn4-${{ hashFiles('yarn.lock', '.yarnrc.yml', 'package.json') }} - name: Install dependencies run: | - yarn - (cd website && yarn) + yarn install --immutable + (cd website && yarn install --immutable) - name: Build website run: (cd website && yarn build) - name: Deploy - uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # 4.8.0 with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: website/build - CLEAN: true + token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} + branch: gh-pages + folder: website/build + clean: true diff --git a/.gitignore b/.gitignore index ba49516..85a9f34 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ !.yarn/releases !.yarn/sdks !.yarn/versions +*/**/.yarn/* */**/yarn.lock !website/yarn.lock @@ -37,4 +38,3 @@ tsconfig.tsbuildinfo .idea *.zip *.rar - diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..32a2d7b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.22.1 diff --git a/package.json b/package.json index 875dd56..b92afb4 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "@probe.gl/bench": "^4.0.0", "@turf/destination": "^6.0.1", "@types/tape-promise": "^4.0.1", - "@vis.gl/dev-tools": "1.0.0-alpha.19", - "@vis.gl/ts-plugins": "1.0.0-alpha.19", + "@vis.gl/dev-tools": "^1.0.2", + "@vis.gl/ts-plugins": "^1.0.2", "pre-commit": "^1.2.2", "puppeteer": "^22.0.0", "tap-spec": "^5.0.0" @@ -44,8 +44,5 @@ "pre-commit": [ "test-pre-commit" ], - "volta": { - "node": "20.15.1", - "yarn": "4.6.0" - } + "packageManager": "yarn@4.13.0" } diff --git a/website/.yarn/install-state.gz b/website/.yarn/install-state.gz deleted file mode 100644 index b11e057..0000000 Binary files a/website/.yarn/install-state.gz and /dev/null differ diff --git a/website/package.json b/website/package.json index bc5becf..226ff10 100644 --- a/website/package.json +++ b/website/package.json @@ -26,9 +26,5 @@ "browserslist": [ ">0.2% and supports async-functions", "not dead" - ], - "volta": { - "node": "20.15.1", - "yarn": "4.6.0" - } + ] } diff --git a/yarn.lock b/yarn.lock index db9a948..9533978 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2049,9 +2049,9 @@ __metadata: languageName: node linkType: hard -"@vis.gl/dev-tools@npm:1.0.0-alpha.19": - version: 1.0.0-alpha.19 - resolution: "@vis.gl/dev-tools@npm:1.0.0-alpha.19" +"@vis.gl/dev-tools@npm:^1.0.2": + version: 1.0.2 + resolution: "@vis.gl/dev-tools@npm:1.0.2" dependencies: "@esbuild-plugins/node-globals-polyfill": "npm:^0.2.0" "@esbuild-plugins/node-modules-polyfill": "npm:^0.2.0" @@ -2092,19 +2092,19 @@ __metadata: ocular-metrics: scripts/metrics.js ocular-publish: scripts/publish.js ocular-test: scripts/test.js - checksum: 10c0/7fc365a758603a5a87cf28e00d8aa7761301519fc09be1f62d344743525940b176ae3e3b997526639b5346ba4ee64f75bb2e7ac9bf7633420fa6b00859bbb271 + checksum: 10c0/692d8d5c2d77932b2c8e0b500b09c266633090154a5bdb6cf990f40494ea8a3772b35b29530b8424e5d18faa4898f1769e0daebffab80aec4e5b8f2317d55b48 languageName: node linkType: hard -"@vis.gl/ts-plugins@npm:1.0.0-alpha.19": - version: 1.0.0-alpha.19 - resolution: "@vis.gl/ts-plugins@npm:1.0.0-alpha.19" +"@vis.gl/ts-plugins@npm:^1.0.2": + version: 1.0.2 + resolution: "@vis.gl/ts-plugins@npm:1.0.2" dependencies: "@luma.gl/constants": "npm:^9.0.0" minimatch: "npm:^3.0.0" ts-patch: "npm:^3.1.2" typescript: "npm:^5.2.2" - checksum: 10c0/967b8952c8a449da008db51a0b0cc8d0c50e9ac571d6c1379c4407d276e8bd34b634829ad001c7604412fe09c7d09bc88ae03dc4fe8a48bad4c81c19f61ba55b + checksum: 10c0/995a27df25124f10971edaf2cbd547664b90270357b4f59bfa23e32e2dd1f973a4cb3048a00bf7a108f38a78c107fb7af5c3e231aac647be07537ff6cf90eff7 languageName: node linkType: hard @@ -6907,8 +6907,8 @@ __metadata: "@probe.gl/bench": "npm:^4.0.0" "@turf/destination": "npm:^6.0.1" "@types/tape-promise": "npm:^4.0.1" - "@vis.gl/dev-tools": "npm:1.0.0-alpha.19" - "@vis.gl/ts-plugins": "npm:1.0.0-alpha.19" + "@vis.gl/dev-tools": "npm:^1.0.2" + "@vis.gl/ts-plugins": "npm:^1.0.2" pre-commit: "npm:^1.2.2" puppeteer: "npm:^22.0.0" tap-spec: "npm:^5.0.0"