Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintrc.js

This file was deleted.

47 changes: 25 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,32 @@ concurrency:
cancel-in-progress: true

jobs:
checks:
# Install, lint, format and typecheck are the shared workflow's; node comes
# from .nvmrc and pnpm from the `packageManager` field.
uses: GSTJ/magic/.github/workflows/ci.yml@main
with:
build-command: pnpm run build
test-command: pnpm run test
# `build/` is generated, so the only way to know the published tarball
# isn't empty is to pack one.
extra-command: npm pack --dry-run
# Nothing here uses turbo.
turbo-cache: false

# master's ruleset requires a status check literally named "Lint, test and
# build", and a called workflow reports as "<caller job> / <called job>", so
# it can never produce that context. This job carries the name instead. It is
# deletable the day the ruleset is pointed at the shared workflow's check —
# a repository settings change, which is not this PR's to make.
#
# `if: always()` matters: a job skipped because its dependency failed reports
# as skipped, and a skipped required check counts as passed.
validate:
name: Lint, test and build
needs: checks
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-node@v7
with:
node-version: 24
cache: yarn

# `prepare` runs `expo-module prepare`, so this already builds once.
- run: yarn install --frozen-lockfile

# universe sets most of its rules to `warn`, so without this the step
# passes no matter what eslint finds.
- run: yarn lint --max-warnings 0

- run: yarn test

- run: yarn build

# `build/` is generated, so the only way to know the published tarball
# isn't empty is to pack one.
- name: Check the tarball contents
run: npm pack --dry-run
- name: Fail unless the shared workflow passed
run: '[ "${{ needs.checks.result }}" = "success" ]'
26 changes: 16 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,28 @@ jobs:
# last one to work out the bump and the changelog entries.
fetch-depth: 0

- uses: pnpm/action-setup@v4

# No `registry-url` here on purpose: it writes an `.npmrc` holding a
# literal `${NODE_AUTH_TOKEN}`, and the `cache: yarn` probe then runs
# `yarn cache dir`, which dies on "Failed to replace env in config".
# The Release step below writes the token itself.
# literal `${NODE_AUTH_TOKEN}`, which the package-manager probes behind
# `cache:` choke on. The Release step below writes the token itself.
- uses: actions/setup-node@v7
with:
node-version: 24
cache: yarn
node-version-file: .nvmrc
cache: pnpm

# `prepare` builds, so this already produces `build/` once.
- run: pnpm install --frozen-lockfile

- run: pnpm run lint

- run: yarn install --frozen-lockfile
- run: pnpm run format

- run: yarn lint --max-warnings 0
- run: pnpm run typecheck

- run: yarn test
- run: pnpm run test

- run: yarn build
- run: pnpm run build

# Publishes to npm, pushes the annotated tag and creates the GitHub
# release. The version bump commit stays local, see .release-it.cjs.
Expand All @@ -73,7 +79,7 @@ jobs:
args="$args --dry-run"
fi

yarn release $args
pnpm run release $args

echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
.idea

# Generated by `expo-module build`, which the `prepare` script runs on every
# Generated by the `build` script, which the `prepare` script runs on every
# install and on publish.
build
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
3 changes: 2 additions & 1 deletion .release-it.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ module.exports = {
header: "# Changelog",
// Each release leaves a `chore(release)` bump commit and the merge commit
// that lands it. Neither is worth a changelog line.
commitFilter: (commit) => !/^chore\(release\)/.test(commit.header ?? ""),
commitFilter: (commit) =>
!(commit.header ?? "").startsWith("chore(release)"),
preset: {
name: "conventionalcommits",
types: [
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Before installing this package, you need completely remove Expo updates from you

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`:


```json
{
"expo": {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('expo-module-scripts/jest-preset-plugin');
module.exports = require("expo-module-scripts/jest-preset-plugin");
5 changes: 5 additions & 0 deletions oxfmt.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// magic-oxfmt-config ignores `**/CHANGELOG.md` itself, so the local
// re-declaration this file used to carry is gone. The `withoutIgnorePatterns`
// opt-out 1.2.0 added is for repos that hand-write their changelog; this one's
// is generated by @release-it/conventional-changelog, so the default is right.
export { default } from "magic-oxfmt-config";
20 changes: 20 additions & 0 deletions oxlint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { extendConfig } from "magic-oxlint-config";
import base from "magic-oxlint-config/base";

// `extendConfig` flattens the preset into a single config rather than going
// through oxlint's `extends`, which is the only other supported shape and
// cannot carry `ignorePatterns` — oxlint has no per-override ignore, so
// magic-oxlint-config 1.2.0 stopped documenting `extends` entirely. Flattening
// carries the ignore list and the preset's `env`/`globals` by construction,
// with nothing local to drift from the preset.
export default extendConfig(base, {
overrides: [
{
// `${version}` and friends in this file are release-it's own template
// syntax, interpolated by release-it at release time. They are supposed
// to reach it uninterpolated, so a real template literal would be the bug.
files: [".release-it.cjs"],
rules: { "no-template-curly-in-string": "off" },
},
],
});
52 changes: 29 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "react-native-code-push-plugin",
"version": "1.0.11",
"description": "Config plugin to auto configure react-native-code-push on prebuild",
"main": "build/index.js",
"types": "build/index.d.ts",
"sideEffects": false,
"keywords": [
"expo",
"react-native",
"react-native-code-push"
],
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -14,41 +16,45 @@
"build",
"app.plugin.js"
],
"sideEffects": false,
"main": "build/index.js",
"types": "build/index.d.ts",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "expo-module build",
"build": "tsc --project tsconfig.build.json",
"clean": "expo-module clean",
"lint": "expo-module lint",
"test": "expo-module test",
"prepare": "expo-module prepare",
"prepublishOnly": "expo-module prepublishOnly",
"lint": "oxlint --report-unused-disable-directives --deny-warnings",
"lint:fix": "oxlint --report-unused-disable-directives --deny-warnings --fix",
"format": "oxfmt --check .",
"format:fix": "oxfmt .",
"typecheck": "tsc --noEmit",
"test": "jest",
"prepare": "pnpm run build",
"release": "release-it",
"expo-module": "expo-module"
},
"keywords": [
"react-native-code-push",
"react-native",
"expo"
],
"peerDependencies": {
"expo": ">=49.0.0"
},
"devDependencies": {
"@babel/core": "^7.29.7",
"@release-it/conventional-changelog": "^12.0.0",
"eslint": "^8.57.1",
"@types/jest": "^29.5.14",
"@types/node": "^24.13.3",
"expo": ">=49.0.0",
"expo-module-scripts": "^3.0.3",
"jest": "^29",
"prettier": "^3.9.6",
"release-it": "^21.0.0"
"magic-codemods": "^1.1.0",
"magic-oxfmt-config": "^1.2.0",
"magic-oxlint-config": "^1.2.0",
"magic-tsconfig": "^1.2.0",
"oxfmt": "0.60.0",
"oxlint": "1.75.0",
"release-it": "^21.0.0",
"typescript": "^5.9.3"
},
"resolutions": {
"**/@expo/plist/@xmldom/xmldom": "0.8.13",
"**/@typescript-eslint/typescript-estree/minimatch": "9.0.7",
"**/xcode/uuid": "11.1.1"
"peerDependencies": {
"expo": ">=49.0.0"
},
"packageManager": "pnpm@11.17.0",
"upstreamPackage": "react-native-code-push"
}
Loading
Loading