@vertekum/schema-builder 0.1.2 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vertekum/schema-builder
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`67ef6d9`](https://github.com/moros-oxus/vertekum/commit/67ef6d96ad209072df270adccaa7ee879edbc30e) Thanks [@tschemmer](https://github.com/tschemmer)! - The package now ships a TextMate grammar and language configuration for `.dfn` files under `grammar/` — the single source editor integrations and documentation highlighters (e.g. Shiki) consume.
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,11 @@
1
+ {
2
+ "comments": {
3
+ "lineComment": "#"
4
+ },
5
+ "brackets": [["[", "]"], ["<", ">"]],
6
+ "autoClosingPairs": [
7
+ { "open": "[", "close": "]" },
8
+ { "open": "\"", "close": "\"" }
9
+ ],
10
+ "surroundingPairs": [["[", "]"], ["<", ">"], ["\"", "\""]]
11
+ }
@@ -0,0 +1,251 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "DFN",
4
+ "scopeName": "source.dfn",
5
+ "patterns": [
6
+ {
7
+ "include": "#comment"
8
+ },
9
+ {
10
+ "include": "#pragma"
11
+ },
12
+ {
13
+ "include": "#use"
14
+ },
15
+ {
16
+ "include": "#root"
17
+ },
18
+ {
19
+ "include": "#production"
20
+ },
21
+ {
22
+ "include": "#expression"
23
+ }
24
+ ],
25
+ "repository": {
26
+ "comment": {
27
+ "name": "comment.line.number-sign.dfn",
28
+ "match": "#.*$"
29
+ },
30
+ "string": {
31
+ "name": "string.quoted.double.dfn",
32
+ "begin": "\"",
33
+ "end": "\"",
34
+ "patterns": []
35
+ },
36
+ "pragma": {
37
+ "match": "^(id|title|description|scope)\\s+(?=\")",
38
+ "captures": {
39
+ "1": {
40
+ "name": "keyword.other.pragma.dfn"
41
+ }
42
+ }
43
+ },
44
+ "use": {
45
+ "match": "^(use)\\s+(?=\")",
46
+ "captures": {
47
+ "1": {
48
+ "name": "keyword.control.import.dfn"
49
+ }
50
+ }
51
+ },
52
+ "root": {
53
+ "match": "^(root)\\s*(=)",
54
+ "captures": {
55
+ "1": {
56
+ "name": "keyword.control.root.dfn"
57
+ },
58
+ "2": {
59
+ "name": "keyword.operator.assignment.dfn"
60
+ }
61
+ }
62
+ },
63
+ "production": {
64
+ "match": "^([A-Za-z][A-Za-z0-9-]*)\\s*(=)",
65
+ "captures": {
66
+ "1": {
67
+ "name": "entity.name.function.production.dfn"
68
+ },
69
+ "2": {
70
+ "name": "keyword.operator.assignment.dfn"
71
+ }
72
+ }
73
+ },
74
+ "expression": {
75
+ "patterns": [
76
+ {
77
+ "include": "#string"
78
+ },
79
+ {
80
+ "include": "#reference"
81
+ },
82
+ {
83
+ "include": "#range"
84
+ },
85
+ {
86
+ "include": "#number"
87
+ },
88
+ {
89
+ "include": "#operator"
90
+ },
91
+ {
92
+ "include": "#group"
93
+ },
94
+ {
95
+ "include": "#name"
96
+ }
97
+ ]
98
+ },
99
+ "reference": {
100
+ "patterns": [
101
+ {
102
+ "include": "#reference-imported"
103
+ },
104
+ {
105
+ "include": "#reference-local"
106
+ }
107
+ ]
108
+ },
109
+ "reference-imported": {
110
+ "begin": "(<)(@)",
111
+ "end": "(\\*)?(>)",
112
+ "beginCaptures": {
113
+ "1": {
114
+ "name": "punctuation.definition.reference.begin.dfn"
115
+ },
116
+ "2": {
117
+ "name": "punctuation.definition.imported.dfn"
118
+ }
119
+ },
120
+ "endCaptures": {
121
+ "1": {
122
+ "name": "keyword.operator.open-set.dfn"
123
+ },
124
+ "2": {
125
+ "name": "punctuation.definition.reference.end.dfn"
126
+ }
127
+ },
128
+ "patterns": [
129
+ {
130
+ "match": "([A-Za-z][A-Za-z0-9-]*)(/)([A-Za-z][A-Za-z0-9-]*)",
131
+ "captures": {
132
+ "1": {
133
+ "name": "entity.name.namespace.module.dfn"
134
+ },
135
+ "2": {
136
+ "name": "punctuation.separator.qualified.dfn"
137
+ },
138
+ "3": {
139
+ "name": "variable.other.reference.imported.dfn"
140
+ }
141
+ }
142
+ },
143
+ {
144
+ "include": "#reference-modifiers"
145
+ },
146
+ {
147
+ "name": "variable.other.reference.imported.dfn",
148
+ "match": "[A-Za-z][A-Za-z0-9-]*"
149
+ }
150
+ ]
151
+ },
152
+ "reference-local": {
153
+ "begin": "(<)",
154
+ "end": "(\\*)?(>)",
155
+ "beginCaptures": {
156
+ "1": {
157
+ "name": "punctuation.definition.reference.begin.dfn"
158
+ }
159
+ },
160
+ "endCaptures": {
161
+ "1": {
162
+ "name": "keyword.operator.open-set.dfn"
163
+ },
164
+ "2": {
165
+ "name": "punctuation.definition.reference.end.dfn"
166
+ }
167
+ },
168
+ "patterns": [
169
+ {
170
+ "include": "#reference-modifiers"
171
+ },
172
+ {
173
+ "name": "variable.other.reference.dfn",
174
+ "match": "[A-Za-z][A-Za-z0-9-]*"
175
+ }
176
+ ]
177
+ },
178
+ "reference-modifiers": {
179
+ "patterns": [
180
+ {
181
+ "name": "keyword.operator.omit.dfn",
182
+ "match": "!"
183
+ },
184
+ {
185
+ "begin": "\\[",
186
+ "end": "\\]",
187
+ "beginCaptures": {
188
+ "0": {
189
+ "name": "punctuation.definition.modifier.begin.dfn"
190
+ }
191
+ },
192
+ "endCaptures": {
193
+ "0": {
194
+ "name": "punctuation.definition.modifier.end.dfn"
195
+ }
196
+ },
197
+ "patterns": [
198
+ {
199
+ "name": "variable.parameter.member.dfn",
200
+ "match": "[A-Za-z][A-Za-z0-9-]*|\\d+"
201
+ },
202
+ {
203
+ "name": "punctuation.separator.comma.dfn",
204
+ "match": ","
205
+ }
206
+ ]
207
+ }
208
+ ]
209
+ },
210
+ "range": {
211
+ "name": "constant.numeric.range.dfn",
212
+ "match": "\\d+-\\d+/\\d+"
213
+ },
214
+ "number": {
215
+ "name": "constant.numeric.dfn",
216
+ "match": "\\b\\d+\\b"
217
+ },
218
+ "operator": {
219
+ "patterns": [
220
+ {
221
+ "name": "keyword.operator.optional.dfn",
222
+ "match": "\\?"
223
+ },
224
+ {
225
+ "name": "keyword.operator.dfn",
226
+ "match": "[|.=]"
227
+ }
228
+ ]
229
+ },
230
+ "group": {
231
+ "patterns": [
232
+ {
233
+ "name": "punctuation.definition.group.begin.dfn",
234
+ "match": "\\["
235
+ },
236
+ {
237
+ "name": "keyword.operator.open-set.dfn",
238
+ "match": "\\*(?=\\s*\\])"
239
+ },
240
+ {
241
+ "name": "punctuation.definition.group.end.dfn",
242
+ "match": "\\]"
243
+ }
244
+ ]
245
+ },
246
+ "name": {
247
+ "name": "constant.language.name.dfn",
248
+ "match": "[A-Za-z][A-Za-z0-9-]*"
249
+ }
250
+ }
251
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertekum/schema-builder",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Declare token vocabularies as grammar; build them into JSON Schema files",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -19,6 +19,7 @@
19
19
  "bugs": "https://github.com/moros-oxus/vertekum/issues",
20
20
  "files": [
21
21
  "CHANGELOG.md",
22
+ "grammar",
22
23
  "src",
23
24
  "tsconfig.json",
24
25
  "!src/**/*.test.ts"
@@ -41,7 +42,7 @@
41
42
  "zod": "^3.25.76"
42
43
  },
43
44
  "devDependencies": {
44
- "@vertekum/core": "0.1.1",
45
- "@vertekum/schema-vocabulary": "0.1.0"
45
+ "@vertekum/schema-vocabulary": "0.1.0",
46
+ "@vertekum/core": "0.1.1"
46
47
  }
47
48
  }