xmlui 0.11.22 → 0.11.24

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 (32) hide show
  1. package/dist/bin/index.cjs +67 -73
  2. package/dist/bin/index.js +51 -57
  3. package/dist/lib/{index-BvICspZ1.js → index-9UB61miF.js} +4548 -4060
  4. package/dist/lib/index.css +1 -1
  5. package/dist/lib/{initMock-Bq5003sR.js → initMock-DppAqVHs.js} +1 -1
  6. package/dist/lib/language-server-web-worker.js +1 -1
  7. package/dist/lib/language-server.js +1 -1
  8. package/dist/lib/{metadata-utils-DFy9QKH6.js → metadata-utils-X4ryJQBa.js} +1 -1
  9. package/dist/lib/scss/components-core/theming/_themes.scss +35 -7
  10. package/dist/lib/scss/index.scss +113 -66
  11. package/dist/lib/{server-common-BwQMbLFd.js → server-common-BZY2B446.js} +2464 -1296
  12. package/dist/lib/syntax-textmate.d.ts +1 -1
  13. package/dist/lib/syntax-textmate.js +1 -1
  14. package/dist/lib/testing.d.ts +8 -1
  15. package/dist/lib/testing.js +2 -2
  16. package/dist/lib/{transform-CQ_6R-43.js → transform-FiPBuy3W.js} +9 -3
  17. package/dist/lib/vite-xmlui-plugin.js +7 -3
  18. package/dist/lib/{xmlui-parser-9Yk-asFP.js → xmlui-parser-DXCqrM50.js} +1 -1
  19. package/dist/lib/xmlui-parser.d.ts +8 -1
  20. package/dist/lib/xmlui-parser.js +2 -2
  21. package/dist/lib/{xmlui-serializer-CeCcgdVR.js → xmlui-serializer-D4ixnQay.js} +1 -1
  22. package/dist/lib/xmlui.d.ts +15 -5
  23. package/dist/lib/xmlui.js +65 -64
  24. package/dist/metadata/{collectedComponentMetadata-CiXsnuT1.js → collectedComponentMetadata-CkHQSF65.js} +2237 -1751
  25. package/dist/metadata/{initMock-B3RWJ2uL.js → initMock-KBzfT81H.js} +1 -1
  26. package/dist/metadata/xmlui-metadata.css +1 -1
  27. package/dist/metadata/xmlui-metadata.js +1 -1
  28. package/dist/metadata/xmlui-metadata.umd.cjs +3 -3
  29. package/dist/standalone/xmlui-standalone.es.d.ts +17 -5
  30. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  31. package/package.json +1 -1
  32. package/src/syntax/textMate/xmlui.tmLanguage.json +1 -1
@@ -488,7 +488,7 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
488
488
  }
489
489
  let base = str;
490
490
  let prefix = "";
491
- let glob$1 = "";
491
+ let glob$2 = "";
492
492
  if (start$1 > 0) {
493
493
  prefix = str.slice(0, start$1);
494
494
  str = str.slice(start$1);
@@ -496,16 +496,16 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
496
496
  }
497
497
  if (base && isGlob === true && lastIndex > 0) {
498
498
  base = str.slice(0, lastIndex);
499
- glob$1 = str.slice(lastIndex);
499
+ glob$2 = str.slice(lastIndex);
500
500
  } else if (isGlob === true) {
501
501
  base = "";
502
- glob$1 = str;
502
+ glob$2 = str;
503
503
  } else base = str;
504
504
  if (base && base !== "" && base !== "/" && base !== str) {
505
505
  if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
506
506
  }
507
507
  if (opts.unescape === true) {
508
- if (glob$1) glob$1 = utils$2.removeBackslashes(glob$1);
508
+ if (glob$2) glob$2 = utils$2.removeBackslashes(glob$2);
509
509
  if (base && backslashes === true) base = utils$2.removeBackslashes(base);
510
510
  }
