@coinbase/create-cdp-app 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
5
5
  import { green, yellow, reset, red } from "kolorist";
6
6
  import minimist from "minimist";
7
7
  import prompts from "prompts";
8
+ import os from "node:os";
8
9
  function prepareAppDirectory(targetDir, shouldOverwrite) {
9
10
  const root = path.join(process.cwd(), targetDir);
10
11
  if (!fs.existsSync(root)) {
@@ -126,6 +127,66 @@ function isDirEmpty(dirPath) {
126
127
  const files = fs.readdirSync(dirPath);
127
128
  return files.length === 0 || files.length === 1 && files[0] === ".git";
128
129
  }
130
+ function customizeReactNativeFiles(templateDir, appName) {
131
+ const username = os.userInfo().username || "user";
132
+ const cleanUsername = username.toLowerCase().replace(/[^a-z0-9]/g, "");
133
+ const cleanAppName = appName.toLowerCase().replace(/[^a-z0-9]/g, "");
134
+ const safeBundleId = `com.${cleanUsername}.${cleanAppName}`;
135
+ const newPackagePath = `com/${cleanUsername}/${cleanAppName}`;
136
+ const customizedFiles = { safeBundleId, newPackagePath };
137
+ const appJsonPath = path.join(templateDir, "app.json");
138
+ if (fs.existsSync(appJsonPath)) {
139
+ const appJsonContent = fs.readFileSync(appJsonPath, "utf-8");
140
+ customizedFiles.appJson = appJsonContent.replace(/com\.anonymous\.reactnativeexpo/g, safeBundleId).replace(/"name": "react-native-expo"/g, `"name": "${appName}"`);
141
+ }
142
+ const infoPlistPath = path.join(templateDir, "ios/reactnativeexpo/Info.plist");
143
+ if (fs.existsSync(infoPlistPath)) {
144
+ const infoPlistContent = fs.readFileSync(infoPlistPath, "utf-8");
145
+ customizedFiles.infoPlist = infoPlistContent.replace(
146
+ /com\.anonymous\.reactnativeexpo/g,
147
+ safeBundleId
148
+ );
149
+ }
150
+ const buildGradlePath = path.join(templateDir, "android/app/build.gradle");
151
+ if (fs.existsSync(buildGradlePath)) {
152
+ const buildGradleContent = fs.readFileSync(buildGradlePath, "utf-8");
153
+ customizedFiles.buildGradle = buildGradleContent.replace(
154
+ /com\.anonymous\.reactnativeexpo/g,
155
+ safeBundleId
156
+ );
157
+ }
158
+ const mainActivityPath = path.join(
159
+ templateDir,
160
+ "android/app/src/main/java/com/anonymous/reactnativeexpo/MainActivity.kt"
161
+ );
162
+ if (fs.existsSync(mainActivityPath)) {
163
+ const mainActivityContent = fs.readFileSync(mainActivityPath, "utf-8");
164
+ customizedFiles.mainActivity = mainActivityContent.replace(
165
+ /package com\.anonymous\.reactnativeexpo/g,
166
+ `package ${safeBundleId}`
167
+ );
168
+ }
169
+ const mainApplicationPath = path.join(
170
+ templateDir,
171
+ "android/app/src/main/java/com/anonymous/reactnativeexpo/MainApplication.kt"
172
+ );
173
+ if (fs.existsSync(mainApplicationPath)) {
174
+ const mainApplicationContent = fs.readFileSync(mainApplicationPath, "utf-8");
175
+ customizedFiles.mainApplication = mainApplicationContent.replace(
176
+ /package com\.anonymous\.reactnativeexpo/g,
177
+ `package ${safeBundleId}`
178
+ );
179
+ }
180
+ const xcodeProjectPath = path.join(templateDir, "ios/reactnativeexpo.xcodeproj/project.pbxproj");
181
+ if (fs.existsSync(xcodeProjectPath)) {
182
+ const xcodeProjectContent = fs.readFileSync(xcodeProjectPath, "utf-8");
183
+ customizedFiles.xcodeProject = xcodeProjectContent.replace(
184
+ /com\.anonymous\.reactnativeexpo/g,
185
+ safeBundleId
186
+ );
187
+ }
188
+ return customizedFiles;
189
+ }
129
190
  function detectPackageManager() {
130
191
  const userAgent = process.env.npm_config_user_agent;
131
192
  if (userAgent) {
@@ -386,6 +447,8 @@ function copyTemplateFiles({
386
447
  }
387
448
  };
388
449
  const isNextjs = templateDir.includes("nextjs");
450
+ const isReactNative = templateDir.includes("react-native");
451
+ const reactNativeCustomizations = isReactNative ? customizeReactNativeFiles(templateDir, appName) : null;
389
452
  const files = fs.readdirSync(templateDir);
390
453
  for (const file of files) {
391
454
  if (file === "package.json") {
@@ -408,11 +471,12 @@ function copyTemplateFiles({
408
471
  console.log("Configuring Smart Accounts in environment");
409
472
  }
410
473
  writeFileToTarget(".env", customizedEnv);
474
+ } else if (file === "app.json" && isReactNative && (reactNativeCustomizations == null ? void 0 : reactNativeCustomizations.appJson)) {
475
+ writeFileToTarget(file, reactNativeCustomizations.appJson);
411
476
  } else {
412
477
  writeFileToTarget(file);
413
478
  }
414
479
  }
415
- const isReactNative = templateDir.includes("react-native");
416
480
  if (useSmartAccounts && !isReactNative) {
417
481
  const configFileName = isNextjs ? "src/components/Providers.tsx" : "src/config.ts";
418
482
  const customizedConfig = customizeConfig(templateDir, useSmartAccounts, isNextjs);
@@ -429,7 +493,48 @@ function copyTemplateFiles({
429
493
  const transactionContent = generateTransactionComponent(useSmartAccounts);
430
494
  writeFileToTarget(transactionFileName, transactionContent);
431
495
  }
432
- if (isReactNative) {
496
+ if (isReactNative && reactNativeCustomizations) {
497
+ if (reactNativeCustomizations.infoPlist) {
498
+ writeFileToTarget("ios/reactnativeexpo/Info.plist", reactNativeCustomizations.infoPlist);
499
+ }
500
+ if (reactNativeCustomizations.buildGradle) {
501
+ writeFileToTarget("android/app/build.gradle", reactNativeCustomizations.buildGradle);
502
+ }
503
+ if (reactNativeCustomizations.xcodeProject) {
504
+ writeFileToTarget(
505
+ "ios/reactnativeexpo.xcodeproj/project.pbxproj",
506
+ reactNativeCustomizations.xcodeProject
507
+ );
508
+ }
509
+ const newPackageDir = path.join(
510
+ root,
511
+ "android/app/src/main/java",
512
+ reactNativeCustomizations.newPackagePath
513
+ );
514
+ fs.mkdirSync(newPackageDir, { recursive: true });
515
+ if (reactNativeCustomizations.mainActivity) {
516
+ const newMainActivityPath = path.join(
517
+ "android/app/src/main/java",
518
+ reactNativeCustomizations.newPackagePath,
519
+ "MainActivity.kt"
520
+ );
521
+ writeFileToTarget(newMainActivityPath, reactNativeCustomizations.mainActivity);
522
+ }
523
+ if (reactNativeCustomizations.mainApplication) {
524
+ const newMainApplicationPath = path.join(
525
+ "android/app/src/main/java",
526
+ reactNativeCustomizations.newPackagePath,
527
+ "MainApplication.kt"
528
+ );
529
+ writeFileToTarget(newMainApplicationPath, reactNativeCustomizations.mainApplication);
530
+ }
531
+ const oldPackageDir = path.join(
532
+ root,
533
+ "android/app/src/main/java/com/anonymous/reactnativeexpo"
534
+ );
535
+ if (fs.existsSync(oldPackageDir)) {
536
+ fs.rmSync(oldPackageDir, { recursive: true, force: true });
537
+ }
433
538
  const gradlewPath = path.join(root, "android", "gradlew");
434
539
  if (fs.existsSync(gradlewPath)) {
435
540
  fs.chmodSync(gradlewPath, 493);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/getAppDetails.ts","../src/index.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\n\n/**\n * Prepare the app directory\n *\n * @param targetDir - The target directory for the app\n * @param shouldOverwrite - Whether to overwrite the existing directory\n * @returns The path to the prepared app directory\n */\nexport function prepareAppDirectory(targetDir: string, shouldOverwrite: boolean): string {\n const root = path.join(process.cwd(), targetDir);\n\n if (shouldOverwrite) {\n emptyDir(root);\n } else if (!fs.existsSync(root)) {\n fs.mkdirSync(root, { recursive: true });\n }\n\n return root;\n}\n\n/**\n * Customize package.json for the new app\n *\n * @param templateDir - The directory containing the template files\n * @param appName - The name of the app\n * @param includeSdk - Whether to include the CDP SDK in the dependencies\n * @returns The customized package.json content\n */\nexport function customizePackageJson(\n templateDir: string,\n appName: string,\n includeSdk?: boolean,\n): string {\n const packageJsonPath = path.join(templateDir, \"package.json\");\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf-8\"));\n packageJson.name = appName;\n if (includeSdk) {\n packageJson.dependencies[\"@coinbase/cdp-sdk\"] = \"latest\";\n }\n return JSON.stringify(packageJson, null, 2) + \"\\n\";\n}\n\n/**\n * Set up the .env file for the new app\n *\n * @param params - The parameters for the function\n * @param params.templateDir - The directory containing the template files\n * @param params.projectId - The CDP Project ID\n * @param params.useSmartAccounts - Whether to enable smart accounts\n * @param params.apiKeyId - The API Key ID\n * @param params.apiKeySecret - The API Key Secret\n * @returns The customized .env content\n */\nexport function customizeEnv({\n templateDir,\n projectId,\n useSmartAccounts,\n apiKeyId,\n apiKeySecret,\n}: {\n templateDir: string;\n projectId: string;\n useSmartAccounts?: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}): string {\n const exampleEnvPath = path.join(templateDir, \"env.example\");\n const exampleEnv = fs.readFileSync(exampleEnvPath, \"utf-8\");\n\n let envContent = exampleEnv.replace(/(.*PROJECT_ID=).*(\\r?\\n|$)/, `$1${projectId}\\n`);\n\n // Set the account type based on user choice\n const accountType = useSmartAccounts ? \"evm-smart\" : \"evm-eoa\";\n let prefix: string;\n if (templateDir.includes(\"nextjs\")) {\n prefix = \"NEXT_PUBLIC_\";\n } else if (templateDir.includes(\"react-native\")) {\n prefix = \"EXPO_PUBLIC_\";\n } else {\n prefix = \"VITE_\";\n }\n envContent = envContent.replace(\n new RegExp(`(${prefix}CDP_CREATE_ACCOUNT_TYPE=).*(\\r?\\n|$)`),\n `$1${accountType}\\n`,\n );\n\n // Replace CDP API credentials if provided\n if (apiKeyId && apiKeySecret) {\n // Replace the commented API Key ID\n envContent = envContent.replace(/# CDP_API_KEY_ID=.*/, `CDP_API_KEY_ID=${apiKeyId}`);\n // Replace the commented API Key Secret\n envContent = envContent.replace(\n /# CDP_API_KEY_SECRET=.*/,\n `CDP_API_KEY_SECRET=${apiKeySecret}`,\n );\n }\n\n return envContent;\n}\n\n/**\n * Customize configuration files for smart accounts\n *\n * @param templateDir - The directory containing the template files\n * @param useSmartAccounts - Whether to enable smart accounts\n * @param isNextjs - Whether this is a Next.js template\n * @returns The customized config content\n */\nexport function customizeConfig(\n templateDir: string,\n useSmartAccounts: boolean,\n isNextjs: boolean,\n): string | null {\n if (!useSmartAccounts) return null;\n\n const configFileName = isNextjs ? \"src/components/Providers.tsx\" : \"src/config.ts\";\n const configPath = path.join(templateDir, configFileName);\n\n if (!fs.existsSync(configPath)) return null;\n\n let configContent = fs.readFileSync(configPath, \"utf-8\");\n\n if (isNextjs) {\n // For Next.js Providers.tsx\n configContent = configContent.replace(\n /const CDP_CONFIG: Config = \\{[\\s\\S]*?\\};/,\n `const CDP_CONFIG: Config = {\n projectId: process.env.NEXT_PUBLIC_CDP_PROJECT_ID ?? \"\",\n createAccountOnLogin: process.env.NEXT_PUBLIC_CDP_CREATE_ACCOUNT_TYPE === \"evm-smart\" ? \"evm-smart\" : \"evm-eoa\",\n};`,\n );\n } else {\n // For React config.ts\n configContent = configContent.replace(\n /export const CDP_CONFIG: Config = \\{[\\s\\S]*?\\};/,\n `export const CDP_CONFIG: Config = {\n projectId: import.meta.env.VITE_CDP_PROJECT_ID,\n createAccountOnLogin: import.meta.env.VITE_CDP_CREATE_ACCOUNT_TYPE === \"evm-smart\" ? \"evm-smart\" : \"evm-eoa\",\n};`,\n );\n }\n\n return configContent;\n}\n\n/**\n * Copy a file or directory recursively\n *\n * @param filePath - The source path\n * @param destPath - The destination path\n */\nexport function copyFile(filePath: string, destPath: string): void {\n const stat = fs.statSync(filePath);\n if (stat.isDirectory()) {\n copyDir(filePath, destPath);\n } else {\n fs.copyFileSync(filePath, destPath);\n }\n}\n\n/**\n * Copy a file or directory recursively with selective filtering for transaction components\n *\n * @param params - The parameters for the function\n * @param params.filePath - The source path\n * @param params.destPath - The destination path\n * @param params.useSmartAccounts - Whether to use Smart Accounts\n * @param params.enableOnramp - Whether to include Onramp\n */\nexport function copyFileSelectively({\n filePath,\n destPath,\n useSmartAccounts,\n enableOnramp,\n}: {\n filePath: string;\n destPath: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n}): void {\n const stat = fs.statSync(filePath);\n if (stat.isDirectory()) {\n const baseDir = path.basename(filePath);\n // skip api and lib directories if Onramp is not enabled\n if (!enableOnramp && (baseDir === \"api\" || baseDir === \"lib\")) return;\n // copy the directory\n copyDirSelectively({ srcDir: filePath, destDir: destPath, useSmartAccounts, enableOnramp });\n } else {\n const fileName = path.basename(filePath);\n\n // Skip transaction components that don't match the user's choice\n if (useSmartAccounts && fileName === \"EOATransaction.tsx\") return;\n if (!useSmartAccounts && fileName === \"SmartAccountTransaction.tsx\") return;\n\n // Skip Onramp files if the user didn't enable Onramp\n if (!enableOnramp && [\"FundWallet.tsx\", \"SignedInScreenWithOnramp.tsx\"].includes(fileName))\n return;\n // Onramp-specific SignedInScreen\n if (enableOnramp) {\n // Skip the default SignedInScreen.tsx file\n if (fileName === \"SignedInScreen.tsx\") return;\n // Copy the SignedInScreenWithOnramp.tsx file to SignedInScreen.tsx\n if (fileName === \"SignedInScreenWithOnramp.tsx\") {\n const newDestPath = destPath.replace(\"SignedInScreenWithOnramp.tsx\", \"SignedInScreen.tsx\");\n fs.copyFileSync(filePath, newDestPath);\n return;\n }\n }\n\n fs.copyFileSync(filePath, destPath);\n }\n}\n\n/**\n * Copy a directory recursively\n *\n * @param srcDir - The source directory path\n * @param destDir - The destination directory path\n */\nfunction copyDir(srcDir: string, destDir: string): void {\n fs.mkdirSync(destDir, { recursive: true });\n for (const file of fs.readdirSync(srcDir)) {\n const srcFile = path.resolve(srcDir, file);\n const destFile = path.resolve(destDir, file);\n copyFile(srcFile, destFile);\n }\n}\n\n/**\n * Copy a directory recursively with selective filtering\n *\n * @param params - The parameters for the function\n * @param params.srcDir - The source directory path\n * @param params.destDir - The destination directory path\n * @param params.useSmartAccounts - Whether to use Smart Accounts\n * @param params.enableOnramp - Whether to include Onramp\n */\nfunction copyDirSelectively({\n srcDir,\n destDir,\n useSmartAccounts,\n enableOnramp,\n}: {\n srcDir: string;\n destDir: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n}): void {\n fs.mkdirSync(destDir, { recursive: true });\n for (const file of fs.readdirSync(srcDir)) {\n const srcFile = path.resolve(srcDir, file);\n const destFile = path.resolve(destDir, file);\n copyFileSelectively({ filePath: srcFile, destPath: destFile, useSmartAccounts, enableOnramp });\n }\n}\n\n/**\n * Check if a directory is empty\n *\n * @param dirPath - The path to the directory\n * @returns True if the directory is empty, false otherwise\n */\nexport function isDirEmpty(dirPath: string): boolean {\n const files = fs.readdirSync(dirPath);\n return files.length === 0 || (files.length === 1 && files[0] === \".git\");\n}\n\n/**\n * Empty a directory while preserving .git\n *\n * @param dirPath - The path to the directory\n */\nfunction emptyDir(dirPath: string): void {\n if (!fs.existsSync(dirPath)) {\n return;\n }\n for (const file of fs.readdirSync(dirPath)) {\n if (file === \".git\") {\n continue;\n }\n fs.rmSync(path.resolve(dirPath, file), { recursive: true, force: true });\n }\n}\n\n/**\n * Detect which package manager invoked the create command\n *\n * @returns The detected package manager or 'pnpm' as default\n */\nexport function detectPackageManager(): \"npm\" | \"pnpm\" | \"yarn\" {\n const userAgent = process.env.npm_config_user_agent;\n\n if (userAgent) {\n if (userAgent.startsWith(\"yarn\")) return \"yarn\";\n if (userAgent.startsWith(\"pnpm\")) return \"pnpm\";\n if (userAgent.startsWith(\"npm\")) return \"npm\";\n }\n\n return \"npm\"; // Default to npm if we can't detect\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\n\nimport { green, red, reset, yellow } from \"kolorist\";\nimport minimist from \"minimist\";\nimport prompts from \"prompts\";\n\nimport { isDirEmpty } from \"./utils.js\";\n\nconst defaultTargetDir = \"cdp-app\";\n\n// Available templates for app creation\nconst TEMPLATES = [\n {\n name: \"react\",\n display: \"React Single Page App\",\n color: green,\n },\n {\n name: \"nextjs\",\n display: \"Next.js Full Stack App\",\n color: green,\n },\n {\n name: \"react-native\",\n display: \"React Native with Expo\",\n color: green,\n },\n] as const;\n\nconst TEMPLATE_NAMES = TEMPLATES.map(template => template.name);\n\ntype TemplateName = (typeof TEMPLATE_NAMES)[number];\n\n/**\n * App options\n */\nexport interface AppOptions {\n appName: string;\n template: TemplateName;\n targetDirectory: string;\n projectId: string;\n useSmartAccounts: boolean;\n enableOnramp: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}\n\ntype CommandLineArgs = {\n \"project-id\": string;\n template: TemplateName;\n \"smart-accounts\"?: boolean;\n onramp?: boolean;\n};\n\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Get app details from command line arguments or prompt the user\n *\n * @returns The app details\n */\nexport async function getAppDetails(): Promise<AppOptions> {\n const argv = minimist<CommandLineArgs>(process.argv.slice(2));\n\n // Get target directory from command line args (first non-option argument)\n let targetDir = argv._[0];\n const defaultAppName = targetDir ?? defaultTargetDir;\n let templateFromArgs: TemplateName | undefined = undefined;\n let projectIdFromArgs: string | undefined = undefined;\n let enableOnrampFromArgs: boolean | undefined = undefined;\n const useSmartAccountsFromArgs = argv[\"smart-accounts\"];\n\n // Validate template from argv\n if (argv.template) {\n if (!TEMPLATE_NAMES.includes(argv.template)) {\n console.log(\n yellow(\n `✖ Invalid template provided: \"${argv.template}\". Please choose from: ${TEMPLATE_NAMES.join(\", \")}.`,\n ),\n );\n } else {\n templateFromArgs = argv.template;\n }\n }\n\n // Validate projectId from argv\n if (argv[\"project-id\"]) {\n if (!uuidRegex.test(argv[\"project-id\"])) {\n console.log(\n yellow(`✖ Invalid Project ID provided: \"${argv.projectId}\". Please enter a valid UUID.`),\n );\n } else {\n projectIdFromArgs = argv[\"project-id\"];\n }\n }\n\n // Validate compatible template for onramp\n if (argv[\"onramp\"] !== undefined) {\n if (!argv[\"onramp\"]) {\n enableOnrampFromArgs = false;\n } else {\n // if template is not provided and onramp is enabled, force nextjs template\n if (!templateFromArgs) {\n templateFromArgs = \"nextjs\";\n }\n if (templateFromArgs !== \"nextjs\") {\n console.log(yellow(`✖ Onramp is only supported with the Next.js template.`));\n } else {\n enableOnrampFromArgs = true;\n }\n }\n }\n\n try {\n const result = await prompts(\n [\n {\n type: targetDir ? null : \"text\",\n name: \"appName\",\n message: reset(\"App Name:\"),\n initial: defaultAppName,\n onState: state => {\n targetDir = String(state.value).trim() || defaultAppName;\n },\n },\n {\n type: templateFromArgs ? null : \"select\",\n name: \"template\",\n message: reset(\"Template:\"),\n initial: 0,\n choices: TEMPLATES.map(template => ({\n title: template.color(template.display),\n value: template.name,\n })),\n },\n {\n type: projectIdFromArgs ? null : \"text\",\n name: \"projectId\",\n message: reset(\n \"CDP Project ID (Find your project ID at https://portal.cdp.coinbase.com/projects/overview):\",\n ),\n validate: value => {\n if (!value) {\n return \"Project ID is required\";\n } else if (!uuidRegex.test(value)) {\n return \"Project ID must be a valid UUID\";\n }\n return true;\n },\n initial: \"\",\n },\n {\n type: useSmartAccountsFromArgs !== undefined ? null : \"confirm\",\n name: \"useSmartAccounts\",\n message: reset(\n \"Enable Smart Accounts? (Smart Accounts enable gasless transactions and improved UX):\",\n ),\n initial: false,\n },\n {\n type: (_, { template }: { template?: string }) =>\n enableOnrampFromArgs !== undefined || (templateFromArgs || template) !== \"nextjs\"\n ? null\n : \"confirm\",\n name: \"enableOnramp\",\n message: reset(\"Enable Coinbase Onramp? (Onramp enables users to buy crypto with fiat):\"),\n initial: false,\n },\n {\n type: (_, { enableOnramp }: { enableOnramp?: boolean }) =>\n enableOnramp || enableOnrampFromArgs ? \"text\" : null,\n name: \"apiKeyId\",\n message: reset(\"CDP API Key ID (Create at https://portal.cdp.coinbase.com/api-keys):\"),\n validate: value => {\n if (!value) {\n return \"API Key ID is required for Onramp\";\n }\n return true;\n },\n },\n {\n type: (_, { enableOnramp }: { enableOnramp?: boolean }) =>\n enableOnramp || enableOnrampFromArgs ? \"password\" : null,\n name: \"apiKeySecret\",\n message: reset(\"CDP API Key Secret (paste your private key - it will be hidden):\"),\n validate: value => {\n if (!value) {\n return \"API Key Secret is required for Onramp\";\n }\n return true;\n },\n },\n {\n type: (_, { template }: { template?: string }) =>\n (templateFromArgs || template) === \"react-native\" ? null : \"confirm\",\n name: \"corsConfirmation\",\n message: reset(\n \"Confirm you have whitelisted 'http://localhost:3000' at https://portal.cdp.coinbase.com/products/embedded-wallets/domains:\",\n ),\n initial: true,\n },\n {\n type: () => (!fs.existsSync(targetDir) || isDirEmpty(targetDir) ? null : \"confirm\"),\n name: \"overwrite\",\n message: () =>\n (targetDir === \".\" ? \"Current directory\" : `Target directory \"${targetDir}\"`) +\n \" is not empty. Remove existing files and continue?\",\n },\n {\n type: (_, { overwrite }: { overwrite?: boolean }) => {\n if (overwrite === false) {\n throw new Error(red(\"✖\") + \" Operation cancelled\");\n }\n return null;\n },\n name: \"overwriteChecker\",\n },\n ],\n {\n onCancel: () => {\n throw new Error(red(\"✖\") + \" Operation cancelled\");\n },\n },\n );\n\n return {\n appName: result.appName || targetDir,\n template: templateFromArgs || result.template,\n targetDirectory: targetDir,\n projectId: projectIdFromArgs || result.projectId,\n useSmartAccounts: useSmartAccountsFromArgs ?? result.useSmartAccounts,\n enableOnramp: enableOnrampFromArgs ?? result.enableOnramp ?? false,\n apiKeyId: result.apiKeyId,\n apiKeySecret: result.apiKeySecret,\n };\n } catch (cancelled: unknown) {\n if (cancelled instanceof Error) {\n console.log(cancelled.message);\n }\n process.exit(0);\n }\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { green } from \"kolorist\";\n\nimport { getAppDetails } from \"./getAppDetails.js\";\nimport {\n prepareAppDirectory,\n customizePackageJson,\n copyFileSelectively,\n customizeEnv,\n customizeConfig,\n detectPackageManager,\n} from \"./utils.js\";\n\nconst fileRenames: Record<string, string | undefined> = {\n _gitignore: \".gitignore\",\n};\n\n/**\n * Initialize a new CDP app\n */\nasync function init(): Promise<void> {\n const {\n appName,\n template,\n targetDirectory,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n } = await getAppDetails();\n\n console.log(`\\nScaffolding app in ${targetDirectory}...`);\n\n const root = prepareAppDirectory(targetDirectory, false);\n const templateDir = path.resolve(fileURLToPath(import.meta.url), \"../..\", `template-${template}`);\n\n copyTemplateFiles({\n templateDir,\n root,\n appName,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n });\n printNextSteps(root, template);\n}\n\n/**\n * Print next steps for the user\n *\n * @param appRoot - The root directory of the app\n * @param template - The template that was used\n */\nfunction printNextSteps(appRoot: string, template: string): void {\n const packageManager = detectPackageManager();\n\n console.log(green(\"\\nDone. Now run your app:\\n\"));\n if (appRoot !== process.cwd()) {\n console.log(`cd ${path.relative(process.cwd(), appRoot)}`);\n }\n\n console.log(`${packageManager} install`);\n\n if (template === \"react-native\") {\n const startCommand =\n packageManager === \"npm\"\n ? \"npm run ios # or npm run android\"\n : `${packageManager} run ios # or ${packageManager} run android`;\n console.log(startCommand);\n } else {\n const devCommand = packageManager === \"npm\" ? \"npm run dev\" : `${packageManager} dev`;\n console.log(devCommand);\n }\n}\n\n/**\n * Copy template files to the app directory\n *\n * @param params - The parameters for the function\n * @param params.templateDir - The directory containing the template files\n * @param params.root - The root directory of the app\n * @param params.appName - The name of the app\n * @param params.projectId - The CDP Project ID\n * @param params.useSmartAccounts - Whether to enable smart accounts\n * @param params.enableOnramp - Whether to include Onramp\n * @param params.apiKeyId - The API Key ID\n * @param params.apiKeySecret - The API Key Secret\n */\nfunction copyTemplateFiles({\n templateDir,\n root,\n appName,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n}: {\n templateDir: string;\n root: string;\n appName: string;\n projectId?: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}): void {\n const writeFileToTarget = (file: string, content?: string) => {\n const targetPath = path.join(root, fileRenames[file] ?? file);\n if (content) {\n fs.writeFileSync(targetPath, content);\n } else {\n copyFileSelectively({\n filePath: path.join(templateDir, file),\n destPath: targetPath,\n useSmartAccounts,\n enableOnramp,\n });\n }\n };\n\n const isNextjs = templateDir.includes(\"nextjs\");\n\n const files = fs.readdirSync(templateDir);\n for (const file of files) {\n if (file === \"package.json\") {\n const customizedPackageJson = customizePackageJson(templateDir, appName, enableOnramp);\n writeFileToTarget(file, customizedPackageJson);\n } else if (file === \"env.example\" && projectId) {\n writeFileToTarget(file);\n const customizedEnv = customizeEnv({\n templateDir,\n projectId,\n useSmartAccounts,\n apiKeyId,\n apiKeySecret,\n });\n console.log(\"Copying CDP Project ID to .env\");\n if (apiKeyId && apiKeySecret) {\n console.log(\"Copying CDP API credentials to .env\");\n }\n if (useSmartAccounts) {\n console.log(\"Configuring Smart Accounts in environment\");\n }\n writeFileToTarget(\".env\", customizedEnv);\n } else {\n writeFileToTarget(file);\n }\n }\n\n const isReactNative = templateDir.includes(\"react-native\");\n\n // Handle smart account configuration in config files\n if (useSmartAccounts && !isReactNative) {\n const configFileName = isNextjs ? \"src/components/Providers.tsx\" : \"src/config.ts\";\n const customizedConfig = customizeConfig(templateDir, useSmartAccounts, isNextjs);\n if (customizedConfig) {\n console.log(\"Configuring Smart Accounts in application config\");\n writeFileToTarget(configFileName, customizedConfig);\n }\n }\n\n // Generate the appropriate Transaction.tsx component\n if (isReactNative) {\n // For React Native, create the Transaction.tsx barrel file\n const transactionContent = generateTransactionComponent(useSmartAccounts);\n writeFileToTarget(\"Transaction.tsx\", transactionContent);\n } else {\n // For React/Next.js templates\n const transactionFileName = isNextjs ? \"src/components/Transaction.tsx\" : \"src/Transaction.tsx\";\n const transactionContent = generateTransactionComponent(useSmartAccounts);\n writeFileToTarget(transactionFileName, transactionContent);\n }\n\n // Update android/gradlew permissions so that the template is runnable\n if (isReactNative) {\n const gradlewPath = path.join(root, \"android\", \"gradlew\");\n if (fs.existsSync(gradlewPath)) {\n fs.chmodSync(gradlewPath, 0o755);\n }\n }\n}\n\n/**\n * Generate the appropriate Transaction component based on account type\n *\n * @param useSmartAccounts - Whether to use Smart Accounts\n * @returns The generated Transaction component content\n */\nfunction generateTransactionComponent(useSmartAccounts?: boolean): string {\n if (useSmartAccounts) {\n return `export { default } from \"./SmartAccountTransaction\";`;\n } else {\n return `export { default } from \"./EOATransaction\";`;\n }\n}\n\ninit().catch(e => {\n console.error(e);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;;;;;AAUgB,SAAA,oBAAoB,WAAmB,iBAAkC;AACvF,QAAM,OAAO,KAAK,KAAK,QAAQ,OAAO,SAAS;AAIpC,MAAA,CAAC,GAAG,WAAW,IAAI,GAAG;AAC/B,OAAG,UAAU,MAAM,EAAE,WAAW,MAAM;AAAA,EAAA;AAGjC,SAAA;AACT;AAUgB,SAAA,qBACd,aACA,SACA,YACQ;AACR,QAAM,kBAAkB,KAAK,KAAK,aAAa,cAAc;AAC7D,QAAM,cAAc,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CAAC;AACxE,cAAY,OAAO;AACnB,MAAI,YAAY;AACF,gBAAA,aAAa,mBAAmB,IAAI;AAAA,EAAA;AAElD,SAAO,KAAK,UAAU,aAAa,MAAM,CAAC,IAAI;AAChD;AAaO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMW;AACT,QAAM,iBAAiB,KAAK,KAAK,aAAa,aAAa;AAC3D,QAAM,aAAa,GAAG,aAAa,gBAAgB,OAAO;AAE1D,MAAI,aAAa,WAAW,QAAQ,8BAA8B,KAAK,SAAS;AAAA,CAAI;AAG9E,QAAA,cAAc,mBAAmB,cAAc;AACjD,MAAA;AACA,MAAA,YAAY,SAAS,QAAQ,GAAG;AACzB,aAAA;AAAA,EACA,WAAA,YAAY,SAAS,cAAc,GAAG;AACtC,aAAA;AAAA,EAAA,OACJ;AACI,aAAA;AAAA,EAAA;AAEX,eAAa,WAAW;AAAA,IACtB,IAAI,OAAO,IAAI,MAAM;AAAA,IAAsC;AAAA,IAC3D,KAAK,WAAW;AAAA;AAAA,EAClB;AAGA,MAAI,YAAY,cAAc;AAE5B,iBAAa,WAAW,QAAQ,uBAAuB,kBAAkB,QAAQ,EAAE;AAEnF,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,IAAA;AAAA,EACjC;AAEJ;AAQA,SAAS,6BAA6B,kBAAoC;AACxE,MAAI,kBAAkB;AACb,WAAA;AAAA,EAAA,OACF;AACE,WAAA;AAAA,EAAA;AAEX;AAEA,OAAO,MAAM,CAAK,MAAA;AAChB,UAAQ,MAAM,CAAC;AACf,UAAQ,KAAK,CAAC;AAChB,CAAC;"}
1
+ {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/getAppDetails.ts","../src/index.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n/**\n * Prepare the app directory\n *\n * @param targetDir - The target directory for the app\n * @param shouldOverwrite - Whether to overwrite the existing directory\n * @returns The path to the prepared app directory\n */\nexport function prepareAppDirectory(targetDir: string, shouldOverwrite: boolean): string {\n const root = path.join(process.cwd(), targetDir);\n\n if (shouldOverwrite) {\n emptyDir(root);\n } else if (!fs.existsSync(root)) {\n fs.mkdirSync(root, { recursive: true });\n }\n\n return root;\n}\n\n/**\n * Customize package.json for the new app\n *\n * @param templateDir - The directory containing the template files\n * @param appName - The name of the app\n * @param includeSdk - Whether to include the CDP SDK in the dependencies\n * @returns The customized package.json content\n */\nexport function customizePackageJson(\n templateDir: string,\n appName: string,\n includeSdk?: boolean,\n): string {\n const packageJsonPath = path.join(templateDir, \"package.json\");\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf-8\"));\n packageJson.name = appName;\n if (includeSdk) {\n packageJson.dependencies[\"@coinbase/cdp-sdk\"] = \"latest\";\n }\n return JSON.stringify(packageJson, null, 2) + \"\\n\";\n}\n\n/**\n * Set up the .env file for the new app\n *\n * @param params - The parameters for the function\n * @param params.templateDir - The directory containing the template files\n * @param params.projectId - The CDP Project ID\n * @param params.useSmartAccounts - Whether to enable smart accounts\n * @param params.apiKeyId - The API Key ID\n * @param params.apiKeySecret - The API Key Secret\n * @returns The customized .env content\n */\nexport function customizeEnv({\n templateDir,\n projectId,\n useSmartAccounts,\n apiKeyId,\n apiKeySecret,\n}: {\n templateDir: string;\n projectId: string;\n useSmartAccounts?: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}): string {\n const exampleEnvPath = path.join(templateDir, \"env.example\");\n const exampleEnv = fs.readFileSync(exampleEnvPath, \"utf-8\");\n\n let envContent = exampleEnv.replace(/(.*PROJECT_ID=).*(\\r?\\n|$)/, `$1${projectId}\\n`);\n\n // Set the account type based on user choice\n const accountType = useSmartAccounts ? \"evm-smart\" : \"evm-eoa\";\n let prefix: string;\n if (templateDir.includes(\"nextjs\")) {\n prefix = \"NEXT_PUBLIC_\";\n } else if (templateDir.includes(\"react-native\")) {\n prefix = \"EXPO_PUBLIC_\";\n } else {\n prefix = \"VITE_\";\n }\n envContent = envContent.replace(\n new RegExp(`(${prefix}CDP_CREATE_ACCOUNT_TYPE=).*(\\r?\\n|$)`),\n `$1${accountType}\\n`,\n );\n\n // Replace CDP API credentials if provided\n if (apiKeyId && apiKeySecret) {\n // Replace the commented API Key ID\n envContent = envContent.replace(/# CDP_API_KEY_ID=.*/, `CDP_API_KEY_ID=${apiKeyId}`);\n // Replace the commented API Key Secret\n envContent = envContent.replace(\n /# CDP_API_KEY_SECRET=.*/,\n `CDP_API_KEY_SECRET=${apiKeySecret}`,\n );\n }\n\n return envContent;\n}\n\n/**\n * Customize configuration files for smart accounts\n *\n * @param templateDir - The directory containing the template files\n * @param useSmartAccounts - Whether to enable smart accounts\n * @param isNextjs - Whether this is a Next.js template\n * @returns The customized config content\n */\nexport function customizeConfig(\n templateDir: string,\n useSmartAccounts: boolean,\n isNextjs: boolean,\n): string | null {\n if (!useSmartAccounts) return null;\n\n const configFileName = isNextjs ? \"src/components/Providers.tsx\" : \"src/config.ts\";\n const configPath = path.join(templateDir, configFileName);\n\n if (!fs.existsSync(configPath)) return null;\n\n let configContent = fs.readFileSync(configPath, \"utf-8\");\n\n if (isNextjs) {\n // For Next.js Providers.tsx\n configContent = configContent.replace(\n /const CDP_CONFIG: Config = \\{[\\s\\S]*?\\};/,\n `const CDP_CONFIG: Config = {\n projectId: process.env.NEXT_PUBLIC_CDP_PROJECT_ID ?? \"\",\n createAccountOnLogin: process.env.NEXT_PUBLIC_CDP_CREATE_ACCOUNT_TYPE === \"evm-smart\" ? \"evm-smart\" : \"evm-eoa\",\n};`,\n );\n } else {\n // For React config.ts\n configContent = configContent.replace(\n /export const CDP_CONFIG: Config = \\{[\\s\\S]*?\\};/,\n `export const CDP_CONFIG: Config = {\n projectId: import.meta.env.VITE_CDP_PROJECT_ID,\n createAccountOnLogin: import.meta.env.VITE_CDP_CREATE_ACCOUNT_TYPE === \"evm-smart\" ? \"evm-smart\" : \"evm-eoa\",\n};`,\n );\n }\n\n return configContent;\n}\n\n/**\n * Copy a file or directory recursively\n *\n * @param filePath - The source path\n * @param destPath - The destination path\n */\nexport function copyFile(filePath: string, destPath: string): void {\n const stat = fs.statSync(filePath);\n if (stat.isDirectory()) {\n copyDir(filePath, destPath);\n } else {\n fs.copyFileSync(filePath, destPath);\n }\n}\n\n/**\n * Copy a file or directory recursively with selective filtering for transaction components\n *\n * @param params - The parameters for the function\n * @param params.filePath - The source path\n * @param params.destPath - The destination path\n * @param params.useSmartAccounts - Whether to use Smart Accounts\n * @param params.enableOnramp - Whether to include Onramp\n */\nexport function copyFileSelectively({\n filePath,\n destPath,\n useSmartAccounts,\n enableOnramp,\n}: {\n filePath: string;\n destPath: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n}): void {\n const stat = fs.statSync(filePath);\n if (stat.isDirectory()) {\n const baseDir = path.basename(filePath);\n // skip api and lib directories if Onramp is not enabled\n if (!enableOnramp && (baseDir === \"api\" || baseDir === \"lib\")) return;\n // copy the directory\n copyDirSelectively({ srcDir: filePath, destDir: destPath, useSmartAccounts, enableOnramp });\n } else {\n const fileName = path.basename(filePath);\n\n // Skip transaction components that don't match the user's choice\n if (useSmartAccounts && fileName === \"EOATransaction.tsx\") return;\n if (!useSmartAccounts && fileName === \"SmartAccountTransaction.tsx\") return;\n\n // Skip Onramp files if the user didn't enable Onramp\n if (!enableOnramp && [\"FundWallet.tsx\", \"SignedInScreenWithOnramp.tsx\"].includes(fileName))\n return;\n // Onramp-specific SignedInScreen\n if (enableOnramp) {\n // Skip the default SignedInScreen.tsx file\n if (fileName === \"SignedInScreen.tsx\") return;\n // Copy the SignedInScreenWithOnramp.tsx file to SignedInScreen.tsx\n if (fileName === \"SignedInScreenWithOnramp.tsx\") {\n const newDestPath = destPath.replace(\"SignedInScreenWithOnramp.tsx\", \"SignedInScreen.tsx\");\n fs.copyFileSync(filePath, newDestPath);\n return;\n }\n }\n\n fs.copyFileSync(filePath, destPath);\n }\n}\n\n/**\n * Copy a directory recursively\n *\n * @param srcDir - The source directory path\n * @param destDir - The destination directory path\n */\nfunction copyDir(srcDir: string, destDir: string): void {\n fs.mkdirSync(destDir, { recursive: true });\n for (const file of fs.readdirSync(srcDir)) {\n const srcFile = path.resolve(srcDir, file);\n const destFile = path.resolve(destDir, file);\n copyFile(srcFile, destFile);\n }\n}\n\n/**\n * Copy a directory recursively with selective filtering\n *\n * @param params - The parameters for the function\n * @param params.srcDir - The source directory path\n * @param params.destDir - The destination directory path\n * @param params.useSmartAccounts - Whether to use Smart Accounts\n * @param params.enableOnramp - Whether to include Onramp\n */\nfunction copyDirSelectively({\n srcDir,\n destDir,\n useSmartAccounts,\n enableOnramp,\n}: {\n srcDir: string;\n destDir: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n}): void {\n fs.mkdirSync(destDir, { recursive: true });\n for (const file of fs.readdirSync(srcDir)) {\n const srcFile = path.resolve(srcDir, file);\n const destFile = path.resolve(destDir, file);\n copyFileSelectively({ filePath: srcFile, destPath: destFile, useSmartAccounts, enableOnramp });\n }\n}\n\n/**\n * Check if a directory is empty\n *\n * @param dirPath - The path to the directory\n * @returns True if the directory is empty, false otherwise\n */\nexport function isDirEmpty(dirPath: string): boolean {\n const files = fs.readdirSync(dirPath);\n return files.length === 0 || (files.length === 1 && files[0] === \".git\");\n}\n\n/**\n * Empty a directory while preserving .git\n *\n * @param dirPath - The path to the directory\n */\nfunction emptyDir(dirPath: string): void {\n if (!fs.existsSync(dirPath)) {\n return;\n }\n for (const file of fs.readdirSync(dirPath)) {\n if (file === \".git\") {\n continue;\n }\n fs.rmSync(path.resolve(dirPath, file), { recursive: true, force: true });\n }\n}\n\n/**\n * Customize React Native specific files with unique bundle identifier\n *\n * @param templateDir - The directory containing the template files\n * @param appName - The name of the app\n * @returns Object containing customized file contents and new package path\n */\nexport function customizeReactNativeFiles(\n templateDir: string,\n appName: string,\n): {\n appJson?: string;\n infoPlist?: string;\n buildGradle?: string;\n mainActivity?: string;\n mainApplication?: string;\n xcodeProject?: string;\n newPackagePath: string;\n safeBundleId: string;\n} {\n const username = os.userInfo().username || \"user\";\n const cleanUsername = username.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n const cleanAppName = appName.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n const safeBundleId = `com.${cleanUsername}.${cleanAppName}`;\n const newPackagePath = `com/${cleanUsername}/${cleanAppName}`;\n\n const customizedFiles: {\n appJson?: string;\n infoPlist?: string;\n buildGradle?: string;\n mainActivity?: string;\n mainApplication?: string;\n xcodeProject?: string;\n newPackagePath: string;\n safeBundleId: string;\n } = { safeBundleId, newPackagePath };\n\n // Customize app.json\n const appJsonPath = path.join(templateDir, \"app.json\");\n if (fs.existsSync(appJsonPath)) {\n const appJsonContent = fs.readFileSync(appJsonPath, \"utf-8\");\n customizedFiles.appJson = appJsonContent\n .replace(/com\\.anonymous\\.reactnativeexpo/g, safeBundleId)\n .replace(/\"name\": \"react-native-expo\"/g, `\"name\": \"${appName}\"`);\n }\n\n // Customize iOS Info.plist\n const infoPlistPath = path.join(templateDir, \"ios/reactnativeexpo/Info.plist\");\n if (fs.existsSync(infoPlistPath)) {\n const infoPlistContent = fs.readFileSync(infoPlistPath, \"utf-8\");\n customizedFiles.infoPlist = infoPlistContent.replace(\n /com\\.anonymous\\.reactnativeexpo/g,\n safeBundleId,\n );\n }\n\n // Customize Android build.gradle\n const buildGradlePath = path.join(templateDir, \"android/app/build.gradle\");\n if (fs.existsSync(buildGradlePath)) {\n const buildGradleContent = fs.readFileSync(buildGradlePath, \"utf-8\");\n customizedFiles.buildGradle = buildGradleContent.replace(\n /com\\.anonymous\\.reactnativeexpo/g,\n safeBundleId,\n );\n }\n\n // Customize MainActivity.kt\n const mainActivityPath = path.join(\n templateDir,\n \"android/app/src/main/java/com/anonymous/reactnativeexpo/MainActivity.kt\",\n );\n if (fs.existsSync(mainActivityPath)) {\n const mainActivityContent = fs.readFileSync(mainActivityPath, \"utf-8\");\n customizedFiles.mainActivity = mainActivityContent.replace(\n /package com\\.anonymous\\.reactnativeexpo/g,\n `package ${safeBundleId}`,\n );\n }\n\n // Customize MainApplication.kt\n const mainApplicationPath = path.join(\n templateDir,\n \"android/app/src/main/java/com/anonymous/reactnativeexpo/MainApplication.kt\",\n );\n if (fs.existsSync(mainApplicationPath)) {\n const mainApplicationContent = fs.readFileSync(mainApplicationPath, \"utf-8\");\n customizedFiles.mainApplication = mainApplicationContent.replace(\n /package com\\.anonymous\\.reactnativeexpo/g,\n `package ${safeBundleId}`,\n );\n }\n\n // Customize iOS Xcode project file - only replace bundle identifier\n const xcodeProjectPath = path.join(templateDir, \"ios/reactnativeexpo.xcodeproj/project.pbxproj\");\n if (fs.existsSync(xcodeProjectPath)) {\n const xcodeProjectContent = fs.readFileSync(xcodeProjectPath, \"utf-8\");\n customizedFiles.xcodeProject = xcodeProjectContent.replace(\n /com\\.anonymous\\.reactnativeexpo/g,\n safeBundleId,\n );\n }\n\n return customizedFiles;\n}\n\n/**\n * Detect which package manager invoked the create command\n *\n * @returns The detected package manager or 'pnpm' as default\n */\nexport function detectPackageManager(): \"npm\" | \"pnpm\" | \"yarn\" {\n const userAgent = process.env.npm_config_user_agent;\n\n if (userAgent) {\n if (userAgent.startsWith(\"yarn\")) return \"yarn\";\n if (userAgent.startsWith(\"pnpm\")) return \"pnpm\";\n if (userAgent.startsWith(\"npm\")) return \"npm\";\n }\n\n return \"npm\"; // Default to npm if we can't detect\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\n\nimport { green, red, reset, yellow } from \"kolorist\";\nimport minimist from \"minimist\";\nimport prompts from \"prompts\";\n\nimport { isDirEmpty } from \"./utils.js\";\n\nconst defaultTargetDir = \"cdp-app\";\n\n// Available templates for app creation\nconst TEMPLATES = [\n {\n name: \"react\",\n display: \"React Single Page App\",\n color: green,\n },\n {\n name: \"nextjs\",\n display: \"Next.js Full Stack App\",\n color: green,\n },\n {\n name: \"react-native\",\n display: \"React Native with Expo\",\n color: green,\n },\n] as const;\n\nconst TEMPLATE_NAMES = TEMPLATES.map(template => template.name);\n\ntype TemplateName = (typeof TEMPLATE_NAMES)[number];\n\n/**\n * App options\n */\nexport interface AppOptions {\n appName: string;\n template: TemplateName;\n targetDirectory: string;\n projectId: string;\n useSmartAccounts: boolean;\n enableOnramp: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}\n\ntype CommandLineArgs = {\n \"project-id\": string;\n template: TemplateName;\n \"smart-accounts\"?: boolean;\n onramp?: boolean;\n};\n\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Get app details from command line arguments or prompt the user\n *\n * @returns The app details\n */\nexport async function getAppDetails(): Promise<AppOptions> {\n const argv = minimist<CommandLineArgs>(process.argv.slice(2));\n\n // Get target directory from command line args (first non-option argument)\n let targetDir = argv._[0];\n const defaultAppName = targetDir ?? defaultTargetDir;\n let templateFromArgs: TemplateName | undefined = undefined;\n let projectIdFromArgs: string | undefined = undefined;\n let enableOnrampFromArgs: boolean | undefined = undefined;\n const useSmartAccountsFromArgs = argv[\"smart-accounts\"];\n\n // Validate template from argv\n if (argv.template) {\n if (!TEMPLATE_NAMES.includes(argv.template)) {\n console.log(\n yellow(\n `✖ Invalid template provided: \"${argv.template}\". Please choose from: ${TEMPLATE_NAMES.join(\", \")}.`,\n ),\n );\n } else {\n templateFromArgs = argv.template;\n }\n }\n\n // Validate projectId from argv\n if (argv[\"project-id\"]) {\n if (!uuidRegex.test(argv[\"project-id\"])) {\n console.log(\n yellow(`✖ Invalid Project ID provided: \"${argv.projectId}\". Please enter a valid UUID.`),\n );\n } else {\n projectIdFromArgs = argv[\"project-id\"];\n }\n }\n\n // Validate compatible template for onramp\n if (argv[\"onramp\"] !== undefined) {\n if (!argv[\"onramp\"]) {\n enableOnrampFromArgs = false;\n } else {\n // if template is not provided and onramp is enabled, force nextjs template\n if (!templateFromArgs) {\n templateFromArgs = \"nextjs\";\n }\n if (templateFromArgs !== \"nextjs\") {\n console.log(yellow(`✖ Onramp is only supported with the Next.js template.`));\n } else {\n enableOnrampFromArgs = true;\n }\n }\n }\n\n try {\n const result = await prompts(\n [\n {\n type: targetDir ? null : \"text\",\n name: \"appName\",\n message: reset(\"App Name:\"),\n initial: defaultAppName,\n onState: state => {\n targetDir = String(state.value).trim() || defaultAppName;\n },\n },\n {\n type: templateFromArgs ? null : \"select\",\n name: \"template\",\n message: reset(\"Template:\"),\n initial: 0,\n choices: TEMPLATES.map(template => ({\n title: template.color(template.display),\n value: template.name,\n })),\n },\n {\n type: projectIdFromArgs ? null : \"text\",\n name: \"projectId\",\n message: reset(\n \"CDP Project ID (Find your project ID at https://portal.cdp.coinbase.com/projects/overview):\",\n ),\n validate: value => {\n if (!value) {\n return \"Project ID is required\";\n } else if (!uuidRegex.test(value)) {\n return \"Project ID must be a valid UUID\";\n }\n return true;\n },\n initial: \"\",\n },\n {\n type: useSmartAccountsFromArgs !== undefined ? null : \"confirm\",\n name: \"useSmartAccounts\",\n message: reset(\n \"Enable Smart Accounts? (Smart Accounts enable gasless transactions and improved UX):\",\n ),\n initial: false,\n },\n {\n type: (_, { template }: { template?: string }) =>\n enableOnrampFromArgs !== undefined || (templateFromArgs || template) !== \"nextjs\"\n ? null\n : \"confirm\",\n name: \"enableOnramp\",\n message: reset(\"Enable Coinbase Onramp? (Onramp enables users to buy crypto with fiat):\"),\n initial: false,\n },\n {\n type: (_, { enableOnramp }: { enableOnramp?: boolean }) =>\n enableOnramp || enableOnrampFromArgs ? \"text\" : null,\n name: \"apiKeyId\",\n message: reset(\"CDP API Key ID (Create at https://portal.cdp.coinbase.com/api-keys):\"),\n validate: value => {\n if (!value) {\n return \"API Key ID is required for Onramp\";\n }\n return true;\n },\n },\n {\n type: (_, { enableOnramp }: { enableOnramp?: boolean }) =>\n enableOnramp || enableOnrampFromArgs ? \"password\" : null,\n name: \"apiKeySecret\",\n message: reset(\"CDP API Key Secret (paste your private key - it will be hidden):\"),\n validate: value => {\n if (!value) {\n return \"API Key Secret is required for Onramp\";\n }\n return true;\n },\n },\n {\n type: (_, { template }: { template?: string }) =>\n (templateFromArgs || template) === \"react-native\" ? null : \"confirm\",\n name: \"corsConfirmation\",\n message: reset(\n \"Confirm you have whitelisted 'http://localhost:3000' at https://portal.cdp.coinbase.com/products/embedded-wallets/domains:\",\n ),\n initial: true,\n },\n {\n type: () => (!fs.existsSync(targetDir) || isDirEmpty(targetDir) ? null : \"confirm\"),\n name: \"overwrite\",\n message: () =>\n (targetDir === \".\" ? \"Current directory\" : `Target directory \"${targetDir}\"`) +\n \" is not empty. Remove existing files and continue?\",\n },\n {\n type: (_, { overwrite }: { overwrite?: boolean }) => {\n if (overwrite === false) {\n throw new Error(red(\"✖\") + \" Operation cancelled\");\n }\n return null;\n },\n name: \"overwriteChecker\",\n },\n ],\n {\n onCancel: () => {\n throw new Error(red(\"✖\") + \" Operation cancelled\");\n },\n },\n );\n\n return {\n appName: result.appName || targetDir,\n template: templateFromArgs || result.template,\n targetDirectory: targetDir,\n projectId: projectIdFromArgs || result.projectId,\n useSmartAccounts: useSmartAccountsFromArgs ?? result.useSmartAccounts,\n enableOnramp: enableOnrampFromArgs ?? result.enableOnramp ?? false,\n apiKeyId: result.apiKeyId,\n apiKeySecret: result.apiKeySecret,\n };\n } catch (cancelled: unknown) {\n if (cancelled instanceof Error) {\n console.log(cancelled.message);\n }\n process.exit(0);\n }\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { green } from \"kolorist\";\n\nimport { getAppDetails } from \"./getAppDetails.js\";\nimport {\n prepareAppDirectory,\n customizePackageJson,\n copyFileSelectively,\n customizeEnv,\n customizeConfig,\n customizeReactNativeFiles,\n detectPackageManager,\n} from \"./utils.js\";\n\nconst fileRenames: Record<string, string | undefined> = {\n _gitignore: \".gitignore\",\n};\n\n/**\n * Initialize a new CDP app\n */\nasync function init(): Promise<void> {\n const {\n appName,\n template,\n targetDirectory,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n } = await getAppDetails();\n\n console.log(`\\nScaffolding app in ${targetDirectory}...`);\n\n const root = prepareAppDirectory(targetDirectory, false);\n const templateDir = path.resolve(fileURLToPath(import.meta.url), \"../..\", `template-${template}`);\n\n copyTemplateFiles({\n templateDir,\n root,\n appName,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n });\n printNextSteps(root, template);\n}\n\n/**\n * Print next steps for the user\n *\n * @param appRoot - The root directory of the app\n * @param template - The template that was used\n */\nfunction printNextSteps(appRoot: string, template: string): void {\n const packageManager = detectPackageManager();\n\n console.log(green(\"\\nDone. Now run your app:\\n\"));\n if (appRoot !== process.cwd()) {\n console.log(`cd ${path.relative(process.cwd(), appRoot)}`);\n }\n\n console.log(`${packageManager} install`);\n\n if (template === \"react-native\") {\n const startCommand =\n packageManager === \"npm\"\n ? \"npm run ios # or npm run android\"\n : `${packageManager} run ios # or ${packageManager} run android`;\n console.log(startCommand);\n } else {\n const devCommand = packageManager === \"npm\" ? \"npm run dev\" : `${packageManager} dev`;\n console.log(devCommand);\n }\n}\n\n/**\n * Copy template files to the app directory\n *\n * @param params - The parameters for the function\n * @param params.templateDir - The directory containing the template files\n * @param params.root - The root directory of the app\n * @param params.appName - The name of the app\n * @param params.projectId - The CDP Project ID\n * @param params.useSmartAccounts - Whether to enable smart accounts\n * @param params.enableOnramp - Whether to include Onramp\n * @param params.apiKeyId - The API Key ID\n * @param params.apiKeySecret - The API Key Secret\n */\nfunction copyTemplateFiles({\n templateDir,\n root,\n appName,\n projectId,\n useSmartAccounts,\n enableOnramp,\n apiKeyId,\n apiKeySecret,\n}: {\n templateDir: string;\n root: string;\n appName: string;\n projectId?: string;\n useSmartAccounts?: boolean;\n enableOnramp?: boolean;\n apiKeyId?: string;\n apiKeySecret?: string;\n}): void {\n const writeFileToTarget = (file: string, content?: string) => {\n const targetPath = path.join(root, fileRenames[file] ?? file);\n if (content) {\n fs.writeFileSync(targetPath, content);\n } else {\n copyFileSelectively({\n filePath: path.join(templateDir, file),\n destPath: targetPath,\n useSmartAccounts,\n enableOnramp,\n });\n }\n };\n\n const isNextjs = templateDir.includes(\"nextjs\");\n const isReactNative = templateDir.includes(\"react-native\");\n\n // Get React Native customizations if needed\n const reactNativeCustomizations = isReactNative\n ? customizeReactNativeFiles(templateDir, appName)\n : null;\n\n const files = fs.readdirSync(templateDir);\n for (const file of files) {\n if (file === \"package.json\") {\n const customizedPackageJson = customizePackageJson(templateDir, appName, enableOnramp);\n writeFileToTarget(file, customizedPackageJson);\n } else if (file === \"env.example\" && projectId) {\n writeFileToTarget(file);\n const customizedEnv = customizeEnv({\n templateDir,\n projectId,\n useSmartAccounts,\n apiKeyId,\n apiKeySecret,\n });\n console.log(\"Copying CDP Project ID to .env\");\n if (apiKeyId && apiKeySecret) {\n console.log(\"Copying CDP API credentials to .env\");\n }\n if (useSmartAccounts) {\n console.log(\"Configuring Smart Accounts in environment\");\n }\n writeFileToTarget(\".env\", customizedEnv);\n } else if (file === \"app.json\" && isReactNative && reactNativeCustomizations?.appJson) {\n writeFileToTarget(file, reactNativeCustomizations.appJson);\n } else {\n writeFileToTarget(file);\n }\n }\n\n // Handle smart account configuration in config files\n if (useSmartAccounts && !isReactNative) {\n const configFileName = isNextjs ? \"src/components/Providers.tsx\" : \"src/config.ts\";\n const customizedConfig = customizeConfig(templateDir, useSmartAccounts, isNextjs);\n if (customizedConfig) {\n console.log(\"Configuring Smart Accounts in application config\");\n writeFileToTarget(configFileName, customizedConfig);\n }\n }\n\n // Generate the appropriate Transaction.tsx component\n if (isReactNative) {\n // For React Native, create the Transaction.tsx barrel file\n const transactionContent = generateTransactionComponent(useSmartAccounts);\n writeFileToTarget(\"Transaction.tsx\", transactionContent);\n } else {\n // For React/Next.js templates\n const transactionFileName = isNextjs ? \"src/components/Transaction.tsx\" : \"src/Transaction.tsx\";\n const transactionContent = generateTransactionComponent(useSmartAccounts);\n writeFileToTarget(transactionFileName, transactionContent);\n }\n\n // Apply React Native specific customizations\n if (isReactNative && reactNativeCustomizations) {\n // Write customized React Native files\n if (reactNativeCustomizations.infoPlist) {\n writeFileToTarget(\"ios/reactnativeexpo/Info.plist\", reactNativeCustomizations.infoPlist);\n }\n if (reactNativeCustomizations.buildGradle) {\n writeFileToTarget(\"android/app/build.gradle\", reactNativeCustomizations.buildGradle);\n }\n if (reactNativeCustomizations.xcodeProject) {\n writeFileToTarget(\n \"ios/reactnativeexpo.xcodeproj/project.pbxproj\",\n reactNativeCustomizations.xcodeProject,\n );\n }\n\n // Create new package directory structure for Android Kotlin files\n const newPackageDir = path.join(\n root,\n \"android/app/src/main/java\",\n reactNativeCustomizations.newPackagePath,\n );\n fs.mkdirSync(newPackageDir, { recursive: true });\n\n if (reactNativeCustomizations.mainActivity) {\n const newMainActivityPath = path.join(\n \"android/app/src/main/java\",\n reactNativeCustomizations.newPackagePath,\n \"MainActivity.kt\",\n );\n writeFileToTarget(newMainActivityPath, reactNativeCustomizations.mainActivity);\n }\n if (reactNativeCustomizations.mainApplication) {\n const newMainApplicationPath = path.join(\n \"android/app/src/main/java\",\n reactNativeCustomizations.newPackagePath,\n \"MainApplication.kt\",\n );\n writeFileToTarget(newMainApplicationPath, reactNativeCustomizations.mainApplication);\n }\n\n // Remove old package directory\n const oldPackageDir = path.join(\n root,\n \"android/app/src/main/java/com/anonymous/reactnativeexpo\",\n );\n if (fs.existsSync(oldPackageDir)) {\n fs.rmSync(oldPackageDir, { recursive: true, force: true });\n }\n\n // Update android/gradlew permissions so that the template is runnable\n const gradlewPath = path.join(root, \"android\", \"gradlew\");\n if (fs.existsSync(gradlewPath)) {\n fs.chmodSync(gradlewPath, 0o755);\n }\n }\n}\n\n/**\n * Generate the appropriate Transaction component based on account type\n *\n * @param useSmartAccounts - Whether to use Smart Accounts\n * @returns The generated Transaction component content\n */\nfunction generateTransactionComponent(useSmartAccounts?: boolean): string {\n if (useSmartAccounts) {\n return `export { default } from \"./SmartAccountTransaction\";`;\n } else {\n return `export { default } from \"./EOATransaction\";`;\n }\n}\n\ninit().catch(e => {\n console.error(e);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;;;;;;AAWgB,SAAA,oBAAoB,WAAmB,iBAAkC;AACvF,QAAM,OAAO,KAAK,KAAK,QAAQ,OAAO,SAAS;AAIpC,MAAA,CAAC,GAAG,WAAW,IAAI,GAAG;AAC/B,OAAG,UAAU,MAAM,EAAE,WAAW,MAAM;AAAA,EAAA;AAGjC,SAAA;AACT;AAUgB,SAAA,qBACd,aACA,SACA,YACQ;AACR,QAAM,kBAAkB,KAAK,KAAK,aAAa,cAAc;AAC7D,QAAM,cAAc,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CAAC;AACxE,cAAY,OAAO;AACnB,MAAI,YAAY;AACF,gBAAA,aAAa,mBAAmB,IAAI;AAAA,EAAA;AAElD,SAAO,KAAK,UAAU,aAAa,MAAM,CAAC,IAAI;AAChD;AAaO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMW;AACT,QAAM,iBAAiB,KAAK,KAAK,aAAa,aAAa;AAC3D,QAAM,aAAa,GAAG,aAAa,g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A,OAAG,UAAU,eAAe,EAAE,WAAW,MAAM;AAE/C,QAAI,0BAA0B,cAAc;AAC1C,YAAM,sBAAsB,KAAK;AAAA,QAC/B;AAAA,QACA,0BAA0B;AAAA,QAC1B;AAAA,MACF;AACkB,wBAAA,qBAAqB,0BAA0B,YAAY;AAAA,IAAA;AAE/E,QAAI,0BAA0B,iBAAiB;AAC7C,YAAM,yBAAyB,KAAK;AAAA,QAClC;AAAA,QACA,0BAA0B;AAAA,QAC1B;AAAA,MACF;AACkB,wBAAA,wBAAwB,0BAA0B,eAAe;AAAA,IAAA;AAIrF,UAAM,gBAAgB,KAAK;AAAA,MACzB;AAAA,MACA;AAAA,IACF;AACI,QAAA,GAAG,WAAW,aAAa,GAAG;AAChC,SAAG,OAAO,eAAe,EAAE,WAAW,MAAM,OAAO,MAAM;AAAA,IAAA;AAI3D,UAAM,cAAc,KAAK,KAAK,MAAM,WAAW,SAAS;AACpD,QAAA,GAAG,WAAW,WAAW,GAAG;AAC3B,SAAA,UAAU,aAAa,GAAK;AAAA,IAAA;AAAA,EACjC;AAEJ;AAQA,SAAS,6BAA6B,kBAAoC;AACxE,MAAI,kBAAkB;AACb,WAAA;AAAA,EAAA,OACF;AACE,WAAA;AAAA,EAAA;AAEX;AAEA,OAAO,MAAM,CAAK,MAAA;AAChB,UAAQ,MAAM,CAAC;AACf,UAAQ,KAAK,CAAC;AAChB,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/create-cdp-app",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -0,0 +1,16 @@
1
+ # OSX
2
+ #
3
+ .DS_Store
4
+
5
+ # Android/IntelliJ
6
+ #
7
+ build/
8
+ .idea
9
+ .gradle
10
+ local.properties
11
+ *.iml
12
+ *.hprof
13
+ .cxx/
14
+
15
+ # Bundle artifacts
16
+ *.jsbundle
@@ -31,7 +31,8 @@
31
31
  "reactCanary": true
32
32
  },
33
33
  "plugins": [
34
- "expo-secure-store"
34
+ "expo-secure-store",
35
+ "expo-asset"
35
36
  ]
36
37
  }
37
38
  }
@@ -1779,91 +1779,91 @@ PODS:
1779
1779
  - Yoga (0.0.0)
1780
1780
 
1781
1781
  DEPENDENCIES:
1782
- - boost (from `../../../node_modules/react-native/third-party-podspecs/boost.podspec`)
1783
- - DoubleConversion (from `../../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
1784
- - EXConstants (from `../../../node_modules/expo-constants/ios`)
1785
- - Expo (from `../../../node_modules/expo`)
1786
- - ExpoAsset (from `../../../node_modules/expo-asset/ios`)
1782
+ - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
1783
+ - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
1784
+ - EXConstants (from `../node_modules/expo-constants/ios`)
1785
+ - Expo (from `../node_modules/expo`)
1786
+ - ExpoAsset (from `../node_modules/expo-asset/ios`)
1787
1787
  - ExpoClipboard (from `../node_modules/expo-clipboard/ios`)
1788
- - ExpoCrypto (from `../../../node_modules/expo-crypto/ios`)
1789
- - ExpoFileSystem (from `../../../node_modules/expo-file-system/ios`)
1790
- - ExpoFont (from `../../../node_modules/expo-font/ios`)
1791
- - ExpoKeepAwake (from `../../../node_modules/expo-keep-awake/ios`)
1792
- - ExpoModulesCore (from `../../../node_modules/expo-modules-core`)
1793
- - ExpoSecureStore (from `../../../node_modules/expo-secure-store/ios`)
1794
- - fast_float (from `../../../node_modules/react-native/third-party-podspecs/fast_float.podspec`)
1795
- - FBLazyVector (from `../../../node_modules/react-native/Libraries/FBLazyVector`)
1796
- - fmt (from `../../../node_modules/react-native/third-party-podspecs/fmt.podspec`)
1797
- - glog (from `../../../node_modules/react-native/third-party-podspecs/glog.podspec`)
1798
- - hermes-engine (from `../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
1799
- - RCT-Folly (from `../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
1800
- - RCT-Folly/Fabric (from `../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
1801
- - RCTDeprecation (from `../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
1802
- - RCTRequired (from `../../../node_modules/react-native/Libraries/Required`)
1803
- - RCTTypeSafety (from `../../../node_modules/react-native/Libraries/TypeSafety`)
1804
- - React (from `../../../node_modules/react-native/`)
1805
- - React-callinvoker (from `../../../node_modules/react-native/ReactCommon/callinvoker`)
1806
- - React-Core (from `../../../node_modules/react-native/`)
1807
- - React-Core/RCTWebSocket (from `../../../node_modules/react-native/`)
1808
- - React-CoreModules (from `../../../node_modules/react-native/React/CoreModules`)
1809
- - React-cxxreact (from `../../../node_modules/react-native/ReactCommon/cxxreact`)
1810
- - React-debug (from `../../../node_modules/react-native/ReactCommon/react/debug`)
1811
- - React-defaultsnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults`)
1812
- - React-domnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/dom`)
1813
- - React-Fabric (from `../../../node_modules/react-native/ReactCommon`)
1814
- - React-FabricComponents (from `../../../node_modules/react-native/ReactCommon`)
1815
- - React-FabricImage (from `../../../node_modules/react-native/ReactCommon`)
1816
- - React-featureflags (from `../../../node_modules/react-native/ReactCommon/react/featureflags`)
1817
- - React-featureflagsnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags`)
1818
- - React-graphics (from `../../../node_modules/react-native/ReactCommon/react/renderer/graphics`)
1819
- - React-hermes (from `../../../node_modules/react-native/ReactCommon/hermes`)
1820
- - React-idlecallbacksnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`)
1821
- - React-ImageManager (from `../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`)
1822
- - React-jserrorhandler (from `../../../node_modules/react-native/ReactCommon/jserrorhandler`)
1823
- - React-jsi (from `../../../node_modules/react-native/ReactCommon/jsi`)
1824
- - React-jsiexecutor (from `../../../node_modules/react-native/ReactCommon/jsiexecutor`)
1825
- - React-jsinspector (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern`)
1826
- - React-jsinspectortracing (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing`)
1827
- - React-jsitooling (from `../../../node_modules/react-native/ReactCommon/jsitooling`)
1828
- - React-jsitracing (from `../../../node_modules/react-native/ReactCommon/hermes/executor/`)
1829
- - React-logger (from `../../../node_modules/react-native/ReactCommon/logger`)
1830
- - React-Mapbuffer (from `../../../node_modules/react-native/ReactCommon`)
1831
- - React-microtasksnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
1832
- - react-native-get-random-values (from `../../../node_modules/react-native-get-random-values`)
1833
- - react-native-quick-crypto (from `../../../node_modules/react-native-quick-crypto`)
1834
- - React-NativeModulesApple (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
1835
- - React-oscompat (from `../../../node_modules/react-native/ReactCommon/oscompat`)
1836
- - React-perflogger (from `../../../node_modules/react-native/ReactCommon/reactperflogger`)
1837
- - React-performancetimeline (from `../../../node_modules/react-native/ReactCommon/react/performance/timeline`)
1838
- - React-RCTActionSheet (from `../../../node_modules/react-native/Libraries/ActionSheetIOS`)
1839
- - React-RCTAnimation (from `../../../node_modules/react-native/Libraries/NativeAnimation`)
1840
- - React-RCTAppDelegate (from `../../../node_modules/react-native/Libraries/AppDelegate`)
1841
- - React-RCTBlob (from `../../../node_modules/react-native/Libraries/Blob`)
1842
- - React-RCTFabric (from `../../../node_modules/react-native/React`)
1843
- - React-RCTFBReactNativeSpec (from `../../../node_modules/react-native/React`)
1844
- - React-RCTImage (from `../../../node_modules/react-native/Libraries/Image`)
1845
- - React-RCTLinking (from `../../../node_modules/react-native/Libraries/LinkingIOS`)
1846
- - React-RCTNetwork (from `../../../node_modules/react-native/Libraries/Network`)
1847
- - React-RCTRuntime (from `../../../node_modules/react-native/React/Runtime`)
1848
- - React-RCTSettings (from `../../../node_modules/react-native/Libraries/Settings`)
1849
- - React-RCTText (from `../../../node_modules/react-native/Libraries/Text`)
1850
- - React-RCTVibration (from `../../../node_modules/react-native/Libraries/Vibration`)
1851
- - React-rendererconsistency (from `../../../node_modules/react-native/ReactCommon/react/renderer/consistency`)
1852
- - React-renderercss (from `../../../node_modules/react-native/ReactCommon/react/renderer/css`)
1853
- - React-rendererdebug (from `../../../node_modules/react-native/ReactCommon/react/renderer/debug`)
1854
- - React-rncore (from `../../../node_modules/react-native/ReactCommon`)
1855
- - React-RuntimeApple (from `../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios`)
1856
- - React-RuntimeCore (from `../../../node_modules/react-native/ReactCommon/react/runtime`)
1857
- - React-runtimeexecutor (from `../../../node_modules/react-native/ReactCommon/runtimeexecutor`)
1858
- - React-RuntimeHermes (from `../../../node_modules/react-native/ReactCommon/react/runtime`)
1859
- - React-runtimescheduler (from `../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
1860
- - React-timing (from `../../../node_modules/react-native/ReactCommon/react/timing`)
1861
- - React-utils (from `../../../node_modules/react-native/ReactCommon/react/utils`)
1788
+ - ExpoCrypto (from `../node_modules/expo-crypto/ios`)
1789
+ - ExpoFileSystem (from `../node_modules/expo-file-system/ios`)
1790
+ - ExpoFont (from `../node_modules/expo-font/ios`)
1791
+ - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
1792
+ - ExpoModulesCore (from `../node_modules/expo-modules-core`)
1793
+ - ExpoSecureStore (from `../node_modules/expo-secure-store/ios`)
1794
+ - fast_float (from `../node_modules/react-native/third-party-podspecs/fast_float.podspec`)
1795
+ - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
1796
+ - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`)
1797
+ - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
1798
+ - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
1799
+ - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
1800
+ - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
1801
+ - RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
1802
+ - RCTRequired (from `../node_modules/react-native/Libraries/Required`)
1803
+ - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
1804
+ - React (from `../node_modules/react-native/`)
1805
+ - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
1806
+ - React-Core (from `../node_modules/react-native/`)
1807
+ - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
1808
+ - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
1809
+ - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
1810
+ - React-debug (from `../node_modules/react-native/ReactCommon/react/debug`)
1811
+ - React-defaultsnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/defaults`)
1812
+ - React-domnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/dom`)
1813
+ - React-Fabric (from `../node_modules/react-native/ReactCommon`)
1814
+ - React-FabricComponents (from `../node_modules/react-native/ReactCommon`)
1815
+ - React-FabricImage (from `../node_modules/react-native/ReactCommon`)
1816
+ - React-featureflags (from `../node_modules/react-native/ReactCommon/react/featureflags`)
1817
+ - React-featureflagsnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/featureflags`)
1818
+ - React-graphics (from `../node_modules/react-native/ReactCommon/react/renderer/graphics`)
1819
+ - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
1820
+ - React-idlecallbacksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`)
1821
+ - React-ImageManager (from `../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`)
1822
+ - React-jserrorhandler (from `../node_modules/react-native/ReactCommon/jserrorhandler`)
1823
+ - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
1824
+ - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
1825
+ - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`)
1826
+ - React-jsinspectortracing (from `../node_modules/react-native/ReactCommon/jsinspector-modern/tracing`)
1827
+ - React-jsitooling (from `../node_modules/react-native/ReactCommon/jsitooling`)
1828
+ - React-jsitracing (from `../node_modules/react-native/ReactCommon/hermes/executor/`)
1829
+ - React-logger (from `../node_modules/react-native/ReactCommon/logger`)
1830
+ - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
1831
+ - React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
1832
+ - react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
1833
+ - react-native-quick-crypto (from `../node_modules/react-native-quick-crypto`)
1834
+ - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
1835
+ - React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`)
1836
+ - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
1837
+ - React-performancetimeline (from `../node_modules/react-native/ReactCommon/react/performance/timeline`)
1838
+ - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
1839
+ - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
1840
+ - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`)
1841
+ - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
1842
+ - React-RCTFabric (from `../node_modules/react-native/React`)
1843
+ - React-RCTFBReactNativeSpec (from `../node_modules/react-native/React`)
1844
+ - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
1845
+ - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
1846
+ - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
1847
+ - React-RCTRuntime (from `../node_modules/react-native/React/Runtime`)
1848
+ - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
1849
+ - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
1850
+ - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
1851
+ - React-rendererconsistency (from `../node_modules/react-native/ReactCommon/react/renderer/consistency`)
1852
+ - React-renderercss (from `../node_modules/react-native/ReactCommon/react/renderer/css`)
1853
+ - React-rendererdebug (from `../node_modules/react-native/ReactCommon/react/renderer/debug`)
1854
+ - React-rncore (from `../node_modules/react-native/ReactCommon`)
1855
+ - React-RuntimeApple (from `../node_modules/react-native/ReactCommon/react/runtime/platform/ios`)
1856
+ - React-RuntimeCore (from `../node_modules/react-native/ReactCommon/react/runtime`)
1857
+ - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
1858
+ - React-RuntimeHermes (from `../node_modules/react-native/ReactCommon/react/runtime`)
1859
+ - React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
1860
+ - React-timing (from `../node_modules/react-native/ReactCommon/react/timing`)
1861
+ - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
1862
1862
  - ReactAppDependencyProvider (from `build/generated/ios`)
1863
1863
  - ReactCodegen (from `build/generated/ios`)
1864
- - ReactCommon/turbomodule/core (from `../../../node_modules/react-native/ReactCommon`)
1865
- - "RNCAsyncStorage (from `../../../node_modules/@react-native-async-storage/async-storage`)"
1866
- - Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`)
1864
+ - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
1865
+ - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
1866
+ - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
1867
1867
 
1868
1868
  SPEC REPOS:
1869
1869
  trunk:
@@ -1872,172 +1872,172 @@ SPEC REPOS:
1872
1872
 
1873
1873
  EXTERNAL SOURCES:
1874
1874
  boost:
1875
- :podspec: "../../../node_modules/react-native/third-party-podspecs/boost.podspec"
1875
+ :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
1876
1876
  DoubleConversion:
1877
- :podspec: "../../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
1877
+ :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
1878
1878
  EXConstants:
1879
- :path: "../../../node_modules/expo-constants/ios"
1879
+ :path: "../node_modules/expo-constants/ios"
1880
1880
  Expo:
1881
- :path: "../../../node_modules/expo"
1881
+ :path: "../node_modules/expo"
1882
1882
  ExpoAsset:
1883
- :path: "../../../node_modules/expo-asset/ios"
1883
+ :path: "../node_modules/expo-asset/ios"
1884
1884
  ExpoClipboard:
1885
1885
  :path: "../node_modules/expo-clipboard/ios"
1886
1886
  ExpoCrypto:
1887
- :path: "../../../node_modules/expo-crypto/ios"
1887
+ :path: "../node_modules/expo-crypto/ios"
1888
1888
  ExpoFileSystem:
1889
- :path: "../../../node_modules/expo-file-system/ios"
1889
+ :path: "../node_modules/expo-file-system/ios"
1890
1890
  ExpoFont:
1891
- :path: "../../../node_modules/expo-font/ios"
1891
+ :path: "../node_modules/expo-font/ios"
1892
1892
  ExpoKeepAwake:
1893
- :path: "../../../node_modules/expo-keep-awake/ios"
1893
+ :path: "../node_modules/expo-keep-awake/ios"
1894
1894
  ExpoModulesCore:
1895
- :path: "../../../node_modules/expo-modules-core"
1895
+ :path: "../node_modules/expo-modules-core"
1896
1896
  ExpoSecureStore:
1897
- :path: "../../../node_modules/expo-secure-store/ios"
1897
+ :path: "../node_modules/expo-secure-store/ios"
1898
1898
  fast_float:
1899
- :podspec: "../../../node_modules/react-native/third-party-podspecs/fast_float.podspec"
1899
+ :podspec: "../node_modules/react-native/third-party-podspecs/fast_float.podspec"
1900
1900
  FBLazyVector:
1901
- :path: "../../../node_modules/react-native/Libraries/FBLazyVector"
1901
+ :path: "../node_modules/react-native/Libraries/FBLazyVector"
1902
1902
  fmt:
1903
- :podspec: "../../../node_modules/react-native/third-party-podspecs/fmt.podspec"
1903
+ :podspec: "../node_modules/react-native/third-party-podspecs/fmt.podspec"
1904
1904
  glog:
1905
- :podspec: "../../../node_modules/react-native/third-party-podspecs/glog.podspec"
1905
+ :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
1906
1906
  hermes-engine:
1907
- :podspec: "../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
1907
+ :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
1908
1908
  :tag: hermes-2025-06-04-RNv0.79.3-7f9a871eefeb2c3852365ee80f0b6733ec12ac3b
1909
1909
  RCT-Folly:
1910
- :podspec: "../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
1910
+ :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
1911
1911
  RCTDeprecation:
1912
- :path: "../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation"
1912
+ :path: "../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation"
1913
1913
  RCTRequired:
1914
- :path: "../../../node_modules/react-native/Libraries/Required"
1914
+ :path: "../node_modules/react-native/Libraries/Required"
1915
1915
  RCTTypeSafety:
1916
- :path: "../../../node_modules/react-native/Libraries/TypeSafety"
1916
+ :path: "../node_modules/react-native/Libraries/TypeSafety"
1917
1917
  React:
1918
- :path: "../../../node_modules/react-native/"
1918
+ :path: "../node_modules/react-native/"
1919
1919
  React-callinvoker:
1920
- :path: "../../../node_modules/react-native/ReactCommon/callinvoker"
1920
+ :path: "../node_modules/react-native/ReactCommon/callinvoker"
1921
1921
  React-Core:
1922
- :path: "../../../node_modules/react-native/"
1922
+ :path: "../node_modules/react-native/"
1923
1923
  React-CoreModules:
1924
- :path: "../../../node_modules/react-native/React/CoreModules"
1924
+ :path: "../node_modules/react-native/React/CoreModules"
1925
1925
  React-cxxreact:
1926
- :path: "../../../node_modules/react-native/ReactCommon/cxxreact"
1926
+ :path: "../node_modules/react-native/ReactCommon/cxxreact"
1927
1927
  React-debug:
1928
- :path: "../../../node_modules/react-native/ReactCommon/react/debug"
1928
+ :path: "../node_modules/react-native/ReactCommon/react/debug"
1929
1929
  React-defaultsnativemodule:
1930
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults"
1930
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/defaults"
1931
1931
  React-domnativemodule:
1932
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/dom"
1932
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/dom"
1933
1933
  React-Fabric:
1934
- :path: "../../../node_modules/react-native/ReactCommon"
1934
+ :path: "../node_modules/react-native/ReactCommon"
1935
1935
  React-FabricComponents:
1936
- :path: "../../../node_modules/react-native/ReactCommon"
1936
+ :path: "../node_modules/react-native/ReactCommon"
1937
1937
  React-FabricImage:
1938
- :path: "../../../node_modules/react-native/ReactCommon"
1938
+ :path: "../node_modules/react-native/ReactCommon"
1939
1939
  React-featureflags:
1940
- :path: "../../../node_modules/react-native/ReactCommon/react/featureflags"
1940
+ :path: "../node_modules/react-native/ReactCommon/react/featureflags"
1941
1941
  React-featureflagsnativemodule:
1942
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags"
1942
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/featureflags"
1943
1943
  React-graphics:
1944
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/graphics"
1944
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/graphics"
1945
1945
  React-hermes:
1946
- :path: "../../../node_modules/react-native/ReactCommon/hermes"
1946
+ :path: "../node_modules/react-native/ReactCommon/hermes"
1947
1947
  React-idlecallbacksnativemodule:
1948
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks"
1948
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks"
1949
1949
  React-ImageManager:
1950
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios"
1950
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios"
1951
1951
  React-jserrorhandler:
1952
- :path: "../../../node_modules/react-native/ReactCommon/jserrorhandler"
1952
+ :path: "../node_modules/react-native/ReactCommon/jserrorhandler"
1953
1953
  React-jsi:
1954
- :path: "../../../node_modules/react-native/ReactCommon/jsi"
1954
+ :path: "../node_modules/react-native/ReactCommon/jsi"
1955
1955
  React-jsiexecutor:
1956
- :path: "../../../node_modules/react-native/ReactCommon/jsiexecutor"
1956
+ :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
1957
1957
  React-jsinspector:
1958
- :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern"
1958
+ :path: "../node_modules/react-native/ReactCommon/jsinspector-modern"
1959
1959
  React-jsinspectortracing:
1960
- :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing"
1960
+ :path: "../node_modules/react-native/ReactCommon/jsinspector-modern/tracing"
1961
1961
  React-jsitooling:
1962
- :path: "../../../node_modules/react-native/ReactCommon/jsitooling"
1962
+ :path: "../node_modules/react-native/ReactCommon/jsitooling"
1963
1963
  React-jsitracing:
1964
- :path: "../../../node_modules/react-native/ReactCommon/hermes/executor/"
1964
+ :path: "../node_modules/react-native/ReactCommon/hermes/executor/"
1965
1965
  React-logger:
1966
- :path: "../../../node_modules/react-native/ReactCommon/logger"
1966
+ :path: "../node_modules/react-native/ReactCommon/logger"
1967
1967
  React-Mapbuffer:
1968
- :path: "../../../node_modules/react-native/ReactCommon"
1968
+ :path: "../node_modules/react-native/ReactCommon"
1969
1969
  React-microtasksnativemodule:
1970
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
1970
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
1971
1971
  react-native-get-random-values:
1972
- :path: "../../../node_modules/react-native-get-random-values"
1972
+ :path: "../node_modules/react-native-get-random-values"
1973
1973
  react-native-quick-crypto:
1974
- :path: "../../../node_modules/react-native-quick-crypto"
1974
+ :path: "../node_modules/react-native-quick-crypto"
1975
1975
  React-NativeModulesApple:
1976
- :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
1976
+ :path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
1977
1977
  React-oscompat:
1978
- :path: "../../../node_modules/react-native/ReactCommon/oscompat"
1978
+ :path: "../node_modules/react-native/ReactCommon/oscompat"
1979
1979
  React-perflogger:
1980
- :path: "../../../node_modules/react-native/ReactCommon/reactperflogger"
1980
+ :path: "../node_modules/react-native/ReactCommon/reactperflogger"
1981
1981
  React-performancetimeline:
1982
- :path: "../../../node_modules/react-native/ReactCommon/react/performance/timeline"
1982
+ :path: "../node_modules/react-native/ReactCommon/react/performance/timeline"
1983
1983
  React-RCTActionSheet:
1984
- :path: "../../../node_modules/react-native/Libraries/ActionSheetIOS"
1984
+ :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
1985
1985
  React-RCTAnimation:
1986
- :path: "../../../node_modules/react-native/Libraries/NativeAnimation"
1986
+ :path: "../node_modules/react-native/Libraries/NativeAnimation"
1987
1987
  React-RCTAppDelegate:
1988
- :path: "../../../node_modules/react-native/Libraries/AppDelegate"
1988
+ :path: "../node_modules/react-native/Libraries/AppDelegate"
1989
1989
  React-RCTBlob:
1990
- :path: "../../../node_modules/react-native/Libraries/Blob"
1990
+ :path: "../node_modules/react-native/Libraries/Blob"
1991
1991
  React-RCTFabric:
1992
- :path: "../../../node_modules/react-native/React"
1992
+ :path: "../node_modules/react-native/React"
1993
1993
  React-RCTFBReactNativeSpec:
1994
- :path: "../../../node_modules/react-native/React"
1994
+ :path: "../node_modules/react-native/React"
1995
1995
  React-RCTImage:
1996
- :path: "../../../node_modules/react-native/Libraries/Image"
1996
+ :path: "../node_modules/react-native/Libraries/Image"
1997
1997
  React-RCTLinking:
1998
- :path: "../../../node_modules/react-native/Libraries/LinkingIOS"
1998
+ :path: "../node_modules/react-native/Libraries/LinkingIOS"
1999
1999
  React-RCTNetwork:
2000
- :path: "../../../node_modules/react-native/Libraries/Network"
2000
+ :path: "../node_modules/react-native/Libraries/Network"
2001
2001
  React-RCTRuntime:
2002
- :path: "../../../node_modules/react-native/React/Runtime"
2002
+ :path: "../node_modules/react-native/React/Runtime"
2003
2003
  React-RCTSettings:
2004
- :path: "../../../node_modules/react-native/Libraries/Settings"
2004
+ :path: "../node_modules/react-native/Libraries/Settings"
2005
2005
  React-RCTText:
2006
- :path: "../../../node_modules/react-native/Libraries/Text"
2006
+ :path: "../node_modules/react-native/Libraries/Text"
2007
2007
  React-RCTVibration:
2008
- :path: "../../../node_modules/react-native/Libraries/Vibration"
2008
+ :path: "../node_modules/react-native/Libraries/Vibration"
2009
2009
  React-rendererconsistency:
2010
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/consistency"
2010
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/consistency"
2011
2011
  React-renderercss:
2012
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/css"
2012
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/css"
2013
2013
  React-rendererdebug:
2014
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/debug"
2014
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/debug"
2015
2015
  React-rncore:
2016
- :path: "../../../node_modules/react-native/ReactCommon"
2016
+ :path: "../node_modules/react-native/ReactCommon"
2017
2017
  React-RuntimeApple:
2018
- :path: "../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios"
2018
+ :path: "../node_modules/react-native/ReactCommon/react/runtime/platform/ios"
2019
2019
  React-RuntimeCore:
2020
- :path: "../../../node_modules/react-native/ReactCommon/react/runtime"
2020
+ :path: "../node_modules/react-native/ReactCommon/react/runtime"
2021
2021
  React-runtimeexecutor:
2022
- :path: "../../../node_modules/react-native/ReactCommon/runtimeexecutor"
2022
+ :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
2023
2023
  React-RuntimeHermes:
2024
- :path: "../../../node_modules/react-native/ReactCommon/react/runtime"
2024
+ :path: "../node_modules/react-native/ReactCommon/react/runtime"
2025
2025
  React-runtimescheduler:
2026
- :path: "../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler"
2026
+ :path: "../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler"
2027
2027
  React-timing:
2028
- :path: "../../../node_modules/react-native/ReactCommon/react/timing"
2028
+ :path: "../node_modules/react-native/ReactCommon/react/timing"
2029
2029
  React-utils:
2030
- :path: "../../../node_modules/react-native/ReactCommon/react/utils"
2030
+ :path: "../node_modules/react-native/ReactCommon/react/utils"
2031
2031
  ReactAppDependencyProvider:
2032
2032
  :path: build/generated/ios
2033
2033
  ReactCodegen:
2034
2034
  :path: build/generated/ios
2035
2035
  ReactCommon:
2036
- :path: "../../../node_modules/react-native/ReactCommon"
2036
+ :path: "../node_modules/react-native/ReactCommon"
2037
2037
  RNCAsyncStorage:
2038
- :path: "../../../node_modules/@react-native-async-storage/async-storage"
2038
+ :path: "../node_modules/@react-native-async-storage/async-storage"
2039
2039
  Yoga:
2040
- :path: "../../../node_modules/react-native/ReactCommon/yoga"
2040
+ :path: "../node_modules/react-native/ReactCommon/yoga"
2041
2041
 
2042
2042
  SPEC CHECKSUMS:
2043
2043
  boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
@@ -0,0 +1,30 @@
1
+ # OSX
2
+ #
3
+ .DS_Store
4
+
5
+ # Xcode
6
+ #
7
+ build/
8
+ *.pbxuser
9
+ !default.pbxuser
10
+ *.mode1v3
11
+ !default.mode1v3
12
+ *.mode2v3
13
+ !default.mode2v3
14
+ *.perspectivev3
15
+ !default.perspectivev3
16
+ xcuserdata
17
+ *.xccheckout
18
+ *.moved-aside
19
+ DerivedData
20
+ *.hmap
21
+ *.ipa
22
+ *.xcuserstate
23
+ project.xcworkspace
24
+ .xcode.env.local
25
+
26
+ # Bundle artifacts
27
+ *.jsbundle
28
+
29
+ # CocoaPods
30
+ /Pods/
@@ -453,7 +453,7 @@
453
453
  "$(inherited)",
454
454
  " ",
455
455
  );
456
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
456
+ REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
457
457
  SDKROOT = iphoneos;
458
458
  SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
459
459
  USE_HERMES = true;
@@ -511,7 +511,7 @@
511
511
  "$(inherited)",
512
512
  " ",
513
513
  );
514
- REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
514
+ REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
515
515
  SDKROOT = iphoneos;
516
516
  USE_HERMES = true;
517
517
  VALIDATE_PRODUCT = YES;
@@ -15,6 +15,7 @@
15
15
  "@react-native-async-storage/async-storage": "^2.2.0",
16
16
  "@ungap/structured-clone": "^1.3.0",
17
17
  "expo": "~53.0.22",
18
+ "expo-asset": "~11.1.7",
18
19
  "expo-clipboard": "~7.1.5",
19
20
  "expo-crypto": "^14.1.5",
20
21
  "expo-secure-store": "^15.0.7",