powerlines 0.37.23 → 0.37.25

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 (105) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.js +1 -1
  3. package/dist/astro.cjs +4 -4
  4. package/dist/astro.js +3 -3
  5. package/dist/{chunk-D4L3REG4.js → chunk-4KHQJLOZ.js} +3 -3
  6. package/dist/{chunk-Z7KIQFLN.js → chunk-5EXQR5PS.js} +3 -3
  7. package/dist/{chunk-3XEOJ3TS.js → chunk-5UWYXYHN.js} +68 -15
  8. package/dist/{chunk-DWF4GVXQ.cjs → chunk-A44AVBOK.cjs} +4 -4
  9. package/dist/{chunk-C3TWAGFQ.cjs → chunk-A6EFHKFH.cjs} +5 -5
  10. package/dist/{chunk-UQ7LY7EU.js → chunk-CBUBY3RQ.js} +3 -3
  11. package/dist/chunk-EBWMUY6X.cjs +12 -0
  12. package/dist/chunk-EIJCWBLT.cjs +12 -0
  13. package/dist/{chunk-PQ6DDPXP.js → chunk-GBWZQNCT.js} +3 -3
  14. package/dist/{chunk-R7IUNKL4.cjs → chunk-GLFCJGOU.cjs} +68 -15
  15. package/dist/{chunk-APLBM72X.js → chunk-KUVGZOIR.js} +3 -3
  16. package/dist/{chunk-UZV6LCRL.cjs → chunk-VNXIVSZM.cjs} +4 -4
  17. package/dist/esbuild.cjs +6 -6
  18. package/dist/esbuild.js +3 -3
  19. package/dist/farm.cjs +3 -3
  20. package/dist/farm.js +2 -2
  21. package/dist/index.cjs +10 -10
  22. package/dist/index.js +2 -2
  23. package/dist/lib/{chunk-NE26SC53.js → chunk-2LZ2KCSP.js} +3 -3
  24. package/dist/lib/{chunk-NE26SC53.js.map → chunk-2LZ2KCSP.js.map} +1 -1
  25. package/dist/lib/{chunk-UKH6QWNB.js → chunk-4UBTIIJL.js} +4 -4
  26. package/dist/lib/{chunk-UKH6QWNB.js.map → chunk-4UBTIIJL.js.map} +1 -1
  27. package/dist/lib/{chunk-KAYP2ZET.js → chunk-5KPURJGU.js} +3 -3
  28. package/dist/lib/{chunk-KAYP2ZET.js.map → chunk-5KPURJGU.js.map} +1 -1
  29. package/dist/lib/{chunk-Y542GHNE.cjs → chunk-5NQEQLWX.cjs} +6 -6
  30. package/dist/lib/{chunk-Y542GHNE.cjs.map → chunk-5NQEQLWX.cjs.map} +1 -1
  31. package/dist/lib/{chunk-GAIS4GMK.js → chunk-67DD6S67.js} +69 -16
  32. package/dist/lib/chunk-67DD6S67.js.map +1 -0
  33. package/dist/lib/{chunk-K3NVHAWK.js → chunk-7S3JZ53C.js} +3 -3
  34. package/dist/lib/{chunk-K3NVHAWK.js.map → chunk-7S3JZ53C.js.map} +1 -1
  35. package/dist/lib/{chunk-EUG7HXQY.js → chunk-AENFA3JO.js} +4 -4
  36. package/dist/lib/{chunk-EUG7HXQY.js.map → chunk-AENFA3JO.js.map} +1 -1
  37. package/dist/lib/{chunk-5WSRLNW3.cjs → chunk-CTZ34LYF.cjs} +74 -21
  38. package/dist/lib/chunk-CTZ34LYF.cjs.map +1 -0
  39. package/dist/lib/{chunk-ZYQHFUU6.cjs → chunk-DFEKS6NC.cjs} +16 -16
  40. package/dist/lib/{chunk-ZYQHFUU6.cjs.map → chunk-DFEKS6NC.cjs.map} +1 -1
  41. package/dist/lib/{chunk-Y2IR6IBT.cjs → chunk-IBV5LQEW.cjs} +19 -19
  42. package/dist/lib/{chunk-Y2IR6IBT.cjs.map → chunk-IBV5LQEW.cjs.map} +1 -1
  43. package/dist/lib/{chunk-YYG2XJQN.cjs → chunk-J4TJDOSP.cjs} +4 -4
  44. package/dist/lib/chunk-J4TJDOSP.cjs.map +1 -0
  45. package/dist/lib/{chunk-EBBGE5FN.js → chunk-LGM65FVK.js} +4 -4
  46. package/dist/lib/chunk-LGM65FVK.js.map +1 -0
  47. package/dist/lib/{chunk-NP43P5WN.cjs → chunk-S3WD3XWS.cjs} +5 -5
  48. package/dist/lib/{chunk-NP43P5WN.cjs.map → chunk-S3WD3XWS.cjs.map} +1 -1
  49. package/dist/lib/{chunk-RI3JLIUH.cjs → chunk-XKEHVYDR.cjs} +7 -7
  50. package/dist/lib/{chunk-RI3JLIUH.cjs.map → chunk-XKEHVYDR.cjs.map} +1 -1
  51. package/dist/lib/contexts/api-context.cjs +7 -7
  52. package/dist/lib/contexts/api-context.js +6 -6
  53. package/dist/lib/contexts/context.cjs +5 -5
  54. package/dist/lib/contexts/context.js +4 -4
  55. package/dist/lib/contexts/environment-context.cjs +6 -6
  56. package/dist/lib/contexts/environment-context.js +5 -5
  57. package/dist/lib/contexts/index.cjs +9 -9
  58. package/dist/lib/contexts/index.js +6 -6
  59. package/dist/lib/fs/helpers.cjs +12 -12
  60. package/dist/lib/fs/helpers.d.cts +1 -1
  61. package/dist/lib/fs/helpers.d.ts +1 -1
  62. package/dist/lib/fs/helpers.js +1 -1
  63. package/dist/lib/fs/index.cjs +4 -4
  64. package/dist/lib/fs/index.js +3 -3
  65. package/dist/lib/fs/storage/file-system.cjs +3 -3
  66. package/dist/lib/fs/storage/file-system.js +2 -2
  67. package/dist/lib/fs/storage/index.cjs +3 -3
  68. package/dist/lib/fs/storage/index.js +2 -2
  69. package/dist/lib/fs/vfs.cjs +4 -4
  70. package/dist/lib/fs/vfs.js +3 -3
  71. package/dist/lib/index.cjs +12 -12
  72. package/dist/lib/index.js +7 -7
  73. package/dist/lib/unplugin/factory.cjs +8 -8
  74. package/dist/lib/unplugin/factory.js +7 -7
  75. package/dist/lib/unplugin/index.cjs +8 -8
  76. package/dist/lib/unplugin/index.js +7 -7
  77. package/dist/next.cjs +4 -4
  78. package/dist/next.js +3 -3
  79. package/dist/nuxt.cjs +7 -7
  80. package/dist/nuxt.js +5 -5
  81. package/dist/rolldown.cjs +6 -6
  82. package/dist/rolldown.js +3 -3
  83. package/dist/rollup.cjs +3 -3
  84. package/dist/rollup.js +2 -2
  85. package/dist/rspack.cjs +3 -3
  86. package/dist/rspack.js +2 -2
  87. package/dist/tsdown.cjs +4 -4
  88. package/dist/tsdown.js +3 -3
  89. package/dist/tsup.cjs +4 -4
  90. package/dist/tsup.js +3 -3
  91. package/dist/unloader.cjs +3 -3
  92. package/dist/unloader.js +2 -2
  93. package/dist/unplugin.cjs +8 -8
  94. package/dist/unplugin.js +4 -4
  95. package/dist/vite.cjs +6 -6
  96. package/dist/vite.js +3 -3
  97. package/dist/webpack.cjs +6 -6
  98. package/dist/webpack.js +3 -3
  99. package/package.json +8 -8
  100. package/dist/chunk-4QCZWJMW.cjs +0 -12
  101. package/dist/chunk-D56IP3ZO.cjs +0 -12
  102. package/dist/lib/chunk-5WSRLNW3.cjs.map +0 -1
  103. package/dist/lib/chunk-EBBGE5FN.js.map +0 -1
  104. package/dist/lib/chunk-GAIS4GMK.js.map +0 -1
  105. package/dist/lib/chunk-YYG2XJQN.cjs.map +0 -1