511
511
  const state = {
@@ -513,7 +513,7 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
513
513
  input,
514
514
  start: start$1,
515
515
  base,
516
- glob: glob$1,
516
+ glob: glob$2,
517
517
  isBrace,
518
518
  isBracket,
519
519
  isGlob,
@@ -1453,9 +1453,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1453
1453
  * @return {Function=} Returns a matcher function.
1454
1454
  * @api public
1455
1455
  */
1456
- const picomatch = (glob$1, options, returnState = false) => {
1457
- if (Array.isArray(glob$1)) {
1458
- const fns = glob$1.map((input) => picomatch(input, options, returnState));
1456
+ const picomatch = (glob$2, options, returnState = false) => {
1457
+ if (Array.isArray(glob$2)) {
1458
+ const fns = glob$2.map((input) => picomatch(input, options, returnState));
1459
1459
  const arrayMatcher = (str) => {
1460
1460
  for (const isMatch of fns) {
1461
1461
  const state$1 = isMatch(str);
@@ -1465,11 +1465,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1465
1465
  };
1466
1466
  return arrayMatcher;
1467
1467
  }
1468
- const isState = isObject(glob$1) && glob$1.tokens && glob$1.input;
1469
- if (glob$1 === "" || typeof glob$1 !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
1468
+ const isState = isObject(glob$2) && glob$2.tokens && glob$2.input;
1469
+ if (glob$2 === "" || typeof glob$2 !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
1470
1470
  const opts = options || {};
1471
1471
  const posix$1 = utils.isWindows(options);
1472
- const regex = isState ? picomatch.compileRe(glob$1, options) : picomatch.makeRe(glob$1, options, false, true);
1472
+ const regex = isState ? picomatch.compileRe(glob$2, options) : picomatch.makeRe(glob$2, options, false, true);
1473
1473
  const state = regex.state;
1474
1474
  delete regex.state;
1475
1475
  let isIgnored = () => false;
@@ -1484,11 +1484,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1484
1484
  }
1485
1485
  const matcher = (input, returnObject = false) => {
1486
1486
  const { isMatch, match, output } = picomatch.test(input, regex, options, {
1487
- glob: glob$1,
1487
+ glob: glob$2,
1488
1488
  posix: posix$1
1489
1489
  });
1490
1490
  const result = {
1491
- glob: glob$1,
1491
+ glob: glob$2,
1492
1492
  state,
1493
1493
  regex,
1494
1494
  posix: posix$1,
@@ -1529,7 +1529,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1529
1529
  * @return {Object} Returns an object with matching info.
1530
1530
  * @api public
1531
1531
  */
1532
- picomatch.test = (input, regex, options, { glob: glob$1, posix: posix$1 } = {}) => {
1532
+ picomatch.test = (input, regex, options, { glob: glob$2, posix: posix$1 } = {}) => {
1533
1533
  if (typeof input !== "string") throw new TypeError("Expected input to be a string");
1534
1534
  if (input === "") return {
1535
1535
  isMatch: false,
@@ -1537,11 +1537,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1537
1537
  };
1538
1538
  const opts = options || {};
1539
1539
  const format = opts.format || (posix$1 ? utils.toPosixSlashes : null);
1540
- let match = input === glob$1;
1540
+ let match = input === glob$2;
1541
1541
  let output = match && format ? format(input) : input;
1542
1542
  if (match === false) {
1543
1543
  output = format ? format(input) : input;
1544
- match = output === glob$1;
1544
+ match = output === glob$2;
1545
1545
  }
1546
1546
  if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix$1);
1547
1547
  else match = regex.exec(output);
@@ -1564,8 +1564,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
1564
1564
  * @return {Boolean}
1565
1565
  * @api public
1566
1566
  */
1567
- picomatch.matchBase = (input, glob$1, options, posix$1 = utils.isWindows(options)) => {
1568
- return (glob$1 instanceof RegExp ? glob$1 : picomatch.makeRe(glob$1, options)).test(path$2.basename(input));
1567
+ picomatch.matchBase = (input, glob$2, options, posix$1 = utils.isWindows(options)) => {
1568
+ return (glob$2 instanceof RegExp ? glob$2 : picomatch.makeRe(glob$2, options)).test(path$2.basename(input));
1569
1569
  };
1570
1570
  /**
1571
1571
  * Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -5734,7 +5734,8 @@ function collectCodeBehindFromSource(moduleName, source) {
5734
5734
  const result = {
5735
5735
  vars: {},
5736
5736
  moduleErrors: {},
5737
- functions: {}
5737
+ functions: {},
5738
+ hasInvalidStatements: false
5738
5739
  };
5739
5740
  const collectedFunctions = {};
5740
5741
  const parsedModule = parseScriptModule(moduleName, source);
@@ -5756,7 +5757,7 @@ function collectCodeBehindFromSource(moduleName, source) {
5756
5757
  case T_FUNCTION_DECLARATION:
5757
5758
  addFunctionDeclaration(stmt);
5758
5759
  break;
5759
- default: throw new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
5760
+ default: result.hasInvalidStatements = true;
5760
5761
  }
5761
5762
  });
5762
5763
  return result;
@@ -7141,6 +7142,7 @@ const CORE_NS_KEY = "core-ns";
7141
7142
  const CORE_NAMESPACE_VALUE = "#xmlui-core-ns";
7142
7143
  const HelperNode = {
7143
7144
  property: "property",
7145
+ template: "template",
7144
7146
  event: "event",
7145
7147
  variable: "variable",
7146
7148
  loaders: "loaders",
@@ -7289,6 +7291,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7289
7291
  }
7290
7292
  switch (childName) {
7291
7293
  case "property":
7294
+ case "template":
7292
7295
  collectElementHelper(usesStack$1, comp, child, (name) => isComponent(comp) ? comp.props?.[name] : void 0, (name, value) => {
7293
7296
  if (!isComponent(comp)) return;
7294
7297
  comp.props ??= {};
@@ -7334,6 +7337,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7334
7337
  try {
7335
7338
  parser.parseStatements();
7336
7339
  comp.scriptCollected = collectCodeBehindFromSource("Main", comp.script);
7340
+ if (comp.scriptCollected.hasInvalidStatements) comp.scriptError = /* @__PURE__ */ new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
7337
7341
  } catch (err) {
7338
7342
  if (parser.errors && parser.errors.length > 0) {
7339
7343
  const errMsg = parser.errors[0];
@@ -7579,7 +7583,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7579
7583
  function prepNode(node$1) {
7580
7584
  const childNodes = getChildNodes(node$1);
7581
7585
  const tagName = getComponentName(node$1, getText);
7582
- const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property";
7586
+ const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property" || tagName === "template";
7583
7587
  const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
7584
7588
  const attrs = getAttributes(node$1);
7585
7589
  desugarKeyOnlyAttrs(attrs);
@@ -8341,6 +8345,12 @@ function viteXmluiPlugin(pluginOptions = {}) {
8341
8345
 
8342
8346
  //#endregion
8343
8347
  //#region bin/viteConfig.ts
8348
+ const logger = (0, vite.createLogger)();
8349
+ const loggerWarn = logger.warn;
8350
+ logger.warn = (msg, options) => {
8351
+ if (msg.includes("Failed to resolve \"remix:manifest\"")) return;
8352
+ loggerWarn(msg, options);
8353
+ };
8344
8354
  async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "" } = {}) {
8345
8355
  let overrides = {};
8346
8356
  try {
@@ -8354,6 +8364,7 @@ async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatD
8354
8364
  viteXmluiPlugin({}),
8355
8365
  ...overrides.plugins || []
8356
8366
  ],
8367
+ customLogger: logger,
8357
8368
  base: withRelativeRoot ? "" : void 0,
8358
8369
  define: overrides.define,
8359
8370
  resolve: {
@@ -8417,7 +8428,7 @@ dotenv.config({
8417
8428
  });
8418
8429
  async function getExportedJsObjects(path$5) {
8419
8430
  return await new Promise((resolve$1, reject) => {
8420
- glob.glob(`${process.cwd()}/${path$5}`, (err, matches = []) => {
8431
+ (0, glob.default)(`${process.cwd()}/${path$5}`, (err, matches = []) => {
8421
8432
  resolve$1(Promise.all(matches.map(async (file) => {
8422
8433
  return (await import(file)).default;
8423
8434
  })));
@@ -8430,7 +8441,7 @@ async function convertResourcesDir(distRoot, flatDist, filePrefix) {
8430
8441
  const resourcesDir = `${distRoot}/resources`;
8431
8442
  if (!(0, fs.existsSync)(resourcesDir)) return;
8432
8443
  const files = await new Promise((resolve$1, reject) => {
8433
- glob.glob(`${resourcesDir}/**/*`, (err, matches = []) => {
8444
+ (0, glob.default)(`${resourcesDir}/**/*`, (err, matches = []) => {
8434
8445
  resolve$1(matches);
8435
8446
  });
8436
8447
  });
@@ -8731,7 +8742,7 @@ function getStringArg(arg, defaultValue) {
8731
8742
  if (arg === void 0) return defaultValue;
8732
8743
  return dedupeArg(arg);
8733
8744
  }
8734
- const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).command("build", "Build the project", (yargs$1) => {
8745
+ (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).command("build", "Build the project", (yargs$1) => {
8735
8746
  return yargs$1.option("flatDist", {
8736
8747
  type: "boolean",
8737
8748
  description: "Create flat distribution"
@@ -8751,6 +8762,15 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8751
8762
  type: "boolean",
8752
8763
  description: "Use relative root"
8753
8764
  });
8765
+ }, (argv) => {
8766
+ const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8767
+ build({
8768
+ buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8769
+ withMock: getBoolArg(withMock, prod ? false : void 0),
8770
+ withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8771
+ withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8772
+ flatDist: getBoolArg(flatDist, prod ? true : void 0)
8773
+ });
8754
8774
  }).command("build-lib", "Build library", (yargs$1) => {
8755
8775
  return yargs$1.option("watch", {
8756
8776
  type: "boolean",
@@ -8759,6 +8779,12 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8759
8779
  type: "string",
8760
8780
  description: "Build mode"
8761
8781
  });
8782
+ }, (argv) => {
8783
+ const { watch, mode } = argv;
8784
+ buildLib({
8785
+ watchMode: getBoolArg(watch, false),
8786
+ mode: getStringArg(mode, "")
8787
+ });
8762
8788
  }).command("start", "Start development server", (yargs$1) => {
8763
8789
  return yargs$1.option("port", {
8764
8790
  type: "number",
@@ -8770,11 +8796,21 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8770
8796
  type: "string",
8771
8797
  description: "Proxy target"
8772
8798
  });
8799
+ }, (argv) => {
8800
+ const { port, withMock, proxy } = argv;
8801
+ start({
8802
+ port,
8803
+ withMock: getBoolArg(withMock),
8804
+ proxy
8805
+ });
8773
8806
  }).command("preview", "Preview build", (yargs$1) => {
8774
8807
  return yargs$1.option("proxy", {
8775
8808
  type: "string",
8776
8809
  description: "Proxy target"
8777
8810
  });
8811
+ }, (argv) => {
8812
+ const { proxy } = argv;
8813
+ preview({ proxy });
8778
8814
  }).command("zip-dist", "Zip distribution", (yargs$1) => {
8779
8815
  return yargs$1.option("target", {
8780
8816
  type: "string",
@@ -8783,54 +8819,12 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8783
8819
  type: "string",
8784
8820
  description: "Source directory"
8785
8821
  });
8786
- }).help().parseSync();
8787
- const command = argv._[0];
8788
- switch (command) {
8789
- case "build": {
8790
- const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8791
- build({
8792
- buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8793
- withMock: getBoolArg(withMock, prod ? false : void 0),
8794
- withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8795
- withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8796
- flatDist: getBoolArg(flatDist, prod ? true : void 0)
8797
- });
8798
- break;
8799
- }
8800
- case "build-lib": {
8801
- const { watch, mode } = argv;
8802
- buildLib({
8803
- watchMode: getBoolArg(watch, false),
8804
- mode: getStringArg(mode, "")
8805
- });
8806
- break;
8807
- }
8808
- case "start": {
8809
- const { port, withMock, proxy } = argv;
8810
- start({
8811
- port,
8812
- withMock: getBoolArg(withMock),
8813
- proxy
8814
- });
8815
- break;
8816
- }
8817
- case "preview": {
8818
- const { proxy } = argv;
8819
- preview({ proxy });
8820
- break;
8821
- }
8822
- case "zip-dist": {
8823
- const { target, source } = argv;
8824
- zipDist({
8825
- target,
8826
- source
8827
- });
8828
- break;
8829
- }
8830
- default:
8831
- console.log("Unknown command \"" + command + "\".");
8832
- console.log("Perhaps you need to update xmlui?");
8833
- process.exit(1);
8834
- }
8822
+ }, (argv) => {
8823
+ const { target, source } = argv;
8824
+ zipDist({
8825
+ target,
8826
+ source
8827
+ });
8828
+ }).strict().demandCommand(1, "You need to provide a command").help().parse();
8835
8829
 
8836
8830
  //#endregion
package/dist/bin/index.js CHANGED
@@ -3,8 +3,8 @@ import { createRequire } from "node:module";
3
3
  import { cp, mkdir, rm, writeFile } from "fs/promises";
4
4
  import * as dotenv from "dotenv";
5
5
  import { existsSync } from "fs";
6
- import * as glob from "glob";
7
- import { build, createServer, defineConfig, loadEnv, preview } from "vite";
6
+ import glob from "glob";
7
+ import { build, createLogger, createServer, defineConfig, loadEnv, preview } from "vite";
8
8
  import react from "@vitejs/plugin-react";
9
9
  import svgr from "vite-plugin-svgr";
10
10
  import ViteYaml from "@modyfi/vite-plugin-yaml";
@@ -5722,7 +5722,8 @@ function collectCodeBehindFromSource(moduleName, source) {
5722
5722
  const result = {
5723
5723
  vars: {},
5724
5724
  moduleErrors: {},
5725
- functions: {}
5725
+ functions: {},
5726
+ hasInvalidStatements: false
5726
5727
  };
5727
5728
  const collectedFunctions = {};
5728
5729
  const parsedModule = parseScriptModule(moduleName, source);
@@ -5744,7 +5745,7 @@ function collectCodeBehindFromSource(moduleName, source) {
5744
5745
  case T_FUNCTION_DECLARATION:
5745
5746
  addFunctionDeclaration(stmt);
5746
5747
  break;
5747
- default: throw new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
5748
+ default: result.hasInvalidStatements = true;
5748
5749
  }
5749
5750
  });
5750
5751
  return result;
@@ -7129,6 +7130,7 @@ const CORE_NS_KEY = "core-ns";
7129
7130
  const CORE_NAMESPACE_VALUE = "#xmlui-core-ns";
7130
7131
  const HelperNode = {
7131
7132
  property: "property",
7133
+ template: "template",
7132
7134
  event: "event",
7133
7135
  variable: "variable",
7134
7136
  loaders: "loaders",
@@ -7277,6 +7279,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7277
7279
  }
7278
7280
  switch (childName) {
7279
7281
  case "property":
7282
+ case "template":
7280
7283
  collectElementHelper(usesStack$1, comp, child, (name) => isComponent(comp) ? comp.props?.[name] : void 0, (name, value) => {
7281
7284
  if (!isComponent(comp)) return;
7282
7285
  comp.props ??= {};
@@ -7322,6 +7325,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7322
7325
  try {
7323
7326
  parser.parseStatements();
7324
7327
  comp.scriptCollected = collectCodeBehindFromSource("Main", comp.script);
7328
+ if (comp.scriptCollected.hasInvalidStatements) comp.scriptError = /* @__PURE__ */ new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
7325
7329
  } catch (err) {
7326
7330
  if (parser.errors && parser.errors.length > 0) {
7327
7331
  const errMsg = parser.errors[0];
@@ -7567,7 +7571,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7567
7571
  function prepNode(node$1) {
7568
7572
  const childNodes = getChildNodes(node$1);
7569
7573
  const tagName = getComponentName(node$1, getText);
7570
- const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property";
7574
+ const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property" || tagName === "template";
7571
7575
  const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
7572
7576
  const attrs = getAttributes(node$1);
7573
7577
  desugarKeyOnlyAttrs(attrs);
@@ -8329,6 +8333,12 @@ function viteXmluiPlugin(pluginOptions = {}) {
8329
8333
 
8330
8334
  //#endregion
8331
8335
  //#region bin/viteConfig.ts
8336
+ const logger = createLogger();
8337
+ const loggerWarn = logger.warn;
8338
+ logger.warn = (msg, options) => {
8339
+ if (msg.includes("Failed to resolve \"remix:manifest\"")) return;
8340
+ loggerWarn(msg, options);
8341
+ };
8332
8342
  async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "" } = {}) {
8333
8343
  let overrides = {};
8334
8344
  try {
@@ -8342,6 +8352,7 @@ async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatD
8342
8352
  viteXmluiPlugin({}),
8343
8353
  ...overrides.plugins || []
8344
8354
  ],
8355
+ customLogger: logger,
8345
8356
  base: withRelativeRoot ? "" : void 0,
8346
8357
  define: overrides.define,
8347
8358
  resolve: {
@@ -8405,7 +8416,7 @@ dotenv.config({
8405
8416
  });
8406
8417
  async function getExportedJsObjects(path$5) {
8407
8418
  return await new Promise((resolve, reject) => {
8408
- glob.glob(`${process.cwd()}/${path$5}`, (err, matches = []) => {
8419
+ glob(`${process.cwd()}/${path$5}`, (err, matches = []) => {
8409
8420
  resolve(Promise.all(matches.map(async (file) => {
8410
8421
  return (await import(file)).default;
8411
8422
  })));
@@ -8418,7 +8429,7 @@ async function convertResourcesDir(distRoot, flatDist, filePrefix) {
8418
8429
  const resourcesDir = `${distRoot}/resources`;
8419
8430
  if (!existsSync(resourcesDir)) return;
8420
8431
  const files = await new Promise((resolve, reject) => {
8421
- glob.glob(`${resourcesDir}/**/*`, (err, matches = []) => {
8432
+ glob(`${resourcesDir}/**/*`, (err, matches = []) => {
8422
8433
  resolve(matches);
8423
8434
  });
8424
8435
  });
@@ -8719,7 +8730,7 @@ function getStringArg(arg, defaultValue) {
8719
8730
  if (arg === void 0) return defaultValue;
8720
8731
  return dedupeArg(arg);
8721
8732
  }
8722
- const argv = yargs(hideBin(process.argv)).command("build", "Build the project", (yargs$1) => {
8733
+ yargs(hideBin(process.argv)).command("build", "Build the project", (yargs$1) => {
8723
8734
  return yargs$1.option("flatDist", {
8724
8735
  type: "boolean",
8725
8736
  description: "Create flat distribution"
@@ -8739,6 +8750,15 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8739
8750
  type: "boolean",
8740
8751
  description: "Use relative root"
8741
8752
  });
8753
+ }, (argv) => {
8754
+ const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8755
+ build$1({
8756
+ buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8757
+ withMock: getBoolArg(withMock, prod ? false : void 0),
8758
+ withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8759
+ withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8760
+ flatDist: getBoolArg(flatDist, prod ? true : void 0)
8761
+ });
8742
8762
  }).command("build-lib", "Build library", (yargs$1) => {
8743
8763
  return yargs$1.option("watch", {
8744
8764
  type: "boolean",
@@ -8747,6 +8767,12 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8747
8767
  type: "string",
8748
8768
  description: "Build mode"
8749
8769
  });
8770
+ }, (argv) => {
8771
+ const { watch, mode } = argv;
8772
+ buildLib({
8773
+ watchMode: getBoolArg(watch, false),
8774
+ mode: getStringArg(mode, "")
8775
+ });
8750
8776
  }).command("start", "Start development server", (yargs$1) => {
8751
8777
  return yargs$1.option("port", {
8752
8778
  type: "number",
@@ -8758,11 +8784,21 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8758
8784
  type: "string",
8759
8785
  description: "Proxy target"
8760
8786
  });
8787
+ }, (argv) => {
8788
+ const { port, withMock, proxy } = argv;
8789
+ start({
8790
+ port,
8791
+ withMock: getBoolArg(withMock),
8792
+ proxy
8793
+ });
8761
8794
  }).command("preview", "Preview build", (yargs$1) => {
8762
8795
  return yargs$1.option("proxy", {
8763
8796
  type: "string",
8764
8797
  description: "Proxy target"
8765
8798
  });
8799
+ }, (argv) => {
8800
+ const { proxy } = argv;
8801
+ preview$1({ proxy });
8766
8802
  }).command("zip-dist", "Zip distribution", (yargs$1) => {
8767
8803
  return yargs$1.option("target", {
8768
8804
  type: "string",
@@ -8771,55 +8807,13 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8771
8807
  type: "string",
8772
8808
  description: "Source directory"
8773
8809
  });
8774
- }).help().parseSync();
8775
- const command = argv._[0];
8776
- switch (command) {
8777
- case "build": {
8778
- const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8779
- build$1({
8780
- buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8781
- withMock: getBoolArg(withMock, prod ? false : void 0),
8782
- withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8783
- withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8784
- flatDist: getBoolArg(flatDist, prod ? true : void 0)
8785
- });
8786
- break;
8787
- }
8788
- case "build-lib": {
8789
- const { watch, mode } = argv;
8790
- buildLib({
8791
- watchMode: getBoolArg(watch, false),
8792
- mode: getStringArg(mode, "")
8793
- });
8794
- break;
8795
- }
8796
- case "start": {
8797
- const { port, withMock, proxy } = argv;
8798
- start({
8799
- port,
8800
- withMock: getBoolArg(withMock),
8801
- proxy
8802
- });
8803
- break;
8804
- }
8805
- case "preview": {
8806
- const { proxy } = argv;
8807
- preview$1({ proxy });
8808
- break;
8809
- }
8810
- case "zip-dist": {
8811
- const { target, source } = argv;
8812
- zipDist({
8813
- target,
8814
- source
8815
- });
8816
- break;
8817
- }
8818
- default:
8819
- console.log("Unknown command \"" + command + "\".");
8820
- console.log("Perhaps you need to update xmlui?");
8821
- process.exit(1);
8822
- }
8810
+ }, (argv) => {
8811
+ const { target, source } = argv;
8812
+ zipDist({
8813
+ target,
8814
+ source
8815
+ });
8816
+ }).strict().demandCommand(1, "You need to provide a command").help().parse();
8823
8817
 
8824
8818
  //#endregion
8825
8819
  export { };