@orkestrel/scaffold 0.0.39 → 0.0.41

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 (37) hide show
  1. package/dist/bin/main.js +8 -1
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/AGENTS.md +2 -2
  4. package/dist/host/agents/orchestration.md +33 -2
  5. package/dist/host/agents/skills/enterprise-bootstrap/references/bootstrap-reference.md +16 -16
  6. package/dist/host/agents/skills/enterprise-bootstrap/references/components.md +3 -3
  7. package/dist/host/agents/skills/orkestrel-align-packages/references/integration.md +1 -1
  8. package/dist/host/agents/skills/orkestrel-build-application/SKILL.md +7 -2
  9. package/dist/host/claude/agents/builder.md +2 -2
  10. package/dist/host/claude/agents/orkestrel.md +48 -48
  11. package/dist/host/claude/rules/application.md +6 -4
  12. package/dist/host/claude/rules/architecture.md +2 -0
  13. package/dist/host/claude/rules/documentation.md +6 -0
  14. package/dist/host/claude/rules/tests.md +11 -1
  15. package/dist/host/claude/rules/typescript.md +15 -1
  16. package/dist/host/claude/rules/workspace.md +43 -13
  17. package/dist/host/claude/rules/writing.md +125 -0
  18. package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +10 -1
  19. package/dist/host/claude/skills/orkestrel-align-packages/SKILL.md +1 -1
  20. package/dist/host/claude/skills/orkestrel-build-application/SKILL.md +1 -1
  21. package/dist/host/claude/skills/orkestrel-harden-package/SKILL.md +1 -1
  22. package/dist/host/configs/policy.ts +185 -0
  23. package/dist/host/dotfiles/oxlintrc.json +13 -1
  24. package/dist/host/dotfiles/prettierignore +3 -0
  25. package/dist/host/guides/scaffold.md +13 -7
  26. package/dist/host/manifest.json +11 -7
  27. package/dist/host/tests/config.test.ts +195 -4
  28. package/dist/host/tests/policy.test.ts +82 -0
  29. package/dist/host/tests/setupPolicy.ts +863 -21
  30. package/dist/src/core/index.cjs +68 -6
  31. package/dist/src/core/index.cjs.map +1 -1
  32. package/dist/src/core/index.d.cts +11 -9
  33. package/dist/src/core/index.d.ts +11 -9
  34. package/dist/src/core/index.js +68 -6
  35. package/dist/src/core/index.js.map +1 -1
  36. package/package.json +2 -2
  37. package/dist/host/agents/skills/orkestrel-build-application/references/application.md +0 -129
