@typra/emitter 0.2.5 → 0.2.7

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.
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+ import { formatVerifySummary, verifyTypraMetadata } from "./verify/index.js";
4
+ const HELP = `
5
+ typra-verify - Verify Typra generated metadata drift
6
+
7
+ Usage:
8
+ npx typra-verify --baseline <dir> --current <dir> [options]
9
+
10
+ Options:
11
+ --baseline <dir> Baseline output root or .typra-generated directory (required)
12
+ --current <dir> Current output root or .typra-generated directory (required)
13
+ --config <file> Optional verifier config JSON with protectedPaths
14
+ --json Print machine-readable JSON result
15
+ -h, --help Show this help message
16
+ `;
17
+ async function main() {
18
+ const { values } = parseArgs({
19
+ options: {
20
+ baseline: { type: "string" },
21
+ current: { type: "string" },
22
+ config: { type: "string" },
23
+ json: { type: "boolean", default: false },
24
+ help: { type: "boolean", short: "h" },
25
+ },
26
+ });
27
+ if (values.help) {
28
+ console.log(HELP);
29
+ process.exit(0);
30
+ }
31
+ if (!values.baseline || !values.current) {
32
+ console.error("Error: --baseline and --current are required.\n");
33
+ console.log(HELP);
34
+ process.exit(1);
35
+ }
36
+ const result = verifyTypraMetadata({
37
+ baselineRoot: values.baseline,
38
+ currentRoot: values.current,
39
+ configPath: values.config,
40
+ });
41
+ if (values.json) {
42
+ console.log(JSON.stringify(result, null, 2));
43
+ }
44
+ else {
45
+ process.stdout.write(formatVerifySummary(result));
46
+ }
47
+ process.exit(result.ok ? 0 : 1);
48
+ }
49
+ main().catch((error) => {
50
+ console.error(error instanceof Error ? error.message : String(error));
51
+ process.exit(1);
52
+ });
53
+ //# sourceMappingURL=verify-cli.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typra/emitter",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Generic TypeSpec emitter for generating multi-runtime model surfaces",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,7 +13,9 @@
13
13
  "types": "dist/src/index.d.ts",
14
14
  "tspMain": "src/lib/main.tsp",
15
15
  "bin": {
16
- "typra-generate": "dist/src/cli.js"
16
+ "typra-generate": "dist/src/cli.js",
17
+ "typra-verify": "dist/src/verify-cli.js",
18
+ "typra-consumer-smoke": "dist/src/consumer-smoke.js"
17
19
  },
18
20
  "exports": {
19
21
  ".": {
@@ -24,6 +26,10 @@
24
26
  "types": "./dist/src/generate.d.ts",
25
27
  "default": "./dist/src/generate.js"
26
28
  },
29
+ "./verify": {
30
+ "types": "./dist/src/verify/index.d.ts",
31
+ "default": "./dist/src/verify/index.js"
32
+ },
27
33
  "./testing": {
28
34
  "types": "./dist/src/testing/index.d.ts",
29
35
  "default": "./dist/src/testing/index.js"
@@ -40,15 +46,15 @@
40
46
  "fixtures/tspconfig.yaml"
41
47
  ],
42
48
  "peerDependencies": {
43
- "@typespec/compiler": "latest",
44
- "@typespec/json-schema": "latest"
49
+ "@typespec/compiler": "1.10.0",
50
+ "@typespec/json-schema": "1.10.0"
45
51
  },
46
52
  "devDependencies": {
47
53
  "@types/node": "^24.7.0",
48
54
  "@typescript-eslint/eslint-plugin": "^8.15.0",
49
55
  "@typescript-eslint/parser": "^8.15.0",
50
- "@typespec/compiler": "latest",
51
- "@typespec/json-schema": "^1.8.0",
56
+ "@typespec/compiler": "1.10.0",
57
+ "@typespec/json-schema": "1.10.0",
52
58
  "eslint": "^9.15.0",
53
59
  "markdownlint-cli": "^0.48.0",
54
60
  "prettier": "^3.3.3",