bleam 0.0.0 → 0.0.3

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 (84) hide show
  1. package/dist/app.cjs +11 -0
  2. package/dist/app.d.cts +7 -0
  3. package/dist/app.d.cts.map +1 -0
  4. package/dist/app.d.ts +7 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +10 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/bundler.cjs +0 -0
  9. package/dist/bundler.d.cts +28 -0
  10. package/dist/bundler.d.cts.map +1 -0
  11. package/dist/bundler.d.ts +28 -0
  12. package/dist/bundler.d.ts.map +1 -0
  13. package/dist/bundler.js +1 -0
  14. package/dist/chunk-CUT6urMc.cjs +30 -0
  15. package/dist/cli.cjs +477 -0
  16. package/dist/cli.d.cts +1 -0
  17. package/dist/cli.d.ts +1 -0
  18. package/dist/cli.js +470 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/config.cjs +26 -0
  21. package/dist/config.d.cts +28 -0
  22. package/dist/config.d.cts.map +1 -0
  23. package/dist/config.d.ts +28 -0
  24. package/dist/config.d.ts.map +1 -0
  25. package/dist/config.js +25 -0
  26. package/dist/config.js.map +1 -0
  27. package/dist/crypto-BNhWeXMj.cjs +15 -0
  28. package/dist/crypto-Bg8cD8wX.d.cts +8 -0
  29. package/dist/crypto-Bg8cD8wX.d.cts.map +1 -0
  30. package/dist/crypto-CCA_hvao.js +11 -0
  31. package/dist/crypto-CCA_hvao.js.map +1 -0
  32. package/dist/crypto-IOzbNoJD.d.ts +8 -0
  33. package/dist/crypto-IOzbNoJD.d.ts.map +1 -0
  34. package/dist/crypto.cjs +4 -0
  35. package/dist/crypto.d.cts +2 -0
  36. package/dist/crypto.d.ts +2 -0
  37. package/dist/crypto.js +4 -0
  38. package/dist/dev-protocol.cjs +16 -0
  39. package/dist/dev-protocol.d.cts +16 -0
  40. package/dist/dev-protocol.d.cts.map +1 -0
  41. package/dist/dev-protocol.d.ts +16 -0
  42. package/dist/dev-protocol.d.ts.map +1 -0
  43. package/dist/dev-protocol.js +14 -0
  44. package/dist/dev-protocol.js.map +1 -0
  45. package/dist/fs-BK7joD1g.js +13 -0
  46. package/dist/fs-BK7joD1g.js.map +1 -0
  47. package/dist/fs-CEhcjuN6.d.ts +9 -0
  48. package/dist/fs-CEhcjuN6.d.ts.map +1 -0
  49. package/dist/fs-CfE8CHf_.d.cts +9 -0
  50. package/dist/fs-CfE8CHf_.d.cts.map +1 -0
  51. package/dist/fs-DKHYTPua.cjs +18 -0
  52. package/dist/fs.cjs +3 -0
  53. package/dist/fs.d.cts +2 -0
  54. package/dist/fs.d.ts +2 -0
  55. package/dist/fs.js +3 -0
  56. package/dist/index.cjs +6 -0
  57. package/dist/index.d.cts +3 -0
  58. package/dist/index.d.ts +3 -0
  59. package/dist/index.js +5 -0
  60. package/dist/native-runtime-BoqybBBf.js +18 -0
  61. package/dist/native-runtime-BoqybBBf.js.map +1 -0
  62. package/dist/native-runtime-CdeT0JyQ.cjs +30 -0
  63. package/dist/native.cjs +132 -0
  64. package/dist/native.d.cts +64 -0
  65. package/dist/native.d.cts.map +1 -0
  66. package/dist/native.d.ts +64 -0
  67. package/dist/native.d.ts.map +1 -0
  68. package/dist/native.js +133 -0
  69. package/dist/native.js.map +1 -0
  70. package/dist/runtime.cjs +0 -0
  71. package/dist/runtime.d.cts +14 -0
  72. package/dist/runtime.d.cts.map +1 -0
  73. package/dist/runtime.d.ts +14 -0
  74. package/dist/runtime.d.ts.map +1 -0
  75. package/dist/runtime.js +1 -0
  76. package/metro-config.cjs +75 -0
  77. package/package.json +93 -2
  78. package/templates/basic/app.config.ts +3 -0
  79. package/templates/basic/app.tsx +18 -0
  80. package/tsconfig.base.json +7 -0
  81. package/tsconfig.json +3 -0
  82. package/.editorconfig +0 -8
  83. package/.gitattributes +0 -4
  84. package/README.md +0 -1