@@ -129,6 +129,7 @@ var HOST_PATHS = Object.freeze([
129
129
  "tests/policy.test.ts",
130
130
  "tests/config.test.ts",
131
131
  "configs/helpers.ts",
132
+ "configs/policy.ts",
132
133
  ".editorconfig",
133
134
  ".gitattributes",
134
135
  ".gitignore",
@@ -305,7 +306,7 @@ var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
305
306
  /** The tooling versions scaffold and every generated workspace share. */
306
307
  var BASE_DEV_DEPENDENCIES = Object.freeze({
307
308
  "@orkestrel/guide": "^0.0.12",
308
- "@orkestrel/scaffold": "^0.0.39",
309
+ "@orkestrel/scaffold": "^0.0.41",
309
310
  "@orkestrel/test": "^0.0.6",
310
311
  "@types/node": "^26.2.0",
311
312
  oxfmt: "^0.62.0",
@@ -405,6 +406,7 @@ var CONFIG_TEMPLATES = Object.freeze({
405
406
  `,
406
407
  vite: `import type { {{viteTypes}} } from 'vite'
407
408
  {{imports}}import { defineConfig, mergeConfig } from 'vitest/config'
409
+ import manifest from './package.json' with { type: 'json' }
408
410
  import tsconfig from './tsconfig.json' with { type: 'json' }
409
411
  {{helpers}}{{browsers}}import { fileURLToPath, URL } from 'node:url'
410
412
 
@@ -412,6 +414,18 @@ import tsconfig from './tsconfig.json' with { type: 'json' }
412
414
  return fileURLToPath(new URL(relativePath, import.meta.url))
413
415
  }
414
416
 
417
+ const peerDependencies = 'peerDependencies' in manifest ? manifest.peerDependencies : undefined
418
+ if (
419
+ peerDependencies !== undefined &&
420
+ (typeof peerDependencies !== 'object' ||
421
+ peerDependencies === null ||
422
+ Array.isArray(peerDependencies))
423
+ ) {
424
+ throw new Error('package peerDependencies must be an object')
425
+ }
426
+ export const peers: readonly string[] =
427
+ peerDependencies === undefined ? [] : Object.keys(peerDependencies)
428
+
415
429
  const resolve = {
416
430
  alias: Object.entries(tsconfig.compilerOptions.paths).reduce((aliases, [key, values]) => {
417
431
  const [path] = values
@@ -539,7 +553,13 @@ const resolve = {
539
553
  },
540
554
  outDir: 'dist/bin',
541
555
  target: 'node22',
542
- rolldownOptions: { external: [/^node:/, /^@orkestrel\\//, /^@src\\//] },
556
+ rolldownOptions: {
557
+ external: (id: string) =>
558
+ id.startsWith('node:') ||
559
+ id.startsWith('@orkestrel/') ||
560
+ id.startsWith('@src/') ||
561
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),
562
+ },
543
563
  },
544
564
  test: {
545
565
  name: { label: 'src:bin', color: 'yellow' },
@@ -660,6 +680,24 @@ export function appBrowser(): UserConfig {
660
680
  setupFiles: ['./tests/setup.ts'],
661
681
  environment: 'node',
662
682
  browser: { enabled: false },
683
+ // A config test validates every target wrapper and runs the real linter twice with
684
+ // 15-second child caps, so this budget clears both caps and reports their diagnostics.
685
+ testTimeout: 45_000,
686
+ },
687
+ },
688
+ options ?? {},
689
+ )
690
+ `,
691
+ setup: `export const setup = (options?: UserConfig): UserConfig =>
692
+ mergeConfig(
693
+ {
694
+ resolve,
695
+ test: {
696
+ name: { label: 'setup', color: 'white' },
697
+ include: ['tests/setup*.test.ts'],
698
+ setupFiles: ['./tests/setup.ts'],
699
+ environment: 'node',
700
+ browser: { enabled: false },
663
701
  },
664
702
  },
665
703
  options ?? {},
@@ -895,7 +933,7 @@ export const probe = (options?: UserConfig): UserConfig =>
895
933
  core: `import { defineConfig } from 'vite'
896
934
  import dts from 'vite-plugin-dts'
897
935
  import { environmentBoundary, outputBoundary } from '../helpers.js'
898
- import { srcCore, resolveWorkspacePath } from '../../vite.config.ts'
936
+ import { peers, srcCore, resolveWorkspacePath } from '../../vite.config.ts'
899
937
 
900
938
  export default defineConfig(
901
939
  srcCore({
@@ -923,7 +961,12 @@ export default defineConfig(
923
961
  fileName: (format) => (format === 'es' ? 'index.js' : 'index.cjs'),
924
962
  },
925
963
  outDir: 'dist/src/core',
926
- rolldownOptions: { external: [/^node:/, /^@orkestrel\\//] },
964
+ rolldownOptions: {
965
+ external: (id: string) =>
966
+ id.startsWith('node:') ||
967
+ id.startsWith('@orkestrel/') ||
968
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),
969
+ },
927
970
  },
928
971
  }),
929
972
  )
@@ -1716,6 +1759,7 @@ var isBlueprint = (0, _orkestrel_contract.recordOf)({
1716
1759
  engines: _orkestrel_contract.isString,
1717
1760
  overrides: (0, _orkestrel_contract.andOf)(isCollection, (0, _orkestrel_contract.arrayOf)(isOverride)),
1718
1761
  bin: _orkestrel_contract.isBoolean,
1762
+ setup: _orkestrel_contract.isBoolean,
1719
1763
  guides: _orkestrel_contract.isBoolean,
1720
1764
  distribution: _orkestrel_contract.isBoolean,
1721
1765
  integration: _orkestrel_contract.isBoolean,
@@ -3079,6 +3123,7 @@ function blueprintToScripts(blueprint) {
3079
3123
  ...blueprint.app.length > 0 ? ["npm run test:app"] : [],
3080
3124
  "npm run test:policy",
3081
3125
  "npm run test:config",
3126
+ ...blueprint.setup ? ["npm run test:setup"] : [],
3082
3127
  ...blueprint.guides ? ["npm run test:guides"] : [],
3083
3128
  ...blueprint.conformance ? ["npm run test:conformance"] : [],
3084
3129
  ...integrates ? ["npm run test:integration"] : [],
@@ -3099,6 +3144,7 @@ function blueprintToScripts(blueprint) {
3099
3144
  }
3100
3145
  scripts["test:policy"] = `${vitest} --project policy`;
3101
3146
  scripts["test:config"] = `${vitest} --project config`;
3147
+ if (blueprint.setup) scripts["test:setup"] = `${vitest} --project setup`;
3102
3148
  if (blueprint.guides) scripts["test:guides"] = `${vitest} --project guides`;
3103
3149
  if (blueprint.conformance) scripts["test:conformance"] = `${vitest} --project conformance`;
3104
3150
  scripts["test:probe"] = "vitest run --config vite.config.ts --no-cache --reporter=verbose --project probe";
@@ -3322,7 +3368,12 @@ function blueprintToRootVite(blueprint) {
3322
3368
  if (blueprint.src.includes("browser")) {
3323
3369
  const core = blueprint.src.includes("core");
3324
3370
  factories.push((0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.src.browser, {
3325
- external: core ? "external: (id: string) => id === '@src/core' || id.startsWith('@orkestrel/')," : "external: (id: string) => id.startsWith('@orkestrel/'),",
3371
+ external: core ? `external: (id: string) =>
3372
+ id === '@src/core' ||
3373
+ id.startsWith('@orkestrel/') ||
3374
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),` : `external: (id: string) =>
3375
+ id.startsWith('@orkestrel/') ||
3376
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),`,
3326
3377
  output: core ? " output: { paths: { '@src/core': '../core/index.js' } }," : " output: {},",
3327
3378
  exclude: core ? " exclude: ['tests/src/core/**/*.test.ts'],\n" : "",
3328
3379
  global: blueprint.global ? " globalSetup: ['./tests/setupGlobal.ts'],\n" : ""
@@ -3333,7 +3384,13 @@ function blueprintToRootVite(blueprint) {
3333
3384
  const core = blueprint.src.includes("core");
3334
3385
  factories.push((0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.src.server, {
3335
3386
  external: core ? `external: (id: string) =>
3336
- id === '@src/core' || id.startsWith('node:') || id.startsWith('@orkestrel/'),` : "external: (id: string) => id.startsWith('node:') || id.startsWith('@orkestrel/'),",
3387
+ id === '@src/core' ||
3388
+ id.startsWith('node:') ||
3389
+ id.startsWith('@orkestrel/') ||
3390
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),` : `external: (id: string) =>
3391
+ id.startsWith('node:') ||
3392
+ id.startsWith('@orkestrel/') ||
3393
+ peers.some((peer) => id === peer || id.startsWith(peer + '/')),`,
3337
3394
  output: core ? `\t\t\t\t\toutput: [
3338
3395
  {
3339
3396
  format: 'es',
@@ -3420,6 +3477,10 @@ export function appShowcase(): UserConfig {
3420
3477
  projects.push("policy");
3421
3478
  factories.push(CONFIG_TEMPLATES.factories.config);
3422
3479
  projects.push("config");
3480
+ if (blueprint.setup) {
3481
+ factories.push(CONFIG_TEMPLATES.factories.setup);
3482
+ projects.push("setup");
3483
+ }
3423
3484
  if (blueprint.guides) {
3424
3485
  factories.push(CONFIG_TEMPLATES.factories.guides);
3425
3486
  projects.push("guides");
@@ -4742,6 +4803,7 @@ function createBlueprint(name, input) {
4742
4803
  engines: input?.engines ?? DEFAULT_ENGINES,
4743
4804
  overrides: input?.overrides ?? [],
4744
4805
  bin: input?.bin ?? false,
4806
+ setup: input?.setup ?? false,
4745
4807
  guides: input?.guides ?? false,
4746
4808
  distribution: input?.distribution ?? false,
4747
4809
  integration: input?.integration ?? false,