vxrn 2.0.0-beta.123.1 → 2.0.0-beta.127.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.
- package/dist/config/getBaseViteConfigOnly.mjs +3 -3
- package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js +3 -3
- package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +30 -16
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +58 -27
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/expo-plugin.cjs +32 -0
- package/package.json +10 -10
- package/src/config/getBaseViteConfigOnly.ts +6 -3
- package/src/exports/prebuildWithoutExpo.test.ts +13 -0
- package/src/exports/prebuildWithoutExpo.ts +37 -25
- package/types/config/getBaseViteConfigOnly.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
|
@@ -55,15 +55,15 @@ async function getBaseViteConfig(config) {
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
find: /^(react-native\/asset-registry|@react-native\/assets-registry\/registry)$/,
|
|
58
|
-
replacement:
|
|
58
|
+
replacement: "react-native-web/dist/modules/AssetRegistry"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
find: "react-native/package.json",
|
|
62
|
-
replacement:
|
|
62
|
+
replacement: "react-native-web/package.json"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
find: "react-native",
|
|
66
|
-
replacement:
|
|
66
|
+
replacement: "react-native-web"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
find: "query-string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBaseViteConfigOnly.js","names":[],"sources":["config/getBaseViteConfigOnly.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport { join } from \"node:path\";\nconst dedupe = [\n \"one\",\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-native-web\",\n \"react-native-web-lite\",\n \"@react-navigation/core\",\n \"@react-navigation/native\",\n \"@react-navigation/elements\",\n \"@react-navigation/native-stack\",\n \"@react-navigation/bottom-tabs\",\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"@tamagui/react-native-web\",\n \"@tamagui/react-native-web-lite\",\n \"tamagui\",\n \"react-native-reanimated\",\n \"escape-string-regexp\"\n];\nasync function getBaseViteConfig(config) {\n const { root, mode } = config;\n const postCSSPaths = [\n join(root, \"postcss.config.js\"),\n join(root, \"postcss.config.ts\"),\n join(root, \"postcss.config.json\")\n ];\n const postCSSConfigPath = (await Promise.all(\n postCSSPaths.map(async (x) => {\n if (await FSExtra.pathExists(x)) {\n return x;\n }\n })\n )).find((x) => typeof x === \"string\");\n const reactNativePackageJsonPath = resolvePath(\"react-native/package.json\", root);\n const { version } = await FSExtra.readJSON(reactNativePackageJsonPath);\n return {\n mode,\n // we load the config ourselves\n // if you disable this is disables auto-reloading config changes\n // configFile: false,\n // TODO make this documented / configurable through the plugins\n css: postCSSConfigPath ? {\n postcss: postCSSConfigPath\n } : {\n transformer: \"lightningcss\",\n lightningcss: {\n targets: {\n safari: 15 << 16 | 2 << 8\n }\n }\n },\n define: {\n __DEV__: `${mode === \"development\"}`,\n \"process.env.NODE_ENV\": `\"${mode}\"`,\n \"process.env.REACT_NATIVE_VERSION\": `\"${version}\"`\n },\n resolve: {\n alias: [\n // deep react-native/Libraries/* paths must be caught BEFORE the general\n // react-native → react-native-web alias, since react-native-web doesn't\n // have these native-only subpaths\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", import.meta.dirname)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement:
|
|
1
|
+
{"version":3,"file":"getBaseViteConfigOnly.js","names":[],"sources":["config/getBaseViteConfigOnly.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport { join } from \"node:path\";\nconst dedupe = [\n \"one\",\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-native-web\",\n \"react-native-web-lite\",\n \"@react-navigation/core\",\n \"@react-navigation/native\",\n \"@react-navigation/elements\",\n \"@react-navigation/native-stack\",\n \"@react-navigation/bottom-tabs\",\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"@tamagui/react-native-web\",\n \"@tamagui/react-native-web-lite\",\n \"tamagui\",\n \"react-native-reanimated\",\n \"escape-string-regexp\"\n];\nasync function getBaseViteConfig(config) {\n const { root, mode } = config;\n const postCSSPaths = [\n join(root, \"postcss.config.js\"),\n join(root, \"postcss.config.ts\"),\n join(root, \"postcss.config.json\")\n ];\n const postCSSConfigPath = (await Promise.all(\n postCSSPaths.map(async (x) => {\n if (await FSExtra.pathExists(x)) {\n return x;\n }\n })\n )).find((x) => typeof x === \"string\");\n const reactNativePackageJsonPath = resolvePath(\"react-native/package.json\", root);\n const { version } = await FSExtra.readJSON(reactNativePackageJsonPath);\n return {\n mode,\n // we load the config ourselves\n // if you disable this is disables auto-reloading config changes\n // configFile: false,\n // TODO make this documented / configurable through the plugins\n css: postCSSConfigPath ? {\n postcss: postCSSConfigPath\n } : {\n transformer: \"lightningcss\",\n lightningcss: {\n targets: {\n safari: 15 << 16 | 2 << 8\n }\n }\n },\n define: {\n __DEV__: `${mode === \"development\"}`,\n \"process.env.NODE_ENV\": `\"${mode}\"`,\n \"process.env.REACT_NATIVE_VERSION\": `\"${version}\"`\n },\n resolve: {\n alias: [\n // deep react-native/Libraries/* paths must be caught BEFORE the general\n // react-native → react-native-web alias, since react-native-web doesn't\n // have these native-only subpaths\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", import.meta.dirname)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement: \"react-native-web/dist/modules/AssetRegistry\"\n },\n {\n find: \"react-native/package.json\",\n replacement: \"react-native-web/package.json\"\n },\n // named by package so it resolves (from the root, through dedupe) only\n // once something imports react-native: an app with no react-native\n // imports needs no react-native-web.\n {\n find: \"react-native\",\n replacement: \"react-native-web\"\n },\n // bundle size optimizations\n {\n find: \"query-string\",\n replacement: resolvePath(\"@vxrn/query-string\", root)\n },\n {\n find: \"url-parse\",\n replacement: resolvePath(\"@vxrn/url-parse\", root)\n }\n ],\n // TODO auto dedupe all include optimize deps?\n dedupe\n },\n build: {},\n // enable OXC React Refresh so component registration ($RefreshReg$) is\n // injected into TSX/JSX output; the one:react-refresh-web compiler plugin\n // then wraps the output with the runtime preamble and import.meta.hot.accept\n // only enable in dev mode - in production the refresh plugin doesn't run,\n // leaving $RefreshReg$ undefined which crashes client-side JS\n oxc: {\n jsx: {\n refresh: mode === \"development\"\n }\n }\n };\n}\nexport {\n dedupe,\n getBaseViteConfig\n};\n//# sourceMappingURL=getBaseViteConfigOnly.js.map\n"],"mappings":";;;;;AAGA,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,eAAe,kBAAkB,QAAQ;CACvC,MAAM,EAAE,MAAM,SAAS;CACvB,MAAM,eAAe;EACnB,KAAK,MAAM,mBAAmB;EAC9B,KAAK,MAAM,mBAAmB;EAC9B,KAAK,MAAM,qBAAqB;CAClC;CACA,MAAM,qBAAqB,MAAM,QAAQ,IACvC,aAAa,IAAI,OAAO,MAAM;EAC5B,IAAI,MAAM,QAAQ,WAAW,CAAC,GAAG;GAC/B,OAAO;EACT;CACF,CAAC,CACH,EAAC,CAAE,MAAM,MAAM,OAAO,MAAM,QAAQ;CACpC,MAAM,6BAA6B,YAAY,6BAA6B,IAAI;CAChF,MAAM,EAAE,YAAY,MAAM,QAAQ,SAAS,0BAA0B;CACrE,OAAO;EACL;EAKA,KAAK,oBAAoB,EACvB,SAAS,kBACX,IAAI;GACF,aAAa;GACb,cAAc,EACZ,SAAS,EACP,QAAQ,MAAM,KAAK,KAAK,EAC1B,EACF;EACF;EACA,QAAQ;GACN,SAAS,GAAG,SAAS;GACrB,wBAAwB,IAAI,KAAK;GACjC,oCAAoC,IAAI,QAAQ;EAClD;EACA,SAAS;GACP,OAAO;IAIL;KACE,MAAM;KACN,aAAa,YAAY,iCAAiC,YAAY,OAAO;IAC/E;IACA;KAGE,MAAM;KACN,aAAa;IACf;IACA;KACE,MAAM;KACN,aAAa;IACf;IAIA;KACE,MAAM;KACN,aAAa;IACf;IAEA;KACE,MAAM;KACN,aAAa,YAAY,sBAAsB,IAAI;IACrD;IACA;KACE,MAAM;KACN,aAAa,YAAY,mBAAmB,IAAI;IAClD;GACF;GAEA;EACF;EACA,OAAO,CAAC;EAMR,KAAK,EACH,KAAK,EACH,SAAS,SAAS,cACpB,EACF;CACF;AACF"}
|
|
@@ -57,15 +57,15 @@ async function getBaseViteConfig(config) {
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
find: /^(react-native\/asset-registry|@react-native\/assets-registry\/registry)$/,
|
|
60
|
-
replacement:
|
|
60
|
+
replacement: "react-native-web/dist/modules/AssetRegistry"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
find: "react-native/package.json",
|
|
64
|
-
replacement:
|
|
64
|
+
replacement: "react-native-web/package.json"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
find: "react-native",
|
|
68
|
-
replacement:
|
|
68
|
+
replacement: "react-native-web"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
find: "query-string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBaseViteConfigOnly.native.js","names":[],"sources":["config/getBaseViteConfigOnly.native.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport { join } from \"path\";\nvar dedupe = [\n \"one\",\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-native-web\",\n \"react-native-web-lite\",\n \"@react-navigation/core\",\n \"@react-navigation/native\",\n \"@react-navigation/elements\",\n \"@react-navigation/native-stack\",\n \"@react-navigation/bottom-tabs\",\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"@tamagui/react-native-web\",\n \"@tamagui/react-native-web-lite\",\n \"tamagui\",\n \"react-native-reanimated\",\n \"escape-string-regexp\"\n];\nasync function getBaseViteConfig(config) {\n var { root, mode } = config;\n var postCSSPaths = [\n join(root, \"postcss.config.js\"),\n join(root, \"postcss.config.ts\"),\n join(root, \"postcss.config.json\")\n ];\n var postCSSConfigPath = (await Promise.all(postCSSPaths.map(async function(x) {\n if (await FSExtra.pathExists(x)) {\n return x;\n }\n }))).find(function(x) {\n return typeof x === \"string\";\n });\n var reactNativePackageJsonPath = resolvePath(\"react-native/package.json\", root);\n var { version } = await FSExtra.readJSON(reactNativePackageJsonPath);\n return {\n mode,\n // we load the config ourselves\n // if you disable this is disables auto-reloading config changes\n // configFile: false,\n // TODO make this documented / configurable through the plugins\n css: postCSSConfigPath ? {\n postcss: postCSSConfigPath\n } : {\n transformer: \"lightningcss\",\n lightningcss: {\n targets: {\n safari: 15 << 16 | 2 << 8\n }\n }\n },\n define: {\n __DEV__: `${mode === \"development\"}`,\n \"process.env.NODE_ENV\": `\"${mode}\"`,\n \"process.env.REACT_NATIVE_VERSION\": `\"${version}\"`\n },\n resolve: {\n alias: [\n // deep react-native/Libraries/* paths must be caught BEFORE the general\n // react-native → react-native-web alias, since react-native-web doesn't\n // have these native-only subpaths\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", import.meta.dirname)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement:
|
|
1
|
+
{"version":3,"file":"getBaseViteConfigOnly.native.js","names":[],"sources":["config/getBaseViteConfigOnly.native.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport { join } from \"path\";\nvar dedupe = [\n \"one\",\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-native-web\",\n \"react-native-web-lite\",\n \"@react-navigation/core\",\n \"@react-navigation/native\",\n \"@react-navigation/elements\",\n \"@react-navigation/native-stack\",\n \"@react-navigation/bottom-tabs\",\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"@tamagui/react-native-web\",\n \"@tamagui/react-native-web-lite\",\n \"tamagui\",\n \"react-native-reanimated\",\n \"escape-string-regexp\"\n];\nasync function getBaseViteConfig(config) {\n var { root, mode } = config;\n var postCSSPaths = [\n join(root, \"postcss.config.js\"),\n join(root, \"postcss.config.ts\"),\n join(root, \"postcss.config.json\")\n ];\n var postCSSConfigPath = (await Promise.all(postCSSPaths.map(async function(x) {\n if (await FSExtra.pathExists(x)) {\n return x;\n }\n }))).find(function(x) {\n return typeof x === \"string\";\n });\n var reactNativePackageJsonPath = resolvePath(\"react-native/package.json\", root);\n var { version } = await FSExtra.readJSON(reactNativePackageJsonPath);\n return {\n mode,\n // we load the config ourselves\n // if you disable this is disables auto-reloading config changes\n // configFile: false,\n // TODO make this documented / configurable through the plugins\n css: postCSSConfigPath ? {\n postcss: postCSSConfigPath\n } : {\n transformer: \"lightningcss\",\n lightningcss: {\n targets: {\n safari: 15 << 16 | 2 << 8\n }\n }\n },\n define: {\n __DEV__: `${mode === \"development\"}`,\n \"process.env.NODE_ENV\": `\"${mode}\"`,\n \"process.env.REACT_NATIVE_VERSION\": `\"${version}\"`\n },\n resolve: {\n alias: [\n // deep react-native/Libraries/* paths must be caught BEFORE the general\n // react-native → react-native-web alias, since react-native-web doesn't\n // have these native-only subpaths\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", import.meta.dirname)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement: \"react-native-web/dist/modules/AssetRegistry\"\n },\n {\n find: \"react-native/package.json\",\n replacement: \"react-native-web/package.json\"\n },\n // named by package so it resolves (from the root, through dedupe) only\n // once something imports react-native: an app with no react-native\n // imports needs no react-native-web.\n {\n find: \"react-native\",\n replacement: \"react-native-web\"\n },\n // bundle size optimizations\n {\n find: \"query-string\",\n replacement: resolvePath(\"@vxrn/query-string\", root)\n },\n {\n find: \"url-parse\",\n replacement: resolvePath(\"@vxrn/url-parse\", root)\n }\n ],\n // TODO auto dedupe all include optimize deps?\n dedupe\n },\n build: {},\n // enable OXC React Refresh so component registration ($RefreshReg$) is\n // injected into TSX/JSX output; the one:react-refresh-web compiler plugin\n // then wraps the output with the runtime preamble and import.meta.hot.accept\n // only enable in dev mode - in production the refresh plugin doesn't run,\n // leaving $RefreshReg$ undefined which crashes client-side JS\n oxc: {\n jsx: {\n refresh: mode === \"development\"\n }\n }\n };\n}\nexport {\n dedupe,\n getBaseViteConfig\n};\n//# sourceMappingURL=getBaseViteConfigOnly.js.map\n"],"mappings":";;;;;AAGA,IAAI,SAAS;CACX;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,eAAe,kBAAkB,QAAQ;CACvC,IAAI,EAAE,MAAM,SAAS;CACrB,IAAI,eAAe;EACjB,KAAK,MAAM,mBAAmB;EAC9B,KAAK,MAAM,mBAAmB;EAC9B,KAAK,MAAM,qBAAqB;CAClC;CACA,IAAI,qBAAqB,MAAM,QAAQ,IAAI,aAAa,IAAI,eAAe,GAAG;EAC5E,IAAI,MAAM,QAAQ,WAAW,CAAC,GAAG;GAC/B,OAAO;EACT;CACF,CAAC,CAAC,EAAC,CAAE,KAAK,SAAS,GAAG;EACpB,OAAO,OAAO,MAAM;CACtB,CAAC;CACD,IAAI,6BAA6B,YAAY,6BAA6B,IAAI;CAC9E,IAAI,EAAE,YAAY,MAAM,QAAQ,SAAS,0BAA0B;CACnE,OAAO;EACL;EAKA,KAAK,oBAAoB,EACvB,SAAS,kBACX,IAAI;GACF,aAAa;GACb,cAAc,EACZ,SAAS,EACP,QAAQ,MAAM,KAAK,KAAK,EAC1B,EACF;EACF;EACA,QAAQ;GACN,SAAS,GAAG,SAAS;GACrB,wBAAwB,IAAI,KAAK;GACjC,oCAAoC,IAAI,QAAQ;EAClD;EACA,SAAS;GACP,OAAO;IAIL;KACE,MAAM;KACN,aAAa,YAAY,iCAAiC,YAAY,OAAO;IAC/E;IACA;KAGE,MAAM;KACN,aAAa;IACf;IACA;KACE,MAAM;KACN,aAAa;IACf;IAIA;KACE,MAAM;KACN,aAAa;IACf;IAEA;KACE,MAAM;KACN,aAAa,YAAY,sBAAsB,IAAI;IACrD;IACA;KACE,MAAM;KACN,aAAa,YAAY,mBAAmB,IAAI;IAClD;GACF;GAEA;EACF;EACA,OAAO,CAAC;EAMR,KAAK,EACH,KAAK,EACH,SAAS,SAAS,cACpB,EACF;CACF;AACF"}
|
|
@@ -5,7 +5,6 @@ import { pathToFileURL } from "node:url";
|
|
|
5
5
|
import { validateNativeApp } from "@vxrn/utils/nativeAppManifest";
|
|
6
6
|
import FSExtra from "fs-extra";
|
|
7
7
|
import sharp from "sharp";
|
|
8
|
-
import { kotlinSourceId, renderKotlinSourceGlue, swiftPodManifest, writeNativeSourceDeclaration, writeSwiftPackageArtifacts } from "../utils/nativeSourceContract.mjs";
|
|
9
8
|
import { swiftPackageDirectories } from "../utils/swiftPackageId.mjs";
|
|
10
9
|
|
|
11
10
|
const nativeProjectPatches = module.createRequire(import.meta.url)("../../native-project-patches.cjs");
|
|
@@ -1305,6 +1304,14 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
|
|
|
1305
1304
|
if (app.contacts !== void 0) {
|
|
1306
1305
|
usage.set("NSContactsUsageDescription", app.contacts.usage);
|
|
1307
1306
|
}
|
|
1307
|
+
if (app.calendar !== void 0) {
|
|
1308
|
+
if (app.calendar.usage !== void 0) {
|
|
1309
|
+
usage.set("NSCalendarsFullAccessUsageDescription", app.calendar.usage);
|
|
1310
|
+
}
|
|
1311
|
+
if (app.calendar.remindersUsage !== void 0) {
|
|
1312
|
+
usage.set("NSRemindersFullAccessUsageDescription", app.calendar.remindersUsage);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1308
1315
|
if (app.location !== void 0) {
|
|
1309
1316
|
usage.set("NSLocationWhenInUseUsageDescription", app.location.whenInUse);
|
|
1310
1317
|
}
|
|
@@ -1480,16 +1487,16 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
|
|
|
1480
1487
|
});
|
|
1481
1488
|
if (platform === "ios") generateOneBridgingHeader(dest, app);
|
|
1482
1489
|
if (platform === "ios") generateIosWidgets(dest, app);
|
|
1483
|
-
if (platform === "ios") generateSwiftPackages({
|
|
1490
|
+
if (platform === "ios") await generateSwiftPackages({
|
|
1484
1491
|
root,
|
|
1485
1492
|
dest
|
|
1486
1493
|
});
|
|
1487
|
-
if (platform === "android") generateKotlinSources({
|
|
1494
|
+
if (platform === "android") await generateKotlinSources({
|
|
1488
1495
|
root,
|
|
1489
1496
|
dest
|
|
1490
1497
|
});
|
|
1491
1498
|
};
|
|
1492
|
-
function generateKotlinSources({ root, dest }) {
|
|
1499
|
+
async function generateKotlinSources({ root, dest }) {
|
|
1493
1500
|
const skip = /* @__PURE__ */ new Set([
|
|
1494
1501
|
"node_modules",
|
|
1495
1502
|
"ios",
|
|
@@ -1501,26 +1508,30 @@ function generateKotlinSources({ root, dest }) {
|
|
|
1501
1508
|
"__tests__",
|
|
1502
1509
|
"scripts"
|
|
1503
1510
|
]);
|
|
1511
|
+
const sources = [];
|
|
1504
1512
|
const collect = (dir) => {
|
|
1505
1513
|
for (const entry of FSExtra.readdirSync(dir, { withFileTypes: true })) {
|
|
1506
1514
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
1507
1515
|
const source = path.join(dir, entry.name);
|
|
1508
1516
|
if (entry.isDirectory()) collect(source);
|
|
1509
|
-
else if (entry.isFile() && entry.name.endsWith(".kt"))
|
|
1510
|
-
const id = kotlinSourceId(root, source);
|
|
1511
|
-
const target = path.join(dest, "app/src/main/java/one/source", id);
|
|
1512
|
-
FSExtra.mkdirSync(target, { recursive: true });
|
|
1513
|
-
FSExtra.copyFileSync(source, path.join(target, entry.name));
|
|
1514
|
-
const contract = writeNativeSourceDeclaration(source);
|
|
1515
|
-
if (contract.modules.length > 0) {
|
|
1516
|
-
FSExtra.writeFileSync(path.join(target, `OneNativeSource_${id}.kt`), renderKotlinSourceGlue(id, contract).source);
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1517
|
+
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(source);
|
|
1519
1518
|
}
|
|
1520
1519
|
};
|
|
1521
1520
|
collect(root);
|
|
1521
|
+
if (sources.length === 0) return;
|
|
1522
|
+
const { kotlinSourceId, renderKotlinSourceGlue, writeNativeSourceDeclaration } = await import("../utils/nativeSourceContract.mjs");
|
|
1523
|
+
for (const source of sources) {
|
|
1524
|
+
const id = kotlinSourceId(root, source);
|
|
1525
|
+
const target = path.join(dest, "app/src/main/java/one/source", id);
|
|
1526
|
+
FSExtra.mkdirSync(target, { recursive: true });
|
|
1527
|
+
FSExtra.copyFileSync(source, path.join(target, path.basename(source)));
|
|
1528
|
+
const contract = writeNativeSourceDeclaration(source);
|
|
1529
|
+
if (contract.modules.length > 0) {
|
|
1530
|
+
FSExtra.writeFileSync(path.join(target, `OneNativeSource_${id}.kt`), renderKotlinSourceGlue(id, contract).source);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1522
1533
|
}
|
|
1523
|
-
function generateSwiftPackages({ root, dest }) {
|
|
1534
|
+
async function generateSwiftPackages({ root, dest }) {
|
|
1524
1535
|
const skip = /* @__PURE__ */ new Set([
|
|
1525
1536
|
"node_modules",
|
|
1526
1537
|
"ios",
|
|
@@ -1529,7 +1540,10 @@ function generateSwiftPackages({ root, dest }) {
|
|
|
1529
1540
|
"types",
|
|
1530
1541
|
"build"
|
|
1531
1542
|
]);
|
|
1532
|
-
|
|
1543
|
+
const packages = swiftPackageDirectories(root);
|
|
1544
|
+
if (packages.size === 0) return;
|
|
1545
|
+
const { swiftPodManifest, writeSwiftPackageArtifacts } = await import("../utils/nativeSourceContract.mjs");
|
|
1546
|
+
for (const [id, packageDir] of packages) {
|
|
1533
1547
|
const podDir = path.join(dest, "OneSwiftPackages", id);
|
|
1534
1548
|
const manifest = swiftPodManifest(path.join(packageDir, "Package.swift"), FSExtra.readFileSync(path.join(packageDir, "Package.swift"), "utf8"));
|
|
1535
1549
|
const sources = [];
|