@webstir-io/webstir 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 (77) hide show
  1. package/README.md +13 -0
  2. package/assets/deployment/docker/.dockerignore +7 -0
  3. package/assets/deployment/docker/Dockerfile +17 -0
  4. package/assets/deployment/docker/README.md +44 -0
  5. package/assets/deployment/docker/example.env +3 -0
  6. package/assets/features/client_nav/client_nav.ts +369 -264
  7. package/assets/features/client_nav/document_navigation.ts +344 -0
  8. package/assets/features/client_nav/form_enhancement.ts +275 -0
  9. package/assets/templates/api/src/backend/index.ts +71 -10
  10. package/assets/templates/api/src/backend/tsconfig.json +6 -1
  11. package/assets/templates/full/src/backend/index.ts +71 -10
  12. package/assets/templates/full/src/backend/module.ts +515 -0
  13. package/assets/templates/full/src/backend/tests/progressive-enhancement.test.ts +180 -0
  14. package/assets/templates/full/src/backend/tsconfig.json +6 -1
  15. package/assets/templates/full/src/frontend/app/scripts/features/client-nav.ts +574 -0
  16. package/assets/templates/full/src/frontend/app/scripts/features/document-navigation.ts +344 -0
  17. package/assets/templates/full/src/frontend/app/scripts/features/form-enhancement.ts +275 -0
  18. package/assets/templates/full/src/frontend/pages/home/index.css +8 -0
  19. package/assets/templates/full/src/frontend/pages/home/index.html +6 -1
  20. package/assets/templates/full/src/frontend/pages/home/tests/home.test.ts +12 -2
  21. package/assets/templates/spa/src/frontend/pages/home/tests/home.test.ts +10 -2
  22. package/package.json +31 -13
  23. package/scripts/check-feature-projections.mjs +87 -0
  24. package/scripts/check-full-demo-sync.mjs +89 -0
  25. package/scripts/check-package-install.mjs +537 -0
  26. package/scripts/check-standalone-install.mjs +221 -0
  27. package/scripts/pack-standalone.mjs +52 -28
  28. package/scripts/publish.sh +9 -0
  29. package/scripts/run-tests.mjs +99 -0
  30. package/scripts/sync-assets.mjs +175 -17
  31. package/src/add-backend-compat.ts +628 -0
  32. package/src/add-backend.ts +155 -27
  33. package/src/add.ts +111 -4
  34. package/src/agent.ts +393 -0
  35. package/src/api-watch.ts +7 -4
  36. package/src/backend-inspect.ts +70 -2
  37. package/src/backend-runtime.ts +22 -14
  38. package/src/build.ts +1 -3
  39. package/src/bun-generated-frontend-watch.ts +209 -0
  40. package/src/bun-globals.d.ts +23 -0
  41. package/src/bun-spa-document.ts +310 -0
  42. package/src/bun-spa-routes.ts +159 -0
  43. package/src/bun-spa-watch.ts +29 -0
  44. package/src/bun-ssg-watch.ts +304 -0
  45. package/src/cli.ts +381 -50
  46. package/src/compile-tests.ts +37 -29
  47. package/src/dev-server.ts +214 -143
  48. package/src/doctor.ts +164 -0
  49. package/src/enable-assets.ts +18 -1
  50. package/src/enable.ts +133 -41
  51. package/src/execute.ts +28 -4
  52. package/src/external-workspace.ts +178 -0
  53. package/src/format.ts +296 -17
  54. package/src/frontend-inspect.ts +32 -0
  55. package/src/frontend-watch.ts +27 -102
  56. package/src/full-watch.ts +13 -18
  57. package/src/index.ts +7 -0
  58. package/src/init-assets.ts +41 -11
  59. package/src/init.ts +85 -71
  60. package/src/inspect.ts +112 -0
  61. package/src/mcp/run-cli-json.ts +46 -0
  62. package/src/mcp/server.ts +307 -0
  63. package/src/operations.ts +176 -0
  64. package/src/providers.ts +20 -18
  65. package/src/refresh.ts +29 -3
  66. package/src/repair.ts +110 -43
  67. package/src/runtime-filter.ts +41 -0
  68. package/src/runtime.ts +1 -1
  69. package/src/smoke.ts +48 -16
  70. package/src/test.ts +54 -16
  71. package/src/testing-runtime.ts +273 -0
  72. package/src/types.ts +1 -4
  73. package/src/watch-events.ts +46 -17
  74. package/src/watch.ts +5 -1
  75. package/src/workspace-watcher.ts +10 -6
  76. package/src/workspace.ts +4 -2
  77. package/src/watch-daemon-client.ts +0 -171
