@hexagen-monaco/sync 0.7.1 → 0.9.0

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 (28) hide show
  1. package/dist/cli.js +744 -25
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/add/index.d.ts +6 -0
  4. package/dist/commands/add/index.d.ts.map +1 -1
  5. package/dist/generators/apps-framework-templates.d.ts.map +1 -1
  6. package/dist/generators/apps.d.ts.map +1 -1
  7. package/dist/generators/eslint.d.ts +2 -0
  8. package/dist/generators/eslint.d.ts.map +1 -1
  9. package/dist/generators/package-json.d.ts.map +1 -1
  10. package/dist/index.js +722 -20
  11. package/dist/index.js.map +1 -1
  12. package/dist/templates/agents-md/files/.agents/tech-stack.md +3 -4
  13. package/dist/templates/agents-md/files/.agents/testing.md +9 -9
  14. package/dist/templates/bedrock-agentcore-runtime/files/.github/workflows/deploy-agentcore.yml +1 -1
  15. package/dist/templates/ci-github-actions/files/.github/workflows/ci.yml +3 -3
  16. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-fly.yml +1 -1
  17. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-railway.yml +1 -1
  18. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vercel.yml +2 -2
  19. package/dist/templates/ci-github-actions/files/.github/workflows/preview.yml +2 -2
  20. package/dist/templates/docker/files/.github/workflows/docker-build.yml +1 -1
  21. package/dist/templates/mcp-server/files/src/infrastructure/mcp/registry/tool-registry.test.ts +1 -1
  22. package/dist/templates/mcp-server/files/src/infrastructure/mcp/tools/example.tool.test.ts +1 -1
  23. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/bearer.test.ts +1 -1
  24. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/oauth.test.ts +1 -1
  25. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/guard.test.ts +1 -1
  26. package/dist/types/manifest/apps.d.ts +1 -1
  27. package/dist/types/manifest/apps.d.ts.map +1 -1
  28. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -904,6 +904,12 @@ async function generatePackageJson(modulePath, moduleName, config, report) {
904
904
  build: "tsc",
905
905
  lint: "eslint . --ext .ts,.tsx",
906
906
  typecheck: "tsc --noEmit",
907
+ // Vitest runner (ADR-0044), scaffolded only for *external* (generated)
908
+ // projects — paired with the vitest.config.ts emitted below. This repo's
909
+ // own packages (self-regen) keep their shared-base setup untouched.
910
+ // `--passWithNoTests` so a freshly scaffolded module passes before any test
911
+ // is written.
912
+ ...config.mode === "external" ? { test: "vitest run --passWithNoTests" } : {},
907
913
  ...defaults.scripts ?? {},
908
914
  ...moduleOverrides.scripts ?? {}
909
915
  },
@@ -920,6 +926,7 @@ async function generatePackageJson(modulePath, moduleName, config, report) {
920
926
  ...Object.keys(dependencies).length > 0 ? { dependencies } : {},
921
927
  devDependencies: {
922
928
  typescript: "^5.0.0",
929
+ ...config.mode === "external" ? { vitest: "^4.1.9" } : {},
923
930
  ...defaults.devDependencies ?? {},
924
931
  ...moduleOverrides.devDependencies ?? {}
925
932
  }
@@ -967,6 +974,39 @@ async function generatePackageJson(modulePath, moduleName, config, report) {
967
974
  true
968
975
  );
969
976
  recordWriteStatus(result, pkgPath, status);
977
+ if (config.mode === "external") {
978
+ const vitestConfigPath = path34__default.join(modulePath, "vitest.config.ts");
979
+ if (isInScope(vitestConfigPath, config)) {
980
+ let vitestConfigExists = false;
981
+ try {
982
+ await fs27.stat(vitestConfigPath);
983
+ vitestConfigExists = true;
984
+ } catch (e) {
985
+ if (!(e instanceof Error && "code" in e && e.code === "ENOENT")) {
986
+ throw e;
987
+ }
988
+ }
989
+ if (!vitestConfigExists) {
990
+ const vitestConfigContent = `import { defineConfig } from "vitest/config";
991
+
992
+ export default defineConfig({
993
+ test: {
994
+ environment: "node",
995
+ exclude: ["**/node_modules/**", "**/dist/**"],
996
+ },
997
+ });
998
+ `;
999
+ const vitestStatus = await safeWriteFileAtomic(
1000
+ vitestConfigPath,
1001
+ vitestConfigContent,
1002
+ config,
1003
+ report,
1004
+ false
1005
+ );
1006
+ recordWriteStatus(result, vitestConfigPath, vitestStatus);
1007
+ }
1008
+ }
1009
+ }
970
1010
  return result;
971
1011
  }
