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.
Files changed (52) hide show
  1. package/deploy/k8s/rosetack.yaml +107 -0
  2. package/dist-cli/compiler.mjs +2783 -0
  3. package/dist-cli/edge.mjs +332 -0
  4. package/dist-cli/rosetack.mjs +4230 -0
  5. package/dist-cli/runtime.mjs +703 -0
  6. package/dist-cli/test.mjs +3202 -0
  7. package/pack.mjs +49 -0
  8. package/package.json +25 -7
  9. package/src/FRAMEWORK_VERSION +1 -1
  10. package/src/cli/edge.ts +67 -25
  11. package/src/cli/index.ts +858 -94
  12. package/src/cli/prompt.ts +127 -0
  13. package/src/cli/shell.ts +133 -30
  14. package/src/cli/test.ts +400 -0
  15. package/src/compiler/errors.ts +74 -0
  16. package/src/compiler/index.ts +1955 -264
  17. package/src/runtime/index.ts +465 -66
  18. package/src/types/rosetack.d.ts +151 -0
  19. package/.github/workflows/ci.yml +0 -72
  20. package/.github/workflows/release.yml +0 -122
  21. package/benchmark.ts +0 -227
  22. package/example/public/favicon.ico +0 -0
  23. package/example/public/logo.svg +0 -148
  24. package/example/public/rose-mark-black.png +0 -0
  25. package/example/public/rose-mark.png +0 -0
  26. package/example/public/rose-mono.png +0 -0
  27. package/example/rosetack.config.js +0 -10
  28. package/example/src/locales/en.json +0 -8
  29. package/example/src/locales/zh.json +0 -8
  30. package/example/src/pages/404.rose +0 -15
  31. package/example/src/pages/500.rose +0 -10
  32. package/example/src/pages/[lang]/about.rose +0 -40
  33. package/example/src/pages/_layout.rose +0 -33
  34. package/example/src/pages/_middleware.rose +0 -37
  35. package/example/src/pages/about.rose +0 -67
  36. package/example/src/pages/admin.rose +0 -27
  37. package/example/src/pages/api/hello.rose +0 -19
  38. package/example/src/pages/api/login.rose +0 -55
  39. package/example/src/pages/api/posts.rose +0 -80
  40. package/example/src/pages/api/secret.rose +0 -14
  41. package/example/src/pages/blog/[id].rose +0 -25
  42. package/example/src/pages/broken.rose +0 -16
  43. package/example/src/pages/fresh.rose +0 -22
  44. package/example/src/pages/garden.rose +0 -27
  45. package/example/src/pages/index.rose +0 -84
  46. package/example/src/pages/sign.rose +0 -45
  47. package/example/src/pages/thorn.rose +0 -23
  48. package/example/src/pages/vault.rose +0 -14
  49. package/go.mod +0 -3
  50. package/main.go +0 -470
  51. package/tools/release-notes.mjs +0 -113
  52. 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