@bedrock-core/builder 0.1.1 → 0.2.0

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 (46) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/bin/api-library.d.ts +1 -0
  3. package/dist/bin/api-library.js +10 -0
  4. package/dist/bin/audit-paths.d.ts +1 -0
  5. package/dist/bin/audit-paths.js +44 -0
  6. package/dist/bin/build.js +1 -1
  7. package/dist/bin/builder.js +13 -2
  8. package/dist/bin/migrate.js +2 -6
  9. package/dist/bin/plan.js +2 -2
  10. package/dist/bin/watch.js +1 -1
  11. package/dist/package.json +11 -10
  12. package/dist/schemas/config.schema.json +28 -8
  13. package/dist/schemas/guides.schema.json +0 -5
  14. package/dist/schemas/i18n.schema.json +0 -5
  15. package/dist/schemas/pack-manifest.schema.json +243 -0
  16. package/dist/schemas/ui-compiler.schema.json +0 -5
  17. package/dist/src/config.d.ts +7 -3
  18. package/dist/src/config.js +3 -0
  19. package/dist/src/contract.d.ts +2 -0
  20. package/dist/src/export.d.ts +7 -5
  21. package/dist/src/export.js +274 -47
  22. package/dist/src/migrate.js +13 -10
  23. package/dist/src/migration/exports.js +1 -1
  24. package/dist/src/migration/filters.js +3 -2
  25. package/dist/src/migration/local-filter.js +1 -1
  26. package/dist/src/migration/project.js +17 -8
  27. package/dist/src/migration/types.d.ts +0 -2
  28. package/dist/src/path-audit.d.ts +29 -0
  29. package/dist/src/path-audit.js +110 -0
  30. package/dist/src/plan.js +2 -2
  31. package/dist/src/plugin-routing.js +1 -1
  32. package/dist/src/plugins.js +10 -1
  33. package/dist/src/project.d.ts +1 -3
  34. package/dist/src/project.js +1 -12
  35. package/dist/src/regolith.js +2 -2
  36. package/dist/src/run.js +67 -30
  37. package/dist/src/staging.d.ts +4 -0
  38. package/dist/src/staging.js +297 -0
  39. package/dist/src/validation.d.ts +1 -1
  40. package/dist/src/watch.js +48 -20
  41. package/package.json +24 -14
  42. package/schemas/config.schema.json +28 -8
  43. package/schemas/guides.schema.json +0 -5
  44. package/schemas/i18n.schema.json +0 -5
  45. package/schemas/pack-manifest.schema.json +243 -0
  46. package/schemas/ui-compiler.schema.json +0 -5
@@ -19,11 +19,6 @@
19
19
  "pattern": "^[a-z]{2}_[A-Z]{2}$",
20
20
  "default": "en_US"
21
21
  },