package/README.md CHANGED
@@ -8,7 +8,13 @@ Current command surface:
8
8
 
9
9
  - `init`
10
10
  - `refresh`
11
+ - `inspect`
12
+ - `frontend-inspect`
13
+ - `doctor`
11
14
  - `repair`
15
+ - `operations`
16
+ - `mcp`
17
+ - `agent`
12
18
  - `enable`
13
19
  - `add-page`
14
20
  - `add-test`
@@ -67,3 +73,10 @@ cd site
67
73
  bun install
68
74
  ../node_modules/.bin/webstir build --workspace "$PWD"
69
75
  ```
76
+
77
+ Contributor notes:
78
+
79
+ - Edit Bun-owned scaffolds, reusable features, and deployment helper sources under `orchestrators/bun/resources/**`.
80
+ - `orchestrators/bun/assets/**` is generated package content used for packing and local repo flows.
81
+ - Run `bun run check:assets` here to verify `assets/**` still matches `resources/**`.
82
+ - Run `bun run check:feature-projections` here to verify the built-in `client-nav` copies inside `resources/templates/full/**` still match `resources/features/client_nav/**`.
@@ -0,0 +1,7 @@
1
+ *
2
+ !package.json
3
+ !bun.lock
4
+ !build/
5
+ !build/**
6
+ !dist/
7
+ !dist/**
@@ -0,0 +1,17 @@
1
+ FROM oven/bun:1.3.11-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package.json bun.lock ./
6
+ RUN bun install --frozen-lockfile --production
7
+
8
+ COPY . .
9
+
10
+ RUN mkdir -p /app/data
11
+
12
+ ENV NODE_ENV=production
13
+ ENV PORT=8080
14
+
15
+ EXPOSE 8080
16
+
17
+ CMD ["bun", "./node_modules/.bin/webstir-backend-deploy", "--workspace", "/app", "--port", "8080"]
@@ -0,0 +1,44 @@
1
+ # Webstir Docker Deployment
2
+
3
+ Canonical Bun deployment contract for published `api` and `full` workspaces.
4
+
5
+ ## Workspace Prerequisites
6
+
7
+ Run from the workspace root after a publish:
8
+
9
+ ```bash
10
+ webstir publish --workspace "$PWD"
11
+ ```
12
+
13
+ Required inputs in the workspace root:
14
+
15
+ - `package.json`
16
+ - `bun.lock`
17
+ - `build/backend/**`
18
+ - `dist/frontend/**` for `full` workspaces
19
+ - The canonical `.dockerignore`
20
+
21
+ ## Build
22
+
23
+ Copy the canonical `Dockerfile` and `.dockerignore` into your workspace root, then build:
24
+
25
+ ```bash
26
+ docker build -t my-webstir-app .
27
+ ```
28
+
29
+ ## Run
30
+
31
+ ```bash
32
+ docker run --rm \
33
+ -p 8080:8080 \
34
+ --env-file ./.env.production \
35
+ my-webstir-app
36
+ ```
37
+
38
+ The container starts `webstir-backend-deploy`, which:
39
+
40
+ - runs the published backend under Bun
41
+ - serves `dist/frontend/**` for `full` workspaces
42
+ - proxies `/api/*` to the backend runtime for `full` workspaces
43
+ - proxies all requests to the backend for `api` workspaces
44
+ - keeps `/readyz`, `/healthz`, and `/metrics` available from the single public port
@@ -0,0 +1,3 @@
1
+ PORT=8080
2
+ NODE_ENV=production
3
+ SESSION_SECRET=replace-me-with-a-real-secret