@allstak/wizard 0.1.3 → 0.1.5

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 (296) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/LICENSE +191 -0
  3. package/README.md +299 -47
  4. package/dist/api/http.d.ts +2 -0
  5. package/dist/api/http.d.ts.map +1 -1
  6. package/dist/api/http.js +6 -0
  7. package/dist/api/http.js.map +1 -1
  8. package/dist/api/index.d.ts +1 -0
  9. package/dist/api/index.d.ts.map +1 -1
  10. package/dist/api/index.js +1 -0
  11. package/dist/api/index.js.map +1 -1
  12. package/dist/api/types.d.ts +3 -3
  13. package/dist/api/types.js +3 -3
  14. package/dist/certification/fixtures.d.ts +4 -0
  15. package/dist/certification/fixtures.d.ts.map +1 -0
  16. package/dist/certification/fixtures.js +109 -0
  17. package/dist/certification/fixtures.js.map +1 -0
  18. package/dist/certification/gates.d.ts +10 -0
  19. package/dist/certification/gates.d.ts.map +1 -0
  20. package/dist/certification/gates.js +20 -0
  21. package/dist/certification/gates.js.map +1 -0
  22. package/dist/certification/index.d.ts +6 -0
  23. package/dist/certification/index.d.ts.map +1 -0
  24. package/dist/certification/index.js +5 -0
  25. package/dist/certification/index.js.map +1 -0
  26. package/dist/certification/live-backend.d.ts +50 -0
  27. package/dist/certification/live-backend.d.ts.map +1 -0
  28. package/dist/certification/live-backend.js +422 -0
  29. package/dist/certification/live-backend.js.map +1 -0
  30. package/dist/certification/packages.d.ts +3 -0
  31. package/dist/certification/packages.d.ts.map +1 -0
  32. package/dist/certification/packages.js +49 -0
  33. package/dist/certification/packages.js.map +1 -0
  34. package/dist/certification/process.d.ts +8 -0
  35. package/dist/certification/process.d.ts.map +1 -0
  36. package/dist/certification/process.js +77 -0
  37. package/dist/certification/process.js.map +1 -0
  38. package/dist/certification/report.d.ts +3 -0
  39. package/dist/certification/report.d.ts.map +1 -0
  40. package/dist/certification/report.js +38 -0
  41. package/dist/certification/report.js.map +1 -0
  42. package/dist/certification/runner.d.ts +3 -0
  43. package/dist/certification/runner.d.ts.map +1 -0
  44. package/dist/certification/runner.js +299 -0
  45. package/dist/certification/runner.js.map +1 -0
  46. package/dist/certification/runtime.d.ts +11 -0
  47. package/dist/certification/runtime.d.ts.map +1 -0
  48. package/dist/certification/runtime.js +60 -0
  49. package/dist/certification/runtime.js.map +1 -0
  50. package/dist/certification/types.d.ts +73 -0
  51. package/dist/certification/types.d.ts.map +1 -0
  52. package/dist/certification/types.js +2 -0
  53. package/dist/certification/types.js.map +1 -0
  54. package/dist/cli.js +70 -3
  55. package/dist/cli.js.map +1 -1
  56. package/dist/commands/certify.d.ts +18 -0
  57. package/dist/commands/certify.d.ts.map +1 -0
  58. package/dist/commands/certify.js +27 -0
  59. package/dist/commands/certify.js.map +1 -0
  60. package/dist/commands/init.d.ts.map +1 -1
  61. package/dist/commands/init.js +13 -0
  62. package/dist/commands/init.js.map +1 -1
  63. package/dist/commands/list.d.ts +5 -1
  64. package/dist/commands/list.d.ts.map +1 -1
  65. package/dist/commands/list.js +9 -3
  66. package/dist/commands/list.js.map +1 -1
  67. package/dist/commands/security-snapshot.d.ts +24 -0
  68. package/dist/commands/security-snapshot.d.ts.map +1 -0
  69. package/dist/commands/security-snapshot.js +113 -0
  70. package/dist/commands/security-snapshot.js.map +1 -0
  71. package/dist/index.d.ts +3 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +3 -1
  74. package/dist/index.js.map +1 -1
  75. package/dist/integrations/_scaffold.d.ts +2 -1
  76. package/dist/integrations/_scaffold.d.ts.map +1 -1
  77. package/dist/integrations/_scaffold.js +36 -13
  78. package/dist/integrations/_scaffold.js.map +1 -1
  79. package/dist/integrations/_simple-scaffold.d.ts +5 -2
  80. package/dist/integrations/_simple-scaffold.d.ts.map +1 -1
  81. package/dist/integrations/_simple-scaffold.js +3 -0
  82. package/dist/integrations/_simple-scaffold.js.map +1 -1
  83. package/dist/integrations/dotnet.d.ts.map +1 -1
  84. package/dist/integrations/dotnet.js +3 -0
  85. package/dist/integrations/dotnet.js.map +1 -1
  86. package/dist/integrations/expo/detect.d.ts +13 -0
  87. package/dist/integrations/expo/detect.d.ts.map +1 -0
  88. package/dist/integrations/expo/detect.js +38 -0
  89. package/dist/integrations/expo/detect.js.map +1 -0
  90. package/dist/integrations/expo/doctor.d.ts +6 -0
  91. package/dist/integrations/expo/doctor.d.ts.map +1 -0
  92. package/dist/integrations/expo/doctor.js +136 -0
  93. package/dist/integrations/expo/doctor.js.map +1 -0
  94. package/dist/integrations/expo/files.d.ts +15 -0
  95. package/dist/integrations/expo/files.d.ts.map +1 -0
  96. package/dist/integrations/expo/files.js +62 -0
  97. package/dist/integrations/expo/files.js.map +1 -0
  98. package/dist/integrations/expo/index.d.ts +24 -0
  99. package/dist/integrations/expo/index.d.ts.map +1 -0
  100. package/dist/integrations/expo/index.js +68 -0
  101. package/dist/integrations/expo/index.js.map +1 -0
  102. package/dist/integrations/expo/manifest.d.ts +3 -0
  103. package/dist/integrations/expo/manifest.d.ts.map +1 -0
  104. package/dist/integrations/expo/manifest.js +39 -0
  105. package/dist/integrations/expo/manifest.js.map +1 -0
  106. package/dist/integrations/expo/patch.d.ts +13 -0
  107. package/dist/integrations/expo/patch.d.ts.map +1 -0
  108. package/dist/integrations/expo/patch.js +215 -0
  109. package/dist/integrations/expo/patch.js.map +1 -0
  110. package/dist/integrations/expo/uninstall.d.ts +4 -0
  111. package/dist/integrations/expo/uninstall.d.ts.map +1 -0
  112. package/dist/integrations/expo/uninstall.js +77 -0
  113. package/dist/integrations/expo/uninstall.js.map +1 -0
  114. package/dist/integrations/expo.d.ts +8 -1
  115. package/dist/integrations/expo.d.ts.map +1 -1
  116. package/dist/integrations/expo.js +8 -11
  117. package/dist/integrations/expo.js.map +1 -1
  118. package/dist/integrations/fastify/detect.d.ts +3 -0
  119. package/dist/integrations/fastify/detect.d.ts.map +1 -0
  120. package/dist/integrations/fastify/detect.js +12 -0
  121. package/dist/integrations/fastify/detect.js.map +1 -0
  122. package/dist/integrations/fastify/doctor.d.ts +3 -0
  123. package/dist/integrations/fastify/doctor.d.ts.map +1 -0
  124. package/dist/integrations/fastify/doctor.js +81 -0
  125. package/dist/integrations/fastify/doctor.js.map +1 -0
  126. package/dist/integrations/fastify/files.d.ts +17 -0
  127. package/dist/integrations/fastify/files.d.ts.map +1 -0
  128. package/dist/integrations/fastify/files.js +51 -0
  129. package/dist/integrations/fastify/files.js.map +1 -0
  130. package/dist/integrations/fastify/index.d.ts +3 -0
  131. package/dist/integrations/fastify/index.d.ts.map +1 -0
  132. package/dist/integrations/fastify/index.js +47 -0
  133. package/dist/integrations/fastify/index.js.map +1 -0
  134. package/dist/integrations/fastify/manifest.d.ts +3 -0
  135. package/dist/integrations/fastify/manifest.d.ts.map +1 -0
  136. package/dist/integrations/fastify/manifest.js +34 -0
  137. package/dist/integrations/fastify/manifest.js.map +1 -0
  138. package/dist/integrations/fastify/patch.d.ts +27 -0
  139. package/dist/integrations/fastify/patch.d.ts.map +1 -0
  140. package/dist/integrations/fastify/patch.js +91 -0
  141. package/dist/integrations/fastify/patch.js.map +1 -0
  142. package/dist/integrations/fastify/uninstall.d.ts +4 -0
  143. package/dist/integrations/fastify/uninstall.d.ts.map +1 -0
  144. package/dist/integrations/fastify/uninstall.js +18 -0
  145. package/dist/integrations/fastify/uninstall.js.map +1 -0
  146. package/dist/integrations/fastify.d.ts +5 -1
  147. package/dist/integrations/fastify.d.ts.map +1 -1
  148. package/dist/integrations/fastify.js +5 -9
  149. package/dist/integrations/fastify.js.map +1 -1
  150. package/dist/integrations/flutter.d.ts.map +1 -1
  151. package/dist/integrations/flutter.js +3 -0
  152. package/dist/integrations/flutter.js.map +1 -1
  153. package/dist/integrations/go/index.d.ts +3 -0
  154. package/dist/integrations/go/index.d.ts.map +1 -0
  155. package/dist/integrations/go/index.js +199 -0
  156. package/dist/integrations/go/index.js.map +1 -0
  157. package/dist/integrations/go.d.ts.map +1 -1
  158. package/dist/integrations/go.js +5 -2
  159. package/dist/integrations/go.js.map +1 -1
  160. package/dist/integrations/java/index.d.ts +3 -0
  161. package/dist/integrations/java/index.d.ts.map +1 -0
  162. package/dist/integrations/java/index.js +472 -0
  163. package/dist/integrations/java/index.js.map +1 -0
  164. package/dist/integrations/java.d.ts.map +1 -1
  165. package/dist/integrations/java.js +5 -2
  166. package/dist/integrations/java.js.map +1 -1
  167. package/dist/integrations/js/manifest.d.ts.map +1 -1
  168. package/dist/integrations/js/manifest.js +3 -0
  169. package/dist/integrations/js/manifest.js.map +1 -1
  170. package/dist/integrations/nestjs/detect.d.ts +3 -0
  171. package/dist/integrations/nestjs/detect.d.ts.map +1 -0
  172. package/dist/integrations/nestjs/detect.js +12 -0
  173. package/dist/integrations/nestjs/detect.js.map +1 -0
  174. package/dist/integrations/nestjs/doctor.d.ts +3 -0
  175. package/dist/integrations/nestjs/doctor.d.ts.map +1 -0
  176. package/dist/integrations/nestjs/doctor.js +76 -0
  177. package/dist/integrations/nestjs/doctor.js.map +1 -0
  178. package/dist/integrations/nestjs/files.d.ts +18 -0
  179. package/dist/integrations/nestjs/files.d.ts.map +1 -0
  180. package/dist/integrations/nestjs/files.js +39 -0
  181. package/dist/integrations/nestjs/files.js.map +1 -0
  182. package/dist/integrations/nestjs/index.d.ts +3 -0
  183. package/dist/integrations/nestjs/index.d.ts.map +1 -0
  184. package/dist/integrations/nestjs/index.js +43 -0
  185. package/dist/integrations/nestjs/index.js.map +1 -0
  186. package/dist/integrations/nestjs/manifest.d.ts +3 -0
  187. package/dist/integrations/nestjs/manifest.d.ts.map +1 -0
  188. package/dist/integrations/nestjs/manifest.js +32 -0
  189. package/dist/integrations/nestjs/manifest.js.map +1 -0
  190. package/dist/integrations/nestjs/patch.d.ts +25 -0
  191. package/dist/integrations/nestjs/patch.d.ts.map +1 -0
  192. package/dist/integrations/nestjs/patch.js +66 -0
  193. package/dist/integrations/nestjs/patch.js.map +1 -0
  194. package/dist/integrations/nestjs/uninstall.d.ts +4 -0
  195. package/dist/integrations/nestjs/uninstall.d.ts.map +1 -0
  196. package/dist/integrations/nestjs/uninstall.js +18 -0
  197. package/dist/integrations/nestjs/uninstall.js.map +1 -0
  198. package/dist/integrations/nestjs.d.ts +5 -1
  199. package/dist/integrations/nestjs.d.ts.map +1 -1
  200. package/dist/integrations/nestjs.js +5 -9
  201. package/dist/integrations/nestjs.js.map +1 -1
  202. package/dist/integrations/next/index.js +2 -2
  203. package/dist/integrations/next/index.js.map +1 -1
  204. package/dist/integrations/next/manifest.d.ts.map +1 -1
  205. package/dist/integrations/next/manifest.js +4 -1
  206. package/dist/integrations/next/manifest.js.map +1 -1
  207. package/dist/integrations/next/patch.js +8 -3
  208. package/dist/integrations/next/patch.js.map +1 -1
  209. package/dist/integrations/next/uninstall.d.ts.map +1 -1
  210. package/dist/integrations/next/uninstall.js +10 -1
  211. package/dist/integrations/next/uninstall.js.map +1 -1
  212. package/dist/integrations/otel.d.ts.map +1 -1
  213. package/dist/integrations/otel.js +4 -1
  214. package/dist/integrations/otel.js.map +1 -1
  215. package/dist/integrations/php.d.ts.map +1 -1
  216. package/dist/integrations/php.js +16 -3
  217. package/dist/integrations/php.js.map +1 -1
  218. package/dist/integrations/python/index.d.ts +3 -0
  219. package/dist/integrations/python/index.d.ts.map +1 -0
  220. package/dist/integrations/python/index.js +222 -0
  221. package/dist/integrations/python/index.js.map +1 -0
  222. package/dist/integrations/python.d.ts.map +1 -1
  223. package/dist/integrations/python.js +5 -2
  224. package/dist/integrations/python.js.map +1 -1
  225. package/dist/integrations/react/doctor.d.ts.map +1 -1
  226. package/dist/integrations/react/doctor.js +41 -8
  227. package/dist/integrations/react/doctor.js.map +1 -1
  228. package/dist/integrations/react/index.d.ts.map +1 -1
  229. package/dist/integrations/react/index.js +1 -4
  230. package/dist/integrations/react/index.js.map +1 -1
  231. package/dist/integrations/react/manifest.d.ts.map +1 -1
  232. package/dist/integrations/react/manifest.js +4 -1
  233. package/dist/integrations/react/manifest.js.map +1 -1
  234. package/dist/integrations/react/patch.d.ts.map +1 -1
  235. package/dist/integrations/react/patch.js +120 -8
  236. package/dist/integrations/react/patch.js.map +1 -1
  237. package/dist/integrations/react/uninstall.d.ts.map +1 -1
  238. package/dist/integrations/react/uninstall.js +20 -1
  239. package/dist/integrations/react/uninstall.js.map +1 -1
  240. package/dist/integrations/react-native.d.ts.map +1 -1
  241. package/dist/integrations/react-native.js +3 -0
  242. package/dist/integrations/react-native.js.map +1 -1
  243. package/dist/integrations/ruby.d.ts.map +1 -1
  244. package/dist/integrations/ruby.js +3 -0
  245. package/dist/integrations/ruby.js.map +1 -1
  246. package/dist/output/human.d.ts.map +1 -1
  247. package/dist/output/human.js +38 -7
  248. package/dist/output/human.js.map +1 -1
  249. package/dist/registry/index.d.ts.map +1 -1
  250. package/dist/registry/index.js +9 -23
  251. package/dist/registry/index.js.map +1 -1
  252. package/dist/registry/manifest.d.ts +8 -0
  253. package/dist/registry/manifest.d.ts.map +1 -1
  254. package/dist/security-snapshot/builder.d.ts +3 -0
  255. package/dist/security-snapshot/builder.d.ts.map +1 -0
  256. package/dist/security-snapshot/builder.js +343 -0
  257. package/dist/security-snapshot/builder.js.map +1 -0
  258. package/dist/security-snapshot/client.d.ts +3 -0
  259. package/dist/security-snapshot/client.d.ts.map +1 -0
  260. package/dist/security-snapshot/client.js +38 -0
  261. package/dist/security-snapshot/client.js.map +1 -0
  262. package/dist/security-snapshot/index.d.ts +4 -0
  263. package/dist/security-snapshot/index.d.ts.map +1 -0
  264. package/dist/security-snapshot/index.js +3 -0
  265. package/dist/security-snapshot/index.js.map +1 -0
  266. package/dist/security-snapshot/types.d.ts +57 -0
  267. package/dist/security-snapshot/types.d.ts.map +1 -0
  268. package/dist/security-snapshot/types.js +2 -0
  269. package/dist/security-snapshot/types.js.map +1 -0
  270. package/dist/sourcemaps/next.js +3 -3
  271. package/dist/sourcemaps/next.js.map +1 -1
  272. package/dist/sourcemaps/vite.d.ts.map +1 -1
  273. package/dist/sourcemaps/vite.js +92 -9
  274. package/dist/sourcemaps/vite.js.map +1 -1
  275. package/dist/util/wizard-version.d.ts +1 -1
  276. package/dist/util/wizard-version.js +1 -1
  277. package/docs/architecture/v02-java-host-fix-spec.md +4 -8
  278. package/docs/architecture/v02-sourcemaps-e2e-spec.md +1 -1
  279. package/docs/beta/README.md +17 -0
  280. package/docs/beta/ci.md +122 -0
  281. package/docs/beta/config.md +124 -0
  282. package/docs/beta/doctor.md +79 -0
  283. package/docs/beta/expo.md +69 -0
  284. package/docs/beta/fastify.md +62 -0
  285. package/docs/beta/known-limitations.md +93 -0
  286. package/docs/beta/nestjs.md +69 -0
  287. package/docs/beta/next.md +76 -0
  288. package/docs/beta/node.md +60 -0
  289. package/docs/beta/privacy.md +99 -0
  290. package/docs/beta/quickstart.md +89 -0
  291. package/docs/beta/react.md +91 -0
  292. package/docs/beta/reliability.md +33 -0
  293. package/docs/beta/restore.md +84 -0
  294. package/docs/beta/troubleshooting.md +133 -0
  295. package/docs/errors.md +88 -0
  296. package/package.json +23 -5
