one 2.14.0 → 2.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/prebuild.cjs +8 -4
- package/dist/cjs/cli/prebuild.native.cjs +8 -4
- package/dist/cjs/cli/prebuild.native.js +8 -4
- package/dist/cjs/cli/prebuild.native.js.map +1 -1
- package/dist/esm/cli/prebuild.mjs +8 -4
- package/dist/esm/cli/prebuild.mjs.map +1 -1
- package/dist/esm/cli/prebuild.native.js +8 -4
- package/dist/esm/cli/prebuild.native.js.map +1 -1
- package/native-core/host/OneHostRuntime.cpp +0 -13
- package/package.json +13 -13
- package/src/cli/prebuild.ts +4 -4
|
@@ -77,7 +77,7 @@ async function run(args) {
|
|
|
77
77
|
app,
|
|
78
78
|
beforeInstall: args.platform === "android" ? void 0 : async () => {
|
|
79
79
|
if (args.platform !== "ios" && !xcrunAvailable()) {
|
|
80
|
-
console.warn("[one]
|
|
80
|
+
console.warn("[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped");
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
await writeIosSdk(root);
|
|
@@ -87,10 +87,14 @@ async function run(args) {
|
|
|
87
87
|
}
|
|
88
88
|
function xcrunAvailable() {
|
|
89
89
|
try {
|
|
90
|
-
(0, import_node_child_process.execFileSync)("xcrun", [
|
|
90
|
+
(0, import_node_child_process.execFileSync)("xcrun", [
|
|
91
|
+
"--sdk",
|
|
92
|
+
"iphonesimulator",
|
|
93
|
+
"--show-sdk-path"
|
|
94
|
+
], { stdio: "ignore" });
|
|
91
95
|
return true;
|
|
92
|
-
} catch
|
|
93
|
-
return
|
|
96
|
+
} catch {
|
|
97
|
+
return false;
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
const sdkDirectory = typeof __dirname === "string" ? (0, import_node_path.join)(__dirname, "..", "..", "sdk") : (0, import_node_path.join)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "..", "..", "sdk");
|
|
@@ -86,7 +86,7 @@ async function run(args) {
|
|
|
86
86
|
app,
|
|
87
87
|
beforeInstall: args.platform === "android" ? void 0 : async function() {
|
|
88
88
|
if (args.platform !== "ios" && !xcrunAvailable()) {
|
|
89
|
-
console.warn("[one]
|
|
89
|
+
console.warn("[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped");
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
await writeIosSdk(root);
|
|
@@ -96,10 +96,14 @@ async function run(args) {
|
|
|
96
96
|
}
|
|
97
97
|
function xcrunAvailable() {
|
|
98
98
|
try {
|
|
99
|
-
(0, import_child_process.execFileSync)("xcrun", [
|
|
99
|
+
(0, import_child_process.execFileSync)("xcrun", [
|
|
100
|
+
"--sdk",
|
|
101
|
+
"iphonesimulator",
|
|
102
|
+
"--show-sdk-path"
|
|
103
|
+
], { stdio: "ignore" });
|
|
100
104
|
return true;
|
|
101
|
-
} catch (
|
|
102
|
-
return
|
|
105
|
+
} catch (unused) {
|
|
106
|
+
return false;
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
var sdkDirectory = typeof __dirname === "string" ? (0, import_path.join)(__dirname, "..", "..", "sdk") : (0, import_path.join)((0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url)), "..", "..", "sdk");
|
|
@@ -86,7 +86,7 @@ async function run(args) {
|
|
|
86
86
|
app,
|
|
87
87
|
beforeInstall: args.platform === "android" ? void 0 : async function() {
|
|
88
88
|
if (args.platform !== "ios" && !xcrunAvailable()) {
|
|
89
|
-
console.warn("[one]
|
|
89
|
+
console.warn("[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped");
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
await writeIosSdk(root);
|
|
@@ -96,10 +96,14 @@ async function run(args) {
|
|
|
96
96
|
}
|
|
97
97
|
function xcrunAvailable() {
|
|
98
98
|
try {
|
|
99
|
-
(0, import_child_process.execFileSync)("xcrun", [
|
|
99
|
+
(0, import_child_process.execFileSync)("xcrun", [
|
|
100
|
+
"--sdk",
|
|
101
|
+
"iphonesimulator",
|
|
102
|
+
"--show-sdk-path"
|
|
103
|
+
], { stdio: "ignore" });
|
|
100
104
|
return true;
|
|
101
|
-
} catch (
|
|
102
|
-
return
|
|
105
|
+
} catch (unused) {
|
|
106
|
+
return false;
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
var sdkDirectory = typeof __dirname === "string" ? (0, import_path.join)(__dirname, "..", "..", "sdk") : (0, import_path.join)((0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url)), "..", "..", "sdk");
|
|
@@ -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_child_process = require(\"child_process\");\nvar import_fs = require(\"fs\");\nvar import_path = require(\"path\");\nvar import_url = require(\"url\");\nvar import_appManifest = require(\"../native/appManifest\");\nvar import_iosLinkSet = require(\"./iosLinkSet\");\nvar import_loadConfig = require(\"../vite/loadConfig\");\nconst import_meta = {};\nvar REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nvar REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n var _packageJson_dependencies, _packageJson_devDependencies;\n var _app_ios, _app_ios1;\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, args.platform);\n if ((((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.backgroundTasks) || ((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.appIntents)) && args.platform !== \"android\") {\n var configured = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.setupFile;\n var setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !(0, import_fs.existsSync)((0, import_path.resolve)(root, setupFile))) {\n var _app_ios2;\n throw new Error(((_app_ios2 = app.ios) === null || _app_ios2 === void 0 ? void 0 : _app_ios2.backgroundTasks) ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\");\n }\n }\n var present = REACT_NATIVE_CONFIG_NAMES.filter(function(name) {\n return (0, import_fs.existsSync)((0, import_path.join)(root, name));\n });\n if (present.length === 0) {\n (0, import_fs.writeFileSync)((0, import_path.join)(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(function(name) {\n return (0, import_fs.readFileSync)((0, import_path.join)(root, name), \"utf8\").includes(\"one/react-native-config\");\n })) {\n throw new Error(`[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`);\n }\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async function() {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one] xcrun is not available, so iOS SDK generation was skipped\");\n return;\n }\n await writeIosSdk(root);\n (0, import_iosLinkSet.writeIosLinkSet)(root);\n }\n });\n}\nfunction xcrunAvailable() {\n try {\n (0, import_child_process.execFileSync)(\"xcrun\", [\n \"--version\"\n ], {\n stdio: \"ignore\"\n });\n return true;\n } catch (error) {\n return !(error instanceof Error && \"code\" in error && error.code === \"ENOENT\");\n }\n}\nvar sdkDirectory = typeof __dirname === \"string\" ? (0, import_path.join)(__dirname, \"..\", \"..\", \"sdk\") : (0, import_path.join)((0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url)), \"..\", \"..\", \"sdk\");\nasync function writeIosSdk(root) {\n var { writeAppSdkPod } = await import((0, import_url.pathToFileURL)((0, import_path.join)(sdkDirectory, \"app.mjs\")).href);\n await writeAppSdkPod(root);\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,k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KAAK,iEAAiE;IAC9E;GACF;GACA,MAAM,YAAY,IAAI;GACtB,CAAC,GAAG,kBAAkB,gBAAe,CAAE,IAAI;EAC7C;CACF,CAAC;AACH;AACA,SAAS,iBAAiB;CACxB,IAAI;EACF,CAAC,GAAG,qBAAqB,aAAY,CAAE,SAAS,CAC9C,WACF,GAAG,EACD,OAAO,SACT,CAAC;EACD,OAAO;CACT,SAAS,OAAO;EACd,OAAO,EAAE,iBAAiB,SAAS,UAAU,SAAS,MAAM,SAAS;CACvE;AACF;AACA,IAAI,eAAe,OAAO,cAAc,YAAY,GAAG,YAAY,KAAI,CAAE,WAAW,MAAM,MAAM,KAAK,KAAK,GAAG,YAAY,KAAI,EAAG,GAAG,YAAY,QAAO,EAAG,GAAG,WAAW,cAAa,CAAE,YAAY,GAAG,CAAC,GAAG,MAAM,MAAM,KAAK;AAC1N,eAAe,YAAY,MAAM;CAC/B,IAAI,EAAE,mBAAmB,MAAM,QAAQ,GAAG,WAAW,cAAa,EAAG,GAAG,YAAY,KAAI,CAAE,cAAc,SAAS,CAAC,CAAC,CAAC;CACpH,MAAM,eAAe,IAAI;AAC3B"}
|
|
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_child_process = require(\"child_process\");\nvar import_fs = require(\"fs\");\nvar import_path = require(\"path\");\nvar import_url = require(\"url\");\nvar import_appManifest = require(\"../native/appManifest\");\nvar import_iosLinkSet = require(\"./iosLinkSet\");\nvar import_loadConfig = require(\"../vite/loadConfig\");\nconst import_meta = {};\nvar REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nvar REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n var _packageJson_dependencies, _packageJson_devDependencies;\n var _app_ios, _app_ios1;\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, args.platform);\n if ((((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.backgroundTasks) || ((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.appIntents)) && args.platform !== \"android\") {\n var configured = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.setupFile;\n var setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !(0, import_fs.existsSync)((0, import_path.resolve)(root, setupFile))) {\n var _app_ios2;\n throw new Error(((_app_ios2 = app.ios) === null || _app_ios2 === void 0 ? void 0 : _app_ios2.backgroundTasks) ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\");\n }\n }\n var present = REACT_NATIVE_CONFIG_NAMES.filter(function(name) {\n return (0, import_fs.existsSync)((0, import_path.join)(root, name));\n });\n if (present.length === 0) {\n (0, import_fs.writeFileSync)((0, import_path.join)(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(function(name) {\n return (0, import_fs.readFileSync)((0, import_path.join)(root, name), \"utf8\").includes(\"one/react-native-config\");\n })) {\n throw new Error(`[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`);\n }\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async function() {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped\");\n return;\n }\n await writeIosSdk(root);\n (0, import_iosLinkSet.writeIosLinkSet)(root);\n }\n });\n}\nfunction xcrunAvailable() {\n try {\n (0, import_child_process.execFileSync)(\"xcrun\", [\n \"--sdk\",\n \"iphonesimulator\",\n \"--show-sdk-path\"\n ], {\n stdio: \"ignore\"\n });\n return true;\n } catch (unused) {\n return false;\n }\n}\nvar sdkDirectory = typeof __dirname === \"string\" ? (0, import_path.join)(__dirname, \"..\", \"..\", \"sdk\") : (0, import_path.join)((0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url)), \"..\", \"..\", \"sdk\");\nasync function writeIosSdk(root) {\n var { writeAppSdkPod } = await import((0, import_url.pathToFileURL)((0, import_path.join)(sdkDirectory, \"app.mjs\")).href);\n await writeAppSdkPod(root);\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,GA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G;EACF,MAAM,IAAI,MAAM,SAAS,QAAQ,KAAK,IAAI,EAAE,kPAAkP;CAChS;CACA,IAAI,EAAE,aAAa,MAAM,OAAO;CAChC,MAAM,SAAS;EACb,MAAM,QAAQ,IAAI;EAClB,GAAG;EACH;EACA,eAAe,KAAK,aAAa,YAAY,KAAK,IAAI,iBAAiB;GACrE,IAAI,KAAK,aAAa,SAAS,CAAC,eAAe,GAAG;IAChD,QAAQ,KAAK,4GAA4G;IACzH;GACF;GACA,MAAM,YAAY,IAAI;GACtB,CAAC,GAAG,kBAAkB,gBAAe,CAAE,IAAI;EAC7C;CACF,CAAC;AACH;AACA,SAAS,iBAAiB;CACxB,IAAI;EACF,CAAC,GAAG,qBAAqB,aAAY,CAAE,SAAS;GAC9C;GACA;GACA;EACF,GAAG,EACD,OAAO,SACT,CAAC;EACD,OAAO;CACT,SAAS,QAAQ;EACf,OAAO;CACT;AACF;AACA,IAAI,eAAe,OAAO,cAAc,YAAY,GAAG,YAAY,KAAI,CAAE,WAAW,MAAM,MAAM,KAAK,KAAK,GAAG,YAAY,KAAI,EAAG,GAAG,YAAY,QAAO,EAAG,GAAG,WAAW,cAAa,CAAE,YAAY,GAAG,CAAC,GAAG,MAAM,MAAM,KAAK;AAC1N,eAAe,YAAY,MAAM;CAC/B,IAAI,EAAE,mBAAmB,MAAM,QAAQ,GAAG,WAAW,cAAa,EAAG,GAAG,YAAY,KAAI,CAAE,cAAc,SAAS,CAAC,CAAC,CAAC;CACpH,MAAM,eAAe,IAAI;AAC3B"}
|
|
@@ -48,7 +48,7 @@ async function run(args) {
|
|
|
48
48
|
app,
|
|
49
49
|
beforeInstall: args.platform === "android" ? void 0 : async () => {
|
|
50
50
|
if (args.platform !== "ios" && !xcrunAvailable()) {
|
|
51
|
-
console.warn("[one]
|
|
51
|
+
console.warn("[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
await writeIosSdk(root);
|
|
@@ -58,10 +58,14 @@ async function run(args) {
|
|
|
58
58
|
}
|
|
59
59
|
function xcrunAvailable() {
|
|
60
60
|
try {
|
|
61
|
-
execFileSync("xcrun", [
|
|
61
|
+
execFileSync("xcrun", [
|
|
62
|
+
"--sdk",
|
|
63
|
+
"iphonesimulator",
|
|
64
|
+
"--show-sdk-path"
|
|
65
|
+
], { stdio: "ignore" });
|
|
62
66
|
return true;
|
|
63
|
-
} catch
|
|
64
|
-
return
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
const sdkDirectory = typeof __dirname === "string" ? join(__dirname, "..", "..", "sdk") : join(dirname(fileURLToPath(import.meta.url)), "..", "..", "sdk");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","names":[],"sources":["esm/cli/prebuild.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { validateNativeApp } from \"../native/appManifest\";\nimport { writeIosLinkSet } from \"./iosLinkSet\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nconst REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nconst REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n const root = process.cwd();\n const packageJson = JSON.parse(readFileSync(join(root, \"package.json\"), \"utf8\"));\n const hasExpo = Object.hasOwn(packageJson.dependencies ?? {}, \"expo\") || Object.hasOwn(packageJson.devDependencies ?? {}, \"expo\");\n if (hasExpo) {\n throw new Error(\n '[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 }\n const { oneOptions } = await loadUserOneOptions(\"build\", true);\n const native = oneOptions?.native;\n const app = typeof native === \"object\" ? native.app : void 0;\n if (!app) {\n throw new Error(\n \"[one] native.app is required: configure one({ native: { app } }) with name, ios.bundleId, and android.applicationId\"\n );\n }\n validateNativeApp(app, args.platform);\n if ((app.ios?.backgroundTasks || app.ios?.appIntents) && args.platform !== \"android\") {\n const configured = oneOptions?.setupFile;\n const setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !existsSync(resolve(root, setupFile))) {\n throw new Error(\n app.ios?.backgroundTasks ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\"\n );\n }\n }\n const present = REACT_NATIVE_CONFIG_NAMES.filter((name) => existsSync(join(root, name)));\n if (present.length === 0) {\n writeFileSync(join(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(\n (name) => readFileSync(join(root, name), \"utf8\").includes(\"one/react-native-config\")\n )) {\n throw new Error(\n `[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`\n );\n }\n const { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async () => {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one]
|
|
1
|
+
{"version":3,"file":"prebuild.js","names":[],"sources":["esm/cli/prebuild.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { validateNativeApp } from \"../native/appManifest\";\nimport { writeIosLinkSet } from \"./iosLinkSet\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nconst REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nconst REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n const root = process.cwd();\n const packageJson = JSON.parse(readFileSync(join(root, \"package.json\"), \"utf8\"));\n const hasExpo = Object.hasOwn(packageJson.dependencies ?? {}, \"expo\") || Object.hasOwn(packageJson.devDependencies ?? {}, \"expo\");\n if (hasExpo) {\n throw new Error(\n '[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 }\n const { oneOptions } = await loadUserOneOptions(\"build\", true);\n const native = oneOptions?.native;\n const app = typeof native === \"object\" ? native.app : void 0;\n if (!app) {\n throw new Error(\n \"[one] native.app is required: configure one({ native: { app } }) with name, ios.bundleId, and android.applicationId\"\n );\n }\n validateNativeApp(app, args.platform);\n if ((app.ios?.backgroundTasks || app.ios?.appIntents) && args.platform !== \"android\") {\n const configured = oneOptions?.setupFile;\n const setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !existsSync(resolve(root, setupFile))) {\n throw new Error(\n app.ios?.backgroundTasks ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\"\n );\n }\n }\n const present = REACT_NATIVE_CONFIG_NAMES.filter((name) => existsSync(join(root, name)));\n if (present.length === 0) {\n writeFileSync(join(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(\n (name) => readFileSync(join(root, name), \"utf8\").includes(\"one/react-native-config\")\n )) {\n throw new Error(\n `[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`\n );\n }\n const { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async () => {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped\");\n return;\n }\n await writeIosSdk(root);\n writeIosLinkSet(root);\n }\n });\n}\nfunction xcrunAvailable() {\n try {\n execFileSync(\"xcrun\", [\"--sdk\", \"iphonesimulator\", \"--show-sdk-path\"], { stdio: \"ignore\" });\n return true;\n } catch {\n return false;\n }\n}\nconst sdkDirectory = typeof __dirname === \"string\" ? join(__dirname, \"..\", \"..\", \"sdk\") : join(dirname(fileURLToPath(import.meta.url)), \"..\", \"..\", \"sdk\");\nasync function writeIosSdk(root) {\n const { writeAppSdkPod } = await import(pathToFileURL(join(sdkDirectory, \"app.mjs\")).href);\n await writeAppSdkPod(root);\n}\nexport {\n run\n};\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,sBAAsB;;AAE5B,MAAM,4BAA4B;CAChC;CACA;CACA;CACA;AACF;AACA,eAAe,IAAI,MAAM;CACvB,MAAM,OAAO,QAAQ,IAAI;CACzB,MAAM,cAAc,KAAK,MAAM,aAAa,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;CAC/E,MAAM,UAAU,OAAO,OAAO,YAAY,gBAAgB,CAAC,GAAG,MAAM,KAAK,OAAO,OAAO,YAAY,mBAAmB,CAAC,GAAG,MAAM;CAChI,IAAI,SAAS;EACX,MAAM,IAAI,MACR,mJACF;CACF;CACA,MAAM,EAAE,eAAe,MAAM,mBAAmB,SAAS,IAAI;CAC7D,MAAM,SAAS,YAAY;CAC3B,MAAM,MAAM,OAAO,WAAW,WAAW,OAAO,MAAM,KAAK;CAC3D,IAAI,CAAC,KAAK;EACR,MAAM,IAAI,MACR,qHACF;CACF;CACA,kBAAkB,KAA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AAG,CAAC,GAAG,MAAM,MAAM,KAAK;AACzJ,eAAe,YAAY,MAAM;CAC/B,MAAM,EAAE,mBAAmB,MAAM,OAAO,cAAc,KAAK,cAAc,SAAS,CAAC,CAAC,CAAC;CACrF,MAAM,eAAe,IAAI;AAC3B"}
|
|
@@ -55,7 +55,7 @@ async function run(args) {
|
|
|
55
55
|
app,
|
|
56
56
|
beforeInstall: args.platform === "android" ? void 0 : async function() {
|
|
57
57
|
if (args.platform !== "ios" && !xcrunAvailable()) {
|
|
58
|
-
console.warn("[one]
|
|
58
|
+
console.warn("[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped");
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
await writeIosSdk(root);
|
|
@@ -65,10 +65,14 @@ async function run(args) {
|
|
|
65
65
|
}
|
|
66
66
|
function xcrunAvailable() {
|
|
67
67
|
try {
|
|
68
|
-
execFileSync("xcrun", [
|
|
68
|
+
execFileSync("xcrun", [
|
|
69
|
+
"--sdk",
|
|
70
|
+
"iphonesimulator",
|
|
71
|
+
"--show-sdk-path"
|
|
72
|
+
], { stdio: "ignore" });
|
|
69
73
|
return true;
|
|
70
|
-
} catch (
|
|
71
|
-
return
|
|
74
|
+
} catch (unused) {
|
|
75
|
+
return false;
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
var sdkDirectory = typeof __dirname === "string" ? join(__dirname, "..", "..", "sdk") : join(dirname(fileURLToPath(import.meta.url)), "..", "..", "sdk");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.native.js","names":[],"sources":["esm/cli/prebuild.native.js"],"sourcesContent":["import { execFileSync } from \"child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\nimport { validateNativeApp } from \"../native/appManifest\";\nimport { writeIosLinkSet } from \"./iosLinkSet\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nvar REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nvar REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n var _packageJson_dependencies, _packageJson_devDependencies;\n var _app_ios, _app_ios1;\n var root = process.cwd();\n var packageJson = JSON.parse(readFileSync(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 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 validateNativeApp(app, args.platform);\n if ((((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.backgroundTasks) || ((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.appIntents)) && args.platform !== \"android\") {\n var configured = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.setupFile;\n var setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !existsSync(resolve(root, setupFile))) {\n var _app_ios2;\n throw new Error(((_app_ios2 = app.ios) === null || _app_ios2 === void 0 ? void 0 : _app_ios2.backgroundTasks) ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\");\n }\n }\n var present = REACT_NATIVE_CONFIG_NAMES.filter(function(name) {\n return existsSync(join(root, name));\n });\n if (present.length === 0) {\n writeFileSync(join(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(function(name) {\n return readFileSync(join(root, name), \"utf8\").includes(\"one/react-native-config\");\n })) {\n throw new Error(`[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`);\n }\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async function() {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one]
|
|
1
|
+
{"version":3,"file":"prebuild.native.js","names":[],"sources":["esm/cli/prebuild.native.js"],"sourcesContent":["import { execFileSync } from \"child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\nimport { validateNativeApp } from \"../native/appManifest\";\nimport { writeIosLinkSet } from \"./iosLinkSet\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nvar REACT_NATIVE_CONFIG = `module.exports = require('one/react-native-config')\n`;\nvar REACT_NATIVE_CONFIG_NAMES = [\n \"react-native.config.js\",\n \"react-native.config.cjs\",\n \"react-native.config.mjs\",\n \"react-native.config.ts\"\n];\nasync function run(args) {\n var _packageJson_dependencies, _packageJson_devDependencies;\n var _app_ios, _app_ios1;\n var root = process.cwd();\n var packageJson = JSON.parse(readFileSync(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 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 validateNativeApp(app, args.platform);\n if ((((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.backgroundTasks) || ((_app_ios1 = app.ios) === null || _app_ios1 === void 0 ? void 0 : _app_ios1.appIntents)) && args.platform !== \"android\") {\n var configured = oneOptions === null || oneOptions === void 0 ? void 0 : oneOptions.setupFile;\n var setupFile = typeof configured === \"string\" ? configured : configured && \"native\" in configured ? configured.native : configured && \"ios\" in configured ? configured.ios : void 0;\n if (!setupFile || !existsSync(resolve(root, setupFile))) {\n var _app_ios2;\n throw new Error(((_app_ios2 = app.ios) === null || _app_ios2 === void 0 ? void 0 : _app_ios2.backgroundTasks) ? \"[one] native.app.ios.backgroundTasks requires an existing iOS native setupFile that defines every task handler before the app renders\" : \"[one] native.app.ios.appIntents requires an existing iOS native setupFile that defines every action handler before the app renders\");\n }\n }\n var present = REACT_NATIVE_CONFIG_NAMES.filter(function(name) {\n return existsSync(join(root, name));\n });\n if (present.length === 0) {\n writeFileSync(join(root, \"react-native.config.cjs\"), REACT_NATIVE_CONFIG);\n } else if (!present.some(function(name) {\n return readFileSync(join(root, name), \"utf8\").includes(\"one/react-native-config\");\n })) {\n throw new Error(`[one] ${present.join(\", \")} does not load one/react-native-config, so Release builds would run the stock React Native bundler instead of One's. Set it to \\`module.exports = require('one/react-native-config')\\` or spread that into your config, then re-run one prebuild.`);\n }\n var { prebuild } = await import(\"vxrn\");\n await prebuild({\n root: process.cwd(),\n ...args,\n app,\n beforeInstall: args.platform === \"android\" ? void 0 : async function() {\n if (args.platform !== \"ios\" && !xcrunAvailable()) {\n console.warn(\"[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped\");\n return;\n }\n await writeIosSdk(root);\n writeIosLinkSet(root);\n }\n });\n}\nfunction xcrunAvailable() {\n try {\n execFileSync(\"xcrun\", [\n \"--sdk\",\n \"iphonesimulator\",\n \"--show-sdk-path\"\n ], {\n stdio: \"ignore\"\n });\n return true;\n } catch (unused) {\n return false;\n }\n}\nvar sdkDirectory = typeof __dirname === \"string\" ? join(__dirname, \"..\", \"..\", \"sdk\") : join(dirname(fileURLToPath(import.meta.url)), \"..\", \"..\", \"sdk\");\nasync function writeIosSdk(root) {\n var { writeAppSdkPod } = await import(pathToFileURL(join(sdkDirectory, \"app.mjs\")).href);\n await writeAppSdkPod(root);\n}\nexport {\n run\n};\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,sBAAsB;;AAE1B,IAAI,4BAA4B;CAC9B;CACA;CACA;CACA;AACF;AACA,eAAe,IAAI,MAAM;CACvB,IAAI,2BAA2B;CAC/B,IAAI,UAAU;CACd,IAAI,OAAO,QAAQ,IAAI;CACvB,IAAI,cAAc,KAAK,MAAM,aAAa,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;CAC7E,IAAI,UAAU,OAAO,QAAQ,4BAA4B,YAAY,kBAAkB,QAAQ,8BAA8B,KAAK,IAAI,4BAA4B,CAAC,GAAG,MAAM,KAAK,OAAO,QAAQ,+BAA+B,YAAY,qBAAqB,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B,CAAC,GAAG,MAAM;CAC3V,IAAI,SAAS;EACX,MAAM,IAAI,MAAM,mJAAiJ;CACnK;CACA,IAAI,EAAE,eAAe,MAAM,mBAAmB,SAAS,IAAI;CAC3D,IAAI,SAAS,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW;CAChF,IAAI,MA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AAa,SAAS,CAAC,eAAe,GAAG;IAChD,QAAQ,KAAK,4GAA4G;IACzH;GACF;GACA,MAAM,YAAY,IAAI;GACtB,gBAAgB,IAAI;EACtB;CACF,CAAC;AACH;AACA,SAAS,iBAAiB;CACxB,IAAI;EACF,aAAa,SAAS;GACpB;GACA;GACA;EACF,GAAG,EACD,OAAO,SACT,CAAC;EACD,OAAO;CACT,SAAS,QAAQ;EACf,OAAO;CACT;AACF;AACA,IAAI,eAAe,OAAO,cAAc,WAAW,KAAK,WAAW,MAAM,MAAM,KAAK,IAAI,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,MAAM,MAAM,KAAK;AACvJ,eAAe,YAAY,MAAM;CAC/B,IAAI,EAAE,mBAAmB,MAAM,OAAO,cAAc,KAAK,cAAc,SAAS,CAAC,CAAC,CAAC;CACnF,MAAM,eAAe,IAAI;AAC3B"}
|
|
@@ -135,19 +135,6 @@ void OneHostRuntime::initializeRuntime()
|
|
|
135
135
|
return module;
|
|
136
136
|
});
|
|
137
137
|
bindNativeLogger(runtime, logJsMessage);
|
|
138
|
-
// hermes has no console of its own, so route it through the native logger
|
|
139
|
-
// before the bundle's own empty console stubs can claim the names
|
|
140
|
-
runtime.evaluateJavaScript(
|
|
141
|
-
std::make_shared<jsi::StringBuffer>(
|
|
142
|
-
"globalThis.console = {};"
|
|
143
|
-
"['log', 'info', 'warn', 'error', 'debug', 'trace'].forEach(function (name, level) {"
|
|
144
|
-
" console[name] = function () {"
|
|
145
|
-
" nativeLoggingHook(Array.prototype.map.call(arguments, function (value) {"
|
|
146
|
-
" return typeof value === 'string' ? value : (value && value.stack) || String(value);"
|
|
147
|
-
" }).join(' '), level);"
|
|
148
|
-
" };"
|
|
149
|
-
"});"),
|
|
150
|
-
"one-host-console");
|
|
151
138
|
auto provider = hasComponentProvider;
|
|
152
139
|
bindHasComponentProvider(runtime, std::move(provider));
|
|
153
140
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.2",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -282,15 +282,15 @@
|
|
|
282
282
|
"@react-navigation/routers": "8.0.0-alpha.21",
|
|
283
283
|
"@rozenite/middleware": "^2.5.0",
|
|
284
284
|
"@ungap/structured-clone": "^1.2.0",
|
|
285
|
-
"@vxrn/color-scheme": "2.14.
|
|
286
|
-
"@vxrn/compiler": "2.14.
|
|
287
|
-
"@vxrn/resolve": "2.14.
|
|
288
|
-
"@vxrn/tslib-lite": "2.14.
|
|
289
|
-
"@vxrn/use-isomorphic-layout-effect": "2.14.
|
|
290
|
-
"@vxrn/utils": "2.14.
|
|
285
|
+
"@vxrn/color-scheme": "2.14.2",
|
|
286
|
+
"@vxrn/compiler": "2.14.2",
|
|
287
|
+
"@vxrn/resolve": "2.14.2",
|
|
288
|
+
"@vxrn/tslib-lite": "2.14.2",
|
|
289
|
+
"@vxrn/use-isomorphic-layout-effect": "2.14.2",
|
|
290
|
+
"@vxrn/utils": "2.14.2",
|
|
291
291
|
"citty": "^0.1.6",
|
|
292
292
|
"core-js": "^3.38.1",
|
|
293
|
-
"create-vxrn": "2.14.
|
|
293
|
+
"create-vxrn": "2.14.2",
|
|
294
294
|
"escape-string-regexp": "^5.0.0",
|
|
295
295
|
"fast-deep-equal": "^3.1.3",
|
|
296
296
|
"fast-glob": "^3.3.3",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"tsconfig-paths": "^4",
|
|
313
313
|
"use-latest-callback": "^0.3.5",
|
|
314
314
|
"vite": "^8.2.2",
|
|
315
|
-
"vxrn": "2.14.
|
|
315
|
+
"vxrn": "2.14.2",
|
|
316
316
|
"web-streams-polyfill": "^4.3.0",
|
|
317
317
|
"ws": "^8.21.0",
|
|
318
318
|
"xxhashjs": "^0.2.2"
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
"@babel/types": "^7.28.5",
|
|
343
343
|
"babel-dead-code-elimination": "1.0.10",
|
|
344
344
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
345
|
-
"@vxrn/vite-plugin-metro": "2.14.
|
|
345
|
+
"@vxrn/vite-plugin-metro": "2.14.2"
|
|
346
346
|
},
|
|
347
347
|
"peerDependenciesMeta": {
|
|
348
348
|
"@react-native/babel-preset": {
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
"@types/react-dom": "^19.3.0",
|
|
417
417
|
"@types/react-test-renderer": "^19.1.0",
|
|
418
418
|
"@types/xxhashjs": "^0.2.4",
|
|
419
|
-
"@vxrn/emitter": "2.14.
|
|
419
|
+
"@vxrn/emitter": "2.14.2",
|
|
420
420
|
"depcheck": "^1.4.7",
|
|
421
421
|
"esbuild": "^0.25.12",
|
|
422
422
|
"immer": "^10.1.1",
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
"@babel/types": "^7.28.5",
|
|
445
445
|
"babel-dead-code-elimination": "1.0.10",
|
|
446
446
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
447
|
-
"@vxrn/vite-plugin-metro": "2.14.
|
|
447
|
+
"@vxrn/vite-plugin-metro": "2.14.2"
|
|
448
448
|
},
|
|
449
449
|
"publishConfig": {
|
|
450
450
|
"access": "public"
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
},
|
|
615
|
-
"releaseSourceCommit": "
|
|
615
|
+
"releaseSourceCommit": "16175b9a93e540cad20b5a9c625a904f923e4ddd",
|
|
616
616
|
"repository": {
|
|
617
617
|
"type": "git",
|
|
618
618
|
"url": "git+https://github.com/onejs/one.git",
|
package/src/cli/prebuild.ts
CHANGED
|
@@ -85,7 +85,7 @@ export async function run(args: { platform?: string; 'no-install'?: boolean }) {
|
|
|
85
85
|
// vxrn patches android after this returns. skip ios when xcrun is
|
|
86
86
|
// absent and the command was not limited to ios, so android still finishes.
|
|
87
87
|
if (args.platform !== 'ios' && !xcrunAvailable()) {
|
|
88
|
-
console.warn('[one]
|
|
88
|
+
console.warn('[one] the iOS SDK is not available (xcrun found no iphonesimulator SDK), so iOS SDK generation was skipped')
|
|
89
89
|
return
|
|
90
90
|
}
|
|
91
91
|
await writeIosSdk(root)
|
|
@@ -96,10 +96,10 @@ export async function run(args: { platform?: string; 'no-install'?: boolean }) {
|
|
|
96
96
|
|
|
97
97
|
function xcrunAvailable() {
|
|
98
98
|
try {
|
|
99
|
-
execFileSync('xcrun', ['--
|
|
99
|
+
execFileSync('xcrun', ['--sdk', 'iphonesimulator', '--show-sdk-path'], { stdio: 'ignore' })
|
|
100
100
|
return true
|
|
101
|
-
} catch
|
|
102
|
-
return
|
|
101
|
+
} catch {
|
|
102
|
+
return false
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|