From 089c20e3c20839b63c4269161e86472c1c0aa5cf Mon Sep 17 00:00:00 2001 From: Matthias Giger Date: Sun, 9 Jun 2024 17:27:25 +0200 Subject: [PATCH] fix(general): update plugin and use Bun for workflow release-npm --- .github/workflows/release.yml | 9 +++++---- .gitignore | 3 +-- package.json | 26 +++++++++++++------------- test/configuration.test.ts | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e731ae4..12760cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,11 +12,12 @@ jobs: contents: write steps: - uses: actions/checkout@v3 - - run: npm install --legacy-peer-deps + - uses: oven-sh/setup-bun@v1 + - run: bun install - name: 🧪 Test - run: npm test + run: bun run test - name: 🚧 Build - run: npm run build - - uses: tobua/release-npm-action@v2 + run: bun run build + - uses: tobua/release-npm-action@v3 with: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 81f695d..5ce4015 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ node_modules -package-lock.json -jsconfig.json +bun.lockb dist tsconfig.json test/fixture diff --git a/package.json b/package.json index 0c32399..a930028 100644 --- a/package.json +++ b/package.json @@ -27,37 +27,37 @@ } }, "dependencies": { - "@react-native-community/cli": "^12.3.2", - "@react-native/babel-preset": "^0.74.0", - "@react-native/eslint-config": "^0.74.0", - "@react-native/metro-config": "^0.73.3", - "@react-native/typescript-config": "^0.74.0", + "@react-native-community/cli": "^13.6.9", + "@react-native/babel-preset": "^0.74.84", + "@react-native/eslint-config": "^0.74.84", + "@react-native/metro-config": "^0.74.84", + "@react-native/typescript-config": "^0.74.84", "arg": "^5.0.2", "command-exists": "^1.2.9", "deepmerge": "^4.3.1", - "eslint": "^8.56.0", + "eslint": "^9.4.0", "eslint-plugin-prettier": "^5.1.3", "fast-glob": "^3.3.2", "global-cache-dir": "^6.0.0", "is-ci": "^3.0.1", "json5": "^2.2.3", "logua": "^3.0.3", - "pakag": "^3.1.1", + "pakag": "^3.1.3", "parse-gitignore": "^2.0.0", - "prettier": "^3.2.2", + "prettier": "^3.3.1", "prompts": "^2.4.2", - "semver": "^7.5.4", + "semver": "^7.6.2", "semver-sort": "^1.0.0", "skip-local-postinstall": "^2.0.4" }, "devDependencies": { "@types/command-exists": "^1.2.3", "@types/prompts": "^2.4.9", - "@types/semver": "^7.5.6", + "@types/semver": "^7.5.8", "jest-fixture": "^4.1.0", - "padua": "^2.0.8", - "react-native": "^0.73.2", - "vitest": "^1.2.0" + "padua": "^4.0.1", + "react-native": "^0.74.2", + "vitest": "^1.6.0" }, "peerDependencies": { "react-native": ">= 0.73" diff --git a/test/configuration.test.ts b/test/configuration.test.ts index 5031d3b..790dee0 100644 --- a/test/configuration.test.ts +++ b/test/configuration.test.ts @@ -214,7 +214,7 @@ test('Properly configures typescript when tsconfig detected.', async () => { packageJson('typescript-detect'), file( 'tsconfig.json', - '{ "compilerOptions": { "skipLibCheck": true }, "exclude": [ "babel.config.js" ] }', + '{ "compilerOptions": { "skipLibCheck": true }, "exclude": [ "babel.config.js", "**/Pods/**" ] }', ), reactNativePkg, ]) @@ -238,7 +238,7 @@ test('Properly configures typescript when tsconfig detected.', async () => { expect(tsconfigContents.extends).toBe('@react-native/typescript-config/tsconfig.json') expect(tsconfigContents.compilerOptions.skipLibCheck).toBe(true) // Extended excludes removed. - expect(tsconfigContents.exclude).toBe(undefined) + expect(tsconfigContents.exclude).toEqual(['babel.config.js']) }) test('Extended tsconfig properties are removed.', async () => { @@ -246,7 +246,7 @@ test('Extended tsconfig properties are removed.', async () => { packageJson('typescript-extend', { devDependencies: { typescript: '^4.4.4' } }), file( 'tsconfig.json', - '{ "compilerOptions": { "skipLibCheck": true }, "exclude": [ "node_modules", "my-stuff" ] }', + '{ "compilerOptions": { "skipLibCheck": true }, "exclude": [ "node_modules", "my-stuff", "**/Pods/**" ] }', ), reactNativePkg, ]) @@ -273,7 +273,7 @@ test('Extended tsconfig properties are removed.', async () => { expect(tsconfigContents.compilerOptions.moduleResolution).toBe('node') expect(tsconfigContents.compilerOptions.skipLibCheck).toBe(true) // Extended excludes removed. - expect(tsconfigContents.exclude).toEqual(['my-stuff']) + expect(tsconfigContents.exclude).toEqual(['node_modules', 'my-stuff']) }) test('tsconfig from package.json is merged in.', async () => {