bleam 0.0.5 → 0.0.7
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/ai.cjs +4146 -0
- package/dist/ai.d.cts +535 -0
- package/dist/ai.d.ts +535 -0
- package/dist/ai.js +4102 -0
- package/dist/animated.cjs +286 -0
- package/dist/animated.d.cts +47 -0
- package/dist/animated.d.ts +47 -0
- package/dist/animated.js +281 -0
- package/dist/app.cjs +92 -0
- package/dist/app.d.cts +1 -2
- package/dist/app.d.ts +1 -2
- package/dist/app.js +93 -2
- package/dist/bundler.d.cts +1 -2
- package/dist/bundler.d.ts +1 -2
- package/dist/cli.cjs +1375 -71
- package/dist/cli.d.cts +89 -1
- package/dist/cli.d.ts +89 -1
- package/dist/cli.js +1373 -74
- package/dist/config-Bb6SULnR.cjs +46 -0
- package/dist/config-CfWa3q-k.js +28 -0
- package/dist/config-Cms0rvqg.d.ts +40 -0
- package/dist/config-CufOVJV3.d.cts +40 -0
- package/dist/config.cjs +4 -25
- package/dist/config.d.cts +2 -28
- package/dist/config.d.ts +2 -28
- package/dist/config.js +2 -24
- package/dist/crypto-BB92-Upx.js +7 -0
- package/dist/crypto-CT3VZ7lF.cjs +13 -0
- package/dist/crypto.cjs +2 -2
- package/dist/crypto.d.cts +6 -1
- package/dist/crypto.d.ts +8 -1
- package/dist/crypto.js +2 -2
- package/dist/dev-protocol.d.cts +16 -3
- package/dist/dev-protocol.d.ts +16 -3
- package/dist/dev-protocol.js +1 -2
- package/dist/files-Bo7h9fik.cjs +468 -0
- package/dist/files-Ds1wT8C2.js +445 -0
- package/dist/files-DwA7pzr3.d.cts +99 -0
- package/dist/files-VrkQlKIT.d.ts +99 -0
- package/dist/files.cjs +7 -0
- package/dist/files.d.cts +2 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.js +4 -0
- package/dist/index.cjs +4 -5
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -4
- package/dist/native-runtime-C85Nuc4F.js +10 -0
- package/dist/{native-runtime-CdeT0JyQ.cjs → native-runtime-CsXnXkQn.cjs} +1 -14
- package/dist/native-sqlite-xcGdamRD.js +64 -0
- package/dist/native-sqlite-yQLD5s9i.cjs +66 -0
- package/dist/platform.cjs +27 -0
- package/dist/platform.d.cts +39 -0
- package/dist/platform.d.ts +39 -0
- package/dist/platform.js +21 -0
- package/dist/runtime.d.cts +1 -7
- package/dist/runtime.d.ts +1 -7
- package/dist/schema-Bo5Jvqus.js +90 -0
- package/dist/schema-DOOjfXvs.d.ts +58 -0
- package/dist/schema-ENSMX_1t.d.cts +58 -0
- package/dist/schema-rQ13mrpD.cjs +102 -0
- package/dist/schema.cjs +4 -0
- package/dist/schema.d.cts +2 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +3 -0
- package/dist/state-Bx0VlTlO.cjs +852 -0
- package/dist/state-CAwe-Vw1.js +767 -0
- package/dist/state.cjs +19 -0
- package/dist/state.d.cts +159 -0
- package/dist/state.d.ts +159 -0
- package/dist/state.js +6 -0
- package/dist/styles.cjs +742 -0
- package/dist/styles.d.cts +701 -0
- package/dist/styles.d.ts +701 -0
- package/dist/styles.js +739 -0
- package/dist/ui-1WepaMS4.d.cts +92 -0
- package/dist/ui-234Plg7Z.d.cts +92 -0
- package/dist/ui-BJmXhz9Q.d.ts +92 -0
- package/dist/ui-Dd7SXdbg.d.cts +92 -0
- package/dist/ui-Ds88eETu.d.ts +92 -0
- package/dist/ui-TaqnB5SP.d.ts +92 -0
- package/dist/ui-WQvnXL0W.d.ts +92 -0
- package/dist/ui.cjs +364 -0
- package/dist/ui.d.cts +2 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.js +357 -0
- package/dist/window.cjs +596 -0
- package/dist/window.d.cts +63 -0
- package/dist/window.d.ts +63 -0
- package/dist/window.js +589 -0
- package/metro-config.cjs +18 -13
- package/package.json +57 -21
- package/templates/basic/app/index.tsx +133 -12
- package/templates/basic/app.config.ts +4 -2
- package/templates/foundation-models/app/index.tsx +32 -0
- package/templates/foundation-models/app.config.ts +5 -0
- package/templates/image-generation/app/index.tsx +39 -0
- package/templates/image-generation/app.config.ts +5 -0
- package/templates/state/app/index.tsx +30 -0
- package/templates/state/app.config.ts +5 -0
- package/dist/app.d.cts.map +0 -1
- package/dist/app.d.ts.map +0 -1
- package/dist/app.js.map +0 -1
- package/dist/bundler.d.cts.map +0 -1
- package/dist/bundler.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/crypto-BNhWeXMj.cjs +0 -15
- package/dist/crypto-Bg8cD8wX.d.cts +0 -8
- package/dist/crypto-Bg8cD8wX.d.cts.map +0 -1
- package/dist/crypto-CCA_hvao.js +0 -11
- package/dist/crypto-CCA_hvao.js.map +0 -1
- package/dist/crypto-IOzbNoJD.d.ts +0 -8
- package/dist/crypto-IOzbNoJD.d.ts.map +0 -1
- package/dist/dev-protocol.d.cts.map +0 -1
- package/dist/dev-protocol.d.ts.map +0 -1
- package/dist/dev-protocol.js.map +0 -1
- package/dist/fs-BK7joD1g.js +0 -13
- package/dist/fs-BK7joD1g.js.map +0 -1
- package/dist/fs-CEhcjuN6.d.ts +0 -9
- package/dist/fs-CEhcjuN6.d.ts.map +0 -1
- package/dist/fs-CfE8CHf_.d.cts +0 -9
- package/dist/fs-CfE8CHf_.d.cts.map +0 -1
- package/dist/fs-DKHYTPua.cjs +0 -18
- package/dist/fs.cjs +0 -3
- package/dist/fs.d.cts +0 -2
- package/dist/fs.d.ts +0 -2
- package/dist/fs.js +0 -3
- package/dist/native-runtime-BoqybBBf.js +0 -18
- package/dist/native-runtime-BoqybBBf.js.map +0 -1
- package/dist/native.cjs +0 -132
- package/dist/native.d.cts +0 -64
- package/dist/native.d.cts.map +0 -1
- package/dist/native.d.ts +0 -64
- package/dist/native.d.ts.map +0 -1
- package/dist/native.js +0 -133
- package/dist/native.js.map +0 -1
- package/dist/runtime.d.cts.map +0 -1
- package/dist/runtime.d.ts.map +0 -1
package/dist/app.cjs
CHANGED
|
@@ -1,8 +1,100 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_native_runtime = require('./native-runtime-CsXnXkQn.cjs');
|
|
2
3
|
let expo = require("expo");
|
|
3
4
|
expo = require_chunk.__toESM(expo);
|
|
4
5
|
|
|
6
|
+
//#region src/dev-runtime.ts
|
|
7
|
+
function launchArgument(name) {
|
|
8
|
+
const argumentsList = NSProcessInfo.processInfo.arguments();
|
|
9
|
+
const count = Number(argumentsList.count ?? 0);
|
|
10
|
+
for (let index = 0; index < count - 1; index += 1) if (String(argumentsList.objectAtIndex(index)) === name) return String(argumentsList.objectAtIndex(index + 1));
|
|
11
|
+
}
|
|
12
|
+
function projectConfigPath() {
|
|
13
|
+
require_native_runtime.ensureNativeScript();
|
|
14
|
+
return launchArgument("--bleam-project-config");
|
|
15
|
+
}
|
|
16
|
+
async function projectConfig() {
|
|
17
|
+
const path = projectConfigPath();
|
|
18
|
+
if (!path) return null;
|
|
19
|
+
const text = String(NSString.stringWithContentsOfFileEncodingError(path, NSUTF8StringEncoding, null));
|
|
20
|
+
return JSON.parse(text);
|
|
21
|
+
}
|
|
22
|
+
async function postDevLog(event) {
|
|
23
|
+
const config = await projectConfig();
|
|
24
|
+
if (!config?.devServer) return false;
|
|
25
|
+
const payload = {
|
|
26
|
+
source: event.source ?? "runtime",
|
|
27
|
+
level: event.level ?? "info",
|
|
28
|
+
message: event.message ?? "",
|
|
29
|
+
category: event.category,
|
|
30
|
+
details: event.details,
|
|
31
|
+
jobId: event.jobId
|
|
32
|
+
};
|
|
33
|
+
return (await fetch(`${config.devServer}/bleam/logs`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body: JSON.stringify(payload)
|
|
37
|
+
})).ok;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
5
41
|
//#region src/app.ts
|
|
42
|
+
let didInstallLogForwarding = false;
|
|
43
|
+
function stringifyLogArg(value) {
|
|
44
|
+
if (typeof value === "string") return value;
|
|
45
|
+
if (value instanceof Error) return value.stack ?? value.message;
|
|
46
|
+
try {
|
|
47
|
+
return JSON.stringify(value);
|
|
48
|
+
} catch {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function installLogForwarding() {
|
|
53
|
+
if (didInstallLogForwarding) return;
|
|
54
|
+
didInstallLogForwarding = true;
|
|
55
|
+
const original = {
|
|
56
|
+
log: console.log.bind(console),
|
|
57
|
+
warn: console.warn.bind(console),
|
|
58
|
+
error: console.error.bind(console)
|
|
59
|
+
};
|
|
60
|
+
function forward(level, args) {
|
|
61
|
+
const details = args.map(stringifyLogArg);
|
|
62
|
+
postDevLog({
|
|
63
|
+
source: "js",
|
|
64
|
+
level,
|
|
65
|
+
category: "console",
|
|
66
|
+
message: details.join(" "),
|
|
67
|
+
details
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
console.log = (...args) => {
|
|
71
|
+
original.log(...args);
|
|
72
|
+
forward("info", args);
|
|
73
|
+
};
|
|
74
|
+
console.warn = (...args) => {
|
|
75
|
+
original.warn(...args);
|
|
76
|
+
forward("warn", args);
|
|
77
|
+
};
|
|
78
|
+
console.error = (...args) => {
|
|
79
|
+
original.error(...args);
|
|
80
|
+
forward("error", args);
|
|
81
|
+
};
|
|
82
|
+
const errorUtils = globalThis.ErrorUtils;
|
|
83
|
+
if (!errorUtils?.setGlobalHandler) return;
|
|
84
|
+
const previousHandler = errorUtils.getGlobalHandler?.();
|
|
85
|
+
errorUtils.setGlobalHandler((nextError, isFatal) => {
|
|
86
|
+
const message = stringifyLogArg(nextError);
|
|
87
|
+
postDevLog({
|
|
88
|
+
source: "js",
|
|
89
|
+
level: "error",
|
|
90
|
+
category: isFatal ? "fatal" : "error",
|
|
91
|
+
message,
|
|
92
|
+
details: { isFatal }
|
|
93
|
+
});
|
|
94
|
+
previousHandler?.(nextError, isFatal);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
installLogForwarding();
|
|
6
98
|
function registerApp(component) {
|
|
7
99
|
(0, expo.registerRootComponent)(component);
|
|
8
100
|
}
|
package/dist/app.d.cts
CHANGED
package/dist/app.d.ts
CHANGED
package/dist/app.js
CHANGED
|
@@ -1,10 +1,101 @@
|
|
|
1
|
+
import { t as ensureNativeScript } from "./native-runtime-C85Nuc4F.js";
|
|
1
2
|
import { registerRootComponent } from "expo";
|
|
2
3
|
|
|
4
|
+
//#region src/dev-runtime.ts
|
|
5
|
+
function launchArgument(name) {
|
|
6
|
+
const argumentsList = NSProcessInfo.processInfo.arguments();
|
|
7
|
+
const count = Number(argumentsList.count ?? 0);
|
|
8
|
+
for (let index = 0; index < count - 1; index += 1) if (String(argumentsList.objectAtIndex(index)) === name) return String(argumentsList.objectAtIndex(index + 1));
|
|
9
|
+
}
|
|
10
|
+
function projectConfigPath() {
|
|
11
|
+
ensureNativeScript();
|
|
12
|
+
return launchArgument("--bleam-project-config");
|
|
13
|
+
}
|
|
14
|
+
async function projectConfig() {
|
|
15
|
+
const path = projectConfigPath();
|
|
16
|
+
if (!path) return null;
|
|
17
|
+
const text = String(NSString.stringWithContentsOfFileEncodingError(path, NSUTF8StringEncoding, null));
|
|
18
|
+
return JSON.parse(text);
|
|
19
|
+
}
|
|
20
|
+
async function postDevLog(event) {
|
|
21
|
+
const config = await projectConfig();
|
|
22
|
+
if (!config?.devServer) return false;
|
|
23
|
+
const payload = {
|
|
24
|
+
source: event.source ?? "runtime",
|
|
25
|
+
level: event.level ?? "info",
|
|
26
|
+
message: event.message ?? "",
|
|
27
|
+
category: event.category,
|
|
28
|
+
details: event.details,
|
|
29
|
+
jobId: event.jobId
|
|
30
|
+
};
|
|
31
|
+
return (await fetch(`${config.devServer}/bleam/logs`, {
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: { "Content-Type": "application/json" },
|
|
34
|
+
body: JSON.stringify(payload)
|
|
35
|
+
})).ok;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
3
39
|
//#region src/app.ts
|
|
40
|
+
let didInstallLogForwarding = false;
|
|
41
|
+
function stringifyLogArg(value) {
|
|
42
|
+
if (typeof value === "string") return value;
|
|
43
|
+
if (value instanceof Error) return value.stack ?? value.message;
|
|
44
|
+
try {
|
|
45
|
+
return JSON.stringify(value);
|
|
46
|
+
} catch {
|
|
47
|
+
return String(value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function installLogForwarding() {
|
|
51
|
+
if (didInstallLogForwarding) return;
|
|
52
|
+
didInstallLogForwarding = true;
|
|
53
|
+
const original = {
|
|
54
|
+
log: console.log.bind(console),
|
|
55
|
+
warn: console.warn.bind(console),
|
|
56
|
+
error: console.error.bind(console)
|
|
57
|
+
};
|
|
58
|
+
function forward(level, args) {
|
|
59
|
+
const details = args.map(stringifyLogArg);
|
|
60
|
+
postDevLog({
|
|
61
|
+
source: "js",
|
|
62
|
+
level,
|
|
63
|
+
category: "console",
|
|
64
|
+
message: details.join(" "),
|
|
65
|
+
details
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
console.log = (...args) => {
|
|
69
|
+
original.log(...args);
|
|
70
|
+
forward("info", args);
|
|
71
|
+
};
|
|
72
|
+
console.warn = (...args) => {
|
|
73
|
+
original.warn(...args);
|
|
74
|
+
forward("warn", args);
|
|
75
|
+
};
|
|
76
|
+
console.error = (...args) => {
|
|
77
|
+
original.error(...args);
|
|
78
|
+
forward("error", args);
|
|
79
|
+
};
|
|
80
|
+
const errorUtils = globalThis.ErrorUtils;
|
|
81
|
+
if (!errorUtils?.setGlobalHandler) return;
|
|
82
|
+
const previousHandler = errorUtils.getGlobalHandler?.();
|
|
83
|
+
errorUtils.setGlobalHandler((nextError, isFatal) => {
|
|
84
|
+
const message = stringifyLogArg(nextError);
|
|
85
|
+
postDevLog({
|
|
86
|
+
source: "js",
|
|
87
|
+
level: "error",
|
|
88
|
+
category: isFatal ? "fatal" : "error",
|
|
89
|
+
message,
|
|
90
|
+
details: { isFatal }
|
|
91
|
+
});
|
|
92
|
+
previousHandler?.(nextError, isFatal);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
installLogForwarding();
|
|
4
96
|
function registerApp(component) {
|
|
5
97
|
registerRootComponent(component);
|
|
6
98
|
}
|
|
7
99
|
|
|
8
100
|
//#endregion
|
|
9
|
-
export { registerApp };
|
|
10
|
-
//# sourceMappingURL=app.js.map
|
|
101
|
+
export { registerApp };
|
package/dist/bundler.d.cts
CHANGED
|
@@ -24,5 +24,4 @@ interface Bundler {
|
|
|
24
24
|
bundle(options: BundleOptions): Promise<BundleResult>;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export { BundleOptions, BundleResult, Bundler, DevServer, DevServerHandle, DevServerOptions };
|
|
28
|
-
//# sourceMappingURL=bundler.d.cts.map
|
|
27
|
+
export { BundleOptions, BundleResult, Bundler, DevServer, DevServerHandle, DevServerOptions };
|
package/dist/bundler.d.ts
CHANGED
|
@@ -24,5 +24,4 @@ interface Bundler {
|
|
|
24
24
|
bundle(options: BundleOptions): Promise<BundleResult>;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export { BundleOptions, BundleResult, Bundler, DevServer, DevServerHandle, DevServerOptions };
|
|
28
|
-
//# sourceMappingURL=bundler.d.ts.map
|
|
27
|
+
export { BundleOptions, BundleResult, Bundler, DevServer, DevServerHandle, DevServerOptions };
|