@shaper.org/vite-react-plugin 1.0.3 → 1.0.5

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 (3) hide show
  1. package/dist/index.cjs +172 -171
  2. package/dist/index.mjs +115 -114
  3. package/package.json +5 -4
package/dist/index.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { readFile } from "node:fs/promises";
3
- import { join } from "node:path";
4
3
  import * as PathUtil from "path";
5
4
  import { isAbsolute, posix, resolve, win32 } from "path";
5
+ import { dirname, join } from "node:path";
6
+ import { fileURLToPath } from "url";
6
7
 
7
8
  //#region rolldown:runtime
8
9
  var __create = Object.create;
@@ -2151,7 +2152,7 @@ error: ${text}`);
2151
2152
  //#endregion
2152
2153
  //#region src/react-route-plugin.ts
2153
2154
  var import_main = require_main();
2154
- const mainContentPath = join(__dirname, "../src/main.ts");
2155
+ const mainContentPath = join(dirname(fileURLToPath(import.meta.url)), "../templates/main.ts");
2155
2156
  const appendTo = "src/routes.tsx";
2156
2157
  const reactRoutesPlugin = () => {
2157
2158
  return {
@@ -47569,16 +47570,16 @@ var require_package$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@
47569
47570
  let pkg = null;
47570
47571
  const directories = [];
47571
47572
  let isPackage = true;
47572
- let dirname = _path$11().dirname(filepath);
47573
- while (!pkg && _path$11().basename(dirname) !== "node_modules") {
47574
- directories.push(dirname);
47575
- pkg = yield* readConfigPackage(_path$11().join(dirname, PACKAGE_FILENAME));
47576
- const nextLoc = _path$11().dirname(dirname);
47577
- if (dirname === nextLoc) {
47573
+ let dirname$1 = _path$11().dirname(filepath);
47574
+ while (!pkg && _path$11().basename(dirname$1) !== "node_modules") {
47575
+ directories.push(dirname$1);
47576
+ pkg = yield* readConfigPackage(_path$11().join(dirname$1, PACKAGE_FILENAME));
47577
+ const nextLoc = _path$11().dirname(dirname$1);
47578
+ if (dirname$1 === nextLoc) {
47578
47579
  isPackage = false;
47579
47580
  break;
47580
47581
  }
47581
- dirname = nextLoc;
47582
+ dirname$1 = nextLoc;
47582
47583
  }
47583
47584
  return {
47584
47585
  filepath,
@@ -78778,37 +78779,37 @@ var require_config_descriptors = /* @__PURE__ */ __commonJS({ "../../node_module
78778
78779
  function* handlerOf(value$1) {
78779
78780
  return value$1;
78780
78781
  }
78781
- function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
78782
- if (typeof options.browserslistConfigFile === "string") options.browserslistConfigFile = (0, _resolveTargets$1.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
78782
+ function optionsWithResolvedBrowserslistConfigFile(options, dirname$1) {
78783
+ if (typeof options.browserslistConfigFile === "string") options.browserslistConfigFile = (0, _resolveTargets$1.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname$1);
78783
78784
  return options;
78784
78785
  }
78785
- function createCachedDescriptors(dirname, options, alias$1) {
78786
+ function createCachedDescriptors(dirname$1, options, alias$1) {
78786
78787
  const { plugins, presets, passPerPreset } = options;
78787
78788
  return {
78788
- options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
78789
- plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias$1) : () => handlerOf([]),
78790
- presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias$1)(!!passPerPreset) : () => handlerOf([])
78789
+ options: optionsWithResolvedBrowserslistConfigFile(options, dirname$1),
78790
+ plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname$1)(alias$1) : () => handlerOf([]),
78791
+ presets: presets ? () => createCachedPresetDescriptors(presets, dirname$1)(alias$1)(!!passPerPreset) : () => handlerOf([])
78791
78792
  };
78792
78793
  }
78793
- function createUncachedDescriptors(dirname, options, alias$1) {
78794
+ function createUncachedDescriptors(dirname$1, options, alias$1) {
78794
78795
  return {
78795
- options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
78796
- plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias$1)),
78797
- presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias$1, !!options.passPerPreset))
78796
+ options: optionsWithResolvedBrowserslistConfigFile(options, dirname$1),
78797
+ plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname$1, alias$1)),
78798
+ presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname$1, alias$1, !!options.passPerPreset))
78798
78799
  };
78799
78800
  }
78800
78801
  const PRESET_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
78801
78802
  const createCachedPresetDescriptors = (0, _caching$3.makeWeakCacheSync)((items, cache$4) => {
78802
- const dirname = cache$4.using((dir) => dir);
78803
+ const dirname$1 = cache$4.using((dir) => dir);
78803
78804
  return (0, _caching$3.makeStrongCacheSync)((alias$1) => (0, _caching$3.makeStrongCache)(function* (passPerPreset) {
78804
- return (yield* createPresetDescriptors(items, dirname, alias$1, passPerPreset)).map((desc) => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
78805
+ return (yield* createPresetDescriptors(items, dirname$1, alias$1, passPerPreset)).map((desc) => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
78805
78806
  }));
78806
78807
  });
78807
78808
  const PLUGIN_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
78808
78809
  const createCachedPluginDescriptors = (0, _caching$3.makeWeakCacheSync)((items, cache$4) => {
78809
- const dirname = cache$4.using((dir) => dir);
78810
+ const dirname$1 = cache$4.using((dir) => dir);
78810
78811
  return (0, _caching$3.makeStrongCache)(function* (alias$1) {
78811
- return (yield* createPluginDescriptors(items, dirname, alias$1)).map((desc) => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
78812
+ return (yield* createPluginDescriptors(items, dirname$1, alias$1)).map((desc) => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
78812
78813
  });
78813
78814
  });
78814
78815
  const DEFAULT_OPTIONS = {};
@@ -78832,14 +78833,14 @@ var require_config_descriptors = /* @__PURE__ */ __commonJS({ "../../node_module
78832
78833
  }
78833
78834
  return desc;
78834
78835
  }
78835
- function* createPresetDescriptors(items, dirname, alias$1, passPerPreset) {
78836
- return yield* createDescriptors("preset", items, dirname, alias$1, passPerPreset);
78836
+ function* createPresetDescriptors(items, dirname$1, alias$1, passPerPreset) {
78837
+ return yield* createDescriptors("preset", items, dirname$1, alias$1, passPerPreset);
78837
78838
  }
78838
- function* createPluginDescriptors(items, dirname, alias$1) {
78839
- return yield* createDescriptors("plugin", items, dirname, alias$1);
78839
+ function* createPluginDescriptors(items, dirname$1, alias$1) {
78840
+ return yield* createDescriptors("plugin", items, dirname$1, alias$1);
78840
78841
  }
78841
- function* createDescriptors(type, items, dirname, alias$1, ownPass) {
78842
- const descriptors = yield* _gensync$8().all(items.map((item, index$2) => createDescriptor(item, dirname, {
78842
+ function* createDescriptors(type, items, dirname$1, alias$1, ownPass) {
78843
+ const descriptors = yield* _gensync$8().all(items.map((item, index$2) => createDescriptor(item, dirname$1, {
78843
78844
  type,
78844
78845
  alias: `${alias$1}$${index$2}`,
78845
78846
  ownPass: !!ownPass
@@ -78847,7 +78848,7 @@ var require_config_descriptors = /* @__PURE__ */ __commonJS({ "../../node_module
78847
78848
  assertNoDuplicates(descriptors);
78848
78849
  return descriptors;
78849
78850
  }
78850
- function* createDescriptor(pair, dirname, { type, alias: alias$1, ownPass }) {
78851
+ function* createDescriptor(pair, dirname$1, { type, alias: alias$1, ownPass }) {
78851
78852
  const desc = (0, _item$3.getItemDescriptor)(pair);
78852
78853
  if (desc) return desc;
78853
78854
  let name;
@@ -78861,7 +78862,7 @@ var require_config_descriptors = /* @__PURE__ */ __commonJS({ "../../node_module
78861
78862
  if (typeof type !== "string") throw new Error("To resolve a string-based item, the type of item must be given");
78862
78863
  const resolver = type === "plugin" ? _index$7.loadPlugin : _index$7.loadPreset;
78863
78864
  const request = value$1;
78864
- ({filepath, value: value$1} = yield* resolver(value$1, dirname));
78865
+ ({filepath, value: value$1} = yield* resolver(value$1, dirname$1));
78865
78866
  file$2 = {
78866
78867
  request,
78867
78868
  resolved: filepath
@@ -78877,7 +78878,7 @@ var require_config_descriptors = /* @__PURE__ */ __commonJS({ "../../node_module
78877
78878
  alias: filepath || alias$1,
78878
78879
  value: value$1,
78879
78880
  options,
78880
- dirname,
78881
+ dirname: dirname$1,
78881
78882
  ownPass,
78882
78883
  file: file$2
78883
78884
  };
@@ -78930,8 +78931,8 @@ var require_item = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
78930
78931
  function createItemFromDescriptor(desc) {
78931
78932
  return new ConfigItem(desc);
78932
78933
  }
78933
- function* createConfigItem$1(value$1, { dirname = ".", type } = {}) {
78934
- return createItemFromDescriptor(yield* (0, _configDescriptors$1.createDescriptor)(value$1, _path$9().resolve(dirname), {
78934
+ function* createConfigItem$1(value$1, { dirname: dirname$1 = ".", type } = {}) {
78935
+ return createItemFromDescriptor(yield* (0, _configDescriptors$1.createDescriptor)(value$1, _path$9().resolve(dirname$1), {
78935
78936
  type,
78936
78937
  alias: "programmatic item"
78937
78938
  }));
@@ -79410,8 +79411,8 @@ var require_pattern_to_regex = /* @__PURE__ */ __commonJS({ "../../node_modules/
79410
79411
  function escapeRegExp(string) {
79411
79412
  return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
79412
79413
  }
79413
- function pathToPattern(pattern, dirname) {
79414
- const parts = _path$8().resolve(dirname, pattern).split(_path$8().sep);
79414
+ function pathToPattern(pattern, dirname$1) {
79415
+ const parts = _path$8().resolve(dirname$1, pattern).split(_path$8().sep);
79415
79416
  return new RegExp(["^", ...parts.map((part, i$2) => {
79416
79417
  const last$1 = i$2 === parts.length - 1;
79417
79418
  if (part === "**") return last$1 ? starStarPatLast : starStarPat;
@@ -79689,59 +79690,59 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
79689
79690
  if (!baseLogger) return () => {};
79690
79691
  return baseLogger.configure(context$2.showConfig, _printer.ChainFormatter.Config, { filepath });
79691
79692
  }
79692
- function buildRootDescriptors({ dirname, options }, alias$1, descriptors) {
79693
- return descriptors(dirname, options, alias$1);
79693
+ function buildRootDescriptors({ dirname: dirname$1, options }, alias$1, descriptors) {
79694
+ return descriptors(dirname$1, options, alias$1);
79694
79695
  }
79695
79696
  function buildProgrammaticLogger(_$1, context$2, baseLogger) {
79696
79697
  var _context$caller;
79697
79698
  if (!baseLogger) return () => {};
79698
79699
  return baseLogger.configure(context$2.showConfig, _printer.ChainFormatter.Programmatic, { callerName: (_context$caller = context$2.caller) == null ? void 0 : _context$caller.name });
79699
79700
  }
79700
- function buildEnvDescriptors({ dirname, options }, alias$1, descriptors, envName) {
79701
+ function buildEnvDescriptors({ dirname: dirname$1, options }, alias$1, descriptors, envName) {
79701
79702
  var _options$env;
79702
79703
  const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
79703
- return opts ? descriptors(dirname, opts, `${alias$1}.env["${envName}"]`) : null;
79704
+ return opts ? descriptors(dirname$1, opts, `${alias$1}.env["${envName}"]`) : null;
79704
79705
  }
79705
- function buildOverrideDescriptors({ dirname, options }, alias$1, descriptors, index$2) {
79706
+ function buildOverrideDescriptors({ dirname: dirname$1, options }, alias$1, descriptors, index$2) {
79706
79707
  var _options$overrides;
79707
79708
  const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index$2];
79708
79709
  if (!opts) throw new Error("Assertion failure - missing override");
79709
- return descriptors(dirname, opts, `${alias$1}.overrides[${index$2}]`);
79710
+ return descriptors(dirname$1, opts, `${alias$1}.overrides[${index$2}]`);
79710
79711
  }
79711
- function buildOverrideEnvDescriptors({ dirname, options }, alias$1, descriptors, index$2, envName) {
79712
+ function buildOverrideEnvDescriptors({ dirname: dirname$1, options }, alias$1, descriptors, index$2, envName) {
79712
79713
  var _options$overrides2, _override$env;
79713
79714
  const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index$2];
79714
79715
  if (!override) throw new Error("Assertion failure - missing override");
79715
79716
  const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
79716
- return opts ? descriptors(dirname, opts, `${alias$1}.overrides[${index$2}].env["${envName}"]`) : null;
79717
+ return opts ? descriptors(dirname$1, opts, `${alias$1}.overrides[${index$2}].env["${envName}"]`) : null;
79717
79718
  }
79718
79719
  function makeChainWalker({ root: root$1, env: env$3, overrides, overridesEnv, createLogger }) {
79719
79720
  return function* chainWalker(input, context$2, files = /* @__PURE__ */ new Set(), baseLogger) {
79720
- const { dirname } = input;
79721
+ const { dirname: dirname$1 } = input;
79721
79722
  const flattenedConfigs = [];
79722
79723
  const rootOpts = root$1(input);
79723
- if (configIsApplicable(rootOpts, dirname, context$2, input.filepath)) {
79724
+ if (configIsApplicable(rootOpts, dirname$1, context$2, input.filepath)) {
79724
79725
  flattenedConfigs.push({
79725
79726
  config: rootOpts,
79726
79727
  envName: void 0,
79727
79728
  index: void 0
79728
79729
  });
79729
79730
  const envOpts = env$3(input, context$2.envName);
79730
- if (envOpts && configIsApplicable(envOpts, dirname, context$2, input.filepath)) flattenedConfigs.push({
79731
+ if (envOpts && configIsApplicable(envOpts, dirname$1, context$2, input.filepath)) flattenedConfigs.push({
79731
79732
  config: envOpts,
79732
79733
  envName: context$2.envName,
79733
79734
  index: void 0
79734
79735
  });
79735
79736
  (rootOpts.options.overrides || []).forEach((_$1, index$2) => {
79736
79737
  const overrideOps = overrides(input, index$2);
79737
- if (configIsApplicable(overrideOps, dirname, context$2, input.filepath)) {
79738
+ if (configIsApplicable(overrideOps, dirname$1, context$2, input.filepath)) {
79738
79739
  flattenedConfigs.push({
79739
79740
  config: overrideOps,
79740
79741
  index: index$2,
79741
79742
  envName: void 0
79742
79743
  });
79743
79744
  const overrideEnvOpts = overridesEnv(input, index$2, context$2.envName);
79744
- if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context$2, input.filepath)) flattenedConfigs.push({
79745
+ if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname$1, context$2, input.filepath)) flattenedConfigs.push({
79745
79746
  config: overrideEnvOpts,
79746
79747
  index: index$2,
79747
79748
  envName: context$2.envName
@@ -79749,20 +79750,20 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
79749
79750
  }
79750
79751
  });
79751
79752
  }
79752
- if (flattenedConfigs.some(({ config: { options: { ignore, only } } }) => shouldIgnore(context$2, ignore, only, dirname))) return null;
79753
+ if (flattenedConfigs.some(({ config: { options: { ignore, only } } }) => shouldIgnore(context$2, ignore, only, dirname$1))) return null;
79753
79754
  const chain$1 = emptyChain();
79754
79755
  const logger = createLogger(input, context$2, baseLogger);
79755
79756
  for (const { config, index: index$2, envName } of flattenedConfigs) {
79756
- if (!(yield* mergeExtendsChain(chain$1, config.options, dirname, context$2, files, baseLogger))) return null;
79757
+ if (!(yield* mergeExtendsChain(chain$1, config.options, dirname$1, context$2, files, baseLogger))) return null;
79757
79758
  logger(config, index$2, envName);
79758
79759
  yield* mergeChainOpts(chain$1, config);
79759
79760
  }
79760
79761
  return chain$1;
79761
79762
  };
79762
79763
  }
79763
- function* mergeExtendsChain(chain$1, opts, dirname, context$2, files, baseLogger) {
79764
+ function* mergeExtendsChain(chain$1, opts, dirname$1, context$2, files, baseLogger) {
79764
79765
  if (opts.extends === void 0) return true;
79765
- const file$2 = yield* (0, _index$6.loadConfig)(opts.extends, dirname, context$2.envName, context$2.caller);
79766
+ const file$2 = yield* (0, _index$6.loadConfig)(opts.extends, dirname$1, context$2.envName, context$2.caller);
79766
79767
  if (files.has(file$2)) throw new Error(`Configuration cycle detected loading ${file$2.filepath}.\nFile already loaded following the config chain:\n` + Array.from(files, (file$3) => ` - ${file$3.filepath}`).join("\n"));
79767
79768
  files.add(file$2);
79768
79769
  const fileChain = yield* loadFileChain(validateExtendFile(file$2), context$2, files, baseLogger);
@@ -79833,44 +79834,44 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
79833
79834
  return acc;
79834
79835
  }, []);
79835
79836
  }
79836
- function configIsApplicable({ options }, dirname, context$2, configName) {
79837
- return (options.test === void 0 || configFieldIsApplicable(context$2, options.test, dirname, configName)) && (options.include === void 0 || configFieldIsApplicable(context$2, options.include, dirname, configName)) && (options.exclude === void 0 || !configFieldIsApplicable(context$2, options.exclude, dirname, configName));
79837
+ function configIsApplicable({ options }, dirname$1, context$2, configName) {
79838
+ return (options.test === void 0 || configFieldIsApplicable(context$2, options.test, dirname$1, configName)) && (options.include === void 0 || configFieldIsApplicable(context$2, options.include, dirname$1, configName)) && (options.exclude === void 0 || !configFieldIsApplicable(context$2, options.exclude, dirname$1, configName));
79838
79839
  }
79839
- function configFieldIsApplicable(context$2, test, dirname, configName) {
79840
- return matchesPatterns(context$2, Array.isArray(test) ? test : [test], dirname, configName);
79840
+ function configFieldIsApplicable(context$2, test, dirname$1, configName) {
79841
+ return matchesPatterns(context$2, Array.isArray(test) ? test : [test], dirname$1, configName);
79841
79842
  }
79842
79843
  function ignoreListReplacer(_key, value$1) {
79843
79844
  if (value$1 instanceof RegExp) return String(value$1);
79844
79845
  return value$1;
79845
79846
  }
79846
- function shouldIgnore(context$2, ignore, only, dirname) {
79847
- if (ignore && matchesPatterns(context$2, ignore, dirname)) {
79847
+ function shouldIgnore(context$2, ignore, only, dirname$1) {
79848
+ if (ignore && matchesPatterns(context$2, ignore, dirname$1)) {
79848
79849
  var _context$filename;
79849
- const message = `No config is applied to "${(_context$filename = context$2.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
79850
+ const message = `No config is applied to "${(_context$filename = context$2.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname$1}"`;
79850
79851
  debug$4(message);
