@typra/emitter 0.2.0 → 0.2.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.
@@ -1,43 +1,43 @@
1
- import "@typra/emitter";
2
-
3
- namespace Typra.Fixtures;
4
-
5
- model FixtureRoot {
6
- @doc("Required scalar field")
7
- name: string;
8
-
9
- @doc("Optional scalar field")
10
- description?: string;
11
-
12
- @doc("Array of scalar tags")
13
- tags: string[];
14
-
15
- @doc("Dictionary-shaped metadata")
16
- metadata?: Record<unknown>;
17
-
18
- @doc("Nested object field")
19
- owner: FixtureOwner;
20
-
21
- @doc("Discriminated union field")
22
- content: FixtureContent;
23
- }
24
-
25
- model FixtureOwner {
26
- id: string;
27
- displayName?: string;
28
- }
29
-
30
- @discriminator("kind")
31
- model FixtureContent {
32
- kind: string;
33
- }
34
-
35
- model TextContent extends FixtureContent {
36
- kind: "text";
37
- text: string;
38
- }
39
-
40
- model ImageContent extends FixtureContent {
41
- kind: "image";
42
- url: string;
43
- }
1
+ import "@typra/emitter";
2
+
3
+ namespace Typra.Fixtures;
4
+
5
+ model FixtureRoot {
6
+ @doc("Required scalar field")
7
+ name: string;
8
+
9
+ @doc("Optional scalar field")
10
+ description?: string;
11
+
12
+ @doc("Array of scalar tags")
13
+ tags: string[];
14
+
15
+ @doc("Dictionary-shaped metadata")
16
+ metadata?: Record<unknown>;
17
+
18
+ @doc("Nested object field")
19
+ owner: FixtureOwner;
20
+
21
+ @doc("Discriminated union field")
22
+ content: FixtureContent;
23
+ }
24
+
25
+ model FixtureOwner {
26
+ id: string;
27
+ displayName?: string;
28
+ }
29
+
30
+ @discriminator("kind")
31
+ model FixtureContent {
32
+ kind: string;
33
+ }
34
+
35
+ model TextContent extends FixtureContent {
36
+ kind: "text";
37
+ text: string;
38
+ }
39
+
40
+ model ImageContent extends FixtureContent {
41
+ kind: "image";
42
+ url: string;
43
+ }
@@ -1,13 +1,13 @@
1
- emit:
2
- - "@typra/emitter"
3
- options:
4
- "@typra/emitter":
5
- emitter-output-dir: "{cwd}/generated/fixtures"
6
- root-object: "Typra.Fixtures.FixtureRoot"
7
- root-namespace: "Typra.Fixtures"
8
- emit-targets:
9
- - type: TypeScript
10
- output-dir: "generated/fixtures/typescript"
11
- test-dir: "generated/fixtures/typescript/tests"
12
- import-path: "../index"
13
- format: false
1
+ emit:
2
+ - "@typra/emitter"
3
+ options:
4
+ "@typra/emitter":
5
+ emitter-output-dir: "{cwd}/generated/fixtures"
6
+ root-object: "Typra.Fixtures.FixtureRoot"
7
+ root-namespace: "Typra.Fixtures"
8
+ emit-targets:
9
+ - type: TypeScript
10
+ output-dir: "generated/fixtures/typescript"
11
+ test-dir: "generated/fixtures/typescript/tests"
12
+ import-path: "../index"
13
+ format: false
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@typra/emitter",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Generic TypeSpec emitter for generating multi-runtime model surfaces",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/sethjuarez/typra"
8
+ "url": "git+https://github.com/sethjuarez/typra.git",
9
+ "directory": "packages/typra-emitter"
9
10
  },
10
11
  "type": "module",
11
12
  "main": "dist/src/index.js",
12
13
  "types": "dist/src/index.d.ts",
13
14
  "tspMain": "src/lib/main.tsp",
14
15
  "bin": {
15
- "typra-generate": "./dist/src/cli.js"
16
+ "typra-generate": "dist/src/cli.js"
16
17
  },
17
18
  "exports": {
18
19
  ".": {
@@ -43,7 +44,6 @@
43
44
  },
44
45
  "devDependencies": {
45
46
  "@types/node": "^24.7.0",
46
-
47
47
  "@typescript-eslint/eslint-plugin": "^8.15.0",
48
48
  "@typescript-eslint/parser": "^8.15.0",
49
49
  "@typespec/compiler": "latest",
@@ -69,8 +69,7 @@
69
69
  },
70
70
  "packageManager": "npm@11.5.1+sha512.232e6f5d9e799bcb486920b3e9ba907fdf96e576cf7e8c9446c8162e33a416096a1d37a9e910d9a918f6b1f606791c99bc6bb61ee2569b496ec74af13d0dbd95",
71
71
  "dependencies": {
72
-
73
72
  "xml-formatter": "^3.6.7",
74
73
  "yaml": "^2.8.1"
75
74
  }
76
- }
75
+ }