powerlines 0.37.62 → 0.37.63

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 (59) 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-YPVXCIVO.js → chunk-46MYUNRY.js} +12 -6
  6. package/dist/{chunk-2D4DO5EB.js → chunk-4OU7TSVU.js} +3 -3
  7. package/dist/{chunk-CU3OVPWB.js → chunk-7B5I5KVD.js} +3 -3
  8. package/dist/{chunk-EDURJN6H.cjs → chunk-7HN4NUEP.cjs} +5 -5
  9. package/dist/{chunk-MIFRMV2M.js → chunk-B6DM5RJL.js} +3 -3
  10. package/dist/chunk-C35YACK3.cjs +12 -0
  11. package/dist/chunk-GRREX4AZ.cjs +12 -0
  12. package/dist/{chunk-W6EJUB3S.cjs → chunk-I63BFWL7.cjs} +12 -6
  13. package/dist/{chunk-IY62R4ON.cjs → chunk-JZOLOGPH.cjs} +4 -4
  14. package/dist/{chunk-4NWPQX5R.js → chunk-LROIIYPX.js} +3 -3
  15. package/dist/{chunk-4XAVV5HA.cjs → chunk-UYI2RSZS.cjs} +4 -4
  16. package/dist/{chunk-GFEZTRXL.js → chunk-ZBPEEQD7.js} +3 -3
  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-NXRMBO47.cjs → chunk-B6IYKQHA.cjs} +12 -6
  24. package/dist/lib/chunk-B6IYKQHA.cjs.map +1 -0
  25. package/dist/lib/{chunk-6CV42PFW.js → chunk-EG5DQURZ.js} +12 -6
  26. package/dist/lib/chunk-EG5DQURZ.js.map +1 -0
  27. package/dist/lib/index.cjs +2 -2
  28. package/dist/lib/index.js +1 -1
  29. package/dist/lib/unplugin/factory.cjs +2 -2
  30. package/dist/lib/unplugin/factory.js +1 -1
  31. package/dist/lib/unplugin/index.cjs +2 -2
  32. package/dist/lib/unplugin/index.js +1 -1
  33. package/dist/next.cjs +4 -4
  34. package/dist/next.js +3 -3
  35. package/dist/nuxt.cjs +8 -8
  36. package/dist/nuxt.js +4 -4
  37. package/dist/rolldown.cjs +6 -6
  38. package/dist/rolldown.js +3 -3
  39. package/dist/rollup.cjs +3 -3
  40. package/dist/rollup.js +2 -2
  41. package/dist/rspack.cjs +3 -3
  42. package/dist/rspack.js +2 -2
  43. package/dist/tsdown.cjs +4 -4
  44. package/dist/tsdown.js +3 -3
  45. package/dist/tsup.cjs +4 -4
  46. package/dist/tsup.js +3 -3
  47. package/dist/unloader.cjs +3 -3
  48. package/dist/unloader.js +2 -2
  49. package/dist/unplugin.cjs +8 -8
  50. package/dist/unplugin.js +4 -4
  51. package/dist/vite.cjs +6 -6
  52. package/dist/vite.js +3 -3
  53. package/dist/webpack.cjs +6 -6
  54. package/dist/webpack.js +3 -3
  55. package/package.json +15 -15
  56. package/dist/chunk-7AJDQVMU.cjs +0 -12
  57. package/dist/chunk-DSRFCFMF.cjs +0 -12
  58. package/dist/lib/chunk-6CV42PFW.js.map +0 -1
  59. package/dist/lib/chunk-NXRMBO47.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../package.json","../../src/plugin-utils/modules.ts","../../src/internal/babel/module-resolver-plugin.ts","../../src/internal/helpers/generate-types.ts","../../src/internal/helpers/hooks.ts","../../src/internal/helpers/install.ts","../../src/internal/helpers/install-dependencies.ts","../../src/internal/helpers/resolve-tsconfig.ts","../../src/api.ts","../../src/lib/unplugin/factory.ts"],"names":["isBuiltinModule","context","moduleName","prefix","config","output","builtinPrefix","framework","startsWith","replace","Object","keys","fs","metadata","filter","key","type","includes","resolveModulePath","nodePath","state","isStringLiteral","node","resolveAll","value","resolvedPath","resolveSync","filename","currentFile","isAbsolutePath","cwd","appendPath","relativePath","findFilePath","replaceWith","stringLiteral","replaceExtension","TRANSFORM_FUNCTIONS","matchesPattern","calleePath","pattern","isMemberExpression","isIdentifier","name","split","importVisitors","CallExpression","moduleResolverVisited","has","get","some","isImport","callee","add","moduleResolverBabelPlugin","options","declare","builder","api","Set","pre","visitor","Program","enter","programPath","traverse","exit","post","clear","getModuleCommentBlockRegex","moduleId","RegExp","formatTypes","code","replaceAll","emitBuiltinTypes","files","length","debug","program","createProgram","skipAddingFilesFromTsConfig","compilerOptions","declaration","declarationMap","emitDeclarationOnly","sourceMap","outDir","replacePath","builtinsPath","workspaceConfig","workspaceRoot","composite","incremental","tsBuildInfoFile","undefined","addSourceFilesAtPaths","result","emitToMemory","emitOnlyDtsFiles","diagnostics","getDiagnostics","d","getCategory","DiagnosticCategory","Error","map","getSourceFile","getFilePath","String","getMessageText","getStart","getLength","join","Warning","warn","emittedFiles","getFiles","builtinModules","emittedFile","trace","filePath","endsWith","findFileName","isParentPath","fullExtension","moduleComment","text","match","find","comment","isSetString","trim","prettyBytes","Blob","toArray","size","mergeResults","createDefu","obj","isString","callHook","args","hooks","selectHooks","log","LogLevelLabel","DEBUG","chalk","bold","cyanBright","order","invokeHook","hook","hookArgs","Reflect","apply","handler","results","sequential","Promise","all","isFunction","asNextParam","push","resolve","isSet","sequenceArgs","isObject","definedResults","mergedResult","defu","installPackage","packageName","dev","isPackageListed","getPackageName","projectRoot","autoInstall","WARN","install","isNumber","exitCode","ERROR","stderr","hasPackageVersion","process","env","POWERLINES_SKIP_VERSION_CHECK","isMatching","doesPackageMatch","getPackageVersion","packageListing","getPackageListing","version","installDependencies","TRACE","dependencies","devDependencies","entries","getTsconfigDtsPath","dtsRelativePath","joinPaths","dtsPath","resolveTsconfigChanges","tsconfig","getParsedTypeScriptConfig","tsconfigRaw","tsconfigFilePath","getTsconfigFilePath","tsconfigJson","readJsonFile","dts","include","filePattern","isIncludeMatchFound","slice","lib","toLowerCase","esModuleInterop","isolatedModules","build","platform","types","initializeTsconfig","isPackageExists","originalTsconfigJson","write","StormJSON","stringify","resolveTsconfig","updateTsconfigJson","Array","isArray","getObjectDiff","ignoreArrayOrder","showOnly","statuses","granularity","changes","getChanges","difference","property","status","diff","field","previous","previousValue","current","currentValue","change","i","whiteBright","titleCase","red","green","PowerlinesAPI","from","PowerlinesAPIContext","$$internal","addPlugin","bind","info","packageJson","plugin","plugins","pluginConfig","environment","getEnvironment","withUserConfig","isHighPriority","prepare","inlineConfig","command","withInlineConfig","entry","title","file","formatLogMessage","userConfig","isSetObject","omit","existsSync","cachePath","createDirectory","dataPath","remove","builtinFilePaths","getBuiltins","transformAsync","toString","highlightCode","ast","cloneInputAst","comments","sourceType","configFile","babelrc","envName","mode","caller","transform","babel","path","id","emitBuiltin","typescriptPath","resolvePackage","reduce","ret","fileName","formatted","directives","previousResult","directive","getFileHeader","prettierIgnore","normalizedDtsRelativePath","includeValue","JSON","formatFolder","entryPath","writeMetaFile","persistedMeta","meta","new","listFiles","powerlinesPath","template","Handlebars","compile","projectType","clean","buildPath","artifactsPath","lint","singleBuild","toEnvironment","docs","deploy","finalize","dispose","Symbol","asyncDispose","outputPath","sourcePath","destinationPath","copy","assets","asset","redBright","input","glob","greenBright","ignore","yellowBright","environments","getEnvironmentSafe","resolvedEnvironment","in","handle","awaited","isPromiseLike","isPluginConfig","invalid","findInvalidPluginConfig","isPlugin","resolved","every","initialized","isPluginConfigTuple","isPluginConfigObject","pluginOptions","checkDedupe","pluginPath","Boolean","splits","isInstalled","paths","error","module","resolver","import","esmResolve","default","isError","message","createUnpluginFactory","variant","decorate","createLog","unplugin","buildStart","getWorkspaceRoot","setParseImpl","parse","resolveId","importer","isEntry","load","getString","writeBundle","FATAL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,SA+vBb,CAAA;;;ACtuBO,SAASA,eAAAA,CAAgBC,SAAkBC,UAAAA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a,MAAMjN,GAAAA,CAAIzD,OAAAA,CAAQ2Q,cAAAA;SACjC,CAAA;AACF,MAAA;AANeqI,MAAAA,MAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA;AAQf,MAAA,MAAM1V,OAAAA,GAAU;QACdZ,IAAAA,EAAM,YAAA;AACNe,QAAAA,GAAAA;QACAkV,SAAAA,EAAW;UACT9X,MAAAA,EAAQ;YACNkS,EAAAA,EAAI;cACF3F,OAAAA,EAAS;AAAC,gBAAA;;AACZ;AACF,WAAA;UACAxD,OAAAA,EAAS+O;AACX,SAAA;QACAG,IAAAA,EAAM;UACJjY,MAAAA,EAAQ;YACNkS,EAAAA,EAAI;cACF3F,OAAAA,EAAS;AAAC,gBAAA,IAAA;AAAM,gBAAA;;AAClB;AACF,WAAA;UACAxD,OAAAA,EAASkP;AACX,SAAA;AACAlG,QAAAA,SAAAA;AACA2F,QAAAA,UAAAA;AACAS,QAAAA;AACF,OAAA;AAEA,MAAA,MAAMhT,MAAAA,GAASoS,QAAAA,GAAWA,QAAAA,CAAS3U,GAAAA,EAAKH,OAAAA,CAAAA,GAAWA,OAAAA;AAEnD0F,MAAAA,GAAAA,CAAIC,aAAAA,CAAcC,OAAO,oCAAA,CAAA;AAEzB,MAAA,OAAO;AAAEzF,QAAAA,GAAAA;QAAK,GAAGuC;AAAO,OAAA;AAC1B,IAAA,CAAA,CAAA,OAAS0R,KAAAA,EAAO;AACd1O,MAAAA,GAAAA,CAAIC,aAAAA,CAAcgQ,KAAAA,EAAQvB,KAAAA,EAAiBO,OAAAA,CAAAA;AAE3C,MAAA,MAAMP,KAAAA;AACR,IAAA;AACF,EAAA,CAAA;AACF;AAhJgBQ,MAAAA,CAAAA,qBAAAA,EAAAA,uBAAAA,CAAAA","file":"chunk-EG5DQURZ.js","sourcesContent":["{\n \"name\": \"powerlines\",\n \"version\": \"0.37.62\",\n \"type\": \"module\",\n \"description\": \"The \\\"any framework\\\" framework that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.\",\n \"repository\": {\n \"type\": \"github\",\n \"url\": \"https://github.com/storm-software/powerlines.git\",\n \"directory\": \"packages/powerlines\"\n },\n \"homepage\": \"https://stormsoftware.com\",\n \"bugs\": {\n \"url\": \"https://stormsoftware.com/support\",\n \"email\": \"support@stormsoftware.com\"\n },\n \"author\": {\n \"name\": \"Storm Software\",\n \"email\": \"contact@stormsoftware.com\",\n \"url\": \"https://stormsoftware.com\"\n },\n \"maintainers\": [\n {\n \"name\": \"Storm Software\",\n \"email\": \"contact@stormsoftware.com\",\n \"url\": \"https://stormsoftware.com\"\n }\n ],\n \"contributors\": [\n {\n \"name\": \"Storm Software\",\n \"email\": \"contact@stormsoftware.com\",\n \"url\": \"https://stormsoftware.com\"\n }\n ],\n \"funding\": {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/storm-software\"\n },\n \"license\": \"Apache-2.0\",\n \"private\": false,\n \"exports\": {\n \"./package.json\": \"./package.json\",\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./index\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./types\": {\n \"import\": {\n \"types\": \"./dist/types/index.d.ts\",\n \"default\": \"./dist/types/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/types/index.d.cts\",\n \"default\": \"./dist/types/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/types/index.d.ts\",\n \"default\": \"./dist/types/index.js\"\n }\n },\n \"./types/*\": {\n \"import\": {\n \"types\": \"./dist/types/*.d.ts\",\n \"default\": \"./dist/types/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/types/*.d.cts\",\n \"default\": \"./dist/types/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/types/*.d.ts\",\n \"default\": \"./dist/types/*.js\"\n }\n },\n \"./astro\": {\n \"import\": {\n \"types\": \"./dist/astro.d.ts\",\n \"default\": \"./dist/astro.js\"\n },\n \"require\": {\n \"types\": \"./dist/astro.d.cts\",\n \"default\": \"./dist/astro.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/astro.d.ts\",\n \"default\": \"./dist/astro.js\"\n }\n },\n \"./esbuild\": {\n \"import\": {\n \"types\": \"./dist/esbuild.d.ts\",\n \"default\": \"./dist/esbuild.js\"\n },\n \"require\": {\n \"types\": \"./dist/esbuild.d.cts\",\n \"default\": \"./dist/esbuild.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/esbuild.d.ts\",\n \"default\": \"./dist/esbuild.js\"\n }\n },\n \"./nuxt\": {\n \"import\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"default\": \"./dist/nuxt.js\"\n },\n \"require\": {\n \"types\": \"./dist/nuxt.d.cts\",\n \"default\": \"./dist/nuxt.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"default\": \"./dist/nuxt.js\"\n }\n },\n \"./next\": {\n \"import\": {\n \"types\": \"./dist/next.d.ts\",\n \"default\": \"./dist/next.js\"\n },\n \"require\": {\n \"types\": \"./dist/next.d.cts\",\n \"default\": \"./dist/next.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/next.d.ts\",\n \"default\": \"./dist/next.js\"\n }\n },\n \"./rollup\": {\n \"import\": {\n \"types\": \"./dist/rollup.d.ts\",\n \"default\": \"./dist/rollup.js\"\n },\n \"require\": {\n \"types\": \"./dist/rollup.d.cts\",\n \"default\": \"./dist/rollup.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/rollup.d.ts\",\n \"default\": \"./dist/rollup.js\"\n }\n },\n \"./rolldown\": {\n \"import\": {\n \"types\": \"./dist/rolldown.d.ts\",\n \"default\": \"./dist/rolldown.js\"\n },\n \"require\": {\n \"types\": \"./dist/rolldown.d.cts\",\n \"default\": \"./dist/rolldown.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/rolldown.d.ts\",\n \"default\": \"./dist/rolldown.js\"\n }\n },\n \"./rspack\": {\n \"import\": {\n \"types\": \"./dist/rspack.d.ts\",\n \"default\": \"./dist/rspack.js\"\n },\n \"require\": {\n \"types\": \"./dist/rspack.d.cts\",\n \"default\": \"./dist/rspack.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/rspack.d.ts\",\n \"default\": \"./dist/rspack.js\"\n }\n },\n \"./tsdown\": {\n \"import\": {\n \"types\": \"./dist/tsdown.d.ts\",\n \"default\": \"./dist/tsdown.js\"\n },\n \"require\": {\n \"types\": \"./dist/tsdown.d.cts\",\n \"default\": \"./dist/tsdown.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/tsdown.d.ts\",\n \"default\": \"./dist/tsdown.js\"\n }\n },\n \"./tsup\": {\n \"import\": {\n \"types\": \"./dist/tsup.d.ts\",\n \"default\": \"./dist/tsup.js\"\n },\n \"require\": {\n \"types\": \"./dist/tsup.d.cts\",\n \"default\": \"./dist/tsup.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/tsup.d.ts\",\n \"default\": \"./dist/tsup.js\"\n }\n },\n \"./unloader\": {\n \"import\": {\n \"types\": \"./dist/unloader.d.ts\",\n \"default\": \"./dist/unloader.js\"\n },\n \"require\": {\n \"types\": \"./dist/unloader.d.cts\",\n \"default\": \"./dist/unloader.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/unloader.d.ts\",\n \"default\": \"./dist/unloader.js\"\n }\n },\n \"./unplugin\": {\n \"import\": {\n \"types\": \"./dist/unplugin.d.ts\",\n \"default\": \"./dist/unplugin.js\"\n },\n \"require\": {\n \"types\": \"./dist/unplugin.d.cts\",\n \"default\": \"./dist/unplugin.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/unplugin.d.ts\",\n \"default\": \"./dist/unplugin.js\"\n }\n },\n \"./vite\": {\n \"import\": {\n \"types\": \"./dist/vite.d.ts\",\n \"default\": \"./dist/vite.js\"\n },\n \"require\": {\n \"types\": \"./dist/vite.d.cts\",\n \"default\": \"./dist/vite.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/vite.d.ts\",\n \"default\": \"./dist/vite.js\"\n }\n },\n \"./webpack\": {\n \"import\": {\n \"types\": \"./dist/webpack.d.ts\",\n \"default\": \"./dist/webpack.js\"\n },\n \"require\": {\n \"types\": \"./dist/webpack.d.cts\",\n \"default\": \"./dist/webpack.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/webpack.d.ts\",\n \"default\": \"./dist/webpack.js\"\n }\n },\n \"./api\": {\n \"import\": {\n \"types\": \"./dist/api.d.ts\",\n \"default\": \"./dist/api.js\"\n },\n \"require\": {\n \"types\": \"./dist/api.d.cts\",\n \"default\": \"./dist/api.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/api.d.ts\",\n \"default\": \"./dist/api.js\"\n }\n },\n \"./lib\": {\n \"import\": {\n \"types\": \"./dist/lib/index.d.ts\",\n \"default\": \"./dist/lib/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/index.d.cts\",\n \"default\": \"./dist/lib/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/index.d.ts\",\n \"default\": \"./dist/lib/index.js\"\n }\n },\n \"./lib/*\": {\n \"import\": {\n \"types\": \"./dist/lib/*.d.ts\",\n \"default\": \"./dist/lib/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/*.d.cts\",\n \"default\": \"./dist/lib/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/*.d.ts\",\n \"default\": \"./dist/lib/*.js\"\n }\n },\n \"./lib/constants\": {\n \"import\": {\n \"types\": \"./dist/lib/constants/index.d.ts\",\n \"default\": \"./dist/lib/constants/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/constants/index.d.cts\",\n \"default\": \"./dist/lib/constants/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/constants/index.d.ts\",\n \"default\": \"./dist/lib/constants/index.js\"\n }\n },\n \"./lib/constants/*\": {\n \"import\": {\n \"types\": \"./dist/lib/constants/*.d.ts\",\n \"default\": \"./dist/lib/constants/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/constants/*.d.cts\",\n \"default\": \"./dist/lib/constants/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/constants/*.d.ts\",\n \"default\": \"./dist/lib/constants/*.js\"\n }\n },\n \"./lib/contexts\": {\n \"import\": {\n \"types\": \"./dist/lib/contexts/index.d.ts\",\n \"default\": \"./dist/lib/contexts/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/contexts/index.d.cts\",\n \"default\": \"./dist/lib/contexts/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/contexts/index.d.ts\",\n \"default\": \"./dist/lib/contexts/index.js\"\n }\n },\n \"./lib/contexts/*\": {\n \"import\": {\n \"types\": \"./dist/lib/contexts/*.d.ts\",\n \"default\": \"./dist/lib/contexts/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/contexts/*.d.cts\",\n \"default\": \"./dist/lib/contexts/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/contexts/*.d.ts\",\n \"default\": \"./dist/lib/contexts/*.js\"\n }\n },\n \"./lib/build\": {\n \"import\": {\n \"types\": \"./dist/lib/build/index.d.ts\",\n \"default\": \"./dist/lib/build/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/build/index.d.cts\",\n \"default\": \"./dist/lib/build/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/build/index.d.ts\",\n \"default\": \"./dist/lib/build/index.js\"\n }\n },\n \"./lib/build/*\": {\n \"import\": {\n \"types\": \"./dist/lib/build/*.d.ts\",\n \"default\": \"./dist/lib/build/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/build/*.d.cts\",\n \"default\": \"./dist/lib/build/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/build/*.d.ts\",\n \"default\": \"./dist/lib/build/*.js\"\n }\n },\n \"./lib/fs\": {\n \"import\": {\n \"types\": \"./dist/lib/fs/index.d.ts\",\n \"default\": \"./dist/lib/fs/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/fs/index.d.cts\",\n \"default\": \"./dist/lib/fs/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/fs/index.d.ts\",\n \"default\": \"./dist/lib/fs/index.js\"\n }\n },\n \"./lib/fs/*\": {\n \"import\": {\n \"types\": \"./dist/lib/fs/*.d.ts\",\n \"default\": \"./dist/lib/fs/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/fs/*.d.cts\",\n \"default\": \"./dist/lib/fs/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/fs/*.d.ts\",\n \"default\": \"./dist/lib/fs/*.js\"\n }\n },\n \"./lib/fs/storage\": {\n \"import\": {\n \"types\": \"./dist/lib/fs/storage/index.d.ts\",\n \"default\": \"./dist/lib/fs/storage/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/fs/storage/index.d.cts\",\n \"default\": \"./dist/lib/fs/storage/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/fs/storage/index.d.ts\",\n \"default\": \"./dist/lib/fs/storage/index.js\"\n }\n },\n \"./lib/fs/storage/*\": {\n \"import\": {\n \"types\": \"./dist/lib/fs/storage/*.d.ts\",\n \"default\": \"./dist/lib/fs/storage/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/fs/storage/*.d.cts\",\n \"default\": \"./dist/lib/fs/storage/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/fs/storage/*.d.ts\",\n \"default\": \"./dist/lib/fs/storage/*.js\"\n }\n },\n \"./lib/typescript\": {\n \"import\": {\n \"types\": \"./dist/lib/typescript/index.d.ts\",\n \"default\": \"./dist/lib/typescript/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/typescript/index.d.cts\",\n \"default\": \"./dist/lib/typescript/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/typescript/index.d.ts\",\n \"default\": \"./dist/lib/typescript/index.js\"\n }\n },\n \"./lib/typescript/*\": {\n \"import\": {\n \"types\": \"./dist/lib/typescript/*.d.ts\",\n \"default\": \"./dist/lib/typescript/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/typescript/*.d.cts\",\n \"default\": \"./dist/lib/typescript/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/typescript/*.d.ts\",\n \"default\": \"./dist/lib/typescript/*.js\"\n }\n },\n \"./lib/unplugin\": {\n \"import\": {\n \"types\": \"./dist/lib/unplugin/index.d.ts\",\n \"default\": \"./dist/lib/unplugin/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/unplugin/index.d.cts\",\n \"default\": \"./dist/lib/unplugin/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/unplugin/index.d.ts\",\n \"default\": \"./dist/lib/unplugin/index.js\"\n }\n },\n \"./lib/unplugin/*\": {\n \"import\": {\n \"types\": \"./dist/lib/unplugin/*.d.ts\",\n \"default\": \"./dist/lib/unplugin/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/unplugin/*.d.cts\",\n \"default\": \"./dist/lib/unplugin/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/unplugin/*.d.ts\",\n \"default\": \"./dist/lib/unplugin/*.js\"\n }\n },\n \"./lib/utilities\": {\n \"import\": {\n \"types\": \"./dist/lib/utilities/index.d.ts\",\n \"default\": \"./dist/lib/utilities/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/utilities/index.d.cts\",\n \"default\": \"./dist/lib/utilities/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/utilities/index.d.ts\",\n \"default\": \"./dist/lib/utilities/index.js\"\n }\n },\n \"./lib/utilities/*\": {\n \"import\": {\n \"types\": \"./dist/lib/utilities/*.d.ts\",\n \"default\": \"./dist/lib/utilities/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/lib/utilities/*.d.cts\",\n \"default\": \"./dist/lib/utilities/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/lib/utilities/*.d.ts\",\n \"default\": \"./dist/lib/utilities/*.js\"\n }\n },\n \"./plugin-utils\": {\n \"import\": {\n \"types\": \"./dist/plugin-utils/index.d.ts\",\n \"default\": \"./dist/plugin-utils/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/plugin-utils/index.d.cts\",\n \"default\": \"./dist/plugin-utils/index.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/plugin-utils/index.d.ts\",\n \"default\": \"./dist/plugin-utils/index.js\"\n }\n },\n \"./plugin-utils/*\": {\n \"import\": {\n \"types\": \"./dist/plugin-utils/*.d.ts\",\n \"default\": \"./dist/plugin-utils/*.js\"\n },\n \"require\": {\n \"types\": \"./dist/plugin-utils/*.d.cts\",\n \"default\": \"./dist/plugin-utils/*.cjs\"\n },\n \"default\": {\n \"types\": \"./dist/plugin-utils/*.d.ts\",\n \"default\": \"./dist/plugin-utils/*.js\"\n }\n },\n \"./files/common/*\": \"./dist/files/common/*\",\n \"./files/library/*\": \"./dist/files/library/*\",\n \"./files/application/*\": \"./dist/files/application/*\",\n \"./schemas/*\": \"./dist/schemas/*\"\n },\n \"types\": \"dist/index.d.ts\",\n \"typings\": \"dist/index.d.ts\",\n \"files\": [\"dist/**/*\", \"files/**/*\", \"schemas/**/*\"],\n \"keywords\": [\n \"powerlines\",\n \"storm-software\",\n \"unplugin\",\n \"typescript\",\n \"dotenv\",\n \"babel\",\n \"esbuild\",\n \"unbuild\",\n \"nuxt\",\n \"vite\",\n \"rollup\",\n \"rspack\",\n \"webpack\",\n \"astro\"\n ],\n \"peerDependencies\": {\n \"@farmfe/cli\": \"^1.0.5\",\n \"@farmfe/core\": \"^1.7.11\",\n \"@nuxt/kit\": \"^4.1.1\",\n \"@nuxt/schema\": \"^4.1.1\",\n \"@rspack/cli\": \"^1.5.0\",\n \"@rspack/core\": \"^1.5.0\",\n \"astro\": \"^5.13.5\",\n \"esbuild\": \"^0.27.0\",\n \"next\": \"^15.5.4\",\n \"rolldown\": \"^1.0.0-beta.51\",\n \"rollup\": \"^4.46.4\",\n \"tsdown\": \"^0.17.0-beta.4\",\n \"tsup\": \"8.4.0\",\n \"unbuild\": \"^3.5.0\",\n \"unloader\": \"^0.5.0\",\n \"vite\": \"^8.0.0-beta.2\",\n \"webpack\": \"^5.101.3\",\n \"webpack-cli\": \"^6.0.1\"\n },\n \"peerDependenciesMeta\": {\n \"@farmfe/cli\": {\n \"optional\": true\n },\n \"@farmfe/core\": {\n \"optional\": true\n },\n \"@nuxt/kit\": {\n \"optional\": true\n },\n \"@nuxt/schema\": {\n \"optional\": true\n },\n \"@rspack/cli\": {\n \"optional\": true\n },\n \"@rspack/core\": {\n \"optional\": true\n },\n \"astro\": {\n \"optional\": true\n },\n \"esbuild\": {\n \"optional\": true\n },\n \"next\": {\n \"optional\": true\n },\n \"rolldown\": {\n \"optional\": true\n },\n \"rollup\": {\n \"optional\": true\n },\n \"tsup\": {\n \"optional\": true\n },\n \"unbuild\": {\n \"optional\": true\n },\n \"unloader\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n },\n \"webpack\": {\n \"optional\": true\n },\n \"webpack-cli\": {\n \"optional\": true\n }\n },\n \"dependencies\": {\n \"@alloy-js/babel-plugin\": \"catalog:\",\n \"@alloy-js/babel-plugin-jsx-dom-expressions\": \"catalog:\",\n \"@babel/core\": \"catalog:\",\n \"@babel/generator\": \"catalog:\",\n \"@babel/helper-module-imports\": \"catalog:\",\n \"@babel/helper-module-transforms\": \"catalog:\",\n \"@babel/helper-plugin-utils\": \"catalog:\",\n \"@babel/helper-simple-access\": \"catalog:\",\n \"@babel/parser\": \"catalog:\",\n \"@babel/plugin-proposal-decorators\": \"catalog:\",\n \"@babel/plugin-syntax-class-properties\": \"catalog:\",\n \"@babel/plugin-syntax-import-assertions\": \"catalog:\",\n \"@babel/plugin-syntax-jsx\": \"catalog:\",\n \"@babel/plugin-syntax-typescript\": \"catalog:\",\n \"@babel/plugin-transform-export-namespace-from\": \"catalog:\",\n \"@babel/plugin-transform-react-jsx\": \"catalog:\",\n \"@babel/plugin-transform-typescript\": \"catalog:\",\n \"@babel/preset-typescript\": \"catalog:\",\n \"@babel/template\": \"catalog:\",\n \"@babel/traverse\": \"catalog:\",\n \"@babel/types\": \"catalog:\",\n \"@cacheable/memory\": \"catalog:\",\n \"@donedeal0/superdiff\": \"catalog:\",\n \"@microsoft/api-extractor\": \"catalog:\",\n \"@microsoft/tsdoc-config\": \"catalog:\",\n \"@rollup/plugin-alias\": \"catalog:\",\n \"@rollup/plugin-babel\": \"catalog:\",\n \"@rollup/plugin-inject\": \"catalog:\",\n \"@rollup/plugin-node-resolve\": \"catalog:\",\n \"@rollup/plugin-replace\": \"catalog:\",\n \"@storm-software/build-tools\": \"catalog:\",\n \"@storm-software/config\": \"catalog:\",\n \"@storm-software/config-tools\": \"catalog:\",\n \"@storm-software/esbuild\": \"catalog:\",\n \"@storm-software/tsup\": \"catalog:\",\n \"@storm-software/unbuild\": \"catalog:\",\n \"@stryke/capnp\": \"catalog:\",\n \"@stryke/convert\": \"catalog:\",\n \"@stryke/env\": \"catalog:\",\n \"@stryke/fs\": \"catalog:\",\n \"@stryke/hash\": \"catalog:\",\n \"@stryke/helpers\": \"catalog:\",\n \"@stryke/http\": \"catalog:\",\n \"@stryke/json\": \"catalog:\",\n \"@stryke/path\": \"catalog:\",\n \"@stryke/string-format\": \"catalog:\",\n \"@stryke/type-checks\": \"catalog:\",\n \"@stryke/unique-id\": \"catalog:\",\n \"@typescript-eslint/utils\": \"catalog:\",\n \"babel-dead-code-elimination\": \"catalog:\",\n \"babel-plugin-parameter-decorator\": \"catalog:\",\n \"bundle-require\": \"catalog:\",\n \"c12\": \"catalog:\",\n \"chalk\": \"catalog:\",\n \"compatx\": \"catalog:\",\n \"defu\": \"catalog:\",\n \"diff-match-patch\": \"catalog:\",\n \"esbuild\": \"catalog:\",\n \"flat-cache\": \"catalog:\",\n \"github-slugger\": \"catalog:\",\n \"handlebars\": \"catalog:\",\n \"jest-worker\": \"catalog:\",\n \"jiti\": \"catalog:\",\n \"magic-string\": \"catalog:\",\n \"oxc-parser\": \"catalog:\",\n \"prettier\": \"catalog:\",\n \"rollup-plugin-typescript2\": \"catalog:\",\n \"ts-morph\": \"catalog:\",\n \"undici\": \"catalog:\",\n \"unimport\": \"catalog:\",\n \"unplugin\": \"catalog:\",\n \"vite\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@microsoft/tsdoc\": \"catalog:\",\n \"@storm-software/testing-tools\": \"catalog:\",\n \"@stryke/types\": \"catalog:\",\n \"@types/babel__core\": \"catalog:\",\n \"@types/babel__helper-module-imports\": \"catalog:\",\n \"@types/babel__helper-plugin-utils\": \"catalog:\",\n \"@types/babel__template\": \"catalog:\",\n \"@types/babel__traverse\": \"catalog:\",\n \"@types/bun\": \"catalog:\",\n \"@types/diff-match-patch\": \"catalog:\",\n \"@types/node\": \"catalog:\",\n \"@types/semver\": \"catalog:\",\n \"bun-types-no-globals\": \"catalog:\",\n \"eslint\": \"catalog:\",\n \"minimatch\": \"catalog:\",\n \"tsdown\": \"catalog:\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"^5.9.3\",\n \"undici-types\": \"catalog:\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","/* -------------------------------------------------------------------\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 { Context } from \"../types/context\";\n\n/**\n * Determine if a module ID is a built-in Powerlines module ID.\n *\n * @param context - The Powerlines context.\n * @param moduleName - The name of the module to check.\n * @returns `true` if the module is a built-in module, otherwise `false`.\n */\nexport function isBuiltinModule(context: Context, moduleName: string): boolean {\n const prefix: string =\n context.config.output?.builtinPrefix ||\n context.config?.framework ||\n \"powerlines\";\n\n return (\n moduleName.startsWith(`${prefix.replace(/:$/, \"\")}:`) ||\n Object.keys(context.fs.metadata)\n .filter(key => context.fs.metadata[key]?.type === \"builtin\")\n .includes(moduleName)\n );\n}\n","/* -------------------------------------------------------------------\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 { NodePath, PluginPass, Visitor } from \"@babel/core\";\nimport { BabelAPI, declare } from \"@babel/helper-plugin-utils\";\nimport * as t from \"@babel/types\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFilePath, relativePath } from \"@stryke/path/file-path-fns\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { isBuiltinModule } from \"../../plugin-utils/modules\";\nimport { Context } from \"../../types/context\";\n\ntype ModuleResolverPluginPass = PluginPass & {\n context: Context;\n moduleResolverVisited: Set<any>;\n api: BabelAPI;\n resolveAll: boolean;\n};\n\nfunction resolveModulePath(\n nodePath: NodePath<t.StringLiteral | null | undefined>,\n state: ModuleResolverPluginPass\n) {\n if (\n !t.isStringLiteral(nodePath.node) ||\n (!state.resolveAll && !isBuiltinModule(state.context, nodePath.node.value))\n ) {\n return;\n }\n\n let resolvedPath = state.context?.fs.resolveSync(nodePath.node.value);\n if (resolvedPath) {\n if (state.filename) {\n const currentFile = state.context?.fs.resolveSync(\n !isAbsolutePath(state.filename) && state.cwd\n ? appendPath(state.filename, state.cwd)\n : state.filename\n );\n if (currentFile && isAbsolutePath(currentFile)) {\n resolvedPath = `./${relativePath(findFilePath(currentFile), resolvedPath)}`;\n }\n\n nodePath.replaceWith(t.stringLiteral(replaceExtension(resolvedPath)));\n }\n }\n}\n\nconst TRANSFORM_FUNCTIONS = [\n \"require\",\n \"require.resolve\",\n \"System.import\",\n\n // Jest methods\n \"jest.genMockFromModule\",\n \"jest.mock\",\n \"jest.unmock\",\n \"jest.doMock\",\n // eslint-disable-next-line @cspell/spellchecker\n \"jest.dontMock\",\n \"jest.setMock\",\n \"jest.requireActual\",\n \"jest.requireMock\",\n\n // Older Jest methods\n \"require.requireActual\",\n \"require.requireMock\"\n];\n\nfunction matchesPattern(\n state: ModuleResolverPluginPass,\n calleePath: NodePath,\n pattern: string\n) {\n const { node } = calleePath;\n\n if (t.isMemberExpression(node)) {\n return calleePath.matchesPattern(pattern);\n }\n\n if (!t.isIdentifier(node) || pattern.includes(\".\")) {\n return false;\n }\n\n const name = pattern.split(\".\")[0];\n\n return node.name === name;\n}\n\nconst importVisitors = {\n CallExpression: (\n nodePath: NodePath<t.CallExpression>,\n state: ModuleResolverPluginPass\n ) => {\n if (state.moduleResolverVisited.has(nodePath)) {\n return;\n }\n\n const calleePath = nodePath.get(\"callee\");\n if (\n (calleePath &&\n TRANSFORM_FUNCTIONS.some(pattern =>\n matchesPattern(state, calleePath, pattern)\n )) ||\n t.isImport(nodePath.node.callee)\n ) {\n state.moduleResolverVisited.add(nodePath);\n resolveModulePath(\n nodePath.get(\"arguments.0\") as NodePath<t.StringLiteral>,\n state\n );\n }\n },\n // eslint-disable-next-line ts/naming-convention\n \"ImportDeclaration|ExportDeclaration|ExportAllDeclaration\": (\n nodePath: NodePath<\n t.ImportDeclaration | t.ExportDeclaration | t.ExportAllDeclaration\n >,\n state: ModuleResolverPluginPass\n ) => {\n if (\n !nodePath ||\n !nodePath.get(\"source\") ||\n state.moduleResolverVisited.has(nodePath)\n ) {\n return;\n }\n\n state.moduleResolverVisited.add(nodePath);\n resolveModulePath(nodePath.get(\"source\"), state);\n }\n} as Visitor<ModuleResolverPluginPass>;\n\nexport interface ModuleResolverBabelPluginOptions {\n /**\n * Whether to resolve all module paths, including non-builtin modules.\n *\n * @default false\n */\n resolveAll?: boolean;\n}\n\n/**\n * Babel plugin to resolve module paths for built-in Powerlines modules.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the plugin.\n * @returns A Babel plugin object.\n */\nexport const moduleResolverBabelPlugin = (\n context: Context,\n options?: ModuleResolverBabelPluginOptions\n) => {\n return declare(function builder(api: BabelAPI) {\n let moduleResolverVisited = new Set();\n\n return {\n name: \"powerlines:module-resolver\",\n\n pre() {\n // We need to keep track of all handled nodes so we do not try to transform them twice,\n // because we run before (enter) and after (exit) all nodes are handled\n moduleResolverVisited = new Set();\n },\n\n visitor: {\n Program: {\n enter(programPath: NodePath<t.Program>, state: PluginPass) {\n programPath.traverse(importVisitors, {\n ...state,\n context,\n moduleResolverVisited,\n api,\n resolveAll: options?.resolveAll ?? false\n } as ModuleResolverPluginPass);\n },\n exit(programPath, state) {\n programPath.traverse(importVisitors, {\n ...state,\n context,\n moduleResolverVisited,\n api,\n resolveAll: options?.resolveAll ?? false\n } as ModuleResolverPluginPass);\n }\n }\n },\n\n post() {\n moduleResolverVisited.clear();\n }\n };\n });\n};\n","/* -------------------------------------------------------------------\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 { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { prettyBytes } from \"@stryke/string-format/pretty-bytes\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { DiagnosticCategory } from \"ts-morph\";\nimport { createProgram } from \"../../lib/typescript/ts-morph\";\nimport { Context } from \"../../types/context\";\n\nconst getModuleCommentBlockRegex = (moduleId: string) =>\n new RegExp(`^\\\\/\\\\*\\\\*(?s:.)*@module ${moduleId}(?s:.)*\\\\*\\\\/\\\\s*`);\n\n/**\n * Formats the generated TypeScript types source code.\n *\n * @param code - The generated TypeScript code.\n * @returns The formatted TypeScript code.\n */\nexport function formatTypes(code: string): string {\n return code\n .replace(\n // eslint-disable-next-line regexp/no-super-linear-backtracking\n /import\\s*(?:type\\s*)?\\{?[\\w,\\s]*(?:\\}\\s*)?from\\s*(?:'|\")@?[a-zA-Z0-9-\\\\/.]*(?:'|\");?/g,\n \"\"\n )\n .replaceAll(\"#private;\", \"\")\n .replace(/__Ω/g, \"\");\n}\n\n/**\n * Emits TypeScript declaration types for the provided files using the given TypeScript configuration.\n *\n * @param context - The context containing options and environment paths.\n * @param files - The list of files to generate types for.\n * @returns A promise that resolves to the generated TypeScript declaration types.\n */\nexport async function emitBuiltinTypes<TContext extends Context>(\n context: TContext,\n files: string[]\n) {\n if (files.length === 0) {\n context.debug(\n \"No files provided for TypeScript types generation. Typescript compilation for built-in modules will be skipped.\"\n );\n return \"\";\n }\n\n context.debug(\n `Running the TypeScript compiler for ${\n files.length\n } generated built-in module files.`\n );\n\n const program = createProgram(context, {\n skipAddingFilesFromTsConfig: true,\n compilerOptions: {\n declaration: true,\n declarationMap: false,\n emitDeclarationOnly: true,\n sourceMap: false,\n outDir: replacePath(\n context.builtinsPath,\n context.workspaceConfig.workspaceRoot\n ),\n composite: false,\n incremental: false,\n tsBuildInfoFile: undefined\n }\n });\n\n program.addSourceFilesAtPaths(files);\n const result = program.emitToMemory({ emitOnlyDtsFiles: true });\n\n const diagnostics = result.getDiagnostics();\n if (diagnostics && diagnostics.length > 0) {\n if (diagnostics.some(d => d.getCategory() === DiagnosticCategory.Error)) {\n throw new Error(\n `The Typescript emit process failed while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Error)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else if (\n diagnostics.some(d => d.getCategory() === DiagnosticCategory.Warning)\n ) {\n context.warn(\n `The Typescript emit process completed with warnings while generating built-in types: \\n ${diagnostics\n .filter(d => d.getCategory() === DiagnosticCategory.Warning)\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n } else {\n context.debug(\n `The Typescript emit process completed with diagnostic messages while generating built-in types: \\n ${diagnostics\n .map(\n d =>\n `-${d.getSourceFile() ? `${d.getSourceFile()?.getFilePath()}:` : \"\"} ${String(\n d.getMessageText()\n )} (at ${d.getStart()}:${d.getLength()})`\n )\n .join(\"\\n\")}`\n );\n }\n }\n\n const emittedFiles = result.getFiles();\n context.debug(\n `The TypeScript compiler emitted ${emittedFiles.length} files for built-in types.`\n );\n\n let builtinModules = \"\";\n for (const emittedFile of emittedFiles) {\n context.trace(\n `Processing emitted type declaration file: ${emittedFile.filePath}`\n );\n\n const filePath = appendPath(\n emittedFile.filePath,\n context.workspaceConfig.workspaceRoot\n );\n\n if (\n !filePath.endsWith(\".map\") &&\n findFileName(filePath) !== \"tsconfig.tsbuildinfo\" &&\n isParentPath(filePath, context.builtinsPath)\n ) {\n const moduleId = `${\n context.config.output?.builtinPrefix ||\n context.config?.framework ||\n \"powerlines\"\n }:${replaceExtension(replacePath(filePath, context.builtinsPath), \"\", {\n fullExtension: true\n })}`;\n const moduleComment = emittedFile.text\n .match(getModuleCommentBlockRegex(moduleId))\n ?.find(comment => isSetString(comment?.trim()));\n\n builtinModules += `${moduleComment ? `\\n${moduleComment.trim()}` : \"\"}\ndeclare module \"${moduleId}\" {\n ${emittedFile.text\n .replace(moduleComment ?? \"\", \"\")\n .trim()\n .replace(/^\\s*export\\s*declare\\s*/gm, \"export \")\n .replace(/^\\s*declare\\s*/gm, \"\")}\n}\n`;\n }\n }\n\n builtinModules = formatTypes(builtinModules);\n context.debug(\n `A TypeScript declaration file (size: ${prettyBytes(\n new Blob(toArray(builtinModules)).size\n )}) emitted for the built-in modules types.`\n );\n\n return builtinModules;\n}\n","/* -------------------------------------------------------------------\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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { ArrayValues } from \"@stryke/types/array\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport { createDefu, defu } from \"defu\";\nimport {\n EnvironmentContext,\n PluginContext,\n SelectHooksOptions\n} from \"../../types/context\";\nimport { InferHookParameters, InferHookReturnType } from \"../../types/hooks\";\nimport { ResolvedConfig } from \"../../types/resolved\";\n\nexport type CallHookOptions = SelectHooksOptions &\n (\n | ({\n /**\n * Whether to call the hooks sequentially or in parallel.\n *\n * @defaultValue true\n */\n sequential?: true;\n } & (\n | {\n /**\n * How to handle multiple return values from hooks.\n * - \"merge\": Merge all non-undefined return values (if they are objects).\n * - \"first\": Return the first non-undefined value.\n *\n * @remarks\n * Merging only works if the return values are objects.\n *\n * @defaultValue \"merge\"\n */\n result: \"first\";\n }\n | {\n /**\n * How to handle multiple return values from hooks.\n * - \"merge\": Merge all non-undefined return values (if they are objects).\n * - \"first\": Return the first non-undefined value.\n *\n * @remarks\n * Merging only works if the return values are objects.\n *\n * @defaultValue \"merge\"\n */\n result?: \"merge\" | \"last\";\n\n /**\n * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter\n */\n asNextParam?: false | ((previousResult: any) => MaybePromise<any>);\n }\n ))\n | {\n /**\n * Whether to call the hooks sequentially or in parallel.\n */\n sequential: false;\n }\n );\n\nconst mergeResults = createDefu(<T>(obj: T, key: keyof T, value: any) => {\n if (isString(obj[key]) && isString(value)) {\n obj[key] = `${obj[key] || \"\"}\\n${value || \"\"}`.trim() as T[keyof T];\n\n return true;\n }\n\n return false;\n});\n\n/**\n * Calls a hook with the given context, options, and arguments.\n *\n * @param context - The context to use when calling the hook.\n * @param key - The hook to call.\n * @param options - Options for calling the hook.\n * @param args - Arguments to pass to the hook.\n * @returns The return value of the hook.\n */\nexport async function callHook<\n TResolvedConfig extends ResolvedConfig,\n TKey extends string\n>(\n context: EnvironmentContext<TResolvedConfig>,\n key: TKey,\n options: CallHookOptions,\n ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>\n): Promise<\n InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined\n> {\n const hooks = context.selectHooks(key, options);\n if (hooks.length > 0) {\n context.log(\n LogLevelLabel.DEBUG,\n ` 🧩 Calling plugin hook: ${chalk.bold.cyanBright(\n `${key}${options?.order ? ` (${options.order})` : \"\"}`\n )}`\n );\n\n const invokeHook = async (\n hook: ArrayValues<typeof hooks>,\n hookArgs: InferHookParameters<PluginContext<TResolvedConfig>, TKey>\n ) => {\n return Reflect.apply(hook.handler, hook.context, hookArgs);\n };\n\n let results = [] as InferHookReturnType<\n PluginContext<TResolvedConfig>,\n TKey\n >[];\n if (options?.sequential === false) {\n results = (await Promise.all(\n hooks.map(async hook => {\n if (!isFunction(hook.handler)) {\n throw new Error(\n `Plugin hook handler for hook \"${key}\" is not a function.`\n );\n }\n\n return invokeHook(hook, [...args]);\n })\n )) as InferHookReturnType<PluginContext<TResolvedConfig>, TKey>[];\n } else {\n for (const hook of hooks) {\n if (!isFunction(hook.handler)) {\n throw new Error(\n `Plugin hook handler for hook \"${key}\" is not a function.`\n );\n }\n\n if (options?.result === \"first\" || options?.asNextParam === false) {\n results.push(\n (await Promise.resolve(\n invokeHook(hook, [...args])\n )) as InferHookReturnType<PluginContext<TResolvedConfig>, TKey>\n );\n if (\n options?.result === \"first\" &&\n isSet(results[results.length - 1])\n ) {\n break;\n }\n } else {\n const sequenceArgs = [...args];\n if (results.length > 0 && sequenceArgs.length > 0) {\n sequenceArgs[0] = isFunction(options.asNextParam)\n ? await Promise.resolve(options.asNextParam(results[0]))\n : results[0];\n }\n\n const result = await Promise.resolve(\n invokeHook(hook, [...sequenceArgs] as InferHookParameters<\n PluginContext<TResolvedConfig>,\n TKey\n >)\n );\n if (result) {\n if (options?.result === \"last\") {\n results = [\n result as InferHookReturnType<\n PluginContext<TResolvedConfig>,\n TKey\n >\n ];\n } else if (isString(result)) {\n results = [\n `${isString(results[0]) ? results[0] || \"\" : \"\"}\\n${result || \"\"}`.trim() as InferHookReturnType<\n PluginContext<TResolvedConfig>,\n TKey\n >\n ];\n } else if (isObject(result)) {\n results = [\n mergeResults(result, results[0] ?? {}) as InferHookReturnType<\n PluginContext<TResolvedConfig>,\n TKey\n >\n ];\n }\n }\n }\n }\n }\n\n const definedResults = results.filter(\n (\n result\n ): result is NonNullable<\n InferHookReturnType<PluginContext<TResolvedConfig>, TKey>\n > => isSet(result)\n );\n\n if (definedResults.length > 0) {\n let mergedResult = undefined as\n | InferHookReturnType<PluginContext<TResolvedConfig>, TKey>\n | undefined;\n\n for (const result of definedResults) {\n mergedResult = defu(\n result as Record<string, unknown>,\n (mergedResult ?? {}) as Record<string, unknown>\n ) as InferHookReturnType<PluginContext<TResolvedConfig>, TKey>;\n }\n\n return mergedResult;\n }\n }\n\n return undefined;\n}\n","/* -------------------------------------------------------------------\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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { install } from \"@stryke/fs/install\";\nimport {\n doesPackageMatch,\n getPackageListing,\n isPackageListed\n} from \"@stryke/fs/package-fns\";\nimport {\n getPackageName,\n getPackageVersion,\n hasPackageVersion\n} from \"@stryke/string-format/package\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport type { Context } from \"../../types/context\";\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packageName - The name of the package to install\n * @param dev - Whether to install the package as a dev dependency\n */\nexport async function installPackage(\n context: Context,\n packageName: string,\n dev = false\n) {\n if (\n !(await isPackageListed(getPackageName(packageName), {\n cwd: context.config.projectRoot\n }))\n ) {\n if (context.config.autoInstall) {\n context.log(\n LogLevelLabel.WARN,\n `The package \"${packageName}\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(packageName, {\n cwd: context.config.projectRoot,\n dev\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.log(LogLevelLabel.ERROR, result.stderr);\n throw new Error(\n `An error occurred while installing the package \"${packageName}\"`\n );\n }\n } else {\n context.log(\n LogLevelLabel.WARN,\n `The package \"${packageName}\" is not installed. Since the \"autoInstall\" option is set to false, it will not be installed automatically.`\n );\n }\n } else if (\n hasPackageVersion(packageName) &&\n !process.env.POWERLINES_SKIP_VERSION_CHECK\n ) {\n const isMatching = await doesPackageMatch(\n getPackageName(packageName),\n getPackageVersion(packageName)!,\n context.config.projectRoot\n );\n if (!isMatching) {\n const packageListing = await getPackageListing(\n getPackageName(packageName),\n {\n cwd: context.config.projectRoot\n }\n );\n if (\n !packageListing?.version.startsWith(\"catalog:\") &&\n !packageListing?.version.startsWith(\"workspace:\")\n ) {\n context.log(\n LogLevelLabel.WARN,\n `The package \"${getPackageName(packageName)}\" is installed but does not match the expected version ${getPackageVersion(\n packageName\n )} (installed version: ${packageListing?.version || \"<Unknown>\"}). Please ensure this is intentional before proceeding. Note: You can skip this validation with the \"STORM_STACK_SKIP_VERSION_CHECK\" environment variable.`\n );\n }\n }\n }\n}\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packages - The list of packages to install\n */\nexport async function installPackages(\n context: Context,\n packages: Array<{ name: string; dev?: boolean }>\n) {\n return Promise.all(\n packages.map(async pkg => installPackage(context, pkg.name, pkg.dev))\n );\n}\n","/* -------------------------------------------------------------------\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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getPackageName } from \"@stryke/string-format/package\";\nimport { Context } from \"../../types/context\";\nimport { installPackage } from \"./install\";\n\n/**\n * Install missing project dependencies.\n *\n * @param context - The build context.\n */\nexport async function installDependencies<TContext extends Context = Context>(\n context: TContext\n): Promise<void> {\n context.log(\n LogLevelLabel.TRACE,\n `Checking and installing missing project dependencies.`\n );\n\n context.dependencies ??= {};\n context.devDependencies ??= {};\n\n if (\n Object.keys(context.dependencies).length === 0 &&\n Object.keys(context.devDependencies).length === 0\n ) {\n context.log(\n LogLevelLabel.TRACE,\n `No dependencies or devDependencies to install. Skipping installation step.`\n );\n return;\n }\n\n context.log(\n LogLevelLabel.DEBUG,\n `The following packages are required: \\nDependencies: \\n${Object.entries(\n context.dependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}\\n\\nDevDependencies: \\n${Object.entries(\n context.devDependencies\n )\n .map(([name, version]) => `- ${name}@${String(version)}`)\n .join(\" \\n\")}`\n );\n\n await Promise.all([\n Promise.all(\n Object.entries(context.dependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n false\n )\n )\n ),\n Promise.all(\n Object.entries(context.devDependencies).map(async ([name, version]) =>\n installPackage(\n context,\n `${getPackageName(name)}@${String(version)}`,\n true\n )\n )\n )\n ]);\n}\n","/* -------------------------------------------------------------------\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 type { Diff, ObjectData } from \"@donedeal0/superdiff\";\nimport { getObjectDiff } from \"@donedeal0/superdiff\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport {\n findFileName,\n findFilePath,\n relativePath\n} from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport chalk from \"chalk\";\nimport {\n getParsedTypeScriptConfig,\n getTsconfigFilePath,\n isIncludeMatchFound\n} from \"../../lib/typescript/tsconfig\";\nimport type { EnvironmentContext } from \"../../types/context\";\nimport { ResolvedConfig } from \"../../types/resolved\";\n\nexport function getTsconfigDtsPath<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n>(context: EnvironmentContext<TResolvedConfig>): string {\n const dtsRelativePath = joinPaths(\n relativePath(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot\n ),\n findFilePath(context.dtsPath)\n ),\n findFileName(context.dtsPath)\n );\n\n return dtsRelativePath;\n}\n\nasync function resolveTsconfigChanges<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n>(context: EnvironmentContext<TResolvedConfig>): Promise<TsConfigJson> {\n const tsconfig = getParsedTypeScriptConfig(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig,\n context.config.tsconfigRaw\n );\n\n const tsconfigFilePath = getTsconfigFilePath(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig\n );\n\n const tsconfigJson = await readJsonFile<TsConfigJson>(tsconfigFilePath);\n tsconfigJson.compilerOptions ??= {};\n\n if (context.config.output.dts !== false) {\n const dtsRelativePath = getTsconfigDtsPath(context);\n\n if (\n !tsconfigJson.include?.some(filePattern =>\n isIncludeMatchFound(filePattern, [context.dtsPath, dtsRelativePath])\n )\n ) {\n tsconfigJson.include ??= [];\n tsconfigJson.include.push(\n dtsRelativePath.startsWith(\"./\")\n ? dtsRelativePath.slice(2)\n : dtsRelativePath\n );\n }\n }\n\n if (\n !tsconfig.options.lib?.some(lib =>\n [\n \"lib.esnext.d.ts\",\n \"lib.es2021.d.ts\",\n \"lib.es2022.d.ts\",\n \"lib.es2023.d.ts\"\n ].includes(lib.toLowerCase())\n )\n ) {\n tsconfigJson.compilerOptions.lib ??= [];\n tsconfigJson.compilerOptions.lib.push(\"esnext\");\n }\n\n // if (tsconfig.options.module !== ts.ModuleKind.ESNext) {\n // tsconfigJson.compilerOptions.module = \"ESNext\";\n // }\n\n // if (\n // !tsconfig.options.target ||\n // ![\n // ts.ScriptTarget.ESNext,\n // ts.ScriptTarget.ES2024,\n // ts.ScriptTarget.ES2023,\n // ts.ScriptTarget.ES2022,\n // ts.ScriptTarget.ES2021\n // ].includes(tsconfig.options.target)\n // ) {\n // tsconfigJson.compilerOptions.target = \"ESNext\";\n // }\n\n // if (tsconfig.options.moduleResolution !== ts.ModuleResolutionKind.Bundler) {\n // tsconfigJson.compilerOptions.moduleResolution = \"Bundler\";\n // }\n\n // if (tsconfig.options.moduleDetection !== ts.ModuleDetectionKind.Force) {\n // tsconfigJson.compilerOptions.moduleDetection = \"force\";\n // }\n\n // if (tsconfig.options.allowSyntheticDefaultImports !== true) {\n // tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;\n // }\n\n // if (tsconfig.options.noImplicitOverride !== true) {\n // tsconfigJson.compilerOptions.noImplicitOverride = true;\n // }\n\n // if (tsconfig.options.noUncheckedIndexedAccess !== true) {\n // tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;\n // }\n\n // if (tsconfig.options.skipLibCheck !== true) {\n // tsconfigJson.compilerOptions.skipLibCheck = true;\n // }\n\n // if (tsconfig.options.resolveJsonModule !== true) {\n // tsconfigJson.compilerOptions.resolveJsonModule = true;\n // }\n\n // if (tsconfig.options.verbatimModuleSyntax !== false) {\n // tsconfigJson.compilerOptions.verbatimModuleSyntax = false;\n // }\n\n // if (tsconfig.options.allowJs !== true) {\n // tsconfigJson.compilerOptions.allowJs = true;\n // }\n\n // if (tsconfig.options.declaration !== true) {\n // tsconfigJson.compilerOptions.declaration = true;\n // }\n\n if (tsconfig.options.esModuleInterop !== true) {\n tsconfigJson.compilerOptions.esModuleInterop = true;\n }\n\n if (tsconfig.options.isolatedModules !== true) {\n tsconfigJson.compilerOptions.isolatedModules = true;\n }\n\n if (context.config.build.platform === \"node\") {\n if (\n !tsconfig.options.types?.some(\n type =>\n type.toLowerCase() === \"node\" || type.toLowerCase() === \"@types/node\"\n )\n ) {\n tsconfigJson.compilerOptions.types ??= [];\n tsconfigJson.compilerOptions.types.push(\"node\");\n }\n }\n\n return tsconfigJson;\n}\n\nexport async function initializeTsconfig<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends EnvironmentContext<TResolvedConfig> =\n EnvironmentContext<TResolvedConfig>\n>(context: TContext): Promise<void> {\n context.log(\n LogLevelLabel.TRACE,\n \"Initializing TypeScript configuration (tsconfig.json) for the Powerlines project.\"\n );\n\n if (!isPackageExists(\"typescript\")) {\n throw new Error(\n 'The TypeScript package is not installed. Please install the package using the command: \"npm install typescript --save-dev\"'\n );\n }\n\n const tsconfigFilePath = getTsconfigFilePath(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig\n );\n\n context.tsconfig.originalTsconfigJson =\n await readJsonFile<TsConfigJson>(tsconfigFilePath);\n\n context.tsconfig.tsconfigJson =\n await resolveTsconfigChanges<TResolvedConfig>(context);\n\n context.log(\n LogLevelLabel.TRACE,\n \"Writing updated TypeScript configuration (tsconfig.json) file to disk.\"\n );\n\n await context.fs.write(\n tsconfigFilePath,\n StormJSON.stringify(context.tsconfig.tsconfigJson)\n );\n\n context.tsconfig = getParsedTypeScriptConfig(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig,\n context.config.tsconfigRaw,\n context.tsconfig.originalTsconfigJson\n );\n}\n\nexport async function resolveTsconfig<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TContext extends EnvironmentContext<TResolvedConfig> =\n EnvironmentContext<TResolvedConfig>\n>(context: TContext): Promise<void> {\n const updateTsconfigJson = await readJsonFile<TsConfigJson>(\n context.tsconfig.tsconfigFilePath\n );\n if (\n updateTsconfigJson?.compilerOptions?.types &&\n Array.isArray(updateTsconfigJson.compilerOptions.types) &&\n !updateTsconfigJson.compilerOptions.types.length\n ) {\n // If the types array is empty, we can safely remove it\n delete updateTsconfigJson.compilerOptions.types;\n }\n\n const result = getObjectDiff(\n context.tsconfig.originalTsconfigJson as NonNullable<ObjectData>,\n updateTsconfigJson as ObjectData,\n {\n ignoreArrayOrder: true,\n showOnly: {\n statuses: [\"added\", \"deleted\", \"updated\"],\n granularity: \"deep\"\n }\n }\n );\n\n const changes = [] as {\n field: string;\n status: \"added\" | \"deleted\" | \"updated\";\n previous: string;\n current: string;\n }[];\n const getChanges = (difference: Diff, property?: string) => {\n if (\n difference.status === \"added\" ||\n difference.status === \"deleted\" ||\n difference.status === \"updated\"\n ) {\n if (difference.diff) {\n for (const diff of difference.diff) {\n getChanges(\n diff,\n property\n ? `${property}.${difference.property}`\n : difference.property\n );\n }\n } else {\n changes.push({\n field: property\n ? `${property}.${difference.property}`\n : difference.property,\n status: difference.status,\n previous:\n difference.status === \"added\"\n ? \"---\"\n : StormJSON.stringify(difference.previousValue),\n current:\n difference.status === \"deleted\"\n ? \"---\"\n : StormJSON.stringify(difference.currentValue)\n });\n }\n }\n };\n\n for (const diff of result.diff) {\n getChanges(diff);\n }\n\n if (changes.length > 0) {\n context.log(\n LogLevelLabel.WARN,\n `Updating the following configuration values in \"${context.tsconfig.tsconfigFilePath}\" file:\n\n ${changes\n .map(\n (change, i) => `${chalk.bold.whiteBright(\n `${i + 1}. ${titleCase(change.status)} the ${change.field} field: `\n )}\n ${chalk.red(` - Previous: ${change.previous} `)}\n ${chalk.green(` - Updated: ${change.current} `)}\n `\n )\n .join(\"\\n\")}\n `\n );\n }\n\n await context.fs.write(\n context.tsconfig.tsconfigFilePath,\n StormJSON.stringify(updateTsconfigJson)\n );\n\n context.tsconfig = getParsedTypeScriptConfig(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig\n );\n if (!context.tsconfig) {\n throw new Error(\"Failed to parse the TypeScript configuration file.\");\n }\n}\n","/* -------------------------------------------------------------------\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 { transformAsync } from \"@babel/core\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger/console\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { install } from \"@stryke/fs/install\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isPromiseLike } from \"@stryke/type-checks/is-promise\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport chalk from \"chalk\";\nimport Handlebars from \"handlebars\";\nimport packageJson from \"../package.json\" assert { type: \"json\" };\nimport { moduleResolverBabelPlugin } from \"./internal/babel/module-resolver-plugin\";\nimport {\n emitBuiltinTypes,\n formatTypes\n} from \"./internal/helpers/generate-types\";\nimport { callHook, CallHookOptions } from \"./internal/helpers/hooks\";\nimport { installDependencies } from \"./internal/helpers/install-dependencies\";\nimport {\n getTsconfigDtsPath,\n initializeTsconfig,\n resolveTsconfig\n} from \"./internal/helpers/resolve-tsconfig\";\nimport { PowerlinesAPIContext } from \"./lib/contexts/api-context\";\nimport {\n getParsedTypeScriptConfig,\n isIncludeMatchFound\n} from \"./lib/typescript/tsconfig\";\nimport { getFileHeader } from \"./lib/utilities/file-header\";\nimport { formatFolder } from \"./lib/utilities/format\";\nimport { writeMetaFile } from \"./lib/utilities/meta\";\nimport {\n checkDedupe,\n findInvalidPluginConfig,\n isPlugin,\n isPluginConfig,\n isPluginConfigObject,\n isPluginConfigTuple\n} from \"./plugin-utils/helpers\";\nimport { API } from \"./types/api\";\nimport type {\n BuildInlineConfig,\n CleanInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InitialUserConfig,\n LintInlineConfig,\n NewInlineConfig,\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple,\n PluginFactory,\n PrepareInlineConfig\n} from \"./types/config\";\nimport type {\n APIContext,\n EnvironmentContext,\n PluginContext\n} from \"./types/context\";\nimport { InferHookParameters } from \"./types/hooks\";\nimport { UNSAFE_APIContext } from \"./types/internal\";\nimport type { Plugin, TypesResult } from \"./types/plugin\";\nimport { EnvironmentResolvedConfig, ResolvedConfig } from \"./types/resolved\";\n\n/**\n * The Powerlines API class\n *\n * @remarks\n * This class is responsible for managing the Powerlines project lifecycle, including initialization, building, and finalization.\n *\n * @public\n */\nexport class PowerlinesAPI<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n>\n implements API<TResolvedConfig>, AsyncDisposable\n{\n /**\n * The Powerlines context\n */\n #context: UNSAFE_APIContext<TResolvedConfig>;\n\n /**\n * The Powerlines context\n */\n public get context(): APIContext<TResolvedConfig> {\n return this.#context;\n }\n\n /**\n * Create a new Powerlines API instance\n *\n * @param context - The Powerlines context\n */\n private constructor(context: APIContext<TResolvedConfig>) {\n this.#context = context as UNSAFE_APIContext<TResolvedConfig>;\n }\n\n /**\n * Initialize a Powerlines API instance\n *\n * @param workspaceRoot - The directory of the underlying workspace the Powerlines project exists in\n * @param config - An object containing the configuration required to run Powerlines tasks.\n * @returns A new instance of the Powerlines API\n */\n public static async from<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n >(\n workspaceRoot: string,\n config: InitialUserConfig<TResolvedConfig[\"userConfig\"]>\n ): Promise<PowerlinesAPI<TResolvedConfig>> {\n const api = new PowerlinesAPI<TResolvedConfig>(\n await PowerlinesAPIContext.from(workspaceRoot, config)\n );\n api.#context.$$internal = {\n api,\n addPlugin: api.#addPlugin.bind(api)\n };\n\n api.context.info(\n `🔌 The Powerlines Engine v${packageJson.version} has started`\n );\n\n for (const plugin of api.context.config.plugins ?? []) {\n await api.#addPlugin(plugin);\n }\n\n if (api.context.plugins.length === 0) {\n api.context.warn(\n \"No Powerlines plugins were specified in the options. Please ensure this is correct, as it is generally not recommended.\"\n );\n }\n\n const pluginConfig = await api.callHook(\"config\", {\n environment: await api.context.getEnvironment(),\n sequential: true,\n result: \"merge\"\n });\n await api.context.withUserConfig(\n pluginConfig as TResolvedConfig[\"userConfig\"],\n { isHighPriority: false }\n );\n\n return api;\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(\n inlineConfig:\n | PrepareInlineConfig\n | NewInlineConfig\n | CleanInlineConfig\n | BuildInlineConfig\n | LintInlineConfig\n | DocsInlineConfig\n | DeployInlineConfig = { command: \"prepare\" }\n ) {\n this.context.info(\" 🏗️ Preparing the Powerlines project\");\n\n this.context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await this.context.withInlineConfig(inlineConfig);\n await this.#executeEnvironments(async context => {\n context.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await this.callHook(\"configResolved\", {\n environment: context,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig>(context);\n\n await this.callHook(\"configResolved\", {\n environment: context,\n order: \"normal\"\n });\n\n if (context.entry.length > 0) {\n context.debug(\n `The configuration provided ${\n toArray(context.config.entry).length\n } entry point(s), Powerlines has found ${\n context.entry.length\n } entry files(s) for the ${context.config.title} project${\n context.entry.length > 0 && context.entry.length < 10\n ? `: \\n${context.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n context.warn(\n `No entry files were found for the ${\n context.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig>(context);\n await installDependencies(context);\n\n await this.callHook(\"configResolved\", {\n environment: context,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...context.config,\n userConfig: isSetObject(context.config.userConfig)\n ? omit(context.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(context.config.inlineConfig)\n ? omit(context.config.inlineConfig, [\"plugins\"])\n : undefined,\n plugins: context.plugins.map(plugin => plugin.plugin.name)\n })}`\n );\n\n if (!context.fs.existsSync(context.cachePath)) {\n await createDirectory(context.cachePath);\n }\n\n if (!context.fs.existsSync(context.dataPath)) {\n await createDirectory(context.dataPath);\n }\n\n await this.callHook(\"prepare\", {\n environment: context,\n order: \"pre\"\n });\n await this.callHook(\"prepare\", {\n environment: context,\n order: \"normal\"\n });\n\n if (context.config.output.dts !== false) {\n context.debug(\n `Preparing the TypeScript definitions for the Powerlines project.`\n );\n\n if (context.fs.existsSync(context.dtsPath)) {\n await context.fs.remove(context.dtsPath);\n }\n\n context.debug(\"Transforming built-ins runtime modules files.\");\n\n const builtinFilePaths = await Promise.all(\n (await context.getBuiltins()).map(async file => {\n const result = await transformAsync(file.code.toString(), {\n highlightCode: true,\n code: true,\n ast: false,\n cloneInputAst: false,\n comments: true,\n sourceType: \"module\",\n configFile: false,\n babelrc: false,\n envName: context.config.mode,\n caller: {\n name: \"powerlines\"\n },\n ...context.config.transform.babel,\n filename: file.path,\n plugins: [\n [\"@babel/plugin-syntax-typescript\"],\n [moduleResolverBabelPlugin(context)]\n ]\n });\n if (!result?.code) {\n throw new Error(\n `Powerlines - Generate Types failed to compile ${file.id}`\n );\n }\n\n if (!file.id) {\n context.warn(\n `File ID is missing for a built-in runtime file at ${file.path}.`\n );\n\n file.id = replacePath(\n replacePath(file.path, context.workspaceConfig.workspaceRoot),\n context.builtinsPath\n );\n }\n\n context.trace(\n `Writing transformed built-in runtime file ${file.id}.`\n );\n\n await context.emitBuiltin(result.code, file.id);\n\n return appendPath(file.path, context.builtinsPath);\n })\n );\n\n const typescriptPath = await resolvePackage(\"typescript\");\n if (!typescriptPath) {\n throw new Error(\n \"Could not resolve TypeScript package location. Please ensure TypeScript is installed.\"\n );\n }\n\n context.debug(\n \"Parsing TypeScript configuration for the Powerlines project.\"\n );\n\n let types = await emitBuiltinTypes(\n context,\n builtinFilePaths.reduce<string[]>(\n (ret, fileName) => {\n const formatted = replacePath(\n fileName,\n context.workspaceConfig.workspaceRoot\n );\n if (!ret.includes(formatted)) {\n ret.push(formatted);\n }\n\n return ret;\n },\n [] // [joinPaths(typescriptPath, \"lib\", \"lib.esnext.full.d.ts\")]\n )\n );\n\n context.debug(\n `Generating TypeScript declaration file ${context.dtsPath}.`\n );\n\n const directives = [] as string[];\n const asNextParam = (\n previousResult: string | TypesResult | null | undefined\n ) => (isObject(previousResult) ? previousResult.code : previousResult);\n\n let result = await this.callHook(\n \"types\",\n {\n environment: context,\n sequential: true,\n order: \"pre\",\n result: \"merge\",\n asNextParam\n },\n types\n );\n if (result) {\n if (isSetObject(result)) {\n types = result.code;\n if (\n Array.isArray(result.directives) &&\n result.directives.length > 0\n ) {\n directives.push(...result.directives);\n }\n } else if (isSetString(result)) {\n types = result;\n }\n }\n\n result = await this.callHook(\n \"types\",\n {\n environment: context,\n sequential: true,\n order: \"normal\",\n result: \"merge\",\n asNextParam\n },\n types\n );\n if (result) {\n if (isSetObject(result)) {\n types = result.code;\n if (\n Array.isArray(result.directives) &&\n result.directives.length > 0\n ) {\n directives.push(...result.directives);\n }\n } else if (isSetString(result)) {\n types = result;\n }\n }\n\n result = await this.callHook(\n \"types\",\n {\n environment: context,\n sequential: true,\n order: \"post\",\n result: \"merge\",\n asNextParam\n },\n types\n );\n if (result) {\n if (isSetObject(result)) {\n types = result.code;\n if (\n Array.isArray(result.directives) &&\n result.directives.length > 0\n ) {\n directives.push(...result.directives);\n }\n } else if (isSetString(result)) {\n types = result;\n }\n }\n\n if (isSetString(types?.trim()) || directives.length > 0) {\n await context.fs.write(\n context.dtsPath,\n `${\n directives.length > 0\n ? `${directives.map(directive => `/// <reference types=\"${directive}\" />`).join(\"\\n\")}\n\n`\n : \"\"\n }${getFileHeader(context, { directive: null, prettierIgnore: false })}\n\n${formatTypes(types)}\n`\n );\n } else {\n const dtsRelativePath = getTsconfigDtsPath(context);\n if (\n context.tsconfig.tsconfigJson.include &&\n isIncludeMatchFound(\n dtsRelativePath,\n context.tsconfig.tsconfigJson.include\n )\n ) {\n const normalizedDtsRelativePath = dtsRelativePath.startsWith(\"./\")\n ? dtsRelativePath.slice(2)\n : dtsRelativePath;\n context.tsconfig.tsconfigJson.include =\n context.tsconfig.tsconfigJson.include.filter(\n includeValue =>\n includeValue?.toString() !== normalizedDtsRelativePath\n );\n\n await context.fs.write(\n context.tsconfig.tsconfigFilePath,\n JSON.stringify(context.tsconfig.tsconfigJson, null, 2)\n );\n }\n }\n }\n\n // Re-resolve the tsconfig to ensure it is up to date\n context.tsconfig = getParsedTypeScriptConfig(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.tsconfig\n );\n if (!context.tsconfig) {\n throw new Error(\"Failed to parse the TypeScript configuration file.\");\n }\n\n this.context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(context, context.builtinsPath),\n formatFolder(context, context.entryPath)\n ]);\n\n await this.callHook(\"prepare\", {\n environment: context,\n order: \"post\"\n });\n\n await writeMetaFile(context);\n context.persistedMeta = context.meta;\n });\n\n this.context.debug(\"✔ Powerlines preparation has completed successfully\");\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the new command\n * @returns A promise that resolves when the project has been created\n */\n public async new(inlineConfig: NewInlineConfig) {\n this.context.info(\"🆕 Creating a new Powerlines project\");\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n context.debug(\n \"Initializing the processing options for the Powerlines project.\"\n );\n\n await this.callHook(\"new\", {\n environment: context,\n order: \"pre\"\n });\n\n const files = await listFiles(\n joinPaths(context.powerlinesPath, \"files/common/**/*.hbs\")\n );\n for (const file of files) {\n context.trace(`Adding template file to project: ${file}`);\n\n const template = Handlebars.compile(file);\n await context.fs.write(\n joinPaths(context.config.projectRoot, file.replace(\".hbs\", \"\")),\n template(context)\n );\n }\n\n await this.callHook(\"new\", {\n environment: context,\n order: \"normal\"\n });\n\n if (context.config.projectType === \"application\") {\n const files = await listFiles(\n joinPaths(context.powerlinesPath, \"files/application/**/*.hbs\")\n );\n for (const file of files) {\n context.trace(`Adding application template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await context.fs.write(\n joinPaths(context.config.projectRoot, file.replace(\".hbs\", \"\")),\n template(context)\n );\n }\n } else {\n const files = await listFiles(\n joinPaths(context.powerlinesPath, \"files/library/**/*.hbs\")\n );\n for (const file of files) {\n context.trace(`Adding library template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await context.fs.write(\n joinPaths(context.config.projectRoot, file.replace(\".hbs\", \"\")),\n template(context)\n );\n }\n }\n\n await this.callHook(\"new\", {\n environment: context,\n order: \"post\"\n });\n });\n\n this.context.debug(\"✔ Powerlines new command completed successfully\");\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(\n inlineConfig: CleanInlineConfig | PrepareInlineConfig = {\n command: \"clean\"\n }\n ) {\n this.context.info(\"🧹 Cleaning the previous Powerlines artifacts\");\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n context.debug(\"Cleaning the project's dist and artifacts directories.\");\n\n await context.fs.remove(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.buildPath\n )\n );\n await context.fs.remove(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n context.config.output.artifactsPath\n )\n );\n\n await this.callHook(\"clean\", {\n environment: context,\n sequential: false\n });\n });\n\n this.context.debug(\"✔ Powerlines cleaning completed successfully\");\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(\n inlineConfig: LintInlineConfig | BuildInlineConfig = { command: \"lint\" }\n ) {\n this.context.info(\"📋 Linting the Powerlines project\");\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n if (context.config.lint !== false) {\n await this.callHook(\"lint\", {\n environment: context,\n sequential: false\n });\n }\n });\n\n this.context.debug(\"✔ Powerlines linting completed successfully\");\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: BuildInlineConfig = { command: \"build\" }) {\n this.context.info(\"📦 Building the Powerlines project\");\n\n // const checksum = await this.context.generateChecksum();\n // if (checksum !== this.context.persistedMeta?.checksum) {\n // this.context.log(\n // LogLevelLabel.INFO,\n // \"The Powerlines project has been modified since the last time `prepare` was ran. Re-preparing the project.\"\n // );\n\n // await this.prepare(inlineConfig);\n // }\n\n await this.prepare(inlineConfig);\n if (this.context.config.singleBuild) {\n await this.#handleBuild(await this.#context.toEnvironment());\n } else {\n await this.#executeEnvironments(async context => {\n await this.#handleBuild(context);\n });\n }\n\n this.context.debug(\"✔ Powerlines build completed successfully\");\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: DocsInlineConfig = { command: \"docs\" }) {\n this.context.info(\"📓 Generating documentation for the Powerlines project\");\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n context.debug(\n \"Writing documentation for the Powerlines project artifacts.\"\n );\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n await this.callHook(\"docs\", {\n environment: context\n });\n });\n });\n\n this.context.debug(\n \"✔ Powerlines documentation generation completed successfully\"\n );\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n */\n public async deploy(\n inlineConfig: DeployInlineConfig = { command: \"deploy\" }\n ) {\n this.context.info(\"🚀 Deploying the Powerlines project\");\n\n await this.prepare(inlineConfig);\n await this.#executeEnvironments(async context => {\n await this.callHook(\"deploy\", { environment: context });\n });\n\n this.context.debug(\"✔ Powerlines deploy completed successfully\");\n }\n\n /**\n * Finalization process\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n this.context.info(\"🏁 Powerlines finalization processes started\");\n\n await this.#executeEnvironments(async context => {\n await this.callHook(\"finalize\", { environment: context });\n await context.fs.dispose();\n });\n\n this.context.debug(\"✔ Powerlines finalization completed successfully\");\n }\n\n /**\n * Invokes the configured plugin hooks\n *\n * @remarks\n * By default, it will call the `\"pre\"`, `\"normal\"`, and `\"post\"` ordered hooks in sequence\n *\n * @param hook - The hook to call\n * @param options - The options to provide to the hook\n * @param args - The arguments to pass to the hook\n * @returns The result of the hook call\n */\n public async callHook<TKey extends string>(\n hook: TKey,\n options: CallHookOptions & {\n environment?: string | EnvironmentContext<TResolvedConfig>;\n },\n ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>\n ) {\n return callHook<TResolvedConfig, TKey>(\n isSetObject(options?.environment)\n ? options.environment\n : await this.#context.getEnvironment(options?.environment),\n hook,\n { sequential: true, ...options },\n ...args\n );\n }\n\n /**\n * Dispose of the Powerlines API instance\n *\n * @remarks\n * This method will finalize the Powerlines API instance, cleaning up any resources used.\n */\n public async [Symbol.asyncDispose]() {\n await this.finalize();\n }\n\n async #handleBuild(context: EnvironmentContext<TResolvedConfig>) {\n await this.callHook(\"build\", {\n environment: context,\n order: \"pre\"\n });\n await this.callHook(\"build\", {\n environment: context,\n order: \"normal\"\n });\n\n if (context.config.output.buildPath !== context.config.output.outputPath) {\n const sourcePath = appendPath(\n context.config.output.buildPath,\n context.workspaceConfig.workspaceRoot\n );\n const destinationPath = joinPaths(\n appendPath(\n context.config.output.outputPath,\n context.workspaceConfig.workspaceRoot\n ),\n \"dist\"\n );\n\n if (context.fs.existsSync(sourcePath) && sourcePath !== destinationPath) {\n context.debug(\n `Copying build output files from project's build directory (${\n context.config.output.buildPath\n }) to the workspace's output directory (${context.config.output.outputPath}).`\n );\n\n await context.fs.copy(sourcePath, destinationPath);\n }\n }\n\n await Promise.all(\n context.config.output.assets.map(async asset => {\n context.trace(\n `Copying asset(s): ${chalk.redBright(\n context.workspaceConfig.workspaceRoot === asset.input\n ? asset.glob\n : joinPaths(\n replacePath(\n asset.input,\n context.workspaceConfig.workspaceRoot\n ),\n asset.glob\n )\n )} -> ${chalk.greenBright(\n joinPaths(\n replacePath(asset.output, context.workspaceConfig.workspaceRoot),\n asset.glob\n )\n )} ${\n Array.isArray(asset.ignore) && asset.ignore.length > 0\n ? ` (ignoring: ${asset.ignore\n .map(i => chalk.yellowBright(i))\n .join(\", \")})`\n : \"\"\n }`\n );\n\n await context.fs.copy(asset, asset.output);\n })\n );\n\n await this.callHook(\"build\", {\n environment: context,\n order: \"post\"\n });\n }\n\n /**\n * Get the configured environments\n *\n * @returns The configured environments\n */\n async #getEnvironments() {\n if (\n !this.context.config.environments ||\n Object.keys(this.context.config.environments).length <= 1\n ) {\n this.context.debug(\n \"No environments are configured for this Powerlines project. Using the default environment.\"\n );\n\n return [await this.context.getEnvironment()];\n }\n\n this.context.debug(\n `Found ${Object.keys(this.context.config.environments).length} configured environment(s) for this Powerlines project.`\n );\n\n return (\n await Promise.all(\n Object.entries(this.context.config.environments).map(\n async ([name, config]) => {\n const environment = await this.context.getEnvironmentSafe(name);\n if (!environment) {\n const resolvedEnvironment = await this.callHook(\n \"configEnvironment\",\n {\n environment: name\n },\n name,\n config\n );\n\n if (resolvedEnvironment) {\n this.context.environments[name] = await this.context.in(\n resolvedEnvironment as EnvironmentResolvedConfig\n );\n }\n }\n\n return this.context.environments[name];\n }\n )\n )\n ).filter(context => isSet(context));\n }\n\n /**\n * Execute a handler function for each environment\n *\n * @param handle - The handler function to execute for each environment\n */\n async #executeEnvironments(\n handle: (context: EnvironmentContext<TResolvedConfig>) => MaybePromise<void>\n ) {\n await Promise.all(\n (await this.#getEnvironments()).map(async context => {\n return Promise.resolve(handle(context));\n })\n );\n }\n\n /**\n * Add a Powerlines plugin used in the build process\n *\n * @param config - The import path of the plugin to add\n */\n async #addPlugin(config: PluginConfig<PluginContext<TResolvedConfig>>) {\n if (config) {\n const result = await this.#initPlugin(config);\n if (!result) {\n return;\n }\n\n for (const plugin of result) {\n this.context.debug(\n `Successfully initialized the ${chalk.bold.cyanBright(\n plugin.name\n )} plugin`\n );\n\n await this.context.addPlugin(plugin);\n }\n }\n }\n\n /**\n * Initialize a Powerlines plugin\n *\n * @param config - The configuration for the plugin\n * @returns The initialized plugin instance, or null if the plugin was a duplicate\n * @throws Will throw an error if the plugin cannot be found or is invalid\n */\n async #initPlugin(\n config: PluginConfig<PluginContext<TResolvedConfig>>\n ): Promise<Plugin<PluginContext<TResolvedConfig>>[] | null> {\n let awaited = config;\n if (isPromiseLike(config)) {\n awaited = (await Promise.resolve(config as Promise<any>)) as PluginConfig<\n PluginContext<TResolvedConfig>\n >;\n }\n\n if (!isPluginConfig<PluginContext<TResolvedConfig>>(awaited)) {\n const invalid = findInvalidPluginConfig(awaited);\n\n throw new Error(\n `Invalid ${\n invalid && invalid.length > 1 ? \"plugins\" : \"plugin\"\n } specified in the configuration - ${\n invalid && invalid.length > 0\n ? JSON.stringify(awaited)\n : invalid?.join(\"\\n\\n\")\n } \\n\\nPlease ensure the value is one of the following: \\n - an instance of \\`Plugin\\` \\n - a plugin name \\n - an object with the \\`plugin\\` and \\`options\\` properties \\n - a tuple array with the plugin and options \\n - a factory function that returns a plugin or array of plugins \\n - an array of plugins or plugin configurations`\n );\n }\n\n let plugins!: Plugin<PluginContext<TResolvedConfig>>[];\n if (isPlugin<PluginContext<TResolvedConfig>>(awaited)) {\n plugins = [awaited];\n } else if (isFunction(awaited)) {\n plugins = toArray(await Promise.resolve(awaited()));\n } else if (isString(awaited)) {\n const resolved = await this.#resolvePlugin(awaited);\n if (isFunction(resolved)) {\n plugins = toArray(await Promise.resolve(resolved()));\n } else {\n plugins = toArray(resolved);\n }\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginContext<TResolvedConfig>[]).every(\n isPlugin<PluginContext<TResolvedConfig>>\n )\n ) {\n plugins = awaited as Plugin<PluginContext<TResolvedConfig>>[];\n } else if (\n Array.isArray(awaited) &&\n (awaited as PluginConfig<PluginContext<TResolvedConfig>>[]).every(\n isPluginConfig<PluginContext<TResolvedConfig>>\n )\n ) {\n plugins = [];\n for (const pluginConfig of awaited as PluginConfig<\n PluginContext<TResolvedConfig>\n >[]) {\n const initialized = await this.#initPlugin(pluginConfig);\n if (initialized) {\n plugins.push(...initialized);\n }\n }\n } else if (\n isPluginConfigTuple<PluginContext<TResolvedConfig>>(awaited) ||\n isPluginConfigObject<PluginContext<TResolvedConfig>>(awaited)\n ) {\n let pluginConfig!:\n | string\n | PluginFactory<PluginContext<TResolvedConfig>>\n | Plugin<PluginContext<TResolvedConfig>>;\n let pluginOptions: any;\n\n if (isPluginConfigTuple<PluginContext<TResolvedConfig>>(awaited)) {\n pluginConfig = awaited[0] as Plugin<PluginContext<TResolvedConfig>>;\n pluginOptions =\n (awaited as PluginConfigTuple)?.length === 2 ? awaited[1] : undefined;\n } else {\n pluginConfig = (awaited as PluginConfigObject).plugin as Plugin<\n PluginContext<TResolvedConfig>\n >;\n pluginOptions = (awaited as PluginConfigObject).options;\n }\n\n if (isSetString(pluginConfig)) {\n const resolved = await this.#resolvePlugin(pluginConfig);\n if (isFunction(resolved)) {\n plugins = toArray(\n await Promise.resolve(\n pluginOptions ? resolved(pluginOptions) : resolved()\n )\n );\n } else {\n plugins = toArray(resolved);\n }\n } else if (isFunction(pluginConfig)) {\n plugins = toArray(await Promise.resolve(pluginConfig(pluginOptions)));\n } else if (\n Array.isArray(pluginConfig) &&\n pluginConfig.every(isPlugin<PluginContext<TResolvedConfig>>)\n ) {\n plugins = pluginConfig;\n } else if (isPlugin<PluginContext<TResolvedConfig>>(pluginConfig)) {\n plugins = toArray(pluginConfig);\n }\n }\n\n if (!plugins) {\n throw new Error(\n `The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n if (\n plugins.length > 0 &&\n !plugins.every(isPlugin<PluginContext<TResolvedConfig>>)\n ) {\n throw new Error(\n `The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`\n );\n }\n\n const result = [] as Plugin<PluginContext<TResolvedConfig>>[];\n for (const plugin of plugins) {\n if (checkDedupe<TResolvedConfig>(plugin, this.context.plugins)) {\n this.context.trace(\n `Duplicate ${chalk.bold.cyanBright(\n plugin.name\n )} plugin dependency detected - Skipping initialization.`\n );\n } else {\n result.push(plugin);\n\n this.context.trace(\n `Initializing the ${chalk.bold.cyanBright(plugin.name)} plugin...`\n );\n }\n }\n\n return result;\n }\n\n async #resolvePlugin<TOptions>(\n pluginPath: string\n ): Promise<\n | Plugin<PluginContext<TResolvedConfig>>\n | Plugin<PluginContext<TResolvedConfig>>[]\n | ((\n options?: TOptions\n ) => MaybePromise<\n | Plugin<PluginContext<TResolvedConfig>>\n | Plugin<PluginContext<TResolvedConfig>>[]\n >)\n > {\n if (\n pluginPath.startsWith(\"@\") &&\n pluginPath.split(\"/\").filter(Boolean).length > 2\n ) {\n const splits = pluginPath.split(\"/\").filter(Boolean);\n pluginPath = `${splits[0]}/${splits[1]}`;\n }\n\n const isInstalled = isPackageExists(pluginPath, {\n paths: [\n this.context.workspaceConfig.workspaceRoot,\n this.context.config.projectRoot\n ]\n });\n if (!isInstalled && this.context.config.autoInstall) {\n this.#context.warn(\n `The plugin package \"${\n pluginPath\n }\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(pluginPath, {\n cwd: this.context.config.projectRoot\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n this.#context.error(result.stderr);\n\n throw new Error(\n `An error occurred while installing the build plugin package \"${\n pluginPath\n }\" `\n );\n }\n }\n\n try {\n // First check if the package has a \"plugin\" subdirectory - @scope/package/plugin\n const module = await this.context.resolver.plugin.import<{\n plugin?:\n | Plugin<PluginContext<TResolvedConfig>>\n | ((\n options?: TOptions\n ) => MaybePromise<Plugin<PluginContext<TResolvedConfig>>>);\n default?:\n | Plugin<PluginContext<TResolvedConfig>>\n | ((\n options?: TOptions\n ) => MaybePromise<Plugin<PluginContext<TResolvedConfig>>>);\n }>(\n this.context.resolver.plugin.esmResolve(joinPaths(pluginPath, \"plugin\"))\n );\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch (error) {\n try {\n const module = await this.context.resolver.plugin.import<{\n plugin?:\n | Plugin<PluginContext<TResolvedConfig>>\n | ((\n options?: TOptions\n ) => MaybePromise<Plugin<PluginContext<TResolvedConfig>>>);\n default?:\n | Plugin<PluginContext<TResolvedConfig>>\n | ((\n options?: TOptions\n ) => MaybePromise<Plugin<PluginContext<TResolvedConfig>>>);\n }>(this.context.resolver.plugin.esmResolve(pluginPath));\n\n const result = module.plugin ?? module.default;\n if (!result) {\n throw new Error(\n `The plugin package \"${pluginPath}\" does not export a valid module.`\n );\n }\n\n return result;\n } catch {\n if (!isInstalled) {\n throw new Error(\n `The plugin package \"${\n pluginPath\n }\" is not installed. Please install the package using the command: \"npm install ${\n pluginPath\n } --save-dev\"`\n );\n } else {\n throw new Error(\n `An error occurred while importing the build plugin package \"${\n pluginPath\n }\":\n${isError(error) ? error.message : String(error)}\n\nNote: Please ensure the plugin package's default export is a class that extends \\`Plugin\\` with a constructor that excepts a single arguments of type \\`PluginOptions\\`.`\n );\n }\n }\n }\n }\n}\n","/* -------------------------------------------------------------------\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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { LoadResult } from \"rolldown\";\nimport type {\n UnpluginOptions as BaseUnpluginOptions,\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { PowerlinesAPI } from \"../../api\";\nimport { API } from \"../../types/api\";\nimport { UnpluginBuilderVariant } from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { UnpluginFactory, UnpluginOptions } from \"../../types/unplugin\";\nimport { createLog } from \"../logger\";\nimport { getString } from \"../utilities/source-file\";\n\n/**\n * Creates a Powerlines unplugin factory that generates a plugin instance.\n *\n * @param variant - The build variant for which to create the unplugin.\n * @param decorate - An optional function to decorate the unplugin options.\n * @returns The unplugin factory that generates a plugin instance.\n */\nexport function createUnpluginFactory<\n TContext extends Context,\n TUnpluginBuilderVariant extends UnpluginBuilderVariant\n>(\n variant: TUnpluginBuilderVariant,\n decorate?: (\n api: API<TContext[\"config\"]>,\n plugin: UnpluginOptions\n ) => BaseUnpluginOptions\n): UnpluginFactory<TUnpluginBuilderVariant> {\n return (config, meta): UnpluginOptions => {\n const log = createLog(\"unplugin\", config);\n log(LogLevelLabel.DEBUG, \"Initializing Unplugin\");\n\n try {\n const userConfig = {\n ...config,\n variant,\n unplugin: meta\n } as TContext[\"config\"][\"userConfig\"];\n\n let api!: API<TContext[\"config\"]>;\n\n async function buildStart(this: UnpluginBuildContext): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Powerlines build plugin starting...\");\n\n api = await PowerlinesAPI.from(\n getWorkspaceRoot(process.cwd()),\n userConfig\n );\n setParseImpl(api.context.parse);\n\n log(\n LogLevelLabel.DEBUG,\n \"Preparing build artifacts for the Powerlines project...\"\n );\n\n await api.prepare({\n command: \"build\"\n });\n }\n\n async function resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n options: {\n isEntry: boolean;\n } = { isEntry: false }\n ) {\n return api.context.resolve(id, importer, options);\n }\n\n async function load(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult> {\n const environment = await api.context.getEnvironment();\n\n let result = await api.callHook(\n \"load\",\n { environment, order: \"pre\" },\n id\n );\n if (result) {\n return result;\n }\n\n result = await api.callHook(\n \"load\",\n { environment, order: \"normal\" },\n id\n );\n if (result) {\n return result;\n }\n\n result = await environment.load(id);\n if (result) {\n return result;\n }\n\n return api.callHook(\"load\", { environment, order: \"post\" }, id);\n }\n\n async function transform(\n code: string,\n id: string\n ): Promise<TransformResult> {\n return api.callHook(\n \"transform\",\n {\n environment: await api.context.getEnvironment(),\n result: \"merge\",\n asNextParam: previousResult => getString(previousResult)\n },\n getString(code),\n id\n );\n }\n\n async function writeBundle(): Promise<void> {\n log(LogLevelLabel.DEBUG, \"Finalizing Powerlines project output...\");\n\n await api.callHook(\"writeBundle\", {\n environment: await api.context.getEnvironment()\n });\n }\n\n const options = {\n name: \"powerlines\",\n api,\n resolveId: {\n filter: {\n id: {\n include: [/.*/]\n }\n },\n handler: resolveId\n },\n load: {\n filter: {\n id: {\n include: [/.*/, /^storm:/]\n }\n },\n handler: load\n },\n transform,\n buildStart,\n writeBundle\n } as UnpluginOptions;\n\n const result = decorate ? decorate(api, options) : options;\n\n log(LogLevelLabel.DEBUG, \"Unplugin initialized successfully.\");\n\n return { api, ...result };\n } catch (error) {\n log(LogLevelLabel.FATAL, (error as Error)?.message);\n\n throw error;\n }\n };\n}\n"]}
