@contractspec/bundle.workspace 1.52.0 → 1.53.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.
- package/dist/adapters/ai.d.mts +2 -2
- package/dist/adapters/ai.d.mts.map +1 -1
- package/dist/adapters/ai.mjs.map +1 -1
- package/dist/adapters/factory.d.mts +2 -2
- package/dist/adapters/factory.d.mts.map +1 -1
- package/dist/adapters/factory.mjs +3 -14
- package/dist/adapters/factory.mjs.map +1 -1
- package/dist/adapters/fs.bun.d.mts +11 -0
- package/dist/adapters/fs.bun.d.mts.map +1 -0
- package/dist/adapters/fs.bun.mjs +81 -0
- package/dist/adapters/fs.bun.mjs.map +1 -0
- package/dist/adapters/fs.d.mts +2 -8
- package/dist/adapters/fs.d.mts.map +1 -1
- package/dist/adapters/fs.mjs +4 -88
- package/dist/adapters/fs.mjs.map +1 -1
- package/dist/adapters/fs.node.d.mts +11 -0
- package/dist/adapters/fs.node.d.mts.map +1 -0
- package/dist/adapters/fs.node.mjs +84 -0
- package/dist/adapters/fs.node.mjs.map +1 -0
- package/dist/adapters/index.d.mts +3 -1
- package/dist/adapters/index.mjs +3 -1
- package/dist/ai/agents/index.d.mts +6 -0
- package/dist/ai/agents/orchestrator.d.mts +4 -4
- package/dist/ai/agents/orchestrator.d.mts.map +1 -1
- package/dist/ai/agents/orchestrator.mjs +5 -0
- package/dist/ai/agents/orchestrator.mjs.map +1 -1
- package/dist/ai/agents/simple-agent.d.mts +2 -2
- package/dist/ai/agents/simple-agent.d.mts.map +1 -1
- package/dist/ai/agents/simple-agent.mjs.map +1 -1
- package/dist/ai/agents/types.d.mts +4 -5
- package/dist/ai/agents/types.d.mts.map +1 -1
- package/dist/ai/agents/unified-adapter.mjs +70 -0
- package/dist/ai/agents/unified-adapter.mjs.map +1 -0
- package/dist/ai/index.d.mts +3 -3
- package/dist/ai/index.mjs +1 -2
- package/dist/ai/prompts/spec-creation.mjs +1 -1
- package/dist/ai/providers.d.mts +3 -18
- package/dist/ai/providers.d.mts.map +1 -1
- package/dist/ai/providers.mjs +2 -22
- package/dist/ai/providers.mjs.map +1 -1
- package/dist/index.d.mts +13 -8
- package/dist/index.mjs +11 -7
- package/dist/ports/ai.d.mts +7 -3
- package/dist/ports/ai.d.mts.map +1 -1
- package/dist/ports/index.d.mts +1 -1
- package/dist/registry.d.mts +15 -0
- package/dist/registry.d.mts.map +1 -0
- package/dist/registry.mjs +19 -0
- package/dist/registry.mjs.map +1 -0
- package/dist/services/action-drift/service.d.mts +11 -0
- package/dist/services/action-drift/service.d.mts.map +1 -0
- package/dist/services/action-drift/service.mjs +43 -0
- package/dist/services/action-drift/service.mjs.map +1 -0
- package/dist/services/action-drift/types.d.mts +23 -0
- package/dist/services/action-drift/types.d.mts.map +1 -0
- package/dist/services/action-pr/service.d.mts +17 -0
- package/dist/services/action-pr/service.d.mts.map +1 -0
- package/dist/services/action-pr/service.mjs +205 -0
- package/dist/services/action-pr/service.mjs.map +1 -0
- package/dist/services/action-pr/types.d.mts +67 -0
- package/dist/services/action-pr/types.d.mts.map +1 -0
- package/dist/services/build.d.mts +3 -2
- package/dist/services/build.d.mts.map +1 -1
- package/dist/services/build.mjs.map +1 -1
- package/dist/services/ci-check/checks/coverage.mjs +30 -41
- package/dist/services/ci-check/checks/coverage.mjs.map +1 -1
- package/dist/services/ci-check/checks/handlers.mjs +3 -3
- package/dist/services/ci-check/checks/handlers.mjs.map +1 -1
- package/dist/services/ci-check/checks/implementation.mjs +1 -1
- package/dist/services/ci-check/checks/implementation.mjs.map +1 -1
- package/dist/services/ci-check/checks/structure.mjs +5 -6
- package/dist/services/ci-check/checks/structure.mjs.map +1 -1
- package/dist/services/ci-check/checks/test-refs.mjs +19 -29
- package/dist/services/ci-check/checks/test-refs.mjs.map +1 -1
- package/dist/services/ci-check/checks/tests.mjs +3 -3
- package/dist/services/ci-check/checks/tests.mjs.map +1 -1
- package/dist/services/ci-check/ci-check-service.d.mts.map +1 -1
- package/dist/services/ci-check/ci-check-service.mjs +7 -12
- package/dist/services/ci-check/ci-check-service.mjs.map +1 -1
- package/dist/services/config.d.mts +3 -3
- package/dist/services/config.d.mts.map +1 -1
- package/dist/services/config.mjs +12 -34
- package/dist/services/config.mjs.map +1 -1
- package/dist/services/create/ai-generator.d.mts +3 -3
- package/dist/services/create/ai-generator.d.mts.map +1 -1
- package/dist/services/create/ai-generator.mjs +1 -1
- package/dist/services/create/ai-generator.mjs.map +1 -1
- package/dist/services/create/index.d.mts +4 -4
- package/dist/services/create/index.d.mts.map +1 -1
- package/dist/services/create/index.mjs.map +1 -1
- package/dist/services/docs/docs-service.mjs +16 -13
- package/dist/services/docs/docs-service.mjs.map +1 -1
- package/dist/services/extract.mjs +2 -10
- package/dist/services/extract.mjs.map +1 -1
- package/dist/services/implementation/discovery.d.mts.map +1 -1
- package/dist/services/implementation/discovery.mjs +6 -14
- package/dist/services/implementation/discovery.mjs.map +1 -1
- package/dist/services/implementation/index.d.mts +1 -1
- package/dist/services/implementation/index.mjs +1 -1
- package/dist/services/implementation/resolver/index.d.mts +8 -6
- package/dist/services/implementation/resolver/index.d.mts.map +1 -1
- package/dist/services/implementation/resolver/index.mjs +33 -31
- package/dist/services/implementation/resolver/index.mjs.map +1 -1
- package/dist/services/implementation/resolver/parsers.d.mts +1 -5
- package/dist/services/implementation/resolver/parsers.d.mts.map +1 -1
- package/dist/services/implementation/resolver/parsers.mjs +1 -19
- package/dist/services/implementation/resolver/parsers.mjs.map +1 -1
- package/dist/services/implementation/types.d.mts +3 -1
- package/dist/services/implementation/types.d.mts.map +1 -1
- package/dist/services/index.d.mts +5 -1
- package/dist/services/index.mjs +4 -2
- package/dist/services/list.d.mts +4 -3
- package/dist/services/list.d.mts.map +1 -1
- package/dist/services/list.mjs +4 -2
- package/dist/services/list.mjs.map +1 -1
- package/dist/services/sync.d.mts +2 -2
- package/dist/services/sync.d.mts.map +1 -1
- package/dist/services/sync.mjs.map +1 -1
- package/dist/services/test/test-generator-service.d.mts +1 -1
- package/dist/services/test/test-service.mjs +1 -1
- package/dist/services/validate/blueprint-validator.mjs +1 -1
- package/dist/services/validate/implementation-agent-validator.d.mts +2 -2
- package/dist/services/validate/implementation-agent-validator.d.mts.map +1 -1
- package/dist/services/validate/implementation-agent-validator.mjs.map +1 -1
- package/dist/services/validate/implementation-validator.d.mts +4 -3
- package/dist/services/validate/implementation-validator.d.mts.map +1 -1
- package/dist/services/validate/implementation-validator.mjs +4 -13
- package/dist/services/validate/implementation-validator.mjs.map +1 -1
- package/dist/services/validate/spec-validator.d.mts +1 -1
- package/dist/services/validate/spec-validator.d.mts.map +1 -1
- package/dist/services/validate/spec-validator.mjs +11 -7
- package/dist/services/validate/spec-validator.mjs.map +1 -1
- package/dist/services/validate/tenant-validator.mjs +1 -1
- package/dist/services/watch.d.mts +2 -2
- package/dist/services/watch.d.mts.map +1 -1
- package/dist/services/watch.mjs.map +1 -1
- package/dist/utils/filter.d.mts +10 -1
- package/dist/utils/filter.d.mts.map +1 -1
- package/dist/utils/filter.mjs +28 -1
- package/dist/utils/filter.mjs.map +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +2 -1
- package/package.json +11 -9
- package/dist/ai/client.d.mts +0 -97
- package/dist/ai/client.d.mts.map +0 -1
- package/dist/ai/client.mjs +0 -189
- package/dist/ai/client.mjs.map +0 -1
- package/dist/types/config.d.mts +0 -34
- package/dist/types/config.d.mts.map +0 -1
package/dist/services/list.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isTestFile } from "../utils/filter.mjs";
|
|
1
|
+
import { isLibraryDefinitionFile, isTestFile } from "../utils/filter.mjs";
|
|
2
2
|
import "../utils/index.mjs";
|
|
3
3
|
import { scanSpecSource } from "@contractspec/module.workspace";
|
|
4
4
|
import micromatch from "micromatch";
|
|
@@ -15,14 +15,16 @@ async function listSpecs(adapters, options = {}) {
|
|
|
15
15
|
const pattern = options.pattern;
|
|
16
16
|
const files = await fs.glob({ pattern });
|
|
17
17
|
const results = [];
|
|
18
|
+
const specTypesToSearch = Array.isArray(options.type) ? options.type : [options.type];
|
|
18
19
|
for (const file of files) {
|
|
19
20
|
if (file.includes("node_modules") || file.includes("/dist/")) continue;
|
|
20
21
|
if (options.config?.excludePackages && micromatch.isMatch(file, options.config.excludePackages, { contains: true })) continue;
|
|
21
22
|
if (isTestFile(file, options.config)) continue;
|
|
23
|
+
if (isLibraryDefinitionFile(file)) continue;
|
|
22
24
|
try {
|
|
23
25
|
const result = scan(await fs.readFile(file), file);
|
|
24
26
|
if (result.specType === "unknown") continue;
|
|
25
|
-
if (options.type && result.specType
|
|
27
|
+
if (options.type && !specTypesToSearch.includes(result.specType)) continue;
|
|
26
28
|
results.push(result);
|
|
27
29
|
} catch {}
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","names":[],"sources":["../../src/services/list.ts"],"sourcesContent":["/**\n * List specs service.\n */\n\nimport {\n scanSpecSource,\n type SpecScanResult,\n} from '@contractspec/module.workspace';\nimport type { FsAdapter } from '../ports/fs';\nimport type {
|
|
1
|
+
{"version":3,"file":"list.mjs","names":[],"sources":["../../src/services/list.ts"],"sourcesContent":["/**\n * List specs service.\n */\n\nimport {\n scanSpecSource,\n type SpecScanResult,\n} from '@contractspec/module.workspace';\nimport type { FsAdapter } from '../ports/fs';\nimport micromatch from 'micromatch';\nimport { isLibraryDefinitionFile, isTestFile } from '../utils';\nimport type { MaybeArray } from '@contractspec/lib.utils-typescript';\nimport type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts';\n\n/**\n * Options for listing specs.\n */\nexport interface ListSpecsOptions {\n /**\n * File pattern to search.\n */\n pattern?: string;\n\n /**\n * Filter by spec type.\n */\n type?: MaybeArray<string>;\n\n /**\n * Workspace configuration\n */\n config?: ResolvedContractsrcConfig;\n}\n\n/**\n * List all spec files in the workspace.\n */\nexport async function listSpecs(\n adapters: { fs: FsAdapter; scan?: typeof scanSpecSource },\n options: ListSpecsOptions = {}\n): Promise<SpecScanResult[]> {\n const { fs, scan = scanSpecSource } = adapters;\n\n // Use pattern if provided, otherwise let fs.glob use its defaults (DEFAULT_SPEC_PATTERNS)\n // This aligns listSpecs behavior with the CI command behavior\n const pattern = options.pattern;\n const files = await fs.glob({ pattern });\n const results: SpecScanResult[] = [];\n const specTypesToSearch = Array.isArray(options.type)\n ? options.type\n : [options.type];\n\n for (const file of files) {\n // Skip node_modules and dist\n if (file.includes('node_modules') || file.includes('/dist/')) {\n continue;\n }\n\n // If excluding packages via config\n if (\n options.config?.excludePackages &&\n micromatch.isMatch(file, options.config.excludePackages, {\n contains: true,\n })\n ) {\n continue;\n }\n\n // Exclude test files\n if (isTestFile(file, options.config)) {\n continue;\n }\n\n // Exclude library definition files (files that define spec functions)\n if (isLibraryDefinitionFile(file)) {\n continue;\n }\n\n try {\n const content = await fs.readFile(file);\n const result = scan(content, file);\n\n if (result.specType === 'unknown') {\n continue;\n }\n\n if (options.type && !specTypesToSearch.includes(result.specType)) {\n continue;\n }\n\n results.push(result);\n } catch {\n // Ignore read errors\n }\n }\n\n return results;\n}\n\n/**\n * Group specs by type.\n */\nexport function groupSpecsByType(\n specs: SpecScanResult[]\n): Map<string, SpecScanResult[]> {\n const groups = new Map<string, SpecScanResult[]>();\n\n for (const spec of specs) {\n const group = groups.get(spec.specType) ?? [];\n group.push(spec);\n groups.set(spec.specType, group);\n }\n\n return groups;\n}\n"],"mappings":";;;;;;;;;;;;AAqCA,eAAsB,UACpB,UACA,UAA4B,EAAE,EACH;CAC3B,MAAM,EAAE,IAAI,OAAO,mBAAmB;CAItC,MAAM,UAAU,QAAQ;CACxB,MAAM,QAAQ,MAAM,GAAG,KAAK,EAAE,SAAS,CAAC;CACxC,MAAM,UAA4B,EAAE;CACpC,MAAM,oBAAoB,MAAM,QAAQ,QAAQ,KAAK,GACjD,QAAQ,OACR,CAAC,QAAQ,KAAK;AAElB,MAAK,MAAM,QAAQ,OAAO;AAExB,MAAI,KAAK,SAAS,eAAe,IAAI,KAAK,SAAS,SAAS,CAC1D;AAIF,MACE,QAAQ,QAAQ,mBAChB,WAAW,QAAQ,MAAM,QAAQ,OAAO,iBAAiB,EACvD,UAAU,MACX,CAAC,CAEF;AAIF,MAAI,WAAW,MAAM,QAAQ,OAAO,CAClC;AAIF,MAAI,wBAAwB,KAAK,CAC/B;AAGF,MAAI;GAEF,MAAM,SAAS,KADC,MAAM,GAAG,SAAS,KAAK,EACV,KAAK;AAElC,OAAI,OAAO,aAAa,UACtB;AAGF,OAAI,QAAQ,QAAQ,CAAC,kBAAkB,SAAS,OAAO,SAAS,CAC9D;AAGF,WAAQ,KAAK,OAAO;UACd;;AAKV,QAAO;;;;;AAMT,SAAgB,iBACd,OAC+B;CAC/B,MAAM,yBAAS,IAAI,KAA+B;AAElD,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,QAAQ,OAAO,IAAI,KAAK,SAAS,IAAI,EAAE;AAC7C,QAAM,KAAK,KAAK;AAChB,SAAO,IAAI,KAAK,UAAU,MAAM;;AAGlC,QAAO"}
|
package/dist/services/sync.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { LoggerAdapter } from "../ports/logger.mjs";
|
|
|
3
3
|
import { ValidateSpecResult } from "./validate/spec-validator.mjs";
|
|
4
4
|
import "./validate/index.mjs";
|
|
5
5
|
import { BuildSpecOptions } from "./build.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { ResolvedContractsrcConfig } from "@contractspec/lib.contracts";
|
|
7
7
|
|
|
8
8
|
//#region src/services/sync.d.ts
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ type SyncValidateFn = (specPath: string) => Promise<ValidateSpecResult>;
|
|
|
33
33
|
declare function syncSpecs(adapters: {
|
|
34
34
|
fs: FsAdapter;
|
|
35
35
|
logger: LoggerAdapter;
|
|
36
|
-
}, config:
|
|
36
|
+
}, config: ResolvedContractsrcConfig, options?: SyncSpecsOptions, overrides?: {
|
|
37
37
|
build?: SyncBuildFn<unknown>;
|
|
38
38
|
validate?: SyncValidateFn;
|
|
39
39
|
}): Promise<SyncSpecsResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.mts","names":[],"sources":["../../src/services/sync.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCY,UAxBK,gBAAA,CA2BJ;EAED,OAAA,CAAA,EAAA,MAAA;EAEU,UAAA,CAAA,EAAS,CAAA,MAAA,GAAA,SAAA,CAAA,EAAA;EACb,QAAA,CAAA,EAAA,OAAA;EAAmB,YAAA,CAAA,EA5BpB,IA4BoB,CA5Bf,gBA4Be,EAAA,WAAA,CAAA;EAC3B,MAAA,CAAA,EAAA,OAAA;;AAGE,UA5BK,kBAAA,CA4BL;EACG,QAAA,EAAA,MAAA;EAEJ,SAAA,CAAA,EAAA,MAAA;EAAR,UAAA,CAAA,EA5BY,kBA4BZ;EAAO,KAAA,CAAA,EAAA,OAAA;;;;;;UApBO,eAAA;;QAET;;KAGI,sEAGP,QAAQ;KAED,cAAA,yBAAuC,QAAQ;iBAErC,SAAA;MACJ;UAAmB;WAC3B,
|
|
1
|
+
{"version":3,"file":"sync.d.mts","names":[],"sources":["../../src/services/sync.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCY,UAxBK,gBAAA,CA2BJ;EAED,OAAA,CAAA,EAAA,MAAA;EAEU,UAAA,CAAA,EAAS,CAAA,MAAA,GAAA,SAAA,CAAA,EAAA;EACb,QAAA,CAAA,EAAA,OAAA;EAAmB,YAAA,CAAA,EA5BpB,IA4BoB,CA5Bf,gBA4Be,EAAA,WAAA,CAAA;EAC3B,MAAA,CAAA,EAAA,OAAA;;AAGE,UA5BK,kBAAA,CA4BL;EACG,QAAA,EAAA,MAAA;EAEJ,SAAA,CAAA,EAAA,MAAA;EAAR,UAAA,CAAA,EA5BY,kBA4BZ;EAAO,KAAA,CAAA,EAAA,OAAA;;;;;;UApBO,eAAA;;QAET;;KAGI,sEAGP,QAAQ;KAED,cAAA,yBAAuC,QAAQ;iBAErC,SAAA;MACJ;UAAmB;WAC3B,qCACC;UAEC;aACG;IAEZ,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.mjs","names":[],"sources":["../../src/services/sync.ts"],"sourcesContent":["/**\n * Sync service.\n *\n * Build (and optionally validate) all discovered specs, optionally repeating into\n * multiple output buckets (./generated/<bucket>/ or any output dir).\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"sync.mjs","names":[],"sources":["../../src/services/sync.ts"],"sourcesContent":["/**\n * Sync service.\n *\n * Build (and optionally validate) all discovered specs, optionally repeating into\n * multiple output buckets (./generated/<bucket>/ or any output dir).\n */\n\nimport type { FsAdapter } from '../ports/fs';\nimport type { LoggerAdapter } from '../ports/logger';\nimport { buildSpec, type BuildSpecOptions } from './build';\nimport { validateSpec, type ValidateSpecResult } from './validate';\nimport type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts';\n\nexport interface SyncSpecsOptions {\n pattern?: string;\n outputDirs?: (string | undefined)[];\n validate?: boolean;\n buildOptions?: Omit<BuildSpecOptions, 'outputDir'>;\n dryRun?: boolean;\n}\n\nexport interface SyncSpecsRunResult {\n specPath: string;\n outputDir?: string;\n validation?: ValidateSpecResult;\n build?: unknown;\n error?: {\n phase: 'validate' | 'build';\n message: string;\n };\n}\n\nexport interface SyncSpecsResult {\n specs: string[];\n runs: SyncSpecsRunResult[];\n}\n\nexport type SyncBuildFn<B> = (\n specPath: string,\n outputDir: string | undefined\n) => Promise<B>;\n\nexport type SyncValidateFn = (specPath: string) => Promise<ValidateSpecResult>;\n\nexport async function syncSpecs(\n adapters: { fs: FsAdapter; logger: LoggerAdapter },\n config: ResolvedContractsrcConfig,\n options: SyncSpecsOptions = {},\n overrides?: {\n build?: SyncBuildFn<unknown>;\n validate?: SyncValidateFn;\n }\n): Promise<SyncSpecsResult> {\n const { fs, logger } = adapters;\n\n const specs = await fs.glob({ pattern: options.pattern });\n const outputDirs = options.outputDirs?.length\n ? options.outputDirs\n : [undefined];\n\n const runs: SyncSpecsRunResult[] = [];\n\n const validateFn: SyncValidateFn =\n overrides?.validate ??\n ((specPath) => validateSpec(specPath, { fs, logger }));\n\n const buildFn: SyncBuildFn<unknown> =\n overrides?.build ??\n ((specPath, outputDir) =>\n buildSpec(\n specPath,\n { fs, logger },\n outputDir ? { ...config, outputDir } : config,\n { ...(options.buildOptions ?? {}), outputDir }\n ));\n\n for (const specPath of specs) {\n for (const outputDir of outputDirs) {\n const run: SyncSpecsRunResult = { specPath, outputDir };\n\n if (options.validate) {\n try {\n run.validation = await validateFn(specPath);\n } catch (error) {\n run.error = {\n phase: 'validate',\n message: error instanceof Error ? error.message : String(error),\n };\n runs.push(run);\n continue;\n }\n }\n\n if (!options.dryRun) {\n try {\n run.build = await buildFn(specPath, outputDir);\n } catch (error) {\n run.error = {\n phase: 'build',\n message: error instanceof Error ? error.message : String(error),\n };\n runs.push(run);\n continue;\n }\n } else {\n logger.info('[dry-run] syncSpecs skipped build', {\n specPath,\n outputDir,\n });\n }\n\n runs.push(run);\n }\n }\n\n return { specs, runs };\n}\n"],"mappings":";;;;;AA4CA,eAAsB,UACpB,UACA,QACA,UAA4B,EAAE,EAC9B,WAI0B;CAC1B,MAAM,EAAE,IAAI,WAAW;CAEvB,MAAM,QAAQ,MAAM,GAAG,KAAK,EAAE,SAAS,QAAQ,SAAS,CAAC;CACzD,MAAM,aAAa,QAAQ,YAAY,SACnC,QAAQ,aACR,CAAC,OAAU;CAEf,MAAM,OAA6B,EAAE;CAErC,MAAM,aACJ,WAAW,cACT,aAAa,aAAa,UAAU;EAAE;EAAI;EAAQ,CAAC;CAEvD,MAAM,UACJ,WAAW,WACT,UAAU,cACV,UACE,UACA;EAAE;EAAI;EAAQ,EACd,YAAY;EAAE,GAAG;EAAQ;EAAW,GAAG,QACvC;EAAE,GAAI,QAAQ,gBAAgB,EAAE;EAAG;EAAW,CAC/C;AAEL,MAAK,MAAM,YAAY,MACrB,MAAK,MAAM,aAAa,YAAY;EAClC,MAAM,MAA0B;GAAE;GAAU;GAAW;AAEvD,MAAI,QAAQ,SACV,KAAI;AACF,OAAI,aAAa,MAAM,WAAW,SAAS;WACpC,OAAO;AACd,OAAI,QAAQ;IACV,OAAO;IACP,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IAChE;AACD,QAAK,KAAK,IAAI;AACd;;AAIJ,MAAI,CAAC,QAAQ,OACX,KAAI;AACF,OAAI,QAAQ,MAAM,QAAQ,UAAU,UAAU;WACvC,OAAO;AACd,OAAI,QAAQ;IACV,OAAO;IACP,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IAChE;AACD,QAAK,KAAK,IAAI;AACd;;MAGF,QAAO,KAAK,qCAAqC;GAC/C;GACA;GACD,CAAC;AAGJ,OAAK,KAAK,IAAI;;AAIlB,QAAO;EAAE;EAAO;EAAM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LoggerAdapter } from "../../ports/logger.mjs";
|
|
2
2
|
import { OperationSpec } from "@contractspec/lib.contracts";
|
|
3
|
-
import { TestSpec } from "@contractspec/lib.contracts/tests";
|
|
4
3
|
import { LanguageModel } from "@contractspec/lib.ai-agent";
|
|
4
|
+
import { TestSpec } from "@contractspec/lib.contracts/tests";
|
|
5
5
|
|
|
6
6
|
//#region src/services/test/test-generator-service.d.ts
|
|
7
7
|
interface TestGeneratorOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { loadTypeScriptModule } from "../../utils/module-loader.mjs";
|
|
2
|
-
import { resolve } from "path";
|
|
3
2
|
import { OperationSpecRegistry } from "@contractspec/lib.contracts";
|
|
3
|
+
import { resolve } from "path";
|
|
4
4
|
import { TestRunner } from "@contractspec/lib.contracts/tests";
|
|
5
5
|
|
|
6
6
|
//#region src/services/test/test-service.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { validateBlueprint } from "@contractspec/lib.contracts";
|
|
1
2
|
import { resolve } from "path";
|
|
2
3
|
import { pathToFileURL } from "url";
|
|
3
|
-
import { validateBlueprint } from "@contractspec/lib.contracts";
|
|
4
4
|
|
|
5
5
|
//#region src/services/validate/blueprint-validator.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FsAdapter } from "../../ports/fs.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { ResolvedContractsrcConfig } from "@contractspec/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/services/validate/implementation-agent-validator.d.ts
|
|
5
5
|
interface ImplementationValidatorOptions {
|
|
@@ -12,7 +12,7 @@ interface ImplementationValidationResult {
|
|
|
12
12
|
suggestions: string[];
|
|
13
13
|
report?: string;
|
|
14
14
|
}
|
|
15
|
-
declare function validateImplementationWithAgent(specFile: string, specCode: string, config:
|
|
15
|
+
declare function validateImplementationWithAgent(specFile: string, specCode: string, config: ResolvedContractsrcConfig, options: ImplementationValidatorOptions, adapters: {
|
|
16
16
|
fs: FsAdapter;
|
|
17
17
|
}): Promise<ImplementationValidationResult>;
|
|
18
18
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-agent-validator.d.mts","names":[],"sources":["../../../src/services/validate/implementation-agent-validator.ts"],"sourcesContent":[],"mappings":";;;;UAKiB,8BAAA;;AAAjB;AAIiB,UAAA,8BAAA,CAA8B;EAQzB,OAAA,EAAA,OAAA;EAGZ,MAAA,EAAA,MAAA,EAAA;EACC,QAAA,EAAA,MAAA,EAAA;EACO,WAAA,EAAA,MAAA,EAAA;EACP,MAAA,CAAA,EAAA,MAAA;;AAAD,iBANY,+BAAA,CAMZ,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAHA,
|
|
1
|
+
{"version":3,"file":"implementation-agent-validator.d.mts","names":[],"sources":["../../../src/services/validate/implementation-agent-validator.ts"],"sourcesContent":[],"mappings":";;;;UAKiB,8BAAA;;AAAjB;AAIiB,UAAA,8BAAA,CAA8B;EAQzB,OAAA,EAAA,OAAA;EAGZ,MAAA,EAAA,MAAA,EAAA;EACC,QAAA,EAAA,MAAA,EAAA;EACO,WAAA,EAAA,MAAA,EAAA;EACP,MAAA,CAAA,EAAA,MAAA;;AAAD,iBANY,+BAAA,CAMZ,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAHA,yBAGA,EAAA,OAAA,EAFC,8BAED,EAAA,QAAA,EAAA;MADQ;IACf,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-agent-validator.mjs","names":["path"],"sources":["../../../src/services/validate/implementation-agent-validator.ts"],"sourcesContent":["import type { FsAdapter } from '../../ports/fs';\nimport {
|
|
1
|
+
{"version":3,"file":"implementation-agent-validator.mjs","names":["path"],"sources":["../../../src/services/validate/implementation-agent-validator.ts"],"sourcesContent":["import type { FsAdapter } from '../../ports/fs';\nimport { basename, dirname, join } from 'path';\nimport { AgentOrchestrator } from '../../ai/agents/orchestrator';\nimport type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts';\n\nexport interface ImplementationValidatorOptions {\n implementationPath?: string;\n}\n\nexport interface ImplementationValidationResult {\n success: boolean;\n errors: string[];\n warnings: string[];\n suggestions: string[];\n report?: string;\n}\n\nexport async function validateImplementationWithAgent(\n specFile: string,\n specCode: string,\n config: ResolvedContractsrcConfig,\n options: ImplementationValidatorOptions,\n adapters: { fs: FsAdapter }\n): Promise<ImplementationValidationResult> {\n const { fs } = adapters;\n\n // Find implementation file\n let implementationPath = options.implementationPath;\n\n if (!implementationPath) {\n // Try to infer from spec file path\n const specDir = dirname(specFile);\n const specBaseName = basename(specFile, '.ts');\n\n // Try common patterns\n const possiblePaths = [\n join(specDir, specBaseName.replace('.contracts', '.handler') + '.ts'),\n join(specDir, specBaseName.replace('.presentation', '') + '.tsx'),\n join(specDir, specBaseName.replace('.form', '.form') + '.tsx'),\n join(\n dirname(specDir),\n 'handlers',\n specBaseName.replace('.contracts', '.handler') + '.ts'\n ),\n join(\n dirname(specDir),\n 'components',\n specBaseName.replace('.presentation', '') + '.tsx'\n ),\n ];\n\n for (const path of possiblePaths) {\n if (await fs.exists(path)) {\n implementationPath = path;\n break;\n }\n }\n }\n\n if (!implementationPath || !(await fs.exists(implementationPath))) {\n return {\n success: true, // Not an error if file not found, just nothing to validate\n errors: [],\n warnings: [\n 'Implementation file not found. Specify with --implementation-path',\n ],\n suggestions: [],\n };\n }\n\n const implementationCode = await fs.readFile(implementationPath);\n\n // Use agent orchestrator to validate\n const orchestrator = new AgentOrchestrator(config);\n const result = await orchestrator.validate(specCode, implementationCode);\n\n return {\n success: result.success,\n errors: result.errors || [],\n warnings: result.warnings || [],\n suggestions: result.suggestions || [],\n report: result.code,\n };\n}\n"],"mappings":";;;;AAiBA,eAAsB,gCACpB,UACA,UACA,QACA,SACA,UACyC;CACzC,MAAM,EAAE,OAAO;CAGf,IAAI,qBAAqB,QAAQ;AAEjC,KAAI,CAAC,oBAAoB;EAEvB,MAAM,UAAU,QAAQ,SAAS;EACjC,MAAM,eAAe,SAAS,UAAU,MAAM;EAG9C,MAAM,gBAAgB;GACpB,KAAK,SAAS,aAAa,QAAQ,cAAc,WAAW,GAAG,MAAM;GACrE,KAAK,SAAS,aAAa,QAAQ,iBAAiB,GAAG,GAAG,OAAO;GACjE,KAAK,SAAS,aAAa,QAAQ,SAAS,QAAQ,GAAG,OAAO;GAC9D,KACE,QAAQ,QAAQ,EAChB,YACA,aAAa,QAAQ,cAAc,WAAW,GAAG,MAClD;GACD,KACE,QAAQ,QAAQ,EAChB,cACA,aAAa,QAAQ,iBAAiB,GAAG,GAAG,OAC7C;GACF;AAED,OAAK,MAAMA,UAAQ,cACjB,KAAI,MAAM,GAAG,OAAOA,OAAK,EAAE;AACzB,wBAAqBA;AACrB;;;AAKN,KAAI,CAAC,sBAAsB,CAAE,MAAM,GAAG,OAAO,mBAAmB,CAC9D,QAAO;EACL,SAAS;EACT,QAAQ,EAAE;EACV,UAAU,CACR,oEACD;EACD,aAAa,EAAE;EAChB;CAGH,MAAM,qBAAqB,MAAM,GAAG,SAAS,mBAAmB;CAIhE,MAAM,SAAS,MADM,IAAI,kBAAkB,OAAO,CAChB,SAAS,UAAU,mBAAmB;AAExE,QAAO;EACL,SAAS,OAAO;EAChB,QAAQ,OAAO,UAAU,EAAE;EAC3B,UAAU,OAAO,YAAY,EAAE;EAC/B,aAAa,OAAO,eAAe,EAAE;EACrC,QAAQ,OAAO;EAChB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FsAdapter } from "../../ports/fs.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { SpecScanResult } from "@contractspec/module.workspace";
|
|
3
|
+
import { ResolvedContractsrcConfig } from "@contractspec/lib.contracts";
|
|
3
4
|
|
|
4
5
|
//#region src/services/validate/implementation-validator.d.ts
|
|
5
6
|
|
|
@@ -24,9 +25,9 @@ interface ValidateImplementationResult {
|
|
|
24
25
|
formTestPath?: string;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
declare function validateImplementationFiles(specFile:
|
|
28
|
+
declare function validateImplementationFiles(specFile: SpecScanResult, adapters: {
|
|
28
29
|
fs: FsAdapter;
|
|
29
|
-
}, config:
|
|
30
|
+
}, config: ResolvedContractsrcConfig, options?: ValidateImplementationOptions): Promise<ValidateImplementationResult>;
|
|
30
31
|
//#endregion
|
|
31
32
|
export { ValidateImplementationOptions, ValidateImplementationResult, validateImplementationFiles };
|
|
32
33
|
//# sourceMappingURL=implementation-validator.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-validator.d.mts","names":[],"sources":["../../../src/services/validate/implementation-validator.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implementation-validator.d.mts","names":[],"sources":["../../../src/services/validate/implementation-validator.ts"],"sourcesContent":[],"mappings":";;;;;;AAmDkB,UAxCD,6BAAA,CAwCC;EACR,aAAA,CAAA,EAAA,OAAA;EACC,UAAA,CAAA,EAAA,OAAA;EACA;;;;;UAlCM,4BAAA;;;;;;;;;;;;;iBA6BK,2BAAA,WACV;MACM;WACR,qCACC,gCACR,QAAQ"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { scanSpecSource } from "@contractspec/module.workspace";
|
|
2
|
-
|
|
3
1
|
//#region src/services/validate/implementation-validator.ts
|
|
4
2
|
function toKebabCase(value) {
|
|
5
3
|
return value.replace(/\./g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -11,26 +9,19 @@ async function validateImplementationFiles(specFile, adapters, config, options =
|
|
|
11
9
|
const { fs } = adapters;
|
|
12
10
|
const errors = [];
|
|
13
11
|
const warnings = [];
|
|
14
|
-
|
|
15
|
-
valid: false,
|
|
16
|
-
errors: [`Spec file not found: ${specFile}`],
|
|
17
|
-
warnings: [],
|
|
18
|
-
expected: {}
|
|
19
|
-
};
|
|
20
|
-
const scan = scanSpecSource(await fs.readFile(specFile), specFile);
|
|
21
|
-
const specName = scan.key ?? fs.basename(specFile).replace(/\.[jt]s$/, "");
|
|
12
|
+
const specName = specFile.key ?? fs.basename(specFile.filePath).replace(/\.[jt]s$/, "");
|
|
22
13
|
const outRoot = options.outputDir ?? config.outputDir ?? "./src";
|
|
23
14
|
const kebab = toKebabCase(specName);
|
|
24
15
|
const expected = {};
|
|
25
|
-
if (
|
|
16
|
+
if (specFile.specType === "operation") {
|
|
26
17
|
expected.handlerPath = fs.join(outRoot, "handlers", `${kebab}.handler.ts`);
|
|
27
18
|
expected.handlerTestPath = fs.join(outRoot, "handlers", `${kebab}.handler.test.ts`);
|
|
28
19
|
}
|
|
29
|
-
if (
|
|
20
|
+
if (specFile.specType === "presentation") {
|
|
30
21
|
expected.componentPath = fs.join(outRoot, "components", `${kebab}.tsx`);
|
|
31
22
|
expected.componentTestPath = fs.join(outRoot, "components", `${kebab}.test.tsx`);
|
|
32
23
|
}
|
|
33
|
-
if (
|
|
24
|
+
if (specFile.specType === "form") {
|
|
34
25
|
expected.formPath = fs.join(outRoot, "forms", `${kebab}.form.tsx`);
|
|
35
26
|
expected.formTestPath = fs.join(outRoot, "forms", `${kebab}.form.test.tsx`);
|
|
36
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-validator.mjs","names":[],"sources":["../../../src/services/validate/implementation-validator.ts"],"sourcesContent":["/**\n * Implementation validation service (handlers + tests).\n *\n * Deterministic, static checks intended for reuse across CLI/VSCode/web tooling.\n * This does NOT execute spec modules.\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"implementation-validator.mjs","names":[],"sources":["../../../src/services/validate/implementation-validator.ts"],"sourcesContent":["/**\n * Implementation validation service (handlers + tests).\n *\n * Deterministic, static checks intended for reuse across CLI/VSCode/web tooling.\n * This does NOT execute spec modules.\n */\n\nimport type { SpecScanResult } from '@contractspec/module.workspace';\nimport type { FsAdapter } from '../../ports/fs';\nimport type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts';\n\nexport interface ValidateImplementationOptions {\n checkHandlers?: boolean;\n checkTests?: boolean;\n /**\n * Override workspace outputDir (defaults to config.outputDir).\n */\n outputDir?: string;\n}\n\nexport interface ValidateImplementationResult {\n valid: boolean;\n errors: string[];\n warnings: string[];\n expected: {\n handlerPath?: string;\n handlerTestPath?: string;\n componentPath?: string;\n componentTestPath?: string;\n formPath?: string;\n formTestPath?: string;\n };\n}\n\nfunction toKebabCase(value: string): string {\n return value\n .replace(/\\./g, '-')\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}\n\nfunction toPascalCase(value: string): string {\n return value\n .split(/[-_.]/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\nexport async function validateImplementationFiles(\n specFile: SpecScanResult,\n adapters: { fs: FsAdapter },\n config: ResolvedContractsrcConfig,\n options: ValidateImplementationOptions = {}\n): Promise<ValidateImplementationResult> {\n const { fs } = adapters;\n const errors: string[] = [];\n const warnings: string[] = [];\n\n const specName =\n specFile.key ?? fs.basename(specFile.filePath).replace(/\\.[jt]s$/, '');\n const outRoot = options.outputDir ?? config.outputDir ?? './src';\n const kebab = toKebabCase(specName);\n\n const expected: ValidateImplementationResult['expected'] = {};\n\n if (specFile.specType === 'operation') {\n expected.handlerPath = fs.join(outRoot, 'handlers', `${kebab}.handler.ts`);\n expected.handlerTestPath = fs.join(\n outRoot,\n 'handlers',\n `${kebab}.handler.test.ts`\n );\n }\n if (specFile.specType === 'presentation') {\n expected.componentPath = fs.join(outRoot, 'components', `${kebab}.tsx`);\n expected.componentTestPath = fs.join(\n outRoot,\n 'components',\n `${kebab}.test.tsx`\n );\n }\n if (specFile.specType === 'form') {\n expected.formPath = fs.join(outRoot, 'forms', `${kebab}.form.tsx`);\n expected.formTestPath = fs.join(outRoot, 'forms', `${kebab}.form.test.tsx`);\n }\n\n if (options.checkHandlers && expected.handlerPath) {\n const handlerExists = await fs.exists(expected.handlerPath);\n if (!handlerExists) {\n errors.push(`Missing handler file: ${expected.handlerPath}`);\n } else {\n const handlerCode = await fs.readFile(expected.handlerPath);\n\n const expectedSpecVar = `${toPascalCase(specName.split('.').pop() ?? specName)}Spec`;\n const hasContractHandlerType = /ContractHandler<\\s*typeof\\s+\\w+\\s*>/.test(\n handlerCode\n );\n const referencesExpectedSpec = new RegExp(\n `typeof\\\\s+${expectedSpecVar}\\\\b`\n ).test(handlerCode);\n if (!hasContractHandlerType) {\n warnings.push(\n `Handler does not appear to type itself as ContractHandler<typeof Spec>: ${expected.handlerPath}`\n );\n } else if (!referencesExpectedSpec) {\n warnings.push(\n `Handler ContractHandler typing does not reference expected spec var (${expectedSpecVar}): ${expected.handlerPath}`\n );\n }\n }\n }\n\n if (options.checkTests) {\n const candidateTests = [\n expected.handlerTestPath,\n expected.componentTestPath,\n expected.formTestPath,\n ].filter((p): p is string => typeof p === 'string');\n\n for (const testPath of candidateTests) {\n const testExists = await fs.exists(testPath);\n if (!testExists) {\n errors.push(`Missing test file: ${testPath}`);\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n expected,\n };\n}\n"],"mappings":";AAkCA,SAAS,YAAY,OAAuB;AAC1C,QAAO,MACJ,QAAQ,OAAO,IAAI,CACnB,QAAQ,mBAAmB,QAAQ,CACnC,aAAa;;AAGlB,SAAS,aAAa,OAAuB;AAC3C,QAAO,MACJ,MAAM,QAAQ,CACd,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,GAAG;;AAGb,eAAsB,4BACpB,UACA,UACA,QACA,UAAyC,EAAE,EACJ;CACvC,MAAM,EAAE,OAAO;CACf,MAAM,SAAmB,EAAE;CAC3B,MAAM,WAAqB,EAAE;CAE7B,MAAM,WACJ,SAAS,OAAO,GAAG,SAAS,SAAS,SAAS,CAAC,QAAQ,YAAY,GAAG;CACxE,MAAM,UAAU,QAAQ,aAAa,OAAO,aAAa;CACzD,MAAM,QAAQ,YAAY,SAAS;CAEnC,MAAM,WAAqD,EAAE;AAE7D,KAAI,SAAS,aAAa,aAAa;AACrC,WAAS,cAAc,GAAG,KAAK,SAAS,YAAY,GAAG,MAAM,aAAa;AAC1E,WAAS,kBAAkB,GAAG,KAC5B,SACA,YACA,GAAG,MAAM,kBACV;;AAEH,KAAI,SAAS,aAAa,gBAAgB;AACxC,WAAS,gBAAgB,GAAG,KAAK,SAAS,cAAc,GAAG,MAAM,MAAM;AACvE,WAAS,oBAAoB,GAAG,KAC9B,SACA,cACA,GAAG,MAAM,WACV;;AAEH,KAAI,SAAS,aAAa,QAAQ;AAChC,WAAS,WAAW,GAAG,KAAK,SAAS,SAAS,GAAG,MAAM,WAAW;AAClE,WAAS,eAAe,GAAG,KAAK,SAAS,SAAS,GAAG,MAAM,gBAAgB;;AAG7E,KAAI,QAAQ,iBAAiB,SAAS,YAEpC,KAAI,CADkB,MAAM,GAAG,OAAO,SAAS,YAAY,CAEzD,QAAO,KAAK,yBAAyB,SAAS,cAAc;MACvD;EACL,MAAM,cAAc,MAAM,GAAG,SAAS,SAAS,YAAY;EAE3D,MAAM,kBAAkB,GAAG,aAAa,SAAS,MAAM,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;EAC/E,MAAM,yBAAyB,sCAAsC,KACnE,YACD;EACD,MAAM,0CAAyB,IAAI,OACjC,aAAa,gBAAgB,KAC9B,EAAC,KAAK,YAAY;AACnB,MAAI,CAAC,uBACH,UAAS,KACP,2EAA2E,SAAS,cACrF;WACQ,CAAC,uBACV,UAAS,KACP,wEAAwE,gBAAgB,KAAK,SAAS,cACvG;;AAKP,KAAI,QAAQ,YAAY;EACtB,MAAM,iBAAiB;GACrB,SAAS;GACT,SAAS;GACT,SAAS;GACV,CAAC,QAAQ,MAAmB,OAAO,MAAM,SAAS;AAEnD,OAAK,MAAM,YAAY,eAErB,KAAI,CADe,MAAM,GAAG,OAAO,SAAS,CAE1C,QAAO,KAAK,sBAAsB,WAAW;;AAKnD,QAAO;EACL,OAAO,OAAO,WAAW;EACzB;EACA;EACA;EACD"}
|
|
@@ -26,7 +26,7 @@ interface ValidateSpecResult {
|
|
|
26
26
|
/**
|
|
27
27
|
* Validate a spec file.
|
|
28
28
|
*/
|
|
29
|
-
declare function validateSpec(
|
|
29
|
+
declare function validateSpec(specFilePath: string, adapters: {
|
|
30
30
|
fs: FsAdapter;
|
|
31
31
|
logger: LoggerAdapter;
|
|
32
32
|
}, options?: ValidateSpecOptions): Promise<ValidateSpecResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-validator.d.mts","names":[],"sources":["../../../src/services/validate/spec-validator.ts"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"spec-validator.d.mts","names":[],"sources":["../../../src/services/validate/spec-validator.ts"],"sourcesContent":[],"mappings":";;;;;;AAyBA;AAWA;;AAEqC,UAvBpB,mBAAA,CAuBoB;EAC1B;;;EACD,aAAA,CAAA,EAAA,OAAA;AA0CV;;;;AAIuB,UA7DN,kBAAA,CA6DM;EAAZ,KAAA,EAAA,OAAA;EAAR,eAAA,CAAA,EA3DiB,gBA2DjB;EAAO,MAAA,EAAA,MAAA,EAAA;;;;;;;iBAlDY,YAAA;MAEJ;UAAmB;aAC1B,sBACR,QAAQ;;;;iBA0CW,aAAA;MAEJ;UAAmB;aAC1B,sBACR,QAAQ,YAAY"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { listSpecs } from "../list.mjs";
|
|
1
2
|
import { validateSpecStructure } from "@contractspec/module.workspace";
|
|
2
3
|
|
|
3
4
|
//#region src/services/validate/spec-validator.ts
|
|
@@ -7,22 +8,25 @@ import { validateSpecStructure } from "@contractspec/module.workspace";
|
|
|
7
8
|
/**
|
|
8
9
|
* Validate a spec file.
|
|
9
10
|
*/
|
|
10
|
-
async function validateSpec(
|
|
11
|
+
async function validateSpec(specFilePath, adapters, options = {}) {
|
|
11
12
|
const { fs } = adapters;
|
|
12
|
-
if (!await fs.exists(
|
|
13
|
+
if (!await fs.exists(specFilePath)) return {
|
|
13
14
|
valid: false,
|
|
14
|
-
errors: [`Spec file not found: ${
|
|
15
|
+
errors: [`Spec file not found: ${specFilePath}`],
|
|
15
16
|
warnings: [],
|
|
16
17
|
code: void 0
|
|
17
18
|
};
|
|
18
|
-
const specCode = await fs.readFile(
|
|
19
|
+
const specCode = await fs.readFile(specFilePath);
|
|
19
20
|
const allErrors = [];
|
|
20
21
|
const allWarnings = [];
|
|
21
22
|
let structureResult;
|
|
22
23
|
if (!options.skipStructure) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const specFiles = await listSpecs(adapters, { pattern: specFilePath });
|
|
25
|
+
for (const specFile of specFiles) {
|
|
26
|
+
structureResult = validateSpecStructure(specFile);
|
|
27
|
+
allErrors.push(...structureResult.errors);
|
|
28
|
+
allWarnings.push(...structureResult.warnings);
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
return {
|
|
28
32
|
valid: allErrors.length === 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-validator.mjs","names":[],"sources":["../../../src/services/validate/spec-validator.ts"],"sourcesContent":["/**\n * Validation service.\n */\n\nimport {\n validateSpecStructure,\n type ValidationResult,\n} from '@contractspec/module.workspace';\nimport type { FsAdapter } from '../../ports/fs';\nimport type { LoggerAdapter } from '../../ports/logger';\n\n/**\n * Options for spec validation.\n */\nexport interface ValidateSpecOptions {\n /**\n * Skip spec structure validation (e.g., for blueprint files).\n */\n skipStructure?: boolean;\n}\n\n/**\n * Result of spec validation.\n */\nexport interface ValidateSpecResult {\n valid: boolean;\n structureResult?: ValidationResult;\n errors: string[];\n warnings: string[];\n code?: string;\n}\n\n/**\n * Validate a spec file.\n */\nexport async function validateSpec(\n
|
|
1
|
+
{"version":3,"file":"spec-validator.mjs","names":[],"sources":["../../../src/services/validate/spec-validator.ts"],"sourcesContent":["/**\n * Validation service.\n */\n\nimport {\n validateSpecStructure,\n type ValidationResult,\n} from '@contractspec/module.workspace';\nimport type { FsAdapter } from '../../ports/fs';\nimport type { LoggerAdapter } from '../../ports/logger';\nimport { listSpecs } from '../list';\n\n/**\n * Options for spec validation.\n */\nexport interface ValidateSpecOptions {\n /**\n * Skip spec structure validation (e.g., for blueprint files).\n */\n skipStructure?: boolean;\n}\n\n/**\n * Result of spec validation.\n */\nexport interface ValidateSpecResult {\n valid: boolean;\n structureResult?: ValidationResult;\n errors: string[];\n warnings: string[];\n code?: string;\n}\n\n/**\n * Validate a spec file.\n */\nexport async function validateSpec(\n specFilePath: string,\n adapters: { fs: FsAdapter; logger: LoggerAdapter },\n options: ValidateSpecOptions = {}\n): Promise<ValidateSpecResult> {\n const { fs } = adapters;\n\n const exists = await fs.exists(specFilePath);\n if (!exists) {\n return {\n valid: false,\n errors: [`Spec file not found: ${specFilePath}`],\n warnings: [],\n code: undefined,\n };\n }\n\n const specCode = await fs.readFile(specFilePath);\n\n const allErrors: string[] = [];\n const allWarnings: string[] = [];\n let structureResult: ValidationResult | undefined;\n\n if (!options.skipStructure) {\n const specFiles = await listSpecs(adapters, {\n pattern: specFilePath,\n });\n for (const specFile of specFiles) {\n structureResult = validateSpecStructure(specFile);\n allErrors.push(...structureResult.errors);\n allWarnings.push(...structureResult.warnings);\n }\n }\n\n return {\n valid: allErrors.length === 0,\n structureResult,\n errors: allErrors,\n warnings: allWarnings,\n code: specCode,\n };\n}\n\n/**\n * Validate multiple spec files.\n */\nexport async function validateSpecs(\n specFiles: string[],\n adapters: { fs: FsAdapter; logger: LoggerAdapter },\n options: ValidateSpecOptions = {}\n): Promise<Map<string, ValidateSpecResult>> {\n const results = new Map<string, ValidateSpecResult>();\n\n for (const specFile of specFiles) {\n const result = await validateSpec(specFile, adapters, options);\n results.set(specFile, result);\n }\n\n return results;\n}\n"],"mappings":";;;;;;;;;;AAoCA,eAAsB,aACpB,cACA,UACA,UAA+B,EAAE,EACJ;CAC7B,MAAM,EAAE,OAAO;AAGf,KAAI,CADW,MAAM,GAAG,OAAO,aAAa,CAE1C,QAAO;EACL,OAAO;EACP,QAAQ,CAAC,wBAAwB,eAAe;EAChD,UAAU,EAAE;EACZ,MAAM;EACP;CAGH,MAAM,WAAW,MAAM,GAAG,SAAS,aAAa;CAEhD,MAAM,YAAsB,EAAE;CAC9B,MAAM,cAAwB,EAAE;CAChC,IAAI;AAEJ,KAAI,CAAC,QAAQ,eAAe;EAC1B,MAAM,YAAY,MAAM,UAAU,UAAU,EAC1C,SAAS,cACV,CAAC;AACF,OAAK,MAAM,YAAY,WAAW;AAChC,qBAAkB,sBAAsB,SAAS;AACjD,aAAU,KAAK,GAAG,gBAAgB,OAAO;AACzC,eAAY,KAAK,GAAG,gBAAgB,SAAS;;;AAIjD,QAAO;EACL,OAAO,UAAU,WAAW;EAC5B;EACA,QAAQ;EACR,UAAU;EACV,MAAM;EACP;;;;;AAMH,eAAsB,cACpB,WACA,UACA,UAA+B,EAAE,EACS;CAC1C,MAAM,0BAAU,IAAI,KAAiC;AAErD,MAAK,MAAM,YAAY,WAAW;EAChC,MAAM,SAAS,MAAM,aAAa,UAAU,UAAU,QAAQ;AAC9D,UAAQ,IAAI,UAAU,OAAO;;AAG/B,QAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { validateConfig } from "@contractspec/lib.contracts";
|
|
1
2
|
import { resolve } from "path";
|
|
2
3
|
import { pathToFileURL } from "url";
|
|
3
|
-
import { validateConfig } from "@contractspec/lib.contracts";
|
|
4
4
|
import { readFile } from "fs/promises";
|
|
5
5
|
|
|
6
6
|
//#region src/services/validate/tenant-validator.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FsAdapter } from "../ports/fs.mjs";
|
|
2
2
|
import { WatchOptions, Watcher, WatcherAdapter } from "../ports/watcher.mjs";
|
|
3
3
|
import { LoggerAdapter } from "../ports/logger.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ResolvedContractsrcConfig } from "@contractspec/lib.contracts";
|
|
5
5
|
|
|
6
6
|
//#region src/services/watch.d.ts
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ declare function watchSpecs(adapters: {
|
|
|
16
16
|
watcher: WatcherAdapter;
|
|
17
17
|
fs: FsAdapter;
|
|
18
18
|
logger: LoggerAdapter;
|
|
19
|
-
}, config:
|
|
19
|
+
}, config: ResolvedContractsrcConfig, options: WatchSpecsOptions, overrides?: {
|
|
20
20
|
validate?: WatchValidateFn;
|
|
21
21
|
build?: WatchBuildFn;
|
|
22
22
|
}): Watcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.mts","names":[],"sources":["../../src/services/watch.ts"],"sourcesContent":[],"mappings":";;;;;;;AAsBgB,UATC,iBAAA,SAA0B,YASjB,CAAA;EACH,WAAA,CAAA,EAAA,OAAA;EAAoB,QAAA,CAAA,EAAA,OAAA;EAAmB,MAAA,CAAA,EAAA,OAAA;;AAEnD,KANC,YAAA,GAMD,CAAA,QAAA,EAAA,MAAA,EAAA,GANsC,OAMtC,CAAA,IAAA,CAAA;AAEI,KAPH,eAAA,GAOG,CAAA,QAAA,EAAA,MAAA,EAAA,GAPqC,OAOrC,CAAA,IAAA,CAAA;AACH,iBANI,UAAA,CAMJ,QAAA,EAAA;EAET,OAAA,EAPoB,cAOpB;EAAO,EAAA,EAPiC,SAOjC;UAPoD;WACpD,
|
|
1
|
+
{"version":3,"file":"watch.d.mts","names":[],"sources":["../../src/services/watch.ts"],"sourcesContent":[],"mappings":";;;;;;;AAsBgB,UATC,iBAAA,SAA0B,YASjB,CAAA;EACH,WAAA,CAAA,EAAA,OAAA;EAAoB,QAAA,CAAA,EAAA,OAAA;EAAmB,MAAA,CAAA,EAAA,OAAA;;AAEnD,KANC,YAAA,GAMD,CAAA,QAAA,EAAA,MAAA,EAAA,GANsC,OAMtC,CAAA,IAAA,CAAA;AAEI,KAPH,eAAA,GAOG,CAAA,QAAA,EAAA,MAAA,EAAA,GAPqC,OAOrC,CAAA,IAAA,CAAA;AACH,iBANI,UAAA,CAMJ,QAAA,EAAA;EAET,OAAA,EAPoB,cAOpB;EAAO,EAAA,EAPiC,SAOjC;UAPoD;WACpD,oCACC;aAEI;UACH;IAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/services/watch.ts"],"sourcesContent":["/**\n * Watch service.\n *\n * Provides a reusable watcher that can trigger validate/build on spec changes.\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/services/watch.ts"],"sourcesContent":["/**\n * Watch service.\n *\n * Provides a reusable watcher that can trigger validate/build on spec changes.\n */\n\nimport type { LoggerAdapter } from '../ports/logger';\nimport type { Watcher, WatcherAdapter, WatchOptions } from '../ports/watcher';\nimport type { FsAdapter } from '../ports/fs';\nimport { buildSpec } from './build';\nimport { validateSpec } from './validate';\nimport type { ResolvedContractsrcConfig } from '@contractspec/lib.contracts';\n\nexport interface WatchSpecsOptions extends WatchOptions {\n runValidate?: boolean;\n runBuild?: boolean;\n dryRun?: boolean;\n}\n\nexport type WatchBuildFn = (specPath: string) => Promise<void>;\nexport type WatchValidateFn = (specPath: string) => Promise<void>;\n\nexport function watchSpecs(\n adapters: { watcher: WatcherAdapter; fs: FsAdapter; logger: LoggerAdapter },\n config: ResolvedContractsrcConfig,\n options: WatchSpecsOptions,\n overrides?: {\n validate?: WatchValidateFn;\n build?: WatchBuildFn;\n }\n): Watcher {\n const { watcher, fs, logger } = adapters;\n const w = watcher.watch(options);\n\n const validateFn: WatchValidateFn =\n overrides?.validate ??\n (async (specPath) => {\n await validateSpec(specPath, { fs, logger });\n });\n\n const buildFn: WatchBuildFn =\n overrides?.build ??\n (async (specPath) => {\n await buildSpec(specPath, { fs, logger }, config);\n });\n\n w.on(async (event) => {\n if (event.type !== 'change') return;\n\n logger.info('watchSpecs.changed', { path: event.path });\n\n if (options.runValidate) {\n await validateFn(event.path);\n }\n\n if (options.runBuild) {\n if (options.dryRun) {\n logger.info('[dry-run] watchSpecs skipped build', { path: event.path });\n } else {\n await buildFn(event.path);\n }\n }\n });\n\n return w;\n}\n"],"mappings":";;;;;AAsBA,SAAgB,WACd,UACA,QACA,SACA,WAIS;CACT,MAAM,EAAE,SAAS,IAAI,WAAW;CAChC,MAAM,IAAI,QAAQ,MAAM,QAAQ;CAEhC,MAAM,aACJ,WAAW,aACV,OAAO,aAAa;AACnB,QAAM,aAAa,UAAU;GAAE;GAAI;GAAQ,CAAC;;CAGhD,MAAM,UACJ,WAAW,UACV,OAAO,aAAa;AACnB,QAAM,UAAU,UAAU;GAAE;GAAI;GAAQ,EAAE,OAAO;;AAGrD,GAAE,GAAG,OAAO,UAAU;AACpB,MAAI,MAAM,SAAS,SAAU;AAE7B,SAAO,KAAK,sBAAsB,EAAE,MAAM,MAAM,MAAM,CAAC;AAEvD,MAAI,QAAQ,YACV,OAAM,WAAW,MAAM,KAAK;AAG9B,MAAI,QAAQ,SACV,KAAI,QAAQ,OACV,QAAO,KAAK,sCAAsC,EAAE,MAAM,MAAM,MAAM,CAAC;MAEvE,OAAM,QAAQ,MAAM,KAAK;GAG7B;AAEF,QAAO"}
|
package/dist/utils/filter.d.mts
CHANGED
|
@@ -11,6 +11,15 @@ import { ContractsrcConfig } from "@contractspec/lib.contracts/workspace-config"
|
|
|
11
11
|
* @param config Optional workspace configuration
|
|
12
12
|
*/
|
|
13
13
|
declare function isTestFile(filePath: string, config?: ContractsrcConfig): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a file path is a library definition file that should be excluded from spec validation.
|
|
16
|
+
*
|
|
17
|
+
* These are files that define the spec functions/types themselves (e.g., defineEvent, defineCommand).
|
|
18
|
+
* They contain spec-related keywords but are not actual spec files.
|
|
19
|
+
*
|
|
20
|
+
* @param filePath Path to check
|
|
21
|
+
*/
|
|
22
|
+
declare function isLibraryDefinitionFile(filePath: string): boolean;
|
|
14
23
|
//#endregion
|
|
15
|
-
export { isTestFile };
|
|
24
|
+
export { isLibraryDefinitionFile, isTestFile };
|
|
16
25
|
//# sourceMappingURL=filter.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.mts","names":[],"sources":["../../src/utils/filter.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.d.mts","names":[],"sources":["../../src/utils/filter.ts"],"sourcesContent":[],"mappings":";;;;AAoCA;;;;;;;;iBArBgB,UAAA,4BAEL;;;;;;;;;iBAmBK,uBAAA"}
|
package/dist/utils/filter.mjs
CHANGED
|
@@ -16,7 +16,34 @@ function isTestFile(filePath, config) {
|
|
|
16
16
|
const patterns = config?.testing?.testMatch ?? ["**/*.{test,spec}.{ts,js}"];
|
|
17
17
|
return micromatch.isMatch(filePath, patterns);
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if a file path is a library definition file that should be excluded from spec validation.
|
|
21
|
+
*
|
|
22
|
+
* These are files that define the spec functions/types themselves (e.g., defineEvent, defineCommand).
|
|
23
|
+
* They contain spec-related keywords but are not actual spec files.
|
|
24
|
+
*
|
|
25
|
+
* @param filePath Path to check
|
|
26
|
+
*/
|
|
27
|
+
function isLibraryDefinitionFile(filePath) {
|
|
28
|
+
if (micromatch.isMatch(filePath, [
|
|
29
|
+
"**/libs/contracts/src/app-config/app-config.capability.ts",
|
|
30
|
+
"**/libs/contracts/src/app-config/app-config.contracts.ts",
|
|
31
|
+
"**/libs/contracts/src/app-config/app-config.feature.ts",
|
|
32
|
+
"**/libs/contracts/src/app-config/lifecycle-contracts.ts",
|
|
33
|
+
"**/libs/contracts/src/app-config/events.ts"
|
|
34
|
+
])) return false;
|
|
35
|
+
return micromatch.isMatch(filePath, [
|
|
36
|
+
"**/libs/contracts/src/*.ts",
|
|
37
|
+
"**/libs/contracts/src/operations/*.ts",
|
|
38
|
+
"**/libs/contracts/src/presentations/*.ts",
|
|
39
|
+
"**/libs/contracts/src/contract-registry/*.ts",
|
|
40
|
+
"**/libs/contracts/src/model-registry/*.ts",
|
|
41
|
+
"**/libs/contracts/src/registry-utils/*.ts",
|
|
42
|
+
"**/libs/contracts-transformers/src/**",
|
|
43
|
+
"**/libs/schema/src/**"
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
19
46
|
|
|
20
47
|
//#endregion
|
|
21
|
-
export { isTestFile };
|
|
48
|
+
export { isLibraryDefinitionFile, isTestFile };
|
|
22
49
|
//# sourceMappingURL=filter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.mjs","names":[],"sources":["../../src/utils/filter.ts"],"sourcesContent":["/**\n * File filtering utilities.\n */\n\nimport micromatch from 'micromatch';\nimport type { ContractsrcConfig } from '@contractspec/lib.contracts/workspace-config';\n\n/**\n * Check if a file path matches test file patterns.\n *\n * Uses configuration testing.testMatch if available, otherwise defaults to standard patterns.\n *\n * @param filePath Path to check\n * @param config Optional workspace configuration\n */\nexport function isTestFile(\n filePath: string,\n config?: ContractsrcConfig\n): boolean {\n // Get patterns from config or use defaults\n // The default from schema is ['**/*.{test,spec}.{ts,js}']\n const patterns = config?.testing?.testMatch ?? ['**/*.{test,spec}.{ts,js}'];\n\n // Ensure we matched against the basename or relative path correctly\n // micromatch usually takes the whole path if patterns contain **\n return micromatch.isMatch(filePath, patterns);\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,WACd,UACA,QACS;CAGT,MAAM,WAAW,QAAQ,SAAS,aAAa,CAAC,2BAA2B;AAI3E,QAAO,WAAW,QAAQ,UAAU,SAAS"}
|
|
1
|
+
{"version":3,"file":"filter.mjs","names":[],"sources":["../../src/utils/filter.ts"],"sourcesContent":["/**\n * File filtering utilities.\n */\n\nimport micromatch from 'micromatch';\nimport type { ContractsrcConfig } from '@contractspec/lib.contracts/workspace-config';\n\n/**\n * Check if a file path matches test file patterns.\n *\n * Uses configuration testing.testMatch if available, otherwise defaults to standard patterns.\n *\n * @param filePath Path to check\n * @param config Optional workspace configuration\n */\nexport function isTestFile(\n filePath: string,\n config?: ContractsrcConfig\n): boolean {\n // Get patterns from config or use defaults\n // The default from schema is ['**/*.{test,spec}.{ts,js}']\n const patterns = config?.testing?.testMatch ?? ['**/*.{test,spec}.{ts,js}'];\n\n // Ensure we matched against the basename or relative path correctly\n // micromatch usually takes the whole path if patterns contain **\n return micromatch.isMatch(filePath, patterns);\n}\n\n/**\n * Check if a file path is a library definition file that should be excluded from spec validation.\n *\n * These are files that define the spec functions/types themselves (e.g., defineEvent, defineCommand).\n * They contain spec-related keywords but are not actual spec files.\n *\n * @param filePath Path to check\n */\nexport function isLibraryDefinitionFile(filePath: string): boolean {\n const allowedPatterns = [\n '**/libs/contracts/src/app-config/app-config.capability.ts',\n '**/libs/contracts/src/app-config/app-config.contracts.ts',\n '**/libs/contracts/src/app-config/app-config.feature.ts',\n '**/libs/contracts/src/app-config/lifecycle-contracts.ts',\n '**/libs/contracts/src/app-config/events.ts',\n ];\n if (micromatch.isMatch(filePath, allowedPatterns)) {\n return false;\n }\n\n // Exclude core library files that define spec types/functions\n const libraryPatterns = [\n // Top-level files in libs/contracts/src are mostly library logic\n '**/libs/contracts/src/*.ts',\n // These specific subfolders in libs/contracts/src contain library logic, not specs\n '**/libs/contracts/src/operations/*.ts',\n '**/libs/contracts/src/presentations/*.ts',\n '**/libs/contracts/src/contract-registry/*.ts',\n '**/libs/contracts/src/model-registry/*.ts',\n '**/libs/contracts/src/registry-utils/*.ts',\n // These packages are pure library code\n '**/libs/contracts-transformers/src/**',\n '**/libs/schema/src/**',\n ];\n\n return micromatch.isMatch(filePath, libraryPatterns);\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,WACd,UACA,QACS;CAGT,MAAM,WAAW,QAAQ,SAAS,aAAa,CAAC,2BAA2B;AAI3E,QAAO,WAAW,QAAQ,UAAU,SAAS;;;;;;;;;;AAW/C,SAAgB,wBAAwB,UAA2B;AAQjE,KAAI,WAAW,QAAQ,UAPC;EACtB;EACA;EACA;EACA;EACA;EACD,CACgD,CAC/C,QAAO;AAkBT,QAAO,WAAW,QAAQ,UAdF;EAEtB;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACD,CAEmD"}
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { loadTypeScriptModule } from "./module-loader.mjs";
|
|
2
2
|
import { emailSchema, isValidDotName, isValidIdentifier, isValidVersion, urlSchema, validators } from "./validation.mjs";
|
|
3
|
-
import { isTestFile } from "./filter.mjs";
|
|
3
|
+
import { isLibraryDefinitionFile, isTestFile } from "./filter.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/index.d.ts
|
|
6
6
|
declare namespace index_d_exports {
|
|
7
|
-
export { emailSchema, isTestFile, isValidDotName, isValidIdentifier, isValidVersion, loadTypeScriptModule, urlSchema, validators };
|
|
7
|
+
export { emailSchema, isLibraryDefinitionFile, isTestFile, isValidDotName, isValidIdentifier, isValidVersion, loadTypeScriptModule, urlSchema, validators };
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { index_d_exports };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
2
|
import { loadTypeScriptModule } from "./module-loader.mjs";
|
|
3
3
|
import { emailSchema, isValidDotName, isValidIdentifier, isValidVersion, urlSchema, validators } from "./validation.mjs";
|
|
4
|
-
import { isTestFile } from "./filter.mjs";
|
|
4
|
+
import { isLibraryDefinitionFile, isTestFile } from "./filter.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/index.ts
|
|
7
7
|
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
emailSchema: () => emailSchema,
|
|
9
|
+
isLibraryDefinitionFile: () => isLibraryDefinitionFile,
|
|
9
10
|
isTestFile: () => isTestFile,
|
|
10
11
|
isValidDotName: () => isValidDotName,
|
|
11
12
|
isValidIdentifier: () => isValidIdentifier,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.workspace",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Workspace utilities for monorepo development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -31,12 +31,13 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@ai-sdk/anthropic": "3.0.11",
|
|
33
33
|
"@ai-sdk/openai": "3.0.8",
|
|
34
|
-
"@contractspec/lib.ai-agent": "1.
|
|
35
|
-
"@contractspec/lib.ai-providers": "1.
|
|
36
|
-
"@contractspec/lib.contracts": "1.
|
|
37
|
-
"@contractspec/lib.contracts-transformers": "1.
|
|
38
|
-
"@contractspec/lib.source-extractors": "0.
|
|
39
|
-
"@contractspec/module.workspace": "1.
|
|
34
|
+
"@contractspec/lib.ai-agent": "1.53.0",
|
|
35
|
+
"@contractspec/lib.ai-providers": "1.53.0",
|
|
36
|
+
"@contractspec/lib.contracts": "1.53.0",
|
|
37
|
+
"@contractspec/lib.contracts-transformers": "1.53.0",
|
|
38
|
+
"@contractspec/lib.source-extractors": "0.7.0",
|
|
39
|
+
"@contractspec/module.workspace": "1.53.0",
|
|
40
|
+
"@contractspec/lib.utils-typescript": "1.53.0",
|
|
40
41
|
"ai": "6.0.29",
|
|
41
42
|
"chalk": "^5.6.2",
|
|
42
43
|
"chokidar": "^5.0.0",
|
|
@@ -48,8 +49,9 @@
|
|
|
48
49
|
"zod": "^4.3.5"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@contractspec/tool.tsdown": "1.
|
|
52
|
-
"@contractspec/tool.typescript": "1.
|
|
52
|
+
"@contractspec/tool.tsdown": "1.53.0",
|
|
53
|
+
"@contractspec/tool.typescript": "1.53.0",
|
|
54
|
+
"@types/bun": "^1.3.8",
|
|
53
55
|
"@types/micromatch": "^4.0.10",
|
|
54
56
|
"@types/node": "^25.0.6",
|
|
55
57
|
"tsdown": "^0.19.0",
|