package/dist/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkR7IUNKL4_cjs = require('./chunk-R7IUNKL4.cjs');
3
+ var chunkGLFCJGOU_cjs = require('./chunk-GLFCJGOU.cjs');
4
4
  require('./chunk-B6DVCLP5.cjs');
5
5
  require('./chunk-V5WOGN7O.cjs');
6
6
  require('./chunk-Z6ARQDHR.cjs');
@@ -10,7 +10,7 @@ require('./chunk-PK6SKIKE.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "PowerlinesAPI", {
12
12
  enumerable: true,
13
- get: function () { return chunkR7IUNKL4_cjs.PowerlinesAPI; }
13
+ get: function () { return chunkGLFCJGOU_cjs.PowerlinesAPI; }
14
14
  });
15
15
  //# sourceMappingURL=api.cjs.map
16
16
  //# sourceMappingURL=api.cjs.map
package/dist/api.js CHANGED
@@ -1,4 +1,4 @@
1
- export { PowerlinesAPI } from './chunk-3XEOJ3TS.js';
1
+ export { PowerlinesAPI } from './chunk-5UWYXYHN.js';
2
2
  import './chunk-PQXP7XQK.js';
3
3
  import './chunk-NITQ5IYP.js';
4
4
  import './chunk-2MYPFASJ.js';
package/dist/astro.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkDWF4GVXQ_cjs = require('./chunk-DWF4GVXQ.cjs');
5
+ var chunkA44AVBOK_cjs = require('./chunk-A44AVBOK.cjs');
6
6
  require('./chunk-SE3RCXWI.cjs');
7
- require('./chunk-C3TWAGFQ.cjs');
8
- require('./chunk-R7IUNKL4.cjs');
7
+ require('./chunk-A6EFHKFH.cjs');
8
+ require('./chunk-GLFCJGOU.cjs');
9
9
  require('./chunk-B6DVCLP5.cjs');
10
10
  require('./chunk-V5WOGN7O.cjs');
11
11
  require('./chunk-Z6ARQDHR.cjs');
@@ -15,7 +15,7 @@ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
15
15
  var astro = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((config) => ({
16
16
  vite: {
17
17
  plugins: [
18
- chunkDWF4GVXQ_cjs.vite_default(config)
18
+ chunkA44AVBOK_cjs.vite_default(config)
19
19
  ]
20
20
  }
21
21
  }), "astro");
