@minecraft/core-build-tasks 5.2.0 → 5.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.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@minecraft/core-build-tasks",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 26 Jun 2025 22:33:07 GMT",
5
+ "date": "Mon, 14 Jul 2025 15:33:40 GMT",
6
+ "version": "5.3.0",
7
+ "tag": "@minecraft/core-build-tasks_v5.3.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "zachary.campbell@skyboxlabs.com",
12
+ "package": "@minecraft/core-build-tasks",
13
+ "commit": "5f36c265c76bb8453750ab544b06327632e2a3ba",
14
+ "comment": "Update coreLint task to run on whole working directory, linting fixes"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 26 Jun 2025 22:33:37 GMT",
6
21
  "version": "5.2.0",
7
22
  "tag": "@minecraft/core-build-tasks_v5.2.0",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @minecraft/core-build-tasks
2
2
 
3
- <!-- This log was last generated on Thu, 26 Jun 2025 22:33:07 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Mon, 14 Jul 2025 15:33:40 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 5.3.0
8
+
9
+ Mon, 14 Jul 2025 15:33:40 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Update coreLint task to run on whole working directory, linting fixes (zachary.campbell@skyboxlabs.com)
14
+
7
15
  ## 5.2.0
8
16
 
9
- Thu, 26 Jun 2025 22:33:07 GMT
17
+ Thu, 26 Jun 2025 22:33:37 GMT
10
18
 
11
19
  ### Minor changes
12
20
 
