bleam 0.0.6 → 0.0.8

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.
Files changed (86) hide show
  1. package/dist/ai.cjs +3984 -25
  2. package/dist/ai.d.cts +503 -20
  3. package/dist/ai.d.ts +503 -20
  4. package/dist/ai.js +3946 -26
  5. package/dist/animated.cjs +1 -1
  6. package/dist/animated.js +1 -1
  7. package/dist/app.cjs +92 -0
  8. package/dist/app.js +92 -0
  9. package/dist/cli.cjs +653 -86
  10. package/dist/cli.d.cts +89 -1
  11. package/dist/cli.d.ts +89 -1
  12. package/dist/cli.js +654 -88
  13. package/dist/{config-ClDGHNb3.d.ts → config-Cms0rvqg.d.ts} +1 -0
  14. package/dist/{config-D3gPaVMb.d.cts → config-CufOVJV3.d.cts} +1 -0
  15. package/dist/config.d.cts +1 -1
  16. package/dist/config.d.ts +1 -1
  17. package/dist/crypto.d.cts +0 -2
  18. package/dist/crypto.d.ts +1 -1
  19. package/dist/dev-protocol.d.cts +14 -1
  20. package/dist/dev-protocol.d.ts +14 -1
  21. package/dist/files-Bo7h9fik.cjs +468 -0
  22. package/dist/files-Ds1wT8C2.js +445 -0
  23. package/dist/files-DwA7pzr3.d.cts +99 -0
  24. package/dist/files-VrkQlKIT.d.ts +99 -0
  25. package/dist/files.cjs +7 -0
  26. package/dist/files.d.cts +2 -0
  27. package/dist/files.d.ts +2 -0
  28. package/dist/files.js +4 -0
  29. package/dist/index.d.cts +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/native-sqlite-xcGdamRD.js +64 -0
  32. package/dist/native-sqlite-yQLD5s9i.cjs +66 -0
  33. package/dist/platform.cjs +27 -0
  34. package/dist/platform.d.cts +39 -0
  35. package/dist/platform.d.ts +39 -0
  36. package/dist/platform.js +21 -0
  37. package/dist/runtime.d.cts +1 -6
  38. package/dist/runtime.d.ts +1 -6
  39. package/dist/{schema-ipsECAso.d.ts → schema-DOOjfXvs.d.ts} +1 -1
  40. package/dist/{schema-BOuUHcqo.d.cts → schema-ENSMX_1t.d.cts} +1 -1
  41. package/dist/schema.cjs +1 -1
  42. package/dist/schema.d.cts +1 -1
  43. package/dist/schema.d.ts +1 -1
  44. package/dist/schema.js +1 -1
  45. package/dist/state-Bx0VlTlO.cjs +852 -0
  46. package/dist/state-CAwe-Vw1.js +767 -0
  47. package/dist/state.cjs +17 -763
  48. package/dist/state.d.cts +107 -77
  49. package/dist/state.d.ts +107 -77
  50. package/dist/state.js +4 -745
  51. package/dist/ui-1WepaMS4.d.cts +92 -0
  52. package/dist/ui-Ce-pnUUA.d.ts +92 -0
  53. package/dist/ui.cjs +286 -35
  54. package/dist/ui.d.cts +2 -30
  55. package/dist/ui.d.ts +2 -30
  56. package/dist/ui.js +283 -36
  57. package/dist/window.cjs +596 -0
  58. package/dist/window.d.cts +63 -0
  59. package/dist/window.d.ts +63 -0
  60. package/dist/window.js +589 -0
  61. package/package.json +16 -14
  62. package/templates/basic/app/index.tsx +8 -5
  63. package/templates/foundation-models/app/index.tsx +32 -0
  64. package/templates/foundation-models/app.config.ts +5 -0
  65. package/templates/image-generation/app/index.tsx +39 -0
  66. package/templates/image-generation/app.config.ts +5 -0
  67. package/templates/state/app/index.tsx +30 -0
  68. package/templates/state/app.config.ts +5 -0
  69. package/dist/chrome.cjs +0 -265
  70. package/dist/chrome.d.cts +0 -19
  71. package/dist/chrome.d.ts +0 -19
  72. package/dist/chrome.js +0 -262
  73. package/dist/fs.cjs +0 -13
  74. package/dist/fs.d.cts +0 -8
  75. package/dist/fs.d.ts +0 -8
  76. package/dist/fs.js +0 -12
  77. package/dist/native-macos-D6p2SmUj.js +0 -20
  78. package/dist/native-macos-DLwo_ii9.cjs +0 -31
  79. package/dist/native-runtime-CbPzrs8j.d.cts +0 -33
  80. package/dist/native-runtime-DxHSrsTX.d.ts +0 -33
  81. package/dist/native.cjs +0 -135
  82. package/dist/native.d.cts +0 -34
  83. package/dist/native.d.ts +0 -34
  84. package/dist/native.js +0 -135
  85. /package/dist/{schema-DVmoD9JL.js → schema-Bo5Jvqus.js} +0 -0
  86. /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: true
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: true
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
  }