package/dist/astro.js CHANGED
@@ -1,7 +1,7 @@
1
- import { vite_default } from './chunk-UQ7LY7EU.js';
1
+ import { vite_default } from './chunk-CBUBY3RQ.js';
2
2
  import './chunk-BGBDDKML.js';
3
- import './chunk-Z7KIQFLN.js';
4
- import './chunk-3XEOJ3TS.js';
3
+ import './chunk-5EXQR5PS.js';
4
+ import './chunk-5UWYXYHN.js';
5
5
  import './chunk-PQXP7XQK.js';
6
6
  import './chunk-NITQ5IYP.js';
7
7
  import './chunk-2MYPFASJ.js';
@@ -1,5 +1,5 @@
1
1
  import { extractESBuildConfig } from './chunk-BGBDDKML.js';
2
- import { createUnpluginFactory } from './chunk-Z7KIQFLN.js';
2
+ import { createUnpluginFactory } from './chunk-5EXQR5PS.js';
3
3
  import { __name } from './chunk-7QVYU63E.js';
4
4
  import { isUndefined } from '@stryke/type-checks/is-undefined';
5
5
  import { createEsbuildPlugin } from 'unplugin';
@@ -29,5 +29,5 @@ var esbuild = createEsbuildPlugin(createUnpluginFactory("esbuild", (api, plugin)
29
29
  var esbuild_default = esbuild;
30
30
 
31
31
  export { esbuild, esbuild_default };
32
- //# sourceMappingURL=chunk-D4L3REG4.js.map
33
- //# sourceMappingURL=chunk-D4L3REG4.js.map
32
+ //# sourceMappingURL=chunk-4KHQJLOZ.js.map
33
+ //# sourceMappingURL=chunk-4KHQJLOZ.js.map
@@ -1,4 +1,4 @@
1
- import { createLog, PowerlinesAPI } from './chunk-3XEOJ3TS.js';
1
+ import { createLog, PowerlinesAPI } from './chunk-5UWYXYHN.js';
2
2
  import { __name } from './chunk-7QVYU63E.js';
3
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
4
4
  import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
@@ -134,5 +134,5 @@ function createUnpluginFactory(variant, decorate) {
134
134
  __name(createUnpluginFactory, "createUnpluginFactory");
135
135
 
136
136
  export { createUnpluginFactory, getString };
137
- //# sourceMappingURL=chunk-Z7KIQFLN.js.map
138
- //# sourceMappingURL=chunk-Z7KIQFLN.js.map
137
+ //# sourceMappingURL=chunk-5EXQR5PS.js.map
138
+ //# sourceMappingURL=chunk-5EXQR5PS.js.map
@@ -1232,7 +1232,7 @@ function isValidId(id, prefix = "powerlines") {
1232
1232
  }
1233
1233
  __name(isValidId, "isValidId");
1234
1234
  function normalizeId(id, prefix = "powerlines") {
1235
- return `${prefix.replace(/:$/, "")}:${toFilePath(id).replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), "").replace(/^\\0/, "").replace(findFileDotExtensionSafe(toFilePath(id)), "")}`;
1235
+ return replaceExtension(toFilePath(id)).replace(/^\\0/, "").replace(/^powerlines:/, "").replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), "");
1236
1236
  }
1237
1237
  __name(normalizeId, "normalizeId");
1238
1238
  function normalizePath(path, builtinsPath, prefix = "powerlines") {
@@ -1841,16 +1841,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
1841
1841
  const result2 = new _VirtualFileSystem(context, fs);
1842
1842
  if (fs._hasStorage() && fs.storage.length > 0) {
1843
1843
  await Promise.all(fs.storage.values().map(async (file) => {
1844
- await result2.write(file.path, file.code);
1844
+ if (file.path && file.code) {
1845
+ await result2.write(file.path, file.code);
1846
+ }
1845
1847
  }));
1846
1848
  }
1847
1849
  }
1848
1850
  const message = new $.Message();
1849
1851
  const result = new _VirtualFileSystem(context, message.initRoot(FileSystem));
1850
1852
  result.#log(LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
1851
- if (result.metadata) {
1852
- result.#log(LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.metadata).length} previously stored metadata records...`);
1853
- const entry = Object.entries(result.metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1853
+ if (result.#metadata && Object.keys(result.#metadata).length > 0) {
1854
+ result.#log(LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.#metadata).length} previously stored metadata records...`);
1855
+ const entry = Object.entries(result.#metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1854
1856
  if (meta.properties) {
1855
1857
  const typeDefinition = {
1856
1858
  file: path
@@ -1876,6 +1878,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
1876
1878
  }).filter(Boolean);
1877
1879
  result.#log(LogLevelLabel.DEBUG, `Loaded ${entry.length} entry type definitions from VFS metadata.`);
1878
1880
  context.entry = entry;
1881
+ } else {
1882
+ result.#log(LogLevelLabel.DEBUG, "No previously stored metadata records were found on the local system.");
1879
1883
  }
1880
1884
  return result;
1881
1885
  }
@@ -1886,19 +1890,53 @@ var VirtualFileSystem = class _VirtualFileSystem {
1886
1890
  * @returns A new virtual file system instance.
1887
1891
  */
1888
1892
  static createSync(context) {
1893
+ context.debug("Starting virtual file system (VFS) initialization processes...");
1889
1894
  if (!context.config.skipCache && existsSync(joinPaths$1(context.dataPath, "fs.bin"))) {
1890
1895
  const buffer = readFileBufferSync(joinPaths$1(context.dataPath, "fs.bin"));
1891
1896
  const message2 = new $.Message(buffer, false);
1892
1897
  const fs = message2.getRoot(FileSystem);
1893
- const result = new _VirtualFileSystem(context, fs);
1898
+ const result2 = new _VirtualFileSystem(context, fs);
1894
1899
  if (fs._hasStorage() && fs.storage.length > 0) {
1895
1900
  fs.storage.values().map((file) => {
1896
- result.writeSync(file.path, file.code);
1901
+ result2.writeSync(file.path, file.code);
1897
1902
  });
1898
1903
  }
1899
1904
  }
1900
1905
  const message = new $.Message();
1901
- return new _VirtualFileSystem(context, message.initRoot(FileSystem));
1906
+ const result = new _VirtualFileSystem(context, message.initRoot(FileSystem));
1907
+ result.#log(LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
1908
+ if (result.#metadata && Object.keys(result.#metadata).length > 0) {
1909
+ result.#log(LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.#metadata).length} previously stored metadata records...`);
1910
+ const entry = Object.entries(result.#metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1911
+ if (meta.properties) {
1912
+ const typeDefinition = {
1913
+ file: path
1914
+ };
1915
+ if (isSetString(meta.properties.name)) {
1916
+ typeDefinition.name = meta.properties.name;
1917
+ }
1918
+ if (isSetString(meta.properties["input.file"]) || isSetString(meta.properties["input.name"])) {
1919
+ typeDefinition.input ??= {};
1920
+ if (isSetString(meta.properties["input.file"])) {
1921
+ typeDefinition.input.file = meta.properties["input.file"];
1922
+ }
1923
+ if (isSetString(meta.properties["input.name"])) {
1924
+ typeDefinition.input.name = meta.properties["input.name"];
1925
+ }
1926
+ }
1927
+ if (isSetString(meta.properties.output)) {
1928
+ typeDefinition.output = meta.properties.output;
1929
+ }
1930
+ return typeDefinition;
1931
+ }
1932
+ return null;
1933
+ }).filter(Boolean);
1934
+ result.#log(LogLevelLabel.DEBUG, `Loaded ${entry.length} entry type definitions from VFS metadata.`);
1935
+ context.entry = entry;
1936
+ } else {
1937
+ result.#log(LogLevelLabel.DEBUG, "No previously stored metadata records were found on the local system.");
1938
+ }
1939
+ return result;
1902
1940
  }
1903
1941
  /**
1904
1942
  * A map of file ids to their metadata.
@@ -1918,7 +1956,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1918
1956
  }, "deleteProperty"),
1919
1957
  has: /* @__PURE__ */ __name((target, prop) => {
1920
1958
  return this.#normalizeId(prop) in target;
1921
- }, "has")
1959
+ }, "has"),
1960
+ ownKeys: /* @__PURE__ */ __name((target) => {
1961
+ return Reflect.ownKeys(target).map((key) => this.#normalizeId(key));
1962
+ }, "ownKeys")
1922
1963
  });
