rosetack 0.1.0 → 0.1.2
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/deploy/k8s/rosetack.yaml +107 -0
- package/dist-cli/compiler.mjs +2783 -0
- package/dist-cli/edge.mjs +332 -0
- package/dist-cli/rosetack.mjs +4230 -0
- package/dist-cli/runtime.mjs +703 -0
- package/dist-cli/test.mjs +3202 -0
- package/pack.mjs +49 -0
- package/package.json +25 -7
- package/src/FRAMEWORK_VERSION +1 -1
- package/src/cli/edge.ts +67 -25
- package/src/cli/index.ts +858 -94
- package/src/cli/prompt.ts +127 -0
- package/src/cli/shell.ts +133 -30
- package/src/cli/test.ts +400 -0
- package/src/compiler/errors.ts +74 -0
- package/src/compiler/index.ts +1955 -264
- package/src/runtime/index.ts +465 -66
- package/src/types/rosetack.d.ts +151 -0
- package/.github/workflows/ci.yml +0 -72
- package/.github/workflows/release.yml +0 -122
- package/benchmark.ts +0 -227
- package/example/public/favicon.ico +0 -0
- package/example/public/logo.svg +0 -148
- package/example/public/rose-mark-black.png +0 -0
- package/example/public/rose-mark.png +0 -0
- package/example/public/rose-mono.png +0 -0
- package/example/rosetack.config.js +0 -10
- package/example/src/locales/en.json +0 -8
- package/example/src/locales/zh.json +0 -8
- package/example/src/pages/404.rose +0 -15
- package/example/src/pages/500.rose +0 -10
- package/example/src/pages/[lang]/about.rose +0 -40
- package/example/src/pages/_layout.rose +0 -33
- package/example/src/pages/_middleware.rose +0 -37
- package/example/src/pages/about.rose +0 -67
- package/example/src/pages/admin.rose +0 -27
- package/example/src/pages/api/hello.rose +0 -19
- package/example/src/pages/api/login.rose +0 -55
- package/example/src/pages/api/posts.rose +0 -80
- package/example/src/pages/api/secret.rose +0 -14
- package/example/src/pages/blog/[id].rose +0 -25
- package/example/src/pages/broken.rose +0 -16
- package/example/src/pages/fresh.rose +0 -22
- package/example/src/pages/garden.rose +0 -27
- package/example/src/pages/index.rose +0 -84
- package/example/src/pages/sign.rose +0 -45
- package/example/src/pages/thorn.rose +0 -23
- package/example/src/pages/vault.rose +0 -14
- package/go.mod +0 -3
- package/main.go +0 -470
- package/tools/release-notes.mjs +0 -113
- package/tsconfig.json +0 -17
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# The hybrid deploy on Kubernetes (consultant P0 §3 方案B) - the same split
|
|
2
|
+
# `docker-compose.yml` runs …
|
|
3
|
+
apiVersion: apps/v1
|
|
4
|
+
kind: Deployment
|
|
5
|
+
metadata:
|
|
6
|
+
name: rosetack-static
|
|
7
|
+
labels: { app: rosetack, tier: static }
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 2
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels: { app: rosetack, tier: static }
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels: { app: rosetack, tier: static }
|
|
15
|
+
annotations:
|
|
16
|
+
prometheus.io/scrape: "true"
|
|
17
|
+
prometheus.io/path: /metrics
|
|
18
|
+
prometheus.io/port: "8080"
|
|
19
|
+
spec:
|
|
20
|
+
containers:
|
|
21
|
+
- name: static
|
|
22
|
+
image: rosetack-static:latest
|
|
23
|
+
env:
|
|
24
|
+
- name: PORT
|
|
25
|
+
value: "8080"
|
|
26
|
+
- name: UPSTREAM
|
|
27
|
+
value: http://rosetack-dynamic:3000
|
|
28
|
+
ports:
|
|
29
|
+
- name: http
|
|
30
|
+
containerPort: 8080
|
|
31
|
+
readinessProbe:
|
|
32
|
+
httpGet: { path: /, port: http }
|
|
33
|
+
resources:
|
|
34
|
+
requests: { cpu: 50m, memory: 32Mi }
|
|
35
|
+
limits: { memory: 64Mi }
|
|
36
|
+
---
|
|
37
|
+
apiVersion: v1
|
|
38
|
+
kind: Service
|
|
39
|
+
metadata:
|
|
40
|
+
name: rosetack-static
|
|
41
|
+
spec:
|
|
42
|
+
selector: { app: rosetack, tier: static }
|
|
43
|
+
ports:
|
|
44
|
+
- name: http
|
|
45
|
+
port: 80
|
|
46
|
+
targetPort: http
|
|
47
|
+
---
|
|
48
|
+
apiVersion: apps/v1
|
|
49
|
+
kind: Deployment
|
|
50
|
+
metadata:
|
|
51
|
+
name: rosetack-dynamic
|
|
52
|
+
labels: { app: rosetack, tier: dynamic }
|
|
53
|
+
spec:
|
|
54
|
+
replicas: 2
|
|
55
|
+
selector:
|
|
56
|
+
matchLabels: { app: rosetack, tier: dynamic }
|
|
57
|
+
template:
|
|
58
|
+
metadata:
|
|
59
|
+
labels: { app: rosetack, tier: dynamic }
|
|
60
|
+
spec:
|
|
61
|
+
containers:
|
|
62
|
+
- name: dynamic
|
|
63
|
+
image: rosetack:latest
|
|
64
|
+
# `rosetack serve` is the production runner: the stdlib cluster (one
|
|
65
|
+
# worker per core), bounded bodies, timeouts, graceful drain.
|
|
66
|
+
command: ["rosetack", "serve"]
|
|
67
|
+
env:
|
|
68
|
+
- name: PORT
|
|
69
|
+
value: "3000"
|
|
70
|
+
ports:
|
|
71
|
+
- name: http
|
|
72
|
+
containerPort: 3000
|
|
73
|
+
readinessProbe:
|
|
74
|
+
httpGet: { path: /, port: http }
|
|
75
|
+
resources:
|
|
76
|
+
requests: { cpu: 100m, memory: 128Mi }
|
|
77
|
+
limits: { memory: 512Mi }
|
|
78
|
+
---
|
|
79
|
+
apiVersion: v1
|
|
80
|
+
kind: Service
|
|
81
|
+
metadata:
|
|
82
|
+
name: rosetack-dynamic
|
|
83
|
+
spec:
|
|
84
|
+
# ClusterIP on purpose: the dynamic half is reached through the static
|
|
85
|
+
# half's UPSTREAM proxy, never directly.
|
|
86
|
+
type: ClusterIP
|
|
87
|
+
selector: { app: rosetack, tier: dynamic }
|
|
88
|
+
ports:
|
|
89
|
+
- name: http
|
|
90
|
+
port: 3000
|
|
91
|
+
targetPort: http
|
|
92
|
+
---
|
|
93
|
+
apiVersion: networking.k8s.io/v1
|
|
94
|
+
kind: Ingress
|
|
95
|
+
metadata:
|
|
96
|
+
name: rosetack
|
|
97
|
+
spec:
|
|
98
|
+
rules:
|
|
99
|
+
- http:
|
|
100
|
+
paths:
|
|
101
|
+
- path: /
|
|
102
|
+
pathType: Prefix
|
|
103
|
+
backend:
|
|
104
|
+
service:
|
|
105
|
+
name: rosetack-static
|
|
106
|
+
port:
|
|
107
|
+
number: 80
|