@apps-in-toss/web-framework 0.0.0-dev.1739241377950

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/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@apps-in-toss/web-framework",
3
+ "type": "module",
4
+ "version": "0.0.0-dev.1739241377950",
5
+ "description": "Web Framework for Apps In Toss",
6
+ "scripts": {
7
+ "prepack": "yarn build",
8
+ "typecheck": "tsc --noEmit",
9
+ "lint": "eslint .",
10
+ "build": "tsup"
11
+ },
12
+ "types": "./dist/index.d.ts",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "bin": {
24
+ "ait": "./bin.js"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "react-native"
29
+ ],
30
+ "devDependencies": {
31
+ "@types/babel__core": "^7.20.5",
32
+ "@types/debug": "^4",
33
+ "@types/node": "^22.10.2",
34
+ "@types/yauzl": "^2.10.3",
35
+ "eslint": "^9.7.0",
36
+ "tsup": "^8.3.5",
37
+ "typescript": "4.9.5",
38
+ "vitest": "^3.0.5"
39
+ },
40
+ "dependencies": {
41
+ "@apps-in-toss/babel-plugin-json": "0.0.0-dev.1739241377950",
42
+ "@apps-in-toss/framework": "0.0.0-dev.1739241377950",
43
+ "@babel/core": "7.23.9",
44
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
45
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
46
+ "@babel/plugin-proposal-numeric-separator": "^7.16.7",
47
+ "@babel/plugin-proposal-optional-chaining": "^7.16.7",
48
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
49
+ "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
50
+ "@babel/plugin-transform-flow-strip-types": "^7.19.0",
51
+ "@babel/preset-env": "^7.15.0",
52
+ "@babel/preset-react": "^7.16.7",
53
+ "@babel/preset-typescript": "^7.16.7",
54
+ "@babel/runtime": "7.18.9",
55
+ "@clack/prompts": "^0.10.0",
56
+ "@react-native-bedrock/mpack-next": "0.0.0-dev.1739241377950",
57
+ "@react-native-bedrock/native": "workspace:*",
58
+ "@types/react": "18.3.3",
59
+ "clipanion": "^4.0.0-rc.4",
60
+ "cosmiconfig": "^9.0.0",
61
+ "cosmiconfig-typescript-loader": "^5.1.0",
62
+ "debug": "^4.4.0",
63
+ "es-toolkit": "^1.32.0",
64
+ "execa": "^9.5.2",
65
+ "picocolors": "^1.1.1",
66
+ "react": "18.2.0",
67
+ "react-native": "0.72.6",
68
+ "react-native-bedrock": "0.0.0-dev.1739241377950",
69
+ "yauzl": "^3.2.0",
70
+ "zod": "^3.24.1"
71
+ },
72
+ "publishConfig": {
73
+ "access": "public"
74
+ },
75
+ "gitHead": "fac6464a95b12e2dbbbc1946e82ea9d6e946cc4e"
76
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "targets": {
7
+ "ie": 11
8
+ }
9
+ }
10
+ ],
11
+ ["@babel/preset-typescript"],
12
+ [
13
+ "@babel/preset-react",
14
+ {
15
+ "runtime": "automatic"
16
+ }
17
+ ]
18
+ ],
19
+ "plugins": [
20
+ ["@apps-in-toss/babel-plugin-json", { "jsonPath": "./.apps-in-toss/metadata.json", "identifierName": "Ait" }],
21
+ ["@babel/plugin-transform-flow-strip-types"],
22
+ [
23
+ "@babel/plugin-proposal-class-properties",
24
+ {
25
+ "loose": true
26
+ }
27
+ ],
28
+ [
29
+ "@babel/plugin-proposal-private-property-in-object",
30
+ {
31
+ "loose": true
32
+ }
33
+ ],
34
+ [
35
+ "@babel/plugin-proposal-private-methods",
36
+ {
37
+ "loose": true
38
+ }
39
+ ]
40
+ ]
41
+ }
@@ -0,0 +1,4 @@
1
+ global.__bedrock = global.__bedrock || {};
2
+ global.__bedrock.shared = { buildNumber: "00000000" };
3
+ global.__bedrock.apps = global.__bedrock.apps || {};
4
+ global.__bedrock.apps["ping-pong"] = { buildNumber: "00000000" };
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ const Ait: {
3
+ appName: string;
4
+ webPort: number;
5
+ };
6
+ }
7
+
8
+ export {};
@@ -0,0 +1,10 @@
1
+ const files = new Map();
2
+
3
+ files.set('./index.tsx', require('./pages/index.tsx'));
4
+ files.set('./_404.tsx', require('./pages/_404.tsx'));
5
+
6
+ export function context(id: string) {
7
+ return files.get(id);
8
+ }
9
+
10
+ context.keys = () => Array.from(files.keys());
@@ -0,0 +1,4 @@
1
+ import { register } from 'react-native-bedrock';
2
+ import App from './src/_app';
3
+
4
+ register(App);
@@ -0,0 +1 @@
1
+ export { default } from './index';
@@ -0,0 +1,10 @@
1
+ import { WebView } from '@apps-in-toss/framework';
2
+ import { View } from 'react-native';
3
+
4
+ export default function Index() {
5
+ return (
6
+ <View style={{ flex: 1 }}>
7
+ <WebView style={{ flex: 1 }} localhostPort={Ait.webPort} />
8
+ </View>
9
+ );
10
+ }
@@ -0,0 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-require-imports */
2
+ /* eslint-disable @typescript-eslint/no-var-requires */
3
+ module.exports = {
4
+ reactNativePath: require('path').dirname(require.resolve('react-native/package.json')),
5
+ };
@@ -0,0 +1,12 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import { Bedrock, type InitialProps } from 'react-native-bedrock';
3
+ import { context } from '../context';
4
+
5
+ function AppContainer({ children }: PropsWithChildren<InitialProps>) {
6
+ return <>{children}</>;
7
+ }
8
+
9
+ export default Bedrock.registerApp(AppContainer, {
10
+ appName: Ait.appName, // this auto replace appName to Ait.appName
11
+ context,
12
+ });