1923
1964
  }
1924
1965
  /**
@@ -1939,7 +1980,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1939
1980
  }, "deleteProperty"),
1940
1981
  has: /* @__PURE__ */ __name((target, prop) => {
1941
1982
  return this.#normalizePath(prop) in target;
1942
- }, "has")
1983
+ }, "has"),
1984
+ ownKeys: /* @__PURE__ */ __name((target) => {
1985
+ return Reflect.ownKeys(target).map((key) => this.#normalizePath(key));
1986
+ }, "ownKeys")
1943
1987
  });
1944
1988
  }
1945
1989
  /**
@@ -1960,7 +2004,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1960
2004
  }, "deleteProperty"),
1961
2005
  has: /* @__PURE__ */ __name((target, prop) => {
1962
2006
  return this.#normalizeId(prop) in target;
1963
- }, "has")
2007
+ }, "has"),
2008
+ ownKeys: /* @__PURE__ */ __name((target) => {
2009
+ return Reflect.ownKeys(target).map((key) => this.#normalizeId(key));
2010
+ }, "ownKeys")
1964
2011
  });
1965
2012
  }
1966
2013
  /**
@@ -2400,9 +2447,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
2400
2447
  async write(path, data = "", options = {}) {
2401
2448
  const meta = options.meta ?? {};
2402
2449
  const { relativeKey, adapter } = this.#getStorage(options.storage || path);
2450
+ this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(data)).size)})`);
2403
2451
  let code = data;
2404
- if (!options.skipFormat) {
2405
- code = await format(this.#normalizePath(path), data);
2452
+ try {
2453
+ if (!options.skipFormat) {
2454
+ code = await format(this.#normalizePath(path), data);
2455
+ }
2456
+ } catch (err) {
2457
+ this.#log(LogLevelLabel.WARN, `Failed to format file ${this.#normalizePath(path)} before writing: ${err.message}`);
2458
+ code = data;
2406
2459
  }
2407
2460
  this.#log(LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes(new Blob(toArray(code)).size)})`);
2408
2461
  const id = meta.id || this.#normalizeId(relativeKey);
@@ -4981,5 +5034,5 @@ Note: Please ensure the plugin package's default export is a class that extends
4981
5034
  };
4982
5035
 
4983
5036
  export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, _capnpFileId, combineContexts, createLog, extendLog, isUnpluginBuilderVariant };
4984
- //# sourceMappingURL=chunk-3XEOJ3TS.js.map
4985
- //# sourceMappingURL=chunk-3XEOJ3TS.js.map
5037
+ //# sourceMappingURL=chunk-5UWYXYHN.js.map
5038
+ //# sourceMappingURL=chunk-5UWYXYHN.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkSE3RCXWI_cjs = require('./chunk-SE3RCXWI.cjs');
4
- var chunkC3TWAGFQ_cjs = require('./chunk-C3TWAGFQ.cjs');
4
+ var chunkA6EFHKFH_cjs = require('./chunk-A6EFHKFH.cjs');
5
5
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
6
6
  var environmentChecks = require('@stryke/env/environment-checks');
7
7
  var defu = require('defu');
@@ -97,7 +97,7 @@ function extractViteConfig(context) {
97
97
  chunkPK6SKIKE_cjs.__name(extractViteConfig, "extractViteConfig");
98
98
 
99
99
  // src/vite.ts
100
- var vite = unplugin.createVitePlugin(chunkC3TWAGFQ_cjs.createUnpluginFactory("vite", (api, plugin) => {
100
+ var vite = unplugin.createVitePlugin(chunkA6EFHKFH_cjs.createUnpluginFactory("vite", (api, plugin) => {
101
101
  return {
102
102
  ...plugin,
103
103
  vite: {
@@ -158,5 +158,5 @@ var vite_default = vite;
158
158
 
159
159
  exports.vite = vite;
160
160
  exports.vite_default = vite_default;
161
- //# sourceMappingURL=chunk-DWF4GVXQ.cjs.map
162
- //# sourceMappingURL=chunk-DWF4GVXQ.cjs.map
161
+ //# sourceMappingURL=chunk-A44AVBOK.cjs.map
162
+ //# sourceMappingURL=chunk-A44AVBOK.cjs.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkR7IUNKL4_cjs = require('./chunk-R7IUNKL4.cjs');
3
+ var chunkGLFCJGOU_cjs = require('./chunk-GLFCJGOU.cjs');
4
4
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
5
5
  var types = require('@storm-software/config-tools/types');
6
6
  var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
@@ -27,7 +27,7 @@ chunkPK6SKIKE_cjs.__name(getString, "getString");
27
27
  // src/lib/unplugin/factory.ts
28
28
  function createUnpluginFactory(variant, decorate) {
29
29
  return (config, meta) => {
30
- const log = chunkR7IUNKL4_cjs.createLog("unplugin", config);
30
+ const log = chunkGLFCJGOU_cjs.createLog("unplugin", config);
31
31
  log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
32
32
  try {
33
33
  const userConfig = {
@@ -38,7 +38,7 @@ function createUnpluginFactory(variant, decorate) {
38
38
  let api;
39
39
  async function buildStart() {
40
40
  log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
41
- api = await chunkR7IUNKL4_cjs.PowerlinesAPI.from(getWorkspaceRoot.getWorkspaceRoot(process.cwd()), userConfig);
41
+ api = await chunkGLFCJGOU_cjs.PowerlinesAPI.from(getWorkspaceRoot.getWorkspaceRoot(process.cwd()), userConfig);
42
42
  unplugin.setParseImpl(api.context.parse);
43
43
  log(types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
44
44
  await api.prepare({
@@ -137,5 +137,5 @@ chunkPK6SKIKE_cjs.__name(createUnpluginFactory, "createUnpluginFactory");
137
137
 
138
138
  exports.createUnpluginFactory = createUnpluginFactory;
139
139
  exports.getString = getString;
140
- //# sourceMappingURL=chunk-C3TWAGFQ.cjs.map
141
- //# sourceMappingURL=chunk-C3TWAGFQ.cjs.map
140
+ //# sourceMappingURL=chunk-A6EFHKFH.cjs.map
141
+ //# sourceMappingURL=chunk-A6EFHKFH.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { extractESBuildConfig } from './chunk-BGBDDKML.js';
2
- import { createUnpluginFactory } from './chunk-Z7KIQFLN.js';
2
+ import { createUnpluginFactory } from './chunk-5EXQR5PS.js';
3
3
  import { __name } from './chunk-7QVYU63E.js';
4
4
  import { isDevelopmentMode, isTestMode } from '@stryke/env/environment-checks';
5
5
  import defu from 'defu';
@@ -151,5 +151,5 @@ var vite = createVitePlugin(createUnpluginFactory("vite", (api, plugin) => {
151
151
  var vite_default = vite;
152
152
 
153
153
  export { vite, vite_default };
154
- //# sourceMappingURL=chunk-UQ7LY7EU.js.map
155
- //# sourceMappingURL=chunk-UQ7LY7EU.js.map
154
+ //# sourceMappingURL=chunk-CBUBY3RQ.js.map
155
+ //# sourceMappingURL=chunk-CBUBY3RQ.js.map
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkA6EFHKFH_cjs = require('./chunk-A6EFHKFH.cjs');
4
+ var unplugin = require('unplugin');
5
+
6
+ var rolldown = unplugin.createRolldownPlugin(chunkA6EFHKFH_cjs.createUnpluginFactory("rolldown"));
7
+ var rolldown_default = rolldown;
8
+
9
+ exports.rolldown = rolldown;
10
+ exports.rolldown_default = rolldown_default;
11
+ //# sourceMappingURL=chunk-EBWMUY6X.cjs.map
12
+ //# sourceMappingURL=chunk-EBWMUY6X.cjs.map
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkA6EFHKFH_cjs = require('./chunk-A6EFHKFH.cjs');
4
+ var unplugin = require('unplugin');
5
+
6
+ var webpack = unplugin.createWebpackPlugin(chunkA6EFHKFH_cjs.createUnpluginFactory("webpack"));
7
+ var webpack_default = webpack;
8
+
9
+ exports.webpack = webpack;
10
+ exports.webpack_default = webpack_default;
11
+ //# sourceMappingURL=chunk-EIJCWBLT.cjs.map
12
+ //# sourceMappingURL=chunk-EIJCWBLT.cjs.map
@@ -1,9 +1,9 @@
1
- import { createUnpluginFactory } from './chunk-Z7KIQFLN.js';
1
+ import { createUnpluginFactory } from './chunk-5EXQR5PS.js';
2
2
  import { createWebpackPlugin } from 'unplugin';
3
3
 
4
4
  var webpack = createWebpackPlugin(createUnpluginFactory("webpack"));
5
5
  var webpack_default = webpack;
6
6
 
7
7
  export { webpack, webpack_default };
8
- //# sourceMappingURL=chunk-PQ6DDPXP.js.map
9
- //# sourceMappingURL=chunk-PQ6DDPXP.js.map
8
+ //# sourceMappingURL=chunk-GBWZQNCT.js.map
9
+ //# sourceMappingURL=chunk-GBWZQNCT.js.map
@@ -1261,7 +1261,7 @@ function isValidId(id, prefix = "powerlines") {
1261
1261
  }
1262
1262
  chunkPK6SKIKE_cjs.__name(isValidId, "isValidId");
1263
1263
  function normalizeId(id, prefix = "powerlines") {
1264
- return `${prefix.replace(/:$/, "")}:${toFilePath(id).replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), "").replace(/^\\0/, "").replace(filePathFns.findFileDotExtensionSafe(toFilePath(id)), "")}`;
1264
+ return replace.replaceExtension(toFilePath(id)).replace(/^\\0/, "").replace(/^powerlines:/, "").replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), "");
1265
1265
  }
1266
1266
  chunkPK6SKIKE_cjs.__name(normalizeId, "normalizeId");
1267
1267
  function normalizePath(path, builtinsPath, prefix = "powerlines") {
@@ -1870,16 +1870,18 @@ var VirtualFileSystem = class _VirtualFileSystem {
1870
1870
  const result2 = new _VirtualFileSystem(context, fs);
1871
1871
  if (fs._hasStorage() && fs.storage.length > 0) {
1872
1872
  await Promise.all(fs.storage.values().map(async (file) => {
1873
- await result2.write(file.path, file.code);
1873
+ if (file.path && file.code) {
1874
+ await result2.write(file.path, file.code);
1875
+ }
1874
1876
  }));
1875
1877
  }
1876
1878
  }
1877
1879
  const message = new $__namespace.Message();
1878
1880
  const result = new _VirtualFileSystem(context, message.initRoot(FileSystem));
1879
1881
  result.#log(types.LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
1880
- if (result.metadata) {
1881
- result.#log(types.LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.metadata).length} previously stored metadata records...`);
1882
- const entry = Object.entries(result.metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1882
+ if (result.#metadata && Object.keys(result.#metadata).length > 0) {
1883
+ result.#log(types.LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.#metadata).length} previously stored metadata records...`);
1884
+ const entry = Object.entries(result.#metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1883
1885
  if (meta.properties) {
1884
1886
  const typeDefinition = {
1885
1887
  file: path
@@ -1905,6 +1907,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
1905
1907
  }).filter(Boolean);
1906
1908
  result.#log(types.LogLevelLabel.DEBUG, `Loaded ${entry.length} entry type definitions from VFS metadata.`);
1907
1909
  context.entry = entry;
1910
+ } else {
1911
+ result.#log(types.LogLevelLabel.DEBUG, "No previously stored metadata records were found on the local system.");
1908
1912
  }
1909
1913
  return result;
1910
1914
  }
@@ -1915,19 +1919,53 @@ var VirtualFileSystem = class _VirtualFileSystem {
1915
1919
  * @returns A new virtual file system instance.
1916
1920
  */