79851
79852
  if (context$2.showConfig) console.log(message);
79852
79853
  return true;
79853
79854
  }
79854
- if (only && !matchesPatterns(context$2, only, dirname)) {
79855
+ if (only && !matchesPatterns(context$2, only, dirname$1)) {
79855
79856
  var _context$filename2;
79856
- const message = `No config is applied to "${(_context$filename2 = context$2.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
79857
+ const message = `No config is applied to "${(_context$filename2 = context$2.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname$1}"`;
79857
79858
  debug$4(message);
79858
79859
  if (context$2.showConfig) console.log(message);
79859
79860
  return true;
79860
79861
  }
79861
79862
  return false;
79862
79863
  }
79863
- function matchesPatterns(context$2, patterns, dirname, configName) {
79864
- return patterns.some((pattern) => matchPattern(pattern, dirname, context$2.filename, context$2, configName));
79864
+ function matchesPatterns(context$2, patterns, dirname$1, configName) {
79865
+ return patterns.some((pattern) => matchPattern(pattern, dirname$1, context$2.filename, context$2, configName));
79865
79866
  }
79866
- function matchPattern(pattern, dirname, pathToTest, context$2, configName) {
79867
+ function matchPattern(pattern, dirname$1, pathToTest, context$2, configName) {
79867
79868
  if (typeof pattern === "function") return !!(0, _rewriteStackTrace$6.endHiddenCallStack)(pattern)(pathToTest, {
79868
- dirname,
79869
+ dirname: dirname$1,
79869
79870
  envName: context$2.envName,
79870
79871
  caller: context$2.caller
79871
79872
  });
79872
79873
  if (typeof pathToTest !== "string") throw new _configError$3.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
79873
- if (typeof pattern === "string") pattern = (0, _patternToRegex$1.default)(pattern, dirname);
79874
+ if (typeof pattern === "string") pattern = (0, _patternToRegex$1.default)(pattern, dirname$1);
79874
79875
  return pattern.test(pathToTest);
79875
79876
  }
79876
79877
  }) });
@@ -80203,7 +80204,7 @@ var require_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
80203
80204
  }
80204
80205
  };
80205
80206
  }
80206
- const makeDescriptorLoader = (apiFactory) => (0, _caching$1.makeWeakCache)(function* ({ value: value$1, options, dirname, alias: alias$1 }, cache$4) {
80207
+ const makeDescriptorLoader = (apiFactory) => (0, _caching$1.makeWeakCache)(function* ({ value: value$1, options, dirname: dirname$1, alias: alias$1 }, cache$4) {
80207
80208
  if (options === false) throw new Error("Assertion failure");
80208
80209
  options = options || {};
80209
80210
  const externalDependencies = [];
@@ -80212,7 +80213,7 @@ var require_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
80212
80213
  const factory = (0, _async$4.maybeAsync)(value$1, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
80213
80214
  const api = Object.assign({}, context, apiFactory(cache$4, externalDependencies));
80214
80215
  try {
80215
- item = yield* factory(api, options, dirname);
80216
+ item = yield* factory(api, options, dirname$1);
80216
80217
  } catch (e$1) {
80217
80218
  if (alias$1) e$1.message += ` (While processing: ${JSON.stringify(alias$1)})`;
80218
80219
  throw e$1;
@@ -80234,14 +80235,14 @@ var require_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
80234
80235
  return {
80235
80236
  value: item,
80236
80237
  options,
80237
- dirname,
80238
+ dirname: dirname$1,
80238
80239
  alias: alias$1,
80239
80240
  externalDependencies: (0, _deepArray$1.finalize)(externalDependencies)
80240
80241
  };
80241
80242
  });
80242
80243
  const pluginDescriptorLoader = makeDescriptorLoader(_configApi$1.makePluginAPI);
80243
80244
  const presetDescriptorLoader = makeDescriptorLoader(_configApi$1.makePresetAPI);
80244
- const instantiatePlugin = (0, _caching$1.makeWeakCache)(function* ({ value: value$1, options, dirname, alias: alias$1, externalDependencies }, cache$4) {
80245
+ const instantiatePlugin = (0, _caching$1.makeWeakCache)(function* ({ value: value$1, options, dirname: dirname$1, alias: alias$1, externalDependencies }, cache$4) {
80245
80246
  const pluginObj = (0, _plugins$1.validatePluginObject)(value$1);
80246
80247
  const plugin = Object.assign({}, pluginObj);
80247
80248
  if (plugin.visitor) plugin.visitor = _traverse$5().default.explode(Object.assign({}, plugin.visitor));
@@ -80251,7 +80252,7 @@ var require_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
80251
80252
  alias: `${alias$1}$inherits`,
80252
80253
  value: plugin.inherits,
80253
80254
  options,
80254
- dirname
80255
+ dirname: dirname$1
80255
80256
  };
80256
80257
  const inherits$2 = yield* (0, _async$4.forwardAsync)(loadPluginDescriptor, (run$1) => {
80257
80258
  return cache$4.invalidate((data) => run$1(inheritsDescriptor, data));
@@ -80293,11 +80294,11 @@ var require_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel
80293
80294
  (_options$overrides = options.overrides) == null || _options$overrides.forEach((overrideOptions) => validateIfOptionNeedsFilename(overrideOptions, descriptor));
80294
80295
  }
80295
80296
  };
80296
- const instantiatePreset = (0, _caching$1.makeWeakCacheSync)(({ value: value$1, dirname, alias: alias$1, externalDependencies }) => {
80297
+ const instantiatePreset = (0, _caching$1.makeWeakCacheSync)(({ value: value$1, dirname: dirname$1, alias: alias$1, externalDependencies }) => {
80297
80298
  return {
80298
80299
  options: (0, _options.validate)("preset", value$1),
80299
80300
  alias: alias$1,
80300
- dirname,
80301
+ dirname: dirname$1,
80301
80302
  externalDependencies
80302
80303
  };
80303
80304
  });
@@ -81642,14 +81643,14 @@ var require_lib$12 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@bab
81642
81643
  addExternalDependency: () => () => {}
81643
81644
  });
81644
81645
  function declare(builder) {
81645
- return (api, options, dirname) => {
81646
+ return (api, options, dirname$1) => {
81646
81647
  let clonedApi;
81647
81648
  for (const name of Object.keys(apiPolyfills)) {
81648
81649
  if (api[name]) continue;
81649
81650
  clonedApi ??= copyApiObject(api);
81650
81651
  clonedApi[name] = apiPolyfills[name](clonedApi);
81651
81652
  }
81652
- return builder(clonedApi != null ? clonedApi : api, options || {}, dirname);
81653
+ return builder(clonedApi != null ? clonedApi : api, options || {}, dirname$1);
81653
81654
  };
81654
81655
  }
81655
81656
  exports.declarePreset = declare;
@@ -86071,19 +86072,19 @@ var require_configuration = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
86071
86072
  };
86072
86073
  });
86073
86074
  function findConfigUpwards(rootDir) {
86074
- let dirname = rootDir;
86075
+ let dirname$1 = rootDir;
86075
86076
  for (;;) {
86076
- for (const filename of ROOT_CONFIG_FILENAMES) if (_fs$2().existsSync(_path$2().join(dirname, filename))) return dirname;
86077
- const nextDir = _path$2().dirname(dirname);
86078
- if (dirname === nextDir) break;
86079
- dirname = nextDir;
86077
+ for (const filename of ROOT_CONFIG_FILENAMES) if (_fs$2().existsSync(_path$2().join(dirname$1, filename))) return dirname$1;
86078
+ const nextDir = _path$2().dirname(dirname$1);
86079
+ if (dirname$1 === nextDir) break;
86080
+ dirname$1 = nextDir;
86080
86081
  }
86081
86082
  return null;
86082
86083
  }
86083
86084
  function* findRelativeConfig(packageData, envName, caller) {
86084
86085
  let config = null;
86085
86086
  let ignore = null;
86086
- const dirname = _path$2().dirname(packageData.filepath);
86087
+ const dirname$1 = _path$2().dirname(packageData.filepath);
86087
86088
  for (const loc of packageData.directories) {
86088
86089
  if (!config) {
86089
86090
  var _packageData$pkg;
@@ -86091,7 +86092,7 @@ var require_configuration = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
86091
86092
  }
86092
86093
  if (!ignore) {
86093
86094
  ignore = yield* readIgnoreConfig(_path$2().join(loc, BABELIGNORE_FILENAME));
86094
- if (ignore) debug$1("Found ignore %o from %o.", ignore.filepath, dirname);
86095
+ if (ignore) debug$1("Found ignore %o from %o.", ignore.filepath, dirname$1);
86095
86096
  }
86096
86097
  }
86097
86098
  return {
@@ -86099,28 +86100,28 @@ var require_configuration = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
86099
86100
  ignore
86100
86101
  };
86101
86102
  }
86102
- function findRootConfig(dirname, envName, caller) {
86103
- return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
86103
+ function findRootConfig(dirname$1, envName, caller) {
86104
+ return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname$1, envName, caller);
86104
86105
  }
86105
- function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
86106
- const config = (yield* _gensync$3().all(names.map((filename) => readConfig(_path$2().join(dirname, filename), envName, caller)))).reduce((previousConfig$1, config$1) => {
86107
- if (config$1 && previousConfig$1) throw new _configError.default(`Multiple configuration files found. Please remove one:\n - ${_path$2().basename(previousConfig$1.filepath)}\n - ${config$1.filepath}\nfrom ${dirname}`);
86106
+ function* loadOneConfig(names, dirname$1, envName, caller, previousConfig = null) {
86107
+ const config = (yield* _gensync$3().all(names.map((filename) => readConfig(_path$2().join(dirname$1, filename), envName, caller)))).reduce((previousConfig$1, config$1) => {
86108
+ if (config$1 && previousConfig$1) throw new _configError.default(`Multiple configuration files found. Please remove one:\n - ${_path$2().basename(previousConfig$1.filepath)}\n - ${config$1.filepath}\nfrom ${dirname$1}`);
86108
86109
  return config$1 || previousConfig$1;
86109
86110
  }, previousConfig);
86110
- if (config) debug$1("Found configuration %o from %o.", config.filepath, dirname);
86111
+ if (config) debug$1("Found configuration %o from %o.", config.filepath, dirname$1);
86111
86112
  return config;
86112
86113
  }
86113
- function* loadConfig(name, dirname, envName, caller) {
86114
+ function* loadConfig(name, dirname$1, envName, caller) {
86114
86115
  const filepath = (((v$4, w$2) => (v$4 = v$4.split("."), w$2 = w$2.split("."), +v$4[0] > +w$2[0] || v$4[0] == w$2[0] && +v$4[1] >= +w$2[1]))(process.versions.node, "8.9") ? __require.resolve : (r$1, { paths: [b$2] }, M = __require("module")) => {
86115
86116
  let f$1 = M._findPath(r$1, M._nodeModulePaths(b$2).concat(b$2));
86116
86117
  if (f$1) return f$1;
86117
86118
  f$1 = /* @__PURE__ */ new Error(`Cannot resolve module '${r$1}'`);
86118
86119
  f$1.code = "MODULE_NOT_FOUND";
86119
86120
  throw f$1;
86120
- })(name, { paths: [dirname] });
86121
+ })(name, { paths: [dirname$1] });
86121
86122
  const conf = yield* readConfig(filepath, envName, caller);
86122
86123
  if (!conf) throw new _configError.default(`Config file contains no configuration data`, filepath);
86123
- debug$1("Loaded config %o from %o.", name, dirname);
86124
+ debug$1("Loaded config %o from %o.", name, dirname$1);
86124
86125
  return conf;
86125
86126
  }
86126
86127
  function readConfig(filepath, envName, caller) {
@@ -86137,10 +86138,10 @@ var require_configuration = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
86137
86138
  default: return readConfigJSON5(filepath);
86138
86139
  }
86139
86140
  }
86140
- function* resolveShowConfigPath(dirname) {
86141
+ function* resolveShowConfigPath(dirname$1) {
86141
86142
  const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
86142
86143
  if (targetPath != null) {
86143
- const absolutePath = _path$2().resolve(dirname, targetPath);
86144
+ const absolutePath = _path$2().resolve(dirname$1, targetPath);
86144
86145
  if (!(yield* fs.stat(absolutePath)).isFile()) throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
86145
86146
  return absolutePath;
86146
86147
  }
@@ -87095,19 +87096,19 @@ var require_plugins = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@ba
87095
87096
  const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
87096
87097
  const resolvePlugin$1 = exports.resolvePlugin = resolveStandardizedName.bind(null, "plugin");
87097
87098
  const resolvePreset$1 = exports.resolvePreset = resolveStandardizedName.bind(null, "preset");
87098
- function* loadPlugin(name, dirname) {
87099
- const { filepath, loader } = resolvePlugin$1(name, dirname, yield* (0, _async.isAsync)());
87099
+ function* loadPlugin(name, dirname$1) {
87100
+ const { filepath, loader } = resolvePlugin$1(name, dirname$1, yield* (0, _async.isAsync)());
87100
87101
  const value$1 = yield* requireModule("plugin", loader, filepath);
87101
- debug("Loaded plugin %o from %o.", name, dirname);
87102
+ debug("Loaded plugin %o from %o.", name, dirname$1);
87102
87103
  return {
87103
87104
  filepath,
87104
87105
  value: value$1
87105
87106
  };
87106
87107
  }
87107
- function* loadPreset(name, dirname) {
87108
- const { filepath, loader } = resolvePreset$1(name, dirname, yield* (0, _async.isAsync)());
87108
+ function* loadPreset(name, dirname$1) {
87109
+ const { filepath, loader } = resolvePreset$1(name, dirname$1, yield* (0, _async.isAsync)());
87109
87110
  const value$1 = yield* requireModule("preset", loader, filepath);
87110
- debug("Loaded preset %o from %o.", name, dirname);
87111
+ debug("Loaded preset %o from %o.", name, dirname$1);
87111
87112
  return {
87112
87113
  filepath,
87113
87114
  value: value$1
@@ -87141,9 +87142,9 @@ to your top-level package.json.
87141
87142
  `;
87142
87143
  throw error;
87143
87144
  }
87144
- function tryRequireResolve(id, dirname) {
87145
+ function tryRequireResolve(id, dirname$1) {
87145
87146
  try {
87146
- if (dirname) return {
87147
+ if (dirname$1) return {
87147
87148
  error: null,
87148
87149
  value: (((v$4, w$2) => (v$4 = v$4.split("."), w$2 = w$2.split("."), +v$4[0] > +w$2[0] || v$4[0] == w$2[0] && +v$4[1] >= +w$2[1]))(process.versions.node, "8.9") ? __require.resolve : (r$1, { paths: [b$2] }, M = __require("module")) => {
87149
87150
  let f$1 = M._findPath(r$1, M._nodeModulePaths(b$2).concat(b$2));
@@ -87151,7 +87152,7 @@ to your top-level package.json.
87151
87152
  f$1 = /* @__PURE__ */ new Error(`Cannot resolve module '${r$1}'`);
87152
87153
  f$1.code = "MODULE_NOT_FOUND";
87153
87154
  throw f$1;
87154
- })(id, { paths: [dirname] })
87155
+ })(id, { paths: [dirname$1] })
87155
87156
  };
87156
87157
  else return {
87157
87158
  error: null,
@@ -87177,17 +87178,17 @@ to your top-level package.json.
87177
87178
  };
87178
87179
  }
87179
87180
  }
87180
- function resolveStandardizedNameForRequire(type, name, dirname) {
87181
+ function resolveStandardizedNameForRequire(type, name, dirname$1) {
87181
87182
  const it = resolveAlternativesHelper(type, name);
87182
87183
  let res = it.next();
87183
- while (!res.done) res = it.next(tryRequireResolve(res.value, dirname));
87184
+ while (!res.done) res = it.next(tryRequireResolve(res.value, dirname$1));
87184
87185
  return {
87185
87186
  loader: "require",
87186
87187
  filepath: res.value
87187
87188
  };
87188
87189
  }
87189
- function resolveStandardizedNameForImport(type, name, dirname) {
87190
- const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href;
87190
+ function resolveStandardizedNameForImport(type, name, dirname$1) {
87191
+ const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname$1, "./babel-virtual-resolve-base.js")).href;
87191
87192
  const it = resolveAlternativesHelper(type, name);
87192
87193
  let res = it.next();
87193
87194
  while (!res.done) res = it.next(tryImportMetaResolve(res.value, parentUrl));
@@ -87196,15 +87197,15 @@ to your top-level package.json.
87196
87197
  filepath: (0, _url().fileURLToPath)(res.value)
87197
87198
  };
87198
87199
  }