@@ -12,7 +12,7 @@ var chunkGDODHF3Y_cjs = require('./chunk-GDODHF3Y.cjs');
12
12
  var chunk62ZJYXT3_cjs = require('./chunk-62ZJYXT3.cjs');
13
13
  require('./chunk-3GMJQ5G3.cjs');
14
14
  var chunkQVDESIYV_cjs = require('./chunk-QVDESIYV.cjs');
15
- var chunkNXRMBO47_cjs = require('./chunk-NXRMBO47.cjs');
15
+ var chunkB6IYKQHA_cjs = require('./chunk-B6IYKQHA.cjs');
16
16
  var chunkMFC7UJHT_cjs = require('./chunk-MFC7UJHT.cjs');
17
17
  require('./chunk-QMKA57N4.cjs');
18
18
  var chunk26DEN74R_cjs = require('./chunk-26DEN74R.cjs');
@@ -89,7 +89,7 @@ Object.defineProperty(exports, "createUnplugin", {
89
89
  });
90
90
  Object.defineProperty(exports, "createUnpluginFactory", {
91
91
  enumerable: true,
92
- get: function () { return chunkNXRMBO47_cjs.createUnpluginFactory; }
92
+ get: function () { return chunkB6IYKQHA_cjs.createUnpluginFactory; }
93
93
  });
