@bedrock-core/builder 0.2.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @bedrock-core/builder
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 68dac73: Compile and register virtual container screens with their complete native allocation, snapshots and runtime metadata. Generate their protocol items in the owning behavior pack without requiring an entity or block definition.
8
+
9
+ Remove experimental Ore host settings, browser assets and input-resource packaging from UI builds.
10
+
11
+ ### Patch Changes
12
+
13
+ - 8adcb6e: Expose native Bedrock document types through the `@bedrock-core/bedrock-types` package root. Keep schema preparation, corrections, declaration compilation and distribution builds in the types package. The generator evaluates content templates using published document types.
14
+
15
+ Provide detailed animations, controller state machines and render controllers. Share client-resource descriptions and scripts between entities and attachables, retaining their document-specific fields and conditional item bindings.
16
+
17
+ Expose extensible component registries and reuse their maps in native documents. Standardize declaration cleanup, semantic duplicate detection, bounded-array output and interface spacing.
18
+
19
+ Use extensionless declaration imports and resolve generated definitions in the package's authoring project. Keep vanilla-only block metadata outside the public authoring API.
20
+
21
+ Run optional Creator Tools validation on the assembled behavior and resource packs and report rule diagnostics with pack paths.
22
+
23
+ Check final JSON documents against the installed native Bedrock types for the project's target version. Expose the release as `typesVersion` and each checked document as a `category`. Use `typesRoot` to select an explicit types package.
24
+ - 28983c1: Bundle loot tables, named predicates, item modifiers and global loot rules from a behavior pack's JSON and Generator templates. Preserve native Bedrock rolls where possible and register scripted loot through the pack's declared entry point.
25
+
26
+ Validate entity value comparisons and compile nested alternatives and groups in tables and bonus pools. Preserve native alternatives in supported table formats when Bedrock can resolve the pool. Stage typed loot JSON together with its TypeScript declaration.
27
+ - Updated dependencies [62e4639]
28
+ - Updated dependencies [8adcb6e]
29
+ - Updated dependencies [8adcb6e]
30
+ - Updated dependencies [62e4639]
31
+ - Updated dependencies [68dac73]
32
+ - Updated dependencies [28983c1]
33
+ - Updated dependencies [28983c1]
34
+ - @bedrock-core/builder-bundler@0.3.0
35
+ - @bedrock-core/builder-generator@0.3.0
36
+ - @bedrock-core/builder-validation@0.3.0
37
+ - @bedrock-core/builder-ui@0.4.0
38
+ - @bedrock-core/builder-i18n@0.2.1
39
+
3
40
  ## 0.2.0
4
41
 
5
42
  ### Minor Changes
@@ -52,7 +89,7 @@
52
89
 
53
90
  - 3098e57: Register container text positions even when the screen has no appearance variants so runtime inventory allocation matches the compiled layout.
54
91
 
55
- Classify runtime text dependencies from JSX expressions and Core text factory calls in both compilation and runtime bundles, while retaining baked literal captions.
92
+ Classify runtime text dependencies from JSX expressions and @bedrock-core text factory calls in both compilation and runtime bundles, while retaining baked literal captions.
56
93
  - Updated dependencies [3098e57]
57
94
  - @bedrock-core/builder-ui@0.2.1
58
95
 
@@ -1,5 +1,4 @@
1
1
  import { migrateRegolithProject, writeMigration } from '../src/migrate.js';
2
- import { stages } from '../src/plan.js';
3
2
  const help = `@bedrock-core Regolith configuration migration
4
3
 
5
4
  Usage: bc-builder migrate [config.json] [options]
@@ -11,7 +10,6 @@ Preview is the default. Filters, shell commands and expressions are never execut
11
10
  --profile name Select a profile (repeatable; default: all)
12
11
  --target-version value Supply missing targetVersion
13
12
  --export profile:pack=path Set exact destinations (repeat for every pack)
14
- --filter id=stage Map a verified local filter or fork to a stage or core
15
13
  --json Print config, diagnostics and readiness as JSON
16
14
  --help Show this help
17
15
  `;
