@askrjs/cli 0.0.2 → 0.0.4

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 (310) hide show
  1. package/README.md +46 -7
  2. package/dist/add.d.ts +16 -0
  3. package/dist/add.js +558 -1
  4. package/dist/cli.d.ts +5 -0
  5. package/dist/cli.js +43 -16
  6. package/dist/create.d.ts +5 -0
  7. package/dist/create.js +104 -26
  8. package/dist/directory-swap-DWoHtx7C.js +35 -0
  9. package/dist/discovery-Difb7Y4G.js +323 -0
  10. package/dist/generate.d.ts +5 -0
  11. package/dist/generate.js +461 -0
  12. package/dist/is-direct-execution-Cdlr-ZUl.js +0 -2
  13. package/dist/openapi.d.ts +25 -0
  14. package/dist/openapi.js +49 -16
  15. package/dist/planner-VAj7qlxr.js +285 -0
  16. package/dist/range-YUs9eimn.js +125 -0
  17. package/dist/registry-CyrRHRG5.js +209 -0
  18. package/dist/skills/askr-dashboard-charts/SKILL.md +61 -44
  19. package/dist/skills/askr-dashboard-charts/agents/openai.yaml +2 -2
  20. package/dist/skills/askr-ssr-ssg/SKILL.md +3 -1
  21. package/dist/{skills-Bh0mEhIx.js → skills-B7CbWur9.js} +89 -26
  22. package/dist/skills.d.ts +18 -0
  23. package/dist/skills.js +1 -1
  24. package/dist/specification-DXnDOC-0.js +49 -0
  25. package/dist/ssg-config.d.ts +41 -0
  26. package/dist/ssg-config.js +1 -0
  27. package/dist/ssg.d.ts +61 -0
  28. package/dist/ssg.js +360 -24
  29. package/dist/templates/full-stack/AGENTS.md +0 -1
  30. package/dist/templates/full-stack/README.md +0 -1
  31. package/dist/templates/full-stack/index.html +0 -1
  32. package/dist/templates/full-stack/package.json +5 -3
  33. package/dist/templates/full-stack/server.ts +5 -9
  34. package/dist/templates/full-stack/src/action-authorizations.ts +2 -2
  35. package/dist/templates/full-stack/src/actions/create-message.ts +5 -5
  36. package/dist/templates/full-stack/src/i18n.ts +4 -4
  37. package/dist/templates/full-stack/src/main.tsx +4 -5
  38. package/dist/templates/full-stack/src/pages/home.tsx +5 -5
  39. package/dist/templates/full-stack/src/pages/layout.tsx +15 -5
  40. package/dist/templates/full-stack/src/pages/not-found.tsx +5 -2
  41. package/dist/templates/full-stack/src/routes.tsx +11 -12
  42. package/dist/templates/full-stack/src/schemas.ts +1 -2
  43. package/dist/templates/full-stack/src/server/action-registry.ts +5 -10
  44. package/dist/templates/full-stack/src/server/actions/create-message.ts +4 -4
  45. package/dist/templates/full-stack/src/server/app.ts +67 -57
  46. package/dist/templates/full-stack/src/server/dependencies.ts +10 -10
  47. package/dist/templates/full-stack/src/server/entry-server.ts +3 -3
  48. package/dist/templates/full-stack/src/telemetry.ts +1 -2
  49. package/dist/templates/full-stack/tests/actions/create-message.test.ts +7 -8
  50. package/dist/templates/full-stack/tsconfig.json +1 -2
  51. package/dist/templates/full-stack/vite.config.ts +5 -6
  52. package/dist/templates/spa/AGENTS.md +1 -1
  53. package/dist/templates/spa/package.json +3 -4
  54. package/dist/templates/spa/src/adapters/operations-client.ts +7 -2
  55. package/dist/templates/spa/src/pages/app/_routes.tsx +2 -0
  56. package/dist/templates/spa/src/pages/app/admin-home.tsx +21 -3
  57. package/dist/templates/spa/src/pages/public/_routes.tsx +2 -0
  58. package/dist/templates/spa/src/styles.css +1 -1
  59. package/dist/templates/spa/tsconfig.json +2 -1
  60. package/dist/templates/spa/vitest.config.ts +0 -4
  61. package/dist/templates/ssg/README.md +1 -1
  62. package/dist/templates/ssg/package.json +1 -1
  63. package/dist/templates/ssg/ssg.config.ts +7 -0
  64. package/dist/templates/ssg/tests/ssg-config.test.ts +5 -3
  65. package/dist/templates/ssg/tsconfig.json +2 -1
  66. package/dist/templates/ssg/vitest.config.ts +0 -4
  67. package/dist/templates/ssr/package.json +2 -2
  68. package/dist/templates/ssr/server.ts +4 -10
  69. package/dist/templates/ssr/src/entry-server.tsx +6 -4
  70. package/dist/templates/startkit/package.json +2 -2
  71. package/dist/templates/startkit/src/lib/mock-data.ts +17 -39
  72. package/dist/templates/startkit/tsconfig.json +2 -1
  73. package/dist/update.d.ts +41 -0
  74. package/dist/update.js +282 -2
  75. package/dist/writer-D8qe_7ud.js +226 -0
  76. package/package.json +23 -22
  77. package/dist/add-DqhqRzBQ.js +0 -555
  78. package/dist/add-DqhqRzBQ.js.map +0 -1
  79. package/dist/cli.js.map +0 -1
  80. package/dist/create.js.map +0 -1
  81. package/dist/is-direct-execution-Cdlr-ZUl.js.map +0 -1
  82. package/dist/openapi.js.map +0 -1
  83. package/dist/skills-Bh0mEhIx.js.map +0 -1
  84. package/dist/ssg.js.map +0 -1
  85. package/dist/templates/full-stack/src/vite-server.d.ts +0 -6
  86. package/dist/templates/spa/src/styles.d.ts +0 -1
  87. package/dist/templates/ssg/src/vite-env.d.ts +0 -5
  88. package/dist/templates/ssr/src/vite-server.d.ts +0 -7
  89. package/dist/templates/startkit/src/vite-env.d.ts +0 -5
  90. package/dist/update-DyW1na5V.js +0 -1140
  91. package/dist/update-DyW1na5V.js.map +0 -1
  92. package/skills/askr-accessibility/SKILL.md +0 -68
  93. package/skills/askr-accessibility/agents/openai.yaml +0 -4
  94. package/skills/askr-agent-execution/SKILL.md +0 -85
  95. package/skills/askr-agent-execution/agents/openai.yaml +0 -4
  96. package/skills/askr-agent-workflows/SKILL.md +0 -57
  97. package/skills/askr-agent-workflows/agents/openai.yaml +0 -4
  98. package/skills/askr-api-integration/SKILL.md +0 -79
  99. package/skills/askr-api-integration/agents/openai.yaml +0 -4
  100. package/skills/askr-app-builder/SKILL.md +0 -99
  101. package/skills/askr-app-builder/agents/openai.yaml +0 -4
  102. package/skills/askr-auth-access/SKILL.md +0 -74
  103. package/skills/askr-auth-access/agents/openai.yaml +0 -4
  104. package/skills/askr-cli-vite/SKILL.md +0 -76
  105. package/skills/askr-cli-vite/agents/openai.yaml +0 -4
  106. package/skills/askr-dashboard-charts/SKILL.md +0 -82
  107. package/skills/askr-dashboard-charts/agents/openai.yaml +0 -4
  108. package/skills/askr-design-system/SKILL.md +0 -86
  109. package/skills/askr-design-system/agents/openai.yaml +0 -4
  110. package/skills/askr-env-config/SKILL.md +0 -74
  111. package/skills/askr-env-config/agents/openai.yaml +0 -4
  112. package/skills/askr-error-loading-empty/SKILL.md +0 -89
  113. package/skills/askr-error-loading-empty/agents/openai.yaml +0 -4
  114. package/skills/askr-file-upload-artifacts/SKILL.md +0 -77
  115. package/skills/askr-file-upload-artifacts/agents/openai.yaml +0 -4
  116. package/skills/askr-forms-tables-crud/SKILL.md +0 -98
  117. package/skills/askr-forms-tables-crud/agents/openai.yaml +0 -4
  118. package/skills/askr-mental-model/SKILL.md +0 -109
  119. package/skills/askr-mental-model/agents/openai.yaml +0 -4
  120. package/skills/askr-migration-react/SKILL.md +0 -81
  121. package/skills/askr-migration-react/agents/openai.yaml +0 -4
  122. package/skills/askr-observability-debugging/SKILL.md +0 -83
  123. package/skills/askr-observability-debugging/agents/openai.yaml +0 -4
  124. package/skills/askr-project-structure/SKILL.md +0 -79
  125. package/skills/askr-project-structure/agents/openai.yaml +0 -4
  126. package/skills/askr-query-mutation/SKILL.md +0 -115
  127. package/skills/askr-query-mutation/agents/openai.yaml +0 -4
  128. package/skills/askr-realtime-streaming/SKILL.md +0 -76
  129. package/skills/askr-realtime-streaming/agents/openai.yaml +0 -4
  130. package/skills/askr-resources-data/SKILL.md +0 -100
  131. package/skills/askr-resources-data/agents/openai.yaml +0 -4
  132. package/skills/askr-routing-layouts/SKILL.md +0 -107
  133. package/skills/askr-routing-layouts/agents/openai.yaml +0 -4
  134. package/skills/askr-runtime-reactivity/SKILL.md +0 -92
  135. package/skills/askr-runtime-reactivity/agents/openai.yaml +0 -4
  136. package/skills/askr-ssr-ssg/SKILL.md +0 -76
  137. package/skills/askr-ssr-ssg/agents/openai.yaml +0 -4
  138. package/skills/askr-testing-determinism/SKILL.md +0 -75
  139. package/skills/askr-testing-determinism/agents/openai.yaml +0 -4
  140. package/skills/askr-theming/SKILL.md +0 -86
  141. package/skills/askr-theming/agents/openai.yaml +0 -4
  142. package/skills/askr-ui-composition/SKILL.md +0 -92
  143. package/skills/askr-ui-composition/agents/openai.yaml +0 -4
  144. package/templates/full-stack/AGENTS.md +0 -12
  145. package/templates/full-stack/README.md +0 -18
  146. package/templates/full-stack/gitignore.template +0 -4
  147. package/templates/full-stack/index.html +0 -14
  148. package/templates/full-stack/package.json +0 -37
  149. package/templates/full-stack/server.ts +0 -13
  150. package/templates/full-stack/src/action-authorizations.ts +0 -10
  151. package/templates/full-stack/src/actions/create-message.ts +0 -10
  152. package/templates/full-stack/src/i18n.ts +0 -8
  153. package/templates/full-stack/src/main.tsx +0 -12
  154. package/templates/full-stack/src/pages/home.tsx +0 -25
  155. package/templates/full-stack/src/pages/layout.tsx +0 -33
  156. package/templates/full-stack/src/pages/not-found.tsx +0 -4
  157. package/templates/full-stack/src/routes.tsx +0 -20
  158. package/templates/full-stack/src/schemas.ts +0 -11
  159. package/templates/full-stack/src/server/action-registry.ts +0 -12
  160. package/templates/full-stack/src/server/actions/create-message.ts +0 -14
  161. package/templates/full-stack/src/server/app.ts +0 -66
  162. package/templates/full-stack/src/server/dependencies.ts +0 -55
  163. package/templates/full-stack/src/server/entry-server.ts +0 -8
  164. package/templates/full-stack/src/telemetry.ts +0 -4
  165. package/templates/full-stack/src/vite-server.d.ts +0 -6
  166. package/templates/full-stack/tests/actions/create-message.test.ts +0 -13
  167. package/templates/full-stack/tsconfig.json +0 -16
  168. package/templates/full-stack/vite.config.ts +0 -11
  169. package/templates/spa/AGENTS.md +0 -60
  170. package/templates/spa/README.md +0 -96
  171. package/templates/spa/gitignore.template +0 -16
  172. package/templates/spa/index.html +0 -13
  173. package/templates/spa/package.json +0 -35
  174. package/templates/spa/src/adapters/operations-client.ts +0 -90
  175. package/templates/spa/src/components/shared/metric-card.tsx +0 -27
  176. package/templates/spa/src/components/shared/status-badge.tsx +0 -24
  177. package/templates/spa/src/features/operations/operations.query.ts +0 -9
  178. package/templates/spa/src/main.tsx +0 -10
  179. package/templates/spa/src/pages/_layout.tsx +0 -9
  180. package/templates/spa/src/pages/_routes.tsx +0 -27
  181. package/templates/spa/src/pages/app/_layout.tsx +0 -94
  182. package/templates/spa/src/pages/app/_routes.tsx +0 -10
  183. package/templates/spa/src/pages/app/admin-home.tsx +0 -152
  184. package/templates/spa/src/pages/app/agent-runs.tsx +0 -93
  185. package/templates/spa/src/pages/app/settings.tsx +0 -91
  186. package/templates/spa/src/pages/auth/_layout.tsx +0 -38
  187. package/templates/spa/src/pages/auth/_routes.tsx +0 -6
  188. package/templates/spa/src/pages/auth/login.tsx +0 -63
  189. package/templates/spa/src/pages/not-found.tsx +0 -22
  190. package/templates/spa/src/pages/public/_layout.tsx +0 -47
  191. package/templates/spa/src/pages/public/_routes.tsx +0 -6
  192. package/templates/spa/src/pages/public/home.tsx +0 -143
  193. package/templates/spa/src/shared/format.ts +0 -12
  194. package/templates/spa/src/shared/navigation.ts +0 -15
  195. package/templates/spa/src/styles/components.css +0 -49
  196. package/templates/spa/src/styles/layout.css +0 -192
  197. package/templates/spa/src/styles/reset.css +0 -44
  198. package/templates/spa/src/styles/theme.css +0 -57
  199. package/templates/spa/src/styles/tokens.css +0 -20
  200. package/templates/spa/src/styles.css +0 -7
  201. package/templates/spa/src/styles.d.ts +0 -1
  202. package/templates/spa/tests/app.test.tsx +0 -37
  203. package/templates/spa/tests/components/shared.test.tsx +0 -12
  204. package/templates/spa/tests/resources.test.ts +0 -22
  205. package/templates/spa/tsconfig.json +0 -20
  206. package/templates/spa/tsconfig.node.json +0 -10
  207. package/templates/spa/vite.config.ts +0 -24
  208. package/templates/spa/vitest.config.ts +0 -17
  209. package/templates/ssg/AGENTS.md +0 -55
  210. package/templates/ssg/README.md +0 -39
  211. package/templates/ssg/gitignore.template +0 -17
  212. package/templates/ssg/index.html +0 -13
  213. package/templates/ssg/package.json +0 -35
  214. package/templates/ssg/src/app.tsx +0 -14
  215. package/templates/ssg/src/components/badge.tsx +0 -3
  216. package/templates/ssg/src/components/counter.tsx +0 -30
  217. package/templates/ssg/src/components/site-shell.tsx +0 -111
  218. package/templates/ssg/src/jsx.d.ts +0 -23
  219. package/templates/ssg/src/main.tsx +0 -8
  220. package/templates/ssg/src/pages/about.tsx +0 -82
  221. package/templates/ssg/src/pages/content.tsx +0 -63
  222. package/templates/ssg/src/pages/example.tsx +0 -97
  223. package/templates/ssg/src/pages/home.tsx +0 -51
  224. package/templates/ssg/src/resources/user.ts +0 -15
  225. package/templates/ssg/src/routes.tsx +0 -15
  226. package/templates/ssg/src/styles.css +0 -89
  227. package/templates/ssg/src/vite-env.d.ts +0 -5
  228. package/templates/ssg/ssg.config.ts +0 -34
  229. package/templates/ssg/tests/app.test.tsx +0 -19
  230. package/templates/ssg/tests/components/counter.test.tsx +0 -18
  231. package/templates/ssg/tests/resources.test.ts +0 -11
  232. package/templates/ssg/tests/ssg-config.test.ts +0 -11
  233. package/templates/ssg/tsconfig.json +0 -20
  234. package/templates/ssg/tsconfig.node.json +0 -10
  235. package/templates/ssg/vite.config.ts +0 -24
  236. package/templates/ssg/vitest.config.ts +0 -17
  237. package/templates/ssr/AGENTS.md +0 -28
  238. package/templates/ssr/README.md +0 -38
  239. package/templates/ssr/gitignore.template +0 -16
  240. package/templates/ssr/index.html +0 -13
  241. package/templates/ssr/package.json +0 -34
  242. package/templates/ssr/server.ts +0 -16
  243. package/templates/ssr/src/app.tsx +0 -21
  244. package/templates/ssr/src/components/counter.tsx +0 -26
  245. package/templates/ssr/src/entry-server.tsx +0 -10
  246. package/templates/ssr/src/main.tsx +0 -11
  247. package/templates/ssr/src/pages/about.tsx +0 -75
  248. package/templates/ssr/src/pages/example.tsx +0 -113
  249. package/templates/ssr/src/pages/home.tsx +0 -56
  250. package/templates/ssr/src/resources/user.ts +0 -15
  251. package/templates/ssr/src/routes.tsx +0 -13
  252. package/templates/ssr/src/styles.css +0 -148
  253. package/templates/ssr/src/vite-server.d.ts +0 -7
  254. package/templates/ssr/tests/app.test.tsx +0 -24
  255. package/templates/ssr/tests/components/counter.test.tsx +0 -13
  256. package/templates/ssr/tests/resources.test.ts +0 -11
  257. package/templates/ssr/tsconfig.json +0 -22
  258. package/templates/ssr/tsconfig.node.json +0 -10
  259. package/templates/ssr/tsconfig.server.json +0 -15
  260. package/templates/ssr/vite.config.ts +0 -25
  261. package/templates/ssr/vitest.config.ts +0 -13
  262. package/templates/startkit/AGENTS.md +0 -77
  263. package/templates/startkit/README.md +0 -192
  264. package/templates/startkit/gitignore.template +0 -16
  265. package/templates/startkit/index.html +0 -13
  266. package/templates/startkit/package.json +0 -35
  267. package/templates/startkit/src/components/app-header.tsx +0 -93
  268. package/templates/startkit/src/components/app-sidebar.tsx +0 -95
  269. package/templates/startkit/src/components/data-table.tsx +0 -80
  270. package/templates/startkit/src/components/empty-state.tsx +0 -13
  271. package/templates/startkit/src/components/page-header.tsx +0 -23
  272. package/templates/startkit/src/components/stat-card.tsx +0 -24
  273. package/templates/startkit/src/features/accounts/account-filters.tsx +0 -61
  274. package/templates/startkit/src/features/accounts/account-table.tsx +0 -79
  275. package/templates/startkit/src/lib/format.ts +0 -31
  276. package/templates/startkit/src/lib/mock-data.ts +0 -441
  277. package/templates/startkit/src/lib/routes.ts +0 -116
  278. package/templates/startkit/src/main.tsx +0 -12
  279. package/templates/startkit/src/pages/_layout.tsx +0 -56
  280. package/templates/startkit/src/pages/auth/_layout.tsx +0 -7
  281. package/templates/startkit/src/pages/auth/login.tsx +0 -129
  282. package/templates/startkit/src/pages/home.tsx +0 -83
  283. package/templates/startkit/src/pages/not-found.tsx +0 -24
  284. package/templates/startkit/src/pages/workspace/_layout.tsx +0 -17
  285. package/templates/startkit/src/pages/workspace/accounts/index.tsx +0 -217
  286. package/templates/startkit/src/pages/workspace/dashboard.tsx +0 -118
  287. package/templates/startkit/src/pages/workspace/settings.tsx +0 -218
  288. package/templates/startkit/src/router.tsx +0 -7
  289. package/templates/startkit/src/routes/auth-config.ts +0 -38
  290. package/templates/startkit/src/routes/auth.ts +0 -8
  291. package/templates/startkit/src/routes/index.ts +0 -28
  292. package/templates/startkit/src/routes/public.ts +0 -8
  293. package/templates/startkit/src/routes/workspace/accounts.ts +0 -8
  294. package/templates/startkit/src/routes/workspace/index.ts +0 -14
  295. package/templates/startkit/src/styles/components.css +0 -396
  296. package/templates/startkit/src/styles/layout.css +0 -192
  297. package/templates/startkit/src/styles/reset.css +0 -38
  298. package/templates/startkit/src/styles/theme.css +0 -76
  299. package/templates/startkit/src/styles/tokens.css +0 -67
  300. package/templates/startkit/src/styles.css +0 -7
  301. package/templates/startkit/src/toast.ts +0 -55
  302. package/templates/startkit/src/utils/join-classes.ts +0 -4
  303. package/templates/startkit/src/vite-env.d.ts +0 -5
  304. package/templates/startkit/tests/app.test.tsx +0 -32
  305. package/templates/startkit/tests/preferences.test.ts +0 -43
  306. package/templates/startkit/tests/resources.test.ts +0 -82
  307. package/templates/startkit/tsconfig.json +0 -20
  308. package/templates/startkit/tsconfig.node.json +0 -10
  309. package/templates/startkit/vite.config.ts +0 -32
  310. package/templates/startkit/vitest.config.ts +0 -13
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>{{appName}}</title>
7
- <!--askr-head-->
8
- </head>
9
- <body>
10
- <div id="app"><!--askr-app--></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
@@ -1,34 +0,0 @@
1
- {
2
- "name": "{{appName}}",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "scripts": {
6
- "dev": "vp dev",
7
- "build": "vp build && vp build --ssr server.ts --outDir dist/server",
8
- "preview": "node dist/server/server.js",
9
- "test": "vp test run",
10
- "typecheck": "tsc --noEmit",
11
- "lint": "vp lint src server.ts tests vite.config.ts",
12
- "lint:fix": "npm run lint -- --fix",
13
- "fmt": "vp fmt \"src/**/*.{ts,tsx,css}\" \"server.ts\" \"tests/**/*.{ts,tsx}\" \"*.md\"",
14
- "check": "npm run lint && npm run typecheck && npm test && npm run build"
15
- },
16
- "dependencies": {
17
- "@askrjs/askr": ">=0.0.53 <0.1.0",
18
- "@askrjs/node": ">=0.0.1 <0.1.0",
19
- "@askrjs/server": ">=0.0.1 <0.1.0",
20
- "@askrjs/themes": ">=0.0.12 <0.1.0",
21
- "@askrjs/ui": ">=0.0.13 <0.1.0"
22
- },
23
- "devDependencies": {
24
- "@askrjs/vite": ">=0.0.6 <0.1.0",
25
- "@types/node": "^26.0.0",
26
- "jsdom": "^29.1.1",
27
- "tsx": "^4.23.1",
28
- "typescript": "^6.0.3",
29
- "vite-plus": "^0.2.4"
30
- },
31
- "engines": {
32
- "node": "^20.19.0 || >=22.12.0"
33
- }
34
- }
@@ -1,16 +0,0 @@
1
- import { listen } from '@askrjs/node';
2
- import app from 'virtual:askr-server';
3
-
4
- const port = Number(process.env.PORT ?? 3000);
5
- const server = await listen(app, {
6
- host: process.env.HOST ?? '127.0.0.1',
7
- port,
8
- });
9
- const address = server.address();
10
- const boundPort = typeof address === 'object' && address ? address.port : port;
11
-
12
- console.log(`Server started at http://127.0.0.1:${boundPort}`);
13
-
14
- const shutdown = () => server.close();
15
- process.once('SIGINT', shutdown);
16
- process.once('SIGTERM', shutdown);
@@ -1,21 +0,0 @@
1
- import './styles.css';
2
- import { Link } from '@askrjs/askr/router';
3
-
4
- export default function App({ children }: { children?: unknown }) {
5
- return (
6
- <div>
7
- <header>
8
- <nav>
9
- <Link href="/">
10
- <strong>{'{{appName}}'}</strong>
11
- </Link>
12
- <div class="nav-links">
13
- <Link href="/example">Example</Link>
14
- <Link href="/about">About</Link>
15
- </div>
16
- </nav>
17
- </header>
18
- <main>{children}</main>
19
- </div>
20
- );
21
- }
@@ -1,26 +0,0 @@
1
- import { state, derive } from '@askrjs/askr';
2
- import { Button } from '@askrjs/ui/button';
3
-
4
- export default function Counter() {
5
- const [count, setCount] = state(0);
6
- const parity = derive(() => (count() % 2 === 0 ? 'even' : 'odd'));
7
-
8
- return (
9
- <div class="counter">
10
- <h2>Interactive Counter</h2>
11
- <p class="text-muted">
12
- Built with <code>state()</code> and <code>derive()</code>
13
- </p>
14
- <div class="counter-value">{count()}</div>
15
- <div>
16
- <span class="badge">{parity()}</span>
17
- </div>
18
- <div class="counter-controls">
19
- <Button onPress={() => setCount((c) => Math.max(0, c - 1))}>
20
- - Decrement
21
- </Button>
22
- <Button onPress={() => setCount((c) => c + 1)}>+ Increment</Button>
23
- </div>
24
- </div>
25
- );
26
- }
@@ -1,10 +0,0 @@
1
- import { createServerApp } from '@askrjs/server';
2
- import { createAskrPageHandler } from '@askrjs/server/askr';
3
- import { pageRegistry } from './routes';
4
-
5
- const app = createServerApp({
6
- fallback: createAskrPageHandler({ registry: pageRegistry }),
7
- });
8
-
9
- export { app };
10
- export default app;
@@ -1,11 +0,0 @@
1
- import { createSPA, hydrateSPA } from '@askrjs/askr/boot';
2
- import { pageRegistry } from './routes';
3
-
4
- const root = document.getElementById('app');
5
- if (!root) throw new Error('Missing #app root element.');
6
-
7
- if (root.hasChildNodes()) {
8
- await hydrateSPA({ root, registry: pageRegistry });
9
- } else {
10
- await createSPA({ root, registry: pageRegistry });
11
- }
@@ -1,75 +0,0 @@
1
- export default function About() {
2
- return (
3
- <>
4
- <h1>About Askr</h1>
5
- <p class="text-muted">
6
- A modern reactive framework for building fast, maintainable web
7
- applications.
8
- </p>
9
-
10
- <section class="section">
11
- <h2>Why Askr Exists</h2>
12
- <p>
13
- Modern web development has become unnecessarily complex. Frameworks
14
- have grown bloated with abstractions, requiring developers to learn
15
- extensive APIs and fight against the framework rather than work with
16
- it.
17
- </p>
18
- <p>
19
- Askr was created to bring simplicity back to web development. It
20
- provides just enough structure to build sophisticated applications
21
- while staying out of your way.
22
- </p>
23
- </section>
24
-
25
- <section class="section">
26
- <h2>Core Primitives</h2>
27
- <div class="features">
28
- <div class="feature-card">
29
- <h3>Fine-grained Reactivity</h3>
30
- <p>
31
- <code>state()</code> for reactive values with automatic dependency
32
- tracking. Updates are surgical — only the specific DOM nodes that
33
- need to change are updated.
34
- </p>
35
- </div>
36
- <div class="feature-card">
37
- <h3>Simple Async Data</h3>
38
- <p>
39
- <code>resource()</code> handles async data fetching with built-in
40
- loading states, error handling, and automatic refetching when
41
- dependencies change.
42
- </p>
43
- </div>
44
- <div class="feature-card">
45
- <h3>Declarative Routing</h3>
46
- <p>
47
- Routes are declared at module-load time with{' '}
48
- <code>createRouteRegistry()</code>, <code>group()</code>, and{' '}
49
- <code>route()</code>. Clean, type-safe, and no configuration
50
- needed.
51
- </p>
52
- </div>
53
- </div>
54
- </section>
55
-
56
- <section class="section">
57
- <h2>The Ecosystem</h2>
58
- <p>
59
- <strong>askr</strong> — the core framework with reactive primitives,
60
- routing, SSR, and SSG support. Zero runtime dependencies.
61
- </p>
62
- <p>
63
- <strong>askr-ui</strong> — headless, accessible UI components. Button,
64
- Accordion, Dialog, and 30+ more. All interaction logic, no opinions on
65
- style.
66
- </p>
67
- <p>
68
- <strong>askr-themes</strong> — CSS-only themes that target askr-ui's{' '}
69
- <code>data-slot</code> attributes. Swap themes with a single import
70
- change.
71
- </p>
72
- </section>
73
- </>
74
- );
75
- }
@@ -1,113 +0,0 @@
1
- import { state } from '@askrjs/askr';
2
- import {
3
- Accordion,
4
- AccordionItem,
5
- AccordionHeader,
6
- AccordionTrigger,
7
- AccordionContent,
8
- } from '@askrjs/ui/accordion';
9
- import { Toggle } from '@askrjs/ui/toggle';
10
- import { Input } from '@askrjs/ui/input';
11
- import Counter from '../components/counter';
12
-
13
- export default function Example() {
14
- const [name, setName] = state('');
15
- const [bold, setBold] = state(false);
16
-
17
- return (
18
- <>
19
- <h1>Component Showcase</h1>
20
- <p class="text-muted">
21
- askr-ui headless components styled by askr-themes — working together
22
- out of the box.
23
- </p>
24
-
25
- <Counter />
26
-
27
- <div class="showcase-section">
28
- <h3>Reactivity</h3>
29
- <p>
30
- Askr uses <code>state()</code> for reactive values that automatically
31
- track dependencies and update only the DOM nodes that need to change.
32
- </p>
33
- <p>
34
- Create reactive state with{' '}
35
- <code>const [count, setCount] = state(0)</code>, read with{' '}
36
- <code>count()</code>, and update with{' '}
37
- <code>setCount(n =&gt; n + 1)</code>.
38
- </p>
39
- <p>
40
- Core primitives: <code>state()</code>, <code>derive()</code>,{' '}
41
- <code>selector()</code>, <code>resource()</code>, and <code>For</code>
42
- .
43
- </p>
44
- </div>
45
-
46
- <div class="showcase-section">
47
- <h3>Accordion</h3>
48
- <Accordion type="single" collapsible>
49
- <AccordionItem value="reactivity">
50
- <AccordionHeader>
51
- <AccordionTrigger>
52
- What is fine-grained reactivity?
53
- </AccordionTrigger>
54
- </AccordionHeader>
55
- <AccordionContent>
56
- <p>
57
- Fine-grained reactivity means updates are surgical. When a state
58
- value changes, only the specific DOM nodes that read that value
59
- are updated — no virtual DOM diffing, no component re-renders.
60
- </p>
61
- </AccordionContent>
62
- </AccordionItem>
63
- <AccordionItem value="ssr">
64
- <AccordionHeader>
65
- <AccordionTrigger>Does Askr support SSR?</AccordionTrigger>
66
- </AccordionHeader>
67
- <AccordionContent>
68
- <p>
69
- Yes. Askr provides <code>renderToString()</code> and{' '}
70
- <code>renderToStream()</code> for server-side rendering, plus{' '}
71
- <code>hydrateSPA()</code> for client hydration.
72
- </p>
73
- </AccordionContent>
74
- </AccordionItem>
75
- <AccordionItem value="themes">
76
- <AccordionHeader>
77
- <AccordionTrigger>How does theming work?</AccordionTrigger>
78
- </AccordionHeader>
79
- <AccordionContent>
80
- <p>
81
- askr-ui components emit <code>data-slot</code> attributes.
82
- askr-themes provides CSS that targets these slots with design
83
- tokens. Switch themes by changing a single CSS import.
84
- </p>
85
- </AccordionContent>
86
- </AccordionItem>
87
- </Accordion>
88
- </div>
89
-
90
- <div class="showcase-section">
91
- <h3>Toggle &amp; Input</h3>
92
- <p class="text-muted">
93
- Reactive state driving UI updates in real time.
94
- </p>
95
- <div style="display: flex; align-items: center; gap: var(--ak-space-md); margin-bottom: var(--ak-space-md);">
96
- <Toggle pressed={bold()} onPress={() => setBold((b) => !b)}>
97
- Bold
98
- </Toggle>
99
- <Input
100
- placeholder="Type your name..."
101
- value={name()}
102
- onInput={(e: Event) =>
103
- setName((e.target as HTMLInputElement).value)
104
- }
105
- />
106
- </div>
107
- <p style={`font-weight: ${bold() ? '700' : '400'}`}>
108
- {name() ? `Hello, ${name()}!` : 'Type something above...'}
109
- </p>
110
- </div>
111
- </>
112
- );
113
- }
@@ -1,56 +0,0 @@
1
- import { Link } from '@askrjs/askr/router';
2
- import { Button } from '@askrjs/ui/button';
3
-
4
- export default function Home() {
5
- return (
6
- <>
7
- <section class="text-center section">
8
- <h1>Welcome to Askr</h1>
9
- <p class="text-muted">
10
- A minimalist reactive framework for modern web applications.
11
- Fine-grained reactivity, zero runtime dependencies, TypeScript-first.
12
- </p>
13
- <div class="hero-actions">
14
- <Button asChild>
15
- <Link href="/example">View Examples</Link>
16
- </Button>
17
- <Button asChild>
18
- <Link href="/about">Learn More</Link>
19
- </Button>
20
- </div>
21
- </section>
22
-
23
- <div class="features">
24
- <div class="feature-card">
25
- <h3>
26
- <span class="badge">Reactive</span>
27
- </h3>
28
- <p>
29
- <code>state()</code> and <code>derive()</code> give you fine-grained
30
- reactivity. Only the DOM nodes that depend on changed values update
31
- — nothing more.
32
- </p>
33
- </div>
34
- <div class="feature-card">
35
- <h3>
36
- <span class="badge">Async</span>
37
- </h3>
38
- <p>
39
- <code>resource()</code> handles data fetching with built-in loading
40
- states, error handling, and automatic refetching when dependencies
41
- change.
42
- </p>
43
- </div>
44
- <div class="feature-card">
45
- <h3>
46
- <span class="badge">Composable</span>
47
- </h3>
48
- <p>
49
- askr-ui provides headless components. askr-themes provides CSS
50
- themes. Mix and match — or build your own.
51
- </p>
52
- </div>
53
- </div>
54
- </>
55
- );
56
- }
@@ -1,15 +0,0 @@
1
- import { resource } from '@askrjs/askr/resources';
2
-
3
- export function fetchUser(id: number) {
4
- return resource(
5
- async ({ signal }: { signal: AbortSignal }) => {
6
- // Simulate API call
7
- await new Promise((resolve) => setTimeout(resolve, 100));
8
- if (signal.aborted) {
9
- throw new DOMException('Request aborted', 'AbortError');
10
- }
11
- return { id, name: `User ${id}`, email: `user${id}@example.com` };
12
- },
13
- [id]
14
- );
15
- }
@@ -1,13 +0,0 @@
1
- import { createRouteRegistry, group, route } from '@askrjs/askr/router';
2
- import AppLayout from './app';
3
- import Home from './pages/home';
4
- import About from './pages/about';
5
- import Example from './pages/example';
6
-
7
- export const pageRegistry = createRouteRegistry(() => {
8
- group({ layout: AppLayout }, () => {
9
- route('/', Home);
10
- route('/about', About);
11
- route('/example', Example);
12
- });
13
- });
@@ -1,148 +0,0 @@
1
- @import '@askrjs/themes/default';
2
-
3
- /* Layout */
4
- body {
5
- margin: 0;
6
- background: var(--ak-color-bg);
7
- color: var(--ak-color-fg);
8
- font-family: var(--ak-font-family);
9
- }
10
-
11
- header {
12
- border-bottom: 1px solid var(--ak-color-border);
13
- padding: var(--ak-space-md) var(--ak-space-xl);
14
- }
15
-
16
- header nav {
17
- display: flex;
18
- align-items: center;
19
- justify-content: space-between;
20
- max-width: var(--ak-layout-content-max-width);
21
- margin: 0 auto;
22
- }
23
-
24
- header nav a {
25
- color: var(--ak-color-fg);
26
- text-decoration: none;
27
- font-size: var(--ak-font-size-md);
28
- }
29
-
30
- header nav a:hover {
31
- color: var(--ak-color-primary);
32
- }
33
-
34
- main {
35
- max-width: var(--ak-layout-content-max-width);
36
- margin: 0 auto;
37
- padding: var(--ak-space-xl);
38
- }
39
-
40
- /* Utility */
41
- .nav-links {
42
- display: flex;
43
- align-items: center;
44
- gap: var(--ak-space-lg);
45
- }
46
-
47
- .section {
48
- margin-bottom: var(--ak-space-xl);
49
- }
50
-
51
- .text-center {
52
- text-align: center;
53
- }
54
-
55
- .text-muted {
56
- color: var(--ak-color-muted);
57
- }
58
-
59
- h1,
60
- h2,
61
- h3 {
62
- color: var(--ak-color-fg);
63
- margin: 0 0 var(--ak-space-md);
64
- }
65
-
66
- p {
67
- line-height: 1.6;
68
- margin: 0 0 var(--ak-space-md);
69
- }
70
-
71
- code {
72
- background: var(--ak-color-surface-muted);
73
- padding: 0.15em 0.4em;
74
- border-radius: var(--ak-radius-sm);
75
- font-size: 0.9em;
76
- }
77
-
78
- /* Feature grid */
79
- .features {
80
- display: grid;
81
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
82
- gap: var(--ak-space-lg);
83
- margin: var(--ak-space-xl) 0;
84
- }
85
-
86
- .feature-card {
87
- background: var(--ak-color-surface);
88
- border: 1px solid var(--ak-color-border);
89
- border-radius: var(--ak-radius-md);
90
- padding: var(--ak-space-lg);
91
- }
92
-
93
- /* Counter */
94
- .counter {
95
- background: var(--ak-color-surface);
96
- border: 1px solid var(--ak-color-border);
97
- border-radius: var(--ak-radius-md);
98
- padding: var(--ak-space-xl);
99
- text-align: center;
100
- }
101
-
102
- .counter-value {
103
- font-size: 4rem;
104
- font-weight: 800;
105
- color: var(--ak-color-primary);
106
- margin: var(--ak-space-lg) 0;
107
- line-height: 1;
108
- }
109
-
110
- .counter-controls {
111
- display: flex;
112
- justify-content: center;
113
- gap: var(--ak-space-md);
114
- margin-top: var(--ak-space-lg);
115
- }
116
-
117
- /* Component showcase */
118
- .showcase-section {
119
- background: var(--ak-color-surface);
120
- border: 1px solid var(--ak-color-border);
121
- border-radius: var(--ak-radius-md);
122
- padding: var(--ak-space-lg);
123
- margin-bottom: var(--ak-space-lg);
124
- }
125
-
126
- .showcase-section h3 {
127
- margin-bottom: var(--ak-space-md);
128
- }
129
-
130
- /* Hero buttons */
131
- .hero-actions {
132
- display: flex;
133
- gap: var(--ak-space-md);
134
- justify-content: center;
135
- margin: var(--ak-space-xl) 0;
136
- }
137
-
138
- /* Responsive */
139
- @media (max-width: 48rem) {
140
- .features {
141
- grid-template-columns: 1fr;
142
- }
143
-
144
- .hero-actions {
145
- flex-direction: column;
146
- align-items: stretch;
147
- }
148
- }
@@ -1,7 +0,0 @@
1
- declare module 'virtual:askr-server' {
2
- import type { ServerApp } from '@askrjs/server';
3
-
4
- const app: ServerApp;
5
- export { app };
6
- export default app;
7
- }
@@ -1,24 +0,0 @@
1
- import { describe, it, expect } from 'vite-plus/test';
2
-
3
- describe('App Component', () => {
4
- it('renders layout with navigation', () => {
5
- const app = (
6
- <div>
7
- <header>
8
- <nav>
9
- <strong>Askr</strong>
10
- <div>
11
- <a href="/example">Example</a>
12
- <a href="/about">About</a>
13
- </div>
14
- </nav>
15
- </header>
16
- <main>
17
- <p>Content goes here</p>
18
- </main>
19
- </div>
20
- );
21
-
22
- expect(app).toBeDefined();
23
- });
24
- });
@@ -1,13 +0,0 @@
1
- import { describe, expect, it } from 'vite-plus/test';
2
- import { renderToString } from '@askrjs/askr/ssr';
3
- import Counter from '../../src/components/counter';
4
-
5
- describe('Counter', () => {
6
- it('renders its initial state during SSR', () => {
7
- const html = renderToString(() => <Counter />);
8
-
9
- expect(html).toContain('counter-value');
10
- expect(html).toContain('>0<');
11
- expect(html).toContain('>even<');
12
- });
13
- });
@@ -1,11 +0,0 @@
1
- import { describe, it, expect } from 'vite-plus/test';
2
- import { fetchUser } from '../src/resources/user';
3
-
4
- describe('SSR Resources', () => {
5
- it('creates a resource for fetching user data', () => {
6
- // Resources are called during component render
7
- // Here we just verify the function is defined
8
- expect(fetchUser).toBeDefined();
9
- expect(typeof fetchUser).toBe('function');
10
- });
11
- });
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "skipLibCheck": true,
9
- "esModuleInterop": true,
10
- "allowSyntheticDefaultImports": true,
11
- "strict": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "noEmit": true,
15
- "jsx": "preserve",
16
- "jsxImportSource": "@askrjs/askr",
17
- "types": ["vite/client"]
18
- },
19
- "include": ["src"],
20
- "exclude": ["dist"],
21
- "references": [{ "path": "./tsconfig.node.json" }]
22
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts", "vitest.config.ts"]
10
- }
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "lib": ["ES2022"],
5
- "module": "NodeNext",
6
- "moduleResolution": "NodeNext",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "outDir": "dist/server",
11
- "noEmit": false,
12
- "types": ["node"]
13
- },
14
- "include": ["server.ts", "src/vite-server.d.ts"]
15
- }