one 2.0.0-beta.57.1 → 2.0.0-beta.59.1

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.
Files changed (49) hide show
  1. package/dist/cjs/babel-preset/index.cjs +18 -8
  2. package/dist/cjs/babel-preset/index.native.cjs +18 -8
  3. package/dist/cjs/babel-preset/index.native.js +18 -8
  4. package/dist/cjs/babel-preset/index.native.js.map +1 -1
  5. package/dist/cjs/cli/generateBundlerConfig.cjs +7 -8
  6. package/dist/cjs/cli/generateBundlerConfig.native.cjs +7 -8
  7. package/dist/cjs/cli/generateBundlerConfig.native.js +7 -8
  8. package/dist/cjs/cli/generateBundlerConfig.native.js.map +1 -1
  9. package/dist/cjs/cli/prebuild.cjs +8 -0
  10. package/dist/cjs/cli/prebuild.native.cjs +9 -0
  11. package/dist/cjs/cli/prebuild.native.js +9 -0
  12. package/dist/cjs/cli/prebuild.native.js.map +1 -1
  13. package/dist/cjs/one.cjs +5 -1
  14. package/dist/cjs/one.native.cjs +5 -1
  15. package/dist/cjs/one.native.js +5 -1
  16. package/dist/cjs/one.native.js.map +1 -1
  17. package/dist/esm/babel-preset/index.mjs +18 -8
  18. package/dist/esm/babel-preset/index.mjs.map +1 -1
  19. package/dist/esm/babel-preset/index.native.js +18 -8
  20. package/dist/esm/babel-preset/index.native.js.map +1 -1
  21. package/dist/esm/cli/generateBundlerConfig.mjs +7 -8
  22. package/dist/esm/cli/generateBundlerConfig.mjs.map +1 -1
  23. package/dist/esm/cli/generateBundlerConfig.native.js +7 -8
  24. package/dist/esm/cli/generateBundlerConfig.native.js.map +1 -1
  25. package/dist/esm/cli/prebuild.mjs +8 -0
  26. package/dist/esm/cli/prebuild.mjs.map +1 -1
  27. package/dist/esm/cli/prebuild.native.js +9 -0
  28. package/dist/esm/cli/prebuild.native.js.map +1 -1
  29. package/dist/esm/one.mjs +6 -2
  30. package/dist/esm/one.mjs.map +1 -1
  31. package/dist/esm/one.native.js +6 -2
  32. package/dist/esm/one.native.js.map +1 -1
  33. package/package.json +16 -12
  34. package/src/babel-preset/index.test.ts +5 -0
  35. package/src/babel-preset/index.ts +20 -5
  36. package/src/babel-preset/integration.test.ts +59 -5
  37. package/src/cli/generateBundlerConfig.test.ts +6 -2
  38. package/src/cli/generateBundlerConfig.ts +7 -8
  39. package/src/cli/prebuild.test.ts +49 -1
  40. package/src/cli/prebuild.ts +13 -4
  41. package/src/native/packedClosure.test.ts +9 -11
  42. package/src/one.test.ts +10 -0
  43. package/src/one.ts +12 -0
  44. package/types/babel-preset/index.d.ts +5 -5
  45. package/types/babel-preset/index.d.ts.map +1 -1
  46. package/types/cli/generateBundlerConfig.d.ts.map +1 -1
  47. package/types/cli/prebuild.d.ts.map +1 -1
  48. package/types/one.d.ts +5 -1
  49. package/types/one.d.ts.map +1 -1
@@ -53,14 +53,24 @@ function oneBabelPreset(api, options = {}) {
53
53
  api.cache(true);
54
54
  }
55
55
  const projectRoot = import_node_path.default.resolve(options.projectRoot ?? (typeof api?.cwd === "function" ? api.cwd() : process.cwd()));
56
- return { plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
57
- projectRoot,
58
- relativeRouterRoot: options.routerRoot ?? "app",
59
- ignoredRouteFiles: options.ignoredRouteFiles,
60
- linking: options.linking,
61
- setupFile: options.setupFile,
62
- includeImportMetaEnv: options.includeImportMetaEnv
63
- }) };
56
+ const require2 = (0, import_node_module.createRequire)(projectRoot + "/");
57
+ let reactNativePresetPath;
58
+ try {
59
+ reactNativePresetPath = require2.resolve("@react-native/babel-preset");
60
+ } catch {
61
+ throw new Error(`[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`);
62
+ }
63
+ return {
64
+ presets: [require2(reactNativePresetPath)],
65
+ plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
66
+ projectRoot,
67
+ relativeRouterRoot: options.routerRoot ?? "app",
68
+ ignoredRouteFiles: options.ignoredRouteFiles,
69
+ linking: options.linking,
70
+ setupFile: options.setupFile,
71
+ includeImportMetaEnv: options.includeImportMetaEnv
72
+ })
73
+ };
64
74
  }
65
75
  function buildOneBabelPlugins({ projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true }) {
66
76
  const tsconfig = import_tsconfig_paths.default.loadConfig(projectRoot);
@@ -61,14 +61,24 @@ function oneBabelPreset(api) {
61
61
  api.cache(true);
62
62
  }
63
63
  var projectRoot = import_path.default.resolve((_options_projectRoot = options.projectRoot) !== null && _options_projectRoot !== void 0 ? _options_projectRoot : typeof (api === null || api === void 0 ? void 0 : api.cwd) === "function" ? api.cwd() : process.cwd());
64
- return { plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
65
- projectRoot,
66
- relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : "app",
67
- ignoredRouteFiles: options.ignoredRouteFiles,
68
- linking: options.linking,
69
- setupFile: options.setupFile,
70
- includeImportMetaEnv: options.includeImportMetaEnv
71
- }) };
64
+ var require2 = (0, import_module.createRequire)(projectRoot + "/");
65
+ var reactNativePresetPath;
66
+ try {
67
+ reactNativePresetPath = require2.resolve("@react-native/babel-preset");
68
+ } catch (unused) {
69
+ throw new Error(`[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`);
70
+ }
71
+ return {
72
+ presets: [require2(reactNativePresetPath)],
73
+ plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
74
+ projectRoot,
75
+ relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : "app",
76
+ ignoredRouteFiles: options.ignoredRouteFiles,
77
+ linking: options.linking,
78
+ setupFile: options.setupFile,
79
+ includeImportMetaEnv: options.includeImportMetaEnv
80
+ })
81
+ };
72
82
  }
73
83
  function buildOneBabelPlugins(param) {
74
84
  var { projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true } = param;
@@ -61,14 +61,24 @@ function oneBabelPreset(api) {
61
61
  api.cache(true);
62
62
  }
63
63
  var projectRoot = import_path.default.resolve((_options_projectRoot = options.projectRoot) !== null && _options_projectRoot !== void 0 ? _options_projectRoot : typeof (api === null || api === void 0 ? void 0 : api.cwd) === "function" ? api.cwd() : process.cwd());
64
- return { plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
65
- projectRoot,
66
- relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : "app",
67
- ignoredRouteFiles: options.ignoredRouteFiles,
68
- linking: options.linking,
69
- setupFile: options.setupFile,
70
- includeImportMetaEnv: options.includeImportMetaEnv
71
- }) };
64
+ var require2 = (0, import_module.createRequire)(projectRoot + "/");
65
+ var reactNativePresetPath;
66
+ try {
67
+ reactNativePresetPath = require2.resolve("@react-native/babel-preset");
68
+ } catch (unused) {
69
+ throw new Error(`[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`);
70
+ }
71
+ return {
72
+ presets: [require2(reactNativePresetPath)],
73
+ plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
74
+ projectRoot,
75
+ relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : "app",
76
+ ignoredRouteFiles: options.ignoredRouteFiles,
77
+ linking: options.linking,
78
+ setupFile: options.setupFile,
79
+ includeImportMetaEnv: options.includeImportMetaEnv
80
+ })
81
+ };
72
82
  }