@@ -63,14 +61,6 @@ try {
63
61
  [profile]: { ...options.exports?.[profile], [pack]: directory },
64
62
  };
65
63
  }
66
- else if (flag === '--filter') {
67
- const value = argument(index++);
68
- const match = /^([^=]+)=([^=]+)$/.exec(value);
69
- if (!match || (match[2] !== 'core' && !stages.some(stage => stage === match[2]))) {
70
- throw new Error(`--filter expects id=core or id=${stages.join('|')}`);
71
- }
72
- options.filters = { ...options.filters, [match[1]]: match[2] };
73
- }
74
64
  else if (flag.startsWith('-') || configPath !== undefined) {
75
65
  throw new Error(`Unknown argument: ${flag}`);
76
66
  }
package/dist/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@bedrock-core/builder",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@bedrock-core/builder-bundler": "0.2.0",
7
- "@bedrock-core/builder-generator": "0.2.0",
6
+ "@bedrock-core/builder-bundler": "0.3.0",
7
+ "@bedrock-core/builder-generator": "0.3.0",
8
8
  "@bedrock-core/builder-guides": "0.2.0",
9
- "@bedrock-core/builder-i18n": "0.2.0",
9
+ "@bedrock-core/builder-i18n": "0.2.1",
10
10
  "@bedrock-core/builder-manifest": "0.2.0",
11
11
  "@bedrock-core/builder-plugin": "0.2.0",
12
- "@bedrock-core/builder-ui": "0.3.0",
13
- "@bedrock-core/builder-validation": "0.2.0",
12
+ "@bedrock-core/builder-ui": "0.4.0",
13
+ "@bedrock-core/builder-validation": "0.3.0",
14
14
  "@types/node": "25.9.9",
15
15
  "ajv": "8.17.1",
16
+ "import-meta-resolve": "^4.2.0",
16
17
  "typescript-native": "npm:typescript@7.1.0-beta"
17
18
  }
18
19
  }
@@ -30,6 +30,11 @@
30
30
  "debug": {
31
31
  "type": "boolean"
32
32
  },