972
1012
  var BUILTIN_FALLBACK_TEMPLATE = {
@@ -5333,7 +5373,7 @@ function assertValidToolchainVersion(version, source) {
5333
5373
  function resolveToolchainVersion() {
5334
5374
  {
5335
5375
  return assertValidToolchainVersion(
5336
- "0.7.1",
5376
+ "0.9.0",
5337
5377
  "build-injected __HEXAGEN_TOOLCHAIN_VERSION__"
5338
5378
  );
5339
5379
  }
@@ -5855,24 +5895,36 @@ var NEXTJS_PACKAGE_JSON_TEMPLATE = `{
5855
5895
  "react-dom": "^19.0.0"
5856
5896
  },
5857
5897
  "devDependencies": {
5898
+ "@types/react": "^19.0.0",
5899
+ "@types/react-dom": "^19.0.0",
5858
5900
  "typescript": "^5.5.4",
5859
5901
  "eslint": "^9.0.0",
5860
- "@typescript-eslint/parser": "^8.0.0",
5861
- "@typescript-eslint/eslint-plugin": "^8.0.0"
5902
+ "@eslint/js": "^9.0.0",
5903
+ "typescript-eslint": "^8.0.0"
5862
5904
  }
5863
5905
  }
5864
5906
  `;
5865
5907
  var NEXTJS_TSCONFIG = {
5866
5908
  extends: "../../tsconfig.base.json",
5867
5909
  compilerOptions: {
5868
- rootDir: "src",
5869
- outDir: "dist",
5870
- composite: true,
5871
- declaration: true,
5872
- emitDeclarationOnly: true,
5873
- jsx: "react-jsx"
5910
+ rootDir: ".",
5911
+ composite: false,
5912
+ declaration: false,
5913
+ emitDeclarationOnly: false,
5914
+ noEmit: true,
5915
+ jsx: "preserve",
5916
+ plugins: [{ name: "next" }]
5874
5917
  },
5875
- include: ["src/**/*"],
5918
+ include: [
5919
+ "next-env.d.ts",
5920
+ "src/**/*.ts",
5921
+ "src/**/*.tsx",
5922
+ ".next/types/**/*.ts"
5923
+ ],
5924
+ // NOT excluding `.next` — `exclude` filters the `include` matches, so listing
5925
+ // `.next` here would cancel the `.next/types/**` include above (the generated
5926
+ // route types). `include` is already an allowlist, so the rest of `.next/`
5927
+ // (cache/server/static) never enters the program regardless.
5876
5928
  exclude: ["node_modules", "dist"]
5877
5929
  };
5878
5930
  var NEXTJS_ENTRY_TEMPLATE = `// Auto-generated Next.js application
@@ -5880,6 +5932,16 @@ export default function HomePage() {
5880
5932
  return <div>Welcome to {system}</div>;
5881
5933
  }
5882
5934
  `;
5935
+ var NEXTJS_LAYOUT_TEMPLATE = `import type { ReactNode } from "react";
5936
+
5937
+ export default function RootLayout({ children }: { children: ReactNode }) {
5938
+ return (
5939
+ <html lang="en">
5940
+ <body>{{children}}</body>
5941
+ </html>
5942
+ );
5943
+ }
5944
+ `;
5883
5945
  var FASTIFY_PACKAGE_JSON_TEMPLATE = `{
5884
5946
  "name": "@{scope}/{appName}",
5885
5947
  "version": "0.0.0",
@@ -5897,8 +5959,8 @@ var FASTIFY_PACKAGE_JSON_TEMPLATE = `{
5897
5959
  "devDependencies": {
5898
5960
  "typescript": "^5.5.4",
5899
5961
  "eslint": "^9.0.0",
5900
- "@typescript-eslint/parser": "^8.0.0",
5901
- "@typescript-eslint/eslint-plugin": "^8.0.0"
5962
+ "@eslint/js": "^9.0.0",
5963
+ "typescript-eslint": "^8.0.0"
5902
5964
  }
5903
5965
  }
5904
5966
  `;
@@ -5940,8 +6002,8 @@ var PLAIN_TS_PACKAGE_JSON_TEMPLATE = `{
5940
6002
  "devDependencies": {
5941
6003
  "typescript": "^5.5.4",
5942
6004
  "eslint": "^9.0.0",
5943
- "@typescript-eslint/parser": "^8.0.0",
5944
- "@typescript-eslint/eslint-plugin": "^8.0.0"
6005
+ "@eslint/js": "^9.0.0",
6006
+ "typescript-eslint": "^8.0.0"
5945
6007
  }
5946
6008
  }
5947
6009
  `;
@@ -5981,8 +6043,8 @@ var NITRO_PACKAGE_JSON_TEMPLATE = `{
5981
6043
  "devDependencies": {
5982
6044
  "typescript": "^5.5.4",
5983
6045
  "eslint": "^9.0.0",
5984
- "@typescript-eslint/parser": "^8.0.0",
5985
- "@typescript-eslint/eslint-plugin": "^8.0.0"
6046
+ "@eslint/js": "^9.0.0",
6047
+ "typescript-eslint": "^8.0.0"
5986
6048
  }
5987
6049
  }
5988
6050
  `;
@@ -6006,6 +6068,538 @@ var NITRO_ROUTE_TEMPLATE = `// Auto-generated Nitro route — GET /
6006
6068
  // \`defineEventHandler\` is auto-imported by Nitro (see ./.nitro/types).
6007
6069
  export default defineEventHandler(() => ({ status: "ok", app: "{appName}" }));
6008
6070
  `;
6071
+ var EXPRESS_PACKAGE_JSON_TEMPLATE = `{
6072
+ "name": "@{scope}/{appName}",
6073
+ "version": "0.0.0",
6074
+ "private": true,
6075
+ "type": "module",
6076
+ "scripts": {
6077
+ "build": "tsc",
6078
+ "dev": "tsc --watch",
6079
+ "lint": "eslint src --ext .ts",
6080
+ "typecheck": "tsc --noEmit"
6081
+ },
6082
+ "dependencies": {
6083
+ "express": "^5.0.0"
6084
+ },
6085
+ "devDependencies": {
6086
+ "@types/express": "^5.0.0",
6087
+ "typescript": "^5.5.4",
6088
+ "eslint": "^9.0.0",
6089
+ "@eslint/js": "^9.0.0",
6090
+ "typescript-eslint": "^8.0.0"
6091
+ }
6092
+ }
6093
+ `;
6094
+ var EXPRESS_TSCONFIG = {
6095
+ extends: "../../tsconfig.base.json",
6096
+ compilerOptions: {
6097
+ rootDir: "src",
6098
+ outDir: "dist",
6099
+ // Emit runnable JS (declaration alongside) — the app's `build: tsc` must
6100
+ // produce dist/*.js to run; NOT declaration-only.
6101
+ composite: true,
6102
+ declaration: true
6103
+ },
6104
+ include: ["src/**/*"],
6105
+ exclude: ["node_modules", "dist"]
6106
+ };
6107
+ var EXPRESS_ENTRY_TEMPLATE = `// Auto-generated Express application
6108
+ import express from "express";
6109
+
6110
+ const app = express();
6111
+
6112
+ app.get("/", (_req, res) => {
6113
+ res.json({ status: "ok", app: "{appName}" });
6114
+ });
6115
+
6116
+ const port = Number(process.env.PORT ?? 3000);
6117
+ app.listen(port);
6118
+
6119
+ export default app;
6120
+ `;
6121
+ var NESTJS_PACKAGE_JSON_TEMPLATE = `{
6122
+ "name": "@{scope}/{appName}",
6123
+ "version": "0.0.0",
6124
+ "private": true,
6125
+ "type": "module",
6126
+ "scripts": {
6127
+ "build": "nest build",
6128
+ "dev": "nest start --watch",
6129
+ "lint": "eslint src --ext .ts",
6130
+ "typecheck": "tsc --noEmit"
6131
+ },
6132
+ "dependencies": {
6133
+ "@nestjs/common": "^11.0.0",
6134
+ "@nestjs/core": "^11.0.0",
6135
+ "@nestjs/platform-express": "^11.0.0",
6136
+ "reflect-metadata": "^0.2.0",
6137
+ "rxjs": "^7.8.0"
6138
+ },
6139
+ "devDependencies": {
6140
+ "@nestjs/cli": "^11.0.0",
6141
+ "@nestjs/schematics": "^11.0.0",
6142
+ "@types/node": "^22.0.0",
6143
+ "typescript": "^5.5.4",
6144
+ "eslint": "^9.0.0",
6145
+ "@eslint/js": "^9.0.0",
6146
+ "typescript-eslint": "^8.0.0"
6147
+ }
6148
+ }
6149
+ `;
6150
+ var NESTJS_TSCONFIG = {
6151
+ extends: "../../tsconfig.base.json",
6152
+ compilerOptions: {
6153
+ rootDir: "src",
6154
+ outDir: "dist",
6155
+ // Emit runnable JS (not declaration-only): `nest build` falls back to this
6156
+ // tsconfig when there's no tsconfig.build.json, so it must produce dist/*.js.
6157
+ composite: true,
6158
+ declaration: true,
6159
+ // NestJS relies on decorator metadata for dependency injection.
6160
+ experimentalDecorators: true,
6161
+ emitDecoratorMetadata: true
6162
+ },
6163
+ include: ["src/**/*"],
6164
+ exclude: ["node_modules", "dist"]
6165
+ };
6166
+ var NESTJS_ENTRY_TEMPLATE = `// Auto-generated NestJS application entry point
6167
+ import "reflect-metadata";
6168
+ import { NestFactory } from "@nestjs/core";
6169
+ import { AppModule } from "./app.module.js";
6170
+
6171
+ async function bootstrap(): Promise<void> {
6172
+ const app = await NestFactory.create(AppModule);
6173
+ await app.listen(process.env.PORT ?? 3000);
6174
+ }
6175
+
6176
+ void bootstrap();
6177
+ `;
6178
+ var NESTJS_MODULE_TEMPLATE = `import { Module } from "@nestjs/common";
6179
+ import { AppController } from "./app.controller.js";
6180
+
6181
+ @Module({
6182
+ controllers: [AppController],
6183
+ })
6184
+ export class AppModule {}
6185
+ `;
6186
+ var NESTJS_CONTROLLER_TEMPLATE = `import { Controller, Get } from "@nestjs/common";
6187
+
6188
+ @Controller()
6189
+ export class AppController {
6190
+ @Get()
6191
+ getStatus(): { status: string; app: string } {
6192
+ return { status: "ok", app: "{appName}" };
6193
+ }
6194
+ }
6195
+ `;
6196
+ var NESTJS_CLI_TEMPLATE = `{
6197
+ "$schema": "https://json.schemastore.org/nest-cli",
6198
+ "collection": "@nestjs/schematics",
6199
+ "sourceRoot": "src"
6200
+ }
6201
+ `;
6202
+ var SERVERLESS_PACKAGE_JSON_TEMPLATE = `{
6203
+ "name": "@{scope}/{appName}",
6204
+ "version": "0.0.0",
6205
+ "private": true,
6206
+ "type": "module",
6207
+ "scripts": {
6208
+ "build": "tsc",
6209
+ "deploy": "tsc && serverless deploy",
6210
+ "lint": "eslint src --ext .ts",
6211
+ "typecheck": "tsc --noEmit"
6212
+ },
6213
+ "devDependencies": {
6214
+ "@types/aws-lambda": "^8.10.0",
6215
+ "serverless": "^4.0.0",
6216
+ "typescript": "^5.5.4",
6217
+ "eslint": "^9.0.0",
6218
+ "@eslint/js": "^9.0.0",
6219
+ "typescript-eslint": "^8.0.0"
6220
+ }
6221
+ }
6222
+ `;
6223
+ var SERVERLESS_TSCONFIG = {
6224
+ extends: "../../tsconfig.base.json",
6225
+ compilerOptions: {
6226
+ rootDir: "src",
6227
+ outDir: "dist",
6228
+ // Emit runnable JS to dist/ — the Lambda handler must exist as JS for deploy
6229
+ // (serverless.yml points at dist/handler.handler).
6230
+ composite: true,
6231
+ declaration: true
6232
+ },
6233
+ include: ["src/**/*"],
6234
+ exclude: ["node_modules", "dist"]
6235
+ };
6236
+ var SERVERLESS_ENTRY_TEMPLATE = `// Auto-generated AWS Lambda handler (Serverless Framework)
6237
+ import type {
6238
+ APIGatewayProxyEventV2,
6239
+ APIGatewayProxyResultV2,
6240
+ } from "aws-lambda";
6241
+
6242
+ export const handler = async (
6243
+ _event: APIGatewayProxyEventV2,
6244
+ ): Promise<APIGatewayProxyResultV2> => {
6245
+ return {
6246
+ statusCode: 200,
6247
+ body: JSON.stringify({ status: "ok", app: "{appName}" }),
6248
+ };
6249
+ };
6250
+ `;
6251
+ var SERVERLESS_CONFIG_TEMPLATE = `service: {appName}
6252
+ frameworkVersion: "4"
6253
+
6254
+ provider:
6255
+ name: aws
6256
+ runtime: nodejs20.x
6257
+
6258
+ functions:
6259
+ api:
6260
+ handler: dist/handler.handler
6261
+ events:
6262
+ - httpApi:
6263
+ path: /
6264
+ method: get
6265
+ `;
6266
+ var VUE_PACKAGE_JSON_TEMPLATE = `{
6267
+ "name": "@{scope}/{appName}",
6268
+ "version": "0.0.0",
6269
+ "private": true,
6270
+ "type": "module",
6271
+ "scripts": {
6272
+ "dev": "vite",
6273
+ "build": "vue-tsc -b && vite build",
6274
+ "preview": "vite preview",
6275
+ "lint": "eslint src --ext .ts,.vue",
6276
+ "typecheck": "vue-tsc --noEmit"
6277
+ },
6278
+ "dependencies": {
6279
+ "vue": "^3.5.0"
6280
+ },
6281
+ "devDependencies": {
6282
+ "@vitejs/plugin-vue": "^5.2.0",
6283
+ "vite": "^6.0.0",
6284
+ "vue-tsc": "^2.1.0",
6285
+ "typescript": "^5.5.4",
6286
+ "eslint": "^9.0.0",
6287
+ "eslint-plugin-vue": "^9.30.0",
6288
+ "vue-eslint-parser": "^9.4.3",
6289
+ "@eslint/js": "^9.0.0",
6290
+ "typescript-eslint": "^8.0.0"
6291
+ }
6292
+ }
6293
+ `;
6294
+ var VUE_TSCONFIG = {
6295
+ extends: "../../tsconfig.base.json",
6296
+ compilerOptions: {
6297
+ rootDir: "src",
6298
+ outDir: "dist",
6299
+ composite: true,
6300
+ declaration: true,
6301
+ emitDeclarationOnly: true,
6302
+ jsx: "preserve"
6303
+ },
6304
+ include: ["src/**/*"],
6305
+ exclude: ["node_modules", "dist"]
6306
+ };
6307
+ var VUE_ENTRY_TEMPLATE = `import { createApp } from "vue";
6308
+ import App from "./App.vue.js";
6309
+
6310
+ createApp(App).mount("#app");
6311
+ `;
6312
+ var VUE_APP_TEMPLATE = `<script setup lang="ts"></script>
6313
+
6314
+ <template>
6315
+ <main>Welcome to {system}</main>
6316
+ </template>
6317
+ `;
6318
+ var VUE_INDEX_HTML_TEMPLATE = `<!doctype html>
6319
+ <html lang="en">
6320
+ <head>
6321
+ <meta charset="UTF-8" />
6322
+ <title>{system}</title>
6323
+ </head>
6324
+ <body>
6325
+ <div id="app"></div>
6326
+ <script type="module" src="/src/main.ts"></script>
6327
+ </body>
6328
+ </html>
6329
+ `;
6330
+ var VUE_VITE_CONFIG_TEMPLATE = `import { defineConfig } from "vite";
6331
+ import vue from "@vitejs/plugin-vue";
6332
+
6333
+ export default defineConfig({ plugins: [vue()] });
6334
+ `;
6335
+ var REACT_ROUTER_PACKAGE_JSON_TEMPLATE = `{
6336
+ "name": "@{scope}/{appName}",
6337
+ "version": "0.0.0",
6338
+ "private": true,
6339
+ "type": "module",
6340
+ "scripts": {
6341
+ "dev": "vite",
6342
+ "build": "tsc && vite build",
6343
+ "preview": "vite preview",
6344
+ "lint": "eslint src --ext .ts,.tsx",
6345
+ "typecheck": "tsc --noEmit"
6346
+ },
6347
+ "dependencies": {
6348
+ "react": "^19.0.0",
6349
+ "react-dom": "^19.0.0",
6350
+ "react-router-dom": "^7.0.0"
6351
+ },
6352
+ "devDependencies": {
6353
+ "@vitejs/plugin-react": "^4.3.0",
6354
+ "vite": "^6.0.0",
6355
+ "@types/react": "^19.0.0",
6356
+ "@types/react-dom": "^19.0.0",
6357
+ "typescript": "^5.5.4",
6358
+ "eslint": "^9.0.0",
6359
+ "@eslint/js": "^9.0.0",
6360
+ "typescript-eslint": "^8.0.0"
6361
+ }
6362
+ }
6363
+ `;
6364
+ var REACT_ROUTER_TSCONFIG = {
6365
+ extends: "../../tsconfig.base.json",
6366
+ compilerOptions: {
6367
+ rootDir: "src",
6368
+ outDir: "dist",
6369
+ composite: true,
6370
+ declaration: true,
6371
+ emitDeclarationOnly: true,
6372
+ jsx: "react-jsx"
6373
+ },
6374
+ include: ["src/**/*"],
6375
+ exclude: ["node_modules", "dist"]
6376
+ };
6377
+ var REACT_ROUTER_ENTRY_TEMPLATE = `import { StrictMode } from "react";
6378
+ import { createRoot } from "react-dom/client";
6379
+ import { createBrowserRouter, RouterProvider } from "react-router-dom";
6380
+ import App from "./App.js";
6381
+
6382
+ const router = createBrowserRouter([{ path: "/", element: <App /> }]);
6383
+
6384
+ createRoot(document.getElementById("root")!).render(
6385
+ <StrictMode>
6386
+ <RouterProvider router={router} />
6387
+ </StrictMode>,
6388
+ );
6389
+ `;
6390
+ var REACT_ROUTER_APP_TEMPLATE = `export default function App() {
6391
+ return <main>Welcome to {system}</main>;
6392
+ }
6393
+ `;
6394
+ var REACT_ROUTER_INDEX_HTML_TEMPLATE = `<!doctype html>
6395
+ <html lang="en">
6396
+ <head>
6397
+ <meta charset="UTF-8" />
6398
+ <title>{system}</title>
6399
+ </head>
6400
+ <body>
6401
+ <div id="root"></div>
6402
+ <script type="module" src="/src/main.tsx"></script>
6403
+ </body>
6404
+ </html>
6405
+ `;
6406
+ var REACT_ROUTER_VITE_CONFIG_TEMPLATE = `import { defineConfig } from "vite";
6407
+ import react from "@vitejs/plugin-react";
6408
+
6409
+ export default defineConfig({ plugins: [react()] });
6410
+ `;
6411
+ var REMIX_PACKAGE_JSON_TEMPLATE = `{
6412
+ "name": "@{scope}/{appName}",
6413
+ "version": "0.0.0",
6414
+ "private": true,
6415
+ "type": "module",
6416
+ "scripts": {
6417
+ "dev": "remix vite:dev",
6418
+ "build": "remix vite:build",
6419
+ "start": "remix-serve ./build/server/index.js",
6420
+ "lint": "eslint app --ext .ts,.tsx",
6421
+ "typecheck": "tsc --noEmit"
6422
+ },
6423
+ "dependencies": {
6424
+ "@remix-run/node": "^2.15.0",
6425
+ "@remix-run/react": "^2.15.0",
6426
+ "@remix-run/serve": "^2.15.0",
6427
+ "isbot": "^5.1.0",
6428
+ "react": "^18.2.0",
6429
+ "react-dom": "^18.2.0"
6430
+ },
6431
+ "devDependencies": {
6432
+ "@remix-run/dev": "^2.15.0",
6433
+ "vite": "^6.0.0",
6434
+ "@types/react": "^18.2.0",
6435
+ "@types/react-dom": "^18.2.0",
6436
+ "typescript": "^5.5.4",
6437
+ "eslint": "^9.0.0",
6438
+ "@eslint/js": "^9.0.0",
6439
+ "typescript-eslint": "^8.0.0"
6440
+ }
6441
+ }
6442
+ `;
6443
+ var REMIX_TSCONFIG = {
6444
+ extends: "../../tsconfig.base.json",
6445
+ compilerOptions: {
6446
+ rootDir: ".",
6447
+ outDir: "dist",
6448
+ composite: true,
6449
+ declaration: true,
6450
+ emitDeclarationOnly: true,
6451
+ jsx: "react-jsx"
6452
+ },
6453
+ include: ["app/**/*"],
6454
+ exclude: ["node_modules", "dist", "build"]
6455
+ };
6456
+ var REMIX_ROOT_TEMPLATE = `import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
6457
+
6458
+ export default function App() {
6459
+ return (
6460
+ <html lang="en">
6461
+ <head>
6462
+ <meta charSet="utf-8" />
6463
+ <Meta />
6464
+ <Links />
6465
+ </head>
6466
+ <body>
6467
+ <Outlet />
6468
+ <Scripts />
6469
+ </body>
6470
+ </html>
6471
+ );
6472
+ }
6473
+ `;
6474
+ var REMIX_INDEX_ROUTE_TEMPLATE = `export default function Index() {
6475
+ return <main>Welcome to {system}</main>;
6476
+ }
6477
+ `;
6478
+ var REMIX_VITE_CONFIG_TEMPLATE = `import { vitePlugin as remix } from "@remix-run/dev";
6479
+ import { defineConfig } from "vite";
6480
+
6481
+ export default defineConfig({ plugins: [remix()] });
6482
+ `;
6483
+ var ANGULAR_PACKAGE_JSON_TEMPLATE = `{
6484
+ "name": "@{scope}/{appName}",
6485
+ "version": "0.0.0",
6486
+ "private": true,
6487
+ "type": "module",
6488
+ "scripts": {
6489
+ "dev": "ng serve",
6490
+ "build": "ng build",
6491
+ "lint": "eslint src --ext .ts",
6492
+ "typecheck": "tsc -p tsconfig.app.json --noEmit"
6493
+ },
6494
+ "dependencies": {
6495
+ "@angular/common": "^19.0.0",
6496
+ "@angular/compiler": "^19.0.0",
6497
+ "@angular/core": "^19.0.0",
6498
+ "@angular/platform-browser": "^19.0.0",
6499
+ "rxjs": "^7.8.0",
6500
+ "tslib": "^2.7.0",
6501
+ "zone.js": "^0.15.0"
6502
+ },
6503
+ "devDependencies": {
6504
+ "@angular/cli": "^19.0.0",
6505
+ "@angular/compiler-cli": "^19.0.0",
6506
+ "@angular-devkit/build-angular": "^19.0.0",
6507
+ "typescript": "^5.5.4",
6508
+ "eslint": "^9.0.0",
6509
+ "@eslint/js": "^9.0.0",
6510
+ "typescript-eslint": "^8.0.0"
6511
+ }
6512
+ }
6513
+ `;
6514
+ var ANGULAR_TSCONFIG = {
6515
+ extends: "../../tsconfig.base.json",
6516
+ compilerOptions: {
6517
+ // `rootDir: "src"` mirrors every other app template. Without it the app
6518
+ // inherits the monorepo base's `rootDir` (the repo root's `src`), and
6519
+ // `tsc -p tsconfig.app.json --noEmit` fails with "src/main.ts is not under
6520
+ // rootDir". tsconfig.app.json extends this file, so it inherits the override.
6521
+ rootDir: "src",
6522
+ outDir: "dist",
6523
+ experimentalDecorators: true,
6524
+ emitDecoratorMetadata: true,
6525
+ lib: ["ES2022", "DOM"],
6526
+ skipLibCheck: true
6527
+ },
6528
+ // The app build/typecheck uses tsconfig.app.json (it carries Angular's
6529
+ // angularCompilerOptions); this base just establishes shared compiler options.
6530
+ include: [],
6531
+ references: [{ path: "./tsconfig.app.json" }]
6532
+ };
6533
+ var ANGULAR_MAIN_TEMPLATE = `// zone.js powers Angular's default (zone-based) change detection — it must be
6534
+ // imported before bootstrap or async updates won't trigger a re-render.
6535
+ import "zone.js";
6536
+ import { bootstrapApplication } from "@angular/platform-browser";
6537
+ import { AppComponent } from "./app/app.component.js";
6538
+
6539
+ bootstrapApplication(AppComponent).catch((err) => console.error(err));
6540
+ `;
6541
+ var ANGULAR_COMPONENT_TEMPLATE = `import { Component } from "@angular/core";
6542
+
6543
+ @Component({
6544
+ selector: "app-root",
6545
+ standalone: true,
6546
+ template: "<main>Welcome to {system}</main>",
6547
+ })
6548
+ export class AppComponent {}
6549
+ `;
6550
+ var ANGULAR_INDEX_HTML_TEMPLATE = `<!doctype html>
6551
+ <html lang="en">
6552
+ <head>
6553
+ <meta charset="UTF-8" />
6554
+ <title>{system}</title>
6555
+ </head>
6556
+ <body>
6557
+ <app-root></app-root>
6558
+ </body>
6559
+ </html>
6560
+ `;
6561
+ var ANGULAR_APP_TSCONFIG_TEMPLATE = `{
6562
+ "extends": "./tsconfig.json",
6563
+ "compilerOptions": {
6564
+ "outDir": "./dist/app",
6565
+ "composite": false,
6566
+ "declaration": false,
6567
+ "types": []
6568
+ },
6569
+ "files": ["src/main.ts"],
6570
+ "include": ["src/**/*.ts"],
6571
+ "angularCompilerOptions": {
6572
+ "strictTemplates": true
6573
+ }
6574
+ }
6575
+ `;
6576
+ var ANGULAR_JSON_TEMPLATE = `{
6577
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
6578
+ "version": 1,
6579
+ "projects": {
6580
+ "{appName}": {
6581
+ "projectType": "application",
6582
+ "root": "",
6583
+ "sourceRoot": "src",
6584
+ "architect": {
6585
+ "build": {
6586
+ "builder": "@angular-devkit/build-angular:application",
6587
+ "options": {
6588
+ "outputPath": "dist",
6589
+ "index": "src/index.html",
6590
+ "browser": "src/main.ts",
6591
+ "tsConfig": "tsconfig.app.json"
6592
+ }
6593
+ },
6594
+ "serve": {
6595
+ "builder": "@angular-devkit/build-angular:dev-server",
6596
+ "options": { "buildTarget": "{appName}:build" }
6597
+ }
6598
+ }
6599
+ }
6600
+ }
6601
+ }
6602
+ `;
6009
6603
  var BUILTIN_FRAMEWORK_TEMPLATES = {
6010
6604
  "next.js": {
6011
6605
  packageJson: { template: NEXTJS_PACKAGE_JSON_TEMPLATE },
@@ -6013,7 +6607,10 @@ var BUILTIN_FRAMEWORK_TEMPLATES = {
6013
6607
  entryPoint: {
6014
6608
  path: "src/app/page.tsx",
6015
6609
  template: NEXTJS_ENTRY_TEMPLATE
6016
- }
6610
+ },
6611
+ extraFiles: [
6612
+ { path: "src/app/layout.tsx", template: NEXTJS_LAYOUT_TEMPLATE }
6613
+ ]
6017
6614
  },
6018
6615
  fastify: {
6019
6616
  packageJson: { template: FASTIFY_PACKAGE_JSON_TEMPLATE },
@@ -6039,6 +6636,72 @@ var BUILTIN_FRAMEWORK_TEMPLATES = {
6039
6636
  template: NITRO_ROUTE_TEMPLATE
6040
6637
  },
6041
6638
  extraFiles: [{ path: "nitro.config.ts", template: NITRO_CONFIG_TEMPLATE }]
6639
+ },
6640
+ express: {
6641
+ packageJson: { template: EXPRESS_PACKAGE_JSON_TEMPLATE },
6642
+ tsConfig: EXPRESS_TSCONFIG,
6643
+ entryPoint: { path: "src/index.ts", template: EXPRESS_ENTRY_TEMPLATE }
6644
+ },
6645
+ nestjs: {
6646
+ packageJson: { template: NESTJS_PACKAGE_JSON_TEMPLATE },
6647
+ tsConfig: NESTJS_TSCONFIG,
6648
+ entryPoint: { path: "src/main.ts", template: NESTJS_ENTRY_TEMPLATE },
6649
+ extraFiles: [
6650
+ { path: "src/app.module.ts", template: NESTJS_MODULE_TEMPLATE },
6651
+ { path: "src/app.controller.ts", template: NESTJS_CONTROLLER_TEMPLATE },
6652
+ { path: "nest-cli.json", template: NESTJS_CLI_TEMPLATE }
6653
+ ]
6654
+ },
6655
+ serverless: {
6656
+ packageJson: { template: SERVERLESS_PACKAGE_JSON_TEMPLATE },
6657
+ tsConfig: SERVERLESS_TSCONFIG,
6658
+ entryPoint: { path: "src/handler.ts", template: SERVERLESS_ENTRY_TEMPLATE },
6659
+ extraFiles: [
6660
+ { path: "serverless.yml", template: SERVERLESS_CONFIG_TEMPLATE }
6661
+ ]
6662
+ },
6663
+ vue: {
6664
+ packageJson: { template: VUE_PACKAGE_JSON_TEMPLATE },
6665
+ tsConfig: VUE_TSCONFIG,
6666
+ entryPoint: { path: "src/main.ts", template: VUE_ENTRY_TEMPLATE },
6667
+ extraFiles: [
6668
+ { path: "src/App.vue", template: VUE_APP_TEMPLATE },
6669
+ { path: "index.html", template: VUE_INDEX_HTML_TEMPLATE },
6670
+ { path: "vite.config.ts", template: VUE_VITE_CONFIG_TEMPLATE }
6671
+ ]
6672
+ },
6673
+ "react-router": {
6674
+ packageJson: { template: REACT_ROUTER_PACKAGE_JSON_TEMPLATE },
6675
+ tsConfig: REACT_ROUTER_TSCONFIG,
6676
+ entryPoint: { path: "src/main.tsx", template: REACT_ROUTER_ENTRY_TEMPLATE },
6677
+ extraFiles: [
6678
+ { path: "src/App.tsx", template: REACT_ROUTER_APP_TEMPLATE },
6679
+ { path: "index.html", template: REACT_ROUTER_INDEX_HTML_TEMPLATE },
6680
+ { path: "vite.config.ts", template: REACT_ROUTER_VITE_CONFIG_TEMPLATE }
6681
+ ]
6682
+ },
6683
+ remix: {
6684
+ packageJson: { template: REMIX_PACKAGE_JSON_TEMPLATE },
6685
+ tsConfig: REMIX_TSCONFIG,
6686
+ entryPoint: { path: "app/root.tsx", template: REMIX_ROOT_TEMPLATE },
6687
+ extraFiles: [
6688
+ { path: "app/routes/_index.tsx", template: REMIX_INDEX_ROUTE_TEMPLATE },
6689
+ { path: "vite.config.ts", template: REMIX_VITE_CONFIG_TEMPLATE }
6690
+ ]
6691
+ },
6692
+ angular: {
6693
+ packageJson: { template: ANGULAR_PACKAGE_JSON_TEMPLATE },
6694
+ tsConfig: ANGULAR_TSCONFIG,
6695
+ entryPoint: { path: "src/main.ts", template: ANGULAR_MAIN_TEMPLATE },
6696
+ extraFiles: [
6697
+ {
6698
+ path: "src/app/app.component.ts",
6699
+ template: ANGULAR_COMPONENT_TEMPLATE
6700
+ },
6701
+ { path: "src/index.html", template: ANGULAR_INDEX_HTML_TEMPLATE },
6702
+ { path: "tsconfig.app.json", template: ANGULAR_APP_TSCONFIG_TEMPLATE },
6703
+ { path: "angular.json", template: ANGULAR_JSON_TEMPLATE }
6704
+ ]
6042
6705
  }
6043
6706
  };
6044
6707
  var GENERATED_MARKER_LINE = "// @generated by @hexagen/sync";
@@ -6059,7 +6722,32 @@ export default tseslint.config(
6059
6722
  },
6060
6723
  );
6061
6724
  `;
6062
- function resolveTemplate3(manifest, moduleName, usePerContextOverride) {
6725
+ var VUE_FALLBACK_TEMPLATE = `import eslint from '@eslint/js';
6726
+ import tseslint from 'typescript-eslint';
6727
+ import pluginVue from 'eslint-plugin-vue';
6728
+
6729
+ export default tseslint.config(
6730
+ eslint.configs.recommended,
6731
+ ...tseslint.configs.recommended,
6732
+ ...pluginVue.configs['flat/recommended'],
6733
+ {
6734
+ files: ['**/*.vue'],
6735
+ languageOptions: {
6736
+ parserOptions: { parser: tseslint.parser },
6737
+ },
6738
+ },
6739
+ {
6740
+ rules: {
6741
+ '@typescript-eslint/no-explicit-any': 'warn',
6742
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
6743
+ },
6744
+ },
6745
+ {
6746
+ ignores: ['dist/**', 'node_modules/**'],
6747
+ },
6748
+ );
6749
+ `;
6750
+ function resolveTemplate3(manifest, moduleName, usePerContextOverride, framework) {
6063
6751
  const contextOverride = usePerContextOverride ? manifest.bounded_contexts?.find((c) => c.name === moduleName)?.generator?.eslint : void 0;
6064
6752
  if (contextOverride?.template !== void 0) {
6065
6753
  return { template: contextOverride.template, source: "per-context" };
@@ -6072,6 +6760,9 @@ function resolveTemplate3(manifest, moduleName, usePerContextOverride) {
6072
6760
  if (monorepoLevel?.template !== void 0) {
6073
6761
  return { template: monorepoLevel.template, source: "workspace" };
6074
6762
  }
6763
+ if (framework === "vue") {
6764
+ return { template: VUE_FALLBACK_TEMPLATE, source: "fallback" };
6765
+ }
6075
6766
  return { template: BUILTIN_FALLBACK_TEMPLATE2, source: "fallback" };
6076
6767
  }
6077
6768
  function withGeneratedMarker(content) {
@@ -6088,7 +6779,8 @@ async function generateEslintConfig(moduleDir, moduleName, config, report, optio
6088
6779
  const { template, source } = resolveTemplate3(
6089
6780
  config.manifest,
6090
6781
  moduleName,
6091
- options.usePerContextOverride ?? true
6782
+ options.usePerContextOverride ?? true,
6783
+ options.framework
6092
6784
  );
6093
6785
  if (typeof template !== "string" || template.length === 0) {
6094
6786
  const message = `No eslint template resolved for ${moduleName} (source: ${source}); skipping`;
@@ -6366,7 +7058,7 @@ async function generateApps(config, report) {
6366
7058
  app.name,
6367
7059
  config,
6368
7060
  report,
6369
- { usePerContextOverride: false }
7061
+ { usePerContextOverride: false, framework }
6370
7062
  );
6371
7063
  mergeResult(result, eslintResult);
6372
7064
  }
@@ -7775,6 +8467,16 @@ var ManifestSchema = external_exports.object({
7775
8467
  description: external_exports.string().optional(),
7776
8468
  system: external_exports.string().optional(),
7777
8469
  scope: external_exports.string().optional(),
8470
+ // Structured workspace metadata (the canonical `workspace:` block, also the
8471
+ // first block in the few-shot examples). `system`/`scope` above are derived
8472
+ // from `workspace.name`; `workspace.description` is the only carrier of the
8473
+ // human-readable intent. Emitted by `draftToManifest` so the generated
8474
+ // manifest survives `parseManifestToWizardData`'s strict parse on the
8475
+ // "Use this manifest" path. Optional — legacy/hand-written manifests omit it.
8476
+ workspace: external_exports.object({
8477
+ name: external_exports.string(),
8478
+ description: external_exports.string()
8479
+ }).optional(),
7778
8480
  architecture: external_exports.string().optional(),
7779
8481
  // The wizard records the chosen workspace template (e.g. "strict-enterprise")
7780
8482
  // alongside `architecture`; persisted into .architecture/manifest.yaml.
@@ -9930,6 +10632,9 @@ function isOutputEnabled(output, answers) {
9930
10632
  return true;
9931
10633
  return matchesCondition(output.when, answers);
9932
10634
  }
10635
+ function isTestOutput(path39) {
10636
+ return /\.(test|spec)\.[cm]?[jt]sx?$/.test(path39);
10637
+ }
9933
10638
 
9934
10639
  // ../template-engine/dist/domain/template-manifest.js
9935
10640
  function validateManifest3(raw) {
@@ -10504,8 +11209,10 @@ ${prompt} (comma-separated numbers)`);
10504
11209
  var PACKAGE_ROOT2 = path34__default.resolve(path34__default.dirname(fileURLToPath(import.meta.url)), "..", "..");
10505
11210
  var FileSystemFileEmitter = class {
10506
11211
  templatesDir;
10507
- constructor(templatesDir) {
11212
+ withTests;
11213
+ constructor(templatesDir, options = {}) {
10508
11214
  this.templatesDir = templatesDir ?? path34__default.join(PACKAGE_ROOT2, "templates");
11215
+ this.withTests = options.withTests ?? false;
10509
11216
  }
10510
11217
  async emit(manifest, answers, projectRoot, config) {
10511
11218
  const warnings = [];
@@ -10516,6 +11223,8 @@ var FileSystemFileEmitter = class {
10516
11223
  if (!isOutputEnabled(out, answers))
10517
11224
  continue;
10518
11225
  const outputRelPath = outputPath(out);
11226
+ if (!this.withTests && isTestOutput(outputRelPath))
11227
+ continue;
10519
11228
  const destFile = path34__default.resolve(projectRoot, outputRelPath);
10520
11229
  if (!destFile.startsWith(resolvedRoot + path34__default.sep) && destFile !== resolvedRoot) {
10521
11230
  throw new Error(`Output path '${outputRelPath}' escapes the project root`);
@@ -10712,7 +11421,9 @@ async function addTemplateCommand(templateIds, options = {}) {
10712
11421
  const templatesDir = resolveTemplatesDir();
10713
11422
  const registry = new FileSystemTemplateRegistry(templatesDir);
10714
11423
  const questionEngine = new InteractiveQuestionEngine();
10715
- const fileEmitter = new FileSystemFileEmitter(templatesDir);
11424
+ const fileEmitter = new FileSystemFileEmitter(templatesDir, {
11425
+ withTests: options.withTests ?? false
11426
+ });
10716
11427
  const configStore = new FileSystemTemplateConfigStore();
10717
11428
  let skipInstalled = !options.force;
10718
11429
  if (!options.force) {
@@ -13408,9 +14119,17 @@ function buildProgram() {
13408
14119
  templatesCommand.command("info <id>").description("Show detailed information about a template").action(async (id) => {
13409
14120
  await templateInfoCommand(id);
13410
14121
  });
13411
- program2.command("add <ids...>").description("Apply one or more add-on templates to the current project").option("--force", "Re-apply already-installed templates").action(async (ids, options) => {
13412
- await addTemplateCommand(ids, { force: options.force });
13413
- });
14122
+ program2.command("add <ids...>").description("Apply one or more add-on templates to the current project").option("--force", "Re-apply already-installed templates").option(
14123
+ "--with-tests",
14124
+ "Also emit each template's test scaffolds (skipped by default)"
14125
+ ).action(
14126
+ async (ids, options) => {
14127
+ await addTemplateCommand(ids, {
14128
+ force: options.force,
14129
+ withTests: options.withTests
14130
+ });
14131
+ }
14132
+ );
13414
14133
  program2.command("validate-templates").description(
13415
14134
  "Validate installed templates — check output files, env vars, and conflict files"
13416
14135
  ).action(async () => {