@canonical/design-system 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  2. package/.github/workflows/ci.yml +39 -0
  3. package/.mcp.json +1 -3
  4. package/biome.json +1 -1
  5. package/bun.lock +38 -35
  6. package/data/apps_launchpad/component/badge.ttl +2 -1
  7. package/data/apps_launchpad/component/button.ttl +2 -1
  8. package/data/apps_launchpad/component/combobox.ttl +2 -1
  9. package/data/apps_launchpad/component/text_input.ttl +2 -1
  10. package/data/apps_launchpad/component/tooltip.ttl +2 -1
  11. package/data/global/component/announcement.ttl +1 -1
  12. package/data/global/component/button.ttl +3 -1
  13. package/data/global/component/code_snippet.ttl +1 -1
  14. package/data/global/component/heading.ttl +3 -2
  15. package/data/global/component/tile.ttl +1 -1
  16. package/data/global/component/tooltip.ttl +38 -19
  17. package/data/global/pattern/dropdown_button.ttl +1 -1
  18. package/data/global/pattern/timeline.ttl +8 -4
  19. package/definitions/ontology.ttl +108 -161
  20. package/package.json +1 -1
  21. package/skills/anatomy-author/SKILL.md +5 -0
  22. package/skills/component-specifier/SKILL.md +5 -2
  23. package/skills/design-auditor/SKILL.md +5 -0
  24. package/source.json +7 -2
  25. package/src/cli.ts +33 -33
  26. package/src/collect/generateTurtle.tests.ts +181 -176
  27. package/src/collect/generateTurtle.ts +189 -138
  28. package/src/collect/index.ts +5 -2
  29. package/src/collect/scanAnnotations.tests.ts +116 -110
  30. package/src/collect/scanAnnotations.ts +35 -33
  31. package/src/collect/types.ts +34 -33
  32. package/src/collect/validateCollectConfig.tests.ts +135 -112
  33. package/src/collect/validateCollectConfig.ts +60 -54
  34. package/src/collect-implementations.ts +101 -88
  35. package/src/commands/extract.tests.ts +31 -32
  36. package/src/commands/extract.ts +29 -27
  37. package/src/commands/index.ts +1 -1
  38. package/src/commands/list.tests.ts +13 -14
  39. package/src/commands/list.ts +9 -9
  40. package/src/commands/transform.tests.ts +21 -21
  41. package/src/commands/transform.ts +118 -114
  42. package/src/config/types.ts +40 -40
  43. package/src/config/validateConfig.tests.ts +31 -31
  44. package/src/config/validateConfig.ts +9 -9
  45. package/src/constants.ts +7 -8
  46. package/src/graph/GraphStore.tests.ts +111 -111
  47. package/src/graph/GraphStore.ts +205 -189
  48. package/src/graph/PrefixMap.tests.ts +124 -122
  49. package/src/graph/PrefixMap.ts +77 -77
  50. package/src/graph/buildUri.tests.ts +116 -116
  51. package/src/graph/buildUri.ts +45 -45
  52. package/src/graph/index.ts +2 -2
  53. package/src/graph/types.ts +3 -3
  54. package/src/providers/CodaProvider.tests.ts +233 -233
  55. package/src/providers/CodaProvider.ts +145 -145
  56. package/src/providers/CodaProvider.types.generated.ts +12484 -12123
  57. package/src/providers/index.ts +13 -13
  58. package/src/serializers/JSONSerializer.tests.ts +64 -64
  59. package/src/serializers/JSONSerializer.ts +51 -51
  60. package/src/serializers/TTLSerializer.tests.ts +45 -45
  61. package/src/serializers/TTLSerializer.ts +64 -57
  62. package/src/serializers/index.ts +4 -1
  63. package/src/serializers/types.ts +3 -3
  64. package/src/transform/resolveReferences.tests.ts +47 -43
  65. package/src/transform/resolveReferences.ts +18 -18
  66. package/src/transform/resolveValue.tests.ts +55 -49
  67. package/src/transform/resolveValue.ts +48 -48
  68. package/src/transform/transform.tests.ts +90 -77
  69. package/src/transform/transform.ts +77 -77
  70. package/src/transform/transformRow.tests.ts +372 -356
  71. package/src/transform/transformRow.ts +222 -191
  72. package/src/transform/types.ts +4 -4
  73. package/tsconfig.json +2 -1
  74. package/.gemini/settings.json +0 -14
@@ -2,156 +2,156 @@ import { describe, expect, it } from "vitest";
2
2
  import GraphStore from "./GraphStore.js";
3
3
 
