diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a42d41b..291be27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,9 @@ on: branches: - main name: release-please +env: + # renovate datasource=github-releases depName=jdx/mise + MISE_VERSION: 'v2025.11.7' jobs: release-please: runs-on: ubuntu-latest @@ -17,13 +20,15 @@ jobs: # these if statements ensure that a publication only occurs when # a new release is created: if: ${{ steps.release.outputs.release_created }} + - uses: jdx/mise-action@v3.5.1 + with: + version: ${{ env.MISE_VERSION }} + if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 with: - node-version: '22' + cache: yarn registry-url: 'https://registry.npmjs.org' if: ${{ steps.release.outputs.release_created }} - - run: corepack enable - if: ${{ steps.release.outputs.release_created }} - run: yarn --immutable if: ${{ steps.release.outputs.release_created }} - run: npm publish diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84af1e0..8115e13 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,37 +1,22 @@ name: Tests on: push: +env: + # renovate datasource=github-releases depName=jdx/mise + MISE_VERSION: 'v2025.11.8' jobs: - static-checks: - runs-on: ubuntu-latest + tests: + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 - - run: corepack enable - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 + - uses: actions/checkout@v5 + - uses: jdx/mise-action@v3.5.1 with: - cache: yarn - - run: yarn - - run: yarn tsc - - run: yarn lint --max-warnings=0 - # This command builds and then prints files which would be included in the published package - - run: yarn pack --dry-run - - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20, 22, 24] - steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 - - run: corepack enable + version: ${{ env.MISE_VERSION }} - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 with: - node-version: ${{ matrix.node-version }} cache: yarn - - run: yarn - - run: yarn test --coverage + - run: mise run ci - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - with: - flags: 'node_${{ matrix.node-version }}' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index f519164..2075dbd 100644 --- a/README.md +++ b/README.md @@ -146,11 +146,17 @@ let receiptIdChunks = expo.chunkPushNotificationReceiptIds(receiptIds); ## Developing -The source code is in the `src/` directory and babel is used to turn it into ES5 that goes in the `build/` directory. +The `mise.toml` file lets you run the full CI pipeline with [mise](https://mise.jdx.dev) and the command `mise run ci`. Each task in the pipeline can also be run separately. -To build, `yarn build`. +`mise install` or `mise en .` will also install tools for your current interactive shell, including [yarn](https://yarnpkg.com/). -To build and watch for changes, `yarn watch`. +Scripts in the `package.json` file can be run with either `yarn ` or `node --run `. + +The source code is in the `src/` directory and the build output is emitted in the `build/` directory. To build, run `yarn build`. + +To typecheck continuously, run `yarn tsc --watch`. + +To run tests, run `yarn test`. ## See Also diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..a4f3a7d --- /dev/null +++ b/mise.toml @@ -0,0 +1,35 @@ +[tools] +node = "24.11.0" + +[hooks] +postinstall = [ + "npx corepack enable", # corepack installs stubs for yarn + "yarn install", +] + +[tasks.yarn] +run = "yarn install --immutable" + +[tasks."checks:types"] +depends = ["yarn"] +run = "node --run tsc" + +[tasks."checks:publish"] +description = "This runs the prepack script, building the js files, then prints all file which would be included in the published package" +depends = ["yarn"] +run = "yarn npm publish --dry-run" + +[tasks."checks:test"] +depends = ["yarn"] +run = "node --run test" + +[tasks."checks:lint"] +depends = ["yarn"] +run = "node --run lint -- --max-warnings=0" + +[tasks.ci] +description = "Run all checks" +run = [ { tasks = ["checks:*"] } ] + +[settings] +experimental = true diff --git a/package.json b/package.json index 07f14b0..e682013 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,8 @@ "build": "yarn prepack", "lint": "eslint", "prepack": "tsc --project tsconfig.build.json", - "test": "jest", - "tsc": "tsc", - "watch": "tsc --watch" + "test": "jest --coverage", + "tsc": "tsc" }, "jest": { "coverageDirectory": "/../coverage", diff --git a/renovate.json b/renovate.json index 5fc82b1..1423296 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,10 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:best-practices", "helpers:pinGitHubActionDigestsToSemver"], + "extends": [ + "config:best-practices", + "customManagers:githubActionsVersions", + "helpers:pinGitHubActionDigestsToSemver" + ], "labels": ["dependencies"], "packageRules": [ {