package/lib/index.js CHANGED
@@ -12262,9 +12262,9 @@ var require_codegen = __commonJS({
12262
12262
  };
12263
12263
  Else.kind = "else";
12264
12264
  var If = class _If extends BlockNode {
12265
- constructor(condition2, nodes) {
12265
+ constructor(condition3, nodes) {
12266
12266
  super(nodes);
12267
- this.condition = condition2;
12267
+ this.condition = condition3;
12268
12268
  }
12269
12269
  render(opts) {
12270
12270
  let code = `if(${this.condition})` + super.render(opts);
@@ -12527,8 +12527,8 @@ var require_codegen = __commonJS({
12527
12527
  return new code_1._Code(code);
12528
12528
  }
12529
12529
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
12530
- if(condition2, thenBody, elseBody) {
12531
- this._blockNode(new If(condition2));
12530
+ if(condition3, thenBody, elseBody) {
12531
+ this._blockNode(new If(condition3));
12532
12532
  if (thenBody && elseBody) {
12533
12533
  this.code(thenBody).else().code(elseBody).endIf();
12534
12534
  } else if (thenBody) {
@@ -12539,8 +12539,8 @@ var require_codegen = __commonJS({
12539
12539
  return this;
12540
12540
  }
12541
12541
  // `else if` clause - invalid without `if` or after `else` clauses
12542
- elseIf(condition2) {
12543
- return this._elseNode(new If(condition2));
12542
+ elseIf(condition3) {
12543
+ return this._elseNode(new If(condition3));
12544
12544
  }
12545
12545
  // `else` clause - only valid after `if` or `else if` clauses
12546
12546
  else() {
@@ -13407,11 +13407,11 @@ var require_defaults = __commonJS({
13407
13407
  (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
13408
13408
  return;
13409
13409
  }
13410
- let condition2 = (0, codegen_1._)`${childData} === undefined`;
13410
+ let condition3 = (0, codegen_1._)`${childData} === undefined`;
13411
13411
  if (opts.useDefaults === "empty") {
13412
- condition2 = (0, codegen_1._)`${condition2} || ${childData} === null || ${childData} === ""`;
13412
+ condition3 = (0, codegen_1._)`${condition3} || ${childData} === null || ${childData} === ""`;
13413
13413
  }
13414
- gen.if(condition2, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
13414
+ gen.if(condition3, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
13415
13415
  }
13416
13416
  }
13417
13417
  });
@@ -14335,11 +14335,11 @@ var require_validate = __commonJS({
14335
14335
  this.errsCount = it.gen.const("_errs", names_1.default.errors);
14336
14336
  }
14337
14337
  }
14338
- result(condition2, successAction, failAction) {
14339
- this.failResult((0, codegen_1.not)(condition2), successAction, failAction);
14338
+ result(condition3, successAction, failAction) {
14339
+ this.failResult((0, codegen_1.not)(condition3), successAction, failAction);
14340
14340
  }
14341
- failResult(condition2, successAction, failAction) {
14342
- this.gen.if(condition2);
14341
+ failResult(condition3, successAction, failAction) {
14342
+ this.gen.if(condition3);
14343
14343
  if (failAction)
14344
14344
  failAction();
14345
14345
  else
@@ -14356,28 +14356,28 @@ var require_validate = __commonJS({
14356
14356
  this.gen.else();
14357
14357
  }
14358
14358
  }
14359
- pass(condition2, failAction) {
14360
- this.failResult((0, codegen_1.not)(condition2), void 0, failAction);
14359
+ pass(condition3, failAction) {
14360
+ this.failResult((0, codegen_1.not)(condition3), void 0, failAction);
14361
14361
  }
14362
- fail(condition2) {
14363
- if (condition2 === void 0) {
14362
+ fail(condition3) {
14363
+ if (condition3 === void 0) {
14364
14364
  this.error();
14365
14365
  if (!this.allErrors)
14366
14366
  this.gen.if(false);
14367
14367
  return;
14368
14368
  }
14369
- this.gen.if(condition2);
14369
+ this.gen.if(condition3);
14370
14370
  this.error();
14371
14371
  if (this.allErrors)
14372
14372
  this.gen.endIf();
14373
14373
  else
14374
14374
  this.gen.else();
14375
14375
  }
14376
- fail$data(condition2) {
14376
+ fail$data(condition3) {
14377
14377
  if (!this.$data)
14378
- return this.fail(condition2);
14378
+ return this.fail(condition3);
14379
14379
  const { schemaCode } = this;
14380
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition2)})`);
14380
+ this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition3)})`);
14381
14381
  }
14382
14382
  error(append, errorParams, errorPaths) {
14383
14383
  if (errorParams) {
@@ -18997,9 +18997,9 @@ var require_codegen2 = __commonJS({
18997
18997
  };
18998
18998
  Else.kind = "else";
18999
18999
  var If = class _If extends BlockNode {
19000
- constructor(condition2, nodes) {
19000
+ constructor(condition3, nodes) {
19001
19001
  super(nodes);
19002
- this.condition = condition2;
19002
+ this.condition = condition3;
19003
19003
  }
19004
19004
  render(opts) {
19005
19005
  let code = `if(${this.condition})` + super.render(opts);
@@ -19262,8 +19262,8 @@ var require_codegen2 = __commonJS({
19262
19262
  return new code_1._Code(code);
19263
19263
  }
19264
19264
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
19265
- if(condition2, thenBody, elseBody) {
19266
- this._blockNode(new If(condition2));
19265
+ if(condition3, thenBody, elseBody) {
19266
+ this._blockNode(new If(condition3));
19267
19267
  if (thenBody && elseBody) {
19268
19268
  this.code(thenBody).else().code(elseBody).endIf();
19269
19269
  } else if (thenBody) {
@@ -19274,8 +19274,8 @@ var require_codegen2 = __commonJS({
19274
19274
  return this;
19275
19275
  }
19276
19276
  // `else if` clause - invalid without `if` or after `else` clauses
19277
- elseIf(condition2) {
19278
- return this._elseNode(new If(condition2));
19277
+ elseIf(condition3) {
19278
+ return this._elseNode(new If(condition3));
19279
19279
  }
19280
19280
  // `else` clause - only valid after `if` or `else if` clauses
19281
19281
  else() {
@@ -20135,11 +20135,11 @@ var require_defaults2 = __commonJS({
20135
20135
  (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
20136
20136
  return;
20137
20137
  }
20138
- let condition2 = (0, codegen_1._)`${childData} === undefined`;
20138
+ let condition3 = (0, codegen_1._)`${childData} === undefined`;
20139
20139
  if (opts.useDefaults === "empty") {
20140
- condition2 = (0, codegen_1._)`${condition2} || ${childData} === null || ${childData} === ""`;
20140
+ condition3 = (0, codegen_1._)`${condition3} || ${childData} === null || ${childData} === ""`;
20141
20141
  }
20142
- gen.if(condition2, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
20142
+ gen.if(condition3, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
20143
20143
  }
20144
20144
  }
20145
20145
  });
@@ -20940,11 +20940,11 @@ var require_validate2 = __commonJS({
20940
20940
  this.errsCount = it.gen.const("_errs", names_1.default.errors);
20941
20941
  }
20942
20942
  }
20943
- result(condition2, successAction, failAction) {
20944
- this.failResult((0, codegen_1.not)(condition2), successAction, failAction);
20943
+ result(condition3, successAction, failAction) {
20944
+ this.failResult((0, codegen_1.not)(condition3), successAction, failAction);
20945
20945
  }
20946
- failResult(condition2, successAction, failAction) {
20947
- this.gen.if(condition2);
20946
+ failResult(condition3, successAction, failAction) {
20947
+ this.gen.if(condition3);
20948
20948
  if (failAction)
20949
20949
  failAction();
20950
20950
  else
@@ -20961,28 +20961,28 @@ var require_validate2 = __commonJS({
20961
20961
  this.gen.else();
20962
20962
  }
20963
20963
  }
20964
- pass(condition2, failAction) {
20965
- this.failResult((0, codegen_1.not)(condition2), void 0, failAction);
20964
+ pass(condition3, failAction) {
20965
+ this.failResult((0, codegen_1.not)(condition3), void 0, failAction);
20966
20966
  }
20967
- fail(condition2) {
20968
- if (condition2 === void 0) {
20967
+ fail(condition3) {
20968
+ if (condition3 === void 0) {
20969
20969
  this.error();
20970
20970
  if (!this.allErrors)
20971
20971
  this.gen.if(false);
20972
20972
  return;
20973
20973
  }
20974
- this.gen.if(condition2);
20974
+ this.gen.if(condition3);
20975
20975
  this.error();
20976
20976
  if (this.allErrors)
20977
20977
  this.gen.endIf();
20978
20978
  else
20979
20979
  this.gen.else();
20980
20980
  }
20981
- fail$data(condition2) {
20981
+ fail$data(condition3) {
20982
20982
  if (!this.$data)
20983
- return this.fail(condition2);
20983
+ return this.fail(condition3);
20984
20984
  const { schemaCode } = this;
20985
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition2)})`);
20985
+ this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition3)})`);
20986
20986
  }
20987
20987
  error(append, errorParams, errorPaths) {
20988
20988
  if (errorParams) {
@@ -44952,7 +44952,7 @@ function copyTask(params) {
44952
44952
  // src/tasks/coreLint.ts
44953
44953
  import { execSync } from "child_process";
44954
44954
  import { existsSync } from "fs";
44955
- import { logger, series, task } from "just-scripts";
44955
+ import { condition, logger, series, task } from "just-scripts";
44956
44956
  import path6 from "path";
44957
44957
  import process2 from "process";
44958
44958
  var LEGACY_CONFIG_FILES = [".eslintrc.js"];
@@ -44967,33 +44967,36 @@ function getConfigFilePath() {
44967
44967
  }
44968
44968
  return void 0;
44969
44969
  }
44970
- function eslintTask(files, fix) {
44970
+ function eslintTask(fix) {
44971
44971
  return () => {
44972
44972
  const configFilePath = getConfigFilePath();
44973
- if (configFilePath) {
44974
- process2.env["ESLINT_USE_FLAT_CONFIG"] = FLAT_CONFIG_FILES.some((file) => configFilePath.endsWith(file)) ? "true" : "false";
44975
- const cmd = [
44976
- "npx",
44977
- "eslint",
44978
- ...files,
44979
- "--config",
44980
- `"${configFilePath}"`,
44981
- ...fix ? ["--fix"] : [],
44982
- "--color"
44983
- ].join(" ");
44984
- logger.info(`Running command: ${cmd}`);
44985
- return execSync(cmd, { stdio: "inherit" });
44973
+ if (!configFilePath) {
44974
+ return Promise.resolve();
44986
44975
  }
44987
- return Promise.resolve();
44976
+ process2.env["ESLINT_USE_FLAT_CONFIG"] = FLAT_CONFIG_FILES.some((file) => configFilePath.endsWith(file)) ? "true" : "false";
44977
+ const cmd = [
44978
+ "npx",
44979
+ "eslint",
44980
+ ".",
44981
+ "--config",
44982
+ `"${configFilePath}"`,
44983
+ ...fix ? ["--fix"] : [],
44984
+ "--color"
44985
+ ].join(" ");
44986
+ logger.info(`Running command: ${cmd}`);
44987
+ return execSync(cmd, { stdio: "inherit" });
44988
44988
  };
44989
44989
  }
44990
44990
  function prettierTask(files, fix) {
44991
44991
  return () => {
44992
+ if (!files || files.length === 0) {
44993
+ return Promise.resolve();
44994
+ }
44992
44995
  const cmd = ["npx", "prettier", fix ? "--write" : "--check", ...files].join(" ");
44993
44996
  return execSync(cmd, { stdio: "inherit" });
44994
44997
  };
44995
44998
  }
44996
- function coreLint(files, fix) {
44999
+ function coreLint(prettierFiles, fix) {
44997
45000
  task("verify-lint", () => {
44998
45001
  if (!getConfigFilePath()) {
44999
45002
  throw new Error(
@@ -45003,9 +45006,13 @@ function coreLint(files, fix) {
45003
45006
  );
45004
45007
  }
45005
45008
  });
45006
- task("eslint", eslintTask(files, fix));
45007
- task("prettier", prettierTask(files, fix));
45008
- return series("verify-lint", "eslint", "prettier");
45009
+ task("eslint", eslintTask(fix));
45010
+ task("prettier", prettierTask(prettierFiles, fix));
45011
+ return series(
45012
+ "verify-lint",
45013
+ "eslint",
45014
+ condition("prettier", () => !!prettierFiles && prettierFiles.length > 0)
45015
+ );
45009
45016
  }
45010
45017
 
45011
45018
  // ../../node_modules/universal-user-agent/index.js
@@ -48173,7 +48180,7 @@ async function createFilesArtifactZip(artifact, releaseTag) {
48173
48180
  try {
48174
48181
  const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
48175
48182
  archive.on("error", (err) => {
48176
- throw new Error(`Failed to create archive for release: ${err}`);
48183
+ throw new Error(`Failed to create archive for release: ${err.message}`);
48177
48184
  });
48178
48185
  archive.pipe(output);
48179
48186
  for (const filePath of artifact.files) {
@@ -48305,7 +48312,7 @@ function vitestTask(options = {}) {
48305
48312
  }
48306
48313
 
48307
48314
  // src/tasks/updateWorld.ts
48308
- import { condition, series as series2, task as task2 } from "just-scripts";
48315
+ import { condition as condition2, series as series2, task as task2 } from "just-scripts";
48309
48316
  var import_node_core_library2 = __toESM(require_lib2());
48310
48317
  import path8 from "path";
48311
48318
  function updateWorldTask(params) {
@@ -48316,7 +48323,7 @@ function updateWorldTask(params) {
48316
48323
  task2("deploy_localmc_world", () => copyFiles([params.devWorldPath], targetWorldPath));
48317
48324
  return series2(
48318
48325
  "clean_localmc_world_backup",
48319
- condition("backup_localmc_world", () => import_node_core_library2.FileSystem.exists(targetWorldPath)),
48326
+ condition2("backup_localmc_world", () => import_node_core_library2.FileSystem.exists(targetWorldPath)),
48320
48327
  "clean_localmc_world",
48321
48328
  "deploy_localmc_world"
48322
48329
  );
@@ -48326,9 +48333,14 @@ function updateWorldTask(params) {
48326
48333
  import { argv, series as series3, task as task3, watch, logger as logger2, undertaker, option } from "just-scripts";
48327
48334
  var WATCH_TASK_NAME = "watch-task";
48328
48335
  option("watch");
48336
+ function executeTask(taskFunction) {
48337
+ void taskFunction.call(void 0, () => {
48338
+ });
48339
+ }
48329
48340
  function watchTask(globs, taskFunction) {
48330
48341
  return () => {
48331
- if (!argv().watch) {
48342
+ const watchArgs = argv();
48343
+ if (!watchArgs.watch) {
48332
48344
  return taskFunction;
48333
48345
  }
48334
48346
  let taskInProgress = true;
@@ -48338,7 +48350,7 @@ function watchTask(globs, taskFunction) {
48338
48350
  if (pendingWork) {
48339
48351
  logger2.info("Processing pending changes...");
48340
48352
  pendingWork = false;
48341
- origTask.call();
48353
+ executeTask(origTask);
48342
48354
  } else {
48343
48355
  logger2.info("Waiting for new changes...");
48344
48356
  taskInProgress = false;
@@ -48357,11 +48369,11 @@ function watchTask(globs, taskFunction) {
48357
48369
  onFinished(args);
48358
48370
  });
48359
48371
  task3(WATCH_TASK_NAME, series3(taskFunction));
48360
- let origTask = series3(WATCH_TASK_NAME);
48361
- origTask.call();
48372
+ const origTask = series3(WATCH_TASK_NAME);
48373
+ executeTask(origTask);
48362
48374
  watch(globs, () => {
48363
48375
  if (!taskInProgress) {
48364
- origTask.call();
48376
+ executeTask(origTask);
48365
48377
  } else {
48366
48378
  pendingWork = true;
48367
48379
  }
@@ -1,2 +1,2 @@
1
- import { TaskFunction } from 'just-scripts';
2
- export declare function coreLint(files: string[], fix?: boolean): TaskFunction;
1
+ import type { TaskFunction } from 'just-scripts';
2
+ export declare function coreLint(prettierFiles?: string[], fix?: boolean): TaskFunction;
@@ -1,6 +1,6 @@
1
1
  import { TaskFunction } from 'just-scripts';
2
2
  /**
3
- * If command line parameter `option` is present, watch for changes in the specified files and run the specified task.
3
+ * If command line parameter `watch` is present, it watches for changes in the specified files and run the specified task.
4
4
  * Otherwise, just run the task.
5
5
  * @param globs The file globs to watch.
6
6
  * @param taskFunction The task to run when changes are detected.
package/lib-cjs/index.js CHANGED
@@ -12262,9 +12262,9 @@ var require_codegen = __commonJS({
12262
12262
  };
12263
12263
  Else.kind = "else";
12264
12264
  var If = class _If extends BlockNode {
12265
- constructor(condition2, nodes) {
12265
+ constructor(condition3, nodes) {
12266
12266
  super(nodes);
12267
- this.condition = condition2;
12267
+ this.condition = condition3;
12268
12268
  }
12269
12269
  render(opts) {
12270
12270
  let code = `if(${this.condition})` + super.render(opts);
@@ -12527,8 +12527,8 @@ var require_codegen = __commonJS({
12527
12527
  return new code_1._Code(code);
12528
12528
  }
12529
12529
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
12530
- if(condition2, thenBody, elseBody) {
12531
- this._blockNode(new If(condition2));
12530
+ if(condition3, thenBody, elseBody) {
12531
+ this._blockNode(new If(condition3));
12532
12532
  if (thenBody && elseBody) {
12533
12533
  this.code(thenBody).else().code(elseBody).endIf();
12534
12534
  } else if (thenBody) {
@@ -12539,8 +12539,8 @@ var require_codegen = __commonJS({
12539
12539
  return this;
12540
12540
  }
12541
12541
  // `else if` clause - invalid without `if` or after `else` clauses
12542
- elseIf(condition2) {
12543
- return this._elseNode(new If(condition2));
12542
+ elseIf(condition3) {
12543
+ return this._elseNode(new If(condition3));
12544
12544
  }
12545
12545
  // `else` clause - only valid after `if` or `else if` clauses
12546
12546
  else() {
@@ -13407,11 +13407,11 @@ var require_defaults = __commonJS({
13407
13407
  (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
13408
13408
  return;
13409
13409
  }
13410
- let condition2 = (0, codegen_1._)`${childData} === undefined`;
13410
+ let condition3 = (0, codegen_1._)`${childData} === undefined`;
13411
13411
  if (opts.useDefaults === "empty") {
13412
- condition2 = (0, codegen_1._)`${condition2} || ${childData} === null || ${childData} === ""`;
13412
+ condition3 = (0, codegen_1._)`${condition3} || ${childData} === null || ${childData} === ""`;
13413
13413
  }
13414
- gen.if(condition2, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
13414
+ gen.if(condition3, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
13415
13415
  }
13416
13416
  }
13417
13417
  });
@@ -14335,11 +14335,11 @@ var require_validate = __commonJS({
14335
14335
  this.errsCount = it.gen.const("_errs", names_1.default.errors);
14336
14336
  }
14337
14337
  }
14338
- result(condition2, successAction, failAction) {
14339
- this.failResult((0, codegen_1.not)(condition2), successAction, failAction);
14338
+ result(condition3, successAction, failAction) {
14339
+ this.failResult((0, codegen_1.not)(condition3), successAction, failAction);
14340
14340
  }
14341
- failResult(condition2, successAction, failAction) {
14342
- this.gen.if(condition2);
14341
+ failResult(condition3, successAction, failAction) {
14342
+ this.gen.if(condition3);
14343
14343
  if (failAction)
14344
14344
  failAction();
14345
14345
  else
@@ -14356,28 +14356,28 @@ var require_validate = __commonJS({
14356
14356
  this.gen.else();
14357
14357
  }
14358
14358
  }
14359
- pass(condition2, failAction) {
14360
- this.failResult((0, codegen_1.not)(condition2), void 0, failAction);
14359
+ pass(condition3, failAction) {
14360
+ this.failResult((0, codegen_1.not)(condition3), void 0, failAction);
14361
14361
  }
14362
- fail(condition2) {
14363
- if (condition2 === void 0) {
14362
+ fail(condition3) {
14363
+ if (condition3 === void 0) {
14364
14364
  this.error();
14365
14365
  if (!this.allErrors)
14366
14366
  this.gen.if(false);
14367
14367
  return;
14368
14368
  }
14369
- this.gen.if(condition2);
14369
+ this.gen.if(condition3);
14370
14370
  this.error();
14371
14371
  if (this.allErrors)
14372
14372
  this.gen.endIf();
14373
14373
  else
14374
14374
  this.gen.else();
14375
14375
  }
14376
- fail$data(condition2) {
14376
+ fail$data(condition3) {
14377
14377
  if (!this.$data)
14378
- return this.fail(condition2);
14378
+ return this.fail(condition3);
14379
14379
  const { schemaCode } = this;
14380
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition2)})`);
14380
+ this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition3)})`);
14381
14381
  }
14382
14382
  error(append, errorParams, errorPaths) {
14383
14383
  if (errorParams) {
@@ -18997,9 +18997,9 @@ var require_codegen2 = __commonJS({
18997
18997
  };
18998
18998
  Else.kind = "else";
18999
18999
  var If = class _If extends BlockNode {
19000
- constructor(condition2, nodes) {
19000
+ constructor(condition3, nodes) {
19001
19001
  super(nodes);
19002
- this.condition = condition2;
19002
+ this.condition = condition3;
19003
19003
  }
19004
19004
  render(opts) {
19005
19005
  let code = `if(${this.condition})` + super.render(opts);
@@ -19262,8 +19262,8 @@ var require_codegen2 = __commonJS({
19262
19262
  return new code_1._Code(code);
19263
19263
  }
19264
19264
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
19265
- if(condition2, thenBody, elseBody) {
19266
- this._blockNode(new If(condition2));
19265
+ if(condition3, thenBody, elseBody) {
19266
+ this._blockNode(new If(condition3));
19267
19267
  if (thenBody && elseBody) {
19268
19268
  this.code(thenBody).else().code(elseBody).endIf();
19269
19269
  } else if (thenBody) {
@@ -19274,8 +19274,8 @@ var require_codegen2 = __commonJS({
19274
19274
  return this;
19275
19275
  }
19276
19276
  // `else if` clause - invalid without `if` or after `else` clauses
19277
- elseIf(condition2) {
19278
- return this._elseNode(new If(condition2));
19277
+ elseIf(condition3) {
19278
+ return this._elseNode(new If(condition3));
19279
19279
  }
19280
19280
  // `else` clause - only valid after `if` or `else if` clauses
19281
19281
  else() {
@@ -20135,11 +20135,11 @@ var require_defaults2 = __commonJS({
20135
20135
  (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
20136
20136
  return;
20137
20137
  }
20138
- let condition2 = (0, codegen_1._)`${childData} === undefined`;
20138
+ let condition3 = (0, codegen_1._)`${childData} === undefined`;
20139
20139
  if (opts.useDefaults === "empty") {
20140
- condition2 = (0, codegen_1._)`${condition2} || ${childData} === null || ${childData} === ""`;
20140
+ condition3 = (0, codegen_1._)`${condition3} || ${childData} === null || ${childData} === ""`;
20141
20141
  }
20142
- gen.if(condition2, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
20142
+ gen.if(condition3, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
20143
20143
  }
20144
20144
  }
20145
20145
  });
@@ -20940,11 +20940,11 @@ var require_validate2 = __commonJS({
20940
20940
  this.errsCount = it.gen.const("_errs", names_1.default.errors);
20941
20941
  }
20942
20942
  }
20943
- result(condition2, successAction, failAction) {
20944
- this.failResult((0, codegen_1.not)(condition2), successAction, failAction);
20943
+ result(condition3, successAction, failAction) {
20944
+ this.failResult((0, codegen_1.not)(condition3), successAction, failAction);
20945
20945
  }
20946
- failResult(condition2, successAction, failAction) {
20947
- this.gen.if(condition2);
20946
+ failResult(condition3, successAction, failAction) {
20947
+ this.gen.if(condition3);
20948
20948
  if (failAction)
20949
20949
  failAction();
20950
20950
  else
@@ -20961,28 +20961,28 @@ var require_validate2 = __commonJS({
20961
20961
  this.gen.else();
20962
20962
  }
20963
20963
  }
20964
- pass(condition2, failAction) {
20965
- this.failResult((0, codegen_1.not)(condition2), void 0, failAction);
20964
+ pass(condition3, failAction) {
20965
+ this.failResult((0, codegen_1.not)(condition3), void 0, failAction);
20966
20966
  }
20967
- fail(condition2) {
20968
- if (condition2 === void 0) {
20967
+ fail(condition3) {
20968
+ if (condition3 === void 0) {
20969
20969
  this.error();
20970
20970
  if (!this.allErrors)
20971
20971
  this.gen.if(false);
20972
20972
  return;
20973
20973
  }
20974
- this.gen.if(condition2);
20974
+ this.gen.if(condition3);
20975
20975
  this.error();
20976
20976
  if (this.allErrors)
20977
20977
  this.gen.endIf();
20978
20978
  else
20979
20979
  this.gen.else();
20980
20980
  }
20981
- fail$data(condition2) {
20981
+ fail$data(condition3) {
20982
20982
  if (!this.$data)
20983
- return this.fail(condition2);
20983
+ return this.fail(condition3);
20984
20984
  const { schemaCode } = this;
20985
- this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition2)})`);
20985
+ this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition3)})`);
20986
20986
  }
20987
20987
  error(append, errorParams, errorPaths) {
20988
20988
  if (errorParams) {
@@ -44994,33 +44994,36 @@ function getConfigFilePath() {
44994
44994
  }
44995
44995
  return void 0;
44996
44996
  }
44997
- function eslintTask(files, fix) {
44997
+ function eslintTask(fix) {
44998
44998
  return () => {
44999
44999
  const configFilePath = getConfigFilePath();
45000
- if (configFilePath) {
45001
- import_process.default.env["ESLINT_USE_FLAT_CONFIG"] = FLAT_CONFIG_FILES.some((file) => configFilePath.endsWith(file)) ? "true" : "false";
45002
- const cmd = [
45003
- "npx",
45004
- "eslint",
45005
- ...files,
45006
- "--config",
45007
- `"${configFilePath}"`,
45008
- ...fix ? ["--fix"] : [],
45009
- "--color"
45010
- ].join(" ");
45011
- import_just_scripts.logger.info(`Running command: ${cmd}`);
45012
- return (0, import_child_process.execSync)(cmd, { stdio: "inherit" });
45000
+ if (!configFilePath) {
45001
+ return Promise.resolve();
45013
45002
  }
45014
- return Promise.resolve();
45003
+ import_process.default.env["ESLINT_USE_FLAT_CONFIG"] = FLAT_CONFIG_FILES.some((file) => configFilePath.endsWith(file)) ? "true" : "false";
45004
+ const cmd = [
45005
+ "npx",
45006
+ "eslint",
45007
+ ".",
45008
+ "--config",
45009
+ `"${configFilePath}"`,
45010
+ ...fix ? ["--fix"] : [],
45011
+ "--color"
45012
+ ].join(" ");
45013
+ import_just_scripts.logger.info(`Running command: ${cmd}`);
45014
+ return (0, import_child_process.execSync)(cmd, { stdio: "inherit" });
45015
45015
  };
45016
45016
  }
45017
45017
  function prettierTask(files, fix) {
45018
45018
  return () => {
45019
+ if (!files || files.length === 0) {
45020
+ return Promise.resolve();
45021
+ }
45019
45022
  const cmd = ["npx", "prettier", fix ? "--write" : "--check", ...files].join(" ");
45020
45023
  return (0, import_child_process.execSync)(cmd, { stdio: "inherit" });
45021
45024
  };
45022
45025
  }
45023
- function coreLint(files, fix) {
45026
+ function coreLint(prettierFiles, fix) {
45024
45027
  (0, import_just_scripts.task)("verify-lint", () => {
45025
45028
  if (!getConfigFilePath()) {
45026
45029
  throw new Error(
@@ -45030,9 +45033,13 @@ function coreLint(files, fix) {
45030
45033
  );
45031
45034
  }
45032
45035
  });
45033
- (0, import_just_scripts.task)("eslint", eslintTask(files, fix));
45034
- (0, import_just_scripts.task)("prettier", prettierTask(files, fix));
45035
- return (0, import_just_scripts.series)("verify-lint", "eslint", "prettier");
45036
+ (0, import_just_scripts.task)("eslint", eslintTask(fix));
45037
+ (0, import_just_scripts.task)("prettier", prettierTask(prettierFiles, fix));
45038
+ return (0, import_just_scripts.series)(
45039
+ "verify-lint",
45040
+ "eslint",
45041
+ (0, import_just_scripts.condition)("prettier", () => !!prettierFiles && prettierFiles.length > 0)
45042
+ );
45036
45043
  }
45037
45044
 
45038
45045
  // ../../node_modules/universal-user-agent/index.js
@@ -48200,7 +48207,7 @@ async function createFilesArtifactZip(artifact, releaseTag) {
48200
48207
  try {
48201
48208
  const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
48202
48209
  archive.on("error", (err) => {
48203
- throw new Error(`Failed to create archive for release: ${err}`);
48210
+ throw new Error(`Failed to create archive for release: ${err.message}`);
48204
48211
  });
48205
48212
  archive.pipe(output);
48206
48213
  for (const filePath of artifact.files) {
@@ -48353,9 +48360,14 @@ function updateWorldTask(params) {
48353
48360
  var import_just_scripts3 = require("just-scripts");
48354
48361
  var WATCH_TASK_NAME = "watch-task";
48355
48362
  (0, import_just_scripts3.option)("watch");
48363
+ function executeTask(taskFunction) {
48364
+ void taskFunction.call(void 0, () => {
48365
+ });
48366
+ }
48356
48367
  function watchTask(globs, taskFunction) {
48357
48368
  return () => {
48358
- if (!(0, import_just_scripts3.argv)().watch) {
48369
+ const watchArgs = (0, import_just_scripts3.argv)();
48370
+ if (!watchArgs.watch) {
48359
48371
  return taskFunction;
48360
48372
  }
48361
48373
  let taskInProgress = true;
@@ -48365,7 +48377,7 @@ function watchTask(globs, taskFunction) {
48365
48377
  if (pendingWork) {
48366
48378
  import_just_scripts3.logger.info("Processing pending changes...");
48367
48379
  pendingWork = false;
48368
- origTask.call();
48380
+ executeTask(origTask);
48369
48381
  } else {
48370
48382
  import_just_scripts3.logger.info("Waiting for new changes...");
48371
48383
  taskInProgress = false;
@@ -48384,11 +48396,11 @@ function watchTask(globs, taskFunction) {
48384
48396
  onFinished(args);
48385
48397
  });
48386
48398
  (0, import_just_scripts3.task)(WATCH_TASK_NAME, (0, import_just_scripts3.series)(taskFunction));
48387
- let origTask = (0, import_just_scripts3.series)(WATCH_TASK_NAME);
48388
- origTask.call();
48399
+ const origTask = (0, import_just_scripts3.series)(WATCH_TASK_NAME);
48400
+ executeTask(origTask);
48389
48401
  (0, import_just_scripts3.watch)(globs, () => {
48390
48402
  if (!taskInProgress) {
48391
- origTask.call();
48403
+ executeTask(origTask);
48392
48404
  } else {
48393
48405
  pendingWork = true;
48394
48406
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/core-build-tasks",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Common build tasks used for minecraft-scripting-libraries",
5
5
  "exports": {
6
6
  "types": "./lib/index.d.ts",
@@ -49,7 +49,6 @@
49
49
  "@types/archiver": "^6.0.0",
50
50
  "@types/node": "^22.0.0",
51
51
  "@types/rimraf": "^3.0.2",
52
- "@typescript-eslint/parser": "^8.18.1",
53
52
  "archiver": "^6.0.0",
54
53
  "ts-node": "^10.9.1",
55
54
  "tsconfig": "*"