From 688e53f1475572f6d69bb6893c101e1e964aac73 Mon Sep 17 00:00:00 2001 From: finalchild Date: Fri, 11 Apr 2025 22:24:36 +0900 Subject: [PATCH 01/19] docs: correct flow homepage url (#814) ### Summary Flow links to TypeScript homepage. ### Test plan --- docs/pages/build.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/build.md b/docs/pages/build.md index 461eda75e..b83458218 100644 --- a/docs/pages/build.md +++ b/docs/pages/build.md @@ -227,7 +227,7 @@ This option has no effect when overriding the default babel configuration withou ##### `copyFlow` -If your source code is written in [Flow](http://www.typescriptlang.org/), You can specify the `copyFlow` option to `true` to copy the source files as `.js.flow` to the output folder. If the `main` entry in `package.json` points to the `index` file in the output folder, the flow type checker will pick these files up to use for type definitions. +If your source code is written in [Flow](https://flow.org/), You can specify the `copyFlow` option to `true` to copy the source files as `.js.flow` to the output folder. If the `main` entry in `package.json` points to the `index` file in the output folder, the flow type checker will pick these files up to use for type definitions. ##### `sourceMaps` @@ -255,7 +255,7 @@ Example: #### `typescript` -Enable generating type definitions with `tsc` if your source code is written in [TypeScript](http://www.typescriptlang.org/). +Enable generating type definitions with `tsc` if your source code is written in [TypeScript](https://www.typescriptlang.org/). When both `module` and `commonjs` targets are enabled, and `esm` is set to `true` for the `module` target, this will output 2 sets of type definitions: one for the CommonJS build and one for the ES module build. From 1706d80da6e724036dcf1e95bbd38250192a4f04 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 11 Apr 2025 21:18:46 +0200 Subject: [PATCH 02/19] refactor: drop old arch and cpp templates (#818) ## Summarry The large number of templates makes it difficult to maintain and test. so this reduces the number of templates: - Drop old architecture templates - users can use codegen or older version of crnl - Drop cpp templates - our cpp template isn't a pure cpp template, we should eventually have it ## Test plan Tested building each template: turbo module, fabric view, nitro module and ran the example app for Android & iOS to verify it works. - Nitro fails locally on iOS due to this https://github.com/mrousavy/nitro/issues/422, so had to force the iOS version to make it work - Turbo module works fine locally on iOS but fails on CI Both of them seem related to XCode 16 and not this change. --- .github/workflows/build-templates.yml | 50 +++------ docs/pages/create.md | 2 + .../src/exampleApp/generateExampleApp.ts | 56 +++++----- .../create-react-native-library/src/input.ts | 24 +--- .../src/template.ts | 103 ++++++------------ .../templates/common-local/$package.json | 2 - .../templates/common/CONTRIBUTING.md | 7 +- .../cpp-library/android/CMakeLists.txt | 16 --- .../cpp-library/android/cpp-adapter.cpp | 8 -- .../cpp/{%- project.identifier %}.cpp | 7 -- .../cpp/{%- project.identifier %}.h | 8 -- .../example-module-legacy/example/src/App.tsx | 32 ------ .../{%- project.name %}Module.kt | 25 ----- .../{%- project.name %}Package.kt | 17 --- .../{%- project.name %}Package.kt | 17 --- .../{%- project.name %}ViewManager.kt | 20 ---- .../native-common/android/build.gradle | 15 +-- .../native-common/{%- project.name %}.podspec | 8 +- .../native-library-legacy/src/index.tsx | 22 ---- .../native-view-legacy/src/index.tsx | 26 ----- .../objc-library/ios/{%- project.name %}.h | 12 -- .../objc-library/ios/{%- project.name %}.mm | 24 ---- .../ios/{%- project.name %}ViewManager.m | 34 ------ .../ios/{%- project.name %}-Bridging-Header.h | 2 - .../ios/{%- project.name %}.mm | 14 --- .../ios/{%- project.name %}.swift | 8 -- .../ios/{%- project.name %}-Bridging-Header.h | 1 - .../ios/{%- project.name %}ViewManager.m | 7 -- .../ios/{%- project.name %}ViewManager.swift | 36 ------ 29 files changed, 86 insertions(+), 517 deletions(-) delete mode 100644 packages/create-react-native-library/templates/cpp-library/android/CMakeLists.txt delete mode 100644 packages/create-react-native-library/templates/cpp-library/android/cpp-adapter.cpp delete mode 100644 packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.cpp delete mode 100644 packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.h delete mode 100644 packages/create-react-native-library/templates/example-module-legacy/example/src/App.tsx delete mode 100644 packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Module.kt delete mode 100644 packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt delete mode 100644 packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt delete mode 100644 packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}ViewManager.kt delete mode 100644 packages/create-react-native-library/templates/native-library-legacy/src/index.tsx delete mode 100644 packages/create-react-native-library/templates/native-view-legacy/src/index.tsx delete mode 100644 packages/create-react-native-library/templates/objc-view-legacy/ios/{%- project.name %}ViewManager.m delete mode 100644 packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}-Bridging-Header.h delete mode 100644 packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.mm delete mode 100644 packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.swift delete mode 100644 packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}-Bridging-Header.h delete mode 100644 packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.m delete mode 100644 packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.swift diff --git a/.github/workflows/build-templates.yml b/.github/workflows/build-templates.yml index 73d5df0b9..f6b3412cd 100644 --- a/.github/workflows/build-templates.yml +++ b/.github/workflows/build-templates.yml @@ -30,35 +30,19 @@ jobs: - ubuntu - macos type: - - turbo-module - - fabric-view - - legacy-module - - legacy-view - - nitro-module - language: - - kotlin-objc - - kotlin-swift - - cpp - exclude: - - type: turbo-module - language: kotlin-swift - - type: fabric-view - language: kotlin-swift - - type: fabric-view - language: cpp - - type: legacy-view - language: cpp - - type: nitro-module + - name: turbo-module language: kotlin-objc - - type: nitro-module - language: cpp + - name: fabric-view + language: kotlin-objc + - name: nitro-module + language: kotlin-swift include: - os: ubuntu - type: library - language: js + type.name: library + type.language: js concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type.name }}-${{ matrix.type.language }} cancel-in-progress: true runs-on: ${{ matrix.os }}-latest @@ -76,7 +60,7 @@ jobs: - name: Get working directory run: | - echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV + echo "work_dir=${{ matrix.os }}-${{ matrix.type.name }}-${{ matrix.type.language }}" >> $GITHUB_ENV - name: Create library run: | @@ -88,9 +72,9 @@ jobs: --author-email test@test \ --author-url https://test.test \ --repo-url https://test.test \ - --type ${{ matrix.type }} \ - --languages ${{ matrix.language }} \ - --example ${{ matrix.language == 'js' && 'expo' || 'vanilla' }} \ + --type ${{ matrix.type.name }} \ + --languages ${{ matrix.type.language }} \ + --example ${{ matrix.type.language == 'js' && 'expo' || 'vanilla' }} \ --no-local - name: Restore dependencies of library @@ -135,14 +119,14 @@ jobs: run: | # Build Android for only some matrices to skip redundant builds if [[ ${{ matrix.os }} == ubuntu ]]; then - if [[ ${{ matrix.type }} == *-view && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == cpp ]]; then + if [[ ${{ matrix.type.name }} == *-view && ${{ matrix.type.language }} == *-objc ]] || [[ ${{ matrix.type.name }} == *-module && ${{ matrix.type.language }} == *-objc ]]; then echo "android_build=1" >> $GITHUB_ENV fi fi # Build iOS for only some matrices to skip redundant builds if [[ ${{ matrix.os }} == macos ]]; then - if [[ ${{ matrix.type }} == *-view && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == cpp ]]; then + if [[ ${{ matrix.type.name }} == *-view && ${{ matrix.type.language }} == kotlin-* ]] || [[ ${{ matrix.type.name }} == *-module && ${{ matrix.type.language }} == kotlin-* ]]; then echo "ios_build=1" >> $GITHUB_ENV fi fi @@ -153,9 +137,9 @@ jobs: with: path: | ${{ env.work_dir }}/.turbo - key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }} + key: ${{ runner.os }}-library-turborepo-${{ matrix.type.name }}-${{ matrix.type.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }} restore-keys: | - ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}- + ${{ runner.os }}-library-turborepo-${{ matrix.type.name }}-${{ matrix.type.language }}- - name: Check turborepo cache if: env.android_build == 1 || env.ios_build == 1 @@ -194,7 +178,7 @@ jobs: - name: Build example (Web) working-directory: ${{ env.work_dir }} - if: matrix.language == 'js' + if: matrix.type.language == 'js' run: | yarn example expo export --platform web diff --git a/docs/pages/create.md b/docs/pages/create.md index e2e6aa61e..56e5eb7c3 100644 --- a/docs/pages/create.md +++ b/docs/pages/create.md @@ -29,6 +29,8 @@ This will ask you a few questions about your project and generate a new project After the project is created, you can find the development workflow in the generated `CONTRIBUTING.md` file. +> Note: If you want to create a library using the legacy native modules and view APIs instead of the new architecture, you can use the `0.49.8` version of `create-react-native-library`: `npx create-react-native-library@0.49.8 awesome-library`. + ## Local library While the default templates are for libraries that are published to npm, you can also create a local library that is not published but used locally in your app. diff --git a/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts b/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts index 79295b051..605aa8d3a 100644 --- a/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts +++ b/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts @@ -261,39 +261,33 @@ export default async function generateExampleApp({ 'android.enableJetifier=false' ); - // If the library is on new architecture, enable new arch for iOS and Android - if (config.project.arch === 'new') { - // iOS - // Add ENV['RCT_NEW_ARCH_ENABLED'] = 1 on top of example/ios/Podfile - const podfile = await fs.readFile( - path.join(directory, 'ios', 'Podfile'), - 'utf8' - ); + // Enable new arch for iOS and Android + // iOS + // Add ENV['RCT_NEW_ARCH_ENABLED'] = 1 on top of example/ios/Podfile + const podfile = await fs.readFile( + path.join(directory, 'ios', 'Podfile'), + 'utf8' + ); - await fs.writeFile( - path.join(directory, 'ios', 'Podfile'), - "ENV['RCT_NEW_ARCH_ENABLED'] = '1'\n\n" + podfile - ); + await fs.writeFile( + path.join(directory, 'ios', 'Podfile'), + "ENV['RCT_NEW_ARCH_ENABLED'] = '1'\n\n" + podfile + ); - // Android - // Make sure newArchEnabled=true is present in android/gradle.properties - if (gradleProperties.split('\n').includes('#newArchEnabled=true')) { - gradleProperties = gradleProperties.replace( - '#newArchEnabled=true', - 'newArchEnabled=true' - ); - } else if ( - gradleProperties.split('\n').includes('newArchEnabled=false') - ) { - gradleProperties = gradleProperties.replace( - 'newArchEnabled=false', - 'newArchEnabled=true' - ); - } else if ( - !gradleProperties.split('\n').includes('newArchEnabled=true') - ) { - gradleProperties += '\nnewArchEnabled=true'; - } + // Android + // Make sure newArchEnabled=true is present in android/gradle.properties + if (gradleProperties.split('\n').includes('#newArchEnabled=true')) { + gradleProperties = gradleProperties.replace( + '#newArchEnabled=true', + 'newArchEnabled=true' + ); + } else if (gradleProperties.split('\n').includes('newArchEnabled=false')) { + gradleProperties = gradleProperties.replace( + 'newArchEnabled=false', + 'newArchEnabled=true' + ); + } else if (!gradleProperties.split('\n').includes('newArchEnabled=true')) { + gradleProperties += '\nnewArchEnabled=true'; } await fs.writeFile( diff --git a/packages/create-react-native-library/src/input.ts b/packages/create-react-native-library/src/input.ts index 162ee17ea..f14fa18d8 100644 --- a/packages/create-react-native-library/src/input.ts +++ b/packages/create-react-native-library/src/input.ts @@ -18,13 +18,11 @@ export type ArgName = | 'example' | 'reactNativeVersion'; -export type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'cpp' | 'js'; +export type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'js'; export type ProjectType = | 'turbo-module' | 'fabric-view' - | 'legacy-module' - | 'legacy-view' | 'nitro-module' | 'library'; @@ -36,17 +34,12 @@ const LANGUAGE_CHOICES: { { title: 'Kotlin & Swift', value: 'kotlin-swift', - types: ['nitro-module', 'legacy-module', 'legacy-view'], + types: ['nitro-module'], }, { title: 'Kotlin & Objective-C', value: 'kotlin-objc', - types: ['turbo-module', 'fabric-view', 'legacy-module', 'legacy-view'], - }, - { - title: 'C++ for Android & iOS', - value: 'cpp', - types: ['turbo-module', 'legacy-module'], + types: ['turbo-module', 'fabric-view'], }, { title: 'JavaScript for Android, iOS & Web', @@ -101,16 +94,6 @@ const TYPE_CHOICES: { description: 'type-safe, fast integration for native APIs to JS (experimental)', }, - { - title: 'Legacy Native module', - value: 'legacy-module', - description: 'bridge for native APIs to JS (old architecture)', - }, - { - title: 'Legacy Native view', - value: 'legacy-view', - description: 'bridge for native views to JS (old architecture)', - }, { title: 'JavaScript library', value: 'library', @@ -167,7 +150,6 @@ export const acceptedArgs: Record = { } as const; export type Args = Record; -export type SupportedArchitecture = 'new' | 'legacy'; export type ExampleApp = 'none' | 'test-app' | 'expo' | 'vanilla'; export type Answers = { diff --git a/packages/create-react-native-library/src/template.ts b/packages/create-react-native-library/src/template.ts index c003891c1..faad7fcce 100644 --- a/packages/create-react-native-library/src/template.ts +++ b/packages/create-react-native-library/src/template.ts @@ -1,12 +1,7 @@ import path from 'path'; import fs from 'fs-extra'; import ejs from 'ejs'; -import type { - Answers, - ExampleApp, - ProjectType, - SupportedArchitecture, -} from './input'; +import type { Answers, ExampleApp, ProjectType } from './input'; export type TemplateVersions = { bob: string; @@ -35,8 +30,6 @@ export type TemplateConfiguration = { package_cpp: string; identifier: string; native: boolean; - arch: SupportedArchitecture; - cpp: boolean; swift: boolean; viewConfig: ViewConfig; moduleConfig: ModuleConfig; @@ -62,10 +55,6 @@ const EXAMPLE_COMMON_FILES = path.resolve( __dirname, '../templates/example-common' ); -const EXAMPLE_MODULE_LEGACY_FILES = path.resolve( - __dirname, - '../templates/example-module-legacy' -); const EXAMPLE_MODULE_NEW_FILES = path.resolve( __dirname, '../templates/example-module-new' @@ -74,7 +63,6 @@ const EXAMPLE_VIEW_FILES = path.resolve(__dirname, '../templates/example-view'); const JS_FILES = path.resolve(__dirname, '../templates/js-library'); const EXPO_FILES = path.resolve(__dirname, '../templates/expo-library'); -const CPP_FILES = path.resolve(__dirname, '../templates/cpp-library'); const NATIVE_COMMON_FILES = path.resolve( __dirname, '../templates/native-common' @@ -85,31 +73,21 @@ const NATIVE_COMMON_EXAMPLE_FILES = path.resolve( ); const NATIVE_FILES = { - module_legacy: path.resolve(__dirname, '../templates/native-library-legacy'), module_new: path.resolve(__dirname, '../templates/native-library-new'), - view_legacy: path.resolve(__dirname, '../templates/native-view-legacy'), view_new: path.resolve(__dirname, '../templates/native-view-new'), module_nitro: path.resolve(__dirname, '../templates/nitro-module'), } as const; const OBJC_FILES = { module_common: path.resolve(__dirname, '../templates/objc-library'), - view_legacy: path.resolve(__dirname, '../templates/objc-view-legacy'), view_new: path.resolve(__dirname, '../templates/objc-view-new'), } as const; const KOTLIN_FILES = { - module_legacy: path.resolve(__dirname, '../templates/kotlin-library-legacy'), module_new: path.resolve(__dirname, '../templates/kotlin-library-new'), - view_legacy: path.resolve(__dirname, '../templates/kotlin-view-legacy'), view_new: path.resolve(__dirname, '../templates/kotlin-view-new'), } as const; -const SWIFT_FILES = { - module_legacy: path.resolve(__dirname, '../templates/swift-library-legacy'), - view_legacy: path.resolve(__dirname, '../templates/swift-view-legacy'), -} as const; - export function generateTemplateConfiguration({ versions, basename, @@ -121,11 +99,6 @@ export function generateTemplateConfiguration({ }): TemplateConfiguration { const { slug, languages, type } = answers; - const arch = - type === 'legacy-module' || type === 'legacy-view' || type === 'library' - ? 'legacy' - : 'new'; - const project = slug.replace(/^(react-native-|@[^/]+\/)/, ''); let namespace: string | undefined; @@ -159,8 +132,6 @@ export function generateTemplateConfiguration({ package_cpp: pack.replace(/\./g, '_'), identifier: slug.replace(/[^a-z0-9]+/g, '-').replace(/^-/, ''), native: languages !== 'js', - arch, - cpp: languages === 'cpp', swift: languages === 'kotlin-swift', viewConfig: getViewConfig(type), moduleConfig: getModuleConfig(type), @@ -182,8 +153,6 @@ function getModuleConfig(projectType: ProjectType): ModuleConfig { return 'nitro-modules'; case 'turbo-module': return 'turbo-modules'; - case 'legacy-module': - return 'native-modules'; default: return null; } @@ -191,8 +160,6 @@ function getModuleConfig(projectType: ProjectType): ModuleConfig { function getViewConfig(projectType: ProjectType): ViewConfig { switch (projectType) { - case 'legacy-view': - return 'paper-view'; case 'fabric-view': return 'fabric-view'; default: @@ -217,11 +184,7 @@ export async function applyTemplates( if (config.project.viewConfig !== null) { await applyTemplate(config, EXAMPLE_VIEW_FILES, folder); } else { - if (config.project.arch === 'legacy') { - await applyTemplate(config, EXAMPLE_MODULE_LEGACY_FILES, folder); - } else { - await applyTemplate(config, EXAMPLE_MODULE_NEW_FILES, folder); - } + await applyTemplate(config, EXAMPLE_MODULE_NEW_FILES, folder); } } } @@ -242,43 +205,22 @@ export async function applyTemplates( } if (config.project.moduleConfig !== null) { - await applyTemplate( - config, - NATIVE_FILES[`module_${config.project.arch}`], - folder - ); + await applyTemplate(config, NATIVE_FILES[`module_new`], folder); } else { - await applyTemplate( - config, - NATIVE_FILES[`view_${config.project.arch}`], - folder - ); + await applyTemplate(config, NATIVE_FILES[`view_new`], folder); } - if (config.project.swift) { - await applyTemplate(config, SWIFT_FILES[`module_legacy`], folder); + if (config.project.moduleConfig !== null) { + await applyTemplate(config, OBJC_FILES[`module_common`], folder); } else { - if (config.project.moduleConfig !== null) { - await applyTemplate(config, OBJC_FILES[`module_common`], folder); - } else { - await applyTemplate( - config, - OBJC_FILES[`view_${config.project.arch}`], - folder - ); - } + await applyTemplate(config, OBJC_FILES[`view_new`], folder); } const templateType = `${ config.project.moduleConfig !== null ? 'module' : 'view' - }_${config.project.arch}` as const; + }_new` as const; await applyTemplate(config, KOTLIN_FILES[templateType], folder); - - if (config.project.cpp) { - await applyTemplate(config, CPP_FILES, folder); - await fs.remove(path.join(folder, 'ios', `${config.project.name}.m`)); - } } } @@ -295,13 +237,20 @@ async function applyTemplate( const files = await fs.readdir(source); for (const f of files) { - const target = path.join( - destination, - ejs.render(f.replace(/^\$/, ''), config, { + let name; + + try { + name = ejs.render(f.replace(/^\$/, ''), config, { openDelimiter: '{', closeDelimiter: '}', - }) - ); + }); + } catch (e) { + throw new Error(`Failed to render template file name: ${f}`, { + cause: e, + }); + } + + const target = path.join(destination, name); const file = path.join(source, f); const stats = await fs.stat(file); @@ -311,7 +260,17 @@ async function applyTemplate( } else if (!BINARIES.some((r) => r.test(file))) { const content = await fs.readFile(file, 'utf8'); - await fs.writeFile(target, ejs.render(content, config)); + let result; + + try { + result = ejs.render(content, config); + } catch (e) { + throw new Error(`Failed to render template file content: ${f}`, { + cause: e, + }); + } + + await fs.writeFile(target, result); } else { await fs.copyFile(file, target); } diff --git a/packages/create-react-native-library/templates/common-local/$package.json b/packages/create-react-native-library/templates/common-local/$package.json index 19d884ddc..9970c8f8f 100644 --- a/packages/create-react-native-library/templates/common-local/$package.json +++ b/packages/create-react-native-library/templates/common-local/$package.json @@ -3,13 +3,11 @@ "version": "0.0.0", "description": "<%- project.description %>", "main": "src/index", -<% if (project.arch === 'new') { -%> "codegenConfig": { "name": "RN<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec", "type": <%- project.viewConfig !== null ? '"all"': '"modules"' %>, "jsSrcsDir": "src" }, -<% } -%> "author": "<%- author.name -%> <<%- author.email -%>> (<%- author.url -%>)", "license": "UNLICENSED", "homepage": "<%- repo -%>#readme" diff --git a/packages/create-react-native-library/templates/common/CONTRIBUTING.md b/packages/create-react-native-library/templates/common/CONTRIBUTING.md index fa78e872c..ab5549219 100644 --- a/packages/create-react-native-library/templates/common/CONTRIBUTING.md +++ b/packages/create-react-native-library/templates/common/CONTRIBUTING.md @@ -18,13 +18,14 @@ yarn ``` > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development. -<% if (project.moduleConfig === 'nitro-modules') { -%> +<% if (project.moduleConfig === 'nitro-modules') { -%> This project uses Nitro Modules. If you're not familiar with how Nitro works, make sure to check the [Nitro Modules Docs](https://nitro.margelo.com/). You need to run [Nitrogen](https://nitro.margelo.com/docs/nitrogen) to generate the boilerplate code required for this project. The example app will not build without this step. Run **Nitrogen** in following cases: + - When you make changes to any `*.nitro.ts` files. - When running the project for the first time (since the generated files are not committed to the repository). @@ -33,8 +34,8 @@ To invoke **Nitrogen**, use the following command: ```sh yarn nitrogen ``` -<% } -%> +<% } -%> The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app. @@ -65,7 +66,6 @@ To run the example app on iOS: yarn example ios ``` -<% if (project.arch === 'new') { -%> To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this: ```sh @@ -74,7 +74,6 @@ Running "<%- project.name -%>Example" with {"fabric":true,"initialProps":{"concu Note the `"fabric":true` and `"concurrentRoot":true` properties. -<% } -%> <% if (!project.native) { -%> To run the example app on Web: diff --git a/packages/create-react-native-library/templates/cpp-library/android/CMakeLists.txt b/packages/create-react-native-library/templates/cpp-library/android/CMakeLists.txt deleted file mode 100644 index 9747045ca..000000000 --- a/packages/create-react-native-library/templates/cpp-library/android/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.4.1) -project(<%- project.name -%>) - -set (CMAKE_VERBOSE_MAKEFILE ON) -set (CMAKE_CXX_STANDARD 14) - -add_library(<%- project.identifier -%> - SHARED - ../cpp/<%- project.identifier -%>.cpp - cpp-adapter.cpp -) - -# Specifies a path to native header files. -include_directories( - ../cpp -) diff --git a/packages/create-react-native-library/templates/cpp-library/android/cpp-adapter.cpp b/packages/create-react-native-library/templates/cpp-library/android/cpp-adapter.cpp deleted file mode 100644 index 36b6a390c..000000000 --- a/packages/create-react-native-library/templates/cpp-library/android/cpp-adapter.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "<%- project.identifier -%>.h" - -extern "C" -JNIEXPORT jdouble JNICALL -Java_com_<%- project.package_cpp -%>_<%- project.name -%>Module_nativeMultiply(JNIEnv *env, jclass type, jdouble a, jdouble b) { - return <%- project.package_cpp -%>::multiply(a, b); -} diff --git a/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.cpp b/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.cpp deleted file mode 100644 index 73f81528e..000000000 --- a/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "<%- project.identifier -%>.h" - -namespace <%- project.package_cpp -%> { - double multiply(double a, double b) { - return a * b; - } -} diff --git a/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.h b/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.h deleted file mode 100644 index 7f3ee334f..000000000 --- a/packages/create-react-native-library/templates/cpp-library/cpp/{%- project.identifier %}.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef <%- project.package_cpp.toUpperCase() -%>_H -#define <%- project.package_cpp.toUpperCase() -%>_H - -namespace <%- project.package_cpp -%> { - double multiply(double a, double b); -} - -#endif /* <%- project.package_cpp.toUpperCase() -%>_H */ diff --git a/packages/create-react-native-library/templates/example-module-legacy/example/src/App.tsx b/packages/create-react-native-library/templates/example-module-legacy/example/src/App.tsx deleted file mode 100644 index 05c7d3ad5..000000000 --- a/packages/create-react-native-library/templates/example-module-legacy/example/src/App.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { multiply } from '<%- project.slug -%>'; -import { Text, View, StyleSheet } from 'react-native'; -<% if (project.native) { -%> -import { useState, useEffect } from 'react'; - -export default function App() { - const [result, setResult] = useState(); - - useEffect(() => { - multiply(3, 7).then(setResult); - }, []); - -<% } else { -%> - -const result = multiply(3, 7); - -export default function App() { -<% } -%> - return ( - - Result: {result} - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, -}); diff --git a/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Module.kt b/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Module.kt deleted file mode 100644 index 392956228..000000000 --- a/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Module.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.<%- project.package %> - -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContextBaseJavaModule -import com.facebook.react.bridge.ReactMethod -import com.facebook.react.bridge.Promise - -class <%- project.name -%>Module(reactContext: ReactApplicationContext) : - ReactContextBaseJavaModule(reactContext) { - - override fun getName(): String { - return NAME - } - - // Example method - // See https://reactnative.dev/docs/native-modules-android - @ReactMethod - fun multiply(a: Double, b: Double, promise: Promise) { - promise.resolve(a * b) - } - - companion object { - const val NAME = "<%- project.name -%>" - } -} diff --git a/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt b/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt deleted file mode 100644 index d34649aee..000000000 --- a/packages/create-react-native-library/templates/kotlin-library-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.<%- project.package %> - -import com.facebook.react.ReactPackage -import com.facebook.react.bridge.NativeModule -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.uimanager.ViewManager - - -class <%- project.name -%>Package : ReactPackage { - override fun createNativeModules(reactContext: ReactApplicationContext): List { - return listOf(<%- project.name -%>Module(reactContext)) - } - - override fun createViewManagers(reactContext: ReactApplicationContext): List> { - return emptyList() - } -} diff --git a/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt b/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt deleted file mode 100644 index 67e778677..000000000 --- a/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}Package.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.<%- project.package %> - -import com.facebook.react.ReactPackage -import com.facebook.react.bridge.NativeModule -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.uimanager.ViewManager - - -class <%- project.name -%>Package : ReactPackage { - override fun createNativeModules(reactContext: ReactApplicationContext): List { - return emptyList() - } - - override fun createViewManagers(reactContext: ReactApplicationContext): List> { - return listOf(<%- project.name -%>ViewManager()) - } -} diff --git a/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}ViewManager.kt b/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}ViewManager.kt deleted file mode 100644 index f52229f97..000000000 --- a/packages/create-react-native-library/templates/kotlin-view-legacy/android/src/main/java/com/{%- project.package_dir %}/{%- project.name %}ViewManager.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.<%- project.package %> - -import android.graphics.Color -import android.view.View -import com.facebook.react.uimanager.SimpleViewManager -import com.facebook.react.uimanager.ThemedReactContext -import com.facebook.react.uimanager.annotations.ReactProp - -class <%- project.name -%>ViewManager : SimpleViewManager() { - override fun getName() = "<%- project.name -%>View" - - override fun createViewInstance(reactContext: ThemedReactContext): View { - return View(reactContext) - } - - @ReactProp(name = "color") - fun setColor(view: View, color: String) { - view.setBackgroundColor(Color.parseColor(color)) - } -} diff --git a/packages/create-react-native-library/templates/native-common/android/build.gradle b/packages/create-react-native-library/templates/native-common/android/build.gradle index d7925a44d..0a6265285 100644 --- a/packages/create-react-native-library/templates/native-common/android/build.gradle +++ b/packages/create-react-native-library/templates/native-common/android/build.gradle @@ -15,7 +15,7 @@ buildscript { } } -<% if (project.cpp || project.moduleConfig === 'nitro-modules') { -%> +<% if (project.moduleConfig === 'nitro-modules') { -%> def reactNativeArchitectures() { def value = rootProject.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] @@ -28,9 +28,7 @@ apply plugin: "kotlin-android" apply from: '../nitrogen/generated/android/<%- project.package_cpp -%>+autolinking.gradle' <% } -%> -<% if (project.arch === "new") { -%> apply plugin: "com.facebook.react" -<% } -%> def getExtOrIntegerDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["<%- project.name -%>_" + name]).toInteger() @@ -60,15 +58,12 @@ android { } } -<% if (project.cpp) { -%> - ndkVersion getExtOrDefault("ndkVersion") -<% } -%> compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") defaultConfig { minSdkVersion getExtOrIntegerDefault("minSdkVersion") targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") -<% if (project.cpp || project.moduleConfig === 'nitro-modules') { -%> +<% if (project.moduleConfig === 'nitro-modules') { -%> externalNativeBuild { cmake { @@ -88,7 +83,7 @@ android { } <% } -%> } -<% if (project.cpp || project.moduleConfig === 'nitro-modules') { -%> +<% if (project.moduleConfig === 'nitro-modules') { -%> externalNativeBuild { cmake { @@ -119,7 +114,6 @@ android { ] } <% } -%> -<% if (project.arch === "new") { -%> buildFeatures { buildConfig true @@ -127,7 +121,6 @@ android { prefab true <% } -%> } -<% } -%> buildTypes { release { @@ -143,7 +136,6 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } -<% if (project.arch === "new") { -%> sourceSets { main { @@ -153,7 +145,6 @@ android { ] } } -<% } -%> } repositories { diff --git a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec index ec8f8785c..c6ea4db12 100644 --- a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec +++ b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec @@ -13,15 +13,11 @@ Pod::Spec.new do |s| s.platforms = { :ios => min_ios_version_supported } s.source = { :git => "<%- repo -%>.git", :tag => "#{s.version}" } -<% if (project.cpp) { -%> - s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}" -<% } else if (project.swift) { -%> +<% if (project.swift) { -%> s.source_files = "ios/**/*.{h,m,mm,swift}" -<% } else if (project.arch !== "legacy") { -%> +<% } else { -%> s.source_files = "ios/**/*.{h,m,mm,cpp}" s.private_header_files = "ios/**/*.h" -<% } else { -%> - s.source_files = "ios/**/*.{h,m,mm}" <% } -%> <% if (project.moduleConfig === "nitro-modules") { -%> diff --git a/packages/create-react-native-library/templates/native-library-legacy/src/index.tsx b/packages/create-react-native-library/templates/native-library-legacy/src/index.tsx deleted file mode 100644 index 651971c33..000000000 --- a/packages/create-react-native-library/templates/native-library-legacy/src/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { NativeModules, Platform } from 'react-native'; - -const LINKING_ERROR = - `The package '<%- project.slug -%>' doesn't seem to be linked. Make sure: \n\n` + - Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo Go\n'; - -const <%- project.name -%> = NativeModules.<%- project.name %> - ? NativeModules.<%- project.name %> - : new Proxy( - {}, - { - get() { - throw new Error(LINKING_ERROR); - }, - } - ); - -export function multiply(a: number, b: number): Promise { - return <%- project.name -%>.multiply(a, b); -} diff --git a/packages/create-react-native-library/templates/native-view-legacy/src/index.tsx b/packages/create-react-native-library/templates/native-view-legacy/src/index.tsx deleted file mode 100644 index 055016821..000000000 --- a/packages/create-react-native-library/templates/native-view-legacy/src/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { - requireNativeComponent, - UIManager, - Platform, - type ViewStyle, -} from 'react-native'; - -const LINKING_ERROR = - `The package '<%- project.slug -%>' doesn't seem to be linked. Make sure: \n\n` + - Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo Go\n'; - -type <%- project.name -%>Props = { - color: string; - style: ViewStyle; -}; - -const ComponentName = '<%- project.name -%>View'; - -export const <%- project.name -%>View = - UIManager.getViewManagerConfig(ComponentName) != null - ? requireNativeComponent<<%- project.name -%>Props>(ComponentName) - : () => { - throw new Error(LINKING_ERROR); - }; diff --git a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h index 2ab64d0f7..cd2f0acd7 100644 --- a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h +++ b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h @@ -1,17 +1,5 @@ -<% if (project.cpp) { -%> -#ifdef __cplusplus -#import "<%- project.identifier -%>.h" -#endif -<% } -%> - -<% if (project.arch === 'new') { -%> #import <<%- project.name -%>/RN<%- project.name -%>Spec.h> @interface <%- project.name -%> : NSObject Spec> -<% } else { -%> -#import - -@interface <%- project.name -%> : NSObject -<% } -%> @end diff --git a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.mm b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.mm index 823ce78c0..ce5beab67 100644 --- a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.mm +++ b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.mm @@ -4,31 +4,8 @@ @implementation <%- project.name -%> RCT_EXPORT_MODULE() -<% if (project.arch === 'legacy') { -%> -// Example method -// See // https://reactnative.dev/docs/native-modules-ios -RCT_EXPORT_METHOD(multiply:(double)a - b:(double)b - resolve:(RCTPromiseResolveBlock)resolve - reject:(RCTPromiseRejectBlock)reject) -{ -<% if (project.cpp) { -%> - NSNumber *result = @(<%- project.package_cpp -%>::multiply(a, b)); -<% } else { -%> - NSNumber *result = @(a * b); -<% } -%> - - resolve(result); -} - -<% } -%> -<% if (project.arch === 'new') { -%> - (NSNumber *)multiply:(double)a b:(double)b { -<% if (project.cpp) { -%> - NSNumber *result = @(<%- project.package_cpp -%>::multiply(a, b)); -<% } else { -%> NSNumber *result = @(a * b); -<% } -%> return result; } @@ -38,6 +15,5 @@ - (NSNumber *)multiply:(double)a b:(double)b { { return std::make_sharedSpecJSI>(params); } -<% } -%> @end diff --git a/packages/create-react-native-library/templates/objc-view-legacy/ios/{%- project.name %}ViewManager.m b/packages/create-react-native-library/templates/objc-view-legacy/ios/{%- project.name %}ViewManager.m deleted file mode 100644 index c9f9c0e00..000000000 --- a/packages/create-react-native-library/templates/objc-view-legacy/ios/{%- project.name %}ViewManager.m +++ /dev/null @@ -1,34 +0,0 @@ -#import - -@interface <%- project.name -%>ViewManager : RCTViewManager -@end - -@implementation <%- project.name -%>ViewManager - -RCT_EXPORT_MODULE(<%- project.name -%>View) - -- (UIView *)view -{ - return [[UIView alloc] init]; -} - -RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView) -{ - [view setBackgroundColor:[self hexStringToColor:json]]; -} - -- hexStringToColor:(NSString *)stringToConvert -{ - NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""]; - NSScanner *stringScanner = [NSScanner scannerWithString:noHashString]; - - unsigned hex; - if (![stringScanner scanHexInt:&hex]) return nil; - int r = (hex >> 16) & 0xFF; - int g = (hex >> 8) & 0xFF; - int b = (hex) & 0xFF; - - return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f]; -} - -@end diff --git a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}-Bridging-Header.h b/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}-Bridging-Header.h deleted file mode 100644 index dea7ff6bf..000000000 --- a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}-Bridging-Header.h +++ /dev/null @@ -1,2 +0,0 @@ -#import -#import diff --git a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.mm b/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.mm deleted file mode 100644 index 77a769b05..000000000 --- a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.mm +++ /dev/null @@ -1,14 +0,0 @@ -#import - -@interface RCT_EXTERN_MODULE(<%- project.name -%>, NSObject) - -RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b - withResolver:(RCTPromiseResolveBlock)resolve - withRejecter:(RCTPromiseRejectBlock)reject) - -+ (BOOL)requiresMainQueueSetup -{ - return NO; -} - -@end diff --git a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.swift b/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.swift deleted file mode 100644 index 2c5c942f0..000000000 --- a/packages/create-react-native-library/templates/swift-library-legacy/ios/{%- project.name %}.swift +++ /dev/null @@ -1,8 +0,0 @@ -@objc(<%- project.name -%>) -class <%- project.name -%>: NSObject { - - @objc(multiply:withB:withResolver:withRejecter:) - func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void { - resolve(a*b) - } -} diff --git a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}-Bridging-Header.h b/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}-Bridging-Header.h deleted file mode 100644 index 16eb5eb19..000000000 --- a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import diff --git a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.m b/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.m deleted file mode 100644 index b9adb6816..000000000 --- a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.m +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface RCT_EXTERN_MODULE(<%- project.name -%>ViewManager, RCTViewManager) - -RCT_EXPORT_VIEW_PROPERTY(color, NSString) - -@end diff --git a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.swift b/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.swift deleted file mode 100644 index b075661d3..000000000 --- a/packages/create-react-native-library/templates/swift-view-legacy/ios/{%- project.name %}ViewManager.swift +++ /dev/null @@ -1,36 +0,0 @@ -@objc(<%- project.name -%>ViewManager) -class <%- project.name -%>ViewManager: RCTViewManager { - - override func view() -> (<%- project.name -%>View) { - return <%- project.name -%>View() - } - - @objc override static func requiresMainQueueSetup() -> Bool { - return false - } -} - -class <%- project.name -%>View : UIView { - - @objc var color: String = "" { - didSet { - self.backgroundColor = hexStringToUIColor(hexColor: color) - } - } - - func hexStringToUIColor(hexColor: String) -> UIColor { - let stringScanner = Scanner(string: hexColor) - - if(hexColor.hasPrefix("#")) { - stringScanner.scanLocation = 1 - } - var color: UInt32 = 0 - stringScanner.scanHexInt32(&color) - - let r = CGFloat(Int(color >> 16) & 0x000000FF) - let g = CGFloat(Int(color >> 8) & 0x000000FF) - let b = CGFloat(Int(color) & 0x000000FF) - - return UIColor(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: 1) - } -} From bc1b53e789eda7864b25ea5a4329425a88a84e13 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sun, 13 Apr 2025 15:10:07 +0200 Subject: [PATCH 03/19] fix: move Gemfile to the root --- .../src/exampleApp/generateExampleApp.ts | 15 ++++++++++++--- packages/create-react-native-library/src/index.ts | 2 +- .../templates/common/$.gitignore | 2 +- .../templates/common/CONTRIBUTING.md | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts b/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts index 605aa8d3a..6cedd73d4 100644 --- a/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts +++ b/packages/create-react-native-library/src/exampleApp/generateExampleApp.ts @@ -19,6 +19,8 @@ const FILES_TO_DELETE = [ 'tsconfig.json', ]; +const FILES_TO_MOVE = ['.bundle', 'Gemfile']; + const PACKAGES_TO_REMOVE = [ '@react-native/eslint-config', '@tsconfig/react-native', @@ -42,14 +44,14 @@ const PACKAGES_TO_ADD_WEB = { export default async function generateExampleApp({ config, - destination, + root, reactNativeVersion = 'latest', }: { config: TemplateConfiguration; - destination: string; + root: string; reactNativeVersion?: string; }) { - const directory = path.join(destination, 'example'); + const directory = path.join(root, 'example'); // `npx --package react-native-test-app@latest init --name ${projectName}Example --destination example --version ${reactNativeVersion}` const testAppArgs = [ @@ -117,6 +119,13 @@ export default async function generateExampleApp({ await fs.remove(path.join(directory, file)); } + // Move files to the root + for (const file of FILES_TO_MOVE) { + if (await fs.pathExists(path.join(directory, file))) { + await fs.move(path.join(directory, file), path.join(root, file)); + } + } + // Patch the example app's package.json const pkg = await fs.readJSON(path.join(directory, 'package.json')); diff --git a/packages/create-react-native-library/src/index.ts b/packages/create-react-native-library/src/index.ts index cbe912091..1dce51722 100644 --- a/packages/create-react-native-library/src/index.ts +++ b/packages/create-react-native-library/src/index.ts @@ -107,7 +107,7 @@ async function create(_argv: yargs.Arguments) { spinner.text = 'Generating example app'; await generateExampleApp({ - destination: folder, + root: folder, reactNativeVersion: answers.reactNativeVersion, config, }); diff --git a/packages/create-react-native-library/templates/common/$.gitignore b/packages/create-react-native-library/templates/common/$.gitignore index 67f32126d..4b1fbd43f 100644 --- a/packages/create-react-native-library/templates/common/$.gitignore +++ b/packages/create-react-native-library/templates/common/$.gitignore @@ -46,7 +46,7 @@ android.iml example/ios/Pods # Ruby -example/vendor/ +/vendor/ # node.js # diff --git a/packages/create-react-native-library/templates/common/CONTRIBUTING.md b/packages/create-react-native-library/templates/common/CONTRIBUTING.md index ab5549219..cc21198b0 100644 --- a/packages/create-react-native-library/templates/common/CONTRIBUTING.md +++ b/packages/create-react-native-library/templates/common/CONTRIBUTING.md @@ -35,6 +35,20 @@ To invoke **Nitrogen**, use the following command: yarn nitrogen ``` +<% } -%> +<% if (project.native) { -%> +You also need to install the required ruby gems for the iOS project with [bundler](https://bundler.io/). To install the gems, run the following command in the root directory: + +```sh +bundle install +``` + +Now, you can install [CocoaPods](https://cocoapods.org/) for the iOS project. To do this, run the following command in the `example/ios` directory: + +```sh +bundle exec pod install +``` + <% } -%> The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. From 7dc0af28fc6dd13d97699b0b8bcf9c254f014a8d Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sun, 13 Apr 2025 15:43:52 +0200 Subject: [PATCH 04/19] refactor: drop code for old react native versions we don't need them for new architecture since new architecture is not supported in those versions. --- .../native-common/android/build.gradle | 21 ++----------------- .../android/src/main/AndroidManifest.xml | 3 +-- .../android/src/main/AndroidManifestNew.xml | 2 -- .../native-common/{%- project.name %}.podspec | 9 +------- 4 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifestNew.xml diff --git a/packages/create-react-native-library/templates/native-common/android/build.gradle b/packages/create-react-native-library/templates/native-common/android/build.gradle index 0a6265285..14a2205a8 100644 --- a/packages/create-react-native-library/templates/native-common/android/build.gradle +++ b/packages/create-react-native-library/templates/native-common/android/build.gradle @@ -34,30 +34,13 @@ def getExtOrIntegerDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["<%- project.name -%>_" + name]).toInteger() } -def supportsNamespace() { - def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') - def major = parsed[0].toInteger() - def minor = parsed[1].toInteger() - - // Namespace support was added in 7.3.0 - return (major == 7 && minor >= 3) || major >= 8 -} - android { - if (supportsNamespace()) { <% if (project.moduleConfig === 'nitro-modules') { -%> - namespace "com.margelo.nitro.<%- project.package -%>" + namespace "com.margelo.nitro.<%- project.package -%>" <% } else { -%> - namespace "com.<%- project.package -%>" + namespace "com.<%- project.package -%>" <% } -%> - sourceSets { - main { - manifest.srcFile "src/main/AndroidManifestNew.xml" - } - } - } - compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") defaultConfig { diff --git a/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifest.xml b/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifest.xml index 8c502c937..a2f47b605 100644 --- a/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifest.xml +++ b/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - + diff --git a/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifestNew.xml b/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifestNew.xml deleted file mode 100644 index a2f47b605..000000000 --- a/packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifestNew.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec index c6ea4db12..defe4c1c6 100644 --- a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec +++ b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec @@ -25,11 +25,4 @@ Pod::Spec.new do |s| add_nitrogen_files(s) <% } -%> -# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. -# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. -if respond_to?(:install_modules_dependencies, true) - install_modules_dependencies(s) -else - s.dependency "React-Core" -end -end +install_modules_dependencies(s) From a260218a99443cac14106fff76321f32fbde32c7 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 15 Apr 2025 18:27:49 +0200 Subject: [PATCH 05/19] fix: use react native babel config for node_modules (#823) This uses the react native babel preset for compiling `node_modules` - mainly useful for tests, so that syntaxes such as Flow are handled. Related to ##747 --- .../src/exampleApp/dependencies.ts | 7 ++++++- .../templates/common/$package.json | 1 + .../templates/common/babel.config.js | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/create-react-native-library/src/exampleApp/dependencies.ts b/packages/create-react-native-library/src/exampleApp/dependencies.ts index 25cd11917..1ed1e1a83 100644 --- a/packages/create-react-native-library/src/exampleApp/dependencies.ts +++ b/packages/create-react-native-library/src/exampleApp/dependencies.ts @@ -16,7 +16,12 @@ export async function alignDependencyVersionsWithExampleApp( path.join(folder, 'example', 'package.json') ); - const PACKAGES_TO_COPY = ['react', 'react-native', '@types/react']; + const PACKAGES_TO_COPY = [ + 'react', + 'react-native', + '@types/react', + '@react-native/babel-preset', + ]; if ( config.example === 'vanilla' && diff --git a/packages/create-react-native-library/templates/common/$package.json b/packages/create-react-native-library/templates/common/$package.json index b60b71f6f..b9dfe1fb9 100644 --- a/packages/create-react-native-library/templates/common/$package.json +++ b/packages/create-react-native-library/templates/common/$package.json @@ -80,6 +80,7 @@ "@react-native-community/cli": "15.0.0-alpha.2", <% } -%> "@react-native/eslint-config": "^0.78.0", + "@react-native/babel-preset": "0.78.2", "@release-it/conventional-changelog": "^9.0.2", "@types/jest": "^29.5.5", "@types/react": "^19.0.12", diff --git a/packages/create-react-native-library/templates/common/babel.config.js b/packages/create-react-native-library/templates/common/babel.config.js index 5d51f258a..ebe06257d 100644 --- a/packages/create-react-native-library/templates/common/babel.config.js +++ b/packages/create-react-native-library/templates/common/babel.config.js @@ -1,3 +1,9 @@ module.exports = { presets: ['module:react-native-builder-bob/babel-preset'], + overrides: [ + { + include: /\/node_modules\//, + presets: ['module:@react-native/babel-preset'], + }, + ], }; From a797db31ff02072e1f4ecf722b11872113d9d190 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Wed, 16 Apr 2025 19:17:02 +0100 Subject: [PATCH 06/19] fix: migrate to babel-plugin-syntax-hermes-parser (#822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary Fixes compatibility of `react-native-builder-bob/babel-preset` with React Native versions `>= 0.76.0` — likely broken today, without user config modifications. - `@babel/preset-flow` is [discontinued](https://github.com/babel/babel/issues/16264). The Flow language has since evolved (e.g. `as` syntax) and newer `react-native` versions can no longer be parsed. - This is succeeded by [babel-plugin-syntax-hermes-parser](https://github.com/facebook/hermes/tree/main/tools/hermes-parser/js/babel-plugin-syntax-hermes-parser). Context: - https://github.com/facebook/react-native/issues/50683#issuecomment-2804970384 Co-authored-by: Satyajit Sahoo --- .../templates/common/babel.config.js | 5 +- .../react-native-builder-bob/babel-preset.js | 6 +- .../react-native-builder-bob/package.json | 3 +- yarn.lock | 70 ++++++++++++------- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/packages/create-react-native-library/templates/common/babel.config.js b/packages/create-react-native-library/templates/common/babel.config.js index ebe06257d..0c05fd696 100644 --- a/packages/create-react-native-library/templates/common/babel.config.js +++ b/packages/create-react-native-library/templates/common/babel.config.js @@ -1,6 +1,9 @@ module.exports = { - presets: ['module:react-native-builder-bob/babel-preset'], overrides: [ + { + exclude: /\/node_modules\//, + presets: ['module:react-native-builder-bob/babel-preset'], + }, { include: /\/node_modules\//, presets: ['module:@react-native/babel-preset'], diff --git a/packages/react-native-builder-bob/babel-preset.js b/packages/react-native-builder-bob/babel-preset.js index 7d86c3a85..9470c94ca 100644 --- a/packages/react-native-builder-bob/babel-preset.js +++ b/packages/react-native-builder-bob/babel-preset.js @@ -50,10 +50,14 @@ module.exports = function (api, options, cwd) { }, ], require.resolve('@babel/preset-typescript'), - require.resolve('@babel/preset-flow'), ], plugins: [ require.resolve('@babel/plugin-transform-strict-mode'), + [ + require.resolve('babel-plugin-syntax-hermes-parser'), + { parseLangTypes: 'flow' }, + ], + require.resolve('@babel/plugin-transform-flow-strip-types'), [ require.resolve('./lib/babel'), { diff --git a/packages/react-native-builder-bob/package.json b/packages/react-native-builder-bob/package.json index 77d24aee3..4ed8fe8d2 100644 --- a/packages/react-native-builder-bob/package.json +++ b/packages/react-native-builder-bob/package.json @@ -46,13 +46,14 @@ }, "dependencies": { "@babel/core": "^7.25.2", + "@babel/plugin-transform-flow-strip-types": "^7.26.5", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", - "@babel/preset-flow": "^7.24.7", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "arktype": "^2.1.15", "babel-plugin-module-resolver": "^5.0.2", + "babel-plugin-syntax-hermes-parser": "^0.28.0", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", diff --git a/yarn.lock b/yarn.lock index 54fc15b7c..ae10275d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -244,6 +244,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.26.5": + version: 7.26.5 + resolution: "@babel/helper-plugin-utils@npm:7.26.5" + checksum: 4771fbb1711c624c62d12deabc2ed7435a6e6994b6ce09d5ede1bc1bf19be59c3775461a1e693bdd596af865685e87bb2abc778f62ceadc1b2095a8e2aa74180 + languageName: node + linkType: hard + "@babel/helper-remap-async-to-generator@npm:^7.24.7, @babel/helper-remap-async-to-generator@npm:^7.25.0": version: 7.25.0 resolution: "@babel/helper-remap-async-to-generator@npm:7.25.0" @@ -487,14 +494,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-flow@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/plugin-syntax-flow@npm:7.24.7" +"@babel/plugin-syntax-flow@npm:^7.26.0": + version: 7.26.0 + resolution: "@babel/plugin-syntax-flow@npm:7.26.0" dependencies: - "@babel/helper-plugin-utils": ^7.24.7 + "@babel/helper-plugin-utils": ^7.25.9 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 43b78b5fcdedb2a6d80c3d02a1a564fbfde86b73b442d616a8f318f673caa6ce0151513af5a00fcae42a512f144e70ef259d368b9537ee35d40336a6c895a7d4 + checksum: fdc0d0a7b512e00d933e12cf93c785ea4645a193f4b539230b7601cfaa8c704410199318ce9ea14e5fca7d13e9027822f7d81a7871d3e854df26b6af04cc3c6c languageName: node linkType: hard @@ -859,15 +866,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-flow-strip-types@npm:^7.24.7": - version: 7.25.2 - resolution: "@babel/plugin-transform-flow-strip-types@npm:7.25.2" +"@babel/plugin-transform-flow-strip-types@npm:^7.26.5": + version: 7.26.5 + resolution: "@babel/plugin-transform-flow-strip-types@npm:7.26.5" dependencies: - "@babel/helper-plugin-utils": ^7.24.8 - "@babel/plugin-syntax-flow": ^7.24.7 + "@babel/helper-plugin-utils": ^7.26.5 + "@babel/plugin-syntax-flow": ^7.26.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 9f7b96cbd374077eaf04b59e468976d2e89ec353807d7ac28f129f686945447df92aeb5b60acf906f3ec0f9ebef5d9f88735c7aa39af97033a6ab96c79c9a909 + checksum: a15ae76aea55f1801a5c8ebdfdd0e4616f256ca1eeb504b0781120242aae5a2174439a084bacd2b9e3e83d2a8463cf10c2a8c9f0f0504ded21144297c2b4a380 languageName: node linkType: hard @@ -1433,19 +1440,6 @@ __metadata: languageName: node linkType: hard -"@babel/preset-flow@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/preset-flow@npm:7.24.7" - dependencies: - "@babel/helper-plugin-utils": ^7.24.7 - "@babel/helper-validator-option": ^7.24.7 - "@babel/plugin-transform-flow-strip-types": ^7.24.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 4caca02a6e0a477eb22994d686a1fbf65b5ab0240ae77530696434dba7efff4c5dcbf9186a774168dd4c492423141a22af3f2874c356aa22429f3c83eaf34419 - languageName: node - linkType: hard - "@babel/preset-modules@npm:0.1.6-no-external-plugins": version: 0.1.6-no-external-plugins resolution: "@babel/preset-modules@npm:0.1.6-no-external-plugins" @@ -4616,6 +4610,15 @@ __metadata: languageName: node linkType: hard +"babel-plugin-syntax-hermes-parser@npm:^0.28.0": + version: 0.28.0 + resolution: "babel-plugin-syntax-hermes-parser@npm:0.28.0" + dependencies: + hermes-parser: 0.28.0 + checksum: 62d16a422f935d2a313fc64a9258cea07974cf97d66fce888bc58c044bbfa84ef891ae7dff7cddd3b891f81936534d29df087040f1e8447d6d60668c5e449f50 + languageName: node + linkType: hard + "babel-preset-current-node-syntax@npm:^1.0.0": version: 1.0.1 resolution: "babel-preset-current-node-syntax@npm:1.0.1" @@ -8121,6 +8124,13 @@ __metadata: languageName: node linkType: hard +"hermes-estree@npm:0.28.0": + version: 0.28.0 + resolution: "hermes-estree@npm:0.28.0" + checksum: d4cf9dd2b718bb0ac0681b015befb96c9a3d3709735ebb5e191bbca559cae06215fac37949cb67e3e8d2dd1af829779d2bfe389763759416dac28129b2462ffe + languageName: node + linkType: hard + "hermes-parser@npm:0.20.1": version: 0.20.1 resolution: "hermes-parser@npm:0.20.1" @@ -8130,6 +8140,15 @@ __metadata: languageName: node linkType: hard +"hermes-parser@npm:0.28.0": + version: 0.28.0 + resolution: "hermes-parser@npm:0.28.0" + dependencies: + hermes-estree: 0.28.0 + checksum: 42aa969f4afb29bb76f0df44f7a672c0ce67814e639882091e1c94f579f2e158dcb761885080c66af89287845073f8a115e72a143bc28e5f6ab9814397524930 + languageName: node + linkType: hard + "hosted-git-info@npm:^2.1.4": version: 2.8.9 resolution: "hosted-git-info@npm:2.8.9" @@ -12731,9 +12750,9 @@ __metadata: dependencies: "@babel/cli": ^7.24.8 "@babel/core": ^7.25.2 + "@babel/plugin-transform-flow-strip-types": ^7.26.5 "@babel/plugin-transform-strict-mode": ^7.24.7 "@babel/preset-env": ^7.25.2 - "@babel/preset-flow": ^7.24.7 "@babel/preset-react": ^7.24.7 "@babel/preset-typescript": ^7.24.7 "@jest/globals": ^29.7.0 @@ -12751,6 +12770,7 @@ __metadata: "@types/yargs": ^17.0.10 arktype: ^2.1.15 babel-plugin-module-resolver: ^5.0.2 + babel-plugin-syntax-hermes-parser: ^0.28.0 browserslist: ^4.20.4 concurrently: ^7.2.2 cross-spawn: ^7.0.3 From 243d862bf21504c07c997595a69d4eb128df6c9c Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 16 Apr 2025 20:21:47 +0200 Subject: [PATCH 07/19] refactor: migrate from jest to vitest (#812) --- eslint.config.mjs | 25 + package.json | 1 + .../react-native-builder-bob/package.json | 12 +- .../__tests__/__snapshots__/init.test.ts.snap | 2 +- .../src/__tests__/babel.test.ts | 5 +- .../src/__tests__/init.test.ts | 18 +- packages/react-native-builder-bob/src/init.ts | 19 +- .../patchCodegenAndroidPackage.test.ts | 2 +- .../patches/removeCodegenAppLevelCode.test.ts | 2 +- .../vitest.config.mjs | 7 + yarn.lock | 2080 ++++++++--------- 11 files changed, 1029 insertions(+), 1144 deletions(-) create mode 100644 packages/react-native-builder-bob/vitest.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs index 34dc2c5a7..248e3c609 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,10 +1,35 @@ // eslint-disable-next-line import-x/extensions,import-x/no-unresolved import { defineConfig, globalIgnores } from 'eslint/config'; import satya164 from 'eslint-config-satya164'; +import vitest from '@vitest/eslint-plugin'; export default defineConfig([ satya164, + { + files: ['**/*.{spec,test}.{js,ts,tsx}', '**/__tests__/**/*.{js,ts,tsx}'], + + plugins: { + vitest, + }, + + rules: { + ...vitest.configs.recommended.rules, + + 'vitest/consistent-test-it': ['error', { fn: 'test' }], + 'vitest/expect-expect': 'error', + 'vitest/no-disabled-tests': 'error', + 'vitest/no-duplicate-hooks': 'error', + 'vitest/no-test-prefixes': 'error', + 'vitest/no-test-return-statement': 'error', + 'vitest/prefer-to-be': 'error', + 'vitest/prefer-todo': 'error', + 'vitest/require-to-throw-message': 'error', + + 'jest/no-deprecated-functions': 'off', + }, + }, + globalIgnores([ '**/.next/', '**/.expo/', diff --git a/package.json b/package.json index a4e72a52f..fd0a5a98b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@evilmartians/lefthook": "^1.5.0", "@lerna-lite/cli": "^1.13.0", "@lerna-lite/run": "^1.13.0", + "@vitest/eslint-plugin": "^1.1.39", "commitlint": "^17.0.2", "concurrently": "^7.2.2", "eslint": "^9.23.0", diff --git a/packages/react-native-builder-bob/package.json b/packages/react-native-builder-bob/package.json index 4ed8fe8d2..171cd7af3 100644 --- a/packages/react-native-builder-bob/package.json +++ b/packages/react-native-builder-bob/package.json @@ -37,12 +37,7 @@ }, "scripts": { "prepare": "babel --extensions .ts,.tsx src --out-dir lib --source-maps --delete-dir-on-start", - "test": "jest" - }, - "jest": { - "testPathIgnorePatterns": [ - "/lib/" - ] + "test": "vitest" }, "dependencies": { "@babel/core": "^7.25.2", @@ -71,7 +66,6 @@ }, "devDependencies": { "@babel/cli": "^7.24.8", - "@jest/globals": "^29.7.0", "@types/babel__core": "^7.1.19", "@types/browserslist": "^4.15.0", "@types/cross-spawn": "^6.0.2", @@ -85,8 +79,8 @@ "@types/which": "^2.0.1", "@types/yargs": "^17.0.10", "concurrently": "^7.2.2", - "jest": "^29.7.0", "mock-fs": "^5.2.0", - "mock-stdin": "^1.0.0" + "mock-stdin": "^1.0.0", + "vitest": "^3.1.1" } } diff --git a/packages/react-native-builder-bob/src/__tests__/__snapshots__/init.test.ts.snap b/packages/react-native-builder-bob/src/__tests__/__snapshots__/init.test.ts.snap index c4f3a97c5..ddb9b8e93 100644 --- a/packages/react-native-builder-bob/src/__tests__/__snapshots__/init.test.ts.snap +++ b/packages/react-native-builder-bob/src/__tests__/__snapshots__/init.test.ts.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`initializes the configuration 1`] = ` "{ diff --git a/packages/react-native-builder-bob/src/__tests__/babel.test.ts b/packages/react-native-builder-bob/src/__tests__/babel.test.ts index b99d1c76c..03553723c 100644 --- a/packages/react-native-builder-bob/src/__tests__/babel.test.ts +++ b/packages/react-native-builder-bob/src/__tests__/babel.test.ts @@ -1,7 +1,8 @@ -import { expect, test } from '@jest/globals'; +import { expect, test } from 'vitest'; import { transformFileAsync } from '@babel/core'; import fs from 'node:fs'; import path from 'node:path'; +import plugin from '../babel'; test.each(['imports', 'exports'])(`adds extension to %s`, async (name) => { const filepath = path.resolve( @@ -21,7 +22,7 @@ test.each(['imports', 'exports'])(`adds extension to %s`, async (name) => { babelrc: false, plugins: [ '@babel/plugin-syntax-typescript', - [require.resolve('../babel.ts'), { extension: 'mjs' }], + [plugin, { extension: 'mjs' }], ], }); diff --git a/packages/react-native-builder-bob/src/__tests__/init.test.ts b/packages/react-native-builder-bob/src/__tests__/init.test.ts index 7684155ce..59dde47cf 100644 --- a/packages/react-native-builder-bob/src/__tests__/init.test.ts +++ b/packages/react-native-builder-bob/src/__tests__/init.test.ts @@ -1,13 +1,15 @@ -import { afterEach, beforeEach, expect, test, jest } from '@jest/globals'; +import { afterEach, beforeEach, expect, test, vi, type Mock } from 'vitest'; import { readFile } from 'fs-extra'; import mockFs from 'mock-fs'; import { stdin } from 'mock-stdin'; -import { join } from 'path'; +import { join } from 'node:path'; import { init } from '../init'; -jest.mock('../../package.json', () => ({ - name: 'react-native-builder-bob', - version: '0.5.0', +vi.mock('../../package.json', () => ({ + default: { + name: 'react-native-builder-bob', + version: '0.5.0', + }, })); let io: ReturnType | undefined; @@ -58,17 +60,17 @@ beforeEach(() => { afterEach(() => { io?.restore(); mockFs.restore(); - jest.restoreAllMocks(); + vi.restoreAllMocks(); }); test('initializes the configuration', async () => { - jest.spyOn(process.stdout, 'write').mockImplementation(() => true); + vi.spyOn(process.stdout, 'write').mockImplementation(() => true); process.chdir(root); const run = async () => { await waitFor(() => { - const lastCall = (process.stdout.write as jest.Mock).mock.lastCall; + const lastCall = (process.stdout.write as Mock).mock.lastCall; if (lastCall == null) { throw new Error('No output'); diff --git a/packages/react-native-builder-bob/src/init.ts b/packages/react-native-builder-bob/src/init.ts index 5a7918fae..5d6c9c59b 100644 --- a/packages/react-native-builder-bob/src/init.ts +++ b/packages/react-native-builder-bob/src/init.ts @@ -5,9 +5,7 @@ import dedent from 'dedent'; import isGitDirty from 'is-git-dirty'; import prompts, { type PromptObject } from './utils/prompts'; import { loadConfig } from './utils/loadConfig'; - -// eslint-disable-next-line @typescript-eslint/no-require-imports,import-x/no-commonjs -const { name, version } = require('../package.json'); +import pack from '../package.json'; const FLOW_PRGAMA_REGEX = /\*?\s*@(flow)\b/m; @@ -37,7 +35,11 @@ export async function init() { const pkg = JSON.parse(await fs.readFile(projectPackagePath, 'utf-8')); const result = loadConfig(root); - if (result?.config && pkg.devDependencies && name in pkg.devDependencies) { + if ( + result?.config && + pkg.devDependencies && + pack.name in pkg.devDependencies + ) { const { shouldContinue } = await prompts({ type: 'confirm', name: 'shouldContinue', @@ -75,9 +77,10 @@ export async function init() { } pkg.devDependencies = Object.fromEntries( - [...Object.entries(pkg.devDependencies || {}), [name, `^${version}`]].sort( - ([a], [b]) => a.localeCompare(b) - ) + [ + ...Object.entries(pkg.devDependencies || {}), + [pack.name, `^${pack.version}`], + ].sort(([a], [b]) => a.localeCompare(b)) ); const questions: PromptObject[] = [ @@ -385,7 +388,7 @@ export async function init() { pkg.files = files; } - pkg[name] = { + pkg[pack.name] = { source, output, targets: targets.map((t: string) => { diff --git a/packages/react-native-builder-bob/src/targets/codegen/patches/patchCodegenAndroidPackage.test.ts b/packages/react-native-builder-bob/src/targets/codegen/patches/patchCodegenAndroidPackage.test.ts index b6467cb00..7fa83008c 100644 --- a/packages/react-native-builder-bob/src/targets/codegen/patches/patchCodegenAndroidPackage.test.ts +++ b/packages/react-native-builder-bob/src/targets/codegen/patches/patchCodegenAndroidPackage.test.ts @@ -1,4 +1,4 @@ -import { expect, test, describe, beforeEach, afterEach } from '@jest/globals'; +import { expect, test, describe, beforeEach, afterEach } from 'vitest'; import fs from 'fs-extra'; import path from 'node:path'; import { patchCodegenAndroidPackage } from './patchCodegenAndroidPackage'; diff --git a/packages/react-native-builder-bob/src/targets/codegen/patches/removeCodegenAppLevelCode.test.ts b/packages/react-native-builder-bob/src/targets/codegen/patches/removeCodegenAppLevelCode.test.ts index c8a129cf4..7fb133258 100644 --- a/packages/react-native-builder-bob/src/targets/codegen/patches/removeCodegenAppLevelCode.test.ts +++ b/packages/react-native-builder-bob/src/targets/codegen/patches/removeCodegenAppLevelCode.test.ts @@ -1,4 +1,4 @@ -import { expect, test, describe, beforeEach, afterEach } from '@jest/globals'; +import { expect, describe, beforeEach, afterEach, test } from 'vitest'; import fs from 'fs-extra'; import path from 'node:path'; import { removeCodegenAppLevelCode } from './removeCodegenAppLevelCode'; diff --git a/packages/react-native-builder-bob/vitest.config.mjs b/packages/react-native-builder-bob/vitest.config.mjs new file mode 100644 index 000000000..8ec53f533 --- /dev/null +++ b/packages/react-native-builder-bob/vitest.config.mjs @@ -0,0 +1,7 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + exclude: ['lib/'], + }, +}); diff --git a/yarn.lock b/yarn.lock index ae10275d5..ed93c7132 100644 --- a/yarn.lock +++ b/yarn.lock @@ -65,7 +65,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.24.7": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.24.7": version: 7.24.7 resolution: "@babel/code-frame@npm:7.24.7" dependencies: @@ -82,7 +82,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.20.0, @babel/core@npm:^7.23.9, @babel/core@npm:^7.25.2": +"@babel/core@npm:^7.20.0, @babel/core@npm:^7.25.2": version: 7.25.2 resolution: "@babel/core@npm:7.25.2" dependencies: @@ -105,7 +105,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.20.0, @babel/generator@npm:^7.25.0, @babel/generator@npm:^7.7.2": +"@babel/generator@npm:^7.20.0, @babel/generator@npm:^7.25.0": version: 7.25.0 resolution: "@babel/generator@npm:7.25.0" dependencies: @@ -351,7 +351,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.25.0": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.0": version: 7.25.0 resolution: "@babel/parser@npm:7.25.0" bin: @@ -439,18 +439,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-bigint@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-bigint@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3a10849d83e47aec50f367a9e56a6b22d662ddce643334b087f9828f4c3dd73bdc5909aaeabe123fed78515767f9ca43498a0e621c438d1cd2802d7fae3c9648 - languageName: node - linkType: hard - -"@babel/plugin-syntax-class-properties@npm:^7.12.13, @babel/plugin-syntax-class-properties@npm:^7.8.3": +"@babel/plugin-syntax-class-properties@npm:^7.12.13": version: 7.12.13 resolution: "@babel/plugin-syntax-class-properties@npm:7.12.13" dependencies: @@ -527,7 +516,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-meta@npm:^7.10.4, @babel/plugin-syntax-import-meta@npm:^7.8.3": +"@babel/plugin-syntax-import-meta@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" dependencies: @@ -549,7 +538,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.24.7, @babel/plugin-syntax-jsx@npm:^7.7.2": +"@babel/plugin-syntax-jsx@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-syntax-jsx@npm:7.24.7" dependencies: @@ -560,7 +549,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4, @babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-logical-assignment-operators@npm:7.10.4" dependencies: @@ -582,7 +571,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-numeric-separator@npm:^7.10.4, @babel/plugin-syntax-numeric-separator@npm:^7.8.3": +"@babel/plugin-syntax-numeric-separator@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-numeric-separator@npm:7.10.4" dependencies: @@ -637,7 +626,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-top-level-await@npm:^7.14.5, @babel/plugin-syntax-top-level-await@npm:^7.8.3": +"@babel/plugin-syntax-top-level-await@npm:^7.14.5": version: 7.14.5 resolution: "@babel/plugin-syntax-top-level-await@npm:7.14.5" dependencies: @@ -648,7 +637,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.24.7, @babel/plugin-syntax-typescript@npm:^7.7.2": +"@babel/plugin-syntax-typescript@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-syntax-typescript@npm:7.24.7" dependencies: @@ -1500,7 +1489,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.0.0, @babel/template@npm:^7.24.7, @babel/template@npm:^7.25.0, @babel/template@npm:^7.3.3": +"@babel/template@npm:^7.0.0, @babel/template@npm:^7.24.7, @babel/template@npm:^7.25.0": version: 7.25.0 resolution: "@babel/template@npm:7.25.0" dependencies: @@ -1526,7 +1515,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.25.2 resolution: "@babel/types@npm:7.25.2" dependencies: @@ -1537,13 +1526,6 @@ __metadata: languageName: node linkType: hard -"@bcoe/v8-coverage@npm:^0.2.3": - version: 0.2.3 - resolution: "@bcoe/v8-coverage@npm:0.2.3" - checksum: 850f9305536d0f2bd13e9e0881cb5f02e4f93fad1189f7b2d4bebf694e3206924eadee1068130d43c11b750efcc9405f88a8e42ef098b6d75239c0f047de1a27 - languageName: node - linkType: hard - "@braintree/sanitize-url@npm:^6.0.1": version: 6.0.4 resolution: "@braintree/sanitize-url@npm:6.0.4" @@ -1785,6 +1767,181 @@ __metadata: languageName: node linkType: hard +"@esbuild/aix-ppc64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/aix-ppc64@npm:0.25.2" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/android-arm64@npm:0.25.2" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/android-arm@npm:0.25.2" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/android-x64@npm:0.25.2" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/darwin-arm64@npm:0.25.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/darwin-x64@npm:0.25.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/freebsd-arm64@npm:0.25.2" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/freebsd-x64@npm:0.25.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-arm64@npm:0.25.2" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-arm@npm:0.25.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-ia32@npm:0.25.2" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-loong64@npm:0.25.2" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@esbuild/linux-mips64el@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-mips64el@npm:0.25.2" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-ppc64@npm:0.25.2" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-riscv64@npm:0.25.2" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-s390x@npm:0.25.2" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/linux-x64@npm:0.25.2" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/netbsd-arm64@npm:0.25.2" + conditions: os=netbsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/netbsd-x64@npm:0.25.2" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/openbsd-arm64@npm:0.25.2" + conditions: os=openbsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/openbsd-x64@npm:0.25.2" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/sunos-x64@npm:0.25.2" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/win32-arm64@npm:0.25.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/win32-ia32@npm:0.25.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.25.2": + version: 0.25.2 + resolution: "@esbuild/win32-x64@npm:0.25.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-plugin-eslint-comments@npm:^4.4.1": version: 4.4.1 resolution: "@eslint-community/eslint-plugin-eslint-comments@npm:4.4.1" @@ -2131,175 +2288,6 @@ __metadata: languageName: node linkType: hard -"@istanbuljs/load-nyc-config@npm:^1.0.0": - version: 1.1.0 - resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" - dependencies: - camelcase: ^5.3.1 - find-up: ^4.1.0 - get-package-type: ^0.1.0 - js-yaml: ^3.13.1 - resolve-from: ^5.0.0 - checksum: d578da5e2e804d5c93228450a1380e1a3c691de4953acc162f387b717258512a3e07b83510a936d9fab03eac90817473917e24f5d16297af3867f59328d58568 - languageName: node - linkType: hard - -"@istanbuljs/schema@npm:^0.1.2, @istanbuljs/schema@npm:^0.1.3": - version: 0.1.3 - resolution: "@istanbuljs/schema@npm:0.1.3" - checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 - languageName: node - linkType: hard - -"@jest/console@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/console@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - slash: ^3.0.0 - checksum: 0e3624e32c5a8e7361e889db70b170876401b7d70f509a2538c31d5cd50deb0c1ae4b92dc63fe18a0902e0a48c590c21d53787a0df41a52b34fa7cab96c384d6 - languageName: node - linkType: hard - -"@jest/core@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/core@npm:29.7.0" - dependencies: - "@jest/console": ^29.7.0 - "@jest/reporters": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - ci-info: ^3.2.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - jest-changed-files: ^29.7.0 - jest-config: ^29.7.0 - jest-haste-map: ^29.7.0 - jest-message-util: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-resolve-dependencies: ^29.7.0 - jest-runner: ^29.7.0 - jest-runtime: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - jest-watcher: ^29.7.0 - micromatch: ^4.0.4 - pretty-format: ^29.7.0 - slash: ^3.0.0 - strip-ansi: ^6.0.0 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: af759c9781cfc914553320446ce4e47775ae42779e73621c438feb1e4231a5d4862f84b1d8565926f2d1aab29b3ec3dcfdc84db28608bdf5f29867124ebcfc0d - languageName: node - linkType: hard - -"@jest/environment@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/environment@npm:29.7.0" - dependencies: - "@jest/fake-timers": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-mock: ^29.7.0 - checksum: 6fb398143b2543d4b9b8d1c6dbce83fa5247f84f550330604be744e24c2bd2178bb893657d62d1b97cf2f24baf85c450223f8237cccb71192c36a38ea2272934 - languageName: node - linkType: hard - -"@jest/expect-utils@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/expect-utils@npm:29.7.0" - dependencies: - jest-get-type: ^29.6.3 - checksum: 75eb177f3d00b6331bcaa057e07c0ccb0733a1d0a1943e1d8db346779039cb7f103789f16e502f888a3096fb58c2300c38d1f3748b36a7fa762eb6f6d1b160ed - languageName: node - linkType: hard - -"@jest/expect@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/expect@npm:29.7.0" - dependencies: - expect: ^29.7.0 - jest-snapshot: ^29.7.0 - checksum: a01cb85fd9401bab3370618f4b9013b90c93536562222d920e702a0b575d239d74cecfe98010aaec7ad464f67cf534a353d92d181646a4b792acaa7e912ae55e - languageName: node - linkType: hard - -"@jest/fake-timers@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/fake-timers@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@sinonjs/fake-timers": ^10.0.2 - "@types/node": "*" - jest-message-util: ^29.7.0 - jest-mock: ^29.7.0 - jest-util: ^29.7.0 - checksum: caf2bbd11f71c9241b458d1b5a66cbe95debc5a15d96442444b5d5c7ba774f523c76627c6931cca5e10e76f0d08761f6f1f01a608898f4751a0eee54fc3d8d00 - languageName: node - linkType: hard - -"@jest/globals@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/globals@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/expect": ^29.7.0 - "@jest/types": ^29.6.3 - jest-mock: ^29.7.0 - checksum: 97dbb9459135693ad3a422e65ca1c250f03d82b2a77f6207e7fa0edd2c9d2015fbe4346f3dc9ebff1678b9d8da74754d4d440b7837497f8927059c0642a22123 - languageName: node - linkType: hard - -"@jest/reporters@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/reporters@npm:29.7.0" - dependencies: - "@bcoe/v8-coverage": ^0.2.3 - "@jest/console": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@jridgewell/trace-mapping": ^0.3.18 - "@types/node": "*" - chalk: ^4.0.0 - collect-v8-coverage: ^1.0.0 - exit: ^0.1.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - istanbul-lib-coverage: ^3.0.0 - istanbul-lib-instrument: ^6.0.0 - istanbul-lib-report: ^3.0.0 - istanbul-lib-source-maps: ^4.0.0 - istanbul-reports: ^3.1.3 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - jest-worker: ^29.7.0 - slash: ^3.0.0 - string-length: ^4.0.1 - strip-ansi: ^6.0.0 - v8-to-istanbul: ^9.0.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 7eadabd62cc344f629024b8a268ecc8367dba756152b761bdcb7b7e570a3864fc51b2a9810cd310d85e0a0173ef002ba4528d5ea0329fbf66ee2a3ada9c40455 - languageName: node - linkType: hard - "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -2309,64 +2297,6 @@ __metadata: languageName: node linkType: hard -"@jest/source-map@npm:^29.6.3": - version: 29.6.3 - resolution: "@jest/source-map@npm:29.6.3" - dependencies: - "@jridgewell/trace-mapping": ^0.3.18 - callsites: ^3.0.0 - graceful-fs: ^4.2.9 - checksum: bcc5a8697d471396c0003b0bfa09722c3cd879ad697eb9c431e6164e2ea7008238a01a07193dfe3cbb48b1d258eb7251f6efcea36f64e1ebc464ea3c03ae2deb - languageName: node - linkType: hard - -"@jest/test-result@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/test-result@npm:29.7.0" - dependencies: - "@jest/console": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/istanbul-lib-coverage": ^2.0.0 - collect-v8-coverage: ^1.0.0 - checksum: 67b6317d526e335212e5da0e768e3b8ab8a53df110361b80761353ad23b6aea4432b7c5665bdeb87658ea373b90fb1afe02ed3611ef6c858c7fba377505057fa - languageName: node - linkType: hard - -"@jest/test-sequencer@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/test-sequencer@npm:29.7.0" - dependencies: - "@jest/test-result": ^29.7.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - slash: ^3.0.0 - checksum: 73f43599017946be85c0b6357993b038f875b796e2f0950487a82f4ebcb115fa12131932dd9904026b4ad8be131fe6e28bd8d0aa93b1563705185f9804bff8bd - languageName: node - linkType: hard - -"@jest/transform@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/transform@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@jest/types": ^29.6.3 - "@jridgewell/trace-mapping": ^0.3.18 - babel-plugin-istanbul: ^6.1.1 - chalk: ^4.0.0 - convert-source-map: ^2.0.0 - fast-json-stable-stringify: ^2.1.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-util: ^29.7.0 - micromatch: ^4.0.4 - pirates: ^4.0.4 - slash: ^3.0.0 - write-file-atomic: ^4.0.2 - checksum: 0f8ac9f413903b3cb6d240102db848f2a354f63971ab885833799a9964999dd51c388162106a807f810071f864302cdd8e3f0c241c29ce02d85a36f18f3f40ab - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -2423,6 +2353,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.5.0": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:0.3.9": version: 0.3.9 resolution: "@jridgewell/trace-mapping@npm:0.3.9" @@ -2433,7 +2370,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -3364,65 +3301,187 @@ __metadata: languageName: node linkType: hard -"@sigstore/bundle@npm:^1.1.0": - version: 1.1.0 - resolution: "@sigstore/bundle@npm:1.1.0" - dependencies: - "@sigstore/protobuf-specs": ^0.2.0 - checksum: 9bdd829f2867de6c03a19c5a7cff2c864887a9ed6e1c3438eb6659e838fde0b449fe83b1ca21efa00286a80c71e0144e20c0d9c415eead12e97d149285245c5a +"@rollup/rollup-android-arm-eabi@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.39.0" + conditions: os=android & cpu=arm languageName: node linkType: hard -"@sigstore/protobuf-specs@npm:^0.2.0": - version: 0.2.1 - resolution: "@sigstore/protobuf-specs@npm:0.2.1" - checksum: ddb7c829c7bf4148eccb571ede07cf9fda62f46b7b4d3a5ca02c0308c950ee90b4206b61082ee8d5753f24098632a8b24c147117bef8c68791bf5da537b55db9 +"@rollup/rollup-android-arm64@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-android-arm64@npm:4.39.0" + conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@sigstore/sign@npm:^1.0.0": - version: 1.0.0 - resolution: "@sigstore/sign@npm:1.0.0" - dependencies: - "@sigstore/bundle": ^1.1.0 - "@sigstore/protobuf-specs": ^0.2.0 - make-fetch-happen: ^11.0.1 - checksum: cbdf409c39219d310f398e6a96b3ed7f422a58cfc0d8a40dd5b94996f805f189fdedf51afd559882bc18eb17054bf9d4f1a584b6af7b26c2f807636bceca5b19 +"@rollup/rollup-darwin-arm64@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.39.0" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@sigstore/tuf@npm:^1.0.3": - version: 1.0.3 - resolution: "@sigstore/tuf@npm:1.0.3" - dependencies: - "@sigstore/protobuf-specs": ^0.2.0 - tuf-js: ^1.1.7 - checksum: 0a32594b73ce3b3a4dfeec438ff98866a952a48ee6c020ddf57795062d9d328bc4327bb0e0c8d24011e3870c7d4670bc142a47025cbe7218c776f08084085421 +"@rollup/rollup-darwin-x64@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.39.0" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@sinclair/typebox@npm:^0.27.8": - version: 0.27.8 - resolution: "@sinclair/typebox@npm:0.27.8" - checksum: 00bd7362a3439021aa1ea51b0e0d0a0e8ca1351a3d54c606b115fdcc49b51b16db6e5f43b4fe7a28c38688523e22a94d49dd31168868b655f0d4d50f032d07a1 +"@rollup/rollup-freebsd-arm64@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.39.0" + conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@sinonjs/commons@npm:^3.0.0": - version: 3.0.1 - resolution: "@sinonjs/commons@npm:3.0.1" - dependencies: - type-detect: 4.0.8 - checksum: a7c3e7cc612352f4004873747d9d8b2d4d90b13a6d483f685598c945a70e734e255f1ca5dc49702515533c403b32725defff148177453b3f3915bcb60e9d4601 +"@rollup/rollup-freebsd-x64@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-freebsd-x64@npm:4.39.0" + conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^10.0.2": - version: 10.3.0 - resolution: "@sinonjs/fake-timers@npm:10.3.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.39.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.39.0" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.39.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.39.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-loongarch64-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.39.0" + conditions: os=linux & cpu=loong64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.39.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.39.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-musl@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.39.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-s390x-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.39.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.39.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.39.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.39.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.39.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.39.0": + version: 4.39.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.39.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@sigstore/bundle@npm:^1.1.0": + version: 1.1.0 + resolution: "@sigstore/bundle@npm:1.1.0" + dependencies: + "@sigstore/protobuf-specs": ^0.2.0 + checksum: 9bdd829f2867de6c03a19c5a7cff2c864887a9ed6e1c3438eb6659e838fde0b449fe83b1ca21efa00286a80c71e0144e20c0d9c415eead12e97d149285245c5a + languageName: node + linkType: hard + +"@sigstore/protobuf-specs@npm:^0.2.0": + version: 0.2.1 + resolution: "@sigstore/protobuf-specs@npm:0.2.1" + checksum: ddb7c829c7bf4148eccb571ede07cf9fda62f46b7b4d3a5ca02c0308c950ee90b4206b61082ee8d5753f24098632a8b24c147117bef8c68791bf5da537b55db9 + languageName: node + linkType: hard + +"@sigstore/sign@npm:^1.0.0": + version: 1.0.0 + resolution: "@sigstore/sign@npm:1.0.0" + dependencies: + "@sigstore/bundle": ^1.1.0 + "@sigstore/protobuf-specs": ^0.2.0 + make-fetch-happen: ^11.0.1 + checksum: cbdf409c39219d310f398e6a96b3ed7f422a58cfc0d8a40dd5b94996f805f189fdedf51afd559882bc18eb17054bf9d4f1a584b6af7b26c2f807636bceca5b19 + languageName: node + linkType: hard + +"@sigstore/tuf@npm:^1.0.3": + version: 1.0.3 + resolution: "@sigstore/tuf@npm:1.0.3" dependencies: - "@sinonjs/commons": ^3.0.0 - checksum: 614d30cb4d5201550c940945d44c9e0b6d64a888ff2cd5b357f95ad6721070d6b8839cd10e15b76bf5e14af0bcc1d8f9ec00d49a46318f1f669a4bec1d7f3148 + "@sigstore/protobuf-specs": ^0.2.0 + tuf-js: ^1.1.7 + checksum: 0a32594b73ce3b3a4dfeec438ff98866a952a48ee6c020ddf57795062d9d328bc4327bb0e0c8d24011e3870c7d4670bc142a47025cbe7218c776f08084085421 + languageName: node + linkType: hard + +"@sinclair/typebox@npm:^0.27.8": + version: 0.27.8 + resolution: "@sinclair/typebox@npm:0.27.8" + checksum: 00bd7362a3439021aa1ea51b0e0d0a0e8ca1351a3d54c606b115fdcc49b51b16db6e5f43b4fe7a28c38688523e22a94d49dd31168868b655f0d4d50f032d07a1 languageName: node linkType: hard @@ -3527,7 +3586,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.1.19": +"@types/babel__core@npm:^7.1.19": version: 7.20.5 resolution: "@types/babel__core@npm:7.20.5" dependencies: @@ -3559,7 +3618,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": +"@types/babel__traverse@npm:*": version: 7.20.6 resolution: "@types/babel__traverse@npm:7.20.6" dependencies: @@ -3664,6 +3723,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:1.0.7": + version: 1.0.7 + resolution: "@types/estree@npm:1.0.7" + checksum: d9312b7075bdd08f3c9e1bb477102f5458aaa42a8eec31a169481ce314ca99ac716645cff4fca81ea65a2294b0276a0de63159d1baca0f8e7b5050a92de950ad + languageName: node + linkType: hard + "@types/estree@npm:^1.0.6": version: 1.0.6 resolution: "@types/estree@npm:1.0.6" @@ -3690,15 +3756,6 @@ __metadata: languageName: node linkType: hard -"@types/graceful-fs@npm:^4.1.3": - version: 4.1.9 - resolution: "@types/graceful-fs@npm:4.1.9" - dependencies: - "@types/node": "*" - checksum: 79d746a8f053954bba36bd3d94a90c78de995d126289d656fb3271dd9f1229d33f678da04d10bce6be440494a5a73438e2e363e92802d16b8315b051036c5256 - languageName: node - linkType: hard - "@types/hast@npm:^2.0.0": version: 2.3.6 resolution: "@types/hast@npm:2.3.6" @@ -3717,7 +3774,7 @@ __metadata: languageName: node linkType: hard -"@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": +"@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0": version: 2.0.6 resolution: "@types/istanbul-lib-coverage@npm:2.0.6" checksum: 3feac423fd3e5449485afac999dcfcb3d44a37c830af898b689fadc65d26526460bedb889db278e0d4d815a670331796494d073a10ee6e3a6526301fe7415778 @@ -3897,13 +3954,6 @@ __metadata: languageName: node linkType: hard -"@types/stack-utils@npm:^2.0.0": - version: 2.0.3 - resolution: "@types/stack-utils@npm:2.0.3" - checksum: 72576cc1522090fe497337c2b99d9838e320659ac57fa5560fcbdcbafcf5d0216c6b3a0a8a4ee4fdb3b1f5e3420aa4f6223ab57b82fef3578bec3206425c6cf5 - languageName: node - linkType: hard - "@types/unist@npm:*, @types/unist@npm:^3.0.0": version: 3.0.0 resolution: "@types/unist@npm:3.0.0" @@ -4174,6 +4224,104 @@ __metadata: languageName: node linkType: hard +"@vitest/eslint-plugin@npm:^1.1.39": + version: 1.1.39 + resolution: "@vitest/eslint-plugin@npm:1.1.39" + peerDependencies: + "@typescript-eslint/utils": ^8.24.0 + eslint: ">= 8.57.0" + typescript: ">= 5.0.0" + vitest: "*" + peerDependenciesMeta: + typescript: + optional: true + vitest: + optional: true + checksum: 0730c7d2a24b6e72ad74478991f7426fe889d0a326f4dc5034db5bfb1fcedeb1f54f8d90d61587e66c447139fa5c72af07003d740753860de82a9b0565bd14aa + languageName: node + linkType: hard + +"@vitest/expect@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/expect@npm:3.1.1" + dependencies: + "@vitest/spy": 3.1.1 + "@vitest/utils": 3.1.1 + chai: ^5.2.0 + tinyrainbow: ^2.0.0 + checksum: a345dbdf60470853fc7641268bea2721ab6c117c77b2195fce74aab187284fedf81e7d1d2292336184804993139734169ee8a7af2ac8e7d67f3f8b5b89797f77 + languageName: node + linkType: hard + +"@vitest/mocker@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/mocker@npm:3.1.1" + dependencies: + "@vitest/spy": 3.1.1 + estree-walker: ^3.0.3 + magic-string: ^0.30.17 + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + checksum: a97f5b730360a13e9b6da99c110928eff9c87fe853f18578826025485dc89a42c6870d3c11c30bbe07cac40d45163d3d1b21fc7ed85035dc782b8ecbe4264b96 + languageName: node + linkType: hard + +"@vitest/pretty-format@npm:3.1.1, @vitest/pretty-format@npm:^3.1.1": + version: 3.1.1 + resolution: "@vitest/pretty-format@npm:3.1.1" + dependencies: + tinyrainbow: ^2.0.0 + checksum: 9f036086bf46b65fb062a6e9f796b17dd64f81eeb237ea141f3bcda413bc71a1f17546cd9def4ee75ea0c47f1120a083b048e65cf877ab114a4355105f64e14d + languageName: node + linkType: hard + +"@vitest/runner@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/runner@npm:3.1.1" + dependencies: + "@vitest/utils": 3.1.1 + pathe: ^2.0.3 + checksum: 9d05418116bd8a40415c17fa4a90c5f852b0ab0fe8403655fcaef6d6a8943d511f8e948f775a0c5e49b767c0aaa2372aea44bb0f62c68791e035717638097129 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/snapshot@npm:3.1.1" + dependencies: + "@vitest/pretty-format": 3.1.1 + magic-string: ^0.30.17 + pathe: ^2.0.3 + checksum: 00079c18e21c7271a6b27198f6604645ec5e4cda8f86716ee658a0993d1baaa47ac0064a92ed0a61a29c27a7f2877f3fa6e11a90d3d597c119623732ecaf1f7b + languageName: node + linkType: hard + +"@vitest/spy@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/spy@npm:3.1.1" + dependencies: + tinyspy: ^3.0.2 + checksum: 7ab13a9fed9fa41a2eee2d098c5026938f7899f41bd1a5ae8db6bd3ed2d3fc4ac6d9142e5028391d5d36c54f989c15450ea89d1fb326bc7fcce590cefd290a41 + languageName: node + linkType: hard + +"@vitest/utils@npm:3.1.1": + version: 3.1.1 + resolution: "@vitest/utils@npm:3.1.1" + dependencies: + "@vitest/pretty-format": 3.1.1 + loupe: ^3.1.3 + tinyrainbow: ^2.0.0 + checksum: 6d93b0876b1c708b3b9f5a1203ab3838811798ee1f989e5b06a1de3aca2c61493075a1a44de220c77ddf914b9f0888845612c9a8175d965b98715196fc169ebe + languageName: node + linkType: hard + "JSONStream@npm:^1.0.4, JSONStream@npm:^1.3.5": version: 1.3.5 resolution: "JSONStream@npm:1.3.5" @@ -4503,6 +4651,13 @@ __metadata: languageName: node linkType: hard +"assertion-error@npm:^2.0.1": + version: 2.0.1 + resolution: "assertion-error@npm:2.0.1" + checksum: a0789dd882211b87116e81e2648ccb7f60340b34f19877dd020b39ebb4714e475eb943e14ba3e22201c221ef6645b7bfe10297e76b6ac95b48a9898c1211ce66 + languageName: node + linkType: hard + "astring@npm:^1.8.0": version: 1.8.6 resolution: "astring@npm:1.8.6" @@ -4519,48 +4674,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.7.0": - version: 29.7.0 - resolution: "babel-jest@npm:29.7.0" - dependencies: - "@jest/transform": ^29.7.0 - "@types/babel__core": ^7.1.14 - babel-plugin-istanbul: ^6.1.1 - babel-preset-jest: ^29.6.3 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - slash: ^3.0.0 - peerDependencies: - "@babel/core": ^7.8.0 - checksum: ee6f8e0495afee07cac5e4ee167be705c711a8cc8a737e05a587a131fdae2b3c8f9aa55dfd4d9c03009ac2d27f2de63d8ba96d3e8460da4d00e8af19ef9a83f7 - languageName: node - linkType: hard - -"babel-plugin-istanbul@npm:^6.1.1": - version: 6.1.1 - resolution: "babel-plugin-istanbul@npm:6.1.1" - dependencies: - "@babel/helper-plugin-utils": ^7.0.0 - "@istanbuljs/load-nyc-config": ^1.0.0 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-instrument: ^5.0.4 - test-exclude: ^6.0.0 - checksum: cb4fd95738219f232f0aece1116628cccff16db891713c4ccb501cddbbf9272951a5df81f2f2658dfdf4b3e7b236a9d5cbcf04d5d8c07dd5077297339598061a - languageName: node - linkType: hard - -"babel-plugin-jest-hoist@npm:^29.6.3": - version: 29.6.3 - resolution: "babel-plugin-jest-hoist@npm:29.6.3" - dependencies: - "@babel/template": ^7.3.3 - "@babel/types": ^7.3.3 - "@types/babel__core": ^7.1.14 - "@types/babel__traverse": ^7.0.6 - checksum: 51250f22815a7318f17214a9d44650ba89551e6d4f47a2dc259128428324b52f5a73979d010cefd921fd5a720d8c1d55ad74ff601cd94c7bd44d5f6292fde2d1 - languageName: node - linkType: hard - "babel-plugin-module-resolver@npm:^5.0.2": version: 5.0.2 resolution: "babel-plugin-module-resolver@npm:5.0.2" @@ -4619,40 +4732,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-current-node-syntax@npm:^1.0.0": - version: 1.0.1 - resolution: "babel-preset-current-node-syntax@npm:1.0.1" - dependencies: - "@babel/plugin-syntax-async-generators": ^7.8.4 - "@babel/plugin-syntax-bigint": ^7.8.3 - "@babel/plugin-syntax-class-properties": ^7.8.3 - "@babel/plugin-syntax-import-meta": ^7.8.3 - "@babel/plugin-syntax-json-strings": ^7.8.3 - "@babel/plugin-syntax-logical-assignment-operators": ^7.8.3 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - "@babel/plugin-syntax-numeric-separator": ^7.8.3 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - "@babel/plugin-syntax-top-level-await": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: d118c2742498c5492c095bc8541f4076b253e705b5f1ad9a2e7d302d81a84866f0070346662355c8e25fc02caa28dc2da8d69bcd67794a0d60c4d6fab6913cc8 - languageName: node - linkType: hard - -"babel-preset-jest@npm:^29.6.3": - version: 29.6.3 - resolution: "babel-preset-jest@npm:29.6.3" - dependencies: - babel-plugin-jest-hoist: ^29.6.3 - babel-preset-current-node-syntax: ^1.0.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: aa4ff2a8a728d9d698ed521e3461a109a1e66202b13d3494e41eea30729a5e7cc03b3a2d56c594423a135429c37bf63a9fa8b0b9ce275298be3095a88c69f6fb - languageName: node - linkType: hard - "bail@npm:^2.0.0": version: 2.0.2 resolution: "bail@npm:2.0.2" @@ -4830,6 +4909,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^6.7.14": + version: 6.7.14 + resolution: "cac@npm:6.7.14" + checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a + languageName: node + linkType: hard + "cacache@npm:^17.0.0, cacache@npm:^17.0.4": version: 17.1.4 resolution: "cacache@npm:17.1.4" @@ -4921,6 +5007,19 @@ __metadata: languageName: node linkType: hard +"chai@npm:^5.2.0": + version: 5.2.0 + resolution: "chai@npm:5.2.0" + dependencies: + assertion-error: ^2.0.1 + check-error: ^2.1.1 + deep-eql: ^5.0.1 + loupe: ^3.1.0 + pathval: ^2.0.0 + checksum: 15e4ba12d02df3620fd59b4a6e8efe43b47872ce61f1c0ca77ac1205a2a5898f3b6f1f52408fd1a708b8d07fdfb5e65b97af40bad9fd94a69ed8d4264c7a69f1 + languageName: node + linkType: hard + "chalk@npm:2.3.0": version: 2.3.0 resolution: "chalk@npm:2.3.0" @@ -4953,13 +5052,6 @@ __metadata: languageName: node linkType: hard -"char-regex@npm:^1.0.2": - version: 1.0.2 - resolution: "char-regex@npm:1.0.2" - checksum: b563e4b6039b15213114626621e7a3d12f31008bdce20f9c741d69987f62aeaace7ec30f6018890ad77b2e9b4d95324c9f5acfca58a9441e3b1dcdd1e2525d17 - languageName: node - linkType: hard - "character-entities-html4@npm:^2.0.0": version: 2.1.0 resolution: "character-entities-html4@npm:2.1.0" @@ -4995,6 +5087,13 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^2.1.1": + version: 2.1.1 + resolution: "check-error@npm:2.1.1" + checksum: d785ed17b1d4a4796b6e75c765a9a290098cf52ff9728ce0756e8ffd4293d2e419dd30c67200aee34202463b474306913f2fcfaf1890641026d9fc6966fea27a + languageName: node + linkType: hard + "chokidar@npm:^3.4.0": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -5035,13 +5134,6 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0": - version: 1.3.1 - resolution: "cjs-module-lexer@npm:1.3.1" - checksum: 75f20ac264a397ea5c63f9c2343a51ab878043666468f275e94862f7180ec1d764a400ec0c09085dcf0db3193c74a8b571519abd2bf4be0d2be510d1377c8d4b - languageName: node - linkType: hard - "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -5152,20 +5244,6 @@ __metadata: languageName: node linkType: hard -"co@npm:^4.6.0": - version: 4.6.0 - resolution: "co@npm:4.6.0" - checksum: 5210d9223010eb95b29df06a91116f2cf7c8e0748a9013ed853b53f362ea0e822f1e5bb054fb3cefc645239a4cf966af1f6133a3b43f40d591f3b68ed6cf0510 - languageName: node - linkType: hard - -"collect-v8-coverage@npm:^1.0.0": - version: 1.0.2 - resolution: "collect-v8-coverage@npm:1.0.2" - checksum: c10f41c39ab84629d16f9f6137bc8a63d332244383fc368caf2d2052b5e04c20cd1fd70f66fcf4e2422b84c8226598b776d39d5f2d2a51867cc1ed5d1982b4da - languageName: node - linkType: hard - "color-convert@npm:^1.9.0": version: 1.9.3 resolution: "color-convert@npm:1.9.3" @@ -5591,23 +5669,6 @@ __metadata: languageName: node linkType: hard -"create-jest@npm:^29.7.0": - version: 29.7.0 - resolution: "create-jest@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - jest-config: ^29.7.0 - jest-util: ^29.7.0 - prompts: ^2.0.1 - bin: - create-jest: bin/create-jest.js - checksum: 1427d49458adcd88547ef6fa39041e1fe9033a661293aa8d2c3aa1b4967cb5bf4f0c00436c7a61816558f28ba2ba81a94d5c962e8022ea9a883978fc8e1f2945 - languageName: node - linkType: hard - "create-react-native-library@workspace:packages/create-react-native-library": version: 0.0.0-use.local resolution: "create-react-native-library@workspace:packages/create-react-native-library" @@ -6195,15 +6256,10 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^1.0.0": - version: 1.5.3 - resolution: "dedent@npm:1.5.3" - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - checksum: 045b595557b2a8ea2eb9b0b4623d764e9a87326486fe2b61191b4342ed93dc01245644d8a09f3108a50c0ee7965f1eedd92e4a3a503ed89ea8e810566ea27f9a +"deep-eql@npm:^5.0.1": + version: 5.0.2 + resolution: "deep-eql@npm:5.0.2" + checksum: 6aaaadb4c19cbce42e26b2bbe5bd92875f599d2602635dc97f0294bae48da79e89470aedee05f449e0ca8c65e9fd7e7872624d1933a1db02713d99c2ca8d1f24 languageName: node linkType: hard @@ -6214,13 +6270,6 @@ __metadata: languageName: node linkType: hard -"deepmerge@npm:^4.2.2": - version: 4.3.1 - resolution: "deepmerge@npm:4.3.1" - checksum: 2024c6a980a1b7128084170c4cf56b0fd58a63f2da1660dcfe977415f27b17dbe5888668b59d0b063753f3220719d5e400b7f113609489c90160bb9a5518d052 - languageName: node - linkType: hard - "defaults@npm:^1.0.3": version: 1.0.4 resolution: "defaults@npm:1.0.4" @@ -6313,13 +6362,6 @@ __metadata: languageName: node linkType: hard -"detect-newline@npm:^3.0.0": - version: 3.1.0 - resolution: "detect-newline@npm:3.1.0" - checksum: ae6cd429c41ad01b164c59ea36f264a2c479598e61cba7c99da24175a7ab80ddf066420f2bec9a1c57a6bead411b4655ff15ad7d281c000a89791f48cbe939e7 - languageName: node - linkType: hard - "devlop@npm:^1.0.0, devlop@npm:^1.1.0": version: 1.1.0 resolution: "devlop@npm:1.1.0" @@ -6329,13 +6371,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^29.6.3": - version: 29.6.3 - resolution: "diff-sequences@npm:29.6.3" - checksum: f4914158e1f2276343d98ff5b31fc004e7304f5470bf0f1adb2ac6955d85a531a6458d33e87667f98f6ae52ebd3891bb47d420bb48a5bd8b7a27ee25b20e33aa - languageName: node - linkType: hard - "diff@npm:^4.0.1": version: 4.0.2 resolution: "diff@npm:4.0.2" @@ -6450,13 +6485,6 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.13.1": - version: 0.13.1 - resolution: "emittery@npm:0.13.1" - checksum: 2b089ab6306f38feaabf4f6f02792f9ec85fc054fda79f44f6790e61bbf6bc4e1616afb9b232e0c5ec5289a8a452f79bfa6d905a6fd64e94b49981f0934001c6 - languageName: node - linkType: hard - "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -6535,7 +6563,100 @@ __metadata: languageName: node linkType: hard -"escalade@npm:^3.1.1, escalade@npm:^3.1.2": +"es-module-lexer@npm:^1.6.0": + version: 1.6.0 + resolution: "es-module-lexer@npm:1.6.0" + checksum: 4413a9aed9bf581de62b98174f3eea3f23ce2994fb6832df64bdd6504f6977da1a3b5ebd3c10f75e3c2f214dcf1a1d8b54be5e62c71b7110e6ccedbf975d2b7d + languageName: node + linkType: hard + +"esbuild@npm:^0.25.0": + version: 0.25.2 + resolution: "esbuild@npm:0.25.2" + dependencies: + "@esbuild/aix-ppc64": 0.25.2 + "@esbuild/android-arm": 0.25.2 + "@esbuild/android-arm64": 0.25.2 + "@esbuild/android-x64": 0.25.2 + "@esbuild/darwin-arm64": 0.25.2 + "@esbuild/darwin-x64": 0.25.2 + "@esbuild/freebsd-arm64": 0.25.2 + "@esbuild/freebsd-x64": 0.25.2 + "@esbuild/linux-arm": 0.25.2 + "@esbuild/linux-arm64": 0.25.2 + "@esbuild/linux-ia32": 0.25.2 + "@esbuild/linux-loong64": 0.25.2 + "@esbuild/linux-mips64el": 0.25.2 + "@esbuild/linux-ppc64": 0.25.2 + "@esbuild/linux-riscv64": 0.25.2 + "@esbuild/linux-s390x": 0.25.2 + "@esbuild/linux-x64": 0.25.2 + "@esbuild/netbsd-arm64": 0.25.2 + "@esbuild/netbsd-x64": 0.25.2 + "@esbuild/openbsd-arm64": 0.25.2 + "@esbuild/openbsd-x64": 0.25.2 + "@esbuild/sunos-x64": 0.25.2 + "@esbuild/win32-arm64": 0.25.2 + "@esbuild/win32-ia32": 0.25.2 + "@esbuild/win32-x64": 0.25.2 + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-arm64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-arm64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 2c4e91948b939e711e9342e692fc3c8b0a95acbc1fc9c7628db6092c4aef7c32aa643b2782111625871756084536cebc4831b3f1d5c3b6bd4e4774e21bc4bbea + languageName: node + linkType: hard + +"escalade@npm:^3.1.1, escalade@npm:^3.1.2": version: 3.1.2 resolution: "escalade@npm:3.1.2" checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 @@ -6563,13 +6684,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^2.0.0": - version: 2.0.0 - resolution: "escape-string-regexp@npm:2.0.0" - checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 - languageName: node - linkType: hard - "escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -7080,7 +7194,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^3.0.0": +"estree-walker@npm:^3.0.0, estree-walker@npm:^3.0.3": version: 3.0.3 resolution: "estree-walker@npm:3.0.3" dependencies: @@ -7166,23 +7280,10 @@ __metadata: languageName: node linkType: hard -"exit@npm:^0.1.2": - version: 0.1.2 - resolution: "exit@npm:0.1.2" - checksum: abc407f07a875c3961e4781dfcb743b58d6c93de9ab263f4f8c9d23bb6da5f9b7764fc773f86b43dd88030444d5ab8abcb611cb680fba8ca075362b77114bba3 - languageName: node - linkType: hard - -"expect@npm:^29.7.0": - version: 29.7.0 - resolution: "expect@npm:29.7.0" - dependencies: - "@jest/expect-utils": ^29.7.0 - jest-get-type: ^29.6.3 - jest-matcher-utils: ^29.7.0 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - checksum: 9257f10288e149b81254a0fda8ffe8d54a7061cd61d7515779998b012579d2b8c22354b0eb901daf0145f347403da582f75f359f4810c007182ad3fb318b5c0c +"expect-type@npm:^1.2.0": + version: 1.2.1 + resolution: "expect-type@npm:1.2.1" + checksum: 4fc41ff0c784cb8984ab7801326251d3178083661f0ad08bbd3e5ca789293e6b66d5082f0cef83ebf9849c85d0280a19df5e4e2c57999a2464db9a01c7e3344f languageName: node linkType: hard @@ -7260,7 +7361,7 @@ __metadata: languageName: node linkType: hard -"fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": +"fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb @@ -7507,7 +7608,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": +"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -7517,7 +7618,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": +"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin, fsevents@patch:fsevents@~2.3.3#~builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" dependencies: @@ -7579,13 +7680,6 @@ __metadata: languageName: node linkType: hard -"get-package-type@npm:^0.1.0": - version: 0.1.0 - resolution: "get-package-type@npm:0.1.0" - checksum: bba0811116d11e56d702682ddef7c73ba3481f114590e705fc549f4d868972263896af313c57a25c076e3c0d567e11d919a64ba1b30c879be985fc9d44f96148 - languageName: node - linkType: hard - "get-pkg-repo@npm:^4.0.0": version: 4.2.1 resolution: "get-pkg-repo@npm:4.2.1" @@ -8174,13 +8268,6 @@ __metadata: languageName: node linkType: hard -"html-escaper@npm:^2.0.0": - version: 2.0.2 - resolution: "html-escaper@npm:2.0.2" - checksum: d2df2da3ad40ca9ee3a39c5cc6475ef67c8f83c234475f24d8e9ce0dc80a2c82df8e1d6fa78ddd1e9022a586ea1bd247a615e80a5cd9273d90111ddda7d9e974 - languageName: node - linkType: hard - "html-void-elements@npm:^3.0.0": version: 3.0.0 resolution: "html-void-elements@npm:3.0.0" @@ -8318,7 +8405,7 @@ __metadata: languageName: node linkType: hard -"import-local@npm:^3.0.2, import-local@npm:^3.1.0": +"import-local@npm:^3.1.0": version: 3.1.0 resolution: "import-local@npm:3.1.0" dependencies: @@ -8563,13 +8650,6 @@ __metadata: languageName: node linkType: hard -"is-generator-fn@npm:^2.0.0": - version: 2.1.0 - resolution: "is-generator-fn@npm:2.1.0" - checksum: a6ad5492cf9d1746f73b6744e0c43c0020510b59d56ddcb78a91cbc173f09b5e6beff53d75c9c5a29feb618bfef2bf458e025ecf3a57ad2268e2fb2569f56215 - languageName: node - linkType: hard - "is-git-dirty@npm:^2.0.1": version: 2.0.2 resolution: "is-git-dirty@npm:2.0.2" @@ -8821,466 +8901,44 @@ __metadata: languageName: node linkType: hard -"isobject@npm:^3.0.1": - version: 3.0.1 - resolution: "isobject@npm:3.0.1" - checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 - languageName: node - linkType: hard - -"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": - version: 3.2.2 - resolution: "istanbul-lib-coverage@npm:3.2.2" - checksum: 2367407a8d13982d8f7a859a35e7f8dd5d8f75aae4bb5484ede3a9ea1b426dc245aff28b976a2af48ee759fdd9be374ce2bd2669b644f31e76c5f46a2e29a831 - languageName: node - linkType: hard - -"istanbul-lib-instrument@npm:^5.0.4": - version: 5.2.1 - resolution: "istanbul-lib-instrument@npm:5.2.1" - dependencies: - "@babel/core": ^7.12.3 - "@babel/parser": ^7.14.7 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-coverage: ^3.2.0 - semver: ^6.3.0 - checksum: bf16f1803ba5e51b28bbd49ed955a736488381e09375d830e42ddeb403855b2006f850711d95ad726f2ba3f1ae8e7366de7e51d2b9ac67dc4d80191ef7ddf272 - languageName: node - linkType: hard - -"istanbul-lib-instrument@npm:^6.0.0": - version: 6.0.3 - resolution: "istanbul-lib-instrument@npm:6.0.3" - dependencies: - "@babel/core": ^7.23.9 - "@babel/parser": ^7.23.9 - "@istanbuljs/schema": ^0.1.3 - istanbul-lib-coverage: ^3.2.0 - semver: ^7.5.4 - checksum: 74104c60c65c4fa0e97cc76f039226c356123893929f067bfad5f86fe839e08f5d680354a68fead3bc9c1e2f3fa6f3f53cded70778e821d911e851d349f3545a - languageName: node - linkType: hard - -"istanbul-lib-report@npm:^3.0.0": - version: 3.0.1 - resolution: "istanbul-lib-report@npm:3.0.1" - dependencies: - istanbul-lib-coverage: ^3.0.0 - make-dir: ^4.0.0 - supports-color: ^7.1.0 - checksum: fd17a1b879e7faf9bb1dc8f80b2a16e9f5b7b8498fe6ed580a618c34df0bfe53d2abd35bf8a0a00e628fb7405462576427c7df20bbe4148d19c14b431c974b21 - languageName: node - linkType: hard - -"istanbul-lib-source-maps@npm:^4.0.0": - version: 4.0.1 - resolution: "istanbul-lib-source-maps@npm:4.0.1" - dependencies: - debug: ^4.1.1 - istanbul-lib-coverage: ^3.0.0 - source-map: ^0.6.1 - checksum: 21ad3df45db4b81852b662b8d4161f6446cd250c1ddc70ef96a585e2e85c26ed7cd9c2a396a71533cfb981d1a645508bc9618cae431e55d01a0628e7dec62ef2 - languageName: node - linkType: hard - -"istanbul-reports@npm:^3.1.3": - version: 3.1.7 - resolution: "istanbul-reports@npm:3.1.7" - dependencies: - html-escaper: ^2.0.0 - istanbul-lib-report: ^3.0.0 - checksum: 2072db6e07bfbb4d0eb30e2700250636182398c1af811aea5032acb219d2080f7586923c09fa194029efd6b92361afb3dcbe1ebcc3ee6651d13340f7c6c4ed95 - languageName: node - linkType: hard - -"jackspeak@npm:^2.0.3": - version: 2.3.3 - resolution: "jackspeak@npm:2.3.3" - dependencies: - "@isaacs/cliui": ^8.0.2 - "@pkgjs/parseargs": ^0.11.0 - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 4313a7c0cc44c7753c4cb9869935f0b06f4cf96827515f63f58ff46b3d2f6e29aba6b3b5151778397c3f5ae67ef8bfc48871967bd10343c27e90cff198ec7808 - languageName: node - linkType: hard - -"jake@npm:^10.8.5": - version: 10.8.7 - resolution: "jake@npm:10.8.7" - dependencies: - async: ^3.2.3 - chalk: ^4.0.2 - filelist: ^1.0.4 - minimatch: ^3.1.2 - bin: - jake: bin/cli.js - checksum: a23fd2273fb13f0d0d845502d02c791fd55ef5c6a2d207df72f72d8e1eac6d2b8ffa6caf660bc8006b3242e0daaa88a3ecc600194d72b5c6016ad56e9cd43553 - languageName: node - linkType: hard - -"jest-changed-files@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-changed-files@npm:29.7.0" - dependencies: - execa: ^5.0.0 - jest-util: ^29.7.0 - p-limit: ^3.1.0 - checksum: 963e203893c396c5dfc75e00a49426688efea7361b0f0e040035809cecd2d46b3c01c02be2d9e8d38b1138357d2de7719ea5b5be21f66c10f2e9685a5a73bb99 - languageName: node - linkType: hard - -"jest-circus@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-circus@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/expect": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - co: ^4.6.0 - dedent: ^1.0.0 - is-generator-fn: ^2.0.0 - jest-each: ^29.7.0 - jest-matcher-utils: ^29.7.0 - jest-message-util: ^29.7.0 - jest-runtime: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - p-limit: ^3.1.0 - pretty-format: ^29.7.0 - pure-rand: ^6.0.0 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: 349437148924a5a109c9b8aad6d393a9591b4dac1918fc97d81b7fc515bc905af9918495055071404af1fab4e48e4b04ac3593477b1d5dcf48c4e71b527c70a7 - languageName: node - linkType: hard - -"jest-cli@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-cli@npm:29.7.0" - dependencies: - "@jest/core": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - create-jest: ^29.7.0 - exit: ^0.1.2 - import-local: ^3.0.2 - jest-config: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - yargs: ^17.3.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 664901277a3f5007ea4870632ed6e7889db9da35b2434e7cb488443e6bf5513889b344b7fddf15112135495b9875892b156faeb2d7391ddb9e2a849dcb7b6c36 - languageName: node - linkType: hard - -"jest-config@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-config@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@jest/test-sequencer": ^29.7.0 - "@jest/types": ^29.6.3 - babel-jest: ^29.7.0 - chalk: ^4.0.0 - ci-info: ^3.2.0 - deepmerge: ^4.2.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-circus: ^29.7.0 - jest-environment-node: ^29.7.0 - jest-get-type: ^29.6.3 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-runner: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - micromatch: ^4.0.4 - parse-json: ^5.2.0 - pretty-format: ^29.7.0 - slash: ^3.0.0 - strip-json-comments: ^3.1.1 - peerDependencies: - "@types/node": "*" - ts-node: ">=9.0.0" - peerDependenciesMeta: - "@types/node": - optional: true - ts-node: - optional: true - checksum: 4cabf8f894c180cac80b7df1038912a3fc88f96f2622de33832f4b3314f83e22b08fb751da570c0ab2b7988f21604bdabade95e3c0c041068ac578c085cf7dff - languageName: node - linkType: hard - -"jest-diff@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-diff@npm:29.7.0" - dependencies: - chalk: ^4.0.0 - diff-sequences: ^29.6.3 - jest-get-type: ^29.6.3 - pretty-format: ^29.7.0 - checksum: 08e24a9dd43bfba1ef07a6374e5af138f53137b79ec3d5cc71a2303515335898888fa5409959172e1e05de966c9e714368d15e8994b0af7441f0721ee8e1bb77 - languageName: node - linkType: hard - -"jest-docblock@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-docblock@npm:29.7.0" - dependencies: - detect-newline: ^3.0.0 - checksum: 66390c3e9451f8d96c5da62f577a1dad701180cfa9b071c5025acab2f94d7a3efc2515cfa1654ebe707213241541ce9c5530232cdc8017c91ed64eea1bd3b192 - languageName: node - linkType: hard - -"jest-each@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-each@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - jest-get-type: ^29.6.3 - jest-util: ^29.7.0 - pretty-format: ^29.7.0 - checksum: e88f99f0184000fc8813f2a0aa79e29deeb63700a3b9b7928b8a418d7d93cd24933608591dbbdea732b473eb2021c72991b5cc51a17966842841c6e28e6f691c - languageName: node - linkType: hard - -"jest-environment-node@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-environment-node@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/fake-timers": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-mock: ^29.7.0 - jest-util: ^29.7.0 - checksum: 501a9966292cbe0ca3f40057a37587cb6def25e1e0c5e39ac6c650fe78d3c70a2428304341d084ac0cced5041483acef41c477abac47e9a290d5545fd2f15646 - languageName: node - linkType: hard - -"jest-get-type@npm:^29.6.3": - version: 29.6.3 - resolution: "jest-get-type@npm:29.6.3" - checksum: 88ac9102d4679d768accae29f1e75f592b760b44277df288ad76ce5bf038c3f5ce3719dea8aa0f035dac30e9eb034b848ce716b9183ad7cc222d029f03e92205 - languageName: node - linkType: hard - -"jest-haste-map@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-haste-map@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/graceful-fs": ^4.1.3 - "@types/node": "*" - anymatch: ^3.0.3 - fb-watchman: ^2.0.0 - fsevents: ^2.3.2 - graceful-fs: ^4.2.9 - jest-regex-util: ^29.6.3 - jest-util: ^29.7.0 - jest-worker: ^29.7.0 - micromatch: ^4.0.4 - walker: ^1.0.8 - dependenciesMeta: - fsevents: - optional: true - checksum: c2c8f2d3e792a963940fbdfa563ce14ef9e14d4d86da645b96d3cd346b8d35c5ce0b992ee08593939b5f718cf0a1f5a90011a056548a1dbf58397d4356786f01 - languageName: node - linkType: hard - -"jest-leak-detector@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-leak-detector@npm:29.7.0" - dependencies: - jest-get-type: ^29.6.3 - pretty-format: ^29.7.0 - checksum: e3950e3ddd71e1d0c22924c51a300a1c2db6cf69ec1e51f95ccf424bcc070f78664813bef7aed4b16b96dfbdeea53fe358f8aeaaea84346ae15c3735758f1605 - languageName: node - linkType: hard - -"jest-matcher-utils@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-matcher-utils@npm:29.7.0" - dependencies: - chalk: ^4.0.0 - jest-diff: ^29.7.0 - jest-get-type: ^29.6.3 - pretty-format: ^29.7.0 - checksum: d7259e5f995d915e8a37a8fd494cb7d6af24cd2a287b200f831717ba0d015190375f9f5dc35393b8ba2aae9b2ebd60984635269c7f8cff7d85b077543b7744cd - languageName: node - linkType: hard - -"jest-message-util@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-message-util@npm:29.7.0" - dependencies: - "@babel/code-frame": ^7.12.13 - "@jest/types": ^29.6.3 - "@types/stack-utils": ^2.0.0 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - micromatch: ^4.0.4 - pretty-format: ^29.7.0 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: a9d025b1c6726a2ff17d54cc694de088b0489456c69106be6b615db7a51b7beb66788bea7a59991a019d924fbf20f67d085a445aedb9a4d6760363f4d7d09930 - languageName: node - linkType: hard - -"jest-mock@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-mock@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-util: ^29.7.0 - checksum: 81ba9b68689a60be1482212878973700347cb72833c5e5af09895882b9eb5c4e02843a1bbdf23f94c52d42708bab53a30c45a3482952c9eec173d1eaac5b86c5 - languageName: node - linkType: hard - -"jest-pnp-resolver@npm:^1.2.2": - version: 1.2.3 - resolution: "jest-pnp-resolver@npm:1.2.3" - peerDependencies: - jest-resolve: "*" - peerDependenciesMeta: - jest-resolve: - optional: true - checksum: db1a8ab2cb97ca19c01b1cfa9a9c8c69a143fde833c14df1fab0766f411b1148ff0df878adea09007ac6a2085ec116ba9a996a6ad104b1e58c20adbf88eed9b2 - languageName: node - linkType: hard - -"jest-regex-util@npm:^29.6.3": - version: 29.6.3 - resolution: "jest-regex-util@npm:29.6.3" - checksum: 0518beeb9bf1228261695e54f0feaad3606df26a19764bc19541e0fc6e2a3737191904607fb72f3f2ce85d9c16b28df79b7b1ec9443aa08c3ef0e9efda6f8f2a - languageName: node - linkType: hard - -"jest-resolve-dependencies@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-resolve-dependencies@npm:29.7.0" - dependencies: - jest-regex-util: ^29.6.3 - jest-snapshot: ^29.7.0 - checksum: aeb75d8150aaae60ca2bb345a0d198f23496494677cd6aefa26fc005faf354061f073982175daaf32b4b9d86b26ca928586344516e3e6969aa614cb13b883984 - languageName: node - linkType: hard - -"jest-resolve@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-resolve@npm:29.7.0" - dependencies: - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-pnp-resolver: ^1.2.2 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - resolve: ^1.20.0 - resolve.exports: ^2.0.0 - slash: ^3.0.0 - checksum: 0ca218e10731aa17920526ec39deaec59ab9b966237905ffc4545444481112cd422f01581230eceb7e82d86f44a543d520a71391ec66e1b4ef1a578bd5c73487 +"isobject@npm:^3.0.1": + version: 3.0.1 + resolution: "isobject@npm:3.0.1" + checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 languageName: node linkType: hard -"jest-runner@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-runner@npm:29.7.0" +"jackspeak@npm:^2.0.3": + version: 2.3.3 + resolution: "jackspeak@npm:2.3.3" dependencies: - "@jest/console": ^29.7.0 - "@jest/environment": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - emittery: ^0.13.1 - graceful-fs: ^4.2.9 - jest-docblock: ^29.7.0 - jest-environment-node: ^29.7.0 - jest-haste-map: ^29.7.0 - jest-leak-detector: ^29.7.0 - jest-message-util: ^29.7.0 - jest-resolve: ^29.7.0 - jest-runtime: ^29.7.0 - jest-util: ^29.7.0 - jest-watcher: ^29.7.0 - jest-worker: ^29.7.0 - p-limit: ^3.1.0 - source-map-support: 0.5.13 - checksum: f0405778ea64812bf9b5c50b598850d94ccf95d7ba21f090c64827b41decd680ee19fcbb494007cdd7f5d0d8906bfc9eceddd8fa583e753e736ecd462d4682fb + "@isaacs/cliui": ^8.0.2 + "@pkgjs/parseargs": ^0.11.0 + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 4313a7c0cc44c7753c4cb9869935f0b06f4cf96827515f63f58ff46b3d2f6e29aba6b3b5151778397c3f5ae67ef8bfc48871967bd10343c27e90cff198ec7808 languageName: node linkType: hard -"jest-runtime@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-runtime@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/fake-timers": ^29.7.0 - "@jest/globals": ^29.7.0 - "@jest/source-map": ^29.6.3 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - cjs-module-lexer: ^1.0.0 - collect-v8-coverage: ^1.0.0 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-message-util: ^29.7.0 - jest-mock: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - slash: ^3.0.0 - strip-bom: ^4.0.0 - checksum: d19f113d013e80691e07047f68e1e3448ef024ff2c6b586ce4f90cd7d4c62a2cd1d460110491019719f3c59bfebe16f0e201ed005ef9f80e2cf798c374eed54e +"jake@npm:^10.8.5": + version: 10.8.7 + resolution: "jake@npm:10.8.7" + dependencies: + async: ^3.2.3 + chalk: ^4.0.2 + filelist: ^1.0.4 + minimatch: ^3.1.2 + bin: + jake: bin/cli.js + checksum: a23fd2273fb13f0d0d845502d02c791fd55ef5c6a2d207df72f72d8e1eac6d2b8ffa6caf660bc8006b3242e0daaa88a3ecc600194d72b5c6016ad56e9cd43553 languageName: node linkType: hard -"jest-snapshot@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-snapshot@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@babel/generator": ^7.7.2 - "@babel/plugin-syntax-jsx": ^7.7.2 - "@babel/plugin-syntax-typescript": ^7.7.2 - "@babel/types": ^7.3.3 - "@jest/expect-utils": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - babel-preset-current-node-syntax: ^1.0.0 - chalk: ^4.0.0 - expect: ^29.7.0 - graceful-fs: ^4.2.9 - jest-diff: ^29.7.0 - jest-get-type: ^29.6.3 - jest-matcher-utils: ^29.7.0 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - natural-compare: ^1.4.0 - pretty-format: ^29.7.0 - semver: ^7.5.3 - checksum: 86821c3ad0b6899521ce75ee1ae7b01b17e6dfeff9166f2cf17f012e0c5d8c798f30f9e4f8f7f5bed01ea7b55a6bc159f5eda778311162cbfa48785447c237ad +"jest-get-type@npm:^29.6.3": + version: 29.6.3 + resolution: "jest-get-type@npm:29.6.3" + checksum: 88ac9102d4679d768accae29f1e75f592b760b44277df288ad76ce5bf038c3f5ce3719dea8aa0f035dac30e9eb034b848ce716b9183ad7cc222d029f03e92205 languageName: node linkType: hard @@ -9298,7 +8956,7 @@ __metadata: languageName: node linkType: hard -"jest-validate@npm:^29.6.3, jest-validate@npm:^29.7.0": +"jest-validate@npm:^29.6.3": version: 29.7.0 resolution: "jest-validate@npm:29.7.0" dependencies: @@ -9312,23 +8970,7 @@ __metadata: languageName: node linkType: hard -"jest-watcher@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-watcher@npm:29.7.0" - dependencies: - "@jest/test-result": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - emittery: ^0.13.1 - jest-util: ^29.7.0 - string-length: ^4.0.1 - checksum: 67e6e7fe695416deff96b93a14a561a6db69389a0667e9489f24485bb85e5b54e12f3b2ba511ec0b777eca1e727235b073e3ebcdd473d68888650489f88df92f - languageName: node - linkType: hard - -"jest-worker@npm:^29.6.3, jest-worker@npm:^29.7.0": +"jest-worker@npm:^29.6.3": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" dependencies: @@ -9340,25 +8982,6 @@ __metadata: languageName: node linkType: hard -"jest@npm:^29.7.0": - version: 29.7.0 - resolution: "jest@npm:29.7.0" - dependencies: - "@jest/core": ^29.7.0 - "@jest/types": ^29.6.3 - import-local: ^3.0.2 - jest-cli: ^29.7.0 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 17ca8d67504a7dbb1998cf3c3077ec9031ba3eb512da8d71cb91bcabb2b8995c4e4b292b740cb9bf1cbff5ce3e110b3f7c777b0cefb6f41ab05445f248d0ee0b - languageName: node - linkType: hard - "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -9841,6 +9464,13 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^3.1.0, loupe@npm:^3.1.3": + version: 3.1.3 + resolution: "loupe@npm:3.1.3" + checksum: 9b2530b1d5a44d2c9fc5241f97ea00296dca257173c535b4832bc31f9516e10387991feb5b3fff23df116c8fcf907ce3980f82b215dcc5d19cde17ce9b9ec3e1 + languageName: node + linkType: hard + "lru-cache@npm:^10.2.0": version: 10.4.3 resolution: "lru-cache@npm:10.4.3" @@ -9883,6 +9513,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.30.17": + version: 0.30.17 + resolution: "magic-string@npm:0.30.17" + dependencies: + "@jridgewell/sourcemap-codec": ^1.5.0 + checksum: f4b4ed17c5ada64f77fc98491847302ebad64894a905c417c943840c0384662118c9b37f9f68bb86add159fa4749ff6f118c4627d69a470121b46731f8debc6d + languageName: node + linkType: hard + "make-dir@npm:^2.1.0": version: 2.1.0 resolution: "make-dir@npm:2.1.0" @@ -9902,15 +9541,6 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^4.0.0": - version: 4.0.0 - resolution: "make-dir@npm:4.0.0" - dependencies: - semver: ^7.5.3 - checksum: bf0731a2dd3aab4db6f3de1585cea0b746bb73eb5a02e3d8d72757e376e64e6ada190b1eddcde5b2f24a81b688a9897efd5018737d05e02e2a671dda9cff8a8a - languageName: node - linkType: hard - "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -11583,6 +11213,15 @@ __metadata: languageName: node linkType: hard +"nanoid@npm:^3.3.8": + version: 3.3.11 + resolution: "nanoid@npm:3.3.11" + bin: + nanoid: bin/nanoid.cjs + checksum: 3be20d8866a57a6b6d218e82549711c8352ed969f9ab3c45379da28f405363ad4c9aeb0b39e9abc101a529ca65a72ff9502b00bf74a912c4b64a9d62dfd26c29 + languageName: node + linkType: hard + "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -12439,6 +12078,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^2.0.3": + version: 2.0.3 + resolution: "pathe@npm:2.0.3" + checksum: 0602bdd4acb54d91044e0c56f1fb63467ae7d44ab3afea1f797947b0eb2b4d1d91cf0d58d065fdb0a8ab0c4acbbd8d3a5b424983eaf10dd5285d37a16f6e3ee9 + languageName: node + linkType: hard + +"pathval@npm:^2.0.0": + version: 2.0.0 + resolution: "pathval@npm:2.0.0" + checksum: 682b6a6289de7990909effef7dae9aa7bb6218c0426727bccf66a35b34e7bfbc65615270c5e44e3c9557a5cb44b1b9ef47fc3cb18bce6ad3ba92bcd28467ed7d + languageName: node + linkType: hard + "periscopic@npm:^3.0.0": version: 3.1.0 resolution: "periscopic@npm:3.1.0" @@ -12457,6 +12110,13 @@ __metadata: languageName: node linkType: hard +"picocolors@npm:^1.1.1": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: e1cf46bf84886c79055fdfa9dcb3e4711ad259949e3565154b004b260cd356c5d54b31a1437ce9782624bf766272fe6b0154f5f0c744fb7af5d454d2b60db045 + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -12499,13 +12159,6 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.4": - version: 4.0.6 - resolution: "pirates@npm:4.0.6" - checksum: 46a65fefaf19c6f57460388a5af9ab81e3d7fd0e7bc44ca59d753cb5c4d0df97c6c6e583674869762101836d68675f027d60f841c105d72734df9dfca97cbcc6 - languageName: node - linkType: hard - "pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -12545,6 +12198,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.5.3": + version: 8.5.3 + resolution: "postcss@npm:8.5.3" + dependencies: + nanoid: ^3.3.8 + picocolors: ^1.1.1 + source-map-js: ^1.2.1 + checksum: da574620eb84ff60e65e1d8fc6bd5ad87a19101a23d0aba113c653434161543918229a0f673d89efb3b6d4906287eb04b957310dbcf4cbebacad9d1312711461 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -12633,7 +12297,7 @@ __metadata: languageName: node linkType: hard -"prompts@npm:^2.0.1, prompts@npm:^2.4.2": +"prompts@npm:^2.4.2": version: 2.4.2 resolution: "prompts@npm:2.4.2" dependencies: @@ -12688,13 +12352,6 @@ __metadata: languageName: node linkType: hard -"pure-rand@npm:^6.0.0": - version: 6.1.0 - resolution: "pure-rand@npm:6.1.0" - checksum: 8d53bc02bed99eca0b65b505090152ee7e9bd67dd74f8ff32ba1c883b87234067c5bf68d2614759fb217d82594d7a92919e6df80f97885e7b12b42af4bd3316a - languageName: node - linkType: hard - "q@npm:^1.5.1": version: 1.5.1 resolution: "q@npm:1.5.1" @@ -12755,7 +12412,6 @@ __metadata: "@babel/preset-env": ^7.25.2 "@babel/preset-react": ^7.24.7 "@babel/preset-typescript": ^7.24.7 - "@jest/globals": ^29.7.0 "@types/babel__core": ^7.1.19 "@types/browserslist": ^4.15.0 "@types/cross-spawn": ^6.0.2 @@ -12780,13 +12436,13 @@ __metadata: fs-extra: ^10.1.0 glob: ^8.0.3 is-git-dirty: ^2.0.1 - jest: ^29.7.0 json5: ^2.2.1 kleur: ^4.1.4 metro-config: ^0.80.9 mock-fs: ^5.2.0 mock-stdin: ^1.0.0 prompts: ^2.4.2 + vitest: ^3.1.1 which: ^2.0.2 yargs: ^17.5.1 bin: @@ -13180,14 +12836,7 @@ __metadata: languageName: node linkType: hard -"resolve.exports@npm:^2.0.0": - version: 2.0.2 - resolution: "resolve.exports@npm:2.0.2" - checksum: 1c7778ca1b86a94f8ab4055d196c7d87d1874b96df4d7c3e67bbf793140f0717fd506dcafd62785b079cd6086b9264424ad634fb904409764c3509c3df1653f2 - languageName: node - linkType: hard - -"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.4, resolve@npm:^1.22.8": +"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.22.4, resolve@npm:^1.22.8": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -13200,7 +12849,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.4#~builtin, resolve@patch:resolve@^1.22.8#~builtin": +"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.4#~builtin, resolve@patch:resolve@^1.22.8#~builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -13255,6 +12904,81 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.30.1": + version: 4.39.0 + resolution: "rollup@npm:4.39.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.39.0 + "@rollup/rollup-android-arm64": 4.39.0 + "@rollup/rollup-darwin-arm64": 4.39.0 + "@rollup/rollup-darwin-x64": 4.39.0 + "@rollup/rollup-freebsd-arm64": 4.39.0 + "@rollup/rollup-freebsd-x64": 4.39.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.39.0 + "@rollup/rollup-linux-arm-musleabihf": 4.39.0 + "@rollup/rollup-linux-arm64-gnu": 4.39.0 + "@rollup/rollup-linux-arm64-musl": 4.39.0 + "@rollup/rollup-linux-loongarch64-gnu": 4.39.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.39.0 + "@rollup/rollup-linux-riscv64-gnu": 4.39.0 + "@rollup/rollup-linux-riscv64-musl": 4.39.0 + "@rollup/rollup-linux-s390x-gnu": 4.39.0 + "@rollup/rollup-linux-x64-gnu": 4.39.0 + "@rollup/rollup-linux-x64-musl": 4.39.0 + "@rollup/rollup-win32-arm64-msvc": 4.39.0 + "@rollup/rollup-win32-ia32-msvc": 4.39.0 + "@rollup/rollup-win32-x64-msvc": 4.39.0 + "@types/estree": 1.0.7 + fsevents: ~2.3.2 + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-freebsd-arm64": + optional: true + "@rollup/rollup-freebsd-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-loongarch64-gnu": + optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-riscv64-musl": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: e5205be3107221bc0de467c6f9d2cc4bef18019f5111fa84f24dd640cb1c82c0c46a5f51c052df956fe24bd6a1e34398fb5abe08470f94d29aa7ad08208115e9 + languageName: node + linkType: hard + "root-workspace-0b6124@workspace:.": version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." @@ -13266,6 +12990,7 @@ __metadata: "@evilmartians/lefthook": ^1.5.0 "@lerna-lite/cli": ^1.13.0 "@lerna-lite/run": ^1.13.0 + "@vitest/eslint-plugin": ^1.1.39 commitlint: ^17.0.2 concurrently: ^7.2.2 eslint: ^9.23.0 @@ -13375,7 +13100,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:7.5.4, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -13386,7 +13111,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": +"semver@npm:^6.0.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -13478,6 +13203,13 @@ __metadata: languageName: node linkType: hard +"siginfo@npm:^2.0.0": + version: 2.0.0 + resolution: "siginfo@npm:2.0.0" + checksum: 8aa5a98640ca09fe00d74416eca97551b3e42991614a3d1b824b115fc1401543650914f651ab1311518177e4d297e80b953f4cd4cd7ea1eabe824e8f2091de01 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -13597,13 +13329,10 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:0.5.13": - version: 0.5.13 - resolution: "source-map-support@npm:0.5.13" - dependencies: - buffer-from: ^1.0.0 - source-map: ^0.6.0 - checksum: 933550047b6c1a2328599a21d8b7666507427c0f5ef5eaadd56b5da0fd9505e239053c66fe181bf1df469a3b7af9d775778eee283cbb7ae16b902ddc09e93a97 +"source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b languageName: node linkType: hard @@ -13727,12 +13456,10 @@ __metadata: languageName: node linkType: hard -"stack-utils@npm:^2.0.3": - version: 2.0.6 - resolution: "stack-utils@npm:2.0.6" - dependencies: - escape-string-regexp: ^2.0.0 - checksum: 052bf4d25bbf5f78e06c1d5e67de2e088b06871fa04107ca8d3f0e9d9263326e2942c8bedee3545795fc77d787d443a538345eef74db2f8e35db3558c6f91ff7 +"stackback@npm:0.0.2": + version: 0.0.2 + resolution: "stackback@npm:0.0.2" + checksum: 2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99 languageName: node linkType: hard @@ -13750,6 +13477,13 @@ __metadata: languageName: node linkType: hard +"std-env@npm:^3.8.1": + version: 3.9.0 + resolution: "std-env@npm:3.9.0" + checksum: d40126e4a650f6e5456711e6c297420352a376ef99a9599e8224d2d8f2ff2b91a954f3264fcef888d94fce5c9ae14992c5569761c95556fc87248ce4602ed212 + languageName: node + linkType: hard + "streamsearch@npm:^1.1.0": version: 1.1.0 resolution: "streamsearch@npm:1.1.0" @@ -13757,16 +13491,6 @@ __metadata: languageName: node linkType: hard -"string-length@npm:^4.0.1": - version: 4.0.2 - resolution: "string-length@npm:4.0.2" - dependencies: - char-regex: ^1.0.2 - strip-ansi: ^6.0.0 - checksum: ce85533ef5113fcb7e522bcf9e62cb33871aa99b3729cec5595f4447f660b0cefd542ca6df4150c97a677d58b0cb727a3fe09ac1de94071d05526c73579bf505 - languageName: node - linkType: hard - "string-ts@npm:^2.2.1": version: 2.2.1 resolution: "string-ts@npm:2.2.1" @@ -14033,17 +13757,6 @@ __metadata: languageName: node linkType: hard -"test-exclude@npm:^6.0.0": - version: 6.0.0 - resolution: "test-exclude@npm:6.0.0" - dependencies: - "@istanbuljs/schema": ^0.1.2 - glob: ^7.1.4 - minimatch: ^3.0.4 - checksum: 3b34a3d77165a2cb82b34014b3aba93b1c4637a5011807557dc2f3da826c59975a5ccad765721c4648b39817e3472789f9b0fa98fc854c5c1c7a1e632aacdc28 - languageName: node - linkType: hard - "text-extensions@npm:^1.0.0": version: 1.9.0 resolution: "text-extensions@npm:1.9.0" @@ -14084,6 +13797,20 @@ __metadata: languageName: node linkType: hard +"tinybench@npm:^2.9.0": + version: 2.9.0 + resolution: "tinybench@npm:2.9.0" + checksum: 1ab00d7dfe0d1f127cbf00822bacd9024f7a50a3ecd1f354a8168e0b7d2b53a639a24414e707c27879d1adc0f5153141d51d76ebd7b4d37fe245e742e5d91fe8 + languageName: node + linkType: hard + +"tinyexec@npm:^0.3.2": + version: 0.3.2 + resolution: "tinyexec@npm:0.3.2" + checksum: bd491923020610bdeadb0d8cf5d70e7cbad5a3201620fd01048c9bf3b31ffaa75c33254e1540e13b993ce4e8187852b0b5a93057bb598e7a57afa2ca2048a35c + languageName: node + linkType: hard + "tinyglobby@npm:^0.2.12": version: 0.2.12 resolution: "tinyglobby@npm:0.2.12" @@ -14094,6 +13821,27 @@ __metadata: languageName: node linkType: hard +"tinypool@npm:^1.0.2": + version: 1.0.2 + resolution: "tinypool@npm:1.0.2" + checksum: 752f23114d8fc95a9497fc812231d6d0a63728376aa11e6e8499c10423a91112e760e388887ea7854f1b16977c321f07c0eab061ec2f60f6761e58b184aac880 + languageName: node + linkType: hard + +"tinyrainbow@npm:^2.0.0": + version: 2.0.0 + resolution: "tinyrainbow@npm:2.0.0" + checksum: 26360631d97e43955a07cfb70fe40a154ce4e2bcd14fa3d37ce8e2ed8f4fa9e5ba00783e4906bbfefe6dcabef5d3510f5bee207cb693bee4e4e7553f5454bef1 + languageName: node + linkType: hard + +"tinyspy@npm:^3.0.2": + version: 3.0.2 + resolution: "tinyspy@npm:3.0.2" + checksum: 5db671b2ff5cd309de650c8c4761ca945459d7204afb1776db9a04fb4efa28a75f08517a8620c01ee32a577748802231ad92f7d5b194dc003ee7f987a2a06337 + languageName: node + linkType: hard + "title@npm:^3.5.3": version: 3.5.3 resolution: "title@npm:3.5.3" @@ -14306,13 +14054,6 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": - version: 4.0.8 - resolution: "type-detect@npm:4.0.8" - checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 - languageName: node - linkType: hard - "type-fest@npm:^0.18.0": version: 0.18.1 resolution: "type-fest@npm:0.18.1" @@ -14832,17 +14573,6 @@ __metadata: languageName: node linkType: hard -"v8-to-istanbul@npm:^9.0.1": - version: 9.3.0 - resolution: "v8-to-istanbul@npm:9.3.0" - dependencies: - "@jridgewell/trace-mapping": ^0.3.12 - "@types/istanbul-lib-coverage": ^2.0.1 - convert-source-map: ^2.0.0 - checksum: ded42cd535d92b7fd09a71c4c67fb067487ef5551cc227bfbf2a1f159a842e4e4acddaef20b955789b8d3b455b9779d036853f4a27ce15007f6364a4d30317ae - languageName: node - linkType: hard - "validate-npm-package-license@npm:^3.0.1, validate-npm-package-license@npm:^3.0.4": version: 3.0.4 resolution: "validate-npm-package-license@npm:3.0.4" @@ -14935,6 +14665,126 @@ __metadata: languageName: node linkType: hard +"vite-node@npm:3.1.1": + version: 3.1.1 + resolution: "vite-node@npm:3.1.1" + dependencies: + cac: ^6.7.14 + debug: ^4.4.0 + es-module-lexer: ^1.6.0 + pathe: ^2.0.3 + vite: ^5.0.0 || ^6.0.0 + bin: + vite-node: vite-node.mjs + checksum: 34f214413cdbdf77bd2ff786934fa6c3e7c6628cfae6e6aba92fc7c0438ad0642166e43077954216b7737aed9de5dec4b6a916dea0384b791e1521e242dd2d56 + languageName: node + linkType: hard + +"vite@npm:^5.0.0 || ^6.0.0": + version: 6.2.5 + resolution: "vite@npm:6.2.5" + dependencies: + esbuild: ^0.25.0 + fsevents: ~2.3.3 + postcss: ^8.5.3 + rollup: ^4.30.1 + peerDependencies: + "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: ">=1.21.0" + less: "*" + lightningcss: ^1.21.0 + sass: "*" + sass-embedded: "*" + stylus: "*" + sugarss: "*" + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + bin: + vite: bin/vite.js + checksum: 49a6529c5ae8d6e4926f2daa51d7e20c50d780d8d2ec8c08605e966983fe8d17ec69bc36a356c1a21141c5a630b7a4109f3690c5b33f579d3e2bf26f914a149d + languageName: node + linkType: hard + +"vitest@npm:^3.1.1": + version: 3.1.1 + resolution: "vitest@npm:3.1.1" + dependencies: + "@vitest/expect": 3.1.1 + "@vitest/mocker": 3.1.1 + "@vitest/pretty-format": ^3.1.1 + "@vitest/runner": 3.1.1 + "@vitest/snapshot": 3.1.1 + "@vitest/spy": 3.1.1 + "@vitest/utils": 3.1.1 + chai: ^5.2.0 + debug: ^4.4.0 + expect-type: ^1.2.0 + magic-string: ^0.30.17 + pathe: ^2.0.3 + std-env: ^3.8.1 + tinybench: ^2.9.0 + tinyexec: ^0.3.2 + tinypool: ^1.0.2 + tinyrainbow: ^2.0.0 + vite: ^5.0.0 || ^6.0.0 + vite-node: 3.1.1 + why-is-node-running: ^2.3.0 + peerDependencies: + "@edge-runtime/vm": "*" + "@types/debug": ^4.1.12 + "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0 + "@vitest/browser": 3.1.1 + "@vitest/ui": 3.1.1 + happy-dom: "*" + jsdom: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@types/debug": + optional: true + "@types/node": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + bin: + vitest: vitest.mjs + checksum: 817198380f249388bebc64cdae27e64d04570bc6ca98c13b3518059a655ebf94f413e17bbe5d71bfc2ca444e9ab93d0b39e9da4f455a51600fd92d4fa6c50664 + languageName: node + linkType: hard + "vlq@npm:^1.0.0": version: 1.0.1 resolution: "vlq@npm:1.0.1" @@ -14963,7 +14813,7 @@ __metadata: languageName: node linkType: hard -"walker@npm:^1.0.7, walker@npm:^1.0.8": +"walker@npm:^1.0.7": version: 1.0.8 resolution: "walker@npm:1.0.8" dependencies: @@ -15055,6 +14905,18 @@ __metadata: languageName: node linkType: hard +"why-is-node-running@npm:^2.3.0": + version: 2.3.0 + resolution: "why-is-node-running@npm:2.3.0" + dependencies: + siginfo: ^2.0.0 + stackback: 0.0.2 + bin: + why-is-node-running: cli.js + checksum: 58ebbf406e243ace97083027f0df7ff4c2108baf2595bb29317718ef207cc7a8104e41b711ff65d6fa354f25daa8756b67f2f04931a4fd6ba9d13ae8197496fb + languageName: node + linkType: hard + "wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -15134,16 +14996,6 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.2": - version: 4.0.2 - resolution: "write-file-atomic@npm:4.0.2" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 5da60bd4eeeb935eec97ead3df6e28e5917a6bd317478e4a85a5285e8480b8ed96032bbcc6ecd07b236142a24f3ca871c924ec4a6575e623ec1b11bf8c1c253c - languageName: node - linkType: hard - "write-file-atomic@npm:^5.0.0": version: 5.0.1 resolution: "write-file-atomic@npm:5.0.1" From 8ed72efd555db2405a78c5b6ca746c18443ac18b Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Thu, 17 Apr 2025 18:54:52 +0200 Subject: [PATCH 08/19] fix: fix typo in podspec --- .../templates/native-common/{%- project.name %}.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec index defe4c1c6..84fe2266c 100644 --- a/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec +++ b/packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec @@ -25,4 +25,5 @@ Pod::Spec.new do |s| add_nitrogen_files(s) <% } -%> -install_modules_dependencies(s) + install_modules_dependencies(s) +end From 9ffb17cb038e9f276d19b87b649e0ec3a6a82e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20G=C3=BCner?= Date: Fri, 25 Apr 2025 21:18:03 +0300 Subject: [PATCH 09/19] fix: install nitro modules dependency automatically for local modules (#828) ### Summary - `create-react-native-library` will install `react-native-nitro-modules` automatically for local libraries. ### Test plan 1. Create a new RN app 2. Build the bob repo 3. Link `create-react-native-library` to your RN app 4. Run `create-react-native-library` in the app 5. Answer yes when you're asked if you want to create a native module 6. Select `Nitro Modules` 7. Make sure `react-native-nitro-modules` is added to your app's dependencies. --- .../create-react-native-library/src/index.ts | 72 +++++----- .../create-react-native-library/src/inform.ts | 123 ++++++++---------- .../src/template.ts | 1 + .../src/utils/local.ts | 99 ++++++++++++++ .../src/utils/packageManager.ts | 8 ++ 5 files changed, 202 insertions(+), 101 deletions(-) create mode 100644 packages/create-react-native-library/src/utils/local.ts create mode 100644 packages/create-react-native-library/src/utils/packageManager.ts diff --git a/packages/create-react-native-library/src/index.ts b/packages/create-react-native-library/src/index.ts index 1dce51722..014634ec6 100644 --- a/packages/create-react-native-library/src/index.ts +++ b/packages/create-react-native-library/src/index.ts @@ -6,7 +6,12 @@ import yargs from 'yargs'; import { addCodegenBuildScript } from './exampleApp/addCodegenBuildScript'; import { alignDependencyVersionsWithExampleApp } from './exampleApp/dependencies'; import generateExampleApp from './exampleApp/generateExampleApp'; -import { printErrorHelp, printNextSteps, printUsedRNVersion } from './inform'; +import { + printErrorHelp, + printLocalLibNextSteps, + printNonLocalLibNextSteps, + printUsedRNVersion, +} from './inform'; import { acceptedArgs, createMetadata, @@ -19,6 +24,12 @@ import { assertNpxExists, assertUserInput } from './utils/assert'; import { createInitialGitCommit } from './utils/initialCommit'; import { prompt } from './utils/prompt'; import { resolveNpmPackageVersion } from './utils/resolveNpmPackageVersion'; +import { + addNitroDependencyToLocalLibrary, + linkLocalLibrary, + promptLocalLibrary, +} from './utils/local'; +import { determinePackageManager } from './utils/packageManager'; const FALLBACK_BOB_VERSION = '0.40.5'; const FALLBACK_NITRO_MODULES_VERSION = '0.22.1'; @@ -143,43 +154,44 @@ async function create(_argv: yargs.Arguments) { spaces: 2, }); + const printSuccessMessage = () => + spinner.succeed( + `Project created successfully at ${kleur.yellow( + path.relative(process.cwd(), folder) + )}!\n` + ); + if (!local) { await createInitialGitCommit(folder); - } - - spinner.succeed( - `Project created successfully at ${kleur.yellow( - path.relative(process.cwd(), folder) - )}!\n` - ); - await printNextSteps(local, folder, config); -} + printSuccessMessage(); -async function promptLocalLibrary(argv: Args) { - let local = false; + printNonLocalLibNextSteps(config); + return; + } - if (typeof argv.local === 'boolean') { - local = argv.local; - } else { - const hasPackageJson = await fs.pathExists( - path.join(process.cwd(), 'package.json') - ); + const packageManager = await determinePackageManager(); - if (hasPackageJson) { - // If we're under a project with package.json, ask the user if they want to create a local library - const answers = await prompt({ - type: 'confirm', - name: 'local', - message: `Looks like you're under a project folder. Do you want to create a local library?`, - initial: true, - }); - - local = answers.local; - } + let addedNitro = false; + if (config.project.moduleConfig === 'nitro-modules') { + addedNitro = await addNitroDependencyToLocalLibrary(config); } - return local; + const linkedLocalLibrary = await linkLocalLibrary( + config, + folder, + packageManager + ); + + printSuccessMessage(); + + printLocalLibNextSteps({ + config, + packageManager, + linkedLocalLibrary, + addedNitro, + folder, + }); } async function promptPath(argv: Args, local: boolean) { diff --git a/packages/create-react-native-library/src/inform.ts b/packages/create-react-native-library/src/inform.ts index 8ded66eac..47a8a99fd 100644 --- a/packages/create-react-native-library/src/inform.ts +++ b/packages/create-react-native-library/src/inform.ts @@ -1,60 +1,74 @@ import path from 'path'; -import fs from 'fs-extra'; import dedent from 'dedent'; import type { TemplateConfiguration } from './template'; import kleur from 'kleur'; -export async function printNextSteps( - local: boolean, - folder: string, - config: TemplateConfiguration -) { - if (local) { - let linked; - - const packageManager = (await fs.pathExists( - path.join(process.cwd(), 'yarn.lock') - )) - ? 'yarn' - : 'npm'; - - const packageJsonPath = path.join(process.cwd(), 'package.json'); - - if (await fs.pathExists(packageJsonPath)) { - const packageJson = await fs.readJSON(packageJsonPath); - const isReactNativeProject = Boolean( - packageJson.dependencies?.['react-native'] - ); +export function printNonLocalLibNextSteps(config: TemplateConfiguration) { + const platforms = { + ios: { name: 'iOS', color: 'cyan' }, + android: { name: 'Android', color: 'green' }, + ...(config.example === 'expo' + ? ({ web: { name: 'Web', color: 'blue' } } as const) + : null), + } as const; + + console.log( + dedent(` + ${kleur.magenta( + `${kleur.bold('Get started')} with the project` + )}${kleur.gray(':')} - if (isReactNativeProject) { - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.dependencies[config.project.slug] = - packageManager === 'yarn' - ? `link:./${path.relative(process.cwd(), folder)}` - : `file:./${path.relative(process.cwd(), folder)}`; + ${kleur.gray('$')} yarn + ${Object.entries(platforms) + .map( + ([script, { name, color }]) => ` + ${kleur[color](`Run the example app on ${kleur.bold(name)}`)}${kleur.gray( + ':' + )} - await fs.writeJSON(packageJsonPath, packageJson, { - spaces: 2, - }); + ${kleur.gray('$')} yarn example ${script}` + ) + .join('\n')} - linked = true; - } - } + ${kleur.yellow( + `See ${kleur.bold('CONTRIBUTING.md')} for more details. Good luck!` + )} + `) + ); +} - console.log( - dedent(` +export function printLocalLibNextSteps({ + folder, + config, + linkedLocalLibrary, + addedNitro, + packageManager, +}: { + folder: string; + config: TemplateConfiguration; + linkedLocalLibrary: boolean; + addedNitro: boolean; + packageManager: string; +}) { + console.log( + dedent(` ${kleur.magenta( `${kleur.bold('Get started')} with the project` )}${kleur.gray(':')} ${ - (linked + (linkedLocalLibrary ? `- Run ${kleur.blue( `${packageManager} install` )} to link the library\n` : `- Link the library at ${kleur.blue( path.relative(process.cwd(), folder) )} based on your project setup\n`) + + (config.project.moduleConfig === 'nitro-modules' && !addedNitro + ? `- Run ${kleur.blue( + `${packageManager} add react-native-nitro-modules` + )} to install nitro modules \n` + : '') + `- Run ${kleur.blue( 'pod install --project-directory=ios' )} to install dependencies with CocoaPods\n` + @@ -68,40 +82,7 @@ export async function printNextSteps( ${kleur.yellow(`Good luck!`)} `) - ); - } else { - const platforms = { - ios: { name: 'iOS', color: 'cyan' }, - android: { name: 'Android', color: 'green' }, - ...(config.example === 'expo' - ? ({ web: { name: 'Web', color: 'blue' } } as const) - : null), - } as const; - - console.log( - dedent(` - ${kleur.magenta( - `${kleur.bold('Get started')} with the project` - )}${kleur.gray(':')} - - ${kleur.gray('$')} yarn - ${Object.entries(platforms) - .map( - ([script, { name, color }]) => ` - ${kleur[color](`Run the example app on ${kleur.bold(name)}`)}${kleur.gray( - ':' - )} - - ${kleur.gray('$')} yarn example ${script}` - ) - .join('\n')} - - ${kleur.yellow( - `See ${kleur.bold('CONTRIBUTING.md')} for more details. Good luck!` - )} - `) - ); - } + ); } export function printErrorHelp(message: string, error: Error) { diff --git a/packages/create-react-native-library/src/template.ts b/packages/create-react-native-library/src/template.ts index faad7fcce..901ee136f 100644 --- a/packages/create-react-native-library/src/template.ts +++ b/packages/create-react-native-library/src/template.ts @@ -39,6 +39,7 @@ export type TemplateConfiguration = { email: string; url: string; }; + /** Git repo URL */ repo: string; example: ExampleApp; year: number; diff --git a/packages/create-react-native-library/src/utils/local.ts b/packages/create-react-native-library/src/utils/local.ts new file mode 100644 index 000000000..d785e5ede --- /dev/null +++ b/packages/create-react-native-library/src/utils/local.ts @@ -0,0 +1,99 @@ +import fs from 'fs-extra'; +import path from 'path'; +import { prompt } from './prompt'; +import type { TemplateConfiguration } from '../template'; +import type { Args } from '../input'; + +type PackageJson = { + dependencies?: Record; +}; + +export async function promptLocalLibrary(argv: Args): Promise { + if (typeof argv.local === 'boolean') { + return argv.local; + } + + const hasPackageJson = findAppPackageJsonPath() !== null; + if (!hasPackageJson) { + return false; + } + + // If we're under a project with package.json, ask the user if they want to create a local library + const answers = await prompt({ + type: 'confirm', + name: 'local', + message: `Looks like you're under a project folder. Do you want to create a local library?`, + initial: true, + }); + + return answers.local; +} + +/** @returns `true` if successfull */ +export async function addNitroDependencyToLocalLibrary( + config: TemplateConfiguration +): Promise { + if (config.versions.nitroModules === undefined) { + return false; + } + + const appPackageJsonPath = await findAppPackageJsonPath(); + if (appPackageJsonPath === null) { + return false; + } + + const appPackageJson: PackageJson = await fs.readJson(appPackageJsonPath); + const dependencies = appPackageJson['dependencies'] ?? {}; + + dependencies['react-native-nitro-modules'] = config.versions.nitroModules; + + appPackageJson['dependencies'] = dependencies; + await fs.writeJson(appPackageJsonPath, appPackageJson, { + spaces: 2, + }); + + return true; +} + +/** @returns `true` if successfull */ +export async function linkLocalLibrary( + config: TemplateConfiguration, + folder: string, + packageManager: string +): Promise { + const appPackageJsonPath = await findAppPackageJsonPath(); + if (appPackageJsonPath === null) { + return false; + } + + const appPackageJson: PackageJson = await fs.readJson(appPackageJsonPath); + + const isReactNativeProject = Boolean( + appPackageJson.dependencies?.['react-native'] + ); + + if (!isReactNativeProject) { + return false; + } + + const dependencies = appPackageJson['dependencies'] ?? {}; + dependencies[config.project.slug] = + packageManager === 'yarn' + ? `link:./${path.relative(process.cwd(), folder)}` + : `file:./${path.relative(process.cwd(), folder)}`; + + await fs.writeJSON(appPackageJsonPath, appPackageJson, { + spaces: 2, + }); + + return true; +} + +async function findAppPackageJsonPath(): Promise { + const cwdPackageJson = path.join(process.cwd(), 'package.json'); + if (!(await fs.pathExists(cwdPackageJson))) { + return null; + } + + return cwdPackageJson; +} diff --git a/packages/create-react-native-library/src/utils/packageManager.ts b/packages/create-react-native-library/src/utils/packageManager.ts new file mode 100644 index 000000000..5f7fecb33 --- /dev/null +++ b/packages/create-react-native-library/src/utils/packageManager.ts @@ -0,0 +1,8 @@ +import fs from 'fs-extra'; +import path from 'path'; + +export async function determinePackageManager() { + return (await fs.pathExists(path.join(process.cwd(), 'yarn.lock'))) + ? 'yarn' + : 'npm'; +} From 97c3cc76f56f6fc1c4e4e0cea61a548a1c877e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=87etinkaya?= Date: Fri, 25 Apr 2025 21:18:56 +0300 Subject: [PATCH 10/19] docs: fix dead links in documentation (#826) Replaced outdated links with updated working versions to improve navigation and prevent 404s. --- docs/pages/create.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pages/create.md b/docs/pages/create.md index 56e5eb7c3..44769020e 100644 --- a/docs/pages/create.md +++ b/docs/pages/create.md @@ -7,7 +7,7 @@ If you want to create your own React Native library, scaffolding the project can - Minimal boilerplate for libraries on which you can build upon - Example React Native app to test your library code - [TypeScript](https://www.typescriptlang.org/) to ensure type-safe code and better DX -- Support for [Turbo Modules](https://reactnative.dev/docs/next/the-new-architecture/pillars-turbomodules) & [Fabric](https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components) +- Support for [Turbo Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) & [Fabric](https://reactnative.dev/docs/fabric-native-components-introduction) - Support for [Kotlin](https://kotlinlang.org/) on Android & [Swift](https://developer.apple.com/swift/) on iOS - Support for C++ to write cross-platform native code - [Expo](https://expo.io/) for libraries without native code and web support @@ -86,8 +86,8 @@ This creates a symlink to the library under `node_modules` which makes autolinki Once the project is created, you can follow the official React Native docs to learn the API for writing native modules and components: -- [Native Modules](https://reactnative.dev/docs/native-modules-intro) -- [Native UI Components for Android](https://reactnative.dev/docs/native-components-android) -- [Native UI Components for iOS](https://reactnative.dev/docs/native-components-ios) -- [Turbo Modules](https://reactnative.dev/docs/the-new-architecture/pillars-turbomodules) -- [Fabric Components](https://reactnative.dev/docs/the-new-architecture/pillars-fabric-components) +- [Native Modules](https://reactnative.dev/docs/legacy/native-modules-intro) +- [Native UI Components for Android](https://reactnative.dev/docs/legacy/native-components-android) +- [Native UI Components for iOS](https://reactnative.dev/docs/legacy/native-components-ios) +- [Turbo Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) +- [Fabric Components](https://reactnative.dev/docs/fabric-native-components-introduction) From cffe7dcaf5641f0706d6635bc732a03c93960907 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 25 Apr 2025 21:53:57 +0200 Subject: [PATCH 11/19] docs: add info about import.meta and various conditions to ESM docs --- docs/pages/esm.md | 92 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/docs/pages/esm.md b/docs/pages/esm.md index 2fd0b65dd..4ad95f5f3 100644 --- a/docs/pages/esm.md +++ b/docs/pages/esm.md @@ -65,6 +65,16 @@ Using the `exports` field has a few benefits, such as: - It [restricts access to the library's internals](https://nodejs.org/api/packages.html#main-entry-point-export) by default. You can explicitly specify which files are accessible with [subpath exports](https://nodejs.org/api/packages.html#subpath-exports). - It allows you to specify different entry points for different environments with [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) (e.g. `node`, `browser`, `module`, `react-native`, `production`, `development` etc.). +### A note on `import.meta` + +The [`import.meta`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) object is available in ESM. As per the spec, different tools may add different properties to it. + +For example, Node.js adds [`import.meta.resolve`](https://nodejs.org/api/esm.html#importmetaresolvespecifier) and more, Webpack adds [`import.meta.webpackHot`](https://webpack.js.org/api/module-variables/#importmetawebpackhot), [`import.meta.webpackContext`](https://webpack.js.org/api/module-variables/#importmetawebpackcontext) and more, Vite adds [`import.meta.env`](https://vite.dev/guide/env-and-mode) and more, etc. Most tools support the `import.meta.url` property, which is a URL string representing the module's location. + +Additionally, the `import.meta` syntax is currently not supported in [Metro](https://metrobundler.dev/) (React Native) and will result in a syntax error. + +So be careful when using properties from `import.meta`, as relying on properties only available in specific tools may lock your library into supporting only those specific tools. Also, since this is an ESM-only feature, you should avoid using it if you compile your library to CommonJS as well. + ## Dual package setup The previously mentioned setup only works with tools that support ES modules. If you want to support tools that don't support ESM and use the CommonJS module system, you can configure a dual package setup. @@ -173,6 +183,63 @@ With this approach, the ESM and CommonJS versions of the package are treated as If the library relies on any state that can cause issues if 2 separate instances are loaded (e.g. global state, constructors, react context etc.), it's necessary to isolate the state into a separate CommonJS module that can be shared between the ESM and CommonJS builds. +### Alternative approach + +An alternative approach to classic dual package setup is to use tool specific conditions instead of specifying both `import` and `require`. This way, each tool can load the appropriate build without resulting in a dual package hazard. + +For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (React Native) and Node.js, and CommonJS for the rest: + +```json +{ + "main": "./lib/commonjs/index.js", + "module": "./lib/module/index.js", + "types": "./lib/typescript/commonjs/src/index.d.ts", + "exports": { + ".": { + "react-native": { + "types": "./lib/typescript/module/src/index.d.ts", + "default": "./lib/module/index.native.js" + }, + "module": { + "types": "./lib/typescript/module/src/index.d.ts", + "default": "./lib/module/index.js" + }, + "node": { + "types": "./lib/typescript/module/src/index.d.ts", + "default": "./lib/module/index.js" + }, + "default": { + "types": "./lib/typescript/commonjs/src/index.d.ts", + "default": "./lib/commonjs/index.js" + } + }, + "./package.json": "./package.json" + } +} +``` + +Here, we specify 4 conditions: + +- `react-native`: Used when the library is imported in a React Native environment with Metro. +- `module`: Used when the library is imported in a bundler such as Webpack, Vite or Rollup. +- `node`: Used when the library is imported in Node.js. +- `default`: Fallback used when the library is imported in an environment that doesn't support the other conditions. + +One thing to note is that TypeScript may need to be configured to resolve to the appropriate condition. It's pre-configured for React Native apps, but in other scenarios, it maybe necessary to specify `customConditions` in the `tsconfig.json` file: + +```json +{ + "compilerOptions": { + "moduleResolution": "bundler", + "customConditions": ["module"] + } +} +``` + +This is just an example to illustrate the idea. In practice, you may want to specify appropriate conditions for your library based on the tools you want to support. + +You can find a list of conditions supported in various tools in the [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and the [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). + ## Compatibility [Node.js](https://nodejs.org) v12 and higher natively support ESM and the `exports` field. However, in a CommonJS environment, an ESM library can be loaded synchronously only in recent Node.js versions. The following Node.js versions support synchronous `require()` for ESM libraries without any flags or warnings: @@ -183,7 +250,7 @@ If the library relies on any state that can cause issues if 2 separate instances Older versions can still load your library asynchronously using `import()` in CommonJS environments. -Most modern tools such as [Webpack](https://webpack.js.org), [Rollup](https://rollupjs.org), [Vite](https://vitejs.dev) etc. also support ESM and the `exports` field. See the supported conditions in the [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). +Most modern tools such as [Webpack](https://webpack.js.org), [Rollup](https://rollupjs.org), [Vite](https://vitejs.dev) etc. also support ESM and the `exports` field. See the supported conditions in the [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and the [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). [Metro](https://metrobundler.dev) enables support for `package.json` exports by default from version [0.82.0](https://github.com/facebook/metro/releases/tag/v0.82.0). In previous versions, experimental support can be enabled by setting the [`unstable_enablePackageExports` option to `true`](https://metrobundler.dev/docs/package-exports/) in the Metro configuration. If this is not enabled, Metro will use the entrypoint specified in the `main` field. Features such as [subpath exports](https://nodejs.org/api/packages.html#subpath-exports) and [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) will not work when `exports` supported is not enabled. @@ -252,7 +319,7 @@ There are still a few things to keep in mind if you want your library to be ESM- ".": { "import": { "types": "./lib/typescript/module/src/index.d.ts", - "react-native": "./lib/modules/index.native.js", + "react-native": "./lib/module/index.native.js", "default": "./lib/module/index.js" }, "require": { @@ -265,6 +332,27 @@ There are still a few things to keep in mind if you want your library to be ESM- } ``` + Or as a separate condition: + + ```json + "exports": { + ".": { + "react-native": { + "types": "./lib/typescript/module/src/index.native.d.ts", + "default": "./lib/module/index.native.js" + }, + "import": { + "types": "./lib/typescript/module/src/index.d.ts", + "default": "./lib/module/index.js" + }, + "require": { + "types": "./lib/typescript/commonjs/src/index.d.ts", + "default": "./lib/commonjs/index.js" + } + }, + } + ``` + ## References - [Node.js documentation on ESM](https://nodejs.org/docs/latest/api/esm.html) From ab97df619a334f3d562b60b1974e81a8170b7288 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 25 Apr 2025 22:08:34 +0200 Subject: [PATCH 12/19] docs: link to customConditions in TypeScript docs --- docs/pages/esm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/esm.md b/docs/pages/esm.md index 4ad95f5f3..bfa863462 100644 --- a/docs/pages/esm.md +++ b/docs/pages/esm.md @@ -225,7 +225,7 @@ Here, we specify 4 conditions: - `node`: Used when the library is imported in Node.js. - `default`: Fallback used when the library is imported in an environment that doesn't support the other conditions. -One thing to note is that TypeScript may need to be configured to resolve to the appropriate condition. It's pre-configured for React Native apps, but in other scenarios, it maybe necessary to specify `customConditions` in the `tsconfig.json` file: +One thing to note is that TypeScript may need to be configured to resolve to the appropriate condition. It's pre-configured for React Native apps, but in other scenarios, it maybe necessary to specify [`customConditions`](https://www.typescriptlang.org/tsconfig/#customConditions) in the `tsconfig.json` file: ```json { From ee62040b6aeb9280273ba3833665b09dad6d5bd5 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 25 Apr 2025 22:20:45 +0200 Subject: [PATCH 13/19] docs: link to runtime keys spec --- docs/pages/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/esm.md b/docs/pages/esm.md index bfa863462..7ffbb5f78 100644 --- a/docs/pages/esm.md +++ b/docs/pages/esm.md @@ -238,7 +238,7 @@ One thing to note is that TypeScript may need to be configured to resolve to the This is just an example to illustrate the idea. In practice, you may want to specify appropriate conditions for your library based on the tools you want to support. -You can find a list of conditions supported in various tools in the [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and the [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). +You can find a list of conditions supported in various tools in the [Runtime Keys](https://runtime-keys.proposal.wintercg.org/) proposal specification, [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). ## Compatibility @@ -250,7 +250,7 @@ You can find a list of conditions supported in various tools in the [Node.js doc Older versions can still load your library asynchronously using `import()` in CommonJS environments. -Most modern tools such as [Webpack](https://webpack.js.org), [Rollup](https://rollupjs.org), [Vite](https://vitejs.dev) etc. also support ESM and the `exports` field. See the supported conditions in the [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and the [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). +Most modern tools such as [Webpack](https://webpack.js.org), [Rollup](https://rollupjs.org), [Vite](https://vitejs.dev) etc. also support ESM and the `exports` field. See the supported conditions in the [Runtime Keys](https://runtime-keys.proposal.wintercg.org/) proposal specification, [Node.js documentation](https://nodejs.org/docs/latest/api/packages.html#community-conditions-definitions) and [Webpack documentation](https://webpack.js.org/guides/package-exports/#conditions). [Metro](https://metrobundler.dev) enables support for `package.json` exports by default from version [0.82.0](https://github.com/facebook/metro/releases/tag/v0.82.0). In previous versions, experimental support can be enabled by setting the [`unstable_enablePackageExports` option to `true`](https://metrobundler.dev/docs/package-exports/) in the Metro configuration. If this is not enabled, Metro will use the entrypoint specified in the `main` field. Features such as [subpath exports](https://nodejs.org/api/packages.html#subpath-exports) and [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) will not work when `exports` supported is not enabled. From 62c0f34e8fdb15af3ea5f450efe5d19200b95d51 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sat, 26 Apr 2025 17:01:31 +0200 Subject: [PATCH 14/19] docs: re-order export conditions --- docs/pages/esm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/esm.md b/docs/pages/esm.md index 7ffbb5f78..420a8b48d 100644 --- a/docs/pages/esm.md +++ b/docs/pages/esm.md @@ -200,11 +200,11 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea "types": "./lib/typescript/module/src/index.d.ts", "default": "./lib/module/index.native.js" }, - "module": { + "node": { "types": "./lib/typescript/module/src/index.d.ts", "default": "./lib/module/index.js" }, - "node": { + "module": { "types": "./lib/typescript/module/src/index.d.ts", "default": "./lib/module/index.js" }, @@ -221,8 +221,8 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea Here, we specify 4 conditions: - `react-native`: Used when the library is imported in a React Native environment with Metro. -- `module`: Used when the library is imported in a bundler such as Webpack, Vite or Rollup. - `node`: Used when the library is imported in Node.js. +- `module`: Used when the library is imported in a bundler such as Webpack, Vite or Rollup. - `default`: Fallback used when the library is imported in an environment that doesn't support the other conditions. One thing to note is that TypeScript may need to be configured to resolve to the appropriate condition. It's pre-configured for React Native apps, but in other scenarios, it maybe necessary to specify [`customConditions`](https://www.typescriptlang.org/tsconfig/#customConditions) in the `tsconfig.json` file: From ed2a30fae8bfa8e73356d5a962a451bb9187f25b Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sat, 26 Apr 2025 22:57:55 +0200 Subject: [PATCH 15/19] docs: add info about types field and fix typo --- docs/pages/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/esm.md b/docs/pages/esm.md index 420a8b48d..56f0cf878 100644 --- a/docs/pages/esm.md +++ b/docs/pages/esm.md @@ -47,7 +47,7 @@ To make use of the output files, ensure that your `package.json` file contains t }, ``` -The `main` field is for tools that don't support the `exports` field (e.g. [Metro](https://metrobundler.dev) < 0.82.0). +The `main` field is for tools that don't support the `exports` field (e.g. [Metro](https://metrobundler.dev) < 0.82.0). The `types` field is for legacy TypeScript setups that use `moduleResolution: "node10"` or `moduleResolution: "node"`. The `exports` field is used by Node.js 12+, modern browsers and tools to determine the correct entry point. The entrypoint is specified in the `.` key and will be used when the library is imported or required directly (e.g. `import 'my-library'` or `require('my-library')`). @@ -198,7 +198,7 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea ".": { "react-native": { "types": "./lib/typescript/module/src/index.d.ts", - "default": "./lib/module/index.native.js" + "default": "./lib/module/index.js" }, "node": { "types": "./lib/typescript/module/src/index.d.ts", From da5df0b1da2085445000373367d687e916cd9328 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 30 Apr 2025 17:45:22 +0200 Subject: [PATCH 16/19] refactor: move to react-native-monorepo-config --- docs/pages/faq.md | 4 +- .../example-common/example/metro.config.js | 2 - .../expo-library/example/metro.config.js | 2 - .../react-native-builder-bob/babel-config.js | 16 +-- .../react-native-builder-bob/metro-config.js | 50 +-------- .../react-native-builder-bob/package.json | 1 - yarn.lock | 104 +----------------- 7 files changed, 10 insertions(+), 169 deletions(-) diff --git a/docs/pages/faq.md b/docs/pages/faq.md index 4a3b0891e..30409b684 100644 --- a/docs/pages/faq.md +++ b/docs/pages/faq.md @@ -73,9 +73,7 @@ There are 2 parts to this process. The JavaScript (or TypeScript) source code is aliased to be used by the example app. This makes it so that when you import from `'your-library-name'`, it imports the source code directly and avoids having to rebuild the library for JavaScript only changes. We configure several tools to make this work: - - [Babel](https://babeljs.io) is configured to use the alias in `example/babel.config.js` using [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver). This transforms the imports to point to the source code instead. - - [Metro](https://facebook.github.io/metro/) is configured to allow importing from outside of the `example` directory by configuring `watchFolders`, and to use the appropriate peer dependencies. This configuration exists in the `example/metro.config.js` file. - - [Webpack](https://webpack.js.org/) is configured to compile the library source code when running on the Web. This configuration exists in the `example/webpack.config.js` file. + - [Metro](https://facebook.github.io/metro/) is configured to allow importing from outside of the `example` directory by configuring `watchFolders`, to use the appropriate peer dependencies, and to import source code of the library in the example. This configuration exists in the `example/metro.config.js` file. - [TypeScript](https://www.typescriptlang.org/) is configured to use the source code for type checking by using the `paths` property under `compilerOptions`. This configuration exists in the `tsconfig.json` file at the root. 2. **Linking the native code** diff --git a/packages/create-react-native-library/templates/example-common/example/metro.config.js b/packages/create-react-native-library/templates/example-common/example/metro.config.js index 78e4f819a..78deb88c1 100644 --- a/packages/create-react-native-library/templates/example-common/example/metro.config.js +++ b/packages/create-react-native-library/templates/example-common/example/metro.config.js @@ -1,7 +1,6 @@ const path = require('path'); const { getDefaultConfig } = require('@react-native/metro-config'); const { getConfig } = require('react-native-builder-bob/metro-config'); -const pkg = require('../package.json'); const root = path.resolve(__dirname, '..'); @@ -13,6 +12,5 @@ const root = path.resolve(__dirname, '..'); */ module.exports = getConfig(getDefaultConfig(__dirname), { root, - pkg, project: __dirname, }); diff --git a/packages/create-react-native-library/templates/expo-library/example/metro.config.js b/packages/create-react-native-library/templates/expo-library/example/metro.config.js index ccb291e79..ee44b4666 100644 --- a/packages/create-react-native-library/templates/expo-library/example/metro.config.js +++ b/packages/create-react-native-library/templates/expo-library/example/metro.config.js @@ -1,7 +1,6 @@ const path = require('path'); const { getDefaultConfig } = require('@expo/metro-config'); const { getConfig } = require('react-native-builder-bob/metro-config'); -const pkg = require('../package.json'); const root = path.resolve(__dirname, '..'); @@ -13,6 +12,5 @@ const root = path.resolve(__dirname, '..'); */ module.exports = getConfig(getDefaultConfig(__dirname), { root, - pkg, project: __dirname, }); diff --git a/packages/react-native-builder-bob/babel-config.js b/packages/react-native-builder-bob/babel-config.js index 2b96bad02..8ce5cad78 100644 --- a/packages/react-native-builder-bob/babel-config.js +++ b/packages/react-native-builder-bob/babel-config.js @@ -14,7 +14,7 @@ const { loadConfig } = require('./lib/utils/loadConfig'); * @param {object} options.pkg Content of package.json of the library * @returns {import('@babel/core').TransformOptions} Babel configuration */ -const getConfig = (defaultConfig, { root, pkg }) => { +const getConfig = (defaultConfig, { root }) => { const result = loadConfig(root); if (result == null) { @@ -33,20 +33,6 @@ const getConfig = (defaultConfig, { root, pkg }) => { ...defaultConfig, overrides: [ ...(defaultConfig.overrides == null ? [] : defaultConfig.overrides), - { - exclude: /\/node_modules\//, - plugins: [ - [ - require.resolve('babel-plugin-module-resolver'), - { - extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'], - alias: { - [pkg.name]: path.join(root, pkg.source), - }, - }, - ], - ], - }, { include: path.join(root, source), presets: [ diff --git a/packages/react-native-builder-bob/metro-config.js b/packages/react-native-builder-bob/metro-config.js index c08a7809d..668ba2171 100644 --- a/packages/react-native-builder-bob/metro-config.js +++ b/packages/react-native-builder-bob/metro-config.js @@ -1,59 +1,17 @@ /* eslint-disable @typescript-eslint/no-require-imports, import-x/no-commonjs, no-undef */ -const path = require('path'); -const escape = require('escape-string-regexp'); -const exclusionList = require('metro-config/src/defaults/exclusionList'); +const { withMetroConfig } = require('react-native-monorepo-config'); /** * Get Metro configuration for the example project. * This sets up appropriate root and watch folders for the library. * It also excludes conflicting modules and aliases them to the correct place. * - * @param {import('metro-config').MetroConfig} defaultConfig Default Metro configuration + * @param {import('metro-config').MetroConfig} baseConfig Base Metro configuration * @param {object} options Options to customize the configuration * @param {string} options.root Root directory of the monorepo - * @param {object} options.pkg Content of package.json of the library * @param {string} options.project Directory containing the example project * @returns {import('metro-config').MetroConfig} Metro configuration */ -const getConfig = (defaultConfig, { root, pkg, project }) => { - const modules = [ - // AssetsRegistry is used internally by React Native to handle asset imports - // This needs to be a singleton so all assets are registered to a single registry - '@react-native/assets-registry', - ...Object.keys({ ...pkg.peerDependencies }), - ]; - - /** - * Metro configuration - * https://facebook.github.io/metro/docs/configuration - * - * @type {import('metro-config').MetroConfig} - */ - return { - ...defaultConfig, - - projectRoot: project, - watchFolders: [root], - - // We need to make sure that only one version is loaded for peerDependencies - // So we block them at the root, and alias them to the versions in example project's node_modules - resolver: { - ...defaultConfig.resolver, - - blacklistRE: exclusionList( - modules.map( - (m) => - new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) - ) - ), - - extraNodeModules: modules.reduce((acc, name) => { - acc[name] = path.join(project, 'node_modules', name); - return acc; - }, {}), - }, - }; -}; - -exports.getConfig = getConfig; +exports.getConfig = (baseConfig, { root, project }) => + withMetroConfig(baseConfig, { root, dirname: project }); diff --git a/packages/react-native-builder-bob/package.json b/packages/react-native-builder-bob/package.json index 171cd7af3..5647a0420 100644 --- a/packages/react-native-builder-bob/package.json +++ b/packages/react-native-builder-bob/package.json @@ -47,7 +47,6 @@ "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "arktype": "^2.1.15", - "babel-plugin-module-resolver": "^5.0.2", "babel-plugin-syntax-hermes-parser": "^0.28.0", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", diff --git a/yarn.lock b/yarn.lock index ed93c7132..069f9cb78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4674,19 +4674,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-module-resolver@npm:^5.0.2": - version: 5.0.2 - resolution: "babel-plugin-module-resolver@npm:5.0.2" - dependencies: - find-babel-config: ^2.1.1 - glob: ^9.3.3 - pkg-up: ^3.1.0 - reselect: ^4.1.7 - resolve: ^1.22.8 - checksum: f1d198acbbbd0b76c9c0c4aacbf9f1ef90f8d36b3d5209d9e7a75cadee2113a73711550ebddeb9464d143b71df19adc75e165dff99ada2614d7ea333affe3b5a - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs2@npm:^0.4.10": version: 0.4.11 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" @@ -7465,16 +7452,6 @@ __metadata: languageName: node linkType: hard -"find-babel-config@npm:^2.1.1": - version: 2.1.1 - resolution: "find-babel-config@npm:2.1.1" - dependencies: - json5: ^2.2.3 - path-exists: ^4.0.0 - checksum: 4be54397339520e0cd49870acb10366684ffc001fd0b7bffedd0fe9d3e1d82234692d3cb4e5ba95280a35887238ba6f82dc79569a13a3749ae3931c23e0b3a99 - languageName: node - linkType: hard - "find-up@npm:^2.0.0": version: 2.1.0 resolution: "find-up@npm:2.1.0" @@ -7484,15 +7461,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^3.0.0": - version: 3.0.0 - resolution: "find-up@npm:3.0.0" - dependencies: - locate-path: ^3.0.0 - checksum: 38eba3fe7a66e4bc7f0f5a1366dc25508b7cfc349f852640e3678d26ad9a6d7e2c43eff0a472287de4a9753ef58f066a0ea892a256fa3636ad51b3fe1e17fae9 - languageName: node - linkType: hard - "find-up@npm:^4.0.0, find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" @@ -7874,18 +7842,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^9.3.3": - version: 9.3.5 - resolution: "glob@npm:9.3.5" - dependencies: - fs.realpath: ^1.0.0 - minimatch: ^8.0.2 - minipass: ^4.2.4 - path-scurry: ^1.6.1 - checksum: 94b093adbc591bc36b582f77927d1fb0dbf3ccc231828512b017601408be98d1fe798fc8c0b19c6f2d1a7660339c3502ce698de475e9d938ccbb69b47b647c84 - languageName: node - linkType: hard - "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -9296,16 +9252,6 @@ __metadata: languageName: node linkType: hard -"locate-path@npm:^3.0.0": - version: 3.0.0 - resolution: "locate-path@npm:3.0.0" - dependencies: - p-locate: ^3.0.0 - path-exists: ^3.0.0 - checksum: 53db3996672f21f8b0bf2a2c645ae2c13ffdae1eeecfcd399a583bce8516c0b88dcb4222ca6efbbbeb6949df7e46860895be2c02e8d3219abd373ace3bfb4e11 - languageName: node - linkType: hard - "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -10980,15 +10926,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^8.0.2": - version: 8.0.4 - resolution: "minimatch@npm:8.0.4" - dependencies: - brace-expansion: ^2.0.1 - checksum: 2e46cffb86bacbc524ad45a6426f338920c529dd13f3a732cc2cf7618988ee1aae88df4ca28983285aca9e0f45222019ac2d14ebd17c1edadd2ee12221ab801a - languageName: node - linkType: hard - "minimatch@npm:^9.0.0, minimatch@npm:^9.0.1": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -11095,13 +11032,6 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.2.4": - version: 4.2.8 - resolution: "minipass@npm:4.2.8" - checksum: 7f4914d5295a9a30807cae5227a37a926e6d910c03f315930fde52332cf0575dfbc20295318f91f0baf0e6bb11a6f668e30cde8027dea7a11b9d159867a3c830 - languageName: node - linkType: hard - "minipass@npm:^5.0.0": version: 5.0.0 resolution: "minipass@npm:5.0.0" @@ -11754,7 +11684,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": +"p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -11781,15 +11711,6 @@ __metadata: languageName: node linkType: hard -"p-locate@npm:^3.0.0": - version: 3.0.0 - resolution: "p-locate@npm:3.0.0" - dependencies: - p-limit: ^2.0.0 - checksum: 83991734a9854a05fe9dbb29f707ea8a0599391f52daac32b86f08e21415e857ffa60f0e120bfe7ce0cc4faf9274a50239c7895fc0d0579d08411e513b83a4ae - languageName: node - linkType: hard - "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -12042,7 +11963,7 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.10.1, path-scurry@npm:^1.6.1": +"path-scurry@npm:^1.10.1": version: 1.11.1 resolution: "path-scurry@npm:1.11.1" dependencies: @@ -12168,15 +12089,6 @@ __metadata: languageName: node linkType: hard -"pkg-up@npm:^3.1.0": - version: 3.1.0 - resolution: "pkg-up@npm:3.1.0" - dependencies: - find-up: ^3.0.0 - checksum: 5bac346b7c7c903613c057ae3ab722f320716199d753f4a7d053d38f2b5955460f3e6ab73b4762c62fd3e947f58e04f1343e92089e7bb6091c90877406fcd8c8 - languageName: node - linkType: hard - "postcss-selector-parser@npm:^6.0.10": version: 6.0.13 resolution: "postcss-selector-parser@npm:6.0.13" @@ -12425,7 +12337,6 @@ __metadata: "@types/which": ^2.0.1 "@types/yargs": ^17.0.10 arktype: ^2.1.15 - babel-plugin-module-resolver: ^5.0.2 babel-plugin-syntax-hermes-parser: ^0.28.0 browserslist: ^4.20.4 concurrently: ^7.2.2 @@ -12783,13 +12694,6 @@ __metadata: languageName: node linkType: hard -"reselect@npm:^4.1.7": - version: 4.1.8 - resolution: "reselect@npm:4.1.8" - checksum: a4ac87cedab198769a29be92bc221c32da76cfdad6911eda67b4d3e7136dca86208c3b210e31632eae31ebd2cded18596f0dd230d3ccc9e978df22f233b5583e - languageName: node - linkType: hard - "resolve-cwd@npm:^3.0.0": version: 3.0.0 resolution: "resolve-cwd@npm:3.0.0" @@ -12836,7 +12740,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.22.4, resolve@npm:^1.22.8": +"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.22.4": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -12849,7 +12753,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.4#~builtin, resolve@patch:resolve@^1.22.8#~builtin": +"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.4#~builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: From d369d18ed67edcc66cb8da67266e769be3ad271d Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 30 Apr 2025 19:37:37 +0200 Subject: [PATCH 17/19] fix: don't ship generated code with the library (#819) ### Summary We currently have `includesGenerateCode: true` which ships codegen specs with the library. The original idea was that the generated code is consistent regardless of React Native version, which can lead to better stability. However, in a practical sense, a different React Native version may not support this generated code anyway, so the library may get locked to single React Native version anyway. > The generated code will use the React Native version defined inside your library. So if your library is shipping with React Native 0.76, the generated code will be based on that version. This could mean that the generated code is not compatible with apps using previous React Native version used by the app (e.g. an App running on React Native 0.75). - [Including Generated Code into Libraries](https://reactnative.dev/docs/the-new-architecture/codegen-cli) This has caused issues for us - breaking our template almost every React Native release due to API changes in the codegen script, which adds a maintenance burden without any concrete benefits. So, this change removes this option from the default template. The documentation has been updated as well with instructions on how to enable this. ### Test plan Generate the Turbo Module and Fabric templates and verify that the app builds and runs on Android & iOS. --- docs/pages/build.md | 131 +++++++++++++++--- docs/pages/faq.md | 40 ------ .../src/exampleApp/addCodegenBuildScript.ts | 58 -------- .../src/exampleApp/dependencies.ts | 14 +- .../create-react-native-library/src/index.ts | 15 +- .../templates/common-local/$package.json | 2 +- .../templates/common/$package.json | 12 +- .../native-library-new/react-native.config.js | 16 --- .../native-view-new/react-native.config.js | 16 --- .../objc-library/ios/{%- project.name %}.h | 2 +- .../ios/{%- project.name %}View.mm | 8 +- 11 files changed, 122 insertions(+), 192 deletions(-) delete mode 100644 packages/create-react-native-library/src/exampleApp/addCodegenBuildScript.ts delete mode 100644 packages/create-react-native-library/templates/native-library-new/react-native.config.js delete mode 100644 packages/create-react-native-library/templates/native-view-new/react-native.config.js diff --git a/docs/pages/build.md b/docs/pages/build.md index b83458218..322d6bbd8 100644 --- a/docs/pages/build.md +++ b/docs/pages/build.md @@ -24,8 +24,6 @@ npx react-native-builder-bob@latest init This will ask you a few questions and add the required configuration and scripts for building the code. The code will be compiled automatically when the package is published. -> Note: the `init` command doesn't add the [`codegen` target](#codegen) yet. You can either add it manually or create a new library with `create-react-native-library`. - You can find details on what exactly it adds in the [Manual configuration](#manual-configuration) section. ## Manual configuration @@ -46,9 +44,7 @@ To configure your project manually, follow these steps: "output": "lib", "targets": [ ["module", { "esm": true }], - ["commonjs", { "esm": true }], "typescript", - "codegen" ] } ``` @@ -120,18 +116,6 @@ To configure your project manually, follow these steps: This makes sure that Jest doesn't try to run the tests in the generated files. -7. Configure [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) - - If your library supports the [New React Native Architecture](https://reactnative.dev/architecture/landing-page), you should also configure Codegen. This is not required for libraries that only support the old architecture. - - You can follow the [Official Codegen Setup Guide](https://reactnative.dev/docs/the-new-architecture/using-codegen) to enable Codegen. - - It's also recommended to ship your Codegen generated scaffold code with your library since it has numerous benefits. To see the benefits and implement this behavior, you can see the [Official Codegen Shipping Guide](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries). - - See [How to opt-out of shipping the Codegen generated code](./faq.md#how-to-opt-out-of-shipping-codegen-generated-scaffold-code) if you don't want to ship the Codegen generated scaffold code. - - > Note: If you enable Codegen generated code shipping, React Native won't build the scaffold code automatically when you build your test app. You need to rebuild the codegen scaffold code manually each time you make changes to your spec. If you want to automate this process, you can create a new project with `create-react-native-library` and inspect the example app. - And we're done 🎉 ## Options @@ -281,9 +265,120 @@ If you need to support legacy setups that use `moduleResolution: node10` or `mod #### `codegen` -Enable generating the [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) scaffold code, which is used with the New React Native Architecture. +Enable generating the [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) scaffold code when building the library. + +If you use this `target`, you'll also want to use `"includesGeneratedCode": true` to ship the generated code with your library. Before you do so, make sure to [read the official docs](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries) to understand the advantages and tradeoffs of this approach. + +If you want to ship codegen generated code with your library, you can do the following steps to integrate it with the library's workflow: + +1. Add the `codegen` target to the `react-native-builder-bob` field in your `package.json` or `bob.config.js`: + + ```diff + "source": "src", + "output": "lib", + "targets": [ + // … + + "codegen" + ] + ``` + + This will enable the codegen script to run when you publish the library (if `bob build` is configured to be run on publish). + +2. Add `@react-native-community/cli` as a `devDependency` in your `package.json`: + + ```diff + "devDependencies": { + // … + + "@react-native-community/cli": "^x.x.x" + } + ``` + + For the `@react-native-community/cli` version, refer to the `example/package.json` file. The version should be the same as the one used in the `example` app. + +3. Add `"includesGeneratedCode": true` and `"outputDir"` to the `codegenConfig` field in your `package.json`: + + ```diff + "codegenConfig": { + // … + + "outputDir": { + + "ios": "ios/generated", + + "android": "android/generated" + + }, + + "includesGeneratedCode": true + } + ``` + +4. Update imports in your ios code to use the new paths for the generated code: + + - If you have a Turbo Module, replace `YourProjectNameSpec.h` with `YourProjectName/YourProjectNameSpec.h`: + + ```diff + - #import + + #import + ``` + + - If you have a Fabric View, replace `react/renderer/components/YourProjectNameViewSpec/` with `YourProjectName/`: + + ```diff + - #import + - #import + - #import + - #import + + #import + + #import + + #import + + #import + ``` + +5. Add a `react-native.config.js` at the root with the correct `cmakeListsPath`: + + ```js + /** + * @type {import('@react-native-community/cli-types').UserDependencyConfig} + */ + module.exports = { + dependency: { + platforms: { + android: { + cmakeListsPath: 'generated/jni/CMakeLists.txt', + }, + }, + }, + }; + ``` + + This makes sure that gradle will pickup the `CMakeLists.txt` file generated by the codegen script on Android. + +6. Add a gradle task to `example/android/app/build.gradle` to automatically run the codegen script when building the example app: + + ```groovy + tasks.register('invokeLibraryCodegen', Exec) { + workingDir "$rootDir/../../" + + def isWindows = System.getProperty('os.name').toLowerCase().contains('windows') + + if (isWindows) { + commandLine 'cmd', '/c', 'npx bob build --target codegen' + } else { + commandLine 'sh', '-c', 'npx bob build --target codegen' + } + } + + preBuild.dependsOn invokeLibraryCodegen + ``` + +7. Add a `pre_install` hook to `example/ios/Podfile` to automatically run the codegen script when installing pods: + + ```ruby + pre_install do |installer| + system("cd ../../ && npx bob build --target codegen") + end + ``` + + This will likely be inside the `target 'YourAppName' do` block. -You can ensure your Codegen generated scaffold code is stable through different React Native versions by shipping it with your library. You can find more in the [React Native Official Docs](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries). +And you're done! Make sure to run `pod install` in the `example/ios` folder and then run the example app to make sure everything works. #### `custom` diff --git a/docs/pages/faq.md b/docs/pages/faq.md index 30409b684..ff1ddfaf9 100644 --- a/docs/pages/faq.md +++ b/docs/pages/faq.md @@ -122,46 +122,6 @@ For more accurate testing, there are various other approaches: You can find installation and usage instructions in the [Verdaccio documentation](https://verdaccio.org/docs/en/installation). -## How to opt out of shipping codegen generated code? - -We recommend shipping the generated scaffold code with your library due to [the benefits mentioned in React Native docs](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries). The new architecture libraries generated by `create-react-native-library` include the generated scaffold code by default. - -If you have a reason to not ship Codegen generated scaffold code with your library, you need do the following steps: - -1. Add `"includesGeneratedCode": false` to the `codegenConfig` field in your `package.json`: - - ```diff - "codegenConfig": { - // … - - "includesGeneratedCode": true - + "includesGeneratedCode": false - } - ``` - -2. Remove the [`codegen` target](#codegen) from the `react-native-builder-bob` field in your `package.json` or `bob.config.js`: - - ```diff - "source": "src", - "output": "lib", - "targets": [ - // … - - "codegen" - ] - ``` - -3. If you have an `exports` field in your `package.json`, ensure that it contains `./package.json`: - - ```diff - "exports": { - ".": { - // … - }, - + "./package.json": "./package.json" - }, - ``` - - This is required for React Native Codegen to read the `codegenConfig` field from your library's `package.json`. You can find the related issue [here](https://github.com/callstack/react-native-builder-bob/issues/637). - ## Users get a warning when they install my library If users are using Yarn 1, they may get a warning when installing your library: diff --git a/packages/create-react-native-library/src/exampleApp/addCodegenBuildScript.ts b/packages/create-react-native-library/src/exampleApp/addCodegenBuildScript.ts deleted file mode 100644 index c6ce2be84..000000000 --- a/packages/create-react-native-library/src/exampleApp/addCodegenBuildScript.ts +++ /dev/null @@ -1,58 +0,0 @@ -import path from 'path'; -import fs from 'fs-extra'; - -// This is added to the example app's build.gradle file to invoke codegen before every build -const GRADLE_INVOKE_CODEGEN_TASK = ` -// Run Codegen during development for the example app. -tasks.register('invokeLibraryCodegen', Exec) { - workingDir "$rootDir/../../" - def isWindows = System.getProperty('os.name').toLowerCase().contains('windows') - - if (isWindows) { - commandLine 'cmd', '/c', 'npx bob build --target codegen' - } else { - commandLine 'sh', '-c', 'npx bob build --target codegen' - } -} - -preBuild.dependsOn invokeLibraryCodegen -`; - -// You need to have the files before calling pod install otherwise they won't be registered in your pod. -// So we add a pre_install hook to the podfile that invokes codegen -const PODSPEC_INVOKE_CODEGEN_SCRIPT = ` - # Run Codegen during development for the example app. - pre_install do |installer| - system("cd ../../ && npx bob build --target codegen") - end -`; - -/** - * Codegen isn't invoked for libraries with `includesGeneratedCode` set to `true`. - * This patches the example app to invoke library codegen on every app build. - */ -export async function addCodegenBuildScript(libraryPath: string) { - const appBuildGradlePath = path.join( - libraryPath, - 'example', - 'android', - 'app', - 'build.gradle' - ); - const podfilePath = path.join(libraryPath, 'example', 'ios', 'Podfile'); - - // Add a gradle task that runs before every build - let appBuildGradle = (await fs.readFile(appBuildGradlePath)).toString(); - appBuildGradle += GRADLE_INVOKE_CODEGEN_TASK; - - await fs.writeFile(appBuildGradlePath, appBuildGradle); - - // Add a preinstall action to the podfile that invokes codegen - const podfile = (await fs.readFile(podfilePath)).toString().split('\n'); - const podfilePostInstallIndex = podfile.findIndex((line) => - line.includes('post_install do |installer|') - ); - podfile.splice(podfilePostInstallIndex, 0, PODSPEC_INVOKE_CODEGEN_SCRIPT); - - await fs.writeFile(podfilePath, podfile.join('\n')); -} diff --git a/packages/create-react-native-library/src/exampleApp/dependencies.ts b/packages/create-react-native-library/src/exampleApp/dependencies.ts index 1ed1e1a83..13d859a4b 100644 --- a/packages/create-react-native-library/src/exampleApp/dependencies.ts +++ b/packages/create-react-native-library/src/exampleApp/dependencies.ts @@ -1,6 +1,5 @@ import path from 'path'; import fs from 'fs-extra'; -import type { TemplateConfiguration } from '../template'; import sortObjectKeys from '../utils/sortObjectKeys'; type PackageJson = { @@ -9,8 +8,7 @@ type PackageJson = { export async function alignDependencyVersionsWithExampleApp( pkg: PackageJson, - folder: string, - config: TemplateConfiguration + folder: string ) { const examplePackageJson = await fs.readJSON( path.join(folder, 'example', 'package.json') @@ -23,16 +21,6 @@ export async function alignDependencyVersionsWithExampleApp( '@react-native/babel-preset', ]; - if ( - config.example === 'vanilla' && - (config.project.moduleConfig === 'turbo-modules' || - config.project.viewConfig === 'fabric-view') - ) { - // React Native doesn't provide the community CLI as a dependency. - // We have to read the version from the example app and put to the root package json - PACKAGES_TO_COPY.push('@react-native-community/cli'); - } - const devDependencies: Record = {}; PACKAGES_TO_COPY.forEach((name) => { diff --git a/packages/create-react-native-library/src/index.ts b/packages/create-react-native-library/src/index.ts index 014634ec6..130842de6 100644 --- a/packages/create-react-native-library/src/index.ts +++ b/packages/create-react-native-library/src/index.ts @@ -3,7 +3,6 @@ import kleur from 'kleur'; import ora from 'ora'; import path from 'path'; import yargs from 'yargs'; -import { addCodegenBuildScript } from './exampleApp/addCodegenBuildScript'; import { alignDependencyVersionsWithExampleApp } from './exampleApp/dependencies'; import generateExampleApp from './exampleApp/generateExampleApp'; import { @@ -131,19 +130,7 @@ async function create(_argv: yargs.Arguments) { const rootPackageJson = await fs.readJson(path.join(folder, 'package.json')); if (config.example !== 'none') { - await alignDependencyVersionsWithExampleApp( - rootPackageJson, - folder, - config - ); - } - - if ( - config.example === 'vanilla' && - (config.project.moduleConfig === 'turbo-modules' || - config.project.viewConfig === 'fabric-view') - ) { - addCodegenBuildScript(folder); + await alignDependencyVersionsWithExampleApp(rootPackageJson, folder); } const libraryMetadata = createMetadata(answers); diff --git a/packages/create-react-native-library/templates/common-local/$package.json b/packages/create-react-native-library/templates/common-local/$package.json index 9970c8f8f..7325f243c 100644 --- a/packages/create-react-native-library/templates/common-local/$package.json +++ b/packages/create-react-native-library/templates/common-local/$package.json @@ -4,7 +4,7 @@ "description": "<%- project.description %>", "main": "src/index", "codegenConfig": { - "name": "RN<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec", + "name": "<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec", "type": <%- project.viewConfig !== null ? '"all"': '"modules"' %>, "jsSrcsDir": "src" }, diff --git a/packages/create-react-native-library/templates/common/$package.json b/packages/create-react-native-library/templates/common/$package.json index b9dfe1fb9..7efbe4122 100644 --- a/packages/create-react-native-library/templates/common/$package.json +++ b/packages/create-react-native-library/templates/common/$package.json @@ -171,9 +171,6 @@ "clean": "nitrogen/" } ], -<% } -%> -<% if (project.moduleConfig === 'turbo-modules' || project.viewConfig === 'fabric-view') { -%> - "codegen", <% } -%> [ "module", @@ -191,13 +188,9 @@ <% if (project.moduleConfig === 'turbo-modules' || project.viewConfig === 'fabric-view') { -%> }, "codegenConfig": { - "name": "RN<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec", + "name": "<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec", "type": "<%- project.viewConfig !== null ? 'all': 'modules' -%>", "jsSrcsDir": "src", - "outputDir": { - "ios": "ios/generated", - "android": "android/generated" - }, "android": { "javaPackageName": "com.<%- project.package %>" <% if (example === 'vanilla') { -%> @@ -208,9 +201,6 @@ "<%- project.name -%>View": "<%- project.name -%>View" } <% } -%> - }, - "includesGeneratedCode": true - <% } else { -%> } <% } -%> <% } -%> diff --git a/packages/create-react-native-library/templates/native-library-new/react-native.config.js b/packages/create-react-native-library/templates/native-library-new/react-native.config.js deleted file mode 100644 index 01104a6b5..000000000 --- a/packages/create-react-native-library/templates/native-library-new/react-native.config.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @type {import('@react-native-community/cli-types').UserDependencyConfig} - */ -module.exports = { - dependency: { - platforms: { - android: { - <%_ if (example === 'vanilla') { -%> - cmakeListsPath: 'generated/jni/CMakeLists.txt', - <%_ } else { -%> - cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt', - <%_ } -%> - }, - }, - }, -}; diff --git a/packages/create-react-native-library/templates/native-view-new/react-native.config.js b/packages/create-react-native-library/templates/native-view-new/react-native.config.js deleted file mode 100644 index 01104a6b5..000000000 --- a/packages/create-react-native-library/templates/native-view-new/react-native.config.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @type {import('@react-native-community/cli-types').UserDependencyConfig} - */ -module.exports = { - dependency: { - platforms: { - android: { - <%_ if (example === 'vanilla') { -%> - cmakeListsPath: 'generated/jni/CMakeLists.txt', - <%_ } else { -%> - cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt', - <%_ } -%> - }, - }, - }, -}; diff --git a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h index cd2f0acd7..cb2be40fe 100644 --- a/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h +++ b/packages/create-react-native-library/templates/objc-library/ios/{%- project.name %}.h @@ -1,4 +1,4 @@ -#import <<%- project.name -%>/RN<%- project.name -%>Spec.h> +#import <<%- project.name -%>Spec/<%- project.name -%>Spec.h> @interface <%- project.name -%> : NSObject Spec> diff --git a/packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm b/packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm index 4dd543215..187c18d2e 100644 --- a/packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm +++ b/packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm @@ -1,9 +1,9 @@ #import "<%- project.name -%>View.h" -#import <<%- project.name -%>/ComponentDescriptors.h> -#import <<%- project.name -%>/EventEmitters.h> -#import <<%- project.name -%>/Props.h> -#import <<%- project.name -%>/RCTComponentViewHelpers.h> +#import ViewSpec/ComponentDescriptors.h> +#import ViewSpec/EventEmitters.h> +#import ViewSpec/Props.h> +#import ViewSpec/RCTComponentViewHelpers.h> #import "RCTFabricComponentsPlugins.h" From 5bec132fe73fb56b1870c9d357f7af91c9546e79 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 30 Apr 2025 19:39:45 +0200 Subject: [PATCH 18/19] fix: fix schema for configFile option --- packages/react-native-builder-bob/src/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-builder-bob/src/schema.ts b/packages/react-native-builder-bob/src/schema.ts index 858755d86..032b2112c 100644 --- a/packages/react-native-builder-bob/src/schema.ts +++ b/packages/react-native-builder-bob/src/schema.ts @@ -5,7 +5,7 @@ const module = { options: type({ esm: type('boolean').default(false), babelrc: type('boolean').default(false), - configFile: type('boolean').default(false), + configFile: type('boolean | string').default(false), sourceMaps: type('boolean').default(true), copyFlow: type('boolean').default(false), jsxRuntime: type('"automatic" | "classic"').default('automatic'), From 92fad2c26ca1bb44088285163068d1dc220224cc Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 30 Apr 2025 19:40:09 +0200 Subject: [PATCH 19/19] chore: publish - docs@0.6.5 - create-react-native-library@0.49.9 - react-native-builder-bob@0.40.7 --- docs/CHANGELOG.md | 6 ++++++ docs/package.json | 2 +- packages/create-react-native-library/CHANGELOG.md | 13 ++++++++++++- packages/create-react-native-library/package.json | 2 +- packages/react-native-builder-bob/CHANGELOG.md | 9 ++++++++- packages/react-native-builder-bob/package.json | 2 +- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a2c983954..fd9801911 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.6.5](https://github.com/callstack/react-native-builder-bob/compare/docs@0.6.4...docs@0.6.5) (2025-04-30) + +### Bug Fixes + +- don't ship generated code with the library ([#819](https://github.com/callstack/react-native-builder-bob/issues/819)) ([d369d18](https://github.com/callstack/react-native-builder-bob/commit/d369d18ed67edcc66cb8da67266e769be3ad271d)) - by @satya164 + ## [0.6.4](https://github.com/callstack/react-native-builder-bob/compare/docs@0.6.3...docs@0.6.4) (2025-04-08) ### Bug Fixes diff --git a/docs/package.json b/docs/package.json index b5e6e2207..bd73af82c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.6.4", + "version": "0.6.5", "private": true, "description": "Documentation for react-native-builder-bob", "scripts": { diff --git a/packages/create-react-native-library/CHANGELOG.md b/packages/create-react-native-library/CHANGELOG.md index 70b2a1da2..c60809db4 100644 --- a/packages/create-react-native-library/CHANGELOG.md +++ b/packages/create-react-native-library/CHANGELOG.md @@ -3,11 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.49.9](https://github.com/callstack/react-native-builder-bob/compare/create-react-native-library@0.49.8...create-react-native-library@0.49.9) (2025-04-30) + +### Bug Fixes + +- don't ship generated code with the library ([#819](https://github.com/callstack/react-native-builder-bob/issues/819)) ([d369d18](https://github.com/callstack/react-native-builder-bob/commit/d369d18ed67edcc66cb8da67266e769be3ad271d)) - by @satya164 +- fix typo in podspec ([8ed72ef](https://github.com/callstack/react-native-builder-bob/commit/8ed72efd555db2405a78c5b6ca746c18443ac18b)) - by @satya164 +- install nitro modules dependency automatically for local modules ([#828](https://github.com/callstack/react-native-builder-bob/issues/828)) ([9ffb17c](https://github.com/callstack/react-native-builder-bob/commit/9ffb17cb038e9f276d19b87b649e0ec3a6a82e6b)) - by @atlj +- migrate to babel-plugin-syntax-hermes-parser ([#822](https://github.com/callstack/react-native-builder-bob/issues/822)) ([a797db3](https://github.com/callstack/react-native-builder-bob/commit/a797db31ff02072e1f4ecf722b11872113d9d190)), closes [/github.com/facebook/react-native/issues/50683#issuecomment-2804970384](https://github.com//github.com/facebook/react-native/issues/50683/issues/issuecomment-2804970384) - by @huntie +- move Gemfile to the root ([bc1b53e](https://github.com/callstack/react-native-builder-bob/commit/bc1b53e789eda7864b25ea5a4329425a88a84e13)) - by @satya164 +- use react native babel config for node_modules ([#823](https://github.com/callstack/react-native-builder-bob/issues/823)) ([a260218](https://github.com/callstack/react-native-builder-bob/commit/a260218a99443cac14106fff76321f32fbde32c7)), closes [#747](https://github.com/callstack/react-native-builder-bob/issues/747) - by @satya164 + ## [0.49.8](https://github.com/callstack/react-native-builder-bob/compare/create-react-native-library@0.49.7...create-react-native-library@0.49.8) (2025-04-11) ### Bug Fixes -* pass source flag to codegen cli when possible ([#815](https://github.com/callstack/react-native-builder-bob/issues/815)) ([7724e47](https://github.com/callstack/react-native-builder-bob/commit/7724e474d0b92d08a3a7b2946946114339acc19e)) - by @atlj +- pass source flag to codegen cli when possible ([#815](https://github.com/callstack/react-native-builder-bob/issues/815)) ([7724e47](https://github.com/callstack/react-native-builder-bob/commit/7724e474d0b92d08a3a7b2946946114339acc19e)) - by @atlj ## [0.49.7](https://github.com/callstack/react-native-builder-bob/compare/create-react-native-library@0.49.6...create-react-native-library@0.49.7) (2025-04-09) diff --git a/packages/create-react-native-library/package.json b/packages/create-react-native-library/package.json index ad0ede14c..b2a5ab2c0 100644 --- a/packages/create-react-native-library/package.json +++ b/packages/create-react-native-library/package.json @@ -1,6 +1,6 @@ { "name": "create-react-native-library", - "version": "0.49.8", + "version": "0.49.9", "description": "CLI to scaffold React Native libraries", "keywords": [ "react-native", diff --git a/packages/react-native-builder-bob/CHANGELOG.md b/packages/react-native-builder-bob/CHANGELOG.md index 566d0bff6..ab3331b72 100644 --- a/packages/react-native-builder-bob/CHANGELOG.md +++ b/packages/react-native-builder-bob/CHANGELOG.md @@ -3,11 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.40.7](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.40.6...react-native-builder-bob@0.40.7) (2025-04-30) + +### Bug Fixes + +- fix schema for configFile option ([5bec132](https://github.com/callstack/react-native-builder-bob/commit/5bec132fe73fb56b1870c9d357f7af91c9546e79)) - by @ +- migrate to babel-plugin-syntax-hermes-parser ([#822](https://github.com/callstack/react-native-builder-bob/issues/822)) ([a797db3](https://github.com/callstack/react-native-builder-bob/commit/a797db31ff02072e1f4ecf722b11872113d9d190)), closes [/github.com/facebook/react-native/issues/50683#issuecomment-2804970384](https://github.com//github.com/facebook/react-native/issues/50683/issues/issuecomment-2804970384) - by @huntie + ## [0.40.6](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.40.5...react-native-builder-bob@0.40.6) (2025-04-11) ### Bug Fixes -* pass source flag to codegen cli when possible ([#815](https://github.com/callstack/react-native-builder-bob/issues/815)) ([7724e47](https://github.com/callstack/react-native-builder-bob/commit/7724e474d0b92d08a3a7b2946946114339acc19e)) - by @atlj +- pass source flag to codegen cli when possible ([#815](https://github.com/callstack/react-native-builder-bob/issues/815)) ([7724e47](https://github.com/callstack/react-native-builder-bob/commit/7724e474d0b92d08a3a7b2946946114339acc19e)) - by @atlj ## [0.40.5](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.40.4...react-native-builder-bob@0.40.5) (2025-04-09) diff --git a/packages/react-native-builder-bob/package.json b/packages/react-native-builder-bob/package.json index 5647a0420..adb4dba7b 100644 --- a/packages/react-native-builder-bob/package.json +++ b/packages/react-native-builder-bob/package.json @@ -1,6 +1,6 @@ { "name": "react-native-builder-bob", - "version": "0.40.6", + "version": "0.40.7", "description": "CLI to build JavaScript files for React Native libraries", "keywords": [ "react-native",