1917
1921
  static createSync(context) {
1922
+ context.debug("Starting virtual file system (VFS) initialization processes...");
1918
1923
  if (!context.config.skipCache && exists.existsSync(joinPaths.joinPaths(context.dataPath, "fs.bin"))) {
1919
1924
  const buffer$1 = buffer.readFileBufferSync(joinPaths.joinPaths(context.dataPath, "fs.bin"));
1920
1925
  const message2 = new $__namespace.Message(buffer$1, false);
1921
1926
  const fs = message2.getRoot(FileSystem);
1922
- const result = new _VirtualFileSystem(context, fs);
1927
+ const result2 = new _VirtualFileSystem(context, fs);
1923
1928
  if (fs._hasStorage() && fs.storage.length > 0) {
1924
1929
  fs.storage.values().map((file) => {
1925
- result.writeSync(file.path, file.code);
1930
+ result2.writeSync(file.path, file.code);
1926
1931
  });
1927
1932
  }
1928
1933
  }
1929
1934
  const message = new $__namespace.Message();
1930
- return new _VirtualFileSystem(context, message.initRoot(FileSystem));
1935
+ const result = new _VirtualFileSystem(context, message.initRoot(FileSystem));
1936
+ result.#log(types.LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
1937
+ if (result.#metadata && Object.keys(result.#metadata).length > 0) {
1938
+ result.#log(types.LogLevelLabel.DEBUG, `Preparing to load ${Object.keys(result.#metadata).length} previously stored metadata records...`);
1939
+ const entry = Object.entries(result.#metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
1940
+ if (meta.properties) {
1941
+ const typeDefinition = {
1942
+ file: path
1943
+ };
1944
+ if (isSetString.isSetString(meta.properties.name)) {
1945
+ typeDefinition.name = meta.properties.name;
1946
+ }
1947
+ if (isSetString.isSetString(meta.properties["input.file"]) || isSetString.isSetString(meta.properties["input.name"])) {
1948
+ typeDefinition.input ??= {};
1949
+ if (isSetString.isSetString(meta.properties["input.file"])) {
1950
+ typeDefinition.input.file = meta.properties["input.file"];
1951
+ }
1952
+ if (isSetString.isSetString(meta.properties["input.name"])) {
1953
+ typeDefinition.input.name = meta.properties["input.name"];
1954
+ }
1955
+ }
1956
+ if (isSetString.isSetString(meta.properties.output)) {
1957
+ typeDefinition.output = meta.properties.output;
1958
+ }
1959
+ return typeDefinition;
1960
+ }
1961
+ return null;
1962
+ }).filter(Boolean);
1963
+ result.#log(types.LogLevelLabel.DEBUG, `Loaded ${entry.length} entry type definitions from VFS metadata.`);
1964
+ context.entry = entry;
1965
+ } else {
1966
+ result.#log(types.LogLevelLabel.DEBUG, "No previously stored metadata records were found on the local system.");
1967
+ }
1968
+ return result;
1931
1969
  }