94
94
  Object.defineProperty(exports, "getBaseFileHeader", {
95
95
  enumerable: true,
package/dist/lib/index.js CHANGED
@@ -10,7 +10,7 @@ export { createImportTransformer } from './chunk-YMEXAI6M.js';
10
10
  export { isolatedDeclarations } from './chunk-367E23MI.js';
11
11
  import './chunk-4BPHC6QQ.js';
12
12
  export { createUnplugin } from './chunk-I7BLJZ4D.js';
13
- export { createUnpluginFactory } from './chunk-6CV42PFW.js';
13
+ export { createUnpluginFactory } from './chunk-EG5DQURZ.js';
14
14
  export { getBaseFileHeader, getFileHeader } from './chunk-7R23HVGQ.js';
15
15
  import './chunk-FJMP4CXA.js';
16
16
  export { PowerlinesAPIContext } from './chunk-VWKNWAN3.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkNXRMBO47_cjs = require('../chunk-NXRMBO47.cjs');
3
+ var chunkB6IYKQHA_cjs = require('../chunk-B6IYKQHA.cjs');
4
4
  require('../chunk-MFC7UJHT.cjs');
5
5
  require('../chunk-26DEN74R.cjs');
6
6
  require('../chunk-DMSD5NS5.cjs');
@@ -29,7 +29,7 @@ require('../chunk-PK6SKIKE.cjs');
29
29
 
30
30
  Object.defineProperty(exports, "createUnpluginFactory", {
31
31
  enumerable: true,
32
- get: function () { return chunkNXRMBO47_cjs.createUnpluginFactory; }
32
+ get: function () { return chunkB6IYKQHA_cjs.createUnpluginFactory; }
33
33
  });
34
34
  //# sourceMappingURL=factory.cjs.map
35
35
  //# sourceMappingURL=factory.cjs.map
@@ -1,4 +1,4 @@
1
- export { createUnpluginFactory } from '../chunk-6CV42PFW.js';
1
+ export { createUnpluginFactory } from '../chunk-EG5DQURZ.js';
2
2
  import '../chunk-7R23HVGQ.js';
3
3
  import '../chunk-VWKNWAN3.js';
4
4
  import '../chunk-YVFFKAMF.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('../chunk-3GMJQ5G3.cjs');
4
4
  var chunkQVDESIYV_cjs = require('../chunk-QVDESIYV.cjs');
5
- var chunkNXRMBO47_cjs = require('../chunk-NXRMBO47.cjs');
5
+ var chunkB6IYKQHA_cjs = require('../chunk-B6IYKQHA.cjs');
6
6
  require('../chunk-MFC7UJHT.cjs');
7
7
  require('../chunk-26DEN74R.cjs');
8
8
  require('../chunk-DMSD5NS5.cjs');
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "createUnplugin", {
35
35
  });
36
36
  Object.defineProperty(exports, "createUnpluginFactory", {
37
37
  enumerable: true,
38
- get: function () { return chunkNXRMBO47_cjs.createUnpluginFactory; }
38
+ get: function () { return chunkB6IYKQHA_cjs.createUnpluginFactory; }
39
39
  });
40
40
  Object.defineProperty(exports, "combineContexts", {
41
41
  enumerable: true,
@@ -1,6 +1,6 @@
1
1
  import '../chunk-4BPHC6QQ.js';
2
2
  export { createUnplugin } from '../chunk-I7BLJZ4D.js';
3
- export { createUnpluginFactory } from '../chunk-6CV42PFW.js';
3
+ export { createUnpluginFactory } from '../chunk-EG5DQURZ.js';
4
4
  import '../chunk-7R23HVGQ.js';
5
5
  import '../chunk-VWKNWAN3.js';
6
6
  import '../chunk-YVFFKAMF.js';
package/dist/next.cjs CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkDSRFCFMF_cjs = require('./chunk-DSRFCFMF.cjs');
6
- require('./chunk-EDURJN6H.cjs');
7
- require('./chunk-W6EJUB3S.cjs');
5
+ var chunkGRREX4AZ_cjs = require('./chunk-GRREX4AZ.cjs');
6
+ require('./chunk-7HN4NUEP.cjs');
7
+ require('./chunk-I63BFWL7.cjs');
8
8
  require('./chunk-B6DVCLP5.cjs');
9
9
  require('./chunk-V5WOGN7O.cjs');
10
10
  require('./chunk-Z6ARQDHR.cjs');
@@ -17,7 +17,7 @@ function next(config = {}) {
17
17
  webpack(webpackConfig, context) {
18
18
  const result = config.webpack?.(webpackConfig, context) || webpackConfig;
19
19
  result.plugins ??= [];
20
- result.plugins.push(chunkDSRFCFMF_cjs.webpack_default(webpackConfig));
20
+ result.plugins.push(chunkGRREX4AZ_cjs.webpack_default(webpackConfig));
21
21
  return result;
22
22
  }
23
23
  };
package/dist/next.js CHANGED
@@ -1,6 +1,6 @@
1
- import { webpack_default } from './chunk-4NWPQX5R.js';
2
- import './chunk-GFEZTRXL.js';
3
- import './chunk-YPVXCIVO.js';
1
+ import { webpack_default } from './chunk-LROIIYPX.js';
2
+ import './chunk-ZBPEEQD7.js';
3
+ import './chunk-46MYUNRY.js';
4
4
  import './chunk-PQXP7XQK.js';
5
5
  import './chunk-NITQ5IYP.js';
6
6
  import './chunk-2MYPFASJ.js';
package/dist/nuxt.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkIY62R4ON_cjs = require('./chunk-IY62R4ON.cjs');
5
+ var chunkJZOLOGPH_cjs = require('./chunk-JZOLOGPH.cjs');
6
6
  require('./chunk-NSSJOBJ7.cjs');
7
- var chunkDSRFCFMF_cjs = require('./chunk-DSRFCFMF.cjs');
8
- require('./chunk-EDURJN6H.cjs');
9
- var chunkW6EJUB3S_cjs = require('./chunk-W6EJUB3S.cjs');
7
+ var chunkGRREX4AZ_cjs = require('./chunk-GRREX4AZ.cjs');
8
+ require('./chunk-7HN4NUEP.cjs');
9
+ var chunkI63BFWL7_cjs = require('./chunk-I63BFWL7.cjs');
10
10
  require('./chunk-B6DVCLP5.cjs');
11
11
  require('./chunk-V5WOGN7O.cjs');
12
12
  require('./chunk-Z6ARQDHR.cjs');
@@ -15,8 +15,8 @@ var kit = require('@nuxt/kit');
15
15
 
16
16
  var nuxt = kit.defineNuxtModule({
17
17
  meta: {
18
- name: chunkW6EJUB3S_cjs.name,
19
- version: chunkW6EJUB3S_cjs.version,
18
+ name: chunkI63BFWL7_cjs.name,
19
+ version: chunkI63BFWL7_cjs.version,
20
20
  configKey: "powerlines",
21
21
  compatibility: {
22
22
  builder: {
@@ -26,8 +26,8 @@ var nuxt = kit.defineNuxtModule({
26
26
  },
27
27
  defaults: {},
28
28
  setup(options) {
29
- kit.addVitePlugin(() => chunkIY62R4ON_cjs.vite_default(options));
30
- kit.addWebpackPlugin(() => chunkDSRFCFMF_cjs.webpack_default(options));
29
+ kit.addVitePlugin(() => chunkJZOLOGPH_cjs.vite_default(options));
30
+ kit.addWebpackPlugin(() => chunkGRREX4AZ_cjs.webpack_default(options));
31
31
  }
32
32
  });
33
33
  var nuxt_default = nuxt;