87199
- function resolveStandardizedName(type, name, dirname, allowAsync) {
87200
- if (!_moduleTypes.supportsESM || !allowAsync) return resolveStandardizedNameForRequire(type, name, dirname);
87200
+ function resolveStandardizedName(type, name, dirname$1, allowAsync) {
87201
+ if (!_moduleTypes.supportsESM || !allowAsync) return resolveStandardizedNameForRequire(type, name, dirname$1);
87201
87202
  try {
87202
- const resolved = resolveStandardizedNameForImport(type, name, dirname);
87203
- if (!(0, _fs().existsSync)(resolved.filepath)) throw Object.assign(/* @__PURE__ */ new Error(`Could not resolve "${name}" in file ${dirname}.`), { type: "MODULE_NOT_FOUND" });
87203
+ const resolved = resolveStandardizedNameForImport(type, name, dirname$1);
87204
+ if (!(0, _fs().existsSync)(resolved.filepath)) throw Object.assign(/* @__PURE__ */ new Error(`Could not resolve "${name}" in file ${dirname$1}.`), { type: "MODULE_NOT_FOUND" });
87204
87205
  return resolved;
87205
87206
  } catch (e$1) {
87206
87207
  try {
87207
- return resolveStandardizedNameForRequire(type, name, dirname);
87208
+ return resolveStandardizedNameForRequire(type, name, dirname$1);
87208
87209
  } catch (e2) {
87209
87210
  if (e$1.type === "MODULE_NOT_FOUND") throw e$1;
87210
87211
  if (e2.type === "MODULE_NOT_FOUND") throw e2;
@@ -87641,9 +87642,9 @@ var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@babel+
87641
87642
  var _transformAst = require_transform_ast();
87642
87643
  var _parse = require_parse();
87643
87644
  exports.version = "7.28.5";
87644
- const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath;
87645
+ const resolvePlugin = (name, dirname$1) => resolvers.resolvePlugin(name, dirname$1, false).filepath;
87645
87646
  exports.resolvePlugin = resolvePlugin;
87646
- const resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath;
87647
+ const resolvePreset = (name, dirname$1) => resolvers.resolvePreset(name, dirname$1, false).filepath;
87647
87648
  exports.resolvePreset = resolvePreset;
87648
87649
  exports.DEFAULT_EXTENSIONS = Object.freeze([
87649
87650
  ".js",
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@shaper.org/vite-react-plugin",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "files": [
8
- "dist"
8
+ "dist",
9
+ "template"
9
10
  ],
10
11
  "exports": {
11
12
  ".": "./dist/index.mjs",
@@ -15,7 +16,7 @@
15
16
  "node": "^20.19.0 || >=22.12.0"
16
17
  },
17
18
  "peerDependencies": {
18
- "@shaper.org/core": "1.0.0",
19
+ "@shaper.org/core": "1.0.1",
19
20
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
20
21
  "vue": "^3.2.25"
21
22
  },
@@ -27,7 +28,7 @@
27
28
  "@jridgewell/gen-mapping": "^0.3.13",
28
29
  "@jridgewell/trace-mapping": "^0.3.31",
29
30
  "@rollup/pluginutils": "^5.3.0",
30
- "@shaper.org/core": "1.0.0",
31
+ "@shaper.org/core": "1.0.1",
31
32
  "esbuild": "^0.27.0",
32
33
  "obug": "^2.0.0",
33
34
  "rollup": "^4.53.3",