1932
1970
  /**
1933
1971
  * A map of file ids to their metadata.
@@ -1947,7 +1985,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1947
1985
  }, "deleteProperty"),
1948
1986
  has: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop) => {
1949
1987
  return this.#normalizeId(prop) in target;
1950
- }, "has")
1988
+ }, "has"),
1989
+ ownKeys: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target) => {
1990
+ return Reflect.ownKeys(target).map((key) => this.#normalizeId(key));
1991
+ }, "ownKeys")
1951
1992
  });
1952
1993
  }
1953
1994
  /**
@@ -1968,7 +2009,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1968
2009
  }, "deleteProperty"),
1969
2010
  has: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop) => {
1970
2011
  return this.#normalizePath(prop) in target;
1971
- }, "has")
2012
+ }, "has"),
2013
+ ownKeys: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target) => {
2014
+ return Reflect.ownKeys(target).map((key) => this.#normalizePath(key));
2015
+ }, "ownKeys")
1972
2016
  });
1973
2017
  }
1974
2018
  /**
@@ -1989,7 +2033,10 @@ var VirtualFileSystem = class _VirtualFileSystem {
1989
2033
  }, "deleteProperty"),
1990
2034
  has: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop) => {
1991
2035
  return this.#normalizeId(prop) in target;
1992
- }, "has")
2036
+ }, "has"),
2037
+ ownKeys: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target) => {
2038
+ return Reflect.ownKeys(target).map((key) => this.#normalizeId(key));
2039
+ }, "ownKeys")
1993
2040
  });
1994
2041
  }
1995
2042
  /**
@@ -2429,9 +2476,15 @@ var VirtualFileSystem = class _VirtualFileSystem {
2429
2476
  async write(path, data = "", options = {}) {
2430
2477
  const meta = options.meta ?? {};
2431
2478
  const { relativeKey, adapter } = this.#getStorage(options.storage || path);
2479
+ this.#log(types.LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes.prettyBytes(new buffer$1.Blob(toArray.toArray(data)).size)})`);
2432
2480
  let code = data;
2433
- if (!options.skipFormat) {
2434
- code = await format(this.#normalizePath(path), data);
2481
+ try {
2482
+ if (!options.skipFormat) {
2483
+ code = await format(this.#normalizePath(path), data);
2484
+ }
2485
+ } catch (err) {
2486
+ this.#log(types.LogLevelLabel.WARN, `Failed to format file ${this.#normalizePath(path)} before writing: ${err.message}`);
2487
+ code = data;
2435
2488
  }
2436
2489
  this.#log(types.LogLevelLabel.TRACE, `Writing ${this.#normalizePath(relativeKey)} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${prettyBytes.prettyBytes(new buffer$1.Blob(toArray.toArray(code)).size)})`);
2437
2490
  const id = meta.id || this.#normalizeId(relativeKey);
@@ -5020,5 +5073,5 @@ exports.combineContexts = combineContexts;
5020
5073
  exports.createLog = createLog;
5021
5074
  exports.extendLog = extendLog;
5022
5075
  exports.isUnpluginBuilderVariant = isUnpluginBuilderVariant;
5023
- //# sourceMappingURL=chunk-R7IUNKL4.cjs.map
5024
- //# sourceMappingURL=chunk-R7IUNKL4.cjs.map
5076
+ //# sourceMappingURL=chunk-GLFCJGOU.cjs.map
5077
+ //# sourceMappingURL=chunk-GLFCJGOU.cjs.map
@@ -1,9 +1,9 @@
1
- import { createUnpluginFactory } from './chunk-Z7KIQFLN.js';
1
+ import { createUnpluginFactory } from './chunk-5EXQR5PS.js';
2
2
  import { createRolldownPlugin } from 'unplugin';
3
3
 
4
4
  var rolldown = createRolldownPlugin(createUnpluginFactory("rolldown"));
5
5
  var rolldown_default = rolldown;
6
6
 
7
7
  export { rolldown, rolldown_default };
8
- //# sourceMappingURL=chunk-APLBM72X.js.map
9
- //# sourceMappingURL=chunk-APLBM72X.js.map
8
+ //# sourceMappingURL=chunk-KUVGZOIR.js.map
9
+ //# sourceMappingURL=chunk-KUVGZOIR.js.map
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkSE3RCXWI_cjs = require('./chunk-SE3RCXWI.cjs');
4
- var chunkC3TWAGFQ_cjs = require('./chunk-C3TWAGFQ.cjs');
4
+ var chunkA6EFHKFH_cjs = require('./chunk-A6EFHKFH.cjs');
5
5
  var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
6
6
  var isUndefined = require('@stryke/type-checks/is-undefined');
7
7
  var unplugin = require('unplugin');
8
8
 
9
- var esbuild = unplugin.createEsbuildPlugin(chunkC3TWAGFQ_cjs.createUnpluginFactory("esbuild", (api, plugin) => {
9
+ var esbuild = unplugin.createEsbuildPlugin(chunkA6EFHKFH_cjs.createUnpluginFactory("esbuild", (api, plugin) => {
10
10
  return {
11
11
  ...plugin,
12
12
  esbuild: {
@@ -32,5 +32,5 @@ var esbuild_default = esbuild;
32
32
 
33
33
  exports.esbuild = esbuild;
34
34
  exports.esbuild_default = esbuild_default;
35
- //# sourceMappingURL=chunk-UZV6LCRL.cjs.map
36
- //# sourceMappingURL=chunk-UZV6LCRL.cjs.map
35
+ //# sourceMappingURL=chunk-VNXIVSZM.cjs.map
36
+ //# sourceMappingURL=chunk-VNXIVSZM.cjs.map
package/dist/esbuild.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkUZV6LCRL_cjs = require('./chunk-UZV6LCRL.cjs');
5
+ var chunkVNXIVSZM_cjs = require('./chunk-VNXIVSZM.cjs');
6
6
  require('./chunk-SE3RCXWI.cjs');
7
- require('./chunk-C3TWAGFQ.cjs');
8
- require('./chunk-R7IUNKL4.cjs');
7
+ require('./chunk-A6EFHKFH.cjs');
8
+ require('./chunk-GLFCJGOU.cjs');
9
9
  require('./chunk-B6DVCLP5.cjs');
10
10
  require('./chunk-V5WOGN7O.cjs');
11
11
  require('./chunk-Z6ARQDHR.cjs');
@@ -15,15 +15,15 @@ require('./chunk-PK6SKIKE.cjs');
15
15
 
16
16
  Object.defineProperty(exports, "default", {
17
17
  enumerable: true,
18
- get: function () { return chunkUZV6LCRL_cjs.esbuild_default; }
18
+ get: function () { return chunkVNXIVSZM_cjs.esbuild_default; }
19
19
  });
20
20
  Object.defineProperty(exports, "esbuild", {
21
21
  enumerable: true,
22
- get: function () { return chunkUZV6LCRL_cjs.esbuild; }
22
+ get: function () { return chunkVNXIVSZM_cjs.esbuild; }
23
23
  });
24
24
  Object.defineProperty(exports, "module.exports", {
25
25
  enumerable: true,
26
- get: function () { return chunkUZV6LCRL_cjs.esbuild; }
26
+ get: function () { return chunkVNXIVSZM_cjs.esbuild; }
27
27
  });
28
28
  //# sourceMappingURL=esbuild.cjs.map
29
29
  //# sourceMappingURL=esbuild.cjs.map
package/dist/esbuild.js CHANGED
@@ -1,7 +1,7 @@
1
- export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-D4L3REG4.js';
1
+ export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-4KHQJLOZ.js';
2
2
  import './chunk-BGBDDKML.js';
3
- import './chunk-Z7KIQFLN.js';
4
- import './chunk-3XEOJ3TS.js';
3
+ import './chunk-5EXQR5PS.js';
4
+ import './chunk-5UWYXYHN.js';
5
5
  import './chunk-PQXP7XQK.js';
6
6
  import './chunk-NITQ5IYP.js';
7
7
  import './chunk-2MYPFASJ.js';
package/dist/farm.cjs CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkC3TWAGFQ_cjs = require('./chunk-C3TWAGFQ.cjs');
6
- require('./chunk-R7IUNKL4.cjs');
5
+ var chunkA6EFHKFH_cjs = require('./chunk-A6EFHKFH.cjs');
6
+ require('./chunk-GLFCJGOU.cjs');
7
7
  require('./chunk-B6DVCLP5.cjs');
8
8
  require('./chunk-V5WOGN7O.cjs');
9
9
  require('./chunk-Z6ARQDHR.cjs');
10
10
  require('./chunk-PK6SKIKE.cjs');
11
11
  var unplugin = require('unplugin');
12
12
 
13
- var farm = unplugin.createFarmPlugin(chunkC3TWAGFQ_cjs.createUnpluginFactory("farm"));
13
+ var farm = unplugin.createFarmPlugin(chunkA6EFHKFH_cjs.createUnpluginFactory("farm"));
14
14
  var farm_default = farm;
15
15
 
16
16
  exports.default = farm_default;
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createUnpluginFactory } from './chunk-Z7KIQFLN.js';
2
- import './chunk-3XEOJ3TS.js';
1
+ import { createUnpluginFactory } from './chunk-5EXQR5PS.js';
2
+ import './chunk-5UWYXYHN.js';
3
3
  import './chunk-PQXP7XQK.js';
4
4
  import './chunk-NITQ5IYP.js';
5
5
  import './chunk-2MYPFASJ.js';