bleam 0.0.6 → 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 +3984 -25
- package/dist/ai.d.cts +503 -20
- package/dist/ai.d.ts +503 -20
- package/dist/ai.js +3946 -26
- package/dist/animated.cjs +1 -1
- package/dist/animated.js +1 -1
- package/dist/app.cjs +92 -0
- package/dist/app.js +92 -0
- package/dist/cli.cjs +653 -86
- package/dist/cli.d.cts +89 -1
- package/dist/cli.d.ts +89 -1
- package/dist/cli.js +654 -88
- package/dist/{config-ClDGHNb3.d.ts → config-Cms0rvqg.d.ts} +1 -0
- package/dist/{config-D3gPaVMb.d.cts → config-CufOVJV3.d.cts} +1 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/crypto.d.cts +0 -2
- package/dist/crypto.d.ts +1 -1
- package/dist/dev-protocol.d.cts +14 -1
- package/dist/dev-protocol.d.ts +14 -1
- 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.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- 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 -6
- package/dist/runtime.d.ts +1 -6
- package/dist/{schema-ipsECAso.d.ts → schema-DOOjfXvs.d.ts} +1 -1
- package/dist/{schema-BOuUHcqo.d.cts → schema-ENSMX_1t.d.cts} +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/dist/state-Bx0VlTlO.cjs +852 -0
- package/dist/state-CAwe-Vw1.js +767 -0
- package/dist/state.cjs +17 -763
- package/dist/state.d.cts +107 -77
- package/dist/state.d.ts +107 -77
- package/dist/state.js +4 -745
- 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 +286 -35
- package/dist/ui.d.cts +2 -30
- package/dist/ui.d.ts +2 -30
- package/dist/ui.js +283 -36
- 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/package.json +16 -14
- package/templates/basic/app/index.tsx +8 -5
- 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/chrome.cjs +0 -265
- package/dist/chrome.d.cts +0 -19
- package/dist/chrome.d.ts +0 -19
- package/dist/chrome.js +0 -262
- package/dist/fs.cjs +0 -13
- package/dist/fs.d.cts +0 -8
- package/dist/fs.d.ts +0 -8
- package/dist/fs.js +0 -12
- package/dist/native-macos-D6p2SmUj.js +0 -20
- package/dist/native-macos-DLwo_ii9.cjs +0 -31
- package/dist/native-runtime-CbPzrs8j.d.cts +0 -33
- package/dist/native-runtime-DxHSrsTX.d.ts +0 -33
- package/dist/native.cjs +0 -135
- package/dist/native.d.cts +0 -34
- package/dist/native.d.ts +0 -34
- package/dist/native.js +0 -135
- /package/dist/{schema-DVmoD9JL.js → schema-Bo5Jvqus.js} +0 -0
- /package/dist/{schema-bxeeCyLn.cjs → schema-rQ13mrpD.cjs} +0 -0
package/dist/animated.cjs
CHANGED
|
@@ -212,7 +212,7 @@ function useAnimatedTransition(transition) {
|
|
|
212
212
|
delay,
|
|
213
213
|
easing,
|
|
214
214
|
isInteraction: false,
|
|
215
|
-
useNativeDriver:
|
|
215
|
+
useNativeDriver: property !== "width" && property !== "height"
|
|
216
216
|
});
|
|
217
217
|
state.animations.set(property, animation);
|
|
218
218
|
state.targets.set(property, target);
|
package/dist/animated.js
CHANGED
|
@@ -208,7 +208,7 @@ function useAnimatedTransition(transition) {
|
|
|
208
208
|
delay,
|
|
209
209
|
easing,
|
|
210
210
|
isInteraction: false,
|
|
211
|
-
useNativeDriver:
|
|
211
|
+
useNativeDriver: property !== "width" && property !== "height"
|
|
212
212
|
});
|
|
213
213
|
state.animations.set(property, animation);
|
|
214
214
|
state.targets.set(property, target);
|
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.js
CHANGED
|
@@ -1,6 +1,98 @@
|
|
|
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
|
}
|