33
+ "vanillaAssets": {
34
+ "type": "boolean",
35
+ "default": false,
36
+ "description": "Include the checked shared vanilla asset catalog and generated atlas. Authored addon assets publish automatically regardless of this setting."
37
+ },
33
38
  "target": {
34
39
  "type": "string",
35
40
  "pattern": "\\S"
@@ -201,14 +201,19 @@
201
201
  {
202
202
  "type": "object",
203
203
  "additionalProperties": false,
204
- "required": [
205
- "script"
204
+ "oneOf": [
205
+ { "required": ["script"] },
206
+ { "required": ["nodeModule"] }
206
207
  ],
207
208
  "properties": {
208
209
  "script": {
209
210
  "$ref": "#/definitions/nonempty",
210
211
  "description": "Standalone Node entry point, relative to filterDir, using the Regolith BP/RP/data contract."
211
212
  },
213
+ "nodeModule": {
214
+ "$ref": "#/definitions/nonempty",
215
+ "description": "Installed Node package or exported subpath resolved from filterDir and executed in the BP/RP/data workspace."
216
+ },
212
217
  "filterDir": {
213
218
  "$ref": "#/definitions/nonempty",
214
219
  "description": "Script definition directory, relative to config.json. Defaults to the project root and sets FILTER_DIR."
@@ -425,7 +430,12 @@
425
430
  "validation": {
426
431
  "enum": ["strict", "warn", "skip"],
427
432
  "default": "warn",
428
- "description": "Content schema validation mode. JSON syntax and pack manifests are always checked."
433
+ "description": "Document type validation mode. JSON syntax and pack manifests are always checked."
434
+ },
435
+ "creatorToolsValidation": {
436
+ "enum": ["strict", "warn", "skip"],
437
+ "default": "skip",
438
+ "description": "Run the installed Mojang Creator Tools CLI on the final pack set. In strict mode, errors prevent export."
429
439
  },
430
440
  "api": {
431
441
  "description": "Portable addon API package output; defaults to dist/api when public addon exports are declared. Set false to disable.",
@@ -14,33 +14,6 @@
14
14
  "exclude": {
15
15
  "$ref": "#/$defs/patterns"
16
16
  },
17
- "types": {
18
- "type": "boolean",
19
- "default": true,
20
- "description": "Generate Minecraft schema declarations for editor completion."
21
- },
22
- "schemaVersion": {
23
- "type": "string",
24
- "pattern": "\\S",
25
- "default": "latest"
26
- },
27
- "typesDir": {
28
- "type": ["string", "null"],
29
- "description": "Project-relative declaration output directory; defaults to .bedrock-core/generated/mc."
30
- },
31
- "typePrefix": {
32
- "type": "string",
33
- "default": ""
34
- },
35
- "strict": {
36
- "type": "boolean",
37
- "default": false
38
- },
39
- "maxAgeHours": {
40
- "type": "number",
41
- "minimum": 0,
42
- "default": 24
43
- },
44
17
  "tsconfig": {
45
18
  "type": "string",
46
19
  "pattern": "\\S"
@@ -80,8 +53,17 @@
80
53
  "$defs": {
81
54
  "patterns": {
82
55
  "anyOf": [
83
- { "type": "string", "pattern": "\\S" },
84
- { "type": "array", "items": { "type": "string", "pattern": "\\S" } }
56
+ {
57
+ "type": "string",
58
+ "pattern": "\\S"
59
+ },
60
+ {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "string",
64
+ "pattern": "\\S"
65
+ }
66
+ }
85
67
  ]
86
68
  }
87
69
  }
@@ -65,6 +65,21 @@
65
65
  "type": "string",
66
66
  "minLength": 1
67
67
  },
68
+ "base_game_version": {
69
+ "type": "string"
70
+ },
71
+ "pack_optimization_version": {
72
+ "type": "string"
73
+ },
74
+ "allow_random_seed": {
75
+ "type": "boolean"
76
+ },
77
+ "lock_template_options": {
78
+ "type": "boolean"
79
+ },
80
+ "platform_locked": {
81
+ "type": "boolean"
82
+ },
68
83
  "pack_scope": {
69
84
  "enum": [
70
85
  "world",
@@ -90,8 +105,14 @@
90
105
  "url": {
91
106
  "type": "string"
92
107
  },
108
+ "product_type": {
109
+ "type": "string"
110
+ },
93
111
  "generated_with": {
94
- "type": "object"
112
+ "type": "object",
113
+ "additionalProperties": {
114
+ "$ref": "#/definitions/stringList"
115
+ }
95
116
  }
96
117
  }
97
118
  },
@@ -121,6 +142,9 @@
121
142
  "type": "string",
122
143
  "minLength": 1
123
144
  },
145
+ "description": {
146
+ "type": "string"
147
+ },
124
148
  "language": {
125
149
  "const": "javascript"
126
150
  },
@@ -137,9 +161,31 @@
137
161
  "items": {
138
162
  "$ref": "#/definitions/dependency"
139
163
  }
164
+ },
165
+ "capabilities": {
166
+ "$ref": "#/definitions/stringList"
167
+ },
168
+ "has_education_metadata": {
169
+ "type": "boolean"
170
+ },
171
+ "subpacks": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "object",
175
+ "required": ["folder_name", "name", "memory_performance_tier"],
176
+ "properties": {
177
+ "folder_name": { "type": "string" },
178
+ "name": { "type": "string" },
179
+ "memory_performance_tier": { "type": "integer", "minimum": 0, "maximum": 5 }
180
+ }
181
+ }
140
182
  }
141
183
  },