22
- "namespace": {
23
- "type": "string",
24
- "pattern": "^[a-z0-9_]+$",
25
- "description": "Defaults to the project's namespace."
26
- },
27
22
  "strict": {
28
23
  "type": "boolean",
29
24
  "default": true
@@ -0,0 +1,243 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "@bedrock-core authored pack manifest",
4
+ "description": "Native manifest v3 fields, inheritance and pack-owned addon metadata.",
5
+ "type": "object",
6
+ "if": {
7
+ "not": {
8
+ "required": [
9
+ "extends"
10
+ ]
11
+ }
12
+ },
13
+ "then": {
14
+ "required": [
15
+ "format_version",
16
+ "header",
17
+ "modules"
18
+ ]
19
+ },
20
+ "properties": {
21
+ "$schema": {
22
+ "type": "string"
23
+ },
24
+ "extends": {
25
+ "type": "string",
26
+ "pattern": "^\\.\\.?[/\\\\]"
27
+ },
28
+ "format_version": {
29
+ "const": 3
30
+ },
31
+ "namespace": {
32
+ "$ref": "#/definitions/namespace"
33
+ },
34
+ "thumbnail": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "description": "PNG path relative to the behavior pack or its selected resource pack."
38
+ },
39
+ "optionalDependencies": {
40
+ "type": "array",
41
+ "uniqueItems": true,
42
+ "items": {
43
+ "$ref": "#/definitions/dependency"
44
+ },
45
+ "description": "Optional dependencies use the same authored objects as required dependencies and add no native load requirement."
46
+ },
47
+ "header": {
48
+ "type": "object",
49
+ "properties": {
50
+ "name": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ },
54
+ "description": {
55
+ "type": "string"
56
+ },
57
+ "uuid": {
58
+ "$ref": "#/definitions/uuid"
59
+ },
60
+ "version": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "min_engine_version": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "pack_scope": {
69
+ "enum": [
70
+ "world",
71
+ "global",
72
+ "any"
73
+ ]
74
+ }
75
+ }
76
+ },
77
+ "metadata": {
78
+ "type": "object",
79
+ "properties": {
80
+ "authors": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ }
86
+ },
87
+ "license": {
88
+ "type": "string"
89
+ },
90
+ "url": {
91
+ "type": "string"
92
+ },
93
+ "generated_with": {
94
+ "type": "object"
95
+ }
96
+ }
97
+ },
98
+ "modules": {
99
+ "type": "array",
100
+ "minItems": 1,
101
+ "items": {
102
+ "type": "object",
103
+ "required": [
104
+ "type",
105
+ "uuid"
106
+ ],
107
+ "properties": {
108
+ "type": {
109
+ "enum": [
110
+ "data",
111
+ "resources",
112
+ "script",
113
+ "world_template",
114
+ "skin_pack"
115
+ ]
116
+ },
117
+ "uuid": {
118
+ "$ref": "#/definitions/uuid"
119
+ },
120
+ "version": {
121
+ "type": "string",
122
+ "minLength": 1
123
+ },
124
+ "language": {
125
+ "const": "javascript"
126
+ },
127
+ "entry": {
128
+ "type": "string",
129
+ "pattern": "^scripts/.+\\.(js|ts|tsx|mts|cts)$",
130
+ "description": "Authored script path. Builder compiles TypeScript entries and exports the corresponding .js path."
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "dependencies": {
136
+ "type": "array",
137
+ "items": {
138
+ "$ref": "#/definitions/dependency"
139
+ }
140
+ }
141
+ },
142
+ "definitions": {
143
+ "namespace": {
144
+ "type": "string",
145
+ "pattern": "^[a-z0-9_]+$",
146
+ "not": {
147
+ "const": "minecraft"
148
+ }
149
+ },
150
+ "uuid": {
151
+ "type": "string",
152
+ "pattern": "^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$"
153
+ },
154
+ "dependency": {
155
+ "type": "object",
156
+ "not": {
157
+ "anyOf": [
158
+ {
159
+ "required": [
160
+ "pack"
161
+ ]
162
+ },
163
+ {
164
+ "required": [
165
+ "module"
166
+ ]
167
+ }
168
+ ]
169
+ },
170
+ "properties": {
171
+ "uuid": {
172
+ "$ref": "#/definitions/uuid"
173
+ },
174
+ "namespace": {
175
+ "$ref": "#/definitions/namespace"
176
+ },
177
+ "module_name": {
178
+ "type": "string",
179
+ "minLength": 1
180
+ },
181
+ "version": {
182
+ "type": "string",
183
+ "minLength": 1
184
+ }
185
+ },
186
+ "oneOf": [
187
+ {
188
+ "required": [
189
+ "namespace"
190
+ ],
191
+ "not": {
192
+ "anyOf": [
193
+ {
194
+ "required": [
195
+ "uuid"
196
+ ]
197
+ },
198
+ {
199
+ "required": [
200
+ "module_name"
201
+ ]
202
+ }
203
+ ]
204
+ }
205
+ },
206
+ {
207
+ "required": [
208
+ "uuid"
209
+ ],
210
+ "not": {
211
+ "required": [
212
+ "module_name"
213
+ ]
214
+ }
215
+ },
216
+ {
217
+ "required": [
218
+ "module_name"
219
+ ],
220
+ "not": {
221
+ "required": [
222
+ "uuid"
223
+ ]
224
+ },
225
+ "if": {
226
+ "properties": {
227
+ "module_name": {
228
+ "pattern": "^@minecraft/"
229
+ }
230
+ }
231
+ },
232
+ "then": {
233
+ "not": {
234
+ "required": [
235
+ "namespace"
236
+ ]
237
+ }
238
+ }
239
+ }
240
+ ]
241
+ }
242
+ }
243
+ }
@@ -18,11 +18,6 @@
18
18
  "type": "boolean",
19
19
  "description": "Stage override for the profile debug setting."
20
20
  },
21
- "namespace": {
22
- "type": "string",
23
- "pattern": "^[a-z0-9_]+$",
24
- "description": "Defaults to the project namespace."
25
- },
26
21
  "testMetadata": {
27
22
  "type": "boolean",
28
23
  "default": false