@hypen-space/cli 0.3.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.
- package/README.md +157 -0
- package/dist/bin/hypen.js +826 -0
- package/dist/bin/hypen.js.map +13 -0
- package/dist/src/dev-bun.js +266 -0
- package/dist/src/dev-bun.js.map +10 -0
- package/dist/src/dev-node.js +313 -0
- package/dist/src/dev-node.js.map +10 -0
- package/dist/src/dev.js +576 -0
- package/dist/src/dev.js.map +12 -0
- package/dist/src/index.js +580 -0
- package/dist/src/index.js.map +13 -0
- package/package.json +58 -0
- package/templates/counter/hypen.json +15 -0
- package/templates/counter/package.json +18 -0
- package/templates/counter/src/app.ts +16 -0
- package/templates/counter/src/components/App/component.hypen +55 -0
- package/templates/counter/src/components/App/component.ts +21 -0
- package/templates/counter/tsconfig.json +26 -0
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hypen-space/cli",
|
|
3
|
+
"version": "0.3.8",
|
|
4
|
+
"description": "Hypen CLI - Create and manage Hypen applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"hypen": "./dist/bin/hypen.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/src/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"bun": "./src/index.ts",
|
|
13
|
+
"import": "./dist/src/index.js",
|
|
14
|
+
"default": "./dist/src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./dev": {
|
|
17
|
+
"bun": "./src/dev.ts",
|
|
18
|
+
"import": "./dist/src/dev.js",
|
|
19
|
+
"default": "./dist/src/dev.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"templates"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "bun run build.ts",
|
|
28
|
+
"prepublishOnly": "bun run build",
|
|
29
|
+
"test": "bun test",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@hypen-space/core": "^0.3.8",
|
|
34
|
+
"@hypen-space/web": "^0.3.8",
|
|
35
|
+
"esbuild": "^0.20.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/bun": "latest",
|
|
39
|
+
"@types/node": "^20",
|
|
40
|
+
"typescript": "^5"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"hypen",
|
|
44
|
+
"cli",
|
|
45
|
+
"ui",
|
|
46
|
+
"declarative"
|
|
47
|
+
],
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.0.0"
|
|
50
|
+
},
|
|
51
|
+
"author": "Ian Rumac",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/hypen-lang/hypen-engine-rs.git",
|
|
56
|
+
"directory": "hypen-cli"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://hypen.dev/schema/hypen.json",
|
|
3
|
+
"entry": "App",
|
|
4
|
+
"components": "./src/components",
|
|
5
|
+
"port": 3000,
|
|
6
|
+
"mode": "hybrid",
|
|
7
|
+
"build": {
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
"minify": true,
|
|
10
|
+
"sourcemap": false
|
|
11
|
+
},
|
|
12
|
+
"deploy": {
|
|
13
|
+
"target": "fly"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "counter",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "hypen dev",
|
|
7
|
+
"build": "hypen build",
|
|
8
|
+
"start": "bun run dist/main.js",
|
|
9
|
+
"deploy": "hypen deploy"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@hypen-space/core": "^0.3.8"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"bun-types": "latest",
|
|
16
|
+
"typescript": "^5.0.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hypen Application Entry Point
|
|
3
|
+
*
|
|
4
|
+
* This file starts your Hypen server.
|
|
5
|
+
* Run with: bun run dev
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { serve } from "@hypen-space/core";
|
|
9
|
+
|
|
10
|
+
const server = await serve({
|
|
11
|
+
entry: "App",
|
|
12
|
+
port: 3000,
|
|
13
|
+
mode: "hybrid" as const,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(`Server running at ${server.url}`);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module App {
|
|
2
|
+
Column {
|
|
3
|
+
Text("Hypen Counter")
|
|
4
|
+
.fontSize(24)
|
|
5
|
+
.fontWeight("bold")
|
|
6
|
+
.color("#333")
|
|
7
|
+
|
|
8
|
+
Text("Count: ${state.count}")
|
|
9
|
+
.fontSize(64)
|
|
10
|
+
.fontWeight("bold")
|
|
11
|
+
.color("#007bff")
|
|
12
|
+
.marginVertical(32)
|
|
13
|
+
|
|
14
|
+
Row {
|
|
15
|
+
Button {
|
|
16
|
+
Text("-")
|
|
17
|
+
.fontSize(24)
|
|
18
|
+
.color("#fff")
|
|
19
|
+
}
|
|
20
|
+
.onClick("@actions.decrement")
|
|
21
|
+
.padding(16)
|
|
22
|
+
.paddingHorizontal(24)
|
|
23
|
+
.backgroundColor("#dc3545")
|
|
24
|
+
.borderRadius(8)
|
|
25
|
+
|
|
26
|
+
Button {
|
|
27
|
+
Text("Reset")
|
|
28
|
+
.fontSize(16)
|
|
29
|
+
.color("#fff")
|
|
30
|
+
}
|
|
31
|
+
.onClick("@actions.reset")
|
|
32
|
+
.padding(16)
|
|
33
|
+
.paddingHorizontal(24)
|
|
34
|
+
.backgroundColor("#6c757d")
|
|
35
|
+
.borderRadius(8)
|
|
36
|
+
|
|
37
|
+
Button {
|
|
38
|
+
Text("+")
|
|
39
|
+
.fontSize(24)
|
|
40
|
+
.color("#fff")
|
|
41
|
+
}
|
|
42
|
+
.onClick("@actions.increment")
|
|
43
|
+
.padding(16)
|
|
44
|
+
.paddingHorizontal(24)
|
|
45
|
+
.backgroundColor("#28a745")
|
|
46
|
+
.borderRadius(8)
|
|
47
|
+
}
|
|
48
|
+
.gap(16)
|
|
49
|
+
}
|
|
50
|
+
.padding(32)
|
|
51
|
+
.gap(24)
|
|
52
|
+
.alignItems("center")
|
|
53
|
+
.justifyContent("center")
|
|
54
|
+
.minHeight("100vh")
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { app } from "@hypen-space/core";
|
|
2
|
+
|
|
3
|
+
type AppState = {
|
|
4
|
+
count: number;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default app
|
|
8
|
+
.defineState<AppState>({ count: 0 })
|
|
9
|
+
.onCreated(async (state) => {
|
|
10
|
+
console.log("App created with count:", state.count);
|
|
11
|
+
})
|
|
12
|
+
.onAction("increment", ({ state }) => {
|
|
13
|
+
state.count++;
|
|
14
|
+
})
|
|
15
|
+
.onAction("decrement", ({ state }) => {
|
|
16
|
+
state.count--;
|
|
17
|
+
})
|
|
18
|
+
.onAction("reset", ({ state }) => {
|
|
19
|
+
state.count = 0;
|
|
20
|
+
})
|
|
21
|
+
.build();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"types": [
|
|
11
|
+
"bun-types"
|
|
12
|
+
],
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": [
|
|
15
|
+
"./src/*"
|
|
16
|
+
],
|
|
17
|
+
"@components/*": [
|
|
18
|
+
"./src/components/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"src/**/*",
|
|
24
|
+
"hypen.json"
|
|
25
|
+
]
|
|
26
|
+
}
|