vxrn 2.0.0-beta.150.1 → 2.0.0-beta.158.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/constants/defaults.mjs +3 -0
- package/dist/constants/defaults.mjs.map +1 -1
- package/dist/constants/defaults.native.js +3 -0
- package/dist/constants/defaults.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +132 -4
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +175 -21
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +2 -2
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +2 -2
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/utils/createNativeDevEngine.mjs +122 -16
- package/dist/utils/createNativeDevEngine.mjs.map +1 -1
- package/dist/utils/createNativeDevEngine.native.js +127 -18
- package/dist/utils/createNativeDevEngine.native.js.map +1 -1
- package/dist/utils/nativeSourceContract.mjs +146 -29
- package/dist/utils/nativeSourceContract.mjs.map +1 -1
- package/dist/utils/nativeSourceContract.native.js +182 -29
- package/dist/utils/nativeSourceContract.native.js.map +1 -1
- package/package.json +10 -10
- package/src/constants/defaults.ts +4 -0
- package/src/exports/prebuildWithoutExpo.test.ts +146 -0
- package/src/exports/prebuildWithoutExpo.ts +165 -4
- package/src/native-source-contract.ts +2 -0
- package/src/rn-commands/bundle/buildBundle.ts +2 -2
- package/src/utils/createNativeDevEngine.test.ts +290 -4
- package/src/utils/createNativeDevEngine.ts +155 -43
- package/src/utils/nativeSourceContract.test.ts +34 -1
- package/src/utils/nativeSourceContract.ts +164 -30
- package/types/constants/defaults.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts +6 -0
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/native-source-contract.d.ts +1 -1
- package/types/native-source-contract.d.ts.map +1 -1
- package/types/utils/createNativeDevEngine.d.ts +7 -22
- package/types/utils/createNativeDevEngine.d.ts.map +1 -1
- package/types/utils/nativeSourceContract.d.ts +15 -0
- package/types/utils/nativeSourceContract.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":[],"sources":["constants/defaults.js"],"sourcesContent":["const DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB;CAEzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
1
|
+
{"version":3,"file":"defaults.js","names":[],"sources":["constants/defaults.js"],"sourcesContent":["const DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // dotLottie animation archives\n \"lottie\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n \"woff\",\n \"woff2\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB;CAEzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CAEA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.native.js","names":[],"sources":["constants/defaults.native.js"],"sourcesContent":["var DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,IAAI,qBAAqB;CAEvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
1
|
+
{"version":3,"file":"defaults.native.js","names":[],"sources":["constants/defaults.native.js"],"sourcesContent":["var DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // dotLottie animation archives\n \"lottie\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n \"woff\",\n \"woff2\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,IAAI,qBAAqB;CAEvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CAEA;AACF"}
|
|
@@ -158,7 +158,7 @@ function patchIosInfoPlistSceneManifest(rendered) {
|
|
|
158
158
|
</dict>
|
|
159
159
|
${anchor}`);
|
|
160
160
|
}
|
|
161
|
-
function patchIosAppDelegateSceneLifecycle(rendered, appName, backgroundTasks) {
|
|
161
|
+
function patchIosAppDelegateSceneLifecycle(rendered, appName, backgroundTasks, appIntents) {
|
|
162
162
|
const anchor = `@main
|
|
163
163
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
164
164
|
var window: UIWindow?
|
|
@@ -206,6 +206,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
206
206
|
reactNativeDelegate = delegate
|
|
207
207
|
reactNativeFactory = factory
|
|
208
208
|
${backgroundTasks ? ` OneBackgroundTasksRegisterHost(factory, launchOptions)
|
|
209
|
+
` : ""}${appIntents ? ` OneAppIntentsRegisterHost(factory, launchOptions)
|
|
209
210
|
` : ""} return true
|
|
210
211
|
}
|
|
211
212
|
}`);
|
|
@@ -215,6 +216,7 @@ function renderOneBridgingHeader(app) {
|
|
|
215
216
|
const imports = [nativeProjectPatches.ONE_LAUNCH_SCREEN.bridgingHeaderImport];
|
|
216
217
|
if (app.updates !== void 0) imports.push(updatesHost.bridgingHeaderImport);
|
|
217
218
|
if (app.ios?.backgroundTasks !== void 0) imports.push("#import \"OneBackgroundTasksBridge.h\"");
|
|
219
|
+
if (app.ios?.appIntents !== void 0) imports.push("#import \"OneAppIntentsBridge.h\"");
|
|
218
220
|
return `// generated by one prebuild: exposes One's c entry points to AppDelegate
|
|
219
221
|
// without importing the One module.
|
|
220
222
|
${imports.join("\n")}
|
|
@@ -250,6 +252,79 @@ function patchIosPbxprojSceneDelegate(rendered, appName) {
|
|
|
250
252
|
}
|
|
251
253
|
return patched;
|
|
252
254
|
}
|
|
255
|
+
function patchIosPbxprojAppIntents(rendered, appName) {
|
|
256
|
+
const name = "OneAppIntents.swift";
|
|
257
|
+
const fileRef = pbxprojId("one-app-intents-file");
|
|
258
|
+
const buildFile = pbxprojId("one-app-intents-build");
|
|
259
|
+
const edits = [
|
|
260
|
+
["/* AppDelegate.swift in Sources */ = {isa = PBXBuildFile;", ` ${buildFile} /* ${name} in Sources */ = {isa = PBXBuildFile; fileRef = ${fileRef} /* ${name} */; };`],
|
|
261
|
+
["/* AppDelegate.swift */ = {isa = PBXFileReference;", ` ${fileRef} /* ${name} */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ${name}; path = ${appName}/${name}; sourceTree = "<group>"; };`],
|
|
262
|
+
["/* AppDelegate.swift */,", ` ${fileRef} /* ${name} */,`],
|
|
263
|
+
["/* AppDelegate.swift in Sources */,", ` ${buildFile} /* ${name} in Sources */,`]
|
|
264
|
+
];
|
|
265
|
+
let patched = rendered;
|
|
266
|
+
for (const [anchor, insertion] of edits) {
|
|
267
|
+
const next = insertAfterLine(patched, anchor, insertion);
|
|
268
|
+
if (next === patched) {
|
|
269
|
+
throw new Error(`[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`);
|
|
270
|
+
}
|
|
271
|
+
patched = next;
|
|
272
|
+
}
|
|
273
|
+
return patched;
|
|
274
|
+
}
|
|
275
|
+
function swiftLiteral(value) {
|
|
276
|
+
return JSON.stringify(value).replace(/\\u([0-9a-fA-F]{4})/g, (_match, hex) => `\\u{${hex}}`);
|
|
277
|
+
}
|
|
278
|
+
function swiftShortcutPhrase(value) {
|
|
279
|
+
return `"${value.split("{app}").map((part) => swiftLiteral(part).slice(1, -1)).join("\\(.applicationName)")}"`;
|
|
280
|
+
}
|
|
281
|
+
function renderIosAppIntentsSwift(actions) {
|
|
282
|
+
const types = actions.map((action, index) => {
|
|
283
|
+
const summaryTitle = swiftLiteral(action.title).slice(1, -1);
|
|
284
|
+
const text = action.textParameterTitle === void 0 ? "" : `
|
|
285
|
+
@Parameter(title: ${swiftLiteral(action.textParameterTitle)}) var text: String
|
|
286
|
+
|
|
287
|
+
static var parameterSummary: some ParameterSummary {
|
|
288
|
+
Summary("${summaryTitle} \\(\\.$text)")
|
|
289
|
+
}
|
|
290
|
+
`;
|
|
291
|
+
return `struct OneAppIntent${index}: AppIntent {
|
|
292
|
+
static let title: LocalizedStringResource = ${swiftLiteral(action.title)}
|
|
293
|
+
${text}
|
|
294
|
+
func perform() async throws -> some IntentResult & ReturnsValue<String> {
|
|
295
|
+
let result = try await oneAppIntentsRun(${swiftLiteral(action.id)}, ${text ? "text" : "nil"})
|
|
296
|
+
return .result(value: result)
|
|
297
|
+
}
|
|
298
|
+
}`;
|
|
299
|
+
});
|
|
300
|
+
const shortcuts = actions.map((action, index) => ` AppShortcut(
|
|
301
|
+
intent: OneAppIntent${index}(),
|
|
302
|
+
phrases: [${swiftShortcutPhrase(action.shortcutPhrase)}],
|
|
303
|
+
shortTitle: ${swiftLiteral(action.title)},
|
|
304
|
+
systemImageName: "bolt.fill"
|
|
305
|
+
)`).join("\n");
|
|
306
|
+
return `import AppIntents
|
|
307
|
+
import Foundation
|
|
308
|
+
|
|
309
|
+
private func oneAppIntentsRun(_ identifier: String, _ text: String?) async throws -> String {
|
|
310
|
+
try await withCheckedThrowingContinuation { continuation in
|
|
311
|
+
OneAppIntentsPerform(identifier, text) { result, error in
|
|
312
|
+
if let error { continuation.resume(throwing: error) }
|
|
313
|
+
else if let result { continuation.resume(returning: result) }
|
|
314
|
+
else { continuation.resume(throwing: NSError(domain: "OneAppIntents", code: 3)) }
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
${types.join("\n\n")}
|
|
320
|
+
|
|
321
|
+
struct OneAppShortcuts: AppShortcutsProvider {
|
|
322
|
+
static var appShortcuts: [AppShortcut] {
|
|
323
|
+
${shortcuts}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
253
328
|
function fontFileName(font) {
|
|
254
329
|
return path.basename(font);
|
|
255
330
|
}
|
|
@@ -507,6 +582,10 @@ function generateSceneDelegate(args) {
|
|
|
507
582
|
FSExtra.writeFileSync(path.join(dest, app.name, `${app.name}.entitlements`), renderEntitlements(entitlements));
|
|
508
583
|
}
|
|
509
584
|
}
|
|
585
|
+
function generateIosAppIntents(dest, platform, app) {
|
|
586
|
+
if (platform !== "ios" || !app.ios?.appIntents) return;
|
|
587
|
+
FSExtra.writeFileSync(path.join(dest, app.name, "OneAppIntents.swift"), renderIosAppIntentsSwift(app.ios.appIntents.actions));
|
|
588
|
+
}
|
|
510
589
|
function generateIosWidgets(dest, app) {
|
|
511
590
|
const widgets = app.ios?.widgets;
|
|
512
591
|
if (!widgets) return;
|
|
@@ -1452,6 +1531,12 @@ ${identifiers.map((identifier) => ` <string>${escapeXml(identifier)}</string>`)
|
|
|
1452
1531
|
stamps.push(plistArray("OneBackgroundRefreshTaskIdentifiers", refreshTasks));
|
|
1453
1532
|
stamps.push(plistArray("OneBackgroundProcessingTaskIdentifiers", processingTasks));
|
|
1454
1533
|
}
|
|
1534
|
+
if (app.ios?.appIntents) {
|
|
1535
|
+
stamps.push(` <key>OneAppIntentIdentifiers</key>
|
|
1536
|
+
<array>
|
|
1537
|
+
${app.ios.appIntents.actions.map((action) => ` <string>${escapeXml(action.id)}</string>`).join("\n")}
|
|
1538
|
+
</array>`);
|
|
1539
|
+
}
|
|
1455
1540
|
const backgroundModes = [
|
|
1456
1541
|
...app.pictureInPicture || app.audio?.background ? ["audio"] : [],
|
|
1457
1542
|
...app.location?.background ? ["location"] : [],
|
|
@@ -1737,7 +1822,7 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
|
|
|
1737
1822
|
rendered = patchIosInfoPlistSceneManifest(rendered);
|
|
1738
1823
|
}
|
|
1739
1824
|
if (platform === "ios" && relativePath.endsWith("/AppDelegate.swift")) {
|
|
1740
|
-
rendered = patchIosAppDelegateSceneLifecycle(rendered, appName, !!app.ios?.backgroundTasks);
|
|
1825
|
+
rendered = patchIosAppDelegateSceneLifecycle(rendered, appName, !!app.ios?.backgroundTasks, !!app.ios?.appIntents);
|
|
1741
1826
|
rendered = nativeProjectPatches.holdLaunchScreenOverRootView(rendered);
|
|
1742
1827
|
if (app.updates !== void 0) {
|
|
1743
1828
|
rendered = nativeProjectPatches.pointReleaseBundleURLAtOneUpdates(rendered);
|
|
@@ -1760,6 +1845,7 @@ end`);
|
|
|
1760
1845
|
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
1761
1846
|
rendered = patchIosBundlePhase(rendered, app.updates?.runtimeVersion);
|
|
1762
1847
|
rendered = patchIosPbxprojSceneDelegate(rendered, appName);
|
|
1848
|
+
if (app.ios?.appIntents) rendered = patchIosPbxprojAppIntents(rendered, appName);
|
|
1763
1849
|
rendered = patchIosPbxprojOneBridgingHeader(rendered, appName);
|
|
1764
1850
|
if (Object.keys(appEntitlements(app)).length && !app.ios?.widgets) {
|
|
1765
1851
|
rendered = patchIosPbxprojAppEntitlements(rendered, appName);
|
|
@@ -1942,6 +2028,7 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
|
|
|
1942
2028
|
platform,
|
|
1943
2029
|
app
|
|
1944
2030
|
});
|
|
2031
|
+
generateIosAppIntents(dest, platform, app);
|
|
1945
2032
|
if (platform === "ios") generateOneBridgingHeader(dest, app);
|
|
1946
2033
|
if (platform === "ios") generateIosWidgets(dest, app);
|
|
1947
2034
|
if (platform === "ios") await generateSwiftPackages({
|
|
@@ -1953,6 +2040,41 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
|
|
|
1953
2040
|
dest
|
|
1954
2041
|
});
|
|
1955
2042
|
};
|
|
2043
|
+
function enableAppComposeIntegration(dest) {
|
|
2044
|
+
const rootBuildGradlePath = path.join(dest, "build.gradle");
|
|
2045
|
+
if (FSExtra.existsSync(rootBuildGradlePath)) {
|
|
2046
|
+
let content = FSExtra.readFileSync(rootBuildGradlePath, "utf8");
|
|
2047
|
+
const composePluginClasspath = " classpath(\"org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:$kotlinVersion\")";
|
|
2048
|
+
if (!content.includes("org.jetbrains.kotlin.plugin.compose")) {
|
|
2049
|
+
const anchor = content.includes("classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin\")") ? "classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin\")" : "classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin\"";
|
|
2050
|
+
content = insertAfterLine(content, anchor, composePluginClasspath);
|
|
2051
|
+
FSExtra.writeFileSync(rootBuildGradlePath, content, "utf8");
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
const appBuildGradlePath = path.join(dest, "app/build.gradle");
|
|
2055
|
+
if (FSExtra.existsSync(appBuildGradlePath)) {
|
|
2056
|
+
let content = FSExtra.readFileSync(appBuildGradlePath, "utf8");
|
|
2057
|
+
if (!content.includes("org.jetbrains.kotlin.plugin.compose")) {
|
|
2058
|
+
const pluginAnchor = content.includes("apply plugin: \"org.jetbrains.kotlin.android\"") ? "apply plugin: \"org.jetbrains.kotlin.android\"" : "apply plugin: 'org.jetbrains.kotlin.android'";
|
|
2059
|
+
content = insertAfterLine(content, pluginAnchor, "apply plugin: \"org.jetbrains.kotlin.plugin.compose\"");
|
|
2060
|
+
}
|
|
2061
|
+
if (!content.includes("compose true")) {
|
|
2062
|
+
content = insertAfterLine(content, "android {", " buildFeatures {\n compose true\n }");
|
|
2063
|
+
}
|
|
2064
|
+
if (!content.includes("androidx.compose.ui:ui")) {
|
|
2065
|
+
const composeDeps = [
|
|
2066
|
+
" def composeUiVersion = rootProject.ext.has(\"composeUiVersion\") ? rootProject.ext.get(\"composeUiVersion\") : \"1.11.4\"",
|
|
2067
|
+
" def material3Version = rootProject.ext.has(\"material3Version\") ? rootProject.ext.get(\"material3Version\") : \"1.5.0-alpha17\"",
|
|
2068
|
+
" implementation \"androidx.compose.ui:ui:$composeUiVersion\"",
|
|
2069
|
+
" implementation \"androidx.compose.foundation:foundation:$composeUiVersion\"",
|
|
2070
|
+
" implementation \"androidx.compose.material3:material3:$material3Version\""
|
|
2071
|
+
].join("\n");
|
|
2072
|
+
const depsAnchor = content.includes("implementation(\"com.facebook.react:react-android\")") ? "implementation(\"com.facebook.react:react-android\")" : "implementation \"com.facebook.react:react-android\"";
|
|
2073
|
+
content = insertAfterLine(content, depsAnchor, composeDeps);
|
|
2074
|
+
}
|
|
2075
|
+
FSExtra.writeFileSync(appBuildGradlePath, content, "utf8");
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
1956
2078
|
async function generateKotlinSources({ root, dest }) {
|
|
1957
2079
|
const skip = /* @__PURE__ */ new Set([
|
|
1958
2080
|
"node_modules",
|
|
@@ -1967,6 +2089,7 @@ async function generateKotlinSources({ root, dest }) {
|
|
|
1967
2089
|
]);
|
|
1968
2090
|
const sources = [];
|
|
1969
2091
|
const collect = (dir) => {
|
|
2092
|
+
if (dir !== root && FSExtra.existsSync(path.join(dir, "package.json"))) return;
|
|
1970
2093
|
for (const entry of FSExtra.readdirSync(dir, { withFileTypes: true })) {
|
|
1971
2094
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
1972
2095
|
const source = path.join(dir, entry.name);
|
|
@@ -1977,16 +2100,21 @@ async function generateKotlinSources({ root, dest }) {
|
|
|
1977
2100
|
collect(root);
|
|
1978
2101
|
if (sources.length === 0) return;
|
|
1979
2102
|
const { kotlinSourceId, renderKotlinSourceGlue, writeNativeSourceDeclaration } = await import("../utils/nativeSourceContract.mjs");
|
|
2103
|
+
let hasViews = false;
|
|
1980
2104
|
for (const source of sources) {
|
|
1981
2105
|
const id = kotlinSourceId(root, source);
|
|
1982
2106
|
const target = path.join(dest, "app/src/main/java/one/source", id);
|
|
1983
2107
|
FSExtra.mkdirSync(target, { recursive: true });
|
|
1984
2108
|
FSExtra.copyFileSync(source, path.join(target, path.basename(source)));
|
|
1985
2109
|
const contract = writeNativeSourceDeclaration(source);
|
|
1986
|
-
if (contract.
|
|
2110
|
+
if (contract.views.length > 0) hasViews = true;
|
|
2111
|
+
if (contract.modules.length > 0 || contract.views.length > 0) {
|
|
1987
2112
|
FSExtra.writeFileSync(path.join(target, `OneNativeSource_${id}.kt`), renderKotlinSourceGlue(id, contract).source);
|
|
1988
2113
|
}
|
|
1989
2114
|
}
|
|
2115
|
+
if (hasViews) {
|
|
2116
|
+
enableAppComposeIntegration(dest);
|
|
2117
|
+
}
|
|
1990
2118
|
}
|
|
1991
2119
|
async function generateSwiftPackages({ root, dest }) {
|
|
1992
2120
|
const skip = /* @__PURE__ */ new Set([
|
|
@@ -2103,5 +2231,5 @@ const transformPath = (filePath) => {
|
|
|
2103
2231
|
return filePath.replace("_BUCK", "BUCK").replace("_gitignore", ".gitignore").replace("_gitattributes", ".gitattributes").replace("_babelrc", ".babelrc").replace("_editorconfig", ".editorconfig").replace("_eslintrc.js", ".eslintrc.js").replace("_flowconfig", ".flowconfig").replace("_buckconfig", ".buckconfig").replace("_prettierrc.js", ".prettierrc.js").replace("_bundle", ".bundle").replace("_ruby-version", ".ruby-version").replace("_node-version", ".node-version").replace("_watchmanconfig", ".watchmanconfig").replace("_xcode.env", ".xcode.env");
|
|
2104
2232
|
};
|
|
2105
2233
|
|
|
2106
|
-
export { applyAndroidDependencyPatches, generateForPlatform, getNativeDependencyInventory, installNativeDependencies, renderPrebuildFile, renderSceneDelegateSwift, validatePrebuildApp };
|
|
2234
|
+
export { applyAndroidDependencyPatches, enableAppComposeIntegration, generateForPlatform, generateKotlinSources, getNativeDependencyInventory, installNativeDependencies, renderIosAppIntentsSwift, renderPrebuildFile, renderSceneDelegateSwift, validatePrebuildApp };
|
|
2107
2235
|
//# sourceMappingURL=prebuildWithoutExpo.mjs.map
|