package/dist/native.js ADDED
@@ -0,0 +1,133 @@
1
+ import { n as globals, t as ensureNativeScript } from "./native-runtime-BoqybBBf.js";
2
+
3
+ //#region src/native.ts
4
+ function colorFromHex(hex) {
5
+ const value = hex.trim().replace(/^#/, "");
6
+ const normalized = value.length === 3 ? value.split("").map((part) => `${part}${part}`).join("") : value;
7
+ if (!/^[\da-f]{6}$/i.test(normalized)) throw new Error(`Invalid native color: ${hex}`);
8
+ const number = Number.parseInt(normalized, 16);
9
+ const red = (number >> 16 & 255) / 255;
10
+ const green = (number >> 8 & 255) / 255;
11
+ const blue = (number & 255) / 255;
12
+ return globals().UIColor.colorWithRedGreenBlueAlpha(red, green, blue, 1);
13
+ }
14
+ function forEachNativeObject(collection, callback) {
15
+ const values = collection?.allObjects ?? collection;
16
+ if (Array.isArray(values)) {
17
+ values.forEach(callback);
18
+ return;
19
+ }
20
+ const count = Number(values?.count ?? 0);
21
+ for (let index = 0; index < count; index += 1) callback(values.objectAtIndex(index));
22
+ }
23
+ async function runOnUI(callback) {
24
+ return ensureNativeScript().runOnUI(callback);
25
+ }
26
+ async function setTintColor(hex) {
27
+ await runOnUI(() => {
28
+ const api = globals();
29
+ const color = colorFromHex(hex);
30
+ const application = api.UIApplication.sharedApplication;
31
+ if (application.keyWindow) application.keyWindow.tintColor = color;
32
+ forEachNativeObject(application.connectedScenes, (scene) => {
33
+ forEachNativeObject(scene.windows, (window) => {
34
+ window.tintColor = color;
35
+ });
36
+ });
37
+ });
38
+ }
39
+ async function setWindowTitle(title) {
40
+ await runOnUI(() => {
41
+ const api = globals();
42
+ const application = api.UIApplication.sharedApplication;
43
+ forEachNativeObject(application.connectedScenes, (scene) => {
44
+ if ("title" in scene) scene.title = title;
45
+ });
46
+ const appKit = api.NSApplication?.sharedApplication;
47
+ const window = appKit?.keyWindow ?? appKit?.mainWindow;
48
+ if (window && "title" in window) window.title = title;
49
+ });
50
+ }
51
+ function documentsDirectoryPath() {
52
+ const api = globals();
53
+ if (!api.NSSearchPathForDirectoriesInDomains) throw new Error("Native FileManager unavailable: NSSearchPathForDirectoriesInDomains missing");
54
+ if (typeof api.NSSearchPathDirectory?.Document !== "number") throw new Error("Native FileManager unavailable: NSSearchPathDirectory.Document missing");
55
+ if (typeof api.NSSearchPathDomainMask?.UserDomain !== "number") throw new Error("Native FileManager unavailable: NSSearchPathDomainMask.UserDomain missing");
56
+ const path = api.NSSearchPathForDirectoriesInDomains(api.NSSearchPathDirectory.Document, api.NSSearchPathDomainMask.UserDomain, true)?.objectAtIndex(0);
57
+ if (typeof path !== "string") throw new Error("Native FileManager unavailable: Documents directory missing");
58
+ return path;
59
+ }
60
+ function documentPath(name) {
61
+ return globals().NSString.stringWithString(documentsDirectoryPath()).stringByAppendingPathComponent(name);
62
+ }
63
+ async function writeDocumentText(name, text) {
64
+ await runOnUI(() => {
65
+ const api = globals();
66
+ const path = documentPath(name);
67
+ if (!api.NSString.stringWithString(text).writeToFileAtomicallyEncodingError(path, true, api.NSUTF8StringEncoding, null)) throw new Error(`Failed to write native document at ${path}`);
68
+ });
69
+ }
70
+ async function readDocumentText(name) {
71
+ let text = "";
72
+ await runOnUI(() => {
73
+ const api = globals();
74
+ text = String(api.NSString.stringWithContentsOfFileEncodingError(documentPath(name), api.NSUTF8StringEncoding, null));
75
+ });
76
+ return text;
77
+ }
78
+ async function documentExists(name) {
79
+ let exists = false;
80
+ await runOnUI(() => {
81
+ const api = globals();
82
+ exists = Boolean(api.NSFileManager.defaultManager.fileExistsAtPath(documentPath(name)));
83
+ });
84
+ return exists;
85
+ }
86
+ async function listDocuments() {
87
+ const names = [];
88
+ await runOnUI(() => {
89
+ forEachNativeObject(globals().NSFileManager.defaultManager.contentsOfDirectoryAtPathError(documentsDirectoryPath(), null), (item) => {
90
+ names.push(String(item));
91
+ });
92
+ });
93
+ return names;
94
+ }
95
+ const NativeLabel = ensureNativeScript().defineUIKitView({
96
+ name: "NativeLabel",
97
+ layout: {
98
+ sizing: "intrinsic",
99
+ defaultSize: {
100
+ width: 1,
101
+ height: 28
102
+ }
103
+ },
104
+ create() {
105
+ const api = globals();
106
+ const label = api.UILabel.new();
107
+ label.textAlignment = api.NSTextAlignment.Center;
108
+ label.font = api.UIFont.boldSystemFontOfSize(18);
109
+ return label;
110
+ },
111
+ update(label, props, previousProps, ctx) {
112
+ label.text = props.text;
113
+ label.textColor = colorFromHex(props.color ?? "#0a84ff");
114
+ ctx?.invalidateLayout();
115
+ }
116
+ });
117
+ const native = {
118
+ init: ensureNativeScript,
119
+ NativeLabel,
120
+ runOnUI,
121
+ ui: { setTintColor },
122
+ files: {
123
+ exists: documentExists,
124
+ listDocuments,
125
+ readText: readDocumentText,
126
+ writeText: writeDocumentText
127
+ },
128
+ window: { setTitle: setWindowTitle }
129
+ };
130
+
131
+ //#endregion
132
+ export { native };
133
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.js","names":["names: string[]"],"sources":["../src/native.ts"],"sourcesContent":["import { ensureNativeScript, globals } from './native-runtime'\n\nfunction colorFromHex(hex: string) {\n const value = hex.trim().replace(/^#/, '')\n const normalized = value.length === 3\n ? value.split('').map((part) => `${part}${part}`).join('')\n : value\n\n if (!/^[\\da-f]{6}$/i.test(normalized)) {\n throw new Error(`Invalid native color: ${hex}`)\n }\n\n const number = Number.parseInt(normalized, 16)\n const red = ((number >> 16) & 255) / 255\n const green = ((number >> 8) & 255) / 255\n const blue = (number & 255) / 255\n return globals().UIColor.colorWithRedGreenBlueAlpha(red, green, blue, 1)\n}\n\nfunction forEachNativeObject(collection: any, callback: (item: any) => void) {\n const values = collection?.allObjects ?? collection\n\n if (Array.isArray(values)) {\n values.forEach(callback)\n return\n }\n\n const count = Number(values?.count ?? 0)\n for (let index = 0; index < count; index += 1) {\n callback(values.objectAtIndex(index))\n }\n}\n\nasync function runOnUI<T>(callback: () => T) {\n return ensureNativeScript().runOnUI(callback)\n}\n\nasync function setTintColor(hex: string) {\n await runOnUI(() => {\n const api = globals()\n const color = colorFromHex(hex)\n const application = api.UIApplication.sharedApplication\n if (application.keyWindow) {\n application.keyWindow.tintColor = color\n }\n\n forEachNativeObject(application.connectedScenes, (scene) => {\n forEachNativeObject(scene.windows, (window) => {\n window.tintColor = color\n })\n })\n })\n}\n\nasync function setWindowTitle(title: string) {\n await runOnUI(() => {\n const api = globals()\n const application = api.UIApplication.sharedApplication\n\n forEachNativeObject(application.connectedScenes, (scene) => {\n if ('title' in scene) {\n scene.title = title\n }\n })\n\n const appKit = api.NSApplication?.sharedApplication\n const window = appKit?.keyWindow ?? appKit?.mainWindow\n if (window && 'title' in window) {\n window.title = title\n }\n })\n}\n\nfunction documentsDirectoryPath() {\n const api = globals()\n\n if (!api.NSSearchPathForDirectoriesInDomains) {\n throw new Error('Native FileManager unavailable: NSSearchPathForDirectoriesInDomains missing')\n }\n if (typeof api.NSSearchPathDirectory?.Document !== 'number') {\n throw new Error('Native FileManager unavailable: NSSearchPathDirectory.Document missing')\n }\n if (typeof api.NSSearchPathDomainMask?.UserDomain !== 'number') {\n throw new Error('Native FileManager unavailable: NSSearchPathDomainMask.UserDomain missing')\n }\n\n const paths = api.NSSearchPathForDirectoriesInDomains(\n api.NSSearchPathDirectory.Document,\n api.NSSearchPathDomainMask.UserDomain,\n true,\n )\n const path = paths?.objectAtIndex(0)\n if (typeof path !== 'string') {\n throw new Error('Native FileManager unavailable: Documents directory missing')\n }\n\n return path\n}\n\nfunction documentPath(name: string) {\n const api = globals()\n return api.NSString.stringWithString(\n documentsDirectoryPath(),\n ).stringByAppendingPathComponent(name) as string\n}\n\nasync function writeDocumentText(name: string, text: string) {\n await runOnUI(() => {\n const api = globals()\n const path = documentPath(name)\n const value = api.NSString.stringWithString(text)\n const didWrite = value.writeToFileAtomicallyEncodingError(\n path,\n true,\n api.NSUTF8StringEncoding,\n null,\n )\n\n if (!didWrite) {\n throw new Error(`Failed to write native document at ${path}`)\n }\n })\n}\n\nasync function readDocumentText(name: string) {\n let text = ''\n await runOnUI(() => {\n const api = globals()\n text = String(\n api.NSString.stringWithContentsOfFileEncodingError(\n documentPath(name),\n api.NSUTF8StringEncoding,\n null,\n ),\n )\n })\n return text\n}\n\nasync function documentExists(name: string) {\n let exists = false\n await runOnUI(() => {\n const api = globals()\n exists = Boolean(\n api.NSFileManager.defaultManager.fileExistsAtPath(documentPath(name)),\n )\n })\n return exists\n}\n\nasync function listDocuments() {\n const names: string[] = []\n await runOnUI(() => {\n const api = globals()\n const items = api.NSFileManager.defaultManager.contentsOfDirectoryAtPathError(\n documentsDirectoryPath(),\n null,\n )\n forEachNativeObject(items, (item) => {\n names.push(String(item))\n })\n })\n return names\n}\n\ntype NativeLabelProps = {\n text: string\n color?: string\n}\n\nconst NativeLabel = ensureNativeScript().defineUIKitView<NativeLabelProps, any>({\n name: 'NativeLabel',\n layout: {\n sizing: 'intrinsic',\n defaultSize: { width: 1, height: 28 },\n },\n create() {\n const api = globals()\n const label = api.UILabel.new()\n label.textAlignment = api.NSTextAlignment.Center\n label.font = api.UIFont.boldSystemFontOfSize(18)\n return label\n },\n update(label, props, previousProps, ctx) {\n label.text = props.text\n label.textColor = colorFromHex(props.color ?? '#0a84ff')\n ctx?.invalidateLayout()\n },\n})\n\nexport const native = {\n init: ensureNativeScript,\n NativeLabel,\n runOnUI,\n ui: {\n setTintColor,\n },\n files: {\n exists: documentExists,\n listDocuments,\n readText: readDocumentText,\n writeText: writeDocumentText,\n },\n window: {\n setTitle: setWindowTitle,\n },\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,KAAa;CACjC,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,MAAM,GAAG;CAC1C,MAAM,aAAa,MAAM,WAAW,IAChC,MAAM,MAAM,GAAG,CAAC,KAAK,SAAS,GAAG,OAAO,OAAO,CAAC,KAAK,GAAG,GACxD;AAEJ,KAAI,CAAC,gBAAgB,KAAK,WAAW,CACnC,OAAM,IAAI,MAAM,yBAAyB,MAAM;CAGjD,MAAM,SAAS,OAAO,SAAS,YAAY,GAAG;CAC9C,MAAM,OAAQ,UAAU,KAAM,OAAO;CACrC,MAAM,SAAU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C;CACD,SAAS;EACP,MAAM,MAAM,SAAS;EACrB,MAAM,QAAQ,IAAI,QAAQ,KAAK;AAC/B,QAAM,gBAAgB,IAAI,gBAAgB;AAC1C,QAAM,OAAO,IAAI,OAAO,qBAAqB,GAAG;AAChD,SAAO;;CAET,OAAO,OAAO,OAAO,eAAe,KAAK;AACvC,QAAM,OAAO,MAAM;AACnB,QAAM,YAAY,aAAa,MAAM,SAAS,UAAU;AACxD,OAAK,kBAAkB;;CAE1B,CAAC;AAEF,MAAa,SAAS;CACpB,MAAM;CACN;CACA;CACA,IAAI,EACF,cACD;CACD,OAAO;EACL,QAAQ;EACR;EACA,UAAU;EACV,WAAW;EACZ;CACD,QAAQ,EACN,UAAU,gBACX;CACF"}
File without changes
@@ -0,0 +1,14 @@
1
+ //#region src/runtime.d.ts
2
+ interface RuntimeCapability {
3
+ name: string;
4
+ version?: string;
5
+ }
6
+ interface RuntimeSession {
7
+ id: string;
8
+ projectName: string;
9
+ manifestUrl: string;
10
+ capabilities: RuntimeCapability[];
11
+ }
12
+ //#endregion
13
+ export { RuntimeCapability, RuntimeSession };
14
+ //# sourceMappingURL=runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.cts","names":[],"sources":["../src/runtime.ts"],"sourcesContent":[],"mappings":";UAAiB,iBAAA;EAAA,IAAA,EAAA,MAAA;EAKA,OAAA,CAAA,EAAA,MAAA;;UAAA,cAAA;;;;gBAID"}
@@ -0,0 +1,14 @@
1
+ //#region src/runtime.d.ts
2
+ interface RuntimeCapability {
3
+ name: string;
4
+ version?: string;
5
+ }
6
+ interface RuntimeSession {
7
+ id: string;
8
+ projectName: string;
9
+ manifestUrl: string;
10
+ capabilities: RuntimeCapability[];
11
+ }
12
+ //#endregion
13
+ export { RuntimeCapability, RuntimeSession };
14
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/runtime.ts"],"sourcesContent":[],"mappings":";UAAiB,iBAAA;EAAA,IAAA,EAAA,MAAA;EAKA,OAAA,CAAA,EAAA,MAAA;;UAAA,cAAA;;;;gBAID"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,75 @@
1
+ const path = require('node:path')
2
+ const fs = require('node:fs')
3
+
4
+ const { getDefaultConfig: getExpoDefaultConfig } = require('expo/metro-config')
5
+ const { version: bleamVersion } = require('./package.json')
6
+
7
+ const bleamNodeModules = path.join(__dirname, 'node_modules')
8
+
9
+ function packageRoot(name) {
10
+ return path.dirname(require.resolve(`${name}/package.json`))
11
+ }
12
+
13
+ function getDefaultConfig(projectRoot) {
14
+ const appRoot = process.env.BLEAM_PROJECT_ROOT ?? projectRoot
15
+ const port = Number(process.env.BLEAM_DEV_PORT ?? 8082)
16
+ const origin = process.env.BLEAM_DEV_ORIGIN ?? `http://localhost:${port}`
17
+ const config = getExpoDefaultConfig(projectRoot)
18
+ const upstreamEnhanceMiddleware = config.server.enhanceMiddleware
19
+ const projectNodeModules = path.join(appRoot, 'node_modules')
20
+ const runtimeNodeModules = path.dirname(packageRoot('react'))
21
+ const nodeModulesPaths = Array.from(new Set([
22
+ projectNodeModules,
23
+ bleamNodeModules,
24
+ runtimeNodeModules,
25
+ ...(config.resolver.nodeModulesPaths ?? []),
26
+ ]))
27
+
28
+ config.watchFolders = Array.from(new Set([
29
+ appRoot,
30
+ __dirname,
31
+ ...nodeModulesPaths,
32
+ ...(config.watchFolders ?? []),
33
+ ])).filter((directory) => fs.existsSync(directory))
34
+
35
+ config.resolver.nodeModulesPaths = nodeModulesPaths
36
+
37
+ config.resolver.extraNodeModules = {
38
+ ...(config.resolver.extraNodeModules ?? {}),
39
+ '@nativescript/react-native': packageRoot('@nativescript/react-native'),
40
+ bleam: __dirname,
41
+ expo: packageRoot('expo'),
42
+ react: packageRoot('react'),
43
+ 'react-native': packageRoot('react-native'),
44
+ }
45
+
46
+ config.server.enhanceMiddleware = (middleware, server) => {
47
+ const enhanced = upstreamEnhanceMiddleware(middleware, server)
48
+
49
+ return (req, res, next) => {
50
+ if (req.url?.split('?')[0] !== '/bleam/manifest.json') {
51
+ return enhanced(req, res, next)
52
+ }
53
+
54
+ const body = JSON.stringify({
55
+ name: process.env.BLEAM_DEV_NAME ?? 'bleam-app',
56
+ sdkVersion: process.env.BLEAM_DEV_SDK_VERSION ?? bleamVersion,
57
+ runtimeVersion: process.env.BLEAM_DEV_RUNTIME_VERSION ?? bleamVersion,
58
+ platform: 'macos',
59
+ bundleUrl: `${origin}/.expo/.virtual-metro-entry.bundle?platform=ios&dev=true&minify=false&runModule=true`,
60
+ dev: true,
61
+ })
62
+
63
+ res.writeHead(200, {
64
+ 'Access-Control-Allow-Origin': '*',
65
+ 'Cache-Control': 'no-store',
66
+ 'Content-Type': 'application/json; charset=utf-8',
67
+ })
68
+ res.end(body)
69
+ }
70
+ }
71
+
72
+ return config
73
+ }
74
+
75
+ module.exports = { getDefaultConfig }
package/package.json CHANGED
@@ -1,5 +1,96 @@
1
1
  {
2
2
  "name": "bleam",
3
- "version": "0.0.0",
4
- "packageManager": "yarn@4.12.0"
3
+ "version": "0.0.3",
4
+ "packageManager": "yarn@1.22.22",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "metro-config.cjs",
9
+ "templates",
10
+ "tsconfig.json",
11
+ "tsconfig.base.json"
12
+ ],
13
+ "bin": {
14
+ "bleam": "./dist/cli.js"
15
+ },
16
+ "scripts": {
17
+ "build": "tsdown",
18
+ "typecheck": "tsc --noEmit -p tsconfig.build.json"
19
+ },
20
+ "prettier": {
21
+ "semi": false,
22
+ "singleQuote": true,
23
+ "trailingComma": "all",
24
+ "printWidth": 80,
25
+ "tabWidth": 2
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^25.5.0",
29
+ "prettier": "^3.8.2",
30
+ "tsdown": "^0.15.6",
31
+ "typescript": "^5.9.2"
32
+ },
33
+ "dependencies": {
34
+ "@nativescript/react-native": "9.0.0-preview.4",
35
+ "@types/react": "~19.2.14",
36
+ "expo": "56",
37
+ "react": "19.2.3",
38
+ "react-native": "0.85.3",
39
+ "tsx": "^4.21.0"
40
+ },
41
+ "main": "./dist/index.cjs",
42
+ "module": "./dist/index.js",
43
+ "types": "./dist/index.d.cts",
44
+ "exports": {
45
+ ".": {
46
+ "types": "./dist/index.d.ts",
47
+ "import": "./dist/index.js",
48
+ "require": "./dist/index.cjs"
49
+ },
50
+ "./app": {
51
+ "types": "./dist/app.d.ts",
52
+ "import": "./dist/app.js",
53
+ "require": "./dist/app.cjs"
54
+ },
55
+ "./bundler": {
56
+ "types": "./dist/bundler.d.ts",
57
+ "import": "./dist/bundler.js",
58
+ "require": "./dist/bundler.cjs"
59
+ },
60
+ "./config": {
61
+ "types": "./dist/config.d.ts",
62
+ "import": "./dist/config.js",
63
+ "require": "./dist/config.cjs"
64
+ },
65
+ "./crypto": {
66
+ "types": "./dist/crypto.d.ts",
67
+ "import": "./dist/crypto.js",
68
+ "require": "./dist/crypto.cjs"
69
+ },
70
+ "./dev-protocol": {
71
+ "types": "./dist/dev-protocol.d.ts",
72
+ "import": "./dist/dev-protocol.js",
73
+ "require": "./dist/dev-protocol.cjs"
74
+ },
75
+ "./fs": {
76
+ "types": "./dist/fs.d.ts",
77
+ "import": "./dist/fs.js",
78
+ "require": "./dist/fs.cjs"
79
+ },
80
+ "./native": {
81
+ "types": "./dist/native.d.ts",
82
+ "import": "./dist/native.js",
83
+ "require": "./dist/native.cjs"
84
+ },
85
+ "./runtime": {
86
+ "types": "./dist/runtime.d.ts",
87
+ "import": "./dist/runtime.js",
88
+ "require": "./dist/runtime.cjs"
89
+ },
90
+ "./package.json": "./package.json",
91
+ "./metro-config": {
92
+ "require": "./metro-config.cjs"
93
+ },
94
+ "./tsconfig": "./tsconfig.base.json"
95
+ }
5
96
  }
@@ -0,0 +1,3 @@
1
+ export default {
2
+ name: 'Bleam Basic',
3
+ }
@@ -0,0 +1,18 @@
1
+ import { StyleSheet, Text, View } from 'react-native'
2
+
3
+ export default function App() {
4
+ return (
5
+ <View style={styles.container}>
6
+ <Text>Open up app.tsx to start working on your app!</Text>
7
+ </View>
8
+ )
9
+ }
10
+
11
+ const styles = StyleSheet.create({
12
+ container: {
13
+ flex: 1,
14
+ backgroundColor: '#fff',
15
+ alignItems: 'center',
16
+ justifyContent: 'center',
17
+ },
18
+ })
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "expo/tsconfig.base",
3
+ "compilerOptions": {
4
+ "moduleResolution": "bundler",
5
+ "strict": true
6
+ }
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./tsconfig.base.json"
3
+ }
package/.editorconfig DELETED
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- indent_size = 2
7
- indent_style = space
8
- insert_final_newline = true
package/.gitattributes DELETED
@@ -1,4 +0,0 @@
1
- /.yarn/** linguist-vendored
2
- /.yarn/releases/* binary
3
- /.yarn/plugins/**/* binary
4
- /.pnp.* binary linguist-generated
package/README.md DELETED
@@ -1 +0,0 @@
1
- # bluum