diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml index e8603ba..8f0e203 100644 --- a/.github/workflows/jest.yml +++ b/.github/workflows/jest.yml @@ -19,6 +19,11 @@ jobs: - name: 🥟 Setup Bun uses: oven-sh/setup-bun@v2 + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: 📦 Install dependencies run: yarn diff --git a/__tests__/recipes/__snapshots__/detox.test.ts.snap b/__tests__/recipes/__snapshots__/detox.test.ts.snap index a760c4c..180064e 100644 --- a/__tests__/recipes/__snapshots__/detox.test.ts.snap +++ b/__tests__/recipes/__snapshots__/detox.test.ts.snap @@ -891,6 +891,468 @@ jobs: " `; +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 1`] = ` +Object { + "dependencies": Object { + "react": "", + "react-native": "", + }, + "devDependencies": Object { + "@babel/core": "", + "@babel/preset-env": "", + "@babel/runtime": "", + "@react-native/babel-preset": "", + "@react-native/metro-config": "", + "@react-native/typescript-config": "", + "@types/jest": "", + "@types/react": "", + "@types/react-test-renderer": "", + "detox": "", + "jest": "", + "react-test-renderer": "", + "ts-jest": "", + "typescript": "", + }, + "engines": Object { + "node": ">=18", + }, + "name": "RnSetupCiYarnFlat", + "packageManager": "yarn@3.6.4", + "private": true, + "scripts": Object { + "android": "react-native run-android", + "build:release:android": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release -Dorg.gradle.jvmargs=-Xmx4g", + "build:release:ios": "cd ios && pod install && cd .. && xcodebuild ONLY_ACTIVE_ARCH=YES -workspace ios/RnSetupCiYarnFlat.xcworkspace -UseNewBuildSystem=YES -scheme RnSetupCiYarnFlat -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet", + "detox:test:android": "detox test --config-path .detoxrc-ci.js --configuration android.emu.release --cleanup", + "detox:test:ios": "detox test --config-path .detoxrc-ci.js --configuration ios.sim.release --cleanup", + "ios": "react-native run-ios", + "start": "react-native start", + }, + "version": "0.0.1", +} +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 2`] = ` +"/** @type {Detox.DetoxConfig} */ +module.exports = { + testRunner: { + args: { + $0: 'jest', + config: 'e2e/jest.config.js', + }, + jest: { + setupTimeout: 300000, + }, + }, + apps: { + 'ios.release': { + type: 'ios.app', + binaryPath: 'ios-release-build/ios-release.app', + }, + 'android.release': { + type: 'android.apk', + binaryPath: 'android-release-build/android-release.apk', + testBinaryPath: 'android-release-build/android-release-test.apk', + }, + }, + devices: { + simulator: { + type: 'ios.simulator', + device: { + type: 'iPhone 15 Pro', + }, + }, + emulator: { + type: 'android.emulator', + device: { + avdName: 'e2e_emulator', + }, + }, + }, + configurations: { + 'ios.sim.release': { + device: 'simulator', + app: 'ios.release', + }, + 'android.emu.release': { + device: 'emulator', + app: 'android.release', + }, + }, +}; +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 3`] = ` +"{ + \\"expo\\": { + \\"name\\": \\"rn-setup-ci-create-expo-stack-pnpm\\", + \\"slug\\": \\"rn-setup-ci-create-expo-stack-pnpm\\", + \\"version\\": \\"1.0.0\\", + \\"scheme\\": \\"rn-setup-ci-create-expo-stack-pnpm\\", + \\"web\\": { + \\"bundler\\": \\"metro\\", + \\"output\\": \\"static\\", + \\"favicon\\": \\"./assets/favicon.png\\" + }, + \\"plugins\\": [\\"expo-router\\", \\"@config-plugins/detox\\"], + \\"experiments\\": { + \\"typedRoutes\\": true, + \\"tsconfigPaths\\": true + }, + \\"orientation\\": \\"portrait\\", + \\"icon\\": \\"./assets/icon.png\\", + \\"userInterfaceStyle\\": \\"light\\", + \\"splash\\": { + \\"image\\": \\"./assets/splash.png\\", + \\"resizeMode\\": \\"contain\\", + \\"backgroundColor\\": \\"#ffffff\\" + }, + \\"assetBundlePatterns\\": [\\"**/*\\"], + \\"ios\\": { + \\"supportsTablet\\": true, + \\"bundleIdentifier\\": \\"com.kmichno.rnsetupcicreateexpostackpnpm\\" + }, + \\"android\\": { + \\"adaptiveIcon\\": { + \\"foregroundImage\\": \\"./assets/adaptive-icon.png\\", + \\"backgroundColor\\": \\"#ffffff\\" + }, + \\"package\\": \\"com.kmichno.rnsetupcicreateexpostackpnpm\\" + } + } +} +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 4`] = ` +"/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + preset: 'ts-jest', + rootDir: '..', + testMatch: ['/e2e/**/*.test.ts'], + testTimeout: 300000, + maxWorkers: 1, + globalSetup: 'detox/runners/jest/globalSetup', + globalTeardown: 'detox/runners/jest/globalTeardown', + reporters: ['detox/runners/jest/reporter'], + testEnvironment: 'detox/runners/jest/testEnvironment', + verbose: true, +}; +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 5`] = ` +"import { device, by, element, expect } from 'detox'; + +describe('Example', () => { + beforeAll(async () => { + await device.launchApp(); + }); + + beforeEach(async () => { + await device.reloadReactNative(); + }); + + it('Hello world! to be visible', async () => { + await expect(element(by.text('Hello World!'))).toBeVisible(); + }); +}); +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 6`] = ` +"name: Build Android Release App + +on: + pull_request: + +jobs: + lookup-cached-build: + runs-on: ubuntu-latest + outputs: + build-exists: \${{ steps.android-release-restore.outputs.cache-hit }} + steps: + - name: 🐛 Try to restore build from cache + id: android-release-restore + uses: actions/cache/restore@v4 + with: + lookup-only: true + path: android-release-build/ + key: android-release-build-\${{ github.event.pull_request.head.sha }} + + build-release-android: + needs: lookup-cached-build + if: needs.lookup-cached-build.outputs.build-exists != 'true' + runs-on: ubuntu-latest + steps: + - name: 💾 Maximize build space + uses: AdityaGarg8/remove-unwanted-software@v4.1 + with: + remove-dotnet: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + + - name: 🏗 Checkout repository + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: ☕ Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'zulu' + + - name: 🐘 Setup Gradle 8.8 + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: 8.8 + + - name: 🛠️ Build + run: pnpm run build:release:android + + - name: 📁 Prepare cache folder + run: | + mkdir android-release-build + mv ./android/app/build/outputs/apk/release/app-release.apk android-release-build/android-release.apk + mv ./android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk android-release-build/android-release-test.apk + + - name: 📡 Store built app in cache + id: android-release-save + uses: actions/cache/save@v4 + with: + path: android-release-build/ + key: android-release-build-\${{ github.event.pull_request.head.sha }} +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 7`] = ` +"name: Build iOS Release App + +on: + pull_request: + +jobs: + lookup-cached-build: + runs-on: ubuntu-latest + outputs: + build-exists: \${{ steps.ios-release-restore.outputs.cache-hit }} + steps: + - name: 🐛 Try to restore build from cache + id: ios-release-restore + uses: actions/cache/restore@v4 + with: + lookup-only: true + path: ios-release-build/ + key: ios-release-build-\${{ github.event.pull_request.head.sha }} + + build-release-ios: + needs: lookup-cached-build + if: needs.lookup-cached-build.outputs.build-exists != 'true' + runs-on: macos-latest + steps: + - name: 🏗 Checkout repository + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 🔨 Use latest stable Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: 🛠️ Build + run: pnpm run build:release:ios + + - name: 📁 Prepare cache folder + run: | + mkdir ios-release-build + mv ./ios/build/Build/Products/Release-iphonesimulator/rnsetupcicreateexpostackpnpm.app ios-release-build/ios-release.app + + - name: 📡 Store built app in cache + id: ios-release-save + uses: actions/cache/save@v4 + with: + path: ios-release-build/ + key: ios-release-build-\${{ github.event.pull_request.head.sha }} +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 8`] = ` +"name: Test Detox Android + +on: + pull_request: + +jobs: + test-detox-android: + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + checks: read + contents: read + env: + API_LEVEL: 34 + steps: + - name: ⌛ Wait for build to finish + uses: poseidon/wait-for-status-checks@v0.5.0 + with: + token: \${{ secrets.GITHUB_TOKEN }} + delay: 20s + match_pattern: build-release-android + + - name: 🏗 Checkout repository + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 📦 Install AVD dependencies + run: | + sudo apt update + sudo apt-get install -y libpulse0 libgl1 + + - name: ☕ Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'zulu' + + - name: 🐘 Setup Gradle 8.8 + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: 8.8 + + - name: 🐛 Try to restore build from cache + id: android-release-restore + uses: actions/cache/restore@v4 + with: + path: android-release-build/ + key: android-release-build-\${{ github.event.pull_request.head.sha }} + + - name: 🏎️ Enable KVM + run: | + echo 'KERNEL==\\"kvm\\", GROUP=\\"kvm\\", MODE=\\"0666\\", OPTIONS+=\\"static_node=kvm\\"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: 📱 AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-\${{ env.API_LEVEL }} + + - name: 📋 Run Detox tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: \${{ env.API_LEVEL }} + target: google_apis + disable-animations: false + emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none + avd-name: e2e_emulator + arch: x86_64 + script: pnpm run detox:test:android +" +`; + +exports[`detox recipe rn-setup-ci-create-expo-stack-pnpm detox 9`] = ` +"name: Test Detox iOS + +on: + pull_request: + +jobs: + test-detox-ios: + runs-on: macos-latest + timeout-minutes: 60 + permissions: + checks: read + contents: read + steps: + - name: ⌛ Wait for build to finish + uses: poseidon/wait-for-status-checks@v0.5.0 + with: + token: \${{ secrets.GITHUB_TOKEN }} + delay: 20s + match_pattern: build-release-ios + + - name: 🏗 Checkout repository + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 📦 Install macOS dependencies + run: | + brew tap wix/brew + brew install applesimutils + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: 🐛 Try to restore build from cache + id: ios-release-restore + uses: actions/cache/restore@v4 + with: + path: ios-release-build/ + key: ios-release-build-\${{ github.event.pull_request.head.sha }} + + - name: 📋 Run Detox tests + run: pnpm run detox:test:ios +" +`; + exports[`detox recipe rn-setup-ci-npm-flat detox 1`] = ` Object { "dependencies": Object { diff --git a/__tests__/recipes/__snapshots__/jest.test.ts.snap b/__tests__/recipes/__snapshots__/jest.test.ts.snap index 9272549..a4bebdd 100644 --- a/__tests__/recipes/__snapshots__/jest.test.ts.snap +++ b/__tests__/recipes/__snapshots__/jest.test.ts.snap @@ -139,6 +139,81 @@ jobs: " `; +exports[`jest recipe rn-setup-ci-create-expo-stack-pnpm jest 1`] = ` +Object { + "dependencies": Object { + "react": "", + "react-native": "", + }, + "devDependencies": Object { + "@babel/core": "", + "@babel/preset-env": "", + "@babel/runtime": "", + "@react-native/babel-preset": "", + "@react-native/metro-config": "", + "@react-native/typescript-config": "", + "@types/react": "", + "@types/react-test-renderer": "", + "jest": "", + "react-test-renderer": "", + }, + "engines": Object { + "node": ">=18", + }, + "name": "RnSetupCiYarnFlat", + "packageManager": "yarn@3.6.4", + "private": true, + "scripts": Object { + "android": "react-native run-android", + "ios": "react-native run-ios", + "start": "react-native start", + "test": "jest --passWithNoTests", + }, + "version": "0.0.1", +} +`; + +exports[`jest recipe rn-setup-ci-create-expo-stack-pnpm jest 2`] = ` +"{ + \\"preset\\": \\"react-native\\", + \\"modulePathIgnorePatterns\\": [\\"e2e\\"] +} +" +`; + +exports[`jest recipe rn-setup-ci-create-expo-stack-pnpm jest 3`] = ` +"name: Run Jest tests + +on: + pull_request: + +jobs: + jest: + name: Jest + runs-on: ubuntu-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 🎭 Run Jest + run: pnpm run test +" +`; + exports[`jest recipe rn-setup-ci-npm-flat jest 1`] = ` Object { "dependencies": Object { diff --git a/__tests__/recipes/__snapshots__/lint.test.ts.snap b/__tests__/recipes/__snapshots__/lint.test.ts.snap index 5e2ff56..37ab7ab 100644 --- a/__tests__/recipes/__snapshots__/lint.test.ts.snap +++ b/__tests__/recipes/__snapshots__/lint.test.ts.snap @@ -129,6 +129,76 @@ jobs: " `; +exports[`lint recipe rn-setup-ci-create-expo-stack-pnpm lint 1`] = ` +Object { + "dependencies": Object { + "react": "", + "react-native": "", + }, + "devDependencies": Object { + "@babel/core": "", + "@babel/preset-env": "", + "@babel/runtime": "", + "@react-native/babel-preset": "", + "@react-native/eslint-config": "", + "@react-native/metro-config": "", + "@react-native/typescript-config": "", + "@types/react": "", + "@types/react-test-renderer": "", + "eslint": "", + "eslint-plugin-ft-flow": "", + "react-test-renderer": "", + "typescript": "", + }, + "engines": Object { + "node": ">=18", + }, + "name": "RnSetupCiYarnFlat", + "packageManager": "yarn@3.6.4", + "private": true, + "scripts": Object { + "android": "react-native run-android", + "ios": "react-native run-ios", + "lint": "eslint '**/*.{js,jsx,ts,tsx}'", + "start": "react-native start", + }, + "version": "0.0.1", +} +`; + +exports[`lint recipe rn-setup-ci-create-expo-stack-pnpm lint 2`] = ` +"name: Check ESLint + +on: + pull_request: + +jobs: + eslint: + name: ESLint + runs-on: ubuntu-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 🤓 Run ESLint + run: pnpm run lint +" +`; + exports[`lint recipe rn-setup-ci-npm-flat lint 1`] = ` Object { "dependencies": Object { diff --git a/__tests__/recipes/__snapshots__/prettier.test.ts.snap b/__tests__/recipes/__snapshots__/prettier.test.ts.snap index 96f6cdd..af12789 100644 --- a/__tests__/recipes/__snapshots__/prettier.test.ts.snap +++ b/__tests__/recipes/__snapshots__/prettier.test.ts.snap @@ -125,6 +125,74 @@ jobs: " `; +exports[`prettier check recipe rn-setup-ci-create-expo-stack-pnpm prettier check 1`] = ` +Object { + "dependencies": Object { + "react": "", + "react-native": "", + }, + "devDependencies": Object { + "@babel/core": "", + "@babel/preset-env": "", + "@babel/runtime": "", + "@react-native/babel-preset": "", + "@react-native/metro-config": "", + "@react-native/typescript-config": "", + "@types/react": "", + "@types/react-test-renderer": "", + "prettier": "", + "react-test-renderer": "", + }, + "engines": Object { + "node": ">=18", + }, + "name": "RnSetupCiYarnFlat", + "packageManager": "yarn@3.6.4", + "private": true, + "scripts": Object { + "android": "react-native run-android", + "ios": "react-native run-ios", + "prettier:check": "prettier --check \\"**/*.{ts,tsx,js,jsx,json,css,scss,md}\\"", + "prettier:write": "prettier --write \\"**/*.{ts,tsx,js,jsx,json,css,scss,md}\\"", + "start": "react-native start", + }, + "version": "0.0.1", +} +`; + +exports[`prettier check recipe rn-setup-ci-create-expo-stack-pnpm prettier check 2`] = ` +"name: Prettier check + +on: + pull_request: + +jobs: + prettier-check: + name: Prettier check + runs-on: ubuntu-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: ✨ Run Prettier check + run: pnpm run prettier:check +" +`; + exports[`prettier check recipe rn-setup-ci-npm-flat prettier check 1`] = ` Object { "dependencies": Object { diff --git a/__tests__/recipes/__snapshots__/typescript.test.ts.snap b/__tests__/recipes/__snapshots__/typescript.test.ts.snap index d42d5a3..0bd7e19 100644 --- a/__tests__/recipes/__snapshots__/typescript.test.ts.snap +++ b/__tests__/recipes/__snapshots__/typescript.test.ts.snap @@ -155,6 +155,89 @@ jobs: " `; +exports[`typescript check recipe rn-setup-ci-create-expo-stack-pnpm typescript check 1`] = ` +Object { + "dependencies": Object { + "react": "", + "react-native": "", + }, + "devDependencies": Object { + "@babel/core": "", + "@babel/preset-env": "", + "@babel/runtime": "", + "@react-native/babel-preset": "", + "@react-native/metro-config": "", + "@react-native/typescript-config": "", + "@types/react": "", + "@types/react-test-renderer": "", + "react-test-renderer": "", + "typescript": "", + }, + "engines": Object { + "node": ">=18", + }, + "name": "RnSetupCiYarnFlat", + "packageManager": "yarn@3.6.4", + "private": true, + "scripts": Object { + "android": "react-native run-android", + "ios": "react-native run-ios", + "start": "react-native start", + "ts:check": "tsc -p . --noEmit", + }, + "version": "0.0.1", +} +`; + +exports[`typescript check recipe rn-setup-ci-create-expo-stack-pnpm typescript check 2`] = ` +"{ + \\"extends\\": \\"expo/tsconfig.base\\", + \\"compilerOptions\\": { + \\"strict\\": true, + + \\"baseUrl\\": \\".\\", + \\"paths\\": { + \\"~/*\\": [\\"*\\"] + } + }, + \\"include\\": [\\"**/*.ts\\", \\"**/*.tsx\\", \\".expo/types/**/*.ts\\", \\"expo-env.d.ts\\"] +} +" +`; + +exports[`typescript check recipe rn-setup-ci-create-expo-stack-pnpm typescript check 3`] = ` +"name: Run Typescript + +on: + pull_request: + +jobs: + typescript-check: + name: Typescript check + runs-on: ubuntu-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v4 + + - name: 🐿️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: 🌿 Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + + - name: 📦 Install dependencies + run: pnpm install --frozen-lockfile + + - name: 🔍 Run Typescript check + run: pnpm run ts:check +" +`; + exports[`typescript check recipe rn-setup-ci-npm-flat typescript check 1`] = ` Object { "dependencies": Object { diff --git a/__tests__/recipes/detox.test.ts b/__tests__/recipes/detox.test.ts index 986de37..5f0ef33 100644 --- a/__tests__/recipes/detox.test.ts +++ b/__tests__/recipes/detox.test.ts @@ -23,6 +23,7 @@ describe('detox recipe', () => { 'rn-setup-ci-npm-monorepo', 'rn-setup-ci-create-expo-stack', 'rn-setup-ci-create-expo-stack-bun', + 'rn-setup-ci-create-expo-stack-pnpm', ] const checkModifiedFiles = ( diff --git a/__tests__/recipes/jest.test.ts b/__tests__/recipes/jest.test.ts index 787a75a..564025d 100644 --- a/__tests__/recipes/jest.test.ts +++ b/__tests__/recipes/jest.test.ts @@ -21,6 +21,7 @@ describe('jest recipe', () => { 'rn-setup-ci-npm-monorepo', 'rn-setup-ci-create-expo-stack', 'rn-setup-ci-create-expo-stack-bun', + 'rn-setup-ci-create-expo-stack-pnpm', ] for (const projectName of PROJECTS) { diff --git a/__tests__/recipes/lint.test.ts b/__tests__/recipes/lint.test.ts index 5cc4677..5976bc1 100644 --- a/__tests__/recipes/lint.test.ts +++ b/__tests__/recipes/lint.test.ts @@ -22,6 +22,7 @@ describe('lint recipe', () => { 'rn-setup-ci-npm-monorepo', 'rn-setup-ci-create-expo-stack', 'rn-setup-ci-create-expo-stack-bun', + 'rn-setup-ci-create-expo-stack-pnpm', ] for (const projectName of PROJECTS) { diff --git a/__tests__/recipes/prettier.test.ts b/__tests__/recipes/prettier.test.ts index 5f37831..9723b63 100644 --- a/__tests__/recipes/prettier.test.ts +++ b/__tests__/recipes/prettier.test.ts @@ -21,6 +21,7 @@ describe('prettier check recipe', () => { 'rn-setup-ci-npm-monorepo', 'rn-setup-ci-create-expo-stack', 'rn-setup-ci-create-expo-stack-bun', + 'rn-setup-ci-create-expo-stack-pnpm', ] for (const projectName of PROJECTS) { diff --git a/__tests__/recipes/typescript.test.ts b/__tests__/recipes/typescript.test.ts index e582dd2..f0054e2 100644 --- a/__tests__/recipes/typescript.test.ts +++ b/__tests__/recipes/typescript.test.ts @@ -21,6 +21,7 @@ describe('typescript check recipe', () => { 'rn-setup-ci-npm-monorepo', 'rn-setup-ci-create-expo-stack', 'rn-setup-ci-create-expo-stack-bun', + 'rn-setup-ci-create-expo-stack-pnpm', ] for (const projectName of PROJECTS) { diff --git a/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/.gitignore b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/.gitignore new file mode 100644 index 0000000..6a904e6 --- /dev/null +++ b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/.gitignore @@ -0,0 +1,24 @@ +node_modules/ +.expo/ +dist/ +npm-debug.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ +# expo router +expo-env.d.ts + + + +ios +android + +# macOS +.DS_Store + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/README.md b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/README.md new file mode 100644 index 0000000..cd3e588 --- /dev/null +++ b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/README.md @@ -0,0 +1 @@ +Generated using `npx create-expo-stack@latest rn-setup-ci-create-expo-stack-pnpm --expo-router --stylesheet --pnpm` diff --git a/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app.json b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app.json new file mode 100644 index 0000000..8501f6c --- /dev/null +++ b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app.json @@ -0,0 +1,43 @@ +{ + "expo": { + "name": "rn-setup-ci-create-expo-stack-pnpm", + "slug": "rn-setup-ci-create-expo-stack-pnpm", + "version": "1.0.0", + + "scheme": "rn-setup-ci-create-expo-stack-pnpm", + "web": { + "bundler": "metro", + "output": "static", + "favicon": "./assets/favicon.png" + }, + "plugins": ["expo-router"], + "experiments": { + "typedRoutes": true, + + "tsconfigPaths": true + }, + + "orientation": "portrait", + "icon": "./assets/icon.png", + + "userInterfaceStyle": "light", + + "splash": { + "image": "./assets/splash.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "assetBundlePatterns": ["**/*"], + "ios": { + "supportsTablet": true, + "bundleIdentifier": "com.kmichno.rnsetupcicreateexpostackpnpm" + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/adaptive-icon.png", + "backgroundColor": "#ffffff" + }, + "package": "com.kmichno.rnsetupcicreateexpostackpnpm" + } + } +} diff --git a/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app/+html.tsx b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app/+html.tsx new file mode 100644 index 0000000..25524d7 --- /dev/null +++ b/__tests__/test-projects/rn-setup-ci-create-expo-stack-pnpm/app/+html.tsx @@ -0,0 +1,46 @@ +import { ScrollViewStyleReset } from 'expo-router/html'; + +// This file is web-only and used to configure the root HTML for every +// web page during static rendering. +// The contents of this function only run in Node.js environments and +// do not have access to the DOM or browser APIs. +export default function Root({ children }: { children: React.ReactNode }) { + return ( + + + + + + {/* + This viewport disables scaling which makes the mobile website act more like a native app. + However this does reduce built-in accessibility. If you want to enable scaling, use this instead: + + */} + + {/* + Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. + However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. + */} + + + {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} +