@@ -1,9 +1,10 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { resolve } from 'node:path';
3
3
  import { patchJsModule, ensureImport, removeImport } from '../patchers/js-ast.js';
4
- import { appendManagedBlock, removeManagedSourceBlock } from '../patchers/source-block.js';
5
- const PKG = '@allstak/js/vite';
6
- const PKG_NAMED = 'allstakVitePlugin';
4
+ import { removeManagedSourceBlock } from '../patchers/source-block.js';
5
+ const PKG = '@allstak/react/vite';
6
+ const LEGACY_PKG = '@allstak/js/vite';
7
+ const PKG_NAMED = 'allstakSourcemaps';
7
8
  function locate(projectRoot) {
8
9
  for (const c of ['vite.config.ts', 'vite.config.mjs', 'vite.config.js']) {
9
10
  const full = resolve(projectRoot, c);
@@ -26,16 +27,18 @@ export const viteSourceMapProvider = {
26
27
  await patchJsModule(tx, cfg, (mod) => {
27
28
  ensureImport(mod, { from: PKG, named: [PKG_NAMED] });
28
29
  });
29
- await appendManagedBlock(tx, cfg, [
30
- `// allstak-wizard: ensure the plugin is in your vite plugins array, e.g.:`,
31
- `// plugins: [react(), ${PKG_NAMED}({ apiKey: process.env.ALLSTAK_API_KEY, project: '${ctx.project}' })]`,
32
- ].join('\n'), { style: 'slash', validateJs: true });
30
+ const src = readFileSync(cfg, 'utf8');
31
+ const next = ensureVitePluginConfigured(src, ctx);
32
+ if (next !== src) {
33
+ await tx.write(cfg, next);
34
+ }
33
35
  },
34
36
  async unwire(ctx, tx) {
35
37
  const cfg = locate(ctx.projectRoot);
36
38
  if (!cfg)
37
39
  return;
38
40
  await patchJsModule(tx, cfg, (mod) => removeImport(mod, PKG));
41
+ await patchJsModule(tx, cfg, (mod) => removeImport(mod, LEGACY_PKG));
39
42
  await removeManagedSourceBlock(tx, cfg, 'slash');
40
43
  },
41
44
  async status(ctx) {
@@ -43,10 +46,10 @@ export const viteSourceMapProvider = {
43
46
  if (!cfg)
44
47
  return { provider: 'vite', state: 'missing', configFile: null };
45
48
  const src = readFileSync(cfg, 'utf8');
46
- const wired = src.includes(PKG);
49
+ const wired = src.includes(PKG) || src.includes(LEGACY_PKG);
47
50
  if (!wired)
48
51
  return { provider: 'vite', state: 'missing', configFile: cfg };
49
- if (!src.includes(PKG_NAMED)) {
52
+ if (!src.includes(PKG_NAMED) && !src.includes('allstakVitePlugin')) {
50
53
  return {
51
54
  provider: 'vite',
52
55
  state: 'drifted',
@@ -54,7 +57,87 @@ export const viteSourceMapProvider = {
54
57
  reason: `${PKG} imported but ${PKG_NAMED} not referenced — plugin may not be invoked`,
55
58
  };
56
59
  }
60
+ if (!/plugins\s*:\s*\[[\s\S]*allstak(?:Sourcemaps|VitePlugin)\s*\(/.test(src)) {
61
+ return {
62
+ provider: 'vite',
63
+ state: 'drifted',
64
+ configFile: cfg,
65
+ reason: 'source-map helper is imported but not present in the Vite plugins array',
66
+ };
67
+ }
68
+ if (!/build\s*:\s*\{[\s\S]*sourcemap\s*:\s*true/.test(src)) {
69
+ return {
70
+ provider: 'vite',
71
+ state: 'drifted',
72
+ configFile: cfg,
73
+ reason: 'Vite build.sourcemap is not enabled',
74
+ };
75
+ }
57
76
  return { provider: 'vite', state: 'wired', configFile: cfg };
58
77
  },
59
78
  };
79
+ function ensureVitePluginConfigured(src, ctx) {
80
+ let next = src;
81
+ if (!next.includes(`${PKG_NAMED}(`)) {
82
+ next = insertIntoPluginsArray(next, [
83
+ `${PKG_NAMED}({`,
84
+ ` release: process.env.ALLSTAK_RELEASE ?? '${ctx.release ?? ''}',`,
85
+ ` token: process.env.ALLSTAK_UPLOAD_TOKEN,`,
86
+ ` dist: process.env.ALLSTAK_DIST ?? 'web',`,
87
+ ` silent: process.env.CI !== 'true',`,
88
+ ` })`,
89
+ ].join('\n '));
90
+ }
91
+ next = ensureSourcemapEnabled(next);
92
+ return next;
93
+ }
94
+ function insertIntoPluginsArray(src, pluginExpr) {
95
+ const match = /plugins\s*:\s*\[/.exec(src);
96
+ if (!match || match.index === undefined)
97
+ return src;
98
+ const open = src.indexOf('[', match.index);
99
+ const close = findMatching(src, open, '[', ']');
100
+ if (close < 0)
101
+ return src;
102
+ const beforeClose = src.slice(0, close).trimEnd();
103
+ const needsComma = !beforeClose.endsWith('[') && !beforeClose.endsWith(',');
104
+ const insertion = `${needsComma ? ',' : ''}\n ${pluginExpr},`;
105
+ return `${src.slice(0, close)}${insertion}${src.slice(close)}`;
106
+ }
107
+ function ensureSourcemapEnabled(src) {
108
+ if (/build\s*:\s*\{[\s\S]*sourcemap\s*:\s*true/.test(src))
109
+ return src;
110
+ const match = /build\s*:\s*\{/.exec(src);
111
+ if (!match || match.index === undefined)
112
+ return src;
113
+ const open = src.indexOf('{', match.index);
114
+ return `${src.slice(0, open + 1)}\n sourcemap: true,${src.slice(open + 1)}`;
115
+ }
116
+ function findMatching(src, openIndex, openChar, closeChar) {
117
+ if (openIndex < 0 || src[openIndex] !== openChar)
118
+ return -1;
119
+ let depth = 0;
120
+ let quote = null;
121
+ for (let i = openIndex; i < src.length; i += 1) {
122
+ const ch = src[i];
123
+ const prev = src[i - 1];
124
+ if (quote) {
125
+ if (ch === quote && prev !== '\\')
126
+ quote = null;
127
+ continue;
128
+ }
129
+ if (ch === '"' || ch === "'" || ch === '`') {
130
+ quote = ch;
131
+ continue;
132
+ }
133
+ if (ch === openChar)
134
+ depth += 1;
135
+ if (ch === closeChar) {
136
+ depth -= 1;
137
+ if (depth === 0)
138
+ return i;
139
+ }
140
+ }
141
+ return -1;
142
+ }
60
143
  //# sourceMappingURL=vite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/sourcemaps/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE3F,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAC/B,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAEtC,SAAS,MAAM,CAAC,WAAmB;IACjC,KAAK,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACrC,IAAI,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,wBAAwB;IAC/B,aAAa,EAAE,GAAG;IAElB,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,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CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI;gBAAE,KAAK,GAAG,IAAI,CAAC;YAChD,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YAC3C,KAAK,GAAG,EAAE,CAAC;YACX,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,QAAQ;YAAE,KAAK,IAAI,CAAC,CAAC;QAChC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,KAAK,IAAI,CAAC,CAAC;YACX,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
@@ -2,5 +2,5 @@
2
2
  * Single source of truth for the wizard's own version string. Bumping `package.json`
3
3
  * does NOT auto-update this constant — keep them in sync. Tests assert equality.
4
4
  */
5
- export declare const WIZARD_VERSION = "0.1.3";
5
+ export declare const WIZARD_VERSION = "0.1.4";
6
6
  //# sourceMappingURL=wizard-version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  * Single source of truth for the wizard's own version string. Bumping `package.json`
3
3
  * does NOT auto-update this constant — keep them in sync. Tests assert equality.
4
4
  */
5
- export const WIZARD_VERSION = '0.1.3';
5
+ export const WIZARD_VERSION = '0.1.4';
6
6
  //# sourceMappingURL=wizard-version.js.map
@@ -22,14 +22,10 @@ SDK-side blocker."
22
22
 
23
23
  ## Required SDK-side change
24
24
 
25
- Reference the AllStak SDK workspace at:
26
-
27
- ```
28
- /Volumes/M.2/MyProjects/AllStak-Projects/sdks/allstak-java-sdk
29
- ```
30
-
31
- The change is small but needs to land in the SDK before the wizard's `java`
32
- integration can graduate from `experimental`:
25
+ Target package: `allstak-java-sdk` (the Java SDK in the AllStak SDK
26
+ monorepo, sibling of `@allstak/wizard`). The change is small but must land
27
+ in the SDK before the wizard's `java` integration can graduate from
28
+ `experimental`:
33
29
 
34
30
  ### 1. Add a `host` field to `AllStakConfig`
35
31
 
@@ -8,7 +8,7 @@ against the live backend. This spec documents what v0.2 must add.
8
8
 
9
9
  ## What works today (v0.1.x)
10
10
 
11
- - `vite` provider: AST-injects `import { allstakVitePlugin } from '@allstak/js/vite'` and adds a managed-block hint.
11
+ - `vite` provider: imports `allstakSourcemaps` from `@allstak/react/vite`, adds it to the real Vite `plugins` array, and enables `build.sourcemap`.
12
12
  - `next` provider: managed-block hint pointing the user at `withAllStak`.
13
13
  - `webpack` provider: managed-block hint only.
14
14
  - `metro` provider: intentionally inert; `detect()` returns false.
@@ -0,0 +1,17 @@
1
+ # `@allstak/wizard@beta` — public beta docs
2
+
3
+ | Doc | What it covers |
4
+ |-----|----------------|
5
+ | [quickstart](./quickstart.md) | Install + run in five minutes |
6
+ | [react](./react.md) | React (Vite or CRA) integration |
7
+ | [next](./next.md) | Next.js 13+ integration |
8
+ | [node](./node.md) | Vanilla Node.js / TypeScript |
9
+ | [doctor](./doctor.md) | Deterministic diagnostics + `--live-probe` |
10
+ | [restore](./restore.md) | Persistent snapshots + rollback |
11
+ | [config](./config.md) | `allstak.config.*` schema + precedence + migrations |
12
+ | [ci](./ci.md) | Running unattended in CI |
13
+ | [privacy](./privacy.md) | Telemetry contract — what we send and how to disable |
14
+ | [known-limitations](./known-limitations.md) | Honest list of what's NOT supported |
15
+ | [troubleshooting](./troubleshooting.md) | Common errors mapped to fixes |
16
+ | [errors](../errors.md) | Canonical error catalog |
17
+ | [architecture](../architecture/) | Internal design docs (registry, transaction, rollback, etc.) |
@@ -0,0 +1,122 @@
1
+ # Running in CI
2
+
3
+ The wizard is designed to run unattended once you've committed an
4
+ `allstak.config.*` and stashed an API key.
5
+
6
+ ## One-shot setup in a CI step
7
+
8
+ ```yaml
9
+ # .github/workflows/setup-allstak.yml (excerpt)
10
+ - name: Configure AllStak
11
+ env:
12
+ ALLSTAK_API_KEY: ${{ secrets.ALLSTAK_API_KEY }}
13
+ run: |
14
+ npx @allstak/wizard@beta -i react -y \
15
+ --skip-deps \
16
+ --release "$GITHUB_SHA"
17
+ ```
18
+
19
+ Why these flags:
20
+
21
+ - `-y`: skip the confirmation prompt. The wizard refuses with `E_USER_CANCELLED`
22
+ in non-interactive mode otherwise.
23
+ - `--skip-deps`: don't run a package install — your CI step before this
24
+ already installed dependencies.
25
+ - `--release "$GITHUB_SHA"`: stamp the deploy commit on every event.
26
+
27
+ The CLI exits 0 on success, 2 on `WizardError`, and 130 on user cancel
28
+ (impossible in `-y` mode but documented for completeness).
29
+
30
+ ## Doctor in CI (smoke check)
31
+
32
+ ```yaml
33
+ - name: Doctor
34
+ env:
35
+ ALLSTAK_API_KEY: ${{ secrets.ALLSTAK_API_KEY }}
36
+ run: |
37
+ npx @allstak/wizard@beta --json doctor \
38
+ --live-probe \
39
+ --project-id ${{ vars.ALLSTAK_PROJECT_ID }} \
40
+ > doctor.json
41
+ jq -e '.outcome == "success"' doctor.json
42
+ ```
43
+
44
+ `--live-probe` sends a real test event and polls for ingestion. Use it as
45
+ a deploy gate — if the ingestion path is broken, fail the deploy before
46
+ users hit it.
47
+
48
+ ## JSON output everywhere
49
+
50
+ `--json` writes a single JSON object to stdout (status text goes to stderr).
51
+ Pipe it to `jq` or your own parser. Shape:
52
+
53
+ ```json
54
+ {
55
+ "schemaVersion": 1,
56
+ "command": "init",
57
+ "outcome": "success",
58
+ "errorCode": null,
59
+ "durationMs": 4200,
60
+ "events": [...],
61
+ "diff": [...],
62
+ "doctor": [...],
63
+ "data": { ... }
64
+ }
65
+ ```
66
+
67
+ ## Telemetry in CI
68
+
69
+ Telemetry is on by default. To disable:
70
+
71
+ ```bash
72
+ ALLSTAK_WIZARD_TELEMETRY=0 npx @allstak/wizard@beta ...
73
+ # or
74
+ npx @allstak/wizard@beta --no-telemetry ...
75
+ ```
76
+
77
+ See [privacy.md](./privacy.md) for the exact payload shape. Telemetry
78
+ failures NEVER abort the wizard.
79
+
80
+ ## Snapshot retention in CI
81
+
82
+ Each wizard run writes a snapshot to `.allstak-wizard/backups/`. In CI the
83
+ default retention of 10 is usually fine. To disable pruning entirely
84
+ (useful when you keep a separate audit log):
85
+
86
+ ```bash
87
+ npx @allstak/wizard@beta -i react -y --snapshot-keep 0
88
+ ```
89
+
90
+ To skip persistent snapshots entirely (in-process rollback only) — not
91
+ currently supported. Plans for v0.2.
92
+
93
+ ## Self-hosted in CI
94
+
95
+ Either pass flags or commit a config:
96
+
97
+ ```bash
98
+ npx @allstak/wizard@beta \
99
+ --host https://api.allstak.acme.com \
100
+ --dashboard-host https://app.allstak.acme.com \
101
+ -i react -y
102
+ ```
103
+
104
+ ## Validating the wizard itself
105
+
106
+ The wizard ships a CI matrix workflow under `.github/workflows/ci.yml` that
107
+ runs install/repair/uninstall/restore cycles against React+Vite, Next, and
108
+ Node fixtures across Node 18/20/22. Fork the workflow if you want to
109
+ gate your own CI on it.
110
+
111
+ ## Recommended pre-deploy chain
112
+
113
+ ```bash
114
+ npm ci
115
+ npm run test
116
+ npx @allstak/wizard@beta config validate
117
+ npx @allstak/wizard@beta -i react -y --release "$GIT_SHA"
118
+ npx @allstak/wizard@beta --json doctor --live-probe \
119
+ --project-id "$ALLSTAK_PROJECT_ID" \
120
+ --api-key "$ALLSTAK_API_KEY"
121
+ npm run build
122
+ ```
@@ -0,0 +1,124 @@
1
+ # `allstak.config.*`
2
+
3
+ Optional project-level config so you don't repeat `--org`, `--project`,
4
+ `--host`, etc. on every wizard invocation. Discovered from the project root
5
+ upward; the first matching file wins.
6
+
7
+ Loader order (first match wins):
8
+
9
+ 1. `allstak.config.ts`
10
+ 2. `allstak.config.mts`
11
+ 3. `allstak.config.mjs`
12
+ 4. `allstak.config.js`
13
+ 5. `allstak.config.cjs`
14
+ 6. `allstak.config.json`
15
+
16
+ `.ts` / `.mts` configs require running the wizard via a TypeScript-aware
17
+ launcher (`npx tsx`, `bun`, or `deno run`). Plain `.mjs` / `.json` work
18
+ without any toolchain.
19
+
20
+ ## Schema
21
+
22
+ ```ts
23
+ import { defineConfig } from '@allstak/wizard/config';
24
+
25
+ export default defineConfig({
26
+ schemaVersion: 1,
27
+ organization: 'my-org',
28
+ project: 'my-project',
29
+ environment: 'production',
30
+ release: process.env.GIT_SHA,
31
+ sourceMaps: {
32
+ enabled: true,
33
+ ignore: ['node_modules'],
34
+ },
35
+ selfHosted: {
36
+ apiHost: 'https://api.allstak.example',
37
+ ingestHost: 'https://api.allstak.example',
38
+ dashboardHost: 'https://app.allstak.example',
39
+ },
40
+ snapshotKeep: 10,
41
+ });
42
+ ```
43
+
44
+ All fields are optional. `defineConfig` is a typed-identity helper; at
45
+ runtime it just returns its input.
46
+
47
+ ## Precedence
48
+
49
+ ```
50
+ CLI flag > env var > config file > built-in default
51
+ ```
52
+
53
+ Examples:
54
+
55
+ | Setting | CLI | Env | Config | Default |
56
+ |---------|-----|-----|--------|---------|
57
+ | organization | `--org` | `ALLSTAK_ORG` | `organization` | — |
58
+ | project | `--project` | `ALLSTAK_PROJECT` | `project` | — |
59
+ | environment | `--environment` | `ALLSTAK_ENVIRONMENT` | `environment` | `production` |
60
+ | release | `--release` | `ALLSTAK_RELEASE` | `release` (string or function) | — |
61
+ | api host | `--host` | `ALLSTAK_HOST` | `selfHosted.apiHost` | `https://api.allstak.sa` |
62
+ | ingest host | `--ingest-host` | `ALLSTAK_INGEST_HOST` | `selfHosted.ingestHost` | matches api host |
63
+ | dashboard host | `--dashboard-host` | `ALLSTAK_DASHBOARD_HOST` | `selfHosted.dashboardHost` | derived from api |
64
+ | source-maps | `--skip-source-maps` | — | `sourceMaps.enabled` | `true` |
65
+ | snapshot-keep | `--snapshot-keep` | `ALLSTAK_SNAPSHOT_KEEP` | `snapshotKeep` | `10` |
66
+
67
+ ## Validation
68
+
69
+ ```bash
70
+ npx @allstak/wizard@beta config validate
71
+ ```
72
+
73
+ Reports the discovered file path, the declared `schemaVersion`, and any
74
+ deprecation warnings.
75
+
76
+ ## Migration
77
+
78
+ When the wizard ships a new schema, `allstak config migrate` upgrades your
79
+ config in place.
80
+
81
+ ```bash
82
+ npx @allstak/wizard@beta config migrate # rewrites .json files
83
+ npx @allstak/wizard@beta config migrate --dry-run # prints planned changes
84
+ ```
85
+
86
+ For `.ts` / `.mjs` configs the wizard prints the migrated shape and asks
87
+ you to apply it manually — we don't roundtrip TypeScript through an AST
88
+ serializer that would mangle your imports and comments.
89
+
90
+ The wizard treats a missing `schemaVersion` as `1`. Always declaring it
91
+ explicitly future-proofs your config.
92
+
93
+ ## Self-hosted
94
+
95
+ Wizard never assumes `api.allstak.sa`. For a self-hosted deployment:
96
+
97
+ ```ts
98
+ export default defineConfig({
99
+ schemaVersion: 1,
100
+ selfHosted: {
101
+ apiHost: 'https://api.allstak.acme.com',
102
+ ingestHost: 'https://api.allstak.acme.com',
103
+ dashboardHost: 'https://app.allstak.acme.com',
104
+ },
105
+ });
106
+ ```
107
+
108
+ CLI users can also pass `--host`, `--ingest-host`, `--dashboard-host`
109
+ directly. **Caveat:** the Java SDK currently hardcodes its host; the wizard
110
+ will warn when `-i java` runs against a non-default host until the SDK
111
+ ships a configurable host field.
112
+
113
+ ## Release as a function
114
+
115
+ Useful for CI:
116
+
117
+ ```ts
118
+ release: process.env.GIT_SHA, // string at config-load time
119
+ release: () => process.env.GIT_SHA, // function evaluated each run
120
+ release: () => execSync('git rev-parse HEAD').toString().trim(),
121
+ ```
122
+
123
+ If the function returns `undefined`, the wizard falls through the precedence
124
+ chain (env, default).
@@ -0,0 +1,79 @@
1
+ # `allstak doctor`
2
+
3
+ Deterministic diagnostic with named stages. Read-only by default;
4
+ `--live-probe` adds a real test event roundtrip.
5
+
6
+ ## Stages
7
+
8
+ The doctor runs all stages in this fixed order, even when an early stage
9
+ fails (so you see the whole picture):
10
+
11
+ | Stage | What it checks |
12
+ |-------|----------------|
13
+ | `auth` | Credentials present + accepted (`--api-key` or stored JWT). Auto-refreshes JWT if it expires soon. |
14
+ | `reachability` | Configured host responds (HTTP-level only — no `/health` exists, so it probes `/api/v1/auth/me` and treats `401` as "alive"). |
15
+ | `config` | `allstak.config.*` discovered (or absent — both fine). Reports the source path. |
16
+ | `integration` | Delegates to the integration's own doctor — env present? entry patched? imports wired? |
17
+ | `event-ingest` | (only with `--live-probe`) Sends a real event to `/ingest/v1/errors`, polls `/api/v1/errors` for ingestion. |
18
+ | `release-linkage` | Confirms the configured release is attached to the test event. |
19
+ | `source-maps` | Asks each registered source-map provider for its wired/drifted/missing state. |
20
+
21
+ ## Output
22
+
23
+ Each stage emits exactly one line: `pass`, `warn`, `fail`, or `skip`, plus
24
+ a fix hint when applicable. `--json` produces a structured array under
25
+ `data.stages` for programmatic consumption.
26
+
27
+ ```bash
28
+ npx @allstak/wizard@beta doctor
29
+ ```
30
+
31
+ ```
32
+ » Doctor
33
+ ✓ [auth] Authenticated as me@example.com.
34
+ ✓ [reachability] Reached https://api.allstak.sa.
35
+ ✓ [config] Loaded config from /repo/allstak.config.ts.
36
+ ✓ [integration] react: ok (4 checks)
37
+ - [event-ingest] Skipped (pass --live-probe to enable).
38
+ - [release-linkage] Skipped: live probe required to verify release linkage end-to-end.
39
+ ✓ [source-maps] Wired: vite
40
+ ✓ Doctor: setup looks good.
41
+ ```
42
+
43
+ ## Live probe
44
+
45
+ Requires both:
46
+
47
+ - `--api-key` (project-scoped — sends the test event),
48
+ - `--project-id <uuid>` (the project UUID, visible in the dashboard URL).
49
+
50
+ ```bash
51
+ npx @allstak/wizard@beta doctor --live-probe \
52
+ --api-key ask_live_... \
53
+ --project-id 7e8e... \
54
+ --live-probe-timeout 60000
55
+ ```
56
+
57
+ Flow:
58
+
59
+ 1. Wizard generates a random fingerprint (`wizard-probe-<6-hex>`).
60
+ 2. POSTs an event to `/ingest/v1/errors` with that fingerprint in metadata.
61
+ 3. Polls `/api/v1/errors?projectId=&from=&query=<fingerprint>` every 2.5s.
62
+ 4. Reports the dashboard URL of the captured event when found.
63
+
64
+ If polling times out, the doctor returns `E_INGEST_VERIFY_FAILED` with the
65
+ event id you can hand to support.
66
+
67
+ ## JSON mode
68
+
69
+ ```bash
70
+ npx @allstak/wizard@beta --json doctor | jq '.data.stages'
71
+ ```
72
+
73
+ Each entry is `{ stage, status, detail, fix?, data? }`.
74
+
75
+ ## When stages fail
76
+
77
+ The CLI exits non-zero (code 2) on any `fail`. `warn` and `skip` do not
78
+ change exit code. See [errors.md](../errors.md) for the canonical error
79
+ codes each stage can emit.
@@ -0,0 +1,69 @@
1
+ # Expo (React Native)
2
+
3
+ **Stability:** internal experimental. Managed workflow only. The wizard refuses to run on
4
+ projects that have already prebuilt to native (i.e. an `ios/` or `android/`
5
+ directory at the project root) — bare-via-prebuild has too many failure
6
+ modes for an unattended patcher and remains `unsupported` in v0.1.
7
+
8
+ ## What you get
9
+
10
+ - `@allstak/react-native` installed.
11
+ - `.env` populated with `ALLSTAK_API_KEY` (and the standard companions).
12
+ - `app.json` gets the AllStak Expo plugin appended to `expo.plugins[]`
13
+ (idempotent — re-running does not duplicate the entry).
14
+ - `App.tsx` gets:
15
+ - An AST-injected `import { AllStakProvider } from '@allstak/react-native'`.
16
+ - A managed-block hint reminding you to wrap your root component in
17
+ `<AllStakProvider>…</AllStakProvider>`.
18
+ - `app.config.{js,ts}` gets the same managed-block hint if it exists.
19
+
20
+ ## Run
21
+
22
+ ```bash
23
+ npx @allstak/wizard@beta -i expo
24
+ ```
25
+
26
+ ## Compatibility
27
+
28
+ - `expo >= 50`. Older versions refused with `E_UNSUPPORTED_VERSION`.
29
+ - `react-native >= 0.73`.
30
+ - **Managed workflow only.** Bare/prebuilt projects (`ios/` or `android/`
31
+ present) are refused with a clear error. To use AllStak in a bare RN
32
+ app, follow the SDK README directly — the wizard will not patch native
33
+ Xcode/Gradle config in v0.1.
34
+
35
+ ## Wiring `<AllStakProvider>`
36
+
37
+ The wizard cannot safely AST-edit your component tree (App.tsx shapes
38
+ vary too much — function/class/forwardRef/HOC). It places a managed-block
39
+ hint and you wire the provider yourself:
40
+
41
+ ```tsx
42
+ import { AllStakProvider } from '@allstak/react-native';
43
+
44
+ export default function App() {
45
+ return (
46
+ <AllStakProvider apiKey={process.env.EXPO_PUBLIC_ALLSTAK_API_KEY}>
47
+ {/* your app */}
48
+ </AllStakProvider>
49
+ );
50
+ }
51
+ ```
52
+
53
+ `doctor` reports `warn` on `provider-wired` until the live call is detected
54
+ (comments inside the managed-block hint are stripped before matching, so
55
+ the example above does not produce a false positive).
56
+
57
+ ## Capabilities the wizard does NOT claim
58
+
59
+ - **No source-map upload wiring.** Metro source-maps are deferred to v0.2
60
+ (no-op `skip` in `doctor`).
61
+ - **No native edits.** No Podfile / Gradle / Info.plist / AndroidManifest
62
+ changes. EAS Build users get the plugin reference in `app.json` and Expo
63
+ takes care of the rest.
64
+
65
+ ## Verify
66
+
67
+ ```bash
68
+ npx @allstak/wizard@beta doctor -i expo
69
+ ```
@@ -0,0 +1,62 @@
1
+ # Fastify
2
+
3
+ **Stability:** internal experimental. AST-safe import (ESM only) + managed-block hint.
4
+ The wizard branches on module system: ESM entries get an AST-injected
5
+ `import { allstakFastify }`; CJS entries get the managed-block hint only
6
+ (the wizard does NOT inject `require()` calls, which interact badly with
7
+ top-of-file conditional/dynamic require patterns).
8
+
9
+ ## What you get
10
+
11
+ - `@allstak/fastify` installed.
12
+ - `.env` populated with `ALLSTAK_API_KEY`.
13
+ - Entry file (resolved from `package.json:scripts.start`,
14
+ `package.json:main`, or conventional `src/server.{ts,js,mjs}` /
15
+ `src/index.{ts,js,mjs}`):
16
+ - **ESM** (`type: module` / `.mjs` / `import` syntax in the file):
17
+ AST-injected import.
18
+ - **CJS**: import skipped, hint-only.
19
+ - Both: a managed-block hint demonstrating
20
+ `app.register(allstakFastify, { ... })`.
21
+
22
+ ## Run
23
+
24
+ ```bash
25
+ npx @allstak/wizard@beta -i fastify
26
+ ```
27
+
28
+ ## Compatibility
29
+
30
+ - `fastify >= 4`. Older versions refused with `E_UNSUPPORTED_VERSION`.
31
+
32
+ ## Wiring `app.register`
33
+
34
+ ```ts
35
+ import Fastify from 'fastify';
36
+ import { allstakFastify } from '@allstak/fastify';
37
+
38
+ const app = Fastify({ logger: true });
39
+ await app.register(allstakFastify, {
40
+ apiKey: process.env.ALLSTAK_API_KEY,
41
+ });
42
+ // … your routes
43
+ await app.listen({ port: 3000 });
44
+ ```
45
+
46
+ `doctor` reports `warn` on `plugin-registered` until a non-comment
47
+ `app.register(allstakFastify, ...)` call is detected (line comments
48
+ are stripped before matching so the wizard's own hint does not satisfy
49
+ the check).
50
+
51
+ ## Capabilities the wizard does NOT claim
52
+
53
+ - **No source-map upload wiring.** Deferred to v0.2.
54
+ - **No CJS AST patching.** CJS users wire the `require(...)` and
55
+ `app.register(...)` calls per the managed-block hint.
56
+ - **No bundler integration** (esbuild/tsup/etc.) — out of scope for v0.1.
57
+
58
+ ## Verify
59
+
60
+ ```bash
61
+ npx @allstak/wizard@beta doctor -i fastify
62
+ ```