73
83
  function buildOneBabelPlugins(param) {
74
84
  var { projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true } = param;
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":[],"sources":["cjs/babel-preset/index.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar babel_preset_exports = {};\n__export(babel_preset_exports, {\n buildOneBabelPlugins: () => buildOneBabelPlugins,\n buildRouterRequireContextRegexString: () => buildRouterRequireContextRegexString,\n default: () => oneBabelPreset\n});\nmodule.exports = __toCommonJS(babel_preset_exports);\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_module = require(\"module\");\nvar import_micromatch = __toESM(require(\"micromatch\"), 1);\nvar import_tsconfig_paths = __toESM(require(\"tsconfig-paths\"), 1);\nvar import_env = require(\"../native/env\");\nvar import_glob_patterns = require(\"../router/glob-patterns\");\nfunction toPosixRelativePath(relativePath) {\n return import_path.default.sep === \"\\\\\" ? relativePath.replace(/\\\\/g, \"/\") : relativePath;\n}\nfunction oneBabelPreset(api) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var _options_projectRoot, _options_routerRoot;\n var hasViteInjectedOnePlugins = typeof (api === null || api === void 0 ? void 0 : api.caller) === \"function\" ? api.caller(function(caller) {\n return !!(caller === null || caller === void 0 ? void 0 : caller.oneViteMetroBabelConfig);\n }) : false;\n var isVxrnCompiler = typeof (api === null || api === void 0 ? void 0 : api.caller) === \"function\" ? api.caller(function(caller) {\n return (caller === null || caller === void 0 ? void 0 : caller.name) === \"vxrn\";\n }) : false;\n if (isVxrnCompiler) {\n return {\n presets: [],\n plugins: []\n };\n }\n if (!(api === null || api === void 0 ? void 0 : api.caller) && typeof (api === null || api === void 0 ? void 0 : api.cache) === \"function\") {\n api.cache(true);\n }\n var projectRoot = import_path.default.resolve((_options_projectRoot = options.projectRoot) !== null && _options_projectRoot !== void 0 ? _options_projectRoot : typeof (api === null || api === void 0 ? void 0 : api.cwd) === \"function\" ? api.cwd() : process.cwd());\n return {\n plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : \"app\",\n ignoredRouteFiles: options.ignoredRouteFiles,\n linking: options.linking,\n setupFile: options.setupFile,\n includeImportMetaEnv: options.includeImportMetaEnv\n })\n };\n}\nfunction buildOneBabelPlugins(param) {\n var { projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true } = param;\n var tsconfig = import_tsconfig_paths.default.loadConfig(projectRoot);\n if (tsconfig.resultType === \"failed\") {\n throw new Error(\"[one/babel-preset] tsconfig.json paths could not be loaded\");\n }\n var require2 = (0, import_module.createRequire)(projectRoot + \"/\");\n var metroEntryPath = require2.resolve(\"one/metro-entry\", {\n paths: [\n projectRoot\n ]\n });\n var setupFileRelativeToMetroEntry = (function() {\n if (!setupFile) return void 0;\n var file = typeof setupFile === \"string\" ? setupFile : setupFile.native || setupFile.ios || setupFile.android;\n if (!file) return void 0;\n return toPosixRelativePath(import_path.default.relative(import_path.default.dirname(metroEntryPath), import_path.default.join(projectRoot, file)));\n })();\n return [\n // standalone Metro CLI needs `import.meta.env.*` /\n // `process.env.*` baked in. The Vite path passes `false` here and injects\n // its own version with the user's `define` env via the server hook.\n ...includeImportMetaEnv ? [\n [\n \"@vxrn/vite-plugin-metro/babel-plugins/import-meta-env-plugin\",\n {\n env: buildStandaloneImportMetaEnv()\n }\n ]\n ] : [],\n \"one/babel-plugin-environment-guard\",\n [\n \"one/babel-plugin-remove-server-code\",\n {\n routerRoot: relativeRouterRoot\n }\n ],\n [\n \"babel-plugin-module-resolver\",\n // \"vite-tsconfig-paths\" for Metro\n {\n alias: Object.fromEntries(Object.entries(tsconfig.paths).map(function(param2) {\n var [k, v] = param2;\n var key = k.endsWith(\"/*\") ? k.replace(/\\/\\*$/, \"\") : `${k}$`;\n var value = v[0].replace(/\\/\\*$/, \"\");\n if (!value.startsWith(\"./\")) value = `./${value}`;\n return [\n key,\n value\n ];\n }))\n }\n ],\n [\n \"one/babel-plugin-one-router-metro\",\n {\n // posix-only, becomes the first arg of `require.context()` in `one-router-metro`;\n // backslashes on Windows drift the babel-emitted AST per platform.\n ONE_ROUTER_APP_ROOT_RELATIVE_TO_ENTRY: toPosixRelativePath(import_path.default.relative(import_path.default.dirname(metroEntryPath), import_path.default.join(projectRoot, relativeRouterRoot))),\n ONE_ROUTER_ROOT_FOLDER_NAME: relativeRouterRoot,\n ONE_ROUTER_REQUIRE_CONTEXT_REGEX_STRING: buildRouterRequireContextRegexString(ignoredRouteFiles),\n ONE_ROUTER_LINKING_CONFIG: linking,\n ONE_SETUP_FILE_NATIVE: setupFileRelativeToMetroEntry\n }\n ],\n \"one/babel-plugin-inline-one-server-url\"\n ];\n}\nfunction buildStandaloneImportMetaEnv() {\n var _process_env_ONE_PLATFORM;\n var isProduction = process.env.NODE_ENV !== \"development\";\n var expoPlatform = process.env.ONE_PLATFORM === \"ios\" || process.env.ONE_PLATFORM === \"android\" ? process.env.ONE_PLATFORM : process.env.EXPO_OS === \"ios\" || process.env.EXPO_OS === \"android\" ? process.env.EXPO_OS : void 0;\n var env = {\n ...(0, import_env.pickOnePublicEnv)(process.env),\n MODE: isProduction ? \"production\" : \"development\",\n BASE_URL: \"/\",\n PROD: isProduction,\n DEV: !isProduction,\n SSR: false,\n ONE_PLATFORM: (_process_env_ONE_PLATFORM = process.env.ONE_PLATFORM) !== null && _process_env_ONE_PLATFORM !== void 0 ? _process_env_ONE_PLATFORM : \"web\",\n ...expoPlatform ? {\n EXPO_OS: expoPlatform\n } : {}\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(process.env)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n if (key.startsWith(\"ONE_\") || key.startsWith(\"VITE_\")) {\n env[key] = value;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return env;\n}\nfunction normalizeReSource(source) {\n return source.replace(/\\[\\\\\\\\\\/\\]/g, \"\\\\/\").replace(/\\[\\^\\\\\\\\\\/\\]/g, \"[^/]\");\n}\nfunction buildRouterRequireContextRegexString(ignoredRouteFiles) {\n var excludeRes = [\n ...(ignoredRouteFiles || []).map(function(pattern) {\n return import_micromatch.default.makeRe(pattern);\n }),\n ...import_glob_patterns.ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS.map(function(pattern) {\n return import_micromatch.default.makeRe(pattern);\n }),\n import_micromatch.default.makeRe(import_glob_patterns.API_ROUTE_GLOB_PATTERN)\n ];\n var mustStartWith = String.raw`^(?:(?:^|\\/|(?:(?:(?!(?:^|\\/)\\.).)*?)\\/)(?!\\.)(?=.)[^/]*?`;\n var mustEndWith = String.raw`)$`;\n var negatives = excludeRes.map(function(re, i) {\n var reSource = normalizeReSource(re.source);\n if (!(reSource.startsWith(mustStartWith) && reSource.endsWith(mustEndWith))) {\n var pattern = ignoredRouteFiles === null || ignoredRouteFiles === void 0 ? void 0 : ignoredRouteFiles[i];\n throw new Error(pattern ? `[one/metro] ignoredRouteFile pattern \"${pattern}\" is not supported. We cannot process the corresponding regex \"${reSource}\" for now.` : `Unsupported regex \"${reSource}\" in \"ignoredRouteFiles\".`);\n }\n var inner = reSource.slice(mustStartWith.length, reSource.length - mustEndWith.length);\n return String.raw`(?:.*${inner})`;\n });\n return String.raw`^(?:\\.\\/)(?!${negatives.join(\"|\")}$).*\\.tsx?$`;\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAA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,aAAa,KAAK,SAAS,SAAS,WAAW,IAAI;GAC3E,IAAI,UAAU,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB;GACtG,MAAM,IAAI,MAAM,UAAU,yCAAyC,QAAQ,iEAAiE,SAAS,cAAc,sBAAsB,SAAS,0BAA0B;EAC9N;EACA,IAAI,QAAQ,SAAS,MAAM,cAAc,QAAQ,SAAS,SAAS,YAAY,MAAM;EACrF,OAAO,OAAO,GAAG,QAAQ,MAAM;CACjC,CAAC;CACD,OAAO,OAAO,GAAG,eAAe,UAAU,KAAK,GAAG,EAAE;AACtD"}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/babel-preset/index.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar babel_preset_exports = {};\n__export(babel_preset_exports, {\n buildOneBabelPlugins: () => buildOneBabelPlugins,\n buildRouterRequireContextRegexString: () => buildRouterRequireContextRegexString,\n default: () => oneBabelPreset\n});\nmodule.exports = __toCommonJS(babel_preset_exports);\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_module = require(\"module\");\nvar import_micromatch = __toESM(require(\"micromatch\"), 1);\nvar import_tsconfig_paths = __toESM(require(\"tsconfig-paths\"), 1);\nvar import_env = require(\"../native/env\");\nvar import_glob_patterns = require(\"../router/glob-patterns\");\nfunction toPosixRelativePath(relativePath) {\n return import_path.default.sep === \"\\\\\" ? relativePath.replace(/\\\\/g, \"/\") : relativePath;\n}\nfunction oneBabelPreset(api) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var _options_projectRoot, _options_routerRoot;\n var hasViteInjectedOnePlugins = typeof (api === null || api === void 0 ? void 0 : api.caller) === \"function\" ? api.caller(function(caller) {\n return !!(caller === null || caller === void 0 ? void 0 : caller.oneViteMetroBabelConfig);\n }) : false;\n var isVxrnCompiler = typeof (api === null || api === void 0 ? void 0 : api.caller) === \"function\" ? api.caller(function(caller) {\n return (caller === null || caller === void 0 ? void 0 : caller.name) === \"vxrn\";\n }) : false;\n if (isVxrnCompiler) {\n return {\n presets: [],\n plugins: []\n };\n }\n if (!(api === null || api === void 0 ? void 0 : api.caller) && typeof (api === null || api === void 0 ? void 0 : api.cache) === \"function\") {\n api.cache(true);\n }\n var projectRoot = import_path.default.resolve((_options_projectRoot = options.projectRoot) !== null && _options_projectRoot !== void 0 ? _options_projectRoot : typeof (api === null || api === void 0 ? void 0 : api.cwd) === \"function\" ? api.cwd() : process.cwd());\n var require2 = (0, import_module.createRequire)(projectRoot + \"/\");\n var reactNativePresetPath;\n try {\n reactNativePresetPath = require2.resolve(\"@react-native/babel-preset\");\n } catch (unused) {\n throw new Error(`[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`);\n }\n return {\n presets: [\n require2(reactNativePresetPath)\n ],\n plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot: (_options_routerRoot = options.routerRoot) !== null && _options_routerRoot !== void 0 ? _options_routerRoot : \"app\",\n ignoredRouteFiles: options.ignoredRouteFiles,\n linking: options.linking,\n setupFile: options.setupFile,\n includeImportMetaEnv: options.includeImportMetaEnv\n })\n };\n}\nfunction buildOneBabelPlugins(param) {\n var { projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true } = param;\n var tsconfig = import_tsconfig_paths.default.loadConfig(projectRoot);\n if (tsconfig.resultType === \"failed\") {\n throw new Error(\"[one/babel-preset] tsconfig.json paths could not be loaded\");\n }\n var require2 = (0, import_module.createRequire)(projectRoot + \"/\");\n var metroEntryPath = require2.resolve(\"one/metro-entry\", {\n paths: [\n projectRoot\n ]\n });\n var setupFileRelativeToMetroEntry = (function() {\n if (!setupFile) return void 0;\n var file = typeof setupFile === \"string\" ? setupFile : setupFile.native || setupFile.ios || setupFile.android;\n if (!file) return void 0;\n return toPosixRelativePath(import_path.default.relative(import_path.default.dirname(metroEntryPath), import_path.default.join(projectRoot, file)));\n })();\n return [\n // standalone Metro CLI needs `import.meta.env.*` /\n // `process.env.*` baked in. The Vite path passes `false` here and injects\n // its own version with the user's `define` env via the server hook.\n ...includeImportMetaEnv ? [\n [\n \"@vxrn/vite-plugin-metro/babel-plugins/import-meta-env-plugin\",\n {\n env: buildStandaloneImportMetaEnv()\n }\n ]\n ] : [],\n \"one/babel-plugin-environment-guard\",\n [\n \"one/babel-plugin-remove-server-code\",\n {\n routerRoot: relativeRouterRoot\n }\n ],\n [\n \"babel-plugin-module-resolver\",\n // \"vite-tsconfig-paths\" for Metro\n {\n alias: Object.fromEntries(Object.entries(tsconfig.paths).map(function(param2) {\n var [k, v] = param2;\n var key = k.endsWith(\"/*\") ? k.replace(/\\/\\*$/, \"\") : `${k}$`;\n var value = v[0].replace(/\\/\\*$/, \"\");\n if (!value.startsWith(\"./\")) value = `./${value}`;\n return [\n key,\n value\n ];\n }))\n }\n ],\n [\n \"one/babel-plugin-one-router-metro\",\n {\n // posix-only, becomes the first arg of `require.context()` in `one-router-metro`;\n // backslashes on Windows drift the babel-emitted AST per platform.\n ONE_ROUTER_APP_ROOT_RELATIVE_TO_ENTRY: toPosixRelativePath(import_path.default.relative(import_path.default.dirname(metroEntryPath), import_path.default.join(projectRoot, relativeRouterRoot))),\n ONE_ROUTER_ROOT_FOLDER_NAME: relativeRouterRoot,\n ONE_ROUTER_REQUIRE_CONTEXT_REGEX_STRING: buildRouterRequireContextRegexString(ignoredRouteFiles),\n ONE_ROUTER_LINKING_CONFIG: linking,\n ONE_SETUP_FILE_NATIVE: setupFileRelativeToMetroEntry\n }\n ],\n \"one/babel-plugin-inline-one-server-url\"\n ];\n}\nfunction buildStandaloneImportMetaEnv() {\n var _process_env_ONE_PLATFORM;\n var isProduction = process.env.NODE_ENV !== \"development\";\n var expoPlatform = process.env.ONE_PLATFORM === \"ios\" || process.env.ONE_PLATFORM === \"android\" ? process.env.ONE_PLATFORM : process.env.EXPO_OS === \"ios\" || process.env.EXPO_OS === \"android\" ? process.env.EXPO_OS : void 0;\n var env = {\n ...(0, import_env.pickOnePublicEnv)(process.env),\n MODE: isProduction ? \"production\" : \"development\",\n BASE_URL: \"/\",\n PROD: isProduction,\n DEV: !isProduction,\n SSR: false,\n ONE_PLATFORM: (_process_env_ONE_PLATFORM = process.env.ONE_PLATFORM) !== null && _process_env_ONE_PLATFORM !== void 0 ? _process_env_ONE_PLATFORM : \"web\",\n ...expoPlatform ? {\n EXPO_OS: expoPlatform\n } : {}\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(process.env)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n if (key.startsWith(\"ONE_\") || key.startsWith(\"VITE_\")) {\n env[key] = value;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return env;\n}\nfunction normalizeReSource(source) {\n return source.replace(/\\[\\\\\\\\\\/\\]/g, \"\\\\/\").replace(/\\[\\^\\\\\\\\\\/\\]/g, \"[^/]\");\n}\nfunction buildRouterRequireContextRegexString(ignoredRouteFiles) {\n var excludeRes = [\n ...(ignoredRouteFiles || []).map(function(pattern) {\n return import_micromatch.default.makeRe(pattern);\n }),\n ...import_glob_patterns.ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS.map(function(pattern) {\n return import_micromatch.default.makeRe(pattern);\n }),\n import_micromatch.default.makeRe(import_glob_patterns.API_ROUTE_GLOB_PATTERN)\n ];\n var mustStartWith = String.raw`^(?:(?:^|\\/|(?:(?:(?!(?:^|\\/)\\.).)*?)\\/)(?!\\.)(?=.)[^/]*?`;\n var mustEndWith = String.raw`)$`;\n var negatives = excludeRes.map(function(re, i) {\n var reSource = normalizeReSource(re.source);\n if (!(reSource.startsWith(mustStartWith) && reSource.endsWith(mustEndWith))) {\n var pattern = ignoredRouteFiles === null || ignoredRouteFiles === void 0 ? void 0 : ignoredRouteFiles[i];\n throw new Error(pattern ? `[one/metro] ignoredRouteFile pattern \"${pattern}\" is not supported. We cannot process the corresponding regex \"${reSource}\" for now.` : `Unsupported regex \"${reSource}\" in \"ignoredRouteFiles\".`);\n }\n var inner = reSource.slice(mustStartWith.length, reSource.length - mustEndWith.length);\n return String.raw`(?:.*${inner})`;\n });\n return String.raw`^(?:\\.\\/)(?!${negatives.join(\"|\")}$).*\\.tsx?$`;\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AA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QAAQ,MAAM;CACjC,CAAC;CACD,OAAO,OAAO,GAAG,eAAe,UAAU,KAAK,GAAG,EAAE;AACtD"}
@@ -38,23 +38,22 @@ var import_getRouterRootFromOneOptions = require("../utils/getRouterRootFromOneO
38
38
  const ONE_GENERATED_MARKER = "@one/generated bundler-config";
39
39
  function buildBabelConfigContent({ eject, options }) {
40
40
  const header = eject ? `// you own this file. edit freely. \`one\` will not regenerate it.
41
- // composes React Native's Metro preset with One's canonical plugin chain.
41
+ // delegates to one/babel-preset which holds the canonical plugin chain.
42
42
  ` : `// ${ONE_GENERATED_MARKER}
43
43
  //
44
- // auto-generated by \`one metro-eject\`. composes React Native's Metro
45
- // preset with One's router/setup transforms.
44
+ // auto-generated by \`one metro-eject\`. delegates to one/babel-preset so
45
+ // Metro uses the same router/setup options as \`one dev\` and \`one build\`.
46
46
  //
47
47
  // to customize, delete this header and edit freely. re-runs will then
48
48
  // leave this file alone.
49
49
  `;
50
50
  return `${header}
51
+ const oneBabelPreset = require('one/babel-preset')
52
+ const preset = oneBabelPreset.default || oneBabelPreset
51
53
  const oneBundlerOptions = ${serializeBundlerConfigOptions(options)}
52
54
 
53
- module.exports = {
54
- presets: [
55
- '@react-native/babel-preset',
56
- ['one/babel-preset', oneBundlerOptions],
57
- ],
55
+ module.exports = function (api) {
56
+ return preset(api, oneBundlerOptions)
58
57
  }
59
58
  `;
60
59
  }
@@ -41,23 +41,22 @@ var ONE_GENERATED_MARKER = "@one/generated bundler-config";
41
41
  function buildBabelConfigContent(param) {
42
42
  var { eject, options } = param;
43
43
  var header = eject ? `// you own this file. edit freely. \`one\` will not regenerate it.
44
- // composes React Native's Metro preset with One's canonical plugin chain.
44
+ // delegates to one/babel-preset which holds the canonical plugin chain.
45
45
  ` : `// ${ONE_GENERATED_MARKER}
46
46
  //
47
- // auto-generated by \`one metro-eject\`. composes React Native's Metro
48
- // preset with One's router/setup transforms.
47
+ // auto-generated by \`one metro-eject\`. delegates to one/babel-preset so
48
+ // Metro uses the same router/setup options as \`one dev\` and \`one build\`.
49
49
  //
50
50
  // to customize, delete this header and edit freely. re-runs will then
51
51
  // leave this file alone.
52
52
  `;
53
53
  return `${header}
54
+ const oneBabelPreset = require('one/babel-preset')
55
+ const preset = oneBabelPreset.default || oneBabelPreset
54
56
  const oneBundlerOptions = ${serializeBundlerConfigOptions(options)}
55
57
 
56
- module.exports = {
57
- presets: [
58
- '@react-native/babel-preset',
59
- ['one/babel-preset', oneBundlerOptions],
60
- ],
58
+ module.exports = function (api) {
59
+ return preset(api, oneBundlerOptions)
61
60
  }
62
61
  `;
63
62
  }
@@ -41,23 +41,22 @@ var ONE_GENERATED_MARKER = "@one/generated bundler-config";
41
41
  function buildBabelConfigContent(param) {
42
42
  var { eject, options } = param;
43
43
  var header = eject ? `// you own this file. edit freely. \`one\` will not regenerate it.
44
- // composes React Native's Metro preset with One's canonical plugin chain.
44
+ // delegates to one/babel-preset which holds the canonical plugin chain.
45
45
  ` : `// ${ONE_GENERATED_MARKER}
46
46
  //
47
- // auto-generated by \`one metro-eject\`. composes React Native's Metro
48
- // preset with One's router/setup transforms.
47
+ // auto-generated by \`one metro-eject\`. delegates to one/babel-preset so
48
+ // Metro uses the same router/setup options as \`one dev\` and \`one build\`.
49
49
  //
50
50
  // to customize, delete this header and edit freely. re-runs will then
51
51
  // leave this file alone.
52
52
  `;
53
53
  return `${header}
54
+ const oneBabelPreset = require('one/babel-preset')
55
+ const preset = oneBabelPreset.default || oneBabelPreset
54
56
  const oneBundlerOptions = ${serializeBundlerConfigOptions(options)}
55
57
 
56
- module.exports = {
57
- presets: [
58
- '@react-native/babel-preset',
59
- ['one/babel-preset', oneBundlerOptions],
60
- ],
58
+ module.exports = function (api) {
59
+ return preset(api, oneBundlerOptions)
61
60
  }
62
61
  `;
63
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generateBundlerConfig.native.js","names":[],"sources":["cjs/cli/generateBundlerConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar generateBundlerConfig_exports = {};\n__export(generateBundlerConfig_exports, {\n ONE_GENERATED_MARKER: () => ONE_GENERATED_MARKER,\n generateBundlerConfig: () => generateBundlerConfig,\n getBundlerConfigOptionsFromOneOptions: () => getBundlerConfigOptionsFromOneOptions\n});\nmodule.exports = __toCommonJS(generateBundlerConfig_exports);\nvar import_fs = require(\"fs\");\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_picocolors = __toESM(require(\"picocolors\"), 1);\nvar import_getRouterRootFromOneOptions = require(\"../utils/getRouterRootFromOneOptions\");\nvar ONE_GENERATED_MARKER = \"@one/generated bundler-config\";\nfunction buildBabelConfigContent(param) {\n var { eject, options } = param;\n var header = eject ? `// you own this file. edit freely. \\`one\\` will not regenerate it.\n// composes React Native's Metro preset with One's canonical plugin chain.\n` : `// ${ONE_GENERATED_MARKER}\n//\n// auto-generated by \\`one metro-eject\\`. composes React Native's Metro\n// preset with One's router/setup transforms.\n//\n// to customize, delete this header and edit freely. re-runs will then\n// leave this file alone.\n`;\n return `${header}\nconst oneBundlerOptions = ${serializeBundlerConfigOptions(options)}\n\nmodule.exports = {\n presets: [\n '@react-native/babel-preset',\n ['one/babel-preset', oneBundlerOptions],\n ],\n}\n`;\n}\nfunction buildMetroConfigContent(param) {\n var { eject, options } = param;\n var header = eject ? `// you own this file. edit freely. \\`one\\` will not regenerate it.\n// withOne() invokes the same Metro pipeline One uses for production bundles.\n` : `// ${ONE_GENERATED_MARKER}\n//\n// auto-generated by \\`one metro-eject\\`. delegates to one/metro-config,\n// which invokes the same metro pipeline One uses for production native\n// bundles with your router and setup options.\n//\n// to customize, delete this header and edit freely. re-runs will then\n// leave this file alone.\n`;\n return `${header}\nconst { withOne } = require('one/metro-config')\nconst oneBundlerOptions = ${serializeBundlerConfigOptions(options)}\n\nmodule.exports = withOne(__dirname, oneBundlerOptions)\n`;\n}\nvar FILES = [\n {\n name: \"babel.config.cjs\",\n getContent: buildBabelConfigContent,\n conflicting: [\n \"babel.config.js\",\n \"babel.config.mjs\",\n \".babelrc\",\n \".babelrc.js\"\n ]\n },\n {\n name: \"metro.config.cjs\",\n getContent: buildMetroConfigContent,\n conflicting: [\n \"metro.config.js\",\n \"metro.config.mjs\"\n ]\n }\n];\nfunction stripUndefined(value) {\n if (Array.isArray(value)) {\n return value.map(stripUndefined);\n }\n if (value && typeof value === \"object\") {\n return Object.fromEntries(Object.entries(value).filter(function(param) {\n var [, entry] = param;\n return entry !== void 0;\n }).map(function(param) {\n var [key, entry] = param;\n return [\n key,\n stripUndefined(entry)\n ];\n }));\n }\n return value;\n}\nfunction assertSerializable(value) {\n var keyPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"one bundler options\";\n if (typeof value === \"function\" || typeof value === \"symbol\" || typeof value === \"bigint\") {\n throw new Error(`[one] ${keyPath} must be JSON-serializable to generate Babel/Metro config files. Move function-valued native linking/customization into an ejected config.`);\n }\n if (Array.isArray(value)) {\n value.forEach(function(entry2, index) {\n return assertSerializable(entry2, `${keyPath}[${index}]`);\n });\n return;\n }\n if (value && typeof value === \"object\") {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, entry] = _step.value;\n assertSerializable(entry, `${keyPath}.${key}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\nfunction serializeBundlerConfigOptions(options) {\n var clean = stripUndefined(options);\n assertSerializable(clean);\n return JSON.stringify(clean, null, 2);\n}\nfunction getBundlerConfigOptionsFromOneOptions() {\n var oneOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var _oneOptions_router, _oneOptions_router1;\n return stripUndefined({\n routerRoot: (0, import_getRouterRootFromOneOptions.getRouterRootFromOneOptions)(oneOptions),\n ignoredRouteFiles: (_oneOptions_router = oneOptions.router) === null || _oneOptions_router === void 0 ? void 0 : _oneOptions_router.ignoredRouteFiles,\n linking: (_oneOptions_router1 = oneOptions.router) === null || _oneOptions_router1 === void 0 ? void 0 : _oneOptions_router1.linking,\n setupFile: oneOptions.setupFile\n });\n}\nfunction generateBundlerConfig() {\n var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var _args_cwd;\n var cwd = import_path.default.resolve((_args_cwd = args.cwd) !== null && _args_cwd !== void 0 ? _args_cwd : process.cwd());\n var force = !!args.force;\n var check = !!args.check;\n var quiet = !!args.quiet;\n var log = function(msg) {\n if (!quiet) console.info(msg);\n };\n var warn = function(msg) {\n if (!quiet) console.warn(msg);\n };\n var results = [];\n var eject = !!args.eject;\n var bundlerOptions = getBundlerConfigOptionsFromOneOptions(args.oneOptions);\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = FILES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var file = _step.value;\n var filePath = import_path.default.join(cwd, file.name);\n var targetContent = file.getContent({\n eject,\n options: bundlerOptions\n });\n var conflict = file.conflicting.find(function(alt) {\n return (0, import_fs.existsSync)(import_path.default.join(cwd, alt));\n });\n if (conflict && !(0, import_fs.existsSync)(filePath)) {\n results.push({\n filePath: import_path.default.join(cwd, conflict),\n action: \"skipped-other-format\",\n reason: `Found ${conflict}; not creating ${file.name}. To switch, delete ${conflict} and re-run with --force.`\n });\n warn(import_picocolors.default.yellow(`[one] found ${conflict}. Leaving it alone. Delete it and re-run with --force to switch to ${file.name}.`));\n continue;\n }\n if (!(0, import_fs.existsSync)(filePath)) {\n if (check) {\n results.push({\n filePath,\n action: \"would-write\"\n });\n log(import_picocolors.default.yellow(`[one] missing: ${file.name}`));\n continue;\n }\n (0, import_fs.writeFileSync)(filePath, targetContent);\n results.push({\n filePath,\n action: \"wrote\"\n });\n log(import_picocolors.default.green(`[one] wrote ${file.name}`));\n continue;\n }\n var existing = (0, import_fs.readFileSync)(filePath, \"utf8\");\n if (existing === targetContent) {\n results.push({\n filePath,\n action: \"kept\"\n });\n log(import_picocolors.default.dim(`[one] up to date: ${file.name}`));\n continue;\n }\n var hasMarker = existing.includes(ONE_GENERATED_MARKER);\n if (!hasMarker && !force) {\n results.push({\n filePath,\n action: \"skipped-customized\",\n reason: `${file.name} has been customized (no @one marker). Re-add the marker comment or pass --force to overwrite.`\n });\n warn(import_picocolors.default.yellow(`[one] ${file.name} appears customized. Skipping. Pass --force to overwrite.`));\n continue;\n }\n if (check) {\n results.push({\n filePath,\n action: \"would-overwrite\"\n });\n log(import_picocolors.default.yellow(`[one] out of date: ${file.name}`));\n continue;\n }\n (0, import_fs.writeFileSync)(filePath, targetContent);\n results.push({\n filePath,\n action: \"wrote\"\n });\n log(import_picocolors.default.green(`[one] updated ${file.name}`));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var acceptableAlways = /* @__PURE__ */ new Set([\n \"wrote\",\n \"kept\",\n \"skipped-other-format\",\n \"skipped-customized\"\n ]);\n var acceptableInCheck = /* @__PURE__ */ new Set([\n \"kept\",\n \"skipped-other-format\",\n \"skipped-customized\"\n ]);\n var ok = (check ? acceptableInCheck : acceptableAlways).size ? results.every(function(r) {\n return (check ? acceptableInCheck : acceptableAlways).has(r.action);\n }) : false;\n return {\n results,\n ok\n };\n}\n//# sourceMappingURL=generateBundlerConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KA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AAO;IACxB,QAAQ,KAAK;KACX;KACA,QAAQ;KACR,QAAQ,GAAG,KAAK,KAAK;IACvB,CAAC;IACD,KAAK,kBAAkB,QAAQ,OAAO,SAAS,KAAK,KAAK,0DAA0D,CAAC;IACpH;GACF;GACA,IAAI,OAAO;IACT,QAAQ,KAAK;KACX;KACA,QAAQ;IACV,CAAC;IACD,IAAI,kBAAkB,QAAQ,OAAO,sBAAsB,KAAK,MAAM,CAAC;IACvE;GACF;GACA,CAAC,GAAG,UAAU,cAAa,CAAE,UAAU,aAAa;GACpD,QAAQ,KAAK;IACX;IACA,QAAQ;GACV,CAAC;GACD,IAAI,kBAAkB,QAAQ,MAAM,iBAAiB,KAAK,MAAM,CAAC;EACnE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,IAAI,mCAAmC,IAAI,IAAI;EAC7C;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI,oCAAoC,IAAI,IAAI;EAC9C;EACA;EACA;CACF,CAAC;CACD,IAAI,MAAM,QAAQ,oBAAoB,iBAAgB,CAAE,OAAO,QAAQ,MAAM,SAAS,GAAG;EACvF,QAAQ,QAAQ,oBAAoB,iBAAgB,CAAE,IAAI,EAAE,MAAM;CACpE,CAAC,IAAI;CACL,OAAO;EACL;EACA;CACF;AACF"}
1
+ {"version":3,"file":"generateBundlerConfig.native.js","names":[],"sources":["cjs/cli/generateBundlerConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar generateBundlerConfig_exports = {};\n__export(generateBundlerConfig_exports, {\n ONE_GENERATED_MARKER: () => ONE_GENERATED_MARKER,\n generateBundlerConfig: () => generateBundlerConfig,\n getBundlerConfigOptionsFromOneOptions: () => getBundlerConfigOptionsFromOneOptions\n});\nmodule.exports = __toCommonJS(generateBundlerConfig_exports);\nvar import_fs = require(\"fs\");\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_picocolors = __toESM(require(\"picocolors\"), 1);\nvar import_getRouterRootFromOneOptions = require(\"../utils/getRouterRootFromOneOptions\");\nvar ONE_GENERATED_MARKER = \"@one/generated bundler-config\";\nfunction buildBabelConfigContent(param) {\n var { eject, options } = param;\n var header = eject ? `// you own this file. edit freely. \\`one\\` will not regenerate it.\n// delegates to one/babel-preset which holds the canonical plugin chain.\n` : `// ${ONE_GENERATED_MARKER}\n//\n// auto-generated by \\`one metro-eject\\`. delegates to one/babel-preset so\n// Metro uses the same router/setup options as \\`one dev\\` and \\`one build\\`.\n//\n// to customize, delete this header and edit freely. re-runs will then\n// leave this file alone.\n`;\n return `${header}\nconst oneBabelPreset = require('one/babel-preset')\nconst preset = oneBabelPreset.default || oneBabelPreset\nconst oneBundlerOptions = ${serializeBundlerConfigOptions(options)}\n\nmodule.exports = function (api) {\n return preset(api, oneBundlerOptions)\n}\n`;\n}\nfunction buildMetroConfigContent(param) {\n var { eject, options } = param;\n var header = eject ? `// you own this file. edit freely. \\`one\\` will not regenerate it.\n// withOne() invokes the same Metro pipeline One uses for production bundles.\n` : `// ${ONE_GENERATED_MARKER}\n//\n// auto-generated by \\`one metro-eject\\`. delegates to one/metro-config,\n// which invokes the same metro pipeline One uses for production native\n// bundles with your router and setup options.\n//\n// to customize, delete this header and edit freely. re-runs will then\n// leave this file alone.\n`;\n return `${header}\nconst { withOne } = require('one/metro-config')\nconst oneBundlerOptions = ${serializeBundlerConfigOptions(options)}\n\nmodule.exports = withOne(__dirname, oneBundlerOptions)\n`;\n}\nvar FILES = [\n {\n name: \"babel.config.cjs\",\n getContent: buildBabelConfigContent,\n conflicting: [\n \"babel.config.js\",\n \"babel.config.mjs\",\n \".babelrc\",\n \".babelrc.js\"\n ]\n },\n {\n name: \"metro.config.cjs\",\n getContent: buildMetroConfigContent,\n conflicting: [\n \"metro.config.js\",\n \"metro.config.mjs\"\n ]\n }\n];\nfunction stripUndefined(value) {\n if (Array.isArray(value)) {\n return value.map(stripUndefined);\n }\n if (value && typeof value === \"object\") {\n return Object.fromEntries(Object.entries(value).filter(function(param) {\n var [, entry] = param;\n return entry !== void 0;\n }).map(function(param) {\n var [key, entry] = param;\n return [\n key,\n stripUndefined(entry)\n ];\n }));\n }\n return value;\n}\nfunction assertSerializable(value) {\n var keyPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"one bundler options\";\n if (typeof value === \"function\" || typeof value === \"symbol\" || typeof value === \"bigint\") {\n throw new Error(`[one] ${keyPath} must be JSON-serializable to generate Babel/Metro config files. Move function-valued native linking/customization into an ejected config.`);\n }\n if (Array.isArray(value)) {\n value.forEach(function(entry2, index) {\n return assertSerializable(entry2, `${keyPath}[${index}]`);\n });\n return;\n }\n if (value && typeof value === \"object\") {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, entry] = _step.value;\n assertSerializable(entry, `${keyPath}.${key}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\nfunction serializeBundlerConfigOptions(options) {\n var clean = stripUndefined(options);\n assertSerializable(clean);\n return JSON.stringify(clean, null, 2);\n}\nfunction getBundlerConfigOptionsFromOneOptions() {\n var oneOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var _oneOptions_router, _oneOptions_router1;\n return stripUndefined({\n routerRoot: (0, import_getRouterRootFromOneOptions.getRouterRootFromOneOptions)(oneOptions),\n ignoredRouteFiles: (_oneOptions_router = oneOptions.router) === null || _oneOptions_router === void 0 ? void 0 : _oneOptions_router.ignoredRouteFiles,\n linking: (_oneOptions_router1 = oneOptions.router) === null || _oneOptions_router1 === void 0 ? void 0 : _oneOptions_router1.linking,\n setupFile: oneOptions.setupFile\n });\n}\nfunction generateBundlerConfig() {\n var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var _args_cwd;\n var cwd = import_path.default.resolve((_args_cwd = args.cwd) !== null && _args_cwd !== void 0 ? _args_cwd : process.cwd());\n var force = !!args.force;\n var check = !!args.check;\n var quiet = !!args.quiet;\n var log = function(msg) {\n if (!quiet) console.info(msg);\n };\n var warn = function(msg) {\n if (!quiet) console.warn(msg);\n };\n var results = [];\n var eject = !!args.eject;\n var bundlerOptions = getBundlerConfigOptionsFromOneOptions(args.oneOptions);\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = FILES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var file = _step.value;\n var filePath = import_path.default.join(cwd, file.name);\n var targetContent = file.getContent({\n eject,\n options: bundlerOptions\n });\n var conflict = file.conflicting.find(function(alt) {\n return (0, import_fs.existsSync)(import_path.default.join(cwd, alt));\n });\n if (conflict && !(0, import_fs.existsSync)(filePath)) {\n results.push({\n filePath: import_path.default.join(cwd, conflict),\n action: \"skipped-other-format\",\n reason: `Found ${conflict}; not creating ${file.name}. To switch, delete ${conflict} and re-run with --force.`\n });\n warn(import_picocolors.default.yellow(`[one] found ${conflict}. Leaving it alone. Delete it and re-run with --force to switch to ${file.name}.`));\n continue;\n }\n if (!(0, import_fs.existsSync)(filePath)) {\n if (check) {\n results.push({\n filePath,\n action: \"would-write\"\n });\n log(import_picocolors.default.yellow(`[one] missing: ${file.name}`));\n continue;\n }\n (0, import_fs.writeFileSync)(filePath, targetContent);\n results.push({\n filePath,\n action: \"wrote\"\n });\n log(import_picocolors.default.green(`[one] wrote ${file.name}`));\n continue;\n }\n var existing = (0, import_fs.readFileSync)(filePath, \"utf8\");\n if (existing === targetContent) {\n results.push({\n filePath,\n action: \"kept\"\n });\n log(import_picocolors.default.dim(`[one] up to date: ${file.name}`));\n continue;\n }\n var hasMarker = existing.includes(ONE_GENERATED_MARKER);\n if (!hasMarker && !force) {\n results.push({\n filePath,\n action: \"skipped-customized\",\n reason: `${file.name} has been customized (no @one marker). Re-add the marker comment or pass --force to overwrite.`\n });\n warn(import_picocolors.default.yellow(`[one] ${file.name} appears customized. Skipping. Pass --force to overwrite.`));\n continue;\n }\n if (check) {\n results.push({\n filePath,\n action: \"would-overwrite\"\n });\n log(import_picocolors.default.yellow(`[one] out of date: ${file.name}`));\n continue;\n }\n (0, import_fs.writeFileSync)(filePath, targetContent);\n results.push({\n filePath,\n action: \"wrote\"\n });\n log(import_picocolors.default.green(`[one] updated ${file.name}`));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var acceptableAlways = /* @__PURE__ */ new Set([\n \"wrote\",\n \"kept\",\n \"skipped-other-format\",\n \"skipped-customized\"\n ]);\n var acceptableInCheck = /* @__PURE__ */ new Set([\n \"kept\",\n \"skipped-other-format\",\n \"skipped-customized\"\n ]);\n var ok = (check ? acceptableInCheck : acceptableAlways).size ? results.every(function(r) {\n return (check ? acceptableInCheck : acceptableAlways).has(r.action);\n }) : false;\n return {\n results,\n ok\n };\n}\n//# sourceMappingURL=generateBundlerConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,I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,OAAO,SAAS,KAAK,KAAK,0DAA0D,CAAC;IACpH;GACF;GACA,IAAI,OAAO;IACT,QAAQ,KAAK;KACX;KACA,QAAQ;IACV,CAAC;IACD,IAAI,kBAAkB,QAAQ,OAAO,sBAAsB,KAAK,MAAM,CAAC;IACvE;GACF;GACA,CAAC,GAAG,UAAU,cAAa,CAAE,UAAU,aAAa;GACpD,QAAQ,KAAK;IACX;IACA,QAAQ;GACV,CAAC;GACD,IAAI,kBAAkB,QAAQ,MAAM,iBAAiB,KAAK,MAAM,CAAC;EACnE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,IAAI,mCAAmC,IAAI,IAAI;EAC7C;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI,oCAAoC,IAAI,IAAI;EAC9C;EACA;EACA;CACF,CAAC;CACD,IAAI,MAAM,QAAQ,oBAAoB,iBAAgB,CAAE,OAAO,QAAQ,MAAM,SAAS,GAAG;EACvF,QAAQ,QAAQ,oBAAoB,iBAAgB,CAAE,IAAI,EAAE,MAAM;CACpE,CAAC,IAAI;CACL,OAAO;EACL;EACA;CACF;AACF"}
@@ -27,9 +27,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  var prebuild_exports = {};
28
28
  __export(prebuild_exports, { run: () => run });
29
29
  module.exports = __toCommonJS(prebuild_exports);
30
+ var import_node_fs = require("node:fs");
31
+ var import_node_path = require("node:path");
30
32
  var import_appManifest = require("../native/appManifest.cjs");
31
33
  var import_loadConfig = require("../vite/loadConfig.cjs");
32
34
  async function run(args) {
35
+ const root = process.cwd();
36
+ const packageJson = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(root, "package.json"), "utf8"));
37
+ const hasExpo = Object.hasOwn(packageJson.dependencies ?? {}, "expo") || Object.hasOwn(packageJson.devDependencies ?? {}, "expo");
38
+ if (hasExpo) {
39
+ throw new Error("[one] one prebuild only generates Expo-free projects. This app declares expo; run Expo prebuild and list \"vxrn/expo-plugin\" in the Expo config.");
40
+ }
33
41
  const { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)("build", true);
34
42
  const native = oneOptions?.native;
35
43
  const app = typeof native === "object" ? native.app : void 0;
@@ -29,9 +29,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var prebuild_exports = {};
30
30
  __export(prebuild_exports, { run: () => run });
31
31
  module.exports = __toCommonJS(prebuild_exports);
32
+ var import_fs = require("fs");
33
+ var import_path = require("path");
32
34
  var import_appManifest = require("../native/appManifest.native.js");
33
35
  var import_loadConfig = require("../vite/loadConfig.native.js");
34
36
  async function run(args) {
37
+ var _packageJson_dependencies, _packageJson_devDependencies;
38
+ var root = process.cwd();
39
+ var packageJson = JSON.parse((0, import_fs.readFileSync)((0, import_path.join)(root, "package.json"), "utf8"));
40
+ var hasExpo = Object.hasOwn((_packageJson_dependencies = packageJson.dependencies) !== null && _packageJson_dependencies !== void 0 ? _packageJson_dependencies : {}, "expo") || Object.hasOwn((_packageJson_devDependencies = packageJson.devDependencies) !== null && _packageJson_devDependencies !== void 0 ? _packageJson_devDependencies : {}, "expo");
41
+ if (hasExpo) {
42
+ throw new Error("[one] one prebuild only generates Expo-free projects. This app declares expo; run Expo prebuild and list \"vxrn/expo-plugin\" in the Expo config.");
43
+ }
35
44
  var { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)("build", true);
36
45
  var native = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.native;
37
46
  var app = typeof native === "object" ? native.app : void 0;
@@ -29,9 +29,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var prebuild_exports = {};
30
30
  __export(prebuild_exports, { run: () => run });
31
31
  module.exports = __toCommonJS(prebuild_exports);
32
+ var import_fs = require("fs");
33
+ var import_path = require("path");
32
34
  var import_appManifest = require("../native/appManifest.native.js");
33
35
  var import_loadConfig = require("../vite/loadConfig.native.js");
34
36
  async function run(args) {
37
+ var _packageJson_dependencies, _packageJson_devDependencies;
38
+ var root = process.cwd();
39
+ var packageJson = JSON.parse((0, import_fs.readFileSync)((0, import_path.join)(root, "package.json"), "utf8"));
40
+ var hasExpo = Object.hasOwn((_packageJson_dependencies = packageJson.dependencies) !== null && _packageJson_dependencies !== void 0 ? _packageJson_dependencies : {}, "expo") || Object.hasOwn((_packageJson_devDependencies = packageJson.devDependencies) !== null && _packageJson_devDependencies !== void 0 ? _packageJson_devDependencies : {}, "expo");
41
+ if (hasExpo) {
42
+ throw new Error("[one] one prebuild only generates Expo-free projects. This app declares expo; run Expo prebuild and list \"vxrn/expo-plugin\" in the Expo config.");
43
+ }
35
44
  var { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)("build", true);
36
45
  var native = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.native;
37
46
  var app = typeof native === "object" ? native.app : void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"prebuild.native.js","names":[],"sources":["cjs/cli/prebuild.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar prebuild_exports = {};\n__export(prebuild_exports, {\n run: () => run\n});\nmodule.exports = __toCommonJS(prebuild_exports);\nvar import_appManifest = require(\"../native/appManifest\");\nvar import_loadConfig = require(\"../vite/loadConfig\");\nasync function run(args) {\n var { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)(\"build\", true);\n var native = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.native;\n var app = typeof native === \"object\" ? native.app : void 0;\n if (!app) {\n throw new Error(\"[one] native.app is required: configure one({ native: { app } }) with name, ios.bundleId, and android.applicationId\");\n }\n (0, import_appManifest.validateNativeApp)(app);\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app\n });\n}\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB,EACzB,WAAW,IACb,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,qBAAqB,QAAQ,iCAAuB;AACxD,IAAI,oBAAoB,QAAQ,8BAAoB;AACpD,eAAe,IAAI,MAAM;CACvB,IAAI,EAAE,eAAe,OAAO,GAAG,kBAAkB,mBAAkB,CAAE,SAAS,IAAI;CAClF,IAAI,SAAS,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW;CAChF,IAAI,MAAM,OAAO,WAAW,WAAW,OAAO,MAAM,KAAK;CACzD,IAAI,CAAC,KAAK;EACR,MAAM,IAAI,MAAM,qHAAqH;CACvI;CACA,CAAC,GAAG,mBAAmB,kBAAiB,CAAE,GAAG;CAC7C,IAAI,EAAE,aAAa,MAAM,OAAO;CAChC,MAAM,SAAS;EACb,MAAM,QAAQ,IAAI;EAClB,GAAG;EACH;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"prebuild.native.js","names":[],"sources":["cjs/cli/prebuild.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar prebuild_exports = {};\n__export(prebuild_exports, {\n run: () => run\n});\nmodule.exports = __toCommonJS(prebuild_exports);\nvar import_fs = require(\"fs\");\nvar import_path = require(\"path\");\nvar import_appManifest = require(\"../native/appManifest\");\nvar import_loadConfig = require(\"../vite/loadConfig\");\nasync function run(args) {\n var _packageJson_dependencies, _packageJson_devDependencies;\n var root = process.cwd();\n var packageJson = JSON.parse((0, import_fs.readFileSync)((0, import_path.join)(root, \"package.json\"), \"utf8\"));\n var hasExpo = Object.hasOwn((_packageJson_dependencies = packageJson.dependencies) !== null && _packageJson_dependencies !== void 0 ? _packageJson_dependencies : {}, \"expo\") || Object.hasOwn((_packageJson_devDependencies = packageJson.devDependencies) !== null && _packageJson_devDependencies !== void 0 ? _packageJson_devDependencies : {}, \"expo\");\n if (hasExpo) {\n throw new Error('[one] one prebuild only generates Expo-free projects. This app declares expo; run Expo prebuild and list \"vxrn/expo-plugin\" in the Expo config.');\n }\n var { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)(\"build\", true);\n var native = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.native;\n var app = typeof native === \"object\" ? native.app : void 0;\n if (!app) {\n throw new Error(\"[one] native.app is required: configure one({ native: { app } }) with name, ios.bundleId, and android.applicationId\");\n }\n (0, import_appManifest.validateNativeApp)(app);\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app\n });\n}\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,G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,
61
- UI
61
+ UI,
62
+ Clipboard: import_native.Clipboard,
63
+ Network: import_native.Network,
64
+ Browser: import_native.Browser,
65
+ useNetworkState: import_native.useNetworkState
62
66
  });
@@ -61,5 +61,9 @@ var One = Object.freeze({
61
61
  },
62
62
  iOS,
63
63
  Android,
64
- UI
64
+ UI,
65
+ Clipboard: import_native.Clipboard,
66
+ Network: import_native.Network,
67
+ Browser: import_native.Browser,
68
+ useNetworkState: import_native.useNetworkState
65
69
  });
@@ -61,7 +61,11 @@ var One = Object.freeze({
61
61
  },
62
62
  iOS,
63
63
  Android,
64
- UI
64
+ UI,
65
+ Clipboard: import_native.Clipboard,
66
+ Network: import_native.Network,
67
+ Browser: import_native.Browser,
68
+ useNetworkState: import_native.useNetworkState
65
69
  });
66
70
 
67
71
  //# sourceMappingURL=one.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"one.native.js","names":[],"sources":["cjs/one.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar one_exports = {};\n__export(one_exports, {\n One: () => One\n});\nmodule.exports = __toCommonJS(one_exports);\nvar import_native = require(\"@vxrn/native\");\nvar import_safe_area = require(\"@vxrn/safe-area\");\nfunction currentPlatform() {\n var _Reflect_get;\n var defined = (_Reflect_get = Reflect.get(globalThis, \"__ONE_PLATFORM__\")) !== null && _Reflect_get !== void 0 ? _Reflect_get : typeof process !== \"undefined\" ? process.env.ONE_PLATFORM : void 0;\n return defined === \"ios\" || defined === \"android\" || defined === \"rnx\" ? defined : \"web\";\n}\nvar iOS = Object.freeze({\n ...import_native.Swift,\n Color: import_native.Color.ios,\n MenuAction: import_native.MenuAction,\n SplitView: import_native.SplitView,\n ToolbarHost: import_native.ToolbarHost,\n ToolbarItem: import_native.ToolbarItem,\n ZoomTransitionAlignmentRectDetector: import_native.ZoomTransitionAlignmentRectDetector,\n ZoomTransitionEnabler: import_native.ZoomTransitionEnabler,\n ZoomTransitionSource: import_native.ZoomTransitionSource\n});\nvar Android = Object.freeze({\n ...import_native.Compose\n});\nvar SafeArea = Object.freeze({\n Provider: import_safe_area.SafeAreaProvider,\n View: import_safe_area.SafeAreaView,\n initialMetrics: import_safe_area.initialWindowMetrics,\n useFrame: import_safe_area.useSafeAreaFrame,\n useInsets: import_safe_area.useSafeAreaInsets\n});\nvar UI = Object.freeze({\n ...import_native.UI,\n SafeArea,\n TextInput: import_native.TextInput,\n useNativeState: import_native.useNativeState\n});\nvar One = Object.freeze({\n get platform() {\n return currentPlatform();\n },\n iOS,\n Android,\n UI\n});\n//# sourceMappingURL=one.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAA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C"}
1
+ {"version":3,"file":"one.native.js","names":[],"sources":["cjs/one.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar one_exports = {};\n__export(one_exports, {\n One: () => One\n});\nmodule.exports = __toCommonJS(one_exports);\nvar import_native = require(\"@vxrn/native\");\nvar import_safe_area = require(\"@vxrn/safe-area\");\nfunction currentPlatform() {\n var _Reflect_get;\n var defined = (_Reflect_get = Reflect.get(globalThis, \"__ONE_PLATFORM__\")) !== null && _Reflect_get !== void 0 ? _Reflect_get : typeof process !== \"undefined\" ? process.env.ONE_PLATFORM : void 0;\n return defined === \"ios\" || defined === \"android\" || defined === \"rnx\" ? defined : \"web\";\n}\nvar iOS = Object.freeze({\n ...import_native.Swift,\n Color: import_native.Color.ios,\n MenuAction: import_native.MenuAction,\n SplitView: import_native.SplitView,\n ToolbarHost: import_native.ToolbarHost,\n ToolbarItem: import_native.ToolbarItem,\n ZoomTransitionAlignmentRectDetector: import_native.ZoomTransitionAlignmentRectDetector,\n ZoomTransitionEnabler: import_native.ZoomTransitionEnabler,\n ZoomTransitionSource: import_native.ZoomTransitionSource\n});\nvar Android = Object.freeze({\n ...import_native.Compose\n});\nvar SafeArea = Object.freeze({\n Provider: import_safe_area.SafeAreaProvider,\n View: import_safe_area.SafeAreaView,\n initialMetrics: import_safe_area.initialWindowMetrics,\n useFrame: import_safe_area.useSafeAreaFrame,\n useInsets: import_safe_area.useSafeAreaInsets\n});\nvar UI = Object.freeze({\n ...import_native.UI,\n SafeArea,\n TextInput: import_native.TextInput,\n useNativeState: import_native.useNativeState\n});\nvar One = Object.freeze({\n get platform() {\n return currentPlatform();\n },\n iOS,\n Android,\n UI,\n Clipboard: import_native.Clipboard,\n Network: import_native.Network,\n Browser: import_native.Browser,\n useNetworkState: import_native.useNetworkState\n});\n//# sourceMappingURL=one.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,cAAc,CAAC;AACnB,SAAS,aAAa,EACpB,WAAW,IACb,CAAC;AACD,OAAO,UAAU,aAAa,WAAW;AACzC,IAAI,gBAAgB,QAAQ,cAAc;AAC1C,IAAI,mBAAmB,QAAQ,iBAAiB;AAChD,SAAS,kBAAkB;CACzB,IAAI;CACJ,IAAI,WAAW,eAAe,QAAQ,IAAI,YAAY,kBAAkB,OAAO,QAAQ,iBAAiB,KAAK,IAAI,eAAe,OAAO,YAAY,cAAc,QAAQ,IAAI,eAAe,KAAK;CACjM,OAAO,YAAY,SAAS,YAAY,aAAa,YAAY,QAAQ,UAAU;AACrF;AACA,IAAI,MAAM,OAAO,OAAO;CACtB,GAAG,cAAc;CACjB,OAAO,cAAc,MAAM;CAC3B,YAAY,cAAc;CAC1B,WAAW,cAAc;CACzB,aAAa,cAAc;CAC3B,aAAa,cAAc;CAC3B,qCAAqC,cAAc;CACnD,uBAAuB,cAAc;CACrC,sBAAsB,cAAc;AACtC,CAAC;AACD,IAAI,UAAU,OAAO,OAAO,EAC1B,GAAG,cAAc,QACnB,CAAC;AACD,IAAI,WAAW,OAAO,OAAO;CAC3B,UAAU,iBAAiB;CAC3B,MAAM,iBAAiB;CACvB,gBAAgB,iBAAiB;CACjC,UAAU,iBAAiB;CAC3B,WAAW,iBAAiB;AAC9B,CAAC;AACD,IAAI,KAAK,OAAO,OAAO;CACrB,GAAG,cAAc;CACjB;CACA,WAAW,cAAc;CACzB,gBAAgB,cAAc;AAChC,CAAC;AACD,IAAI,MAAM,OAAO,OAAO;CACtB,IAAI,WAAW;EACb,OAAO,gBAAgB;CACzB;CACA;CACA;CACA;CACA,WAAW,cAAc;CACzB,SAAS,cAAc;CACvB,SAAS,cAAc;CACvB,iBAAiB,cAAc;AACjC,CAAC"}
@@ -21,14 +21,24 @@ function oneBabelPreset(api, options = {}) {
21
21
  api.cache(true);
22
22
  }
23
23
  const projectRoot = path.resolve(options.projectRoot ?? (typeof api?.cwd === "function" ? api.cwd() : process.cwd()));
24
- return { plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
25
- projectRoot,
26
- relativeRouterRoot: options.routerRoot ?? "app",
27
- ignoredRouteFiles: options.ignoredRouteFiles,
28
- linking: options.linking,
29
- setupFile: options.setupFile,
30
- includeImportMetaEnv: options.includeImportMetaEnv
31
- }) };
24
+ const require2 = createRequire(projectRoot + "/");
25
+ let reactNativePresetPath;
26
+ try {
27
+ reactNativePresetPath = require2.resolve("@react-native/babel-preset");
28
+ } catch {
29
+ throw new Error(`[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`);
30
+ }
31
+ return {
32
+ presets: [require2(reactNativePresetPath)],
33
+ plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({
34
+ projectRoot,
35
+ relativeRouterRoot: options.routerRoot ?? "app",
36
+ ignoredRouteFiles: options.ignoredRouteFiles,
37
+ linking: options.linking,
38
+ setupFile: options.setupFile,
39
+ includeImportMetaEnv: options.includeImportMetaEnv
40
+ })
41
+ };
32
42
  }
33
43
  function buildOneBabelPlugins({ projectRoot, relativeRouterRoot, ignoredRouteFiles, linking, setupFile, includeImportMetaEnv = true }) {
34
44
  const tsconfig = tsconfigPaths.loadConfig(projectRoot);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["esm/babel-preset/index.js"],"sourcesContent":["import path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport mm from \"micromatch\";\nimport tsconfigPaths from \"tsconfig-paths\";\nimport { pickOnePublicEnv } from \"../native/env\";\nimport {\n API_ROUTE_GLOB_PATTERN,\n ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS\n} from \"../router/glob-patterns\";\nfunction toPosixRelativePath(relativePath) {\n return path.sep === \"\\\\\" ? relativePath.replace(/\\\\/g, \"/\") : relativePath;\n}\nfunction oneBabelPreset(api, options = {}) {\n const hasViteInjectedOnePlugins = typeof api?.caller === \"function\" ? api.caller((caller) => !!caller?.oneViteMetroBabelConfig) : false;\n const isVxrnCompiler = typeof api?.caller === \"function\" ? api.caller((caller) => caller?.name === \"vxrn\") : false;\n if (isVxrnCompiler) {\n return { presets: [], plugins: [] };\n }\n if (!api?.caller && typeof api?.cache === \"function\") {\n api.cache(true);\n }\n const projectRoot = path.resolve(\n options.projectRoot ?? (typeof api?.cwd === \"function\" ? api.cwd() : process.cwd())\n );\n return {\n plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot: options.routerRoot ?? \"app\",\n ignoredRouteFiles: options.ignoredRouteFiles,\n linking: options.linking,\n setupFile: options.setupFile,\n includeImportMetaEnv: options.includeImportMetaEnv\n })\n };\n}\nfunction buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot,\n ignoredRouteFiles,\n linking,\n setupFile,\n includeImportMetaEnv = true\n}) {\n const tsconfig = tsconfigPaths.loadConfig(projectRoot);\n if (tsconfig.resultType === \"failed\") {\n throw new Error(\"[one/babel-preset] tsconfig.json paths could not be loaded\");\n }\n const require2 = createRequire(projectRoot + \"/\");\n const metroEntryPath = require2.resolve(\"one/metro-entry\", {\n paths: [projectRoot]\n });\n const setupFileRelativeToMetroEntry = (() => {\n if (!setupFile) return void 0;\n const file = typeof setupFile === \"string\" ? setupFile : setupFile.native || setupFile.ios || setupFile.android;\n if (!file) return void 0;\n return toPosixRelativePath(\n path.relative(path.dirname(metroEntryPath), path.join(projectRoot, file))\n );\n })();\n return [\n // standalone Metro CLI needs `import.meta.env.*` /\n // `process.env.*` baked in. The Vite path passes `false` here and injects\n // its own version with the user's `define` env via the server hook.\n ...includeImportMetaEnv ? [\n [\n \"@vxrn/vite-plugin-metro/babel-plugins/import-meta-env-plugin\",\n { env: buildStandaloneImportMetaEnv() }\n ]\n ] : [],\n \"one/babel-plugin-environment-guard\",\n [\"one/babel-plugin-remove-server-code\", { routerRoot: relativeRouterRoot }],\n [\n \"babel-plugin-module-resolver\",\n // \"vite-tsconfig-paths\" for Metro\n {\n alias: Object.fromEntries(\n Object.entries(tsconfig.paths).map(([k, v]) => {\n const key = k.endsWith(\"/*\") ? k.replace(/\\/\\*$/, \"\") : `${k}$`;\n let value = v[0].replace(/\\/\\*$/, \"\");\n if (!value.startsWith(\"./\")) value = `./${value}`;\n return [key, value];\n })\n )\n }\n ],\n [\n \"one/babel-plugin-one-router-metro\",\n {\n // posix-only, becomes the first arg of `require.context()` in `one-router-metro`;\n // backslashes on Windows drift the babel-emitted AST per platform.\n ONE_ROUTER_APP_ROOT_RELATIVE_TO_ENTRY: toPosixRelativePath(\n path.relative(\n path.dirname(metroEntryPath),\n path.join(projectRoot, relativeRouterRoot)\n )\n ),\n ONE_ROUTER_ROOT_FOLDER_NAME: relativeRouterRoot,\n ONE_ROUTER_REQUIRE_CONTEXT_REGEX_STRING: buildRouterRequireContextRegexString(ignoredRouteFiles),\n ONE_ROUTER_LINKING_CONFIG: linking,\n ONE_SETUP_FILE_NATIVE: setupFileRelativeToMetroEntry\n }\n ],\n \"one/babel-plugin-inline-one-server-url\"\n ];\n}\nfunction buildStandaloneImportMetaEnv() {\n const isProduction = process.env.NODE_ENV !== \"development\";\n const expoPlatform = process.env.ONE_PLATFORM === \"ios\" || process.env.ONE_PLATFORM === \"android\" ? process.env.ONE_PLATFORM : process.env.EXPO_OS === \"ios\" || process.env.EXPO_OS === \"android\" ? process.env.EXPO_OS : void 0;\n const env = {\n ...pickOnePublicEnv(process.env),\n MODE: isProduction ? \"production\" : \"development\",\n BASE_URL: \"/\",\n PROD: isProduction,\n DEV: !isProduction,\n SSR: false,\n ONE_PLATFORM: process.env.ONE_PLATFORM ?? \"web\",\n ...expoPlatform ? { EXPO_OS: expoPlatform } : {}\n };\n for (const [key, value] of Object.entries(process.env)) {\n if (key.startsWith(\"ONE_\") || key.startsWith(\"VITE_\")) {\n env[key] = value;\n }\n }\n return env;\n}\nfunction normalizeReSource(source) {\n return source.replace(/\\[\\\\\\\\\\/\\]/g, \"\\\\/\").replace(/\\[\\^\\\\\\\\\\/\\]/g, \"[^/]\");\n}\nfunction buildRouterRequireContextRegexString(ignoredRouteFiles) {\n const excludeRes = [\n ...(ignoredRouteFiles || []).map((pattern) => mm.makeRe(pattern)),\n ...ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS.map((pattern) => mm.makeRe(pattern)),\n mm.makeRe(API_ROUTE_GLOB_PATTERN)\n ];\n const mustStartWith = String.raw`^(?:(?:^|\\/|(?:(?:(?!(?:^|\\/)\\.).)*?)\\/)(?!\\.)(?=.)[^/]*?`;\n const mustEndWith = String.raw`)$`;\n const negatives = excludeRes.map((re, i) => {\n const reSource = normalizeReSource(re.source);\n if (!(reSource.startsWith(mustStartWith) && reSource.endsWith(mustEndWith))) {\n const pattern = ignoredRouteFiles?.[i];\n throw new Error(\n pattern ? `[one/metro] ignoredRouteFile pattern \"${pattern}\" is not supported. We cannot process the corresponding regex \"${reSource}\" for now.` : `Unsupported regex \"${reSource}\" in \"ignoredRouteFiles\".`\n );\n }\n const inner = reSource.slice(\n mustStartWith.length,\n reSource.length - mustEndWith.length\n );\n return String.raw`(?:.*${inner})`;\n });\n return String.raw`^(?:\\.\\/)(?!${negatives.join(\"|\")}$).*\\.tsx?$`;\n}\nexport {\n buildOneBabelPlugins,\n buildRouterRequireContextRegexString,\n oneBabelPreset as default\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;AASA,SAAS,oBAAoB,cAAc;CACzC,OAAO,KAAK,QAAQ,OAAO,aAAa,QAAQ,OAAO,GAAG,IAAI;AAChE;AACA,SAAS,eAAe,KAAK,UAAU,CAAC,GAAG;CACzC,MAAM,4BAA4B,OAAO,KAAK,WAAW,aAAa,IAAI,QAAQ,WAAW,CAAC,CAAC,QAAQ,uBAAuB,IAAI;CAClI,MAAM,iBAAiB,OAAO,KAAK,WAAW,aAAa,IAAI,QAAQ,WAAW,QAAQ,SAAS,MAAM,IAAI;CAC7G,IAAI,gBAAgB;EAClB,OAAO;GAAE,SAAS,CAAC;GAAG,SAAS,CAAC;EAAE;CACpC;CACA,IAAI,CAAC,KAAK,UAAU,OAAO,KAAK,UAAU,YAAY;EACpD,IAAI,MAAM,IAAI;CAChB;CACA,MAAM,cAAc,KAAK,QACvB,QAAQ,gBAAgB,OAAO,KAAK,QAAQ,aAAa,IAAI,IAAI,IAAI,QAAQ,IAAI,EACnF;CACA,O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B,MAAM,YAAY,WAAW,KAAK,IAAI,MAAM;EAC1C,MAAM,WAAW,kBAAkB,GAAG,MAAM;EAC5C,IAAI,EAAE,SAAS,WAAW,aAAa,KAAK,SAAS,SAAS,WAAW,IAAI;GAC3E,MAAM,UAAU,oBAAoB;GACpC,MAAM,IAAI,MACR,UAAU,yCAAyC,QAAQ,iEAAiE,SAAS,cAAc,sBAAsB,SAAS,0BACpL;EACF;EACA,MAAM,QAAQ,SAAS,MACrB,cAAc,QACd,SAAS,SAAS,YAAY,MAChC;EACA,OAAO,OAAO,GAAG,QAAQ,MAAM;CACjC,CAAC;CACD,OAAO,OAAO,GAAG,eAAe,UAAU,KAAK,GAAG,EAAE;AACtD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/babel-preset/index.js"],"sourcesContent":["import path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport mm from \"micromatch\";\nimport tsconfigPaths from \"tsconfig-paths\";\nimport { pickOnePublicEnv } from \"../native/env\";\nimport {\n API_ROUTE_GLOB_PATTERN,\n ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS\n} from \"../router/glob-patterns\";\nfunction toPosixRelativePath(relativePath) {\n return path.sep === \"\\\\\" ? relativePath.replace(/\\\\/g, \"/\") : relativePath;\n}\nfunction oneBabelPreset(api, options = {}) {\n const hasViteInjectedOnePlugins = typeof api?.caller === \"function\" ? api.caller((caller) => !!caller?.oneViteMetroBabelConfig) : false;\n const isVxrnCompiler = typeof api?.caller === \"function\" ? api.caller((caller) => caller?.name === \"vxrn\") : false;\n if (isVxrnCompiler) {\n return { presets: [], plugins: [] };\n }\n if (!api?.caller && typeof api?.cache === \"function\") {\n api.cache(true);\n }\n const projectRoot = path.resolve(\n options.projectRoot ?? (typeof api?.cwd === \"function\" ? api.cwd() : process.cwd())\n );\n const require2 = createRequire(projectRoot + \"/\");\n let reactNativePresetPath;\n try {\n reactNativePresetPath = require2.resolve(\"@react-native/babel-preset\");\n } catch {\n throw new Error(\n `[one/babel-preset] Could not resolve '@react-native/babel-preset' from ${projectRoot}. Install it as a project dependency (it ships with every React Native app template).`\n );\n }\n return {\n presets: [require2(reactNativePresetPath)],\n plugins: hasViteInjectedOnePlugins ? [] : buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot: options.routerRoot ?? \"app\",\n ignoredRouteFiles: options.ignoredRouteFiles,\n linking: options.linking,\n setupFile: options.setupFile,\n includeImportMetaEnv: options.includeImportMetaEnv\n })\n };\n}\nfunction buildOneBabelPlugins({\n projectRoot,\n relativeRouterRoot,\n ignoredRouteFiles,\n linking,\n setupFile,\n includeImportMetaEnv = true\n}) {\n const tsconfig = tsconfigPaths.loadConfig(projectRoot);\n if (tsconfig.resultType === \"failed\") {\n throw new Error(\"[one/babel-preset] tsconfig.json paths could not be loaded\");\n }\n const require2 = createRequire(projectRoot + \"/\");\n const metroEntryPath = require2.resolve(\"one/metro-entry\", {\n paths: [projectRoot]\n });\n const setupFileRelativeToMetroEntry = (() => {\n if (!setupFile) return void 0;\n const file = typeof setupFile === \"string\" ? setupFile : setupFile.native || setupFile.ios || setupFile.android;\n if (!file) return void 0;\n return toPosixRelativePath(\n path.relative(path.dirname(metroEntryPath), path.join(projectRoot, file))\n );\n })();\n return [\n // standalone Metro CLI needs `import.meta.env.*` /\n // `process.env.*` baked in. The Vite path passes `false` here and injects\n // its own version with the user's `define` env via the server hook.\n ...includeImportMetaEnv ? [\n [\n \"@vxrn/vite-plugin-metro/babel-plugins/import-meta-env-plugin\",\n { env: buildStandaloneImportMetaEnv() }\n ]\n ] : [],\n \"one/babel-plugin-environment-guard\",\n [\"one/babel-plugin-remove-server-code\", { routerRoot: relativeRouterRoot }],\n [\n \"babel-plugin-module-resolver\",\n // \"vite-tsconfig-paths\" for Metro\n {\n alias: Object.fromEntries(\n Object.entries(tsconfig.paths).map(([k, v]) => {\n const key = k.endsWith(\"/*\") ? k.replace(/\\/\\*$/, \"\") : `${k}$`;\n let value = v[0].replace(/\\/\\*$/, \"\");\n if (!value.startsWith(\"./\")) value = `./${value}`;\n return [key, value];\n })\n )\n }\n ],\n [\n \"one/babel-plugin-one-router-metro\",\n {\n // posix-only, becomes the first arg of `require.context()` in `one-router-metro`;\n // backslashes on Windows drift the babel-emitted AST per platform.\n ONE_ROUTER_APP_ROOT_RELATIVE_TO_ENTRY: toPosixRelativePath(\n path.relative(\n path.dirname(metroEntryPath),\n path.join(projectRoot, relativeRouterRoot)\n )\n ),\n ONE_ROUTER_ROOT_FOLDER_NAME: relativeRouterRoot,\n ONE_ROUTER_REQUIRE_CONTEXT_REGEX_STRING: buildRouterRequireContextRegexString(ignoredRouteFiles),\n ONE_ROUTER_LINKING_CONFIG: linking,\n ONE_SETUP_FILE_NATIVE: setupFileRelativeToMetroEntry\n }\n ],\n \"one/babel-plugin-inline-one-server-url\"\n ];\n}\nfunction buildStandaloneImportMetaEnv() {\n const isProduction = process.env.NODE_ENV !== \"development\";\n const expoPlatform = process.env.ONE_PLATFORM === \"ios\" || process.env.ONE_PLATFORM === \"android\" ? process.env.ONE_PLATFORM : process.env.EXPO_OS === \"ios\" || process.env.EXPO_OS === \"android\" ? process.env.EXPO_OS : void 0;\n const env = {\n ...pickOnePublicEnv(process.env),\n MODE: isProduction ? \"production\" : \"development\",\n BASE_URL: \"/\",\n PROD: isProduction,\n DEV: !isProduction,\n SSR: false,\n ONE_PLATFORM: process.env.ONE_PLATFORM ?? \"web\",\n ...expoPlatform ? { EXPO_OS: expoPlatform } : {}\n };\n for (const [key, value] of Object.entries(process.env)) {\n if (key.startsWith(\"ONE_\") || key.startsWith(\"VITE_\")) {\n env[key] = value;\n }\n }\n return env;\n}\nfunction normalizeReSource(source) {\n return source.replace(/\\[\\\\\\\\\\/\\]/g, \"\\\\/\").replace(/\\[\\^\\\\\\\\\\/\\]/g, \"[^/]\");\n}\nfunction buildRouterRequireContextRegexString(ignoredRouteFiles) {\n const excludeRes = [\n ...(ignoredRouteFiles || []).map((pattern) => mm.makeRe(pattern)),\n ...ROUTE_NATIVE_EXCLUSION_GLOB_PATTERNS.map((pattern) => mm.makeRe(pattern)),\n mm.makeRe(API_ROUTE_GLOB_PATTERN)\n ];\n const mustStartWith = String.raw`^(?:(?:^|\\/|(?:(?:(?!(?:^|\\/)\\.).)*?)\\/)(?!\\.)(?=.)[^/]*?`;\n const mustEndWith = String.raw`)$`;\n const negatives = excludeRes.map((re, i) => {\n const reSource = normalizeReSource(re.source);\n if (!(reSource.startsWith(mustStartWith) && reSource.endsWith(mustEndWith))) {\n const pattern = ignoredRouteFiles?.[i];\n throw new Error(\n pattern ? `[one/metro] ignoredRouteFile pattern \"${pattern}\" is not supported. We cannot process the corresponding regex \"${reSource}\" for now.` : `Unsupported regex \"${reSource}\" in \"ignoredRouteFiles\".`\n );\n }\n const inner = reSource.slice(\n mustStartWith.length,\n reSource.length - mustEndWith.length\n );\n return String.raw`(?:.*${inner})`;\n });\n return String.raw`^(?:\\.\\/)(?!${negatives.join(\"|\")}$).*\\.tsx?$`;\n}\nexport {\n buildOneBabelPlugins,\n buildRouterRequireContextRegexString,\n oneBabelPreset as default\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;AASA,SAAS,oBAAoB,cAAc;CACzC,OAAO,KAAK,QAAQ,OAAO,aAAa,QAAQ,OAAO,GAAG,IAAI;AAChE;AACA,SAAS,eAAe,KAAK,UAAU,CAAC,GAAG;CACzC,MAAM,4BAA4B,OAAO,KAAK,WAAW,aAAa,IAAI,QAAQ,WAAW,CAAC,CAAC,QAAQ,uBAAuB,IAAI;CAClI,MAAM,iBAAiB,OAAO,KAAK,WAAW,aAAa,IAAI,QAAQ,WAAW,QAAQ,SAAS,MAAM,IAAI;CAC7G,IAAI,gBAAgB;EAClB,OAAO;GAAE,SAAS,CAAC;GAAG,SAAS,CAAC;EAAE;CACpC;CACA,IAAI,CAAC,KAAK,UAAU,OAAO,KAAK,UAAU,YAAY;EACpD,IAAI,MAAM,IAAI;CAChB;CACA,MAAM,cAAc,KAAK,QACvB,QAAQ,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