powerlines 0.37.53 → 0.37.55

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 (136) 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-NLMIRB6Q.js → chunk-3IBKHRRH.js} +3 -3
  6. package/dist/{chunk-B4NNABMD.cjs → chunk-6DKPMU3L.cjs} +5 -5
  7. package/dist/{chunk-CUAOWSR7.cjs → chunk-6VDZHJEH.cjs} +4 -4
  8. package/dist/{chunk-2CFDUVKT.js → chunk-6YCSSTVC.js} +3 -3
  9. package/dist/{chunk-JTMNFP4L.js → chunk-BW5NDBWH.js} +3 -3
  10. package/dist/{chunk-ILQD2JJ3.cjs → chunk-CUGOCGSK.cjs} +4 -4
  11. package/dist/chunk-D7545A3W.cjs +12 -0
  12. package/dist/{chunk-MQBIQICR.js → chunk-EHCLZGBR.js} +3 -3
  13. package/dist/{chunk-DPLZABXI.js → chunk-LX3ZZP62.js} +3 -3
  14. package/dist/{chunk-GMAZZ3IG.cjs → chunk-P24DSFF4.cjs} +6 -6
  15. package/dist/{chunk-HO5PC45I.js → chunk-XIBDIPTT.js} +6 -6
  16. package/dist/chunk-YTXKB2NX.cjs +12 -0
  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/build/esbuild.cjs +5 -5
  24. package/dist/lib/build/esbuild.js +2 -2
  25. package/dist/lib/build/index.cjs +12 -12
  26. package/dist/lib/build/index.js +4 -4
  27. package/dist/lib/build/tsup.cjs +6 -6
  28. package/dist/lib/build/tsup.js +3 -3
  29. package/dist/lib/build/vite.cjs +5 -5
  30. package/dist/lib/build/vite.js +3 -3
  31. package/dist/lib/{chunk-DURA23ST.cjs → chunk-26DEN74R.cjs} +6 -6
  32. package/dist/lib/{chunk-DURA23ST.cjs.map → chunk-26DEN74R.cjs.map} +1 -1
  33. package/dist/lib/{chunk-UDP5UT5U.cjs → chunk-43LFJIBT.cjs} +4 -4
  34. package/dist/lib/{chunk-UDP5UT5U.cjs.map → chunk-43LFJIBT.cjs.map} +1 -1
  35. package/dist/lib/{chunk-DF6BTQY5.cjs → chunk-57INYYJ7.cjs} +17 -17
  36. package/dist/lib/{chunk-DF6BTQY5.cjs.map → chunk-57INYYJ7.cjs.map} +1 -1
  37. package/dist/lib/{chunk-XKEHVYDR.cjs → chunk-5RGBODNU.cjs} +3 -3
  38. package/dist/lib/chunk-5RGBODNU.cjs.map +1 -0
  39. package/dist/lib/{chunk-5LL3YTST.cjs → chunk-ALXWGYR7.cjs} +4 -4
  40. package/dist/lib/{chunk-5LL3YTST.cjs.map → chunk-ALXWGYR7.cjs.map} +1 -1
  41. package/dist/lib/{chunk-2XCDEMMO.cjs → chunk-C2SIHISU.cjs} +4 -4
  42. package/dist/lib/{chunk-2XCDEMMO.cjs.map → chunk-C2SIHISU.cjs.map} +1 -1
  43. package/dist/lib/{chunk-54W6CDDJ.cjs → chunk-DMSD5NS5.cjs} +19 -19
  44. package/dist/lib/{chunk-54W6CDDJ.cjs.map → chunk-DMSD5NS5.cjs.map} +1 -1
  45. package/dist/lib/{chunk-QA5Q2UBH.cjs → chunk-DTGZYBQX.cjs} +4 -4
  46. package/dist/lib/{chunk-QA5Q2UBH.cjs.map → chunk-DTGZYBQX.cjs.map} +1 -1
  47. package/dist/lib/{chunk-ARPXWAQM.cjs → chunk-FIXA5XLP.cjs} +4 -4
  48. package/dist/lib/{chunk-ARPXWAQM.cjs.map → chunk-FIXA5XLP.cjs.map} +1 -1
  49. package/dist/lib/{chunk-M4Q6V2EL.js → chunk-G2GLLLRU.js} +4 -4
  50. package/dist/lib/{chunk-M4Q6V2EL.js.map → chunk-G2GLLLRU.js.map} +1 -1
  51. package/dist/lib/{chunk-VZCNKJBT.js → chunk-GQNZENVF.js} +3 -3
  52. package/dist/lib/{chunk-VZCNKJBT.js.map → chunk-GQNZENVF.js.map} +1 -1
  53. package/dist/lib/{chunk-5RFTIHJY.cjs → chunk-HCDETYRM.cjs} +4 -4
  54. package/dist/lib/chunk-HCDETYRM.cjs.map +1 -0
  55. package/dist/lib/{chunk-RWOQGHJP.js → chunk-I4LBDWHI.js} +4 -4
  56. package/dist/lib/{chunk-RWOQGHJP.js.map → chunk-I4LBDWHI.js.map} +1 -1
  57. package/dist/lib/{chunk-MT6U737Y.js → chunk-I4VVVKOI.js} +3 -3
  58. package/dist/lib/{chunk-MT6U737Y.js.map → chunk-I4VVVKOI.js.map} +1 -1
  59. package/dist/lib/{chunk-G6TY5O4F.cjs → chunk-IEWCXR3Q.cjs} +8 -8
  60. package/dist/lib/{chunk-G6TY5O4F.cjs.map → chunk-IEWCXR3Q.cjs.map} +1 -1
  61. package/dist/lib/{chunk-3VHQ4ICQ.js → chunk-IJ534W5N.js} +3 -3
  62. package/dist/lib/{chunk-3VHQ4ICQ.js.map → chunk-IJ534W5N.js.map} +1 -1
  63. package/dist/lib/{chunk-O2HWFNL5.js → chunk-LGJOP2GH.js} +5 -5
  64. package/dist/lib/{chunk-O2HWFNL5.js.map → chunk-LGJOP2GH.js.map} +1 -1
  65. package/dist/lib/{chunk-2LZ2KCSP.js → chunk-O3TMMYSA.js} +3 -3
  66. package/dist/lib/chunk-O3TMMYSA.js.map +1 -0
  67. package/dist/lib/{chunk-YFI33VEM.cjs → chunk-ODRURQ3X.cjs} +4 -4
  68. package/dist/lib/{chunk-YFI33VEM.cjs.map → chunk-ODRURQ3X.cjs.map} +1 -1
  69. package/dist/lib/{chunk-BZUPF244.js → chunk-PMOMJSBN.js} +3 -3
  70. package/dist/lib/{chunk-BZUPF244.js.map → chunk-PMOMJSBN.js.map} +1 -1
  71. package/dist/lib/{chunk-JVQJY2N3.js → chunk-VWKNWAN3.js} +4 -4
  72. package/dist/lib/{chunk-JVQJY2N3.js.map → chunk-VWKNWAN3.js.map} +1 -1
  73. package/dist/lib/{chunk-FUY5E7BG.js → chunk-VXFMR22Q.js} +3 -3
  74. package/dist/lib/{chunk-FUY5E7BG.js.map → chunk-VXFMR22Q.js.map} +1 -1
  75. package/dist/lib/{chunk-ZW6KFCBI.js → chunk-Y7RUTBOF.js} +3 -3
  76. package/dist/lib/{chunk-ZW6KFCBI.js.map → chunk-Y7RUTBOF.js.map} +1 -1
  77. package/dist/lib/{chunk-DPGJOEXL.js → chunk-YVFFKAMF.js} +3 -3
  78. package/dist/lib/{chunk-DPGJOEXL.js.map → chunk-YVFFKAMF.js.map} +1 -1
  79. package/dist/lib/contexts/api-context.cjs +7 -7
  80. package/dist/lib/contexts/api-context.js +6 -6
  81. package/dist/lib/contexts/context.cjs +5 -5
  82. package/dist/lib/contexts/context.js +4 -4
  83. package/dist/lib/contexts/environment-context.cjs +6 -6
  84. package/dist/lib/contexts/environment-context.js +5 -5
  85. package/dist/lib/contexts/index.cjs +9 -9
  86. package/dist/lib/contexts/index.js +6 -6
  87. package/dist/lib/entry.cjs +8 -8
  88. package/dist/lib/entry.js +1 -1
  89. package/dist/lib/fs/index.cjs +3 -3
  90. package/dist/lib/fs/index.js +2 -2
  91. package/dist/lib/fs/storage/file-system.cjs +2 -2
  92. package/dist/lib/fs/storage/file-system.js +1 -1
  93. package/dist/lib/fs/storage/index.cjs +2 -2
  94. package/dist/lib/fs/storage/index.js +1 -1
  95. package/dist/lib/fs/vfs.cjs +3 -3
  96. package/dist/lib/fs/vfs.js +2 -2
  97. package/dist/lib/index.cjs +24 -24
  98. package/dist/lib/index.js +10 -10
  99. package/dist/lib/unplugin/factory.cjs +8 -8
  100. package/dist/lib/unplugin/factory.js +7 -7
  101. package/dist/lib/unplugin/index.cjs +8 -8
  102. package/dist/lib/unplugin/index.js +7 -7
  103. package/dist/lib/utilities/bundle.cjs +4 -4
  104. package/dist/lib/utilities/bundle.js +3 -3
  105. package/dist/lib/utilities/index.cjs +6 -6
  106. package/dist/lib/utilities/index.js +4 -4
  107. package/dist/lib/utilities/resolve.cjs +5 -5
  108. package/dist/lib/utilities/resolve.js +4 -4
  109. package/dist/next.cjs +4 -4
  110. package/dist/next.js +3 -3
  111. package/dist/nuxt.cjs +8 -8
  112. package/dist/nuxt.js +4 -4
  113. package/dist/rolldown.cjs +6 -6
  114. package/dist/rolldown.js +3 -3
  115. package/dist/rollup.cjs +3 -3
  116. package/dist/rollup.js +2 -2
  117. package/dist/rspack.cjs +3 -3
  118. package/dist/rspack.js +2 -2
  119. package/dist/tsdown.cjs +4 -4
  120. package/dist/tsdown.js +3 -3
  121. package/dist/tsup.cjs +4 -4
  122. package/dist/tsup.js +3 -3
  123. package/dist/unloader.cjs +3 -3
  124. package/dist/unloader.js +2 -2
  125. package/dist/unplugin.cjs +8 -8
  126. package/dist/unplugin.js +4 -4
  127. package/dist/vite.cjs +6 -6
  128. package/dist/vite.js +3 -3
  129. package/dist/webpack.cjs +6 -6
  130. package/dist/webpack.js +3 -3
  131. package/package.json +2 -2
  132. package/dist/chunk-MJ6VMXPE.cjs +0 -12
  133. package/dist/chunk-SFQQQYGC.cjs +0 -12
  134. package/dist/lib/chunk-2LZ2KCSP.js.map +0 -1
  135. package/dist/lib/chunk-5RFTIHJY.cjs.map +0 -1
  136. package/dist/lib/chunk-XKEHVYDR.cjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerlines",
