@intentius/chant 0.0.1
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/README.md +365 -0
- package/package.json +22 -0
- package/src/attrref.test.ts +148 -0
- package/src/attrref.ts +50 -0
- package/src/barrel.test.ts +157 -0
- package/src/barrel.ts +101 -0
- package/src/bench.test.ts +227 -0
- package/src/build.test.ts +437 -0
- package/src/build.ts +425 -0
- package/src/builder.test.ts +312 -0
- package/src/builder.ts +56 -0
- package/src/child-project.ts +44 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/README.md +26 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +14 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +16 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +8 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +7 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +10 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/examples/getting-started/.gitkeep +0 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/justfile +26 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/package.json +29 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/docs.ts +25 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate-cli.ts +8 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate.ts +74 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/naming.ts +33 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/package.ts +25 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/rollback.ts +45 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/coverage.ts +11 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/generated/.gitkeep +0 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/import/generator.ts +10 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/import/parser.ts +10 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/index.ts +9 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/lint/rules/index.ts +1 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/lint/rules/sample.ts +18 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/lsp/completions.ts +14 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/lsp/hover.ts +14 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/plugin.ts +110 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/serializer.ts +24 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/spec/fetch.ts +21 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/spec/parse.ts +25 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/validate-cli.ts +4 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/validate.ts +24 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/tsconfig.json +10 -0
- package/src/cli/commands/__fixtures__/sample-rule.ts +11 -0
- package/src/cli/commands/__snapshots__/init-lexicon.test.ts.snap +222 -0
- package/src/cli/commands/build.test.ts +149 -0
- package/src/cli/commands/build.ts +344 -0
- package/src/cli/commands/diff.test.ts +148 -0
- package/src/cli/commands/diff.ts +221 -0
- package/src/cli/commands/doctor.test.ts +239 -0
- package/src/cli/commands/doctor.ts +224 -0
- package/src/cli/commands/import.test.ts +379 -0
- package/src/cli/commands/import.ts +335 -0
- package/src/cli/commands/init-lexicon.test.ts +297 -0
- package/src/cli/commands/init-lexicon.ts +993 -0
- package/src/cli/commands/init.test.ts +317 -0
- package/src/cli/commands/init.ts +505 -0
- package/src/cli/commands/licenses.ts +165 -0
- package/src/cli/commands/lint.test.ts +332 -0
- package/src/cli/commands/lint.ts +408 -0
- package/src/cli/commands/list.test.ts +100 -0
- package/src/cli/commands/list.ts +108 -0
- package/src/cli/commands/update.test.ts +38 -0
- package/src/cli/commands/update.ts +207 -0
- package/src/cli/conflict-check.test.ts +255 -0
- package/src/cli/conflict-check.ts +89 -0
- package/src/cli/debug.ts +8 -0
- package/src/cli/format.test.ts +140 -0
- package/src/cli/format.ts +133 -0
- package/src/cli/handlers/build.ts +58 -0
- package/src/cli/handlers/dev.ts +38 -0
- package/src/cli/handlers/init.ts +46 -0
- package/src/cli/handlers/lint.ts +36 -0
- package/src/cli/handlers/misc.ts +57 -0
- package/src/cli/handlers/serve.ts +26 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/lsp/capabilities.ts +46 -0
- package/src/cli/lsp/diagnostics.ts +52 -0
- package/src/cli/lsp/server.test.ts +618 -0
- package/src/cli/lsp/server.ts +393 -0
- package/src/cli/main.test.ts +257 -0
- package/src/cli/main.ts +224 -0
- package/src/cli/mcp/resources/context.ts +59 -0
- package/src/cli/mcp/server.test.ts +747 -0
- package/src/cli/mcp/server.ts +402 -0
- package/src/cli/mcp/tools/build.ts +117 -0
- package/src/cli/mcp/tools/import.ts +48 -0
- package/src/cli/mcp/tools/lint.ts +45 -0
- package/src/cli/plugins.test.ts +31 -0
- package/src/cli/plugins.ts +94 -0
- package/src/cli/registry.ts +73 -0
- package/src/cli/reporters/stylish.test.ts +282 -0
- package/src/cli/reporters/stylish.ts +186 -0
- package/src/cli/watch.test.ts +81 -0
- package/src/cli/watch.ts +101 -0
- package/src/codegen/case.test.ts +30 -0
- package/src/codegen/case.ts +11 -0
- package/src/codegen/coverage.ts +167 -0
- package/src/codegen/docs.ts +634 -0
- package/src/codegen/fetch.test.ts +119 -0
- package/src/codegen/fetch.ts +261 -0
- package/src/codegen/generate-registry.test.ts +118 -0
- package/src/codegen/generate-registry.ts +107 -0
- package/src/codegen/generate-runtime-index.test.ts +81 -0
- package/src/codegen/generate-runtime-index.ts +99 -0
- package/src/codegen/generate-typescript.test.ts +146 -0
- package/src/codegen/generate-typescript.ts +161 -0
- package/src/codegen/generate.ts +206 -0
- package/src/codegen/json-patch.test.ts +113 -0
- package/src/codegen/json-patch.ts +151 -0
- package/src/codegen/json-schema.test.ts +196 -0
- package/src/codegen/json-schema.ts +209 -0
- package/src/codegen/naming.ts +201 -0
- package/src/codegen/package.ts +161 -0
- package/src/codegen/rollback.test.ts +92 -0
- package/src/codegen/rollback.ts +115 -0
- package/src/codegen/topo-sort.test.ts +69 -0
- package/src/codegen/topo-sort.ts +46 -0
- package/src/codegen/typecheck.test.ts +37 -0
- package/src/codegen/typecheck.ts +74 -0
- package/src/codegen/validate.test.ts +86 -0
- package/src/codegen/validate.ts +143 -0
- package/src/composite.test.ts +426 -0
- package/src/composite.ts +243 -0
- package/src/config.test.ts +91 -0
- package/src/config.ts +87 -0
- package/src/declarable.test.ts +160 -0
- package/src/declarable.ts +47 -0
- package/src/detectLexicon.test.ts +236 -0
- package/src/detectLexicon.ts +37 -0
- package/src/discovery/cache.test.ts +78 -0
- package/src/discovery/cache.ts +86 -0
- package/src/discovery/collect.test.ts +269 -0
- package/src/discovery/collect.ts +51 -0
- package/src/discovery/cycles.test.ts +238 -0
- package/src/discovery/cycles.ts +107 -0
- package/src/discovery/files.test.ts +154 -0
- package/src/discovery/files.ts +61 -0
- package/src/discovery/graph.test.ts +476 -0
- package/src/discovery/graph.ts +150 -0
- package/src/discovery/import.test.ts +199 -0
- package/src/discovery/import.ts +20 -0
- package/src/discovery/index.test.ts +272 -0
- package/src/discovery/index.ts +132 -0
- package/src/discovery/resolve.test.ts +267 -0
- package/src/discovery/resolve.ts +54 -0
- package/src/errors.test.ts +138 -0
- package/src/errors.ts +86 -0
- package/src/import/base-parser.test.ts +67 -0
- package/src/import/base-parser.ts +48 -0
- package/src/import/generator.ts +21 -0
- package/src/import/ir-utils.test.ts +103 -0
- package/src/import/ir-utils.ts +87 -0
- package/src/import/parser.ts +41 -0
- package/src/index.ts +60 -0
- package/src/intrinsic-interpolation.test.ts +91 -0
- package/src/intrinsic-interpolation.ts +89 -0
- package/src/intrinsic.test.ts +69 -0
- package/src/intrinsic.ts +43 -0
- package/src/lexicon-integrity.test.ts +94 -0
- package/src/lexicon-integrity.ts +69 -0
- package/src/lexicon-manifest.test.ts +101 -0
- package/src/lexicon-manifest.ts +71 -0
- package/src/lexicon-output.test.ts +182 -0
- package/src/lexicon-output.ts +82 -0
- package/src/lexicon-schema.test.ts +239 -0
- package/src/lexicon-schema.ts +144 -0
- package/src/lexicon.ts +212 -0
- package/src/lint/config-overrides.test.ts +254 -0
- package/src/lint/config.test.ts +644 -0
- package/src/lint/config.ts +375 -0
- package/src/lint/declarative.test.ts +256 -0
- package/src/lint/declarative.ts +187 -0
- package/src/lint/engine.test.ts +465 -0
- package/src/lint/engine.ts +172 -0
- package/src/lint/named-checks.test.ts +37 -0
- package/src/lint/named-checks.ts +33 -0
- package/src/lint/parser.test.ts +129 -0
- package/src/lint/parser.ts +42 -0
- package/src/lint/post-synth.test.ts +113 -0
- package/src/lint/post-synth.ts +76 -0
- package/src/lint/presets/relaxed.json +19 -0
- package/src/lint/presets/strict.json +19 -0
- package/src/lint/rule-loader.test.ts +67 -0
- package/src/lint/rule-loader.ts +67 -0
- package/src/lint/rule-options.test.ts +141 -0
- package/src/lint/rule.test.ts +196 -0
- package/src/lint/rule.ts +98 -0
- package/src/lint/rules/barrel-import-style.test.ts +80 -0
- package/src/lint/rules/barrel-import-style.ts +59 -0
- package/src/lint/rules/composite-scope.ts +55 -0
- package/src/lint/rules/cor017-composite-name-match.test.ts +107 -0
- package/src/lint/rules/cor017-composite-name-match.ts +108 -0
- package/src/lint/rules/cor018-composite-prefer-lexicon-type.test.ts +172 -0
- package/src/lint/rules/cor018-composite-prefer-lexicon-type.ts +167 -0
- package/src/lint/rules/declarable-naming-convention.test.ts +69 -0
- package/src/lint/rules/declarable-naming-convention.ts +70 -0
- package/src/lint/rules/enforce-barrel-import.test.ts +169 -0
- package/src/lint/rules/enforce-barrel-import.ts +81 -0
- package/src/lint/rules/enforce-barrel-ref.test.ts +114 -0
- package/src/lint/rules/enforce-barrel-ref.ts +75 -0
- package/src/lint/rules/evl001-non-literal-expression.test.ts +158 -0
- package/src/lint/rules/evl001-non-literal-expression.ts +149 -0
- package/src/lint/rules/evl002-control-flow-resource.test.ts +110 -0
- package/src/lint/rules/evl002-control-flow-resource.ts +61 -0
- package/src/lint/rules/evl003-dynamic-property-access.test.ts +63 -0
- package/src/lint/rules/evl003-dynamic-property-access.ts +41 -0
- package/src/lint/rules/evl004-spread-non-const.test.ts +130 -0
- package/src/lint/rules/evl004-spread-non-const.ts +111 -0
- package/src/lint/rules/evl005-resource-block-body.test.ts +59 -0
- package/src/lint/rules/evl005-resource-block-body.ts +49 -0
- package/src/lint/rules/evl006-barrel-usage.test.ts +63 -0
- package/src/lint/rules/evl006-barrel-usage.ts +95 -0
- package/src/lint/rules/evl007-invalid-siblings.test.ts +87 -0
- package/src/lint/rules/evl007-invalid-siblings.ts +139 -0
- package/src/lint/rules/evl008-unresolvable-barrel-ref.test.ts +118 -0
- package/src/lint/rules/evl008-unresolvable-barrel-ref.ts +140 -0
- package/src/lint/rules/evl009-composite-no-constant.test.ts +162 -0
- package/src/lint/rules/evl009-composite-no-constant.ts +171 -0
- package/src/lint/rules/evl010-composite-no-transform.test.ts +121 -0
- package/src/lint/rules/evl010-composite-no-transform.ts +69 -0
- package/src/lint/rules/export-required.test.ts +213 -0
- package/src/lint/rules/export-required.ts +158 -0
- package/src/lint/rules/file-declarable-limit.test.ts +148 -0
- package/src/lint/rules/file-declarable-limit.ts +96 -0
- package/src/lint/rules/flat-declarations.test.ts +210 -0
- package/src/lint/rules/flat-declarations.ts +70 -0
- package/src/lint/rules/index.ts +99 -0
- package/src/lint/rules/no-cyclic-declarable-ref.test.ts +135 -0
- package/src/lint/rules/no-cyclic-declarable-ref.ts +178 -0
- package/src/lint/rules/no-redundant-type-import.test.ts +129 -0
- package/src/lint/rules/no-redundant-type-import.ts +85 -0
- package/src/lint/rules/no-redundant-value-cast.test.ts +51 -0
- package/src/lint/rules/no-redundant-value-cast.ts +46 -0
- package/src/lint/rules/no-string-ref.test.ts +100 -0
- package/src/lint/rules/no-string-ref.ts +66 -0
- package/src/lint/rules/no-unused-declarable-import.test.ts +74 -0
- package/src/lint/rules/no-unused-declarable-import.ts +103 -0
- package/src/lint/rules/no-unused-declarable.test.ts +134 -0
- package/src/lint/rules/no-unused-declarable.ts +118 -0
- package/src/lint/rules/prefer-namespace-import.test.ts +102 -0
- package/src/lint/rules/prefer-namespace-import.ts +63 -0
- package/src/lint/rules/single-concern-file.test.ts +156 -0
- package/src/lint/rules/single-concern-file.ts +98 -0
- package/src/lint/rules/stale-barrel-types.ts +60 -0
- package/src/lint/selectors.test.ts +113 -0
- package/src/lint/selectors.ts +188 -0
- package/src/lsp/lexicon-providers.ts +191 -0
- package/src/lsp/types.ts +79 -0
- package/src/mcp/types.ts +22 -0
- package/src/project/scan.test.ts +178 -0
- package/src/project/scan.ts +182 -0
- package/src/project/sync.test.ts +87 -0
- package/src/project/sync.ts +46 -0
- package/src/project-validation.test.ts +64 -0
- package/src/project-validation.ts +79 -0
- package/src/pseudo-parameter.test.ts +39 -0
- package/src/pseudo-parameter.ts +47 -0
- package/src/runtime.ts +68 -0
- package/src/serializer-walker.test.ts +124 -0
- package/src/serializer-walker.ts +83 -0
- package/src/serializer.ts +42 -0
- package/src/sort.test.ts +290 -0
- package/src/sort.ts +58 -0
- package/src/stack-output.ts +82 -0
- package/src/types.test.ts +307 -0
- package/src/types.ts +46 -0
- package/src/utils.test.ts +195 -0
- package/src/utils.ts +46 -0
- package/src/validation.test.ts +308 -0
- package/src/validation.ts +50 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NamingStrategy, type NamingConfig, type NamingInput } from "@intentius/chant/codegen/naming";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Naming configuration for this lexicon.
|
|
5
|
+
*
|
|
6
|
+
* TODO: Populate these tables with your provider's naming conventions.
|
|
7
|
+
*/
|
|
8
|
+
export const namingConfig: NamingConfig = {
|
|
9
|
+
// High-priority short names for common resource types
|
|
10
|
+
priorityNames: {},
|
|
11
|
+
|
|
12
|
+
// Aliases for resource types that need alternate names
|
|
13
|
+
priorityAliases: {},
|
|
14
|
+
|
|
15
|
+
// Aliases for property types
|
|
16
|
+
priorityPropertyAliases: {},
|
|
17
|
+
|
|
18
|
+
// Abbreviations for service names (used in collision resolution)
|
|
19
|
+
serviceAbbreviations: {},
|
|
20
|
+
|
|
21
|
+
// Extract the short name from a fully-qualified type string
|
|
22
|
+
shortName: (typeName: string) => typeName.split("::").pop()!,
|
|
23
|
+
|
|
24
|
+
// Extract the service name from a fully-qualified type string
|
|
25
|
+
serviceName: (typeName: string) => typeName.split("::")[1] ?? typeName,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create a NamingStrategy instance from parsed results.
|
|
30
|
+
*/
|
|
31
|
+
export function createNaming(inputs: NamingInput[]): NamingStrategy {
|
|
32
|
+
return new NamingStrategy(inputs, namingConfig);
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { packagePipeline } from "@intentius/chant/codegen/package";
|
|
2
|
+
import type { PackagePipelineConfig } from "@intentius/chant/codegen/package";
|
|
3
|
+
import { generate } from "./generate";
|
|
4
|
+
import { dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Package the fixture lexicon for distribution.
|
|
9
|
+
*/
|
|
10
|
+
export async function packageLexicon(options?: { verbose?: boolean; force?: boolean }) {
|
|
11
|
+
const srcDir = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
|
|
13
|
+
const { spec, stats } = await packagePipeline({
|
|
14
|
+
generate: (opts) => generate({ verbose: opts?.verbose, force: opts?.force }),
|
|
15
|
+
buildManifest: (genResult) => ({
|
|
16
|
+
name: "fixture",
|
|
17
|
+
version: "0.0.1",
|
|
18
|
+
}),
|
|
19
|
+
srcDir,
|
|
20
|
+
collectSkills: () => new Map(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
console.error(`Packaged ${stats.resources} resources, ${stats.ruleCount} rules`);
|
|
24
|
+
return { spec, stats };
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, cpSync } from "fs";
|
|
2
|
+
import { join, basename } from "path";
|
|
3
|
+
|
|
4
|
+
export interface Snapshot {
|
|
5
|
+
timestamp: string;
|
|
6
|
+
resources: number;
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List available generation snapshots.
|
|
12
|
+
*/
|
|
13
|
+
export function listSnapshots(snapshotsDir: string): Snapshot[] {
|
|
14
|
+
if (!existsSync(snapshotsDir)) return [];
|
|
15
|
+
|
|
16
|
+
return readdirSync(snapshotsDir)
|
|
17
|
+
.filter((d) => !d.startsWith("."))
|
|
18
|
+
.sort()
|
|
19
|
+
.reverse()
|
|
20
|
+
.map((dir) => {
|
|
21
|
+
const fullPath = join(snapshotsDir, dir);
|
|
22
|
+
const metaPath = join(fullPath, "meta.json");
|
|
23
|
+
let resources = 0;
|
|
24
|
+
if (existsSync(metaPath)) {
|
|
25
|
+
try {
|
|
26
|
+
const meta = JSON.parse(readFileSync(metaPath, "utf-8"));
|
|
27
|
+
resources = meta.resources ?? 0;
|
|
28
|
+
} catch {}
|
|
29
|
+
}
|
|
30
|
+
return { timestamp: dir, resources, path: fullPath };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Restore a snapshot to the generated directory.
|
|
36
|
+
*/
|
|
37
|
+
export function restoreSnapshot(timestamp: string, generatedDir: string): void {
|
|
38
|
+
const snapshotsDir = join(generatedDir, "..", "..", ".snapshots");
|
|
39
|
+
const snapshotDir = join(snapshotsDir, timestamp);
|
|
40
|
+
if (!existsSync(snapshotDir)) {
|
|
41
|
+
throw new Error(`Snapshot not found: ${timestamp}`);
|
|
42
|
+
}
|
|
43
|
+
mkdirSync(generatedDir, { recursive: true });
|
|
44
|
+
cpSync(snapshotDir, generatedDir, { recursive: true });
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage analysis for the fixture lexicon.
|
|
3
|
+
*
|
|
4
|
+
* TODO: Implement coverage analysis that checks how much of the
|
|
5
|
+
* upstream spec is covered by the generated types.
|
|
6
|
+
*/
|
|
7
|
+
export async function analyzeCoverage(options?: { verbose?: boolean }): Promise<void> {
|
|
8
|
+
console.error("Coverage analysis not yet implemented");
|
|
9
|
+
// TODO: Read generated lexicon JSON, compare against upstream spec,
|
|
10
|
+
// and report coverage metrics.
|
|
11
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TypeScriptGenerator } from "@intentius/chant/import/generator";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TypeScript generator for converting imported fixture templates.
|
|
5
|
+
*
|
|
6
|
+
* TODO: Implement the TypeScriptGenerator interface for your format.
|
|
7
|
+
*/
|
|
8
|
+
// export class FixtureGenerator implements TypeScriptGenerator {
|
|
9
|
+
// generate(ir: IR): string { ... }
|
|
10
|
+
// }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TemplateParser } from "@intentius/chant/import/parser";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Template parser for importing external fixture templates.
|
|
5
|
+
*
|
|
6
|
+
* TODO: Implement the TemplateParser interface for your format.
|
|
7
|
+
*/
|
|
8
|
+
// export class FixtureParser implements TemplateParser {
|
|
9
|
+
// parse(data: unknown): IR { ... }
|
|
10
|
+
// }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Plugin
|
|
2
|
+
export { fixturePlugin } from "./plugin";
|
|
3
|
+
|
|
4
|
+
// Serializer
|
|
5
|
+
export { fixtureSerializer } from "./serializer";
|
|
6
|
+
|
|
7
|
+
// Generated resources — export everything from generated index
|
|
8
|
+
// After running `chant generate`, this re-exports all resource classes
|
|
9
|
+
// export * from "./generated/index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { sampleRule } from "./sample";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LintRule, LintDiagnostic, LintContext } from "@intentius/chant/lint/rule";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FIX001: Sample lint rule
|
|
5
|
+
*
|
|
6
|
+
* TODO: Replace with a real lint rule for your lexicon.
|
|
7
|
+
*/
|
|
8
|
+
export const sampleRule: LintRule = {
|
|
9
|
+
id: "FIX001",
|
|
10
|
+
severity: "warning",
|
|
11
|
+
category: "style",
|
|
12
|
+
description: "Sample lint rule — replace with real checks",
|
|
13
|
+
|
|
14
|
+
check(context: LintContext): LintDiagnostic[] {
|
|
15
|
+
// TODO: Implement rule logic
|
|
16
|
+
return [];
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CompletionContext, CompletionItem } from "@intentius/chant/lsp/types";
|
|
2
|
+
// import { LexiconIndex, lexiconCompletions } from "@intentius/chant/lsp/lexicon-providers";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provide LSP completions for fixture resources.
|
|
6
|
+
*
|
|
7
|
+
* TODO: Build a LexiconIndex from your generated lexicon data
|
|
8
|
+
* and delegate to lexiconCompletions().
|
|
9
|
+
*/
|
|
10
|
+
export function completions(ctx: CompletionContext): CompletionItem[] {
|
|
11
|
+
// const index = new LexiconIndex(lexiconData);
|
|
12
|
+
// return lexiconCompletions(ctx, index, "fixture resource");
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
|
|
2
|
+
// import { LexiconIndex, lexiconHover } from "@intentius/chant/lsp/lexicon-providers";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provide LSP hover information for fixture resources.
|
|
6
|
+
*
|
|
7
|
+
* TODO: Build a LexiconIndex from your generated lexicon data
|
|
8
|
+
* and delegate to lexiconHover().
|
|
9
|
+
*/
|
|
10
|
+
export function hover(ctx: HoverContext): HoverInfo | undefined {
|
|
11
|
+
// const index = new LexiconIndex(lexiconData);
|
|
12
|
+
// return lexiconHover(ctx, index, myCustomHoverFormatter);
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { LexiconPlugin } from "@intentius/chant/lexicon";
|
|
2
|
+
import { fixtureSerializer } from "./serializer";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* fixture lexicon plugin.
|
|
6
|
+
*
|
|
7
|
+
* Implements all required LexiconPlugin lifecycle methods.
|
|
8
|
+
*/
|
|
9
|
+
export const fixturePlugin: LexiconPlugin = {
|
|
10
|
+
name: "fixture",
|
|
11
|
+
serializer: fixtureSerializer,
|
|
12
|
+
|
|
13
|
+
// ── Required lifecycle methods ────────────────────────────────
|
|
14
|
+
|
|
15
|
+
async generate(options?: { verbose?: boolean }): Promise<void> {
|
|
16
|
+
const { generate } = await import("./codegen/generate");
|
|
17
|
+
await generate(options);
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
async validate(options?: { verbose?: boolean }): Promise<void> {
|
|
21
|
+
const { validate } = await import("./validate");
|
|
22
|
+
await validate(options);
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
async coverage(options?: { verbose?: boolean; minOverall?: number }): Promise<void> {
|
|
26
|
+
// TODO: Implement coverage analysis
|
|
27
|
+
console.error("Coverage analysis not yet implemented");
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
async package(options?: { verbose?: boolean; force?: boolean }): Promise<void> {
|
|
31
|
+
const { packageLexicon } = await import("./codegen/package");
|
|
32
|
+
await packageLexicon(options);
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
async rollback(options?: { restore?: string; verbose?: boolean }): Promise<void> {
|
|
36
|
+
const { listSnapshots, restoreSnapshot } = await import("./codegen/rollback");
|
|
37
|
+
const { join, dirname } = await import("path");
|
|
38
|
+
const { fileURLToPath } = await import("url");
|
|
39
|
+
|
|
40
|
+
const pkgDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
41
|
+
const snapshotsDir = join(pkgDir, ".snapshots");
|
|
42
|
+
|
|
43
|
+
if (options?.restore) {
|
|
44
|
+
const generatedDir = join(pkgDir, "src", "generated");
|
|
45
|
+
restoreSnapshot(String(options.restore), generatedDir);
|
|
46
|
+
console.error(`Restored snapshot: ${options.restore}`);
|
|
47
|
+
} else {
|
|
48
|
+
const snapshots = listSnapshots(snapshotsDir);
|
|
49
|
+
if (snapshots.length === 0) {
|
|
50
|
+
console.error("No snapshots available.");
|
|
51
|
+
} else {
|
|
52
|
+
console.error(`Available snapshots (${snapshots.length}):`);
|
|
53
|
+
for (const s of snapshots) {
|
|
54
|
+
console.error(` ${s.timestamp} ${s.resources} resources ${s.path}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// ── Optional extensions (uncomment and implement as needed) ───
|
|
61
|
+
|
|
62
|
+
// lintRules(): LintRule[] {
|
|
63
|
+
// return [];
|
|
64
|
+
// },
|
|
65
|
+
|
|
66
|
+
// declarativeRules(): RuleSpec[] {
|
|
67
|
+
// return [];
|
|
68
|
+
// },
|
|
69
|
+
|
|
70
|
+
// postSynthChecks(): PostSynthCheck[] {
|
|
71
|
+
// return [];
|
|
72
|
+
// },
|
|
73
|
+
|
|
74
|
+
// intrinsics(): IntrinsicDef[] {
|
|
75
|
+
// return [];
|
|
76
|
+
// },
|
|
77
|
+
|
|
78
|
+
// pseudoParameters(): string[] {
|
|
79
|
+
// return [];
|
|
80
|
+
// },
|
|
81
|
+
|
|
82
|
+
// detectTemplate(data: unknown): boolean {
|
|
83
|
+
// return false;
|
|
84
|
+
// },
|
|
85
|
+
|
|
86
|
+
// templateParser(): TemplateParser {
|
|
87
|
+
// // return new MyParser();
|
|
88
|
+
// },
|
|
89
|
+
|
|
90
|
+
// templateGenerator(): TypeScriptGenerator {
|
|
91
|
+
// // return new MyGenerator();
|
|
92
|
+
// },
|
|
93
|
+
|
|
94
|
+
// skills(): SkillDefinition[] {
|
|
95
|
+
// return [];
|
|
96
|
+
// },
|
|
97
|
+
|
|
98
|
+
// completionProvider(ctx: CompletionContext): CompletionItem[] {
|
|
99
|
+
// return [];
|
|
100
|
+
// },
|
|
101
|
+
|
|
102
|
+
// hoverProvider(ctx: HoverContext): HoverInfo | undefined {
|
|
103
|
+
// return undefined;
|
|
104
|
+
// },
|
|
105
|
+
|
|
106
|
+
// docs(options?: { verbose?: boolean }): Promise<void> {
|
|
107
|
+
// const { generateDocs } = await import("./codegen/docs");
|
|
108
|
+
// return generateDocs(options);
|
|
109
|
+
// },
|
|
110
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Serializer, Declarable } from "@intentius/chant";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* fixture serializer — produces minimal JSON output.
|
|
5
|
+
*
|
|
6
|
+
* TODO: Replace with your lexicon's output format.
|
|
7
|
+
*/
|
|
8
|
+
export const fixtureSerializer: Serializer = {
|
|
9
|
+
name: "fixture",
|
|
10
|
+
rulePrefix: "FIX",
|
|
11
|
+
|
|
12
|
+
serialize(entities: Map<string, Declarable>): string {
|
|
13
|
+
const resources: Record<string, unknown> = {};
|
|
14
|
+
|
|
15
|
+
for (const [entityName, entity] of entities) {
|
|
16
|
+
resources[entityName] = {
|
|
17
|
+
type: entity.entityType,
|
|
18
|
+
// TODO: Convert entity properties to your output format
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return JSON.stringify({ resources }, null, 2);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { fetchWithCache, extractFromZip } from "@intentius/chant/codegen/fetch";
|
|
2
|
+
|
|
3
|
+
// TODO: Set this to your upstream schema source URL
|
|
4
|
+
const SCHEMA_URL = "https://example.com/schemas.zip";
|
|
5
|
+
const CACHE_FILE = ".cache/schemas.zip";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Fetch upstream schemas with caching.
|
|
9
|
+
*
|
|
10
|
+
* TODO: Point SCHEMA_URL at your real upstream schema source.
|
|
11
|
+
*/
|
|
12
|
+
export async function fetchSchemas(options?: { force?: boolean }): Promise<Map<string, string>> {
|
|
13
|
+
const zipData = await fetchWithCache({
|
|
14
|
+
url: SCHEMA_URL,
|
|
15
|
+
cacheFile: CACHE_FILE,
|
|
16
|
+
force: options?.force,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// TODO: Adjust the filter to match your schema file names
|
|
20
|
+
return extractFromZip(zipData, (name) => name.endsWith(".json"));
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed schema result for a single schema file.
|
|
3
|
+
*/
|
|
4
|
+
export interface ParseResult {
|
|
5
|
+
typeName: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
properties: Map<string, ParsedProperty>;
|
|
8
|
+
attributes: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ParsedProperty {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
required: boolean;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Parse a single schema file into a ParseResult.
|
|
20
|
+
*
|
|
21
|
+
* TODO: Implement parsing for your schema format.
|
|
22
|
+
*/
|
|
23
|
+
export function parseSchema(name: string, content: string): ParseResult {
|
|
24
|
+
throw new Error(`TODO: implement parseSchema for ${name}`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate generated artifacts for the fixture lexicon.
|
|
3
|
+
*
|
|
4
|
+
* TODO: Add validation checks for your generated files.
|
|
5
|
+
*/
|
|
6
|
+
export async function validate(options?: { verbose?: boolean }): Promise<void> {
|
|
7
|
+
const checks = [
|
|
8
|
+
// TODO: Add checks — e.g. verify lexicon JSON exists, types compile,
|
|
9
|
+
// registry has expected resources, etc.
|
|
10
|
+
{ name: "placeholder", ok: true, error: undefined as string | undefined },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
for (const check of checks) {
|
|
14
|
+
const status = check.ok ? "OK" : "FAIL";
|
|
15
|
+
const msg = check.error ? ` — ${check.error}` : "";
|
|
16
|
+
console.error(` [${status}] ${check.name}${msg}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const failed = checks.filter((c) => !c.ok);
|
|
20
|
+
if (failed.length > 0) {
|
|
21
|
+
throw new Error("Validation failed");
|
|
22
|
+
}
|
|
23
|
+
console.error("All validation checks passed.");
|
|
24
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
|
+
|
|
3
|
+
exports[`init-lexicon fixture snapshot fixture generate.ts matches snapshot 1`] = `
|
|
4
|
+
"import { generatePipeline, writeGeneratedArtifacts } from "@intentius/chant/codegen/generate";
|
|
5
|
+
import type { GenerateResult } from "@intentius/chant/codegen/generate";
|
|
6
|
+
import { dirname } from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Run the code generation pipeline.
|
|
11
|
+
*
|
|
12
|
+
* Each callback has a TODO describing what to implement.
|
|
13
|
+
*/
|
|
14
|
+
export async function generate(options?: { verbose?: boolean }): Promise<GenerateResult> {
|
|
15
|
+
const result = await generatePipeline({
|
|
16
|
+
// Must return Map<typeName, Buffer> — each entry is one schema file.
|
|
17
|
+
// Example: fetch a zip, extract JSON files, key by type name.
|
|
18
|
+
// See lexicons/aws/src/spec/fetch.ts for a working example.
|
|
19
|
+
fetchSchemas: async (opts) => {
|
|
20
|
+
throw new Error("TODO: implement fetchSchemas — download your upstream spec");
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Must return a ParsedResult (with propertyTypes[] and enums[] at minimum).
|
|
24
|
+
// Return null to skip a schema file.
|
|
25
|
+
// See lexicons/aws/src/spec/parse.ts for a working example.
|
|
26
|
+
parseSchema: (name, data) => {
|
|
27
|
+
throw new Error("TODO: implement parseSchema — parse a single schema file");
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// Must return a NamingStrategy instance.
|
|
31
|
+
// See lexicons/aws/src/codegen/naming.ts and ./naming.ts for setup.
|
|
32
|
+
createNaming: (results) => {
|
|
33
|
+
throw new Error("TODO: implement createNaming — return a NamingStrategy instance");
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Must return a string of JSON (the lexicon registry).
|
|
37
|
+
// Use buildRegistry + serializeRegistry from @intentius/chant/codegen/generate-registry.
|
|
38
|
+
// See lexicons/aws/src/codegen/generate.ts for a working example.
|
|
39
|
+
generateRegistry: (results, naming) => {
|
|
40
|
+
throw new Error("TODO: implement generateRegistry — produce lexicon JSON");
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// Must return a string of TypeScript declarations (.d.ts content).
|
|
44
|
+
// See lexicons/aws/src/codegen/generate.ts for a working example.
|
|
45
|
+
generateTypes: (results, naming) => {
|
|
46
|
+
throw new Error("TODO: implement generateTypes — produce .d.ts content");
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
// Must return a string of TypeScript (runtime index with factory exports).
|
|
50
|
+
// Use generateRuntimeIndex from @intentius/chant/codegen/generate-runtime-index.
|
|
51
|
+
// See lexicons/aws/src/codegen/generate.ts for a working example.
|
|
52
|
+
generateRuntimeIndex: (results, naming) => {
|
|
53
|
+
throw new Error("TODO: implement generateRuntimeIndex — produce index.ts content");
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (options?.verbose) {
|
|
58
|
+
console.error(\`Generated \${result.resources} resources, \${result.properties} property types\`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Write generated files to the package directory.
|
|
66
|
+
*/
|
|
67
|
+
export function writeGeneratedFiles(result: GenerateResult, pkgDir?: string): void {
|
|
68
|
+
const dir = pkgDir ?? dirname(dirname(fileURLToPath(import.meta.url)));
|
|
69
|
+
writeGeneratedArtifacts({
|
|
70
|
+
baseDir: dir,
|
|
71
|
+
files: {
|
|
72
|
+
"lexicon.json": result.lexiconJSON,
|
|
73
|
+
"index.d.ts": result.typesDTS,
|
|
74
|
+
"index.ts": result.indexTS,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
"
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
exports[`init-lexicon fixture snapshot fixture package.ts matches snapshot 1`] = `
|
|
82
|
+
"import { packagePipeline } from "@intentius/chant/codegen/package";
|
|
83
|
+
import type { PackagePipelineConfig } from "@intentius/chant/codegen/package";
|
|
84
|
+
import { generate } from "./generate";
|
|
85
|
+
import { dirname } from "path";
|
|
86
|
+
import { fileURLToPath } from "url";
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Package the fixture lexicon for distribution.
|
|
90
|
+
*/
|
|
91
|
+
export async function packageLexicon(options?: { verbose?: boolean; force?: boolean }) {
|
|
92
|
+
const srcDir = dirname(fileURLToPath(import.meta.url));
|
|
93
|
+
|
|
94
|
+
const { spec, stats } = await packagePipeline({
|
|
95
|
+
generate: (opts) => generate({ verbose: opts?.verbose, force: opts?.force }),
|
|
96
|
+
buildManifest: (genResult) => ({
|
|
97
|
+
name: "fixture",
|
|
98
|
+
version: "0.0.1",
|
|
99
|
+
}),
|
|
100
|
+
srcDir,
|
|
101
|
+
collectSkills: () => new Map(),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
console.error(\`Packaged \${stats.resources} resources, \${stats.ruleCount} rules\`);
|
|
105
|
+
return { spec, stats };
|
|
106
|
+
}
|
|
107
|
+
"
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
exports[`init-lexicon fixture snapshot fixture plugin.ts matches snapshot 1`] = `
|
|
111
|
+
"import type { LexiconPlugin } from "@intentius/chant/lexicon";
|
|
112
|
+
import { fixtureSerializer } from "./serializer";
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* fixture lexicon plugin.
|
|
116
|
+
*
|
|
117
|
+
* Implements all required LexiconPlugin lifecycle methods.
|
|
118
|
+
*/
|
|
119
|
+
export const fixturePlugin: LexiconPlugin = {
|
|
120
|
+
name: "fixture",
|
|
121
|
+
serializer: fixtureSerializer,
|
|
122
|
+
|
|
123
|
+
// ── Required lifecycle methods ────────────────────────────────
|
|
124
|
+
|
|
125
|
+
async generate(options?: { verbose?: boolean }): Promise<void> {
|
|
126
|
+
const { generate } = await import("./codegen/generate");
|
|
127
|
+
await generate(options);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
async validate(options?: { verbose?: boolean }): Promise<void> {
|
|
131
|
+
const { validate } = await import("./validate");
|
|
132
|
+
await validate(options);
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
async coverage(options?: { verbose?: boolean; minOverall?: number }): Promise<void> {
|
|
136
|
+
// TODO: Implement coverage analysis
|
|
137
|
+
console.error("Coverage analysis not yet implemented");
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
async package(options?: { verbose?: boolean; force?: boolean }): Promise<void> {
|
|
141
|
+
const { packageLexicon } = await import("./codegen/package");
|
|
142
|
+
await packageLexicon(options);
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
async rollback(options?: { restore?: string; verbose?: boolean }): Promise<void> {
|
|
146
|
+
const { listSnapshots, restoreSnapshot } = await import("./codegen/rollback");
|
|
147
|
+
const { join, dirname } = await import("path");
|
|
148
|
+
const { fileURLToPath } = await import("url");
|
|
149
|
+
|
|
150
|
+
const pkgDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
151
|
+
const snapshotsDir = join(pkgDir, ".snapshots");
|
|
152
|
+
|
|
153
|
+
if (options?.restore) {
|
|
154
|
+
const generatedDir = join(pkgDir, "src", "generated");
|
|
155
|
+
restoreSnapshot(String(options.restore), generatedDir);
|
|
156
|
+
console.error(\`Restored snapshot: \${options.restore}\`);
|
|
157
|
+
} else {
|
|
158
|
+
const snapshots = listSnapshots(snapshotsDir);
|
|
159
|
+
if (snapshots.length === 0) {
|
|
160
|
+
console.error("No snapshots available.");
|
|
161
|
+
} else {
|
|
162
|
+
console.error(\`Available snapshots (\${snapshots.length}):\`);
|
|
163
|
+
for (const s of snapshots) {
|
|
164
|
+
console.error(\` \${s.timestamp} \${s.resources} resources \${s.path}\`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
// ── Optional extensions (uncomment and implement as needed) ───
|
|
171
|
+
|
|
172
|
+
// lintRules(): LintRule[] {
|
|
173
|
+
// return [];
|
|
174
|
+
// },
|
|
175
|
+
|
|
176
|
+
// declarativeRules(): RuleSpec[] {
|
|
177
|
+
// return [];
|
|
178
|
+
// },
|
|
179
|
+
|
|
180
|
+
// postSynthChecks(): PostSynthCheck[] {
|
|
181
|
+
// return [];
|
|
182
|
+
// },
|
|
183
|
+
|
|
184
|
+
// intrinsics(): IntrinsicDef[] {
|
|
185
|
+
// return [];
|
|
186
|
+
// },
|
|
187
|
+
|
|
188
|
+
// pseudoParameters(): string[] {
|
|
189
|
+
// return [];
|
|
190
|
+
// },
|
|
191
|
+
|
|
192
|
+
// detectTemplate(data: unknown): boolean {
|
|
193
|
+
// return false;
|
|
194
|
+
// },
|
|
195
|
+
|
|
196
|
+
// templateParser(): TemplateParser {
|
|
197
|
+
// // return new MyParser();
|
|
198
|
+
// },
|
|
199
|
+
|
|
200
|
+
// templateGenerator(): TypeScriptGenerator {
|
|
201
|
+
// // return new MyGenerator();
|
|
202
|
+
// },
|
|
203
|
+
|
|
204
|
+
// skills(): SkillDefinition[] {
|
|
205
|
+
// return [];
|
|
206
|
+
// },
|
|
207
|
+
|
|
208
|
+
// completionProvider(ctx: CompletionContext): CompletionItem[] {
|
|
209
|
+
// return [];
|
|
210
|
+
// },
|
|
211
|
+
|
|
212
|
+
// hoverProvider(ctx: HoverContext): HoverInfo | undefined {
|
|
213
|
+
// return undefined;
|
|
214
|
+
// },
|
|
215
|
+
|
|
216
|
+
// docs(options?: { verbose?: boolean }): Promise<void> {
|
|
217
|
+
// const { generateDocs } = await import("./codegen/docs");
|
|
218
|
+
// return generateDocs(options);
|
|
219
|
+
// },
|
|
220
|
+
};
|
|
221
|
+
"
|
|
222
|
+
`;
|