142
184
  "definitions": {
185
+ "stringList": {
186
+ "type": "array",
187
+ "items": { "type": "string" }
188
+ },
143
189
  "namespace": {
144
190
  "type": "string",
145
191
  "pattern": "^[a-z0-9_]+$",
@@ -178,11 +224,16 @@
178
224
  "type": "string",
179
225
  "minLength": 1
180
226
  },
227
+ "optional": {
228
+ "type": "boolean"
229
+ },
181
230
  "version": {
182
231
  "type": "string",
183
232
  "minLength": 1
184
233
  }
185
234
  },
235
+ "if": { "required": ["optional"] },
236
+ "then": { "required": ["module_name"] },
186
237
  "oneOf": [
187
238
  {
188
239
  "required": [
@@ -4,16 +4,6 @@
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "properties": {
7
- "experimentalOre": {
8
- "type": "object",
9
- "additionalProperties": false,
10
- "description": "Asset preparation for Experimental_OreUI screens; ignored when the build has none.",
11
- "properties": {
12
- "clientRoot": { "type": "string", "pattern": "\\S", "description": "Windows Minecraft Content directory; defaults to a matching installed client." },
13
- "resourceRoots": { "type": "array", "items": { "type": "string", "pattern": "\\S" }, "description": "Fallback resource-pack roots after the selected RP, in priority order. Paths resolve from the project." },
14
- "dynamicTextures": { "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^textures/(?:[A-Za-z0-9_-]+/)*[A-Za-z0-9_-]+(?:\\.png)?$" }, "description": "Pack-local PNG textures available to live Ore images." }
15
- }
16
- },
17
7
  "debug": {
18
8
  "type": "boolean",
19
9
  "description": "Stage override for the profile debug setting."
@@ -14,10 +14,18 @@ export interface ScriptFolders {
14
14
  BP?: string;
15
15
  RP?: string;
16
16
  }
17
- /** Standalone Node script run once in a temporary BP/RP/data workspace. */
18
- export interface NodePluginDefinition {
19
- /** Entry file relative to filterDir, or an absolute file path. */
17
+ /** Standalone Node entry run once in a temporary BP/RP/data workspace. */
18
+ export type NodePluginDefinition = (
19
+ /** Entry file relative to filterDir, or an absolute file path. */
20
+ {
20
21
  script: string;
22
+ nodeModule?: never;
23
+ }
24
+ /** Installed package or exported subpath resolved from filterDir. */
25
+ | {
26
+ nodeModule: string;
27
+ script?: never;
28
+ }) & {
21
29
  /** Definition directory relative to config.json; defaults to projectRoot. */
22
30
  filterDir?: string;
23
31
  /** Configured pack IDs exposed under conventional folder names. Omission infers an unambiguous set. */
@@ -28,7 +36,7 @@ export interface NodePluginDefinition {
28
36
  persistData?: boolean;
29
37
  /** Node flags placed before the entry file. */
30
38
  nodeArguments?: string[];
31
- }
39
+ };
32
40
  /** Native module with host-owned owner restrictions and dependency overrides. */
33
41
  export interface ModulePluginDefinition {
34
42
  module: string;
@@ -66,8 +74,10 @@ export interface BuildProfile {
66
74
  stages?: Partial<Record<StageName, StageSelection>>;
67
75
  /** Reuse verified compilation and validation results; defaults to true. */
68
76
  cache?: boolean;
69
- /** Content schema validation mode; defaults to warn. JSON syntax and pack manifests always validate. */
77
+ /** Document type validation mode, defaulting to warn. JSON syntax and pack manifests always validate. */
70
78
  validation?: ContentValidationMode;
79
+ /** Creator Tools CLI validation mode, defaulting to skip. */
80
+ creatorToolsValidation?: ContentValidationMode;
71
81
  /** Invocations after prepare, before/after enabled stages, or before export. */
72
82
  steps?: PluginStep[];
73
83
  /** Destination for every configured pack ID, relative to config.json or absolute. */
@@ -19,9 +19,10 @@ export interface BuildOptions {
19
19
  /** Additional final check after artifact checks, before manifest/content validation and export. */
20
20
  validateArtifacts?: (context: BuildContext) => void | Promise<void>;
21
21
  }
22
+
22
23
  /** Successful build report containing durable destinations and IDs, without temporary paths. */
23
24
  export interface BuildResult {
24
- /** Final JSON syntax/schema validation coverage. */
25
+ /** Final JSON syntax and document type validation coverage. */
25
26
  readonly validation: ContentValidationResult;
26
27
  /** Pack IDs mapped to their published absolute directories. */
27
28
  readonly outputPaths: Readonly<Record<string, string>>;
@@ -36,7 +37,7 @@ export interface BuildResult {
36
37
  /** Individual compiler execution and reuse records. */
37
38
  readonly compilations: { id: string; status: 'executed' | 'cached' }[];
38
39
  /** Artifact identities and owners; workspace file paths are intentionally omitted. */
39
- readonly artifacts: Pick<Artifact, 'id' | 'owner' | 'importAs' | 'pack'>[];
40
+ readonly artifacts: Pick<Artifact, 'id' | 'owner' | 'importAs' | 'pack' | 'assetRegistry'>[];
40
41
  /** Final manifest classifications with published pack paths. */
41
42
  readonly packs: PackInfo[];
42
43
  }
@@ -42,7 +42,7 @@ export declare function withExportPaths<T>(paths: Record<string, string>, build:
42
42
  /**
43
43
  * Publish pack folders with manifest checks, locks and rollback, without the build runner.
44
44
  * @returns Published pack IDs and absolute destination directories.
45
- * @remarks Updates files in place without renaming pack roots. Snapshots and locks stay in the OS temporary directory. JSON schema validation is separate; use validatePackContent when content checks are required.
45
+ * @remarks Updates files in place without renaming pack roots. Snapshots and locks stay in the OS temporary directory. Use validatePackContent to check pack JSON before export.
46
46
  * @throws If manifest checks or publication fail. Failed rollback reports a retained recovery directory.
47
47
  */
48
48
  export declare function exportPacks({ packs, paths, signal, environment }: ExportOptions): Promise<ExportedPack[]>;
@@ -459,7 +459,7 @@ export async function withExportPaths(paths, build, apiPath) {
459
459
  /**
460
460
  * Publish pack folders with manifest checks, locks and rollback, without the build runner.
461
461
  * @returns Published pack IDs and absolute destination directories.
462
- * @remarks Updates files in place without renaming pack roots. Snapshots and locks stay in the OS temporary directory. JSON schema validation is separate; use validatePackContent when content checks are required.
462
+ * @remarks Updates files in place without renaming pack roots. Snapshots and locks stay in the OS temporary directory. Use validatePackContent to check pack JSON before export.
463
463
  * @throws If manifest checks or publication fail. Failed rollback reports a retained recovery directory.
464
464
  */
465
465
  export async function exportPacks({ packs, paths, signal, environment = process.env }) {
@@ -1,5 +1,5 @@
1
1
  import type { MigrationOptions, MigrationResult } from './migration/types.ts';
2
- export type { FilterKind, MigrationDiagnostic, MigrationOptions, MigrationResult } from './migration/types.ts';
2
+ export type { MigrationDiagnostic, MigrationOptions, MigrationResult } from './migration/types.ts';
3
3
  export { migrateRegolithProject, writeMigration } from './migration/project.ts';
4
4
  export type { ProjectMigration } from './migration/project.ts';
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { validateConfig } from './config.js';
2
- import { planBuild } from './plan.js';
2
+ import { planBuild, stages } from './plan.js';
3
3
  import { convertExport } from './migration/exports.js';
4
4
  import { convertFilters } from './migration/filters.js';
5
5
  import { isRecord, pointer } from './migration/types.js';
@@ -60,8 +60,12 @@ export function migrateRegolithConfig(input, options = {}) {
60
60
  const profiles = regolith.profiles;
61
61
  const definitions = isRecord(regolith.filterDefinitions) ? regolith.filterDefinitions : {};
62
62
  const selectedNames = options.profiles ?? Object.keys(profiles);
63
- const namespaces = new Set();
63
+ const plugins = new Map();
64
64
  const migrated = [];
65
+ const dataPath = typeof regolith.dataPath === 'string' && regolith.dataPath.trim() ? regolith.dataPath : undefined;
66
+ if (regolith.dataPath !== undefined && dataPath === undefined) {
67
+ report('data-source', '/regolith/dataPath', 'Set dataPath to a project-relative directory.');
68
+ }
65
69
  if (!selectedNames.length || new Set(selectedNames).size !== selectedNames.length) {
66
70
  report('profile-selection', '/regolith/profiles', 'Select at least one distinct profile.');
67
71
  }
@@ -77,11 +81,8 @@ export function migrateRegolithConfig(input, options = {}) {
77
81
  report('profile-selection', location, 'Selected profile must exist and be an object.');
78
82
  continue;
79
83
  }
80
- const converted = convertFilters(name, profiles, definitions, packs, regolith.dataPath, options, report);
81
- for (const namespace of converted.namespaces) {
82
- namespaces.add(namespace);
83
- }
84
- const profile = { stages: converted.stages };
84
+ const steps = convertFilters(name, profiles, definitions, plugins, dataPath, report);
85
+ const profile = { stages: Object.fromEntries(stages.map(stage => [stage, false])), steps };
85
86
  const destinations = convertExport(source.export, packs, config.name, name, options, report, `${location}/export`);
86
87
  if (destinations) {
87
88
  profile.export = destinations;
@@ -106,18 +107,20 @@ export function migrateRegolithConfig(input, options = {}) {
106
107
  }
107
108
  delete config.worlds;
108
109
  config.targetVersion = options.targetVersion ?? config.targetVersion;
109
- if (typeof config.namespace === 'string') {
110
- namespaces.add(config.namespace);
111
- }
110
+ const namespace = config.namespace;
112
111
  delete config.namespace;
113
112
  if (config.targetVersion === undefined) {
114
113
  report('target-version', '/targetVersion', 'Set targetVersion or pass --target-version with the intended Minecraft version.');
115
114
  }
116
- if (namespaces.size) {
117
- report('manifest-namespace', '/packs', `Declare a namespace in each owner manifest.json. Source namespace values: ${[...namespaces].join(', ')}.`, 'warning');
115
+ if (typeof namespace === 'string') {
116
+ report('manifest-namespace', '/packs', `Declare the ${namespace} namespace in the owning pack manifest.`, 'warning');
118
117
  }
119
118
  config.$schema = options.schema ?? new URL('../schemas/config.schema.json', import.meta.url).href;
120
- config.bedrockCore = { formatVersion: '1.0.0', profiles: Object.fromEntries(migrated) };
119
+ config.bedrockCore = {
120
+ formatVersion: '1.0.0',
121
+ ...(plugins.size ? { plugins: Object.fromEntries(plugins) } : {}),
122
+ profiles: Object.fromEntries(migrated),
123
+ };
121
124
  try {
122
125
  const validated = validateConfig(config);
123
126
  for (const name of selectedNames) {
@@ -1,7 +1,4 @@
1
- import type { StageName, StageSelection } from '../config.ts';
2
- import type { MigrationOptions, ReportDiagnostic } from './types.ts';
3
- /** Flatten profile references and preserve the supported, fixed stage order. */
4
- export declare function convertFilters(name: string, profiles: Record<string, unknown>, definitions: Record<string, unknown>, packs: Record<string, string>, dataPath: unknown, options: MigrationOptions, report: ReportDiagnostic): {
5
- stages: Partial<Record<StageName, StageSelection>>;
6
- namespaces: string[];
7
- };
1
+ import type { NodePluginDefinition, PluginStep } from '../config.ts';
2
+ import type { ReportDiagnostic } from './types.ts';
3
+ /** Flatten profile references into ordered steps for standalone Node filters. */
4
+ export declare function convertFilters(name: string, profiles: Record<string, unknown>, definitions: Record<string, unknown>, plugins: Map<string, NodePluginDefinition>, dataPath: string | undefined, report: ReportDiagnostic): PluginStep[];