3
- "version": "0.37.53",
3
+ "version": "0.37.55",
4
4
  "type": "module",
5
5
  "description": "The \"any framework\" framework that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.",
6
6
  "repository": {
@@ -662,5 +662,5 @@
662
662
  "undici-types": "^7.18.2"
663
663
  },
664
664
  "publishConfig": { "access": "public" },
665
- "gitHead": "5f1905e411abd4cb78962bc0cae6ddaf19ffd9bd"
665
+ "gitHead": "5c6a45da350207ae49328ff5a6330415e872a319"
666
666
  }
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkB4NNABMD_cjs = require('./chunk-B4NNABMD.cjs');
4
- var unplugin = require('unplugin');
5
-
6
- var rolldown = unplugin.createRolldownPlugin(chunkB4NNABMD_cjs.createUnpluginFactory("rolldown"));
7
- var rolldown_default = rolldown;
8
-
9
- exports.rolldown = rolldown;
10
- exports.rolldown_default = rolldown_default;
11
- //# sourceMappingURL=chunk-MJ6VMXPE.cjs.map
12
- //# sourceMappingURL=chunk-MJ6VMXPE.cjs.map
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkB4NNABMD_cjs = require('./chunk-B4NNABMD.cjs');
4
- var unplugin = require('unplugin');
5
-
6
- var webpack = unplugin.createWebpackPlugin(chunkB4NNABMD_cjs.createUnpluginFactory("webpack"));
7
- var webpack_default = webpack;
8
-
9
- exports.webpack = webpack;
10
- exports.webpack_default = webpack_default;
11
- //# sourceMappingURL=chunk-SFQQQYGC.cjs.map
12
- //# sourceMappingURL=chunk-SFQQQYGC.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/fs/storage/file-system.ts"],"names":["FileSystemStorageAdapter","BaseStorageAdapter","name","preset","options","existsSync","key","resolve","exists","getSync","readFileSync","get","readFile","setSync","value","isReadOnly","writeFileSync","set","writeFile","removeSync","unlinkSync","err","ignoreNotfound","remove","unlink","catch","mkdirSync","dirPath","createDirectorySync","mkdir","createDirectory","listSync","base","listFilesSync","ignore","list","listFiles","then","r","isDirectorySync","isDirectory","isFileSync","isFile"],"mappings":";;;;;;;;;;;;AAmCO,IAAMA,wBAAAA,GAAN,cAAuCC,kBAAAA,CAAAA;EAnC9C;;;;;;EAuCSC,IAAAA,GAAO,aAAA;;;;;;;EAQWC,MAAAA,GAAS,IAAA;;;;;;AAOlC,EAAA,WAAA,CAAmBC,OAAAA,EAAiC;AAClD,IAAA,KAAA,CAAMA,OAAAA,CAAAA;AACR,EAAA;;;;;;;AAQOC,EAAAA,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CAAAA,CACNe,KAAKC,CAAAA,CAAAA,KAAKA,CAAAA,IAAK,EAAE,CAAA;AACtB,EAAA;;;;;;;AAQgBC,EAAAA,eAAAA,CAAgBjC,GAAAA,EAAsB;AACpD,IAAA,OAAOkC,WAAAA,CAAY,IAAA,CAAKjC,OAAAA,CAAQD,GAAAA,CAAAA,CAAAA;AAClC,EAAA;;;;;;;AAQgBmC,EAAAA,UAAAA,CAAWnC,GAAAA,EAAsB;AAC/C,IAAA,OAAO,CAACoC,MAAAA,CAAO,IAAA,CAAKnC,OAAAA,CAAQD,GAAAA,CAAAA,CAAAA;AAC9B,EAAA;AACF","file":"chunk-2LZ2KCSP.js","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { exists, existsSync } from \"@stryke/fs/exists\";\nimport { createDirectory, createDirectorySync } from \"@stryke/fs/helpers\";\nimport { isDirectory, isFile } from \"@stryke/fs/is-file\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { readFile, readFileSync } from \"@stryke/fs/read-file\";\nimport { writeFile, writeFileSync } from \"@stryke/fs/write-file\";\nimport { unlinkSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\nimport { ignoreNotfound } from \"../helpers\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\n\nexport type SetSyncOptions = Parameters<typeof writeFileSync>[2];\nexport type SetOptions = Parameters<typeof writeFile>[2];\n\n/**\n * File system storage adapter implementation.\n */\nexport class FileSystemStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"file-system\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"fs\";\n\n /**\n * Constructor for the FileSystemStorageAdapter.\n *\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(options?: StorageAdapterOptions) {\n super(options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return existsSync(this.resolve(key));\n }\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public override async exists(key: string): Promise<boolean> {\n return exists(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return readFileSync(this.resolve(key));\n }\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public override async get(key: string): Promise<string | null> {\n return readFile(this.resolve(key));\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.options.isReadOnly) {\n return writeFileSync(this.resolve(key), value);\n }\n }\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public override async set(key: string, value: string): Promise<void> {\n if (!this.options.isReadOnly) {\n return writeFile(this.resolve(key), value);\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.options.isReadOnly) {\n try {\n return unlinkSync(this.resolve(key));\n } catch (err) {\n return ignoreNotfound(err);\n }\n }\n }\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public override async remove(key: string): Promise<void> {\n if (!this.options.isReadOnly) {\n return unlink(this.resolve(key)).catch(ignoreNotfound);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override mkdirSync(dirPath: string) {\n createDirectorySync(this.resolve(dirPath));\n }\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override async mkdir(dirPath: string): Promise<void> {\n await createDirectory(this.resolve(dirPath));\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n try {\n return listFilesSync(this.resolve(base), {\n ignore: this.options.ignore\n });\n } catch (err) {\n return ignoreNotfound(err) ?? [];\n }\n }\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public override async list(base?: string): Promise<string[]> {\n return listFiles(this.resolve(base), {\n ignore: this.options.ignore\n })\n .catch(ignoreNotfound)\n .then(r => r || []);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public override isDirectorySync(key: string): boolean {\n return isDirectory(this.resolve(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public override isFileSync(key: string): boolean {\n return !isFile(this.resolve(key));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/entry.ts"],"names":["resolveEntryOutput","context","typeDefinition","replaceExtension","replacePath","file","joinPaths","workspaceConfig","workspaceRoot","config","sourceRoot","projectRoot","resolveEntry","input","output","resolveEntries","typeDefinitions","Promise","all","map","entry","isResolvedEntryTypeDefinition","replacePathTokens","isString","parseTypeDefinition","filePath","isAbsolutePath","appendPath","fs","isFile","name","glob","flat","filter","Boolean","isTypeDefinition","undefined","resolveEntriesSync","isFileSync","globSync","getUniqueEntries","entries","getUniqueBy","toArray","item","isSetString","murmurhash","maxLength"],"mappings":";;;;;;;;;;;;;;;AAwDO,SAASA,kBAAAA,CACdC,SACAC,cAAAA,EAA8B;AAE9B,EAAA,OAAOC,yBACLC,mBAAAA,CACEA,mBAAAA,CACEA,oBACEA,mBAAAA,CACEA,mBAAAA,CACEF,eAAeG,IAAAA,EACfC,mBAAAA,CACEL,QAAQM,eAAAA,CAAgBC,aAAAA,EACxBP,QAAQQ,MAAAA,CAAOC,UAAU,CAAA,CAAA,EAG7BJ,mBAAAA,CACEL,QAAQM,eAAAA,CAAgBC,aAAAA,EACxBP,OAAAA,CAAQQ,MAAAA,CAAOE,WAAW,CAAA,CAAA,EAG9BV,QAAQQ,MAAAA,CAAOC,UAAU,GAE3BT,OAAAA,CAAQQ,MAAAA,CAAOE,WAAW,CAAA,EAE5BP,mBAAAA,CAAYH,QAAQQ,MAAAA,CAAOC,UAAAA,EAAYT,QAAQQ,MAAAA,CAAOE,WAAW,CAAA,CAAA,CAAA;AAGvE;AA5BgBX,wBAAAA,CAAAA,kBAAAA,EAAAA,oBAAAA,CAAAA;AA8BT,SAASY,YAAAA,CACdX,SACAC,cAAAA,EAA8B;AAI9B,EAAA,OAAO;IACL,GAAGA,cAAAA;IACHW,KAAAA,EAAOX,cAAAA;IACPY,MAAAA,EAAQd,kBAAAA,CAAmBC,SAASC,cAAAA;AACtC,GAAA;AACF;AAXgBU,wBAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA;AAoBhB,eAAsBG,cAAAA,CACpBd,SACAe,eAAAA,EAA6E;AAE7E,EAAA,OAAA,CACE,MAAMC,OAAAA,CAAQC,GAAAA,CACZF,eAAAA,CAAgBG,GAAAA,CAAI,OAAMC,KAAAA,KAAAA;AACxB,IAAA,IAAIC,6BAAAA,CAA8BD,KAAAA,CAAAA,EAAQ;AACxC,MAA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BAAAA,CAAYC,eAAAA,CAAQF,OAAAA,CAAAA,EAAU,CAACG,IAAAA,KACpCC,uBAAAA,CAAYD,IAAAA,CAAAA,GAAQA,IAAAA,GAAOE,qBAAAA,CAAWF,IAAAA,IAAQ,EAAC,EAAG;IAAEG,SAAAA,EAAW;AAAG,GAAA,CAAA,CAAA;AAEtE;AANgBP,wBAAAA,CAAAA,gBAAAA,EAAAA,kBAAAA,CAAAA","file":"chunk-5RFTIHJY.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { murmurhash } from \"@stryke/hash/murmurhash\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport type { Context } from \"../types/context\";\nimport { ResolvedEntryTypeDefinition } from \"../types/resolved\";\n\n// export function resolveEntryInputFile(\n// context: Context,\n// typeDefinition: TypeDefinition\n// ): string {\n// return replacePath(\n// typeDefinition.file,\n// joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)\n// );\n// }\n\n// export function resolveEntryInput(\n// context: Context,\n// typeDefinition: TypeDefinition\n// ): TypeDefinition {\n// return {\n// file: resolveEntryInputFile(context, typeDefinition),\n// name: typeDefinition.name\n// };\n// }\n\nexport function resolveEntryOutput(\n context: Context,\n typeDefinition: TypeDefinition\n): string {\n return replaceExtension(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n replacePath(\n typeDefinition.file,\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.sourceRoot\n )\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n )\n ),\n context.config.sourceRoot\n ),\n context.config.projectRoot\n ),\n replacePath(context.config.sourceRoot, context.config.projectRoot)\n )\n );\n}\n\nexport function resolveEntry(\n context: Context,\n typeDefinition: TypeDefinition\n): ResolvedEntryTypeDefinition {\n // const input = resolveEntryInput(context, typeDefinition);\n\n return {\n ...typeDefinition,\n input: typeDefinition,\n output: resolveEntryOutput(context, typeDefinition)\n };\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport async function resolveEntries(\n context: Context,\n typeDefinitions: Array<TypeDefinitionParameter | ResolvedEntryTypeDefinition>\n): Promise<ResolvedEntryTypeDefinition[]> {\n return (\n await Promise.all(\n typeDefinitions.map(async entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return { ...entry, file: replacePathTokens(context, entry.file) };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.projectRoot);\n if (await context.fs.isFile(filePath)) {\n return resolveEntry(context, {\n file: replacePath(filePath, context.config.projectRoot),\n name: typeDefinition.name\n });\n }\n\n return (\n await context.fs.glob(\n appendPath(filePath, context.workspaceConfig.workspaceRoot)\n )\n ).map(file =>\n resolveEntry(context, {\n file: replacePath(file, context.config.projectRoot),\n name: typeDefinition.name\n })\n );\n })\n )\n )\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Checks if the provided entry is a type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a type definition, false otherwise.\n */\nexport function isTypeDefinition(\n entry: TypeDefinitionParameter\n): entry is TypeDefinition {\n return !isString(entry) && entry.file !== undefined;\n}\n\n/**\n * Checks if the provided entry is a resolved entry type definition.\n *\n * @param entry - The entry to check.\n * @returns True if the entry is a resolved entry type definition, false otherwise.\n */\nexport function isResolvedEntryTypeDefinition(\n entry: TypeDefinitionParameter | ResolvedEntryTypeDefinition\n): entry is ResolvedEntryTypeDefinition {\n return (\n isTypeDefinition(entry) &&\n (entry as ResolvedEntryTypeDefinition).input !== undefined &&\n (entry as ResolvedEntryTypeDefinition).output !== undefined\n );\n}\n\n/**\n * Resolves multiple type definitions into their corresponding resolved entry type definitions.\n *\n * @param context - The current context\n * @param typeDefinitions - The type definitions to resolve.\n * @returns A promise that resolves to an array of resolved entry type definitions.\n */\nexport function resolveEntriesSync(\n context: Context,\n typeDefinitions: Array<TypeDefinitionParameter | ResolvedEntryTypeDefinition>\n): ResolvedEntryTypeDefinition[] {\n return typeDefinitions\n .map(entry => {\n if (isResolvedEntryTypeDefinition(entry)) {\n return { ...entry, file: replacePathTokens(context, entry.file) };\n }\n\n let typeDefinition: TypeDefinition;\n if (isString(entry)) {\n typeDefinition = parseTypeDefinition(\n replacePathTokens(context, entry)\n )!;\n } else {\n typeDefinition = entry;\n typeDefinition.file = replacePathTokens(context, typeDefinition.file);\n }\n\n const filePath = isAbsolutePath(typeDefinition.file)\n ? typeDefinition.file\n : appendPath(typeDefinition.file, context.config.projectRoot);\n if (context.fs.isFileSync(filePath)) {\n return resolveEntry(context, {\n file: replacePath(filePath, context.config.projectRoot),\n name: typeDefinition.name\n });\n }\n\n return context.fs\n .globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot))\n .map(file =>\n resolveEntry(context, {\n file: replacePath(file, context.config.projectRoot),\n name: typeDefinition.name\n })\n );\n })\n .flat()\n .filter(Boolean);\n}\n\n// /** Resolve a virtual entry point by generating a unique file path in the artifacts directory.\n// *\n// * @param context - The current context\n// * @param typeDefinition - The type definition to resolve.\n// * @returns The resolved entry type definition with a unique virtual file path.\n// */\n// export function resolveVirtualEntry(\n// context: Context,\n// typeDefinition: TypeDefinitionParameter\n// ): ResolvedEntryTypeDefinition {\n// const parsed = parseTypeDefinition(typeDefinition)!;\n// const resolved = resolveEntry(context, parsed);\n// const file = joinPaths(\n// context.artifactsPath,\n// `entry-${murmurhash(\n// { file: resolved.file, name: resolved.name },\n// { maxLength: 24 }\n// )\n// .replaceAll(\"-\", \"0\")\n// .replaceAll(\"_\", \"1\")}.ts`\n// );\n\n// return {\n// file,\n// name: resolved.name,\n// input: {\n// file,\n// name: resolved.name\n// },\n// output: file\n// };\n// }\n\n/**\n * Get unique entries from the provided list.\n *\n * @param entries - The entries to process.\n * @returns An array of unique entries (by file path or content hash).\n */\nexport function getUniqueEntries(\n entries: TypeDefinitionParameter | TypeDefinitionParameter[] = []\n): TypeDefinitionParameter[] {\n return getUniqueBy(toArray(entries), (item: TypeDefinitionParameter) =>\n isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 })\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/fs/storage/file-system.ts"],"names":["FileSystemStorageAdapter","BaseStorageAdapter","name","preset","options","existsSync","key","resolve","exists","getSync","readFileSync","get","readFile","setSync","value","isReadOnly","writeFileSync","set","writeFile","removeSync","unlinkSync","err","ignoreNotfound","remove","unlink","catch","mkdirSync","dirPath","createDirectorySync","mkdir","createDirectory","listSync","base","listFilesSync","ignore","list","listFiles","then","r","isDirectorySync","isDirectory","isFile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,OAAOC,gCAAAA,CAAeD,GAAAA,CAAAA,IAAQ,EAAA;AAChC,IAAA;AACF,EAAA;;;;;;;AAQA,EAAA,MAAsBc,KAAKH,IAAAA,EAAkC;AAC3D,IAAA,OAAOI,mBAAAA,CAAU,IAAA,CAAK7B,OAAAA,CAAQyB,IAAAA,CAAAA,EAAO;AACnCE,MAAAA,MAAAA,EAAQ,KAAK9B,OAAAA,CAAQ8B;KACvB,CAAA,CACGT,MAAMH,gCAAAA,CAAAA,CACNe,KAAKC,CAAAA,CAAAA,KAAKA,CAAAA,IAAK,EAAE,CAAA;AACtB,EAAA;;;;;;;AAQgBC,EAAAA,eAAAA,CAAgBjC,GAAAA,EAAsB;AACpD,IAAA,OAAOkC,kBAAAA,CAAY,IAAA,CAAKjC,OAAAA,CAAQD,GAAAA,CAAAA,CAAAA;AAClC,EAAA;;;;;;;AAQgBmC,EAAAA,UAAAA,CAAWnC,GAAAA,EAAsB;AAC/C,IAAA,OAAO,CAACoC,aAAAA,CAAO,IAAA,CAAKnC,OAAAA,CAAQD,GAAAA,CAAAA,CAAAA;AAC9B,EAAA;AACF","file":"chunk-XKEHVYDR.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { exists, existsSync } from \"@stryke/fs/exists\";\nimport { createDirectory, createDirectorySync } from \"@stryke/fs/helpers\";\nimport { isDirectory, isFile } from \"@stryke/fs/is-file\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { readFile, readFileSync } from \"@stryke/fs/read-file\";\nimport { writeFile, writeFileSync } from \"@stryke/fs/write-file\";\nimport { unlinkSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\nimport { ignoreNotfound } from \"../helpers\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\n\nexport type SetSyncOptions = Parameters<typeof writeFileSync>[2];\nexport type SetOptions = Parameters<typeof writeFile>[2];\n\n/**\n * File system storage adapter implementation.\n */\nexport class FileSystemStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"file-system\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"fs\";\n\n /**\n * Constructor for the FileSystemStorageAdapter.\n *\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(options?: StorageAdapterOptions) {\n super(options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return existsSync(this.resolve(key));\n }\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public override async exists(key: string): Promise<boolean> {\n return exists(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return readFileSync(this.resolve(key));\n }\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public override async get(key: string): Promise<string | null> {\n return readFile(this.resolve(key));\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.options.isReadOnly) {\n return writeFileSync(this.resolve(key), value);\n }\n }\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public override async set(key: string, value: string): Promise<void> {\n if (!this.options.isReadOnly) {\n return writeFile(this.resolve(key), value);\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.options.isReadOnly) {\n try {\n return unlinkSync(this.resolve(key));\n } catch (err) {\n return ignoreNotfound(err);\n }\n }\n }\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public override async remove(key: string): Promise<void> {\n if (!this.options.isReadOnly) {\n return unlink(this.resolve(key)).catch(ignoreNotfound);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override mkdirSync(dirPath: string) {\n createDirectorySync(this.resolve(dirPath));\n }\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override async mkdir(dirPath: string): Promise<void> {\n await createDirectory(this.resolve(dirPath));\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n try {\n return listFilesSync(this.resolve(base), {\n ignore: this.options.ignore\n });\n } catch (err) {\n return ignoreNotfound(err) ?? [];\n }\n }\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public override async list(base?: string): Promise<string[]> {\n return listFiles(this.resolve(base), {\n ignore: this.options.ignore\n })\n .catch(ignoreNotfound)\n .then(r => r || []);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public override isDirectorySync(key: string): boolean {\n return isDirectory(this.resolve(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public override isFileSync(key: string): boolean {\n return !isFile(this.resolve(key));\n }\n}\n"]}