bleam 0.0.4 → 0.0.6
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 +187 -0
- package/dist/ai.d.cts +52 -0
- package/dist/ai.d.ts +52 -0
- package/dist/ai.js +182 -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.d.cts +1 -2
- package/dist/app.d.ts +1 -2
- package/dist/app.js +1 -2
- package/dist/bundler.d.cts +1 -2
- package/dist/bundler.d.ts +1 -2
- package/dist/chrome.cjs +265 -0
- package/dist/chrome.d.cts +19 -0
- package/dist/chrome.d.ts +19 -0
- package/dist/chrome.js +262 -0
- package/dist/cli.cjs +918 -68
- package/dist/cli.js +917 -71
- package/dist/config-Bb6SULnR.cjs +46 -0
- package/dist/config-CfWa3q-k.js +28 -0
- package/dist/config-ClDGHNb3.d.ts +39 -0
- package/dist/config-D3gPaVMb.d.cts +39 -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 +8 -1
- package/dist/crypto.d.ts +8 -1
- package/dist/crypto.js +2 -2
- package/dist/dev-protocol.d.cts +3 -3
- package/dist/dev-protocol.d.ts +3 -3
- package/dist/dev-protocol.js +1 -2
- package/dist/fs.cjs +12 -2
- package/dist/fs.d.cts +7 -1
- package/dist/fs.d.ts +7 -1
- package/dist/fs.js +10 -1
- 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-macos-D6p2SmUj.js +20 -0
- package/dist/native-macos-DLwo_ii9.cjs +31 -0
- package/dist/native-runtime-C85Nuc4F.js +10 -0
- package/dist/native-runtime-CbPzrs8j.d.cts +33 -0
- package/dist/{native-runtime-CdeT0JyQ.cjs → native-runtime-CsXnXkQn.cjs} +1 -14
- package/dist/native-runtime-DxHSrsTX.d.ts +33 -0
- package/dist/native.cjs +35 -32
- package/dist/native.d.cts +4 -34
- package/dist/native.d.ts +3 -33
- package/dist/native.js +36 -34
- package/dist/runtime.d.cts +1 -2
- package/dist/runtime.d.ts +1 -2
- package/dist/schema-BOuUHcqo.d.cts +58 -0
- package/dist/schema-DVmoD9JL.js +90 -0
- package/dist/schema-bxeeCyLn.cjs +102 -0
- package/dist/schema-ipsECAso.d.ts +58 -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.cjs +765 -0
- package/dist/state.d.cts +129 -0
- package/dist/state.d.ts +129 -0
- package/dist/state.js +747 -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.cjs +113 -0
- package/dist/ui.d.cts +30 -0
- package/dist/ui.d.ts +30 -0
- package/dist/ui.js +110 -0
- package/metro-config.cjs +18 -13
- package/package.json +48 -13
- package/templates/basic/app/index.tsx +136 -0
- package/templates/basic/app.config.ts +4 -2
- 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/native-runtime-BoqybBBf.js +0 -18
- package/dist/native-runtime-BoqybBBf.js.map +0 -1
- package/dist/native.d.cts.map +0 -1
- package/dist/native.d.ts.map +0 -1
- package/dist/native.js.map +0 -1
- package/dist/runtime.d.cts.map +0 -1
- package/dist/runtime.d.ts.map +0 -1
- package/templates/basic/app.tsx +0 -18
package/dist/ui.cjs
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_native_runtime = require('./native-runtime-CsXnXkQn.cjs');
|
|
3
|
+
let react_native = require("react-native");
|
|
4
|
+
react_native = require_chunk.__toESM(react_native);
|
|
5
|
+
|
|
6
|
+
//#region src/ui.tsx
|
|
7
|
+
function textFromChildren(children) {
|
|
8
|
+
if (typeof children === "string" || typeof children === "number") return String(children);
|
|
9
|
+
if (Array.isArray(children)) return children.filter((child) => typeof child === "string" || typeof child === "number").join("");
|
|
10
|
+
}
|
|
11
|
+
function styleFromProps(style) {
|
|
12
|
+
return react_native.StyleSheet.flatten(style);
|
|
13
|
+
}
|
|
14
|
+
function colorFromHex(hex) {
|
|
15
|
+
const value = hex.trim().replace(/^#/, "");
|
|
16
|
+
const normalized = value.length === 3 ? value.split("").map((part) => `${part}${part}`).join("") : value;
|
|
17
|
+
if (!/^[\da-f]{6}$/i.test(normalized)) return;
|
|
18
|
+
const number = Number.parseInt(normalized, 16);
|
|
19
|
+
const red = (number >> 16 & 255) / 255;
|
|
20
|
+
const green = (number >> 8 & 255) / 255;
|
|
21
|
+
const blue = (number & 255) / 255;
|
|
22
|
+
return UIColor.colorWithRedGreenBlueAlpha(red, green, blue, 1);
|
|
23
|
+
}
|
|
24
|
+
function colorFromStyle(value) {
|
|
25
|
+
return typeof value === "string" ? colorFromHex(value) : void 0;
|
|
26
|
+
}
|
|
27
|
+
function labelText(props) {
|
|
28
|
+
return props.text ?? textFromChildren(props.children) ?? "";
|
|
29
|
+
}
|
|
30
|
+
function buttonTitle(props) {
|
|
31
|
+
return props.title ?? textFromChildren(props.children) ?? "";
|
|
32
|
+
}
|
|
33
|
+
function defaultLabelColor(tone) {
|
|
34
|
+
if (tone === "secondary") return UIColor.secondaryLabelColor;
|
|
35
|
+
if (tone === "tertiary") return UIColor.tertiaryLabelColor;
|
|
36
|
+
return UIColor.labelColor;
|
|
37
|
+
}
|
|
38
|
+
function buttonConfiguration(variant) {
|
|
39
|
+
if (variant === "secondary") return UIButtonConfiguration.borderedButtonConfiguration();
|
|
40
|
+
if (variant === "plain") return UIButtonConfiguration.plainButtonConfiguration();
|
|
41
|
+
return UIButtonConfiguration.borderedProminentButtonConfiguration();
|
|
42
|
+
}
|
|
43
|
+
function buttonSize(size) {
|
|
44
|
+
if (size === "small") return UIButtonConfigurationSize.Small;
|
|
45
|
+
if (size === "large") return UIButtonConfigurationSize.Large;
|
|
46
|
+
return UIButtonConfigurationSize.Medium;
|
|
47
|
+
}
|
|
48
|
+
function fontFromStyle(style) {
|
|
49
|
+
if (typeof style?.fontSize !== "number") return;
|
|
50
|
+
if (style.fontWeight === "700" || style.fontWeight === "bold") return UIFont.boldSystemFontOfSize(style.fontSize);
|
|
51
|
+
return UIFont.systemFontOfSize(style.fontSize);
|
|
52
|
+
}
|
|
53
|
+
const Label = require_native_runtime.ensureNativeScript().defineUIKitView({
|
|
54
|
+
name: "Label",
|
|
55
|
+
layout: {
|
|
56
|
+
sizing: "intrinsic",
|
|
57
|
+
defaultSize: {
|
|
58
|
+
width: 1,
|
|
59
|
+
height: 24
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
create() {
|
|
63
|
+
const label = UILabel.new();
|
|
64
|
+
label.adjustsFontForContentSizeCategory = true;
|
|
65
|
+
return label;
|
|
66
|
+
},
|
|
67
|
+
update(label, props, _previousProps, ctx) {
|
|
68
|
+
const style = styleFromProps(props.style);
|
|
69
|
+
label.text = labelText(props);
|
|
70
|
+
label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
|
|
71
|
+
label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
|
|
72
|
+
label.numberOfLines = props.numberOfLines ?? 0;
|
|
73
|
+
if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
|
|
74
|
+
else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
|
|
75
|
+
else label.textAlignment = NSTextAlignment.Left;
|
|
76
|
+
ctx?.invalidateLayout();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const Button = require_native_runtime.ensureNativeScript().defineUIKitView({
|
|
80
|
+
name: "Button",
|
|
81
|
+
layout: {
|
|
82
|
+
sizing: "intrinsic",
|
|
83
|
+
defaultSize: {
|
|
84
|
+
width: 1,
|
|
85
|
+
height: 34
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
create(ctx) {
|
|
89
|
+
const button = UIButton.buttonWithType(UIButtonType.System);
|
|
90
|
+
ctx.targetAction(button, UIControlEvents.TouchUpInside, () => {
|
|
91
|
+
ctx.emit("onPress");
|
|
92
|
+
});
|
|
93
|
+
return button;
|
|
94
|
+
},
|
|
95
|
+
update(button, props, _previousProps, ctx) {
|
|
96
|
+
const style = styleFromProps(props.style);
|
|
97
|
+
const configuration = buttonConfiguration(props.variant);
|
|
98
|
+
configuration.title = buttonTitle(props);
|
|
99
|
+
configuration.buttonSize = buttonSize(props.size);
|
|
100
|
+
configuration.showsActivityIndicator = props.loading ?? false;
|
|
101
|
+
const foregroundColor = colorFromStyle(style?.color);
|
|
102
|
+
if (foregroundColor) configuration.baseForegroundColor = foregroundColor;
|
|
103
|
+
const backgroundColor = colorFromStyle(style?.backgroundColor);
|
|
104
|
+
if (backgroundColor) configuration.baseBackgroundColor = backgroundColor;
|
|
105
|
+
button.configuration = configuration;
|
|
106
|
+
button.enabled = !(props.disabled || props.loading);
|
|
107
|
+
ctx?.invalidateLayout();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.Button = Button;
|
|
113
|
+
exports.Label = Label;
|
package/dist/ui.d.cts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import * as _nativescript_react_native0 from "@nativescript/react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/ui.d.ts
|
|
6
|
+
type NativeStyle = ViewStyle & TextStyle;
|
|
7
|
+
type ButtonVariant = 'primary' | 'secondary' | 'plain';
|
|
8
|
+
type ButtonSize = 'regular' | 'small' | 'large';
|
|
9
|
+
type ButtonProps = {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
title?: string;
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
style?: StyleProp<NativeStyle>;
|
|
18
|
+
};
|
|
19
|
+
type LabelTone = 'primary' | 'secondary' | 'tertiary';
|
|
20
|
+
type LabelProps = {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
text?: string;
|
|
23
|
+
tone?: LabelTone;
|
|
24
|
+
numberOfLines?: number;
|
|
25
|
+
style?: StyleProp<NativeStyle>;
|
|
26
|
+
};
|
|
27
|
+
declare const Label: _nativescript_react_native0.UIKitViewComponent<LabelProps, UILabel>;
|
|
28
|
+
declare const Button: _nativescript_react_native0.UIKitViewComponent<ButtonProps, UIButton>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Button, ButtonProps, ButtonSize, ButtonVariant, Label, LabelProps, LabelTone };
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as _nativescript_react_native0 from "@nativescript/react-native";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/ui.d.ts
|
|
6
|
+
type NativeStyle = ViewStyle & TextStyle;
|
|
7
|
+
type ButtonVariant = 'primary' | 'secondary' | 'plain';
|
|
8
|
+
type ButtonSize = 'regular' | 'small' | 'large';
|
|
9
|
+
type ButtonProps = {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
title?: string;
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
style?: StyleProp<NativeStyle>;
|
|
18
|
+
};
|
|
19
|
+
type LabelTone = 'primary' | 'secondary' | 'tertiary';
|
|
20
|
+
type LabelProps = {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
text?: string;
|
|
23
|
+
tone?: LabelTone;
|
|
24
|
+
numberOfLines?: number;
|
|
25
|
+
style?: StyleProp<NativeStyle>;
|
|
26
|
+
};
|
|
27
|
+
declare const Label: _nativescript_react_native0.UIKitViewComponent<LabelProps, UILabel>;
|
|
28
|
+
declare const Button: _nativescript_react_native0.UIKitViewComponent<ButtonProps, UIButton>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Button, ButtonProps, ButtonSize, ButtonVariant, Label, LabelProps, LabelTone };
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { t as ensureNativeScript } from "./native-runtime-C85Nuc4F.js";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
|
|
4
|
+
//#region src/ui.tsx
|
|
5
|
+
function textFromChildren(children) {
|
|
6
|
+
if (typeof children === "string" || typeof children === "number") return String(children);
|
|
7
|
+
if (Array.isArray(children)) return children.filter((child) => typeof child === "string" || typeof child === "number").join("");
|
|
8
|
+
}
|
|
9
|
+
function styleFromProps(style) {
|
|
10
|
+
return StyleSheet.flatten(style);
|
|
11
|
+
}
|
|
12
|
+
function colorFromHex(hex) {
|
|
13
|
+
const value = hex.trim().replace(/^#/, "");
|
|
14
|
+
const normalized = value.length === 3 ? value.split("").map((part) => `${part}${part}`).join("") : value;
|
|
15
|
+
if (!/^[\da-f]{6}$/i.test(normalized)) return;
|
|
16
|
+
const number = Number.parseInt(normalized, 16);
|
|
17
|
+
const red = (number >> 16 & 255) / 255;
|
|
18
|
+
const green = (number >> 8 & 255) / 255;
|
|
19
|
+
const blue = (number & 255) / 255;
|
|
20
|
+
return UIColor.colorWithRedGreenBlueAlpha(red, green, blue, 1);
|
|
21
|
+
}
|
|
22
|
+
function colorFromStyle(value) {
|
|
23
|
+
return typeof value === "string" ? colorFromHex(value) : void 0;
|
|
24
|
+
}
|
|
25
|
+
function labelText(props) {
|
|
26
|
+
return props.text ?? textFromChildren(props.children) ?? "";
|
|
27
|
+
}
|
|
28
|
+
function buttonTitle(props) {
|
|
29
|
+
return props.title ?? textFromChildren(props.children) ?? "";
|
|
30
|
+
}
|
|
31
|
+
function defaultLabelColor(tone) {
|
|
32
|
+
if (tone === "secondary") return UIColor.secondaryLabelColor;
|
|
33
|
+
if (tone === "tertiary") return UIColor.tertiaryLabelColor;
|
|
34
|
+
return UIColor.labelColor;
|
|
35
|
+
}
|
|
36
|
+
function buttonConfiguration(variant) {
|
|
37
|
+
if (variant === "secondary") return UIButtonConfiguration.borderedButtonConfiguration();
|
|
38
|
+
if (variant === "plain") return UIButtonConfiguration.plainButtonConfiguration();
|
|
39
|
+
return UIButtonConfiguration.borderedProminentButtonConfiguration();
|
|
40
|
+
}
|
|
41
|
+
function buttonSize(size) {
|
|
42
|
+
if (size === "small") return UIButtonConfigurationSize.Small;
|
|
43
|
+
if (size === "large") return UIButtonConfigurationSize.Large;
|
|
44
|
+
return UIButtonConfigurationSize.Medium;
|
|
45
|
+
}
|
|
46
|
+
function fontFromStyle(style) {
|
|
47
|
+
if (typeof style?.fontSize !== "number") return;
|
|
48
|
+
if (style.fontWeight === "700" || style.fontWeight === "bold") return UIFont.boldSystemFontOfSize(style.fontSize);
|
|
49
|
+
return UIFont.systemFontOfSize(style.fontSize);
|
|
50
|
+
}
|
|
51
|
+
const Label = ensureNativeScript().defineUIKitView({
|
|
52
|
+
name: "Label",
|
|
53
|
+
layout: {
|
|
54
|
+
sizing: "intrinsic",
|
|
55
|
+
defaultSize: {
|
|
56
|
+
width: 1,
|
|
57
|
+
height: 24
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
create() {
|
|
61
|
+
const label = UILabel.new();
|
|
62
|
+
label.adjustsFontForContentSizeCategory = true;
|
|
63
|
+
return label;
|
|
64
|
+
},
|
|
65
|
+
update(label, props, _previousProps, ctx) {
|
|
66
|
+
const style = styleFromProps(props.style);
|
|
67
|
+
label.text = labelText(props);
|
|
68
|
+
label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
|
|
69
|
+
label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
|
|
70
|
+
label.numberOfLines = props.numberOfLines ?? 0;
|
|
71
|
+
if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
|
|
72
|
+
else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
|
|
73
|
+
else label.textAlignment = NSTextAlignment.Left;
|
|
74
|
+
ctx?.invalidateLayout();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const Button = ensureNativeScript().defineUIKitView({
|
|
78
|
+
name: "Button",
|
|
79
|
+
layout: {
|
|
80
|
+
sizing: "intrinsic",
|
|
81
|
+
defaultSize: {
|
|
82
|
+
width: 1,
|
|
83
|
+
height: 34
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
create(ctx) {
|
|
87
|
+
const button = UIButton.buttonWithType(UIButtonType.System);
|
|
88
|
+
ctx.targetAction(button, UIControlEvents.TouchUpInside, () => {
|
|
89
|
+
ctx.emit("onPress");
|
|
90
|
+
});
|
|
91
|
+
return button;
|
|
92
|
+
},
|
|
93
|
+
update(button, props, _previousProps, ctx) {
|
|
94
|
+
const style = styleFromProps(props.style);
|
|
95
|
+
const configuration = buttonConfiguration(props.variant);
|
|
96
|
+
configuration.title = buttonTitle(props);
|
|
97
|
+
configuration.buttonSize = buttonSize(props.size);
|
|
98
|
+
configuration.showsActivityIndicator = props.loading ?? false;
|
|
99
|
+
const foregroundColor = colorFromStyle(style?.color);
|
|
100
|
+
if (foregroundColor) configuration.baseForegroundColor = foregroundColor;
|
|
101
|
+
const backgroundColor = colorFromStyle(style?.backgroundColor);
|
|
102
|
+
if (backgroundColor) configuration.baseBackgroundColor = backgroundColor;
|
|
103
|
+
button.configuration = configuration;
|
|
104
|
+
button.enabled = !(props.disabled || props.loading);
|
|
105
|
+
ctx?.invalidateLayout();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Button, Label };
|
package/metro-config.cjs
CHANGED
|
@@ -14,23 +14,28 @@ function getDefaultConfig(projectRoot) {
|
|
|
14
14
|
const appRoot = process.env.BLEAM_PROJECT_ROOT ?? projectRoot
|
|
15
15
|
const port = Number(process.env.BLEAM_DEV_PORT ?? 8081)
|
|
16
16
|
const origin = process.env.BLEAM_DEV_ORIGIN ?? `http://localhost:${port}`
|
|
17
|
+
const platform = process.env.BLEAM_DEV_PLATFORM === 'ios' ? 'ios' : 'macos'
|
|
17
18
|
const config = getExpoDefaultConfig(projectRoot)
|
|
18
19
|
const upstreamEnhanceMiddleware = config.server.enhanceMiddleware
|
|
19
20
|
const projectNodeModules = path.join(appRoot, 'node_modules')
|
|
20
21
|
const runtimeNodeModules = path.dirname(packageRoot('react'))
|
|
21
|
-
const nodeModulesPaths = Array.from(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const nodeModulesPaths = Array.from(
|
|
23
|
+
new Set([
|
|
24
|
+
projectNodeModules,
|
|
25
|
+
bleamNodeModules,
|
|
26
|
+
runtimeNodeModules,
|
|
27
|
+
...(config.resolver.nodeModulesPaths ?? []),
|
|
28
|
+
]),
|
|
29
|
+
)
|
|
27
30
|
|
|
28
|
-
config.watchFolders = Array.from(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
config.watchFolders = Array.from(
|
|
32
|
+
new Set([
|
|
33
|
+
appRoot,
|
|
34
|
+
__dirname,
|
|
35
|
+
...nodeModulesPaths,
|
|
36
|
+
...(config.watchFolders ?? []),
|
|
37
|
+
]),
|
|
38
|
+
).filter((directory) => fs.existsSync(directory))
|
|
34
39
|
|
|
35
40
|
config.resolver.nodeModulesPaths = nodeModulesPaths
|
|
36
41
|
|
|
@@ -55,7 +60,7 @@ function getDefaultConfig(projectRoot) {
|
|
|
55
60
|
name: process.env.BLEAM_DEV_NAME ?? 'bleam-app',
|
|
56
61
|
sdkVersion: process.env.BLEAM_DEV_SDK_VERSION ?? bleamVersion,
|
|
57
62
|
runtimeVersion: process.env.BLEAM_DEV_RUNTIME_VERSION ?? bleamVersion,
|
|
58
|
-
platform
|
|
63
|
+
platform,
|
|
59
64
|
bundleUrl: `${origin}/.expo/.virtual-metro-entry.bundle?platform=ios&dev=true&minify=false&runModule=true`,
|
|
60
65
|
dev: true,
|
|
61
66
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bleam",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"packageManager": "yarn@1.22.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -17,26 +17,26 @@
|
|
|
17
17
|
"build": "tsdown",
|
|
18
18
|
"typecheck": "tsc --noEmit -p tsconfig.build.json"
|
|
19
19
|
},
|
|
20
|
-
"prettier": {
|
|
21
|
-
"semi": false,
|
|
22
|
-
"singleQuote": true,
|
|
23
|
-
"trailingComma": "all",
|
|
24
|
-
"printWidth": 80,
|
|
25
|
-
"tabWidth": 2
|
|
26
|
-
},
|
|
27
20
|
"devDependencies": {
|
|
21
|
+
"@nativescript/types-ios": "9.0.0",
|
|
28
22
|
"@types/node": "^25.5.0",
|
|
29
|
-
"
|
|
23
|
+
"@types/ws": "^8.18.1",
|
|
30
24
|
"tsdown": "^0.15.6"
|
|
31
25
|
},
|
|
32
26
|
"dependencies": {
|
|
27
|
+
"@biomejs/biome": "^2.2.0",
|
|
28
|
+
"@expo/metro": "56.0.0",
|
|
29
|
+
"@nativescript-community/sqlite": "^3.5.9",
|
|
33
30
|
"@nativescript/react-native": "9.0.0-preview.4",
|
|
34
|
-
"@types/react": "~19.2.
|
|
35
|
-
"expo": "
|
|
31
|
+
"@types/react": "~19.2.17",
|
|
32
|
+
"expo": "57",
|
|
36
33
|
"react": "19.2.3",
|
|
37
|
-
"react-native": "0.
|
|
34
|
+
"react-native": "0.86.0",
|
|
38
35
|
"tsx": "^4.21.0",
|
|
39
|
-
"typescript": "~6.0.3"
|
|
36
|
+
"typescript": "~6.0.3",
|
|
37
|
+
"ws": "^8.21.0",
|
|
38
|
+
"yocto-spinner": "^1.2.1",
|
|
39
|
+
"yoctocolors": "^2.1.2"
|
|
40
40
|
},
|
|
41
41
|
"expo": {
|
|
42
42
|
"install": {
|
|
@@ -54,6 +54,16 @@
|
|
|
54
54
|
"import": "./dist/index.js",
|
|
55
55
|
"require": "./dist/index.cjs"
|
|
56
56
|
},
|
|
57
|
+
"./ai": {
|
|
58
|
+
"types": "./dist/ai.d.ts",
|
|
59
|
+
"import": "./dist/ai.js",
|
|
60
|
+
"require": "./dist/ai.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./animated": {
|
|
63
|
+
"types": "./dist/animated.d.ts",
|
|
64
|
+
"import": "./dist/animated.js",
|
|
65
|
+
"require": "./dist/animated.cjs"
|
|
66
|
+
},
|
|
57
67
|
"./app": {
|
|
58
68
|
"types": "./dist/app.d.ts",
|
|
59
69
|
"import": "./dist/app.js",
|
|
@@ -64,6 +74,11 @@
|
|
|
64
74
|
"import": "./dist/bundler.js",
|
|
65
75
|
"require": "./dist/bundler.cjs"
|
|
66
76
|
},
|
|
77
|
+
"./chrome": {
|
|
78
|
+
"types": "./dist/chrome.d.ts",
|
|
79
|
+
"import": "./dist/chrome.js",
|
|
80
|
+
"require": "./dist/chrome.cjs"
|
|
81
|
+
},
|
|
67
82
|
"./config": {
|
|
68
83
|
"types": "./dist/config.d.ts",
|
|
69
84
|
"import": "./dist/config.js",
|
|
@@ -94,6 +109,26 @@
|
|
|
94
109
|
"import": "./dist/runtime.js",
|
|
95
110
|
"require": "./dist/runtime.cjs"
|
|
96
111
|
},
|
|
112
|
+
"./schema": {
|
|
113
|
+
"types": "./dist/schema.d.ts",
|
|
114
|
+
"import": "./dist/schema.js",
|
|
115
|
+
"require": "./dist/schema.cjs"
|
|
116
|
+
},
|
|
117
|
+
"./state": {
|
|
118
|
+
"types": "./dist/state.d.ts",
|
|
119
|
+
"import": "./dist/state.js",
|
|
120
|
+
"require": "./dist/state.cjs"
|
|
121
|
+
},
|
|
122
|
+
"./styles": {
|
|
123
|
+
"types": "./dist/styles.d.ts",
|
|
124
|
+
"import": "./dist/styles.js",
|
|
125
|
+
"require": "./dist/styles.cjs"
|
|
126
|
+
},
|
|
127
|
+
"./ui": {
|
|
128
|
+
"types": "./dist/ui.d.ts",
|
|
129
|
+
"import": "./dist/ui.js",
|
|
130
|
+
"require": "./dist/ui.cjs"
|
|
131
|
+
},
|
|
97
132
|
"./package.json": "./package.json",
|
|
98
133
|
"./metro-config": {
|
|
99
134
|
"require": "./metro-config.cjs"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Toolbar, Window } from 'bleam/chrome'
|
|
2
|
+
import { sx } from 'bleam/styles'
|
|
3
|
+
import { Button } from 'bleam/ui'
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
import { Text, View } from 'react-native'
|
|
6
|
+
|
|
7
|
+
export default function App() {
|
|
8
|
+
const [count, setCount] = useState(0)
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<View style={sx('flex-1', 'bg-system')}>
|
|
12
|
+
<Window title="Bleam" titleVisibility="visible" />
|
|
13
|
+
<Toolbar toolbarStyle="unified" />
|
|
14
|
+
|
|
15
|
+
<View style={sx('flex-1', 'items-center', 'justify-center', 'p-6')}>
|
|
16
|
+
<View style={sx('flex-1', 'w-full', 'max-w-5xl', 'max-h-3xl')}>
|
|
17
|
+
<View style={sx('flex-1', 'items-center', 'justify-center', 'px-6')}>
|
|
18
|
+
<View style={sx('items-center', 'gap-8')}>
|
|
19
|
+
<View
|
|
20
|
+
style={sx('h-44', 'w-44', 'items-center', 'justify-center')}
|
|
21
|
+
>
|
|
22
|
+
<View
|
|
23
|
+
style={sx(
|
|
24
|
+
'absolute',
|
|
25
|
+
'top-0',
|
|
26
|
+
'h-24',
|
|
27
|
+
'w-32',
|
|
28
|
+
'rounded-2xl',
|
|
29
|
+
'border',
|
|
30
|
+
'border-tertiary-label',
|
|
31
|
+
'bg-system',
|
|
32
|
+
'items-center',
|
|
33
|
+
'justify-center',
|
|
34
|
+
'rotate-30',
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
<Text
|
|
38
|
+
style={sx(
|
|
39
|
+
'text-3xl',
|
|
40
|
+
'font-semibold',
|
|
41
|
+
'text-system-cyan',
|
|
42
|
+
'-rotate-30',
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
B
|
|
46
|
+
</Text>
|
|
47
|
+
</View>
|
|
48
|
+
|
|
49
|
+
<View
|
|
50
|
+
style={sx(
|
|
51
|
+
'absolute',
|
|
52
|
+
'bottom-2',
|
|
53
|
+
'h-24',
|
|
54
|
+
'w-32',
|
|
55
|
+
'rounded-2xl',
|
|
56
|
+
'border-2',
|
|
57
|
+
'border-system-purple',
|
|
58
|
+
'bg-secondary-system',
|
|
59
|
+
'items-center',
|
|
60
|
+
'justify-center',
|
|
61
|
+
'rotate-30',
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
<Text
|
|
65
|
+
style={sx(
|
|
66
|
+
'text-3xl',
|
|
67
|
+
'font-bold',
|
|
68
|
+
'text-system-purple',
|
|
69
|
+
'-rotate-30',
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
JS
|
|
73
|
+
</Text>
|
|
74
|
+
</View>
|
|
75
|
+
</View>
|
|
76
|
+
|
|
77
|
+
<View style={sx('items-center')}>
|
|
78
|
+
<Text
|
|
79
|
+
style={sx(
|
|
80
|
+
'text-5xl',
|
|
81
|
+
'font-semibold',
|
|
82
|
+
'tracking-tighter',
|
|
83
|
+
'text-label',
|
|
84
|
+
'text-center',
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
Get started
|
|
88
|
+
</Text>
|
|
89
|
+
<Text
|
|
90
|
+
style={sx(
|
|
91
|
+
'mt-6',
|
|
92
|
+
'text-lg',
|
|
93
|
+
'text-secondary-label',
|
|
94
|
+
'text-center',
|
|
95
|
+
)}
|
|
96
|
+
>
|
|
97
|
+
Edit{' '}
|
|
98
|
+
<Text
|
|
99
|
+
style={sx(
|
|
100
|
+
'rounded-md',
|
|
101
|
+
'italic',
|
|
102
|
+
'px-2',
|
|
103
|
+
'py-1',
|
|
104
|
+
'text-label',
|
|
105
|
+
)}
|
|
106
|
+
>
|
|
107
|
+
app/index.tsx
|
|
108
|
+
</Text>{' '}
|
|
109
|
+
and save to test{' '}
|
|
110
|
+
<Text
|
|
111
|
+
style={sx(
|
|
112
|
+
'rounded-md',
|
|
113
|
+
'italic',
|
|
114
|
+
'px-2',
|
|
115
|
+
'py-1',
|
|
116
|
+
'text-label',
|
|
117
|
+
)}
|
|
118
|
+
>
|
|
119
|
+
live reload
|
|
120
|
+
</Text>
|
|
121
|
+
</Text>
|
|
122
|
+
</View>
|
|
123
|
+
|
|
124
|
+
<Button
|
|
125
|
+
title={`Count is ${count}`}
|
|
126
|
+
variant="secondary"
|
|
127
|
+
size="regular"
|
|
128
|
+
onPress={() => setCount((value) => value + 1)}
|
|
129
|
+
/>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
</View>
|
|
134
|
+
</View>
|
|
135
|
+
)
|
|
136
|
+
}
|
package/dist/app.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.cts","names":[],"sources":["../src/app.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,WAAA,YAAuB"}
|
package/dist/app.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","names":[],"sources":["../src/app.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,WAAA,YAAuB"}
|
package/dist/app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","names":[],"sources":["../src/app.ts"],"sourcesContent":["import { registerRootComponent } from 'expo'\nimport type { ComponentType } from 'react'\n\nexport function registerApp(component: ComponentType) {\n registerRootComponent(component)\n}\n"],"mappings":";;;AAGA,SAAgB,YAAY,WAA0B;AACpD,uBAAsB,UAAU"}
|
package/dist/bundler.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.cts","names":[],"sources":["../src/bundler.ts"],"sourcesContent":[],"mappings":";UAAiB,gBAAA;EAAA,WAAA,EAAA,MAAgB;EAKhB,IAAA,CAAA,EAAA,MAAA;AAKjB;AAOiB,UAZA,eAAA,CAYY;EAKZ,GAAA,EAAA,MAAA;EACA,KAAA,EAAA,EAhBN,OAgBM,CAAA,IAAA,CAAA;;AAAmB,UAbnB,aAAA,CAamB;EAAO,WAAA,EAAA,MAAA;EAG1B,KAAA,EAAA,MAAO;EACN,QAAA,EAAA,OAAA;EAAwB,GAAA,EAAA,OAAA;;AAAD,UAVxB,YAAA,CAUwB;;;;UALxB,SAAA;iBACA,mBAAmB,QAAQ;;UAG3B,OAAA;kBACC,gBAAgB,QAAQ"}
|
package/dist/bundler.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","names":[],"sources":["../src/bundler.ts"],"sourcesContent":[],"mappings":";UAAiB,gBAAA;EAAA,WAAA,EAAA,MAAgB;EAKhB,IAAA,CAAA,EAAA,MAAA;AAKjB;AAOiB,UAZA,eAAA,CAYY;EAKZ,GAAA,EAAA,MAAA;EACA,KAAA,EAAA,EAhBN,OAgBM,CAAA,IAAA,CAAA;;AAAmB,UAbnB,aAAA,CAamB;EAAO,WAAA,EAAA,MAAA;EAG1B,KAAA,EAAA,MAAO;EACN,QAAA,EAAA,OAAA;EAAwB,GAAA,EAAA,OAAA;;AAAD,UAVxB,YAAA,CAUwB;;;;UALxB,SAAA;iBACA,mBAAmB,QAAQ;;UAG3B,OAAA;kBACC,gBAAgB,QAAQ"}
|