vxrn 2.0.0-beta.120.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 +33 -16
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +61 -27
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/expo-plugin.cjs +52 -0
- package/package.json +10 -10
- package/src/config/getBaseViteConfigOnly.ts +6 -3
- package/src/exports/prebuildWithoutExpo.test.ts +23 -0
- package/src/exports/prebuildWithoutExpo.ts +40 -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");
|
|
@@ -1302,6 +1301,17 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
|
|
|
1302
1301
|
if (app.photoLibrary !== void 0) {
|
|
1303
1302
|
usage.set("NSPhotoLibraryAddUsageDescription", app.photoLibrary.addOnly);
|
|
1304
1303
|
}
|
|
1304
|
+
if (app.contacts !== void 0) {
|
|
1305
|
+
usage.set("NSContactsUsageDescription", app.contacts.usage);
|
|
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
|
+
}
|
|
1305
1315
|
if (app.location !== void 0) {
|
|
1306
1316
|
usage.set("NSLocationWhenInUseUsageDescription", app.location.whenInUse);
|
|
1307
1317
|
}
|
|
@@ -1477,16 +1487,16 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
|
|
|
1477
1487
|
});
|
|
1478
1488
|
if (platform === "ios") generateOneBridgingHeader(dest, app);
|
|
1479
1489
|
if (platform === "ios") generateIosWidgets(dest, app);
|
|
1480
|
-
if (platform === "ios") generateSwiftPackages({
|
|
1490
|
+
if (platform === "ios") await generateSwiftPackages({
|
|
1481
1491
|
root,
|
|
1482
1492
|
dest
|
|
1483
1493
|
});
|
|
1484
|
-
if (platform === "android") generateKotlinSources({
|
|
1494
|
+
if (platform === "android") await generateKotlinSources({
|
|
1485
1495
|
root,
|
|
1486
1496
|
dest
|
|
1487
1497
|
});
|
|
1488
1498
|
};
|
|
1489
|
-
function generateKotlinSources({ root, dest }) {
|
|
1499
|
+
async function generateKotlinSources({ root, dest }) {
|
|
1490
1500
|
const skip = /* @__PURE__ */ new Set([
|
|
1491
1501
|
"node_modules",
|
|
1492
1502
|
"ios",
|
|
@@ -1498,26 +1508,30 @@ function generateKotlinSources({ root, dest }) {
|
|
|
1498
1508
|
"__tests__",
|
|
1499
1509
|
"scripts"
|
|
1500
1510
|
]);
|
|
1511
|
+
const sources = [];
|
|
1501
1512
|
const collect = (dir) => {
|
|
1502
1513
|
for (const entry of FSExtra.readdirSync(dir, { withFileTypes: true })) {
|
|
1503
1514
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
1504
1515
|
const source = path.join(dir, entry.name);
|
|
1505
1516
|
if (entry.isDirectory()) collect(source);
|
|
1506
|
-
else if (entry.isFile() && entry.name.endsWith(".kt"))
|
|
1507
|
-
const id = kotlinSourceId(root, source);
|
|
1508
|
-
const target = path.join(dest, "app/src/main/java/one/source", id);
|
|
1509
|
-
FSExtra.mkdirSync(target, { recursive: true });
|
|
1510
|
-
FSExtra.copyFileSync(source, path.join(target, entry.name));
|
|
1511
|
-
const contract = writeNativeSourceDeclaration(source);
|
|
1512
|
-
if (contract.modules.length > 0) {
|
|
1513
|
-
FSExtra.writeFileSync(path.join(target, `OneNativeSource_${id}.kt`), renderKotlinSourceGlue(id, contract).source);
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1517
|
+
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(source);
|
|
1516
1518
|
}
|
|
1517
1519
|
};
|
|
1518
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
|
+
}
|
|
1519
1533
|
}
|
|
1520
|
-
function generateSwiftPackages({ root, dest }) {
|
|
1534
|
+
async function generateSwiftPackages({ root, dest }) {
|
|
1521
1535
|
const skip = /* @__PURE__ */ new Set([
|
|
1522
1536
|
"node_modules",
|
|
1523
1537
|
"ios",
|
|
@@ -1526,7 +1540,10 @@ function generateSwiftPackages({ root, dest }) {
|
|
|
1526
1540
|
"types",
|
|
1527
1541
|
"build"
|
|
1528
1542
|
]);
|
|
1529
|
-
|
|
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) {
|
|
1530
1547
|
const podDir = path.join(dest, "OneSwiftPackages", id);
|
|
1531
1548
|
const manifest = swiftPodManifest(path.join(packageDir, "Package.swift"), FSExtra.readFileSync(path.join(packageDir, "Package.swift"), "utf8"));
|
|
1532
1549
|
const sources = [];
|