xmlui 0.11.22 → 0.11.23

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.
@@ -7141,6 +7141,7 @@ const CORE_NS_KEY = "core-ns";
7141
7141
  const CORE_NAMESPACE_VALUE = "#xmlui-core-ns";
7142
7142
  const HelperNode = {
7143
7143
  property: "property",
7144
+ template: "template",
7144
7145
  event: "event",
7145
7146
  variable: "variable",
7146
7147
  loaders: "loaders",
@@ -7289,6 +7290,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7289
7290
  }
7290
7291
  switch (childName) {
7291
7292
  case "property":
7293
+ case "template":
7292
7294
  collectElementHelper(usesStack$1, comp, child, (name) => isComponent(comp) ? comp.props?.[name] : void 0, (name, value) => {
7293
7295
  if (!isComponent(comp)) return;
7294
7296
  comp.props ??= {};
@@ -7579,7 +7581,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7579
7581
  function prepNode(node$1) {
7580
7582
  const childNodes = getChildNodes(node$1);
7581
7583
  const tagName = getComponentName(node$1, getText);
7582
- const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property";
7584
+ const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property" || tagName === "template";
7583
7585
  const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
7584
7586
  const attrs = getAttributes(node$1);
7585
7587
  desugarKeyOnlyAttrs(attrs);
@@ -8341,6 +8343,12 @@ function viteXmluiPlugin(pluginOptions = {}) {
8341
8343
 
8342
8344
  //#endregion
8343
8345
  //#region bin/viteConfig.ts
8346
+ const logger = (0, vite.createLogger)();
8347
+ const loggerWarn = logger.warn;
8348
+ logger.warn = (msg, options) => {
8349
+ if (msg.includes("Failed to resolve \"remix:manifest\"")) return;
8350
+ loggerWarn(msg, options);
8351
+ };
8344
8352
  async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "" } = {}) {
8345
8353
  let overrides = {};
8346
8354
  try {
@@ -8354,6 +8362,7 @@ async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatD
8354
8362
  viteXmluiPlugin({}),
8355
8363
  ...overrides.plugins || []
8356
8364
  ],
8365
+ customLogger: logger,
8357
8366
  base: withRelativeRoot ? "" : void 0,
8358
8367
  define: overrides.define,
8359
8368
  resolve: {
@@ -8731,7 +8740,7 @@ function getStringArg(arg, defaultValue) {
8731
8740
  if (arg === void 0) return defaultValue;
8732
8741
  return dedupeArg(arg);
8733
8742
  }
8734
- const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).command("build", "Build the project", (yargs$1) => {
8743
+ (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).command("build", "Build the project", (yargs$1) => {
8735
8744
  return yargs$1.option("flatDist", {
8736
8745
  type: "boolean",
8737
8746
  description: "Create flat distribution"
@@ -8751,6 +8760,15 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8751
8760
  type: "boolean",
8752
8761
  description: "Use relative root"
8753
8762
  });
8763
+ }, (argv) => {
8764
+ const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8765
+ build({
8766
+ buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8767
+ withMock: getBoolArg(withMock, prod ? false : void 0),
8768
+ withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8769
+ withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8770
+ flatDist: getBoolArg(flatDist, prod ? true : void 0)
8771
+ });
8754
8772
  }).command("build-lib", "Build library", (yargs$1) => {
8755
8773
  return yargs$1.option("watch", {
8756
8774
  type: "boolean",
@@ -8759,6 +8777,12 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8759
8777
  type: "string",
8760
8778
  description: "Build mode"
8761
8779
  });
8780
+ }, (argv) => {
8781
+ const { watch, mode } = argv;
8782
+ buildLib({
8783
+ watchMode: getBoolArg(watch, false),
8784
+ mode: getStringArg(mode, "")
8785
+ });
8762
8786
  }).command("start", "Start development server", (yargs$1) => {
8763
8787
  return yargs$1.option("port", {
8764
8788
  type: "number",
@@ -8770,11 +8794,21 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8770
8794
  type: "string",
8771
8795
  description: "Proxy target"
8772
8796
  });
8797
+ }, (argv) => {
8798
+ const { port, withMock, proxy } = argv;
8799
+ start({
8800
+ port,
8801
+ withMock: getBoolArg(withMock),
8802
+ proxy
8803
+ });
8773
8804
  }).command("preview", "Preview build", (yargs$1) => {
8774
8805
  return yargs$1.option("proxy", {
8775
8806
  type: "string",
8776
8807
  description: "Proxy target"
8777
8808
  });
8809
+ }, (argv) => {
8810
+ const { proxy } = argv;
8811
+ preview({ proxy });
8778
8812
  }).command("zip-dist", "Zip distribution", (yargs$1) => {
8779
8813
  return yargs$1.option("target", {
8780
8814
  type: "string",
@@ -8783,54 +8817,12 @@ const argv = (0, yargs_yargs.default)((0, yargs_helpers.hideBin)(process.argv)).
8783
8817
  type: "string",
8784
8818
  description: "Source directory"
8785
8819
  });
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
- }
8820
+ }, (argv) => {
8821
+ const { target, source } = argv;
8822
+ zipDist({
8823
+ target,
8824
+ source
8825
+ });
8826
+ }).strict().demandCommand(1, "You need to provide a command").help().parse();
8835
8827
 
8836
8828
  //#endregion
package/dist/bin/index.js CHANGED
@@ -4,7 +4,7 @@ import { cp, mkdir, rm, writeFile } from "fs/promises";
4
4
  import * as dotenv from "dotenv";
5
5
  import { existsSync } from "fs";
6
6
  import * as glob from "glob";
7
- import { build, createServer, defineConfig, loadEnv, preview } from "vite";
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";
@@ -7129,6 +7129,7 @@ const CORE_NS_KEY = "core-ns";
7129
7129
  const CORE_NAMESPACE_VALUE = "#xmlui-core-ns";
7130
7130
  const HelperNode = {
7131
7131
  property: "property",
7132
+ template: "template",
7132
7133
  event: "event",
7133
7134
  variable: "variable",
7134
7135
  loaders: "loaders",
@@ -7277,6 +7278,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7277
7278
  }
7278
7279
  switch (childName) {
7279
7280
  case "property":
7281
+ case "template":
7280
7282
  collectElementHelper(usesStack$1, comp, child, (name) => isComponent(comp) ? comp.props?.[name] : void 0, (name, value) => {
7281
7283
  if (!isComponent(comp)) return;
7282
7284
  comp.props ??= {};
@@ -7567,7 +7569,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
7567
7569
  function prepNode(node$1) {
7568
7570
  const childNodes = getChildNodes(node$1);
7569
7571
  const tagName = getComponentName(node$1, getText);
7570
- const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property";
7572
+ const shouldUseTextNodeElement = !(tagName in HelperNode) || tagName === "property" || tagName === "template";
7571
7573
  const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
7572
7574
  const attrs = getAttributes(node$1);
7573
7575
  desugarKeyOnlyAttrs(attrs);
@@ -8329,6 +8331,12 @@ function viteXmluiPlugin(pluginOptions = {}) {
8329
8331
 
8330
8332
  //#endregion
8331
8333
  //#region bin/viteConfig.ts
8334
+ const logger = createLogger();
8335
+ const loggerWarn = logger.warn;
8336
+ logger.warn = (msg, options) => {
8337
+ if (msg.includes("Failed to resolve \"remix:manifest\"")) return;
8338
+ loggerWarn(msg, options);
8339
+ };
8332
8340
  async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "" } = {}) {
8333
8341
  let overrides = {};
8334
8342
  try {
@@ -8342,6 +8350,7 @@ async function getViteConfig({ flatDist = false, withRelativeRoot = false, flatD
8342
8350
  viteXmluiPlugin({}),
8343
8351
  ...overrides.plugins || []
8344
8352
  ],
8353
+ customLogger: logger,
8345
8354
  base: withRelativeRoot ? "" : void 0,
8346
8355
  define: overrides.define,
8347
8356
  resolve: {
@@ -8719,7 +8728,7 @@ function getStringArg(arg, defaultValue) {
8719
8728
  if (arg === void 0) return defaultValue;
8720
8729
  return dedupeArg(arg);
8721
8730
  }
8722
- const argv = yargs(hideBin(process.argv)).command("build", "Build the project", (yargs$1) => {
8731
+ yargs(hideBin(process.argv)).command("build", "Build the project", (yargs$1) => {
8723
8732
  return yargs$1.option("flatDist", {
8724
8733
  type: "boolean",
8725
8734
  description: "Create flat distribution"
@@ -8739,6 +8748,15 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8739
8748
  type: "boolean",
8740
8749
  description: "Use relative root"
8741
8750
  });
8751
+ }, (argv) => {
8752
+ const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
8753
+ build$1({
8754
+ buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : void 0),
8755
+ withMock: getBoolArg(withMock, prod ? false : void 0),
8756
+ withHostingMetaFiles: getBoolArg(withHostingMetaFiles, prod ? false : void 0),
8757
+ withRelativeRoot: getBoolArg(withRelativeRoot, prod ? true : void 0),
8758
+ flatDist: getBoolArg(flatDist, prod ? true : void 0)
8759
+ });
8742
8760
  }).command("build-lib", "Build library", (yargs$1) => {
8743
8761
  return yargs$1.option("watch", {
8744
8762
  type: "boolean",
@@ -8747,6 +8765,12 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8747
8765
  type: "string",
8748
8766
  description: "Build mode"
8749
8767
  });
8768
+ }, (argv) => {
8769
+ const { watch, mode } = argv;
8770
+ buildLib({
8771
+ watchMode: getBoolArg(watch, false),
8772
+ mode: getStringArg(mode, "")
8773
+ });
8750
8774
  }).command("start", "Start development server", (yargs$1) => {
8751
8775
  return yargs$1.option("port", {
8752
8776
  type: "number",
@@ -8758,11 +8782,21 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8758
8782
  type: "string",
8759
8783
  description: "Proxy target"
8760
8784
  });
8785
+ }, (argv) => {
8786
+ const { port, withMock, proxy } = argv;
8787
+ start({
8788
+ port,
8789
+ withMock: getBoolArg(withMock),
8790
+ proxy
8791
+ });
8761
8792
  }).command("preview", "Preview build", (yargs$1) => {
8762
8793
  return yargs$1.option("proxy", {
8763
8794
  type: "string",
8764
8795
  description: "Proxy target"
8765
8796
  });
8797
+ }, (argv) => {
8798
+ const { proxy } = argv;
8799
+ preview$1({ proxy });
8766
8800
  }).command("zip-dist", "Zip distribution", (yargs$1) => {
8767
8801
  return yargs$1.option("target", {
8768
8802
  type: "string",
@@ -8771,55 +8805,13 @@ const argv = yargs(hideBin(process.argv)).command("build", "Build the project",
8771
8805
  type: "string",
8772
8806
  description: "Source directory"
8773
8807
  });
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
- }
8808
+ }, (argv) => {
8809
+ const { target, source } = argv;
8810
+ zipDist({
8811
+ target,
8812
+ source
8813
+ });
8814
+ }).strict().demandCommand(1, "You need to provide a command").help().parse();
8823
8815
 
8824
8816
  //#endregion
8825
8817
  export { };