4
4
  describe("GraphStore", () => {
5
- describe("addQuad", () => {
6
- it("should add a quad with URI object", () => {
7
- const store = new GraphStore();
5
+ describe("addQuad", () => {
6
+ it("should add a quad with URI object", () => {
7
+ const store = new GraphStore();
8
8
 
9
- store.addQuad("ds:button", "rdf:type", "ds:Component");
9
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
10
10
 
11
- expect(store.size()).toBe(1);
12
- });
11
+ expect(store.size()).toBe(1);
12
+ });
13
13
 
14
- it("should add a quad with literal object", () => {
15
- const store = new GraphStore();
14
+ it("should add a quad with literal object", () => {
15
+ const store = new GraphStore();
16
16
 
17
- store.addLiteral("ds:button", "ds:name", "Button");
17
+ store.addLiteral("ds:button", "ds:name", "Button");
18
18
 
19
- expect(store.size()).toBe(1);
20
- });
19
+ expect(store.size()).toBe(1);
20
+ });
21
21
 
22
- it("should add multiple quads", () => {
23
- const store = new GraphStore();
22
+ it("should add multiple quads", () => {
23
+ const store = new GraphStore();
24
24
 
25
- store.addQuad("ds:button", "rdf:type", "ds:Component");
26
- store.addLiteral("ds:button", "ds:name", "Button");
27
- store.addQuad("ds:button", "ds:tier", "ds:global");
25
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
26
+ store.addLiteral("ds:button", "ds:name", "Button");
27
+ store.addQuad("ds:button", "ds:tier", "ds:global");
28
28
 
29
- expect(store.size()).toBe(3);
30
- });
31
- });
29
+ expect(store.size()).toBe(3);
30
+ });
31
+ });
32
32
 
33
- describe("getQuads", () => {
34
- it("should return all quads", () => {
35
- const store = new GraphStore();
36
- store.addQuad("ds:button", "rdf:type", "ds:Component");
37
- store.addLiteral("ds:button", "ds:name", "Button");
33
+ describe("getQuads", () => {
34
+ it("should return all quads", () => {
35
+ const store = new GraphStore();
36
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
37
+ store.addLiteral("ds:button", "ds:name", "Button");
38
38
 
39
- const quads = store.getQuads();
39
+ const quads = store.getQuads();
40
40
 
41
- expect(quads).toHaveLength(2);
42
- });
41
+ expect(quads).toHaveLength(2);
42
+ });
43
43
 
44
- it("should return empty array for empty store", () => {
45
- const store = new GraphStore();
44
+ it("should return empty array for empty store", () => {
45
+ const store = new GraphStore();
46
46
 
47
- const quads = store.getQuads();
47
+ const quads = store.getQuads();
48
48
 
49
- expect(quads).toHaveLength(0);
50
- });
51
- });
49
+ expect(quads).toHaveLength(0);
50
+ });
51
+ });
52
52
 
53
- describe("getQuadsForSubject", () => {
54
- it("should return quads for a specific subject", () => {
55
- const store = new GraphStore();
56
- store.addQuad("ds:button", "rdf:type", "ds:Component");
57
- store.addLiteral("ds:button", "ds:name", "Button");
58
- store.addQuad("ds:input", "rdf:type", "ds:Component");
53
+ describe("getQuadsForSubject", () => {
54
+ it("should return quads for a specific subject", () => {
55
+ const store = new GraphStore();
56
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
57
+ store.addLiteral("ds:button", "ds:name", "Button");
58
+ store.addQuad("ds:input", "rdf:type", "ds:Component");
59
59
 
60
- const quads = store.getQuadsForSubject("ds:button");
60
+ const quads = store.getQuadsForSubject("ds:button");
61
61
 
62
- expect(quads).toHaveLength(2);
63
- });
62
+ expect(quads).toHaveLength(2);
63
+ });
64
64
 
65
- it("should return empty array for unknown subject", () => {
66
- const store = new GraphStore();
67
- store.addQuad("ds:button", "rdf:type", "ds:Component");
65
+ it("should return empty array for unknown subject", () => {
66
+ const store = new GraphStore();
67
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
68
68
 
69
- const quads = store.getQuadsForSubject("ds:unknown");
69
+ const quads = store.getQuadsForSubject("ds:unknown");
70
70
 
71
- expect(quads).toHaveLength(0);
72
- });
73
- });
71
+ expect(quads).toHaveLength(0);
72
+ });
73
+ });
74
74
 
75
- describe("getSubjects", () => {
76
- it("should return unique subjects", () => {
77
- const store = new GraphStore();
78
- store.addQuad("ds:button", "rdf:type", "ds:Component");
79
- store.addLiteral("ds:button", "ds:name", "Button");
80
- store.addQuad("ds:input", "rdf:type", "ds:Component");
75
+ describe("getSubjects", () => {
76
+ it("should return unique subjects", () => {
77
+ const store = new GraphStore();
78
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
79
+ store.addLiteral("ds:button", "ds:name", "Button");
80
+ store.addQuad("ds:input", "rdf:type", "ds:Component");
81
81
 
82
- const subjects = store.getSubjects();
82
+ const subjects = store.getSubjects();
83
83
 
84
- expect(subjects).toHaveLength(2);
85
- expect(subjects).toContain("ds:button");
86
- expect(subjects).toContain("ds:input");
87
- });
88
- });
84
+ expect(subjects).toHaveLength(2);
85
+ expect(subjects).toContain("ds:button");
86
+ expect(subjects).toContain("ds:input");
87
+ });
88
+ });
89
89
 
90
- describe("getN3Store", () => {
91
- it("should return underlying n3 store for serializers", () => {
92
- const store = new GraphStore();
93
- store.addQuad("ds:button", "rdf:type", "ds:Component");
90
+ describe("getN3Store", () => {
91
+ it("should return underlying n3 store for serializers", () => {
92
+ const store = new GraphStore();
93
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
94
94
 
95
- const n3Store = store.getN3Store();
95
+ const n3Store = store.getN3Store();
96
96
 
97
- expect(n3Store).toBeDefined();
98
- expect(n3Store.size).toBe(1);
99
- });
100
- });
97
+ expect(n3Store).toBeDefined();
98
+ expect(n3Store.size).toBe(1);
99
+ });
100
+ });
101
101
 
102
- describe("clear", () => {
103
- it("should remove all quads", () => {
104
- const store = new GraphStore();
105
- store.addQuad("ds:button", "rdf:type", "ds:Component");
106
- store.addLiteral("ds:button", "ds:name", "Button");
102
+ describe("clear", () => {
103
+ it("should remove all quads", () => {
104
+ const store = new GraphStore();
105
+ store.addQuad("ds:button", "rdf:type", "ds:Component");
106
+ store.addLiteral("ds:button", "ds:name", "Button");
107
107
 
108
- store.clear();
108
+ store.clear();
109
109
 
110
- expect(store.size()).toBe(0);
111
- });
112
- });
110
+ expect(store.size()).toBe(0);
111
+ });
112
+ });
113
113
 
114
- describe("blank nodes", () => {
115
- it("should create a blank node", () => {
116
- const store = new GraphStore();
114
+ describe("blank nodes", () => {
115
+ it("should create a blank node", () => {
116
+ const store = new GraphStore();
117
117
 
118
- const bn = store.createBlankNode();
118
+ const bn = store.createBlankNode();
119
119
 
120
- expect(bn).toBeDefined();
121
- expect(bn.termType).toBe("BlankNode");
122
- });
120
+ expect(bn).toBeDefined();
121
+ expect(bn.termType).toBe("BlankNode");
122
+ });
123
123
 
124
- it("should add a quad with blank node as object", () => {
125
- const store = new GraphStore();
126
- const bn = store.createBlankNode();
124
+ it("should add a quad with blank node as object", () => {
125
+ const store = new GraphStore();
126
+ const bn = store.createBlankNode();
127
127
 
128
- store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
128
+ store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
129
129
 
130
- expect(store.size()).toBe(1);
131
- const quads = store.getQuads();
132
- expect(quads[0].object.termType).toBe("BlankNode");
133
- });
130
+ expect(store.size()).toBe(1);
131
+ const quads = store.getQuads();
132
+ expect(quads[0].object.termType).toBe("BlankNode");
133
+ });
134
134
 
135
- it("should add quads from blank node subject", () => {
136
- const store = new GraphStore();
137
- const bn = store.createBlankNode();
135
+ it("should add quads from blank node subject", () => {
136
+ const store = new GraphStore();
137
+ const bn = store.createBlankNode();
138
138
 
139
- store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
140
- store.addLiteralFromBlankNode(bn, "ds:name", "content");
141
- store.addQuadFromBlankNode(bn, "rdf:type", "ds:Property");
139
+ store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
140
+ store.addLiteralFromBlankNode(bn, "ds:name", "content");
141
+ store.addQuadFromBlankNode(bn, "rdf:type", "ds:Property");
142
142
 
143
- expect(store.size()).toBe(3);
144
- });
143
+ expect(store.size()).toBe(3);
144
+ });
145
145
 
146
- it("should serialize inline blank nodes in turtle", async () => {
147
- const store = new GraphStore();
148
- const bn = store.createBlankNode();
146
+ it("should serialize inline blank nodes in turtle", async () => {
147
+ const store = new GraphStore();
148
+ const bn = store.createBlankNode();
149
149
 
150
- store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
151
- store.addLiteralFromBlankNode(bn, "ds:name", "content");
150
+ store.addBlankNodeQuad("ds:button", "ds:hasProperty", bn);
151
+ store.addLiteralFromBlankNode(bn, "ds:name", "content");
152
152
 
153
- const quads = store.getQuads();
154
- expect(quads).toHaveLength(2);
155
- });
156
- });
153
+ const quads = store.getQuads();
154
+ expect(quads).toHaveLength(2);
155
+ });
156
+ });
157
157
  });