Skip to content

Commit d8f9ec3

Browse files
authored
Merge pull request #24 from GSTJ/chore/magic-tooling
chore: migrate to the magic tooling stack
2 parents 3330f5e + fd29026 commit d8f9ec3

29 files changed

Lines changed: 12364 additions & 9205 deletions

.eslintrc.js

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

.github/workflows/ci.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,32 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
checks:
17+
# Install, lint, format and typecheck are the shared workflow's; node comes
18+
# from .nvmrc and pnpm from the `packageManager` field.
19+
uses: GSTJ/magic/.github/workflows/ci.yml@main
20+
with:
21+
build-command: pnpm run build
22+
test-command: pnpm run test
23+
# `build/` is generated, so the only way to know the published tarball
24+
# isn't empty is to pack one.
25+
extra-command: npm pack --dry-run
26+
# Nothing here uses turbo.
27+
turbo-cache: false
28+
29+
# master's ruleset requires a status check literally named "Lint, test and
30+
# build", and a called workflow reports as "<caller job> / <called job>", so
31+
# it can never produce that context. This job carries the name instead. It is
32+
# deletable the day the ruleset is pointed at the shared workflow's check —
33+
# a repository settings change, which is not this PR's to make.
34+
#
35+
# `if: always()` matters: a job skipped because its dependency failed reports
36+
# as skipped, and a skipped required check counts as passed.
1637
validate:
1738
name: Lint, test and build
39+
needs: checks
40+
if: always()
1841
runs-on: ubuntu-latest
1942
steps:
20-
- uses: actions/checkout@v7
21-
22-
- uses: actions/setup-node@v7
23-
with:
24-
node-version: 24
25-
cache: yarn
26-
27-
# `prepare` runs `expo-module prepare`, so this already builds once.
28-
- run: yarn install --frozen-lockfile
29-
30-
# universe sets most of its rules to `warn`, so without this the step
31-
# passes no matter what eslint finds.
32-
- run: yarn lint --max-warnings 0
33-
34-
- run: yarn test
35-
36-
- run: yarn build
37-
38-
# `build/` is generated, so the only way to know the published tarball
39-
# isn't empty is to pack one.
40-
- name: Check the tarball contents
41-
run: npm pack --dry-run
43+
- name: Fail unless the shared workflow passed
44+
run: '[ "${{ needs.checks.result }}" = "success" ]'

.github/workflows/release.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,28 @@ jobs:
3434
# last one to work out the bump and the changelog entries.
3535
fetch-depth: 0
3636

37+
- uses: pnpm/action-setup@v4
38+
3739
# No `registry-url` here on purpose: it writes an `.npmrc` holding a
38-
# literal `${NODE_AUTH_TOKEN}`, and the `cache: yarn` probe then runs
39-
# `yarn cache dir`, which dies on "Failed to replace env in config".
40-
# The Release step below writes the token itself.
40+
# literal `${NODE_AUTH_TOKEN}`, which the package-manager probes behind
41+
# `cache:` choke on. The Release step below writes the token itself.
4142
- uses: actions/setup-node@v7
4243
with:
43-
node-version: 24
44-
cache: yarn
44+
node-version-file: .nvmrc
45+
cache: pnpm
46+
47+
# `prepare` builds, so this already produces `build/` once.
48+
- run: pnpm install --frozen-lockfile
49+
50+
- run: pnpm run lint
4551

46-
- run: yarn install --frozen-lockfile
52+
- run: pnpm run format
4753

48-
- run: yarn lint --max-warnings 0
54+
- run: pnpm run typecheck
4955

50-
- run: yarn test
56+
- run: pnpm run test
5157

52-
- run: yarn build
58+
- run: pnpm run build
5359

5460
# Publishes to npm, pushes the annotated tag and creates the GitHub
5561
# release. The version bump commit stays local, see .release-it.cjs.
@@ -73,7 +79,7 @@ jobs:
7379
args="$args --dry-run"
7480
fi
7581
76-
yarn release $args
82+
pnpm run release $args
7783
7884
echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
7985

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
node_modules
22
.idea
33

4-
# Generated by `expo-module build`, which the `prepare` script runs on every
4+
# Generated by the `build` script, which the `prepare` script runs on every
55
# install and on publish.
66
build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.release-it.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ module.exports = {
4141
header: "# Changelog",
4242
// Each release leaves a `chore(release)` bump commit and the merge commit
4343
// that lands it. Neither is worth a changelog line.
44-
commitFilter: (commit) => !/^chore\(release\)/.test(commit.header ?? ""),
44+
commitFilter: (commit) =>
45+
!(commit.header ?? "").startsWith("chore(release)"),
4546
preset: {
4647
name: "conventionalcommits",
4748
types: [

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Before installing this package, you need completely remove Expo updates from you
2727

2828
After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`:
2929

30-
3130
```json
3231
{
3332
"expo": {

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('expo-module-scripts/jest-preset-plugin');
1+
module.exports = require("expo-module-scripts/jest-preset-plugin");

oxfmt.config.mts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// magic-oxfmt-config ignores `**/CHANGELOG.md` itself, so the local
2+
// re-declaration this file used to carry is gone. The `withoutIgnorePatterns`
3+
// opt-out 1.2.0 added is for repos that hand-write their changelog; this one's
4+
// is generated by @release-it/conventional-changelog, so the default is right.
5+
export { default } from "magic-oxfmt-config";

oxlint.config.mts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { extendConfig } from "magic-oxlint-config";
2+
import base from "magic-oxlint-config/base";
3+
4+
// `extendConfig` flattens the preset into a single config rather than going
5+
// through oxlint's `extends`, which is the only other supported shape and
6+
// cannot carry `ignorePatterns` — oxlint has no per-override ignore, so
7+
// magic-oxlint-config 1.2.0 stopped documenting `extends` entirely. Flattening
8+
// carries the ignore list and the preset's `env`/`globals` by construction,
9+
// with nothing local to drift from the preset.
10+
export default extendConfig(base, {
11+
overrides: [
12+
{
13+
// `${version}` and friends in this file are release-it's own template
14+
// syntax, interpolated by release-it at release time. They are supposed
15+
// to reach it uninterpolated, so a real template literal would be the bug.
16+
files: [".release-it.cjs"],
17+
rules: { "no-template-curly-in-string": "off" },
18+
},
19+
],
20+
});

0 commit comments

Comments
 (0)