diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9f9e9e67..6fb6a136 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -35,3 +35,6 @@ jobs: run: | npm run build:cli node bin/code-push.js build-patch-tools --print-hash > /dev/null + # Loads a TypeScript config file that uses `export default` and a tsconfig `paths` alias, + # from its project directory the way a user runs the CLI. + (cd cli/__fixtures__/ts-config-project && node ../../../bin/code-push.js show-history -b 1.0.0 -p ios | grep -q '"packageHash": "fixture"') diff --git a/README.md b/README.md index f3104a6d..432116b1 100644 --- a/README.md +++ b/README.md @@ -394,7 +394,18 @@ module.exports = Config; - Modifying an existing release history with the `update-history` command. -**(2) For `code-push.config.ts` (TypeScript) to work properly, you may need to update your `tsconfig.json`.** +**(2) A `code-push.config.ts` (TypeScript) file needs a loader installed.** + +Install `tsx`, which requires no further setup: + +```bash +npm install --save-dev tsx +``` + +`ts-node` also keeps working, and is used when `tsx` is not installed. Note that `ts-node` is no +longer maintained, so support for it is **deprecated and will be removed in a future major +version** — please migrate to `tsx`. Until then, `ts-node` needs the following `tsconfig.json` +setup: ```diff { @@ -414,6 +425,8 @@ module.exports = Config; ``` +A `code-push.config.js` (JavaScript) file needs neither. + ### 6. Diff Updates (Optional) diff --git a/cli/README.ko.md b/cli/README.ko.md index bd101412..79245fa2 100644 --- a/cli/README.ko.md +++ b/cli/README.ko.md @@ -6,7 +6,7 @@ - **Node.js** >= 18 - React Native 프로젝트에서 **Hermes** 엔진 활성화 -- **ts-node** (선택 사항, 설정 파일이 `.ts`인 경우 필요) +- **tsx** 또는 **ts-node** (선택 사항, 설정 파일이 `.ts`인 경우에만 필요하며 `tsx`를 권장합니다) ## 빠른 시작 diff --git a/cli/README.md b/cli/README.md index b938d0e6..76e6e0fc 100644 --- a/cli/README.md +++ b/cli/README.md @@ -6,7 +6,7 @@ CLI for [`@bravemobile/react-native-code-push`](../README.md). Bundles, releases - **Node.js** >= 18 - **Hermes** engine enabled in your React Native project -- **ts-node** (optional — only needed if your config file is `.ts`) +- **tsx** or **ts-node** (optional — only needed if your config file is `.ts`; `tsx` recommended) ## Quick Start diff --git a/cli/__fixtures__/ts-config-project/code-push.config.ts b/cli/__fixtures__/ts-config-project/code-push.config.ts new file mode 100644 index 00000000..85f5d1c9 --- /dev/null +++ b/cli/__fixtures__/ts-config-project/code-push.config.ts @@ -0,0 +1,14 @@ +// Loaded by the CI smoke test through the compiled CLI: a TypeScript config that uses +// `export default` and a tsconfig `paths` alias, the two things the loader must handle. +import type { CliConfigInterface, ReleaseHistoryInterface } from "@bravemobile/react-native-code-push"; +import { downloadUrlFor } from "@helpers/host"; + +const config: CliConfigInterface = { + bundleUploader: async (source) => ({ downloadUrl: downloadUrlFor(source) }), + getReleaseHistory: async (targetBinaryVersion): Promise => ({ + [targetBinaryVersion]: { enabled: true, mandatory: false, downloadUrl: downloadUrlFor("fixture.zip"), packageHash: "fixture" }, + }), + setReleaseHistory: async () => {}, +}; + +export default config; diff --git a/cli/__fixtures__/ts-config-project/helpers/host.ts b/cli/__fixtures__/ts-config-project/helpers/host.ts new file mode 100644 index 00000000..70f959de --- /dev/null +++ b/cli/__fixtures__/ts-config-project/helpers/host.ts @@ -0,0 +1,5 @@ +const CDN_HOST = "https://cdn.example.com"; + +export function downloadUrlFor(fileName: string): string { + return `${CDN_HOST}/${fileName}`; +} diff --git a/cli/__fixtures__/ts-config-project/package.json b/cli/__fixtures__/ts-config-project/package.json new file mode 100644 index 00000000..daeb8a2c --- /dev/null +++ b/cli/__fixtures__/ts-config-project/package.json @@ -0,0 +1,4 @@ +{ + "name": "ts-config-project", + "private": true +} diff --git a/cli/__fixtures__/ts-config-project/tsconfig.json b/cli/__fixtures__/ts-config-project/tsconfig.json new file mode 100644 index 00000000..473bd53d --- /dev/null +++ b/cli/__fixtures__/ts-config-project/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "bundler", + "baseUrl": ".", + "paths": { + "@helpers/*": ["helpers/*"] + } + } +} diff --git a/cli/package.json b/cli/package.json index 60ada820..1b7f9179 100644 --- a/cli/package.json +++ b/cli/package.json @@ -19,11 +19,15 @@ "yauzl": "^3.2.0" }, "peerDependencies": { - "ts-node": ">=10" + "ts-node": ">=10", + "tsx": ">=4" }, "peerDependenciesMeta": { "ts-node": { "optional": true + }, + "tsx": { + "optional": true } }, "engines": { diff --git a/cli/tsconfig.json b/cli/tsconfig.json index 706bbd6e..bfc6958c 100644 --- a/cli/tsconfig.json +++ b/cli/tsconfig.json @@ -16,6 +16,7 @@ }, "include": ["./**/*.ts"], "exclude": [ - "dist" + "dist", + "**/__fixtures__" ] } diff --git a/cli/utils/fsUtils.ts b/cli/utils/fsUtils.ts index e31d1e96..5a8b2767 100644 --- a/cli/utils/fsUtils.ts +++ b/cli/utils/fsUtils.ts @@ -3,28 +3,62 @@ import path from "path"; import { createRequire } from "module"; import type { CliConfigInterface } from "../../typings/react-native-code-push.d.ts"; -const nodeRequire = createRequire(import.meta.url); - /** * allows to require a config file with .ts extension */ function requireConfig(filePath: string): CliConfigInterface { const ext = path.extname(filePath); + // Resolve the loader from the project the config file lives in, not from the CLI install. + const projectRequire = createRequire(filePath); if (ext === '.ts') { - try { - nodeRequire('ts-node/register'); - } catch { - console.error('ts-node not found. Please install ts-node as a devDependency.'); - process.exit(1); - } + return unwrapDefaultExport(requireTsConfig(projectRequire, filePath)); } else if (ext === '.js') { // do nothing } else { throw new Error(`Unsupported file extension: ${ext}`); } - return nodeRequire(filePath) as CliConfigInterface; + return unwrapDefaultExport(projectRequire(filePath)); +} + +/** + * tsx is preferred: it needs no tsconfig setup and resolves tsconfig `paths` aliases on its own. + * ts-node keeps working for projects that already have it configured. + */ +function requireTsConfig(projectRequire: NodeRequire, filePath: string): { default?: unknown } { + if (canResolve(projectRequire, 'tsx/cjs/api')) { + const { require: tsxRequire } = projectRequire('tsx/cjs/api') as { + require: (id: string, fromFile: string) => { default?: unknown }; + }; + return tsxRequire(filePath, filePath); + } + + if (canResolve(projectRequire, 'ts-node/register')) { + console.warn( + 'warn: Loading the config file with ts-node, which is no longer maintained. Support for it ' + + 'will be removed in a future major version - please install tsx instead (`npm i -D tsx`).', + ); + projectRequire('ts-node/register'); + return projectRequire(filePath); + } + + console.error('A TypeScript config file needs a loader. Please install tsx as a devDependency (`npm i -D tsx`).'); + process.exit(1); +} + +function canResolve(projectRequire: NodeRequire, id: string): boolean { + try { + projectRequire.resolve(id); + return true; + } catch { + return false; + } +} + +// `export default` compiles to `exports.default`; `module.exports =` is returned as is. +function unwrapDefaultExport(loaded: { default?: unknown }): CliConfigInterface { + return (loaded.default ?? loaded) as CliConfigInterface; } export function findAndReadConfigFile(startDir: string, configFileName: string): CliConfigInterface { diff --git a/package-lock.json b/package-lock.json index 7984363e..2d05c93a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "react": "19.2.3", "react-native": "0.84.1", "ts-node": "^10.9.2", + "tsx": "^4.23.13", "typescript": "5.0.4", "typescript-eslint": "^8.11.0" }, @@ -51,11 +52,19 @@ }, "peerDependencies": { "expo": ">=50.0.0", - "react-native": "*" + "react-native": "*", + "ts-node": ">=10", + "tsx": ">=4" }, "peerDependenciesMeta": { "expo": { "optional": true + }, + "ts-node": { + "optional": true + }, + "tsx": { + "optional": true } } }, @@ -79,11 +88,15 @@ "node": ">=18" }, "peerDependencies": { - "ts-node": ">=10" + "ts-node": ">=10", + "tsx": ">=4" }, "peerDependenciesMeta": { "ts-node": { "optional": true + }, + "tsx": { + "optional": true } } }, @@ -1809,6 +1822,422 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "dev": true, @@ -4509,6 +4938,48 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "devOptional": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, "node_modules/escalade": { "version": "3.2.0", "dev": true, @@ -5162,8 +5633,10 @@ "license": "ISC" }, "node_modules/fsevents": { - "version": "2.3.2", - "dev": true, + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -8997,6 +9470,25 @@ "node": ">=0.3.1" } }, + "node_modules/tsx": { + "version": "4.23.13", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.13.tgz", + "integrity": "sha512-BL5MGkRln6aDYhb0xbQlEAGw743BaZYWdbWtdJOBriYJboKgUUYCadFp2/FpBBZquBC/ezNBn7wMMPx7FDZUDw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/type-detect": { "version": "4.0.8", "dev": true, diff --git a/package.json b/package.json index 8d577c3c..b2f8a254 100644 --- a/package.json +++ b/package.json @@ -102,11 +102,19 @@ }, "peerDependencies": { "expo": ">=50.0.0", - "react-native": "*" + "react-native": "*", + "ts-node": ">=10", + "tsx": ">=4" }, "peerDependenciesMeta": { "expo": { "optional": true + }, + "ts-node": { + "optional": true + }, + "tsx": { + "optional": true } }, "devDependencies": { @@ -129,6 +137,7 @@ "react": "19.2.3", "react-native": "0.84.1", "ts-node": "^10.9.2", + "tsx": "^4.23.13", "typescript": "5.0.4", "typescript-eslint": "^8.11.0" },