@powerlines/plugin-date 0.12.259 → 0.12.260

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 (163) hide show
  1. package/dist/components/date-fns.cjs +2 -3
  2. package/dist/components/date-fns.mjs +1 -1
  3. package/dist/components/dayjs.cjs +2 -3
  4. package/dist/components/dayjs.mjs +1 -1
  5. package/dist/components/luxon.cjs +2 -3
  6. package/dist/components/luxon.mjs +1 -1
  7. package/dist/components/moment.cjs +2 -3
  8. package/dist/components/moment.mjs +1 -1
  9. package/dist/deepkit/schemas/reflection.cjs +3998 -0
  10. package/dist/deepkit/schemas/reflection.mjs +3996 -0
  11. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  12. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  13. package/dist/deepkit/src/capnp.cjs +913 -0
  14. package/dist/deepkit/src/capnp.mjs +911 -0
  15. package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
  16. package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
  17. package/dist/deepkit/src/reflect-type.cjs +22 -0
  18. package/dist/deepkit/src/reflect-type.mjs +20 -0
  19. package/dist/deepkit/src/resolve-reflections.cjs +16 -0
  20. package/dist/deepkit/src/resolve-reflections.mjs +15 -0
  21. package/dist/deepkit/src/transformer.cjs +52 -0
  22. package/dist/deepkit/src/transformer.mjs +49 -0
  23. package/dist/deepkit/src/transpile.cjs +29 -0
  24. package/dist/deepkit/src/transpile.mjs +27 -0
  25. package/dist/deepkit/src/utilities.cjs +67 -0
  26. package/dist/deepkit/src/utilities.mjs +66 -0
  27. package/dist/index.cjs +5 -5
  28. package/dist/index.d.mts +1 -1
  29. package/dist/index.mjs +3 -3
  30. package/dist/plugin-alloy/src/core/components/output.cjs +36 -0
  31. package/dist/plugin-alloy/src/core/components/output.mjs +35 -0
  32. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +20 -0
  33. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +19 -0
  34. package/dist/plugin-alloy/src/core/components/source-file.cjs +60 -0
  35. package/dist/plugin-alloy/src/core/components/source-file.mjs +58 -0
  36. package/dist/plugin-alloy/src/core/contexts/context.cjs +38 -0
  37. package/dist/plugin-alloy/src/core/contexts/context.mjs +34 -0
  38. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  39. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  40. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
  41. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
  42. package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
  43. package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
  44. package/dist/plugin-alloy/src/index.cjs +102 -0
  45. package/dist/plugin-alloy/src/index.mjs +100 -0
  46. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +89 -0
  47. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +88 -0
  48. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +33 -0
  49. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +32 -0
  50. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +18 -0
  51. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
  52. package/dist/plugin-alloy/src/types/components.d.mts +3 -0
  53. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  54. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +52 -0
  55. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +51 -0
  56. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +78 -0
  57. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +76 -0
  58. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +364 -0
  59. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +355 -0
  60. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +157 -0
  61. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +154 -0
  62. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +57 -0
  63. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +56 -0
  64. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +94 -0
  65. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +93 -0
  66. package/dist/plugin-automd/src/index.cjs +101 -0
  67. package/dist/plugin-automd/src/index.mjs +98 -0
  68. package/dist/{packages/plugin-automd → plugin-automd}/src/types/plugin.d.mts +3 -1
  69. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
  70. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
  71. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
  72. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
  73. package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
  74. package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
  75. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  76. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  77. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
  78. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
  79. package/dist/plugin-babel/src/helpers/options.cjs +49 -0
  80. package/dist/plugin-babel/src/helpers/options.mjs +46 -0
  81. package/dist/plugin-babel/src/index.cjs +85 -0
  82. package/dist/plugin-babel/src/index.mjs +83 -0
  83. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  84. package/dist/plugin-env/src/babel/index.cjs +1 -0
  85. package/dist/plugin-env/src/babel/index.mjs +3 -0
  86. package/dist/plugin-env/src/babel/plugin.cjs +70 -0
  87. package/dist/plugin-env/src/babel/plugin.mjs +69 -0
  88. package/dist/plugin-env/src/components/docs.cjs +60 -0
  89. package/dist/plugin-env/src/components/docs.mjs +59 -0
  90. package/dist/plugin-env/src/components/env.cjs +497 -0
  91. package/dist/plugin-env/src/components/env.mjs +494 -0
  92. package/dist/plugin-env/src/components/index.cjs +2 -0
  93. package/dist/plugin-env/src/components/index.mjs +4 -0
  94. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
  95. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
  96. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
  97. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
  98. package/dist/plugin-env/src/helpers/docs-helper.cjs +16 -0
  99. package/dist/plugin-env/src/helpers/docs-helper.mjs +15 -0
  100. package/dist/plugin-env/src/helpers/index.cjs +6 -0
  101. package/dist/plugin-env/src/helpers/index.mjs +8 -0
  102. package/dist/plugin-env/src/helpers/load.cjs +84 -0
  103. package/dist/plugin-env/src/helpers/load.mjs +81 -0
  104. package/dist/plugin-env/src/helpers/persistence.cjs +201 -0
  105. package/dist/plugin-env/src/helpers/persistence.mjs +190 -0
  106. package/dist/plugin-env/src/helpers/reflect.cjs +125 -0
  107. package/dist/plugin-env/src/helpers/reflect.mjs +117 -0
  108. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
  109. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
  110. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
  111. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
  112. package/dist/plugin-env/src/index.cjs +174 -0
  113. package/dist/plugin-env/src/index.mjs +172 -0
  114. package/dist/{packages/plugin-env → plugin-env}/src/types/plugin.d.mts +3 -1
  115. package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +2 -0
  116. package/dist/powerlines/src/lib/build/esbuild.cjs +93 -0
  117. package/dist/powerlines/src/lib/build/esbuild.mjs +91 -0
  118. package/dist/powerlines/src/lib/constants/environments.cjs +6 -0
  119. package/dist/powerlines/src/lib/constants/environments.mjs +5 -0
  120. package/dist/powerlines/src/lib/entry.cjs +11 -0
  121. package/dist/powerlines/src/lib/entry.mjs +13 -0
  122. package/dist/powerlines/src/lib/logger.cjs +41 -0
  123. package/dist/powerlines/src/lib/logger.mjs +39 -0
  124. package/dist/powerlines/src/lib/unplugin/helpers.cjs +3 -0
  125. package/dist/powerlines/src/lib/unplugin/helpers.mjs +5 -0
  126. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +66 -0
  127. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +65 -0
  128. package/dist/powerlines/src/lib/unplugin/plugin.cjs +46 -0
  129. package/dist/powerlines/src/lib/unplugin/plugin.mjs +45 -0
  130. package/dist/powerlines/src/lib/utilities/bundle.cjs +42 -0
  131. package/dist/powerlines/src/lib/utilities/bundle.mjs +40 -0
  132. package/dist/powerlines/src/lib/utilities/file-header.cjs +22 -0
  133. package/dist/powerlines/src/lib/utilities/file-header.mjs +21 -0
  134. package/dist/powerlines/src/lib/utilities/resolve.cjs +50 -0
  135. package/dist/powerlines/src/lib/utilities/resolve.mjs +49 -0
  136. package/dist/powerlines/src/lib/utilities/source-file.cjs +5 -0
  137. package/dist/powerlines/src/lib/utilities/source-file.mjs +5 -0
  138. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  139. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
  140. package/dist/powerlines/src/types/build.cjs +21 -0
  141. package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +6 -6
  142. package/dist/powerlines/src/types/build.mjs +21 -0
  143. package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +1 -0
  144. package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +3 -2
  145. package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +2 -2
  146. package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +1 -1
  147. package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +1 -1
  148. package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +2 -1
  149. package/dist/types/plugin.d.mts +1 -1
  150. package/package.json +4 -4
  151. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
  152. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -42
  153. /package/dist/{packages/deepkit → deepkit}/schemas/reflection.d.mts +0 -0
  154. /package/dist/{packages/deepkit → deepkit}/src/types.d.mts +0 -0
  155. /package/dist/{packages/plugin-alloy → plugin-alloy}/src/types/plugin.d.mts +0 -0
  156. /package/dist/{packages/plugin-automd → plugin-automd}/src/types/toc.d.mts +0 -0
  157. /package/dist/{packages/plugin-babel → plugin-babel}/src/types/plugin.d.mts +0 -0
  158. /package/dist/{packages/plugin-env → plugin-env}/src/types/runtime.d.mts +0 -0
  159. /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
  160. /package/dist/{packages/powerlines → powerlines}/src/types/babel.d.mts +0 -0
  161. /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
  162. /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
  163. /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
@@ -1,3 +1,5 @@
1
+ import "../../types/hooks.mjs";
2
+ import "../../types/resolved.mjs";
1
3
  import { SelectHooksOptions } from "../../types/context.mjs";
2
4
  import { MaybePromise } from "@stryke/types/base";
3
5
 
@@ -0,0 +1,93 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ require('../entry.cjs');
3
+ let defu = require("defu");
4
+ defu = require_rolldown_runtime.__toESM(defu);
5
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
6
+ let __stryke_path_replace = require("@stryke/path/replace");
7
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
8
+ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
9
+ let __stryke_helpers_omit = require("@stryke/helpers/omit");
10
+
11
+ //#region ../powerlines/src/lib/build/esbuild.ts
12
+ const DEFAULT_ESBUILD_CONFIG = {
13
+ target: "esnext",
14
+ platform: "neutral",
15
+ format: "esm",
16
+ write: true,
17
+ minify: true,
18
+ sourcemap: false,
19
+ bundle: true,
20
+ treeShaking: true,
21
+ keepNames: true,
22
+ splitting: true,
23
+ logLevel: "silent"
24
+ };
25
+ /**
26
+ * Resolves the esbuild options.
27
+ *
28
+ * @param context - The build context.
29
+ * @returns The resolved esbuild options.
30
+ */
31
+ function extractESBuildConfig(context) {
32
+ const inject = context.config.build.override.inject ?? context.config.build.inject;
33
+ if (inject && Object.keys(inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
34
+ if (value) if (Array.isArray(value)) {
35
+ if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
36
+ if (value.length === 1) return `
37
+ import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
38
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
39
+ else if (value.length > 1) return `
40
+ import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
41
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
42
+ } else if (value.length === 1) return `
43
+ import ${key} from "${value[0]}";
44
+ export { ${key} };`;
45
+ else if (value.length > 1) return `
46
+ import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
47
+ export { ${key} };`;
48
+ } else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
49
+ import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
50
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
51
+ else return `
52
+ import ${key} from "${value}";
53
+ export { ${key} };`;
54
+ return "";
55
+ }).join("\n"));
56
+ return (0, defu.default)({
57
+ alias: context.alias,
58
+ inject: inject && Object.keys(inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
59
+ }, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
60
+ "alias",
61
+ "inject",
62
+ "external",
63
+ "noExternal",
64
+ "skipNodeModulesBundle",
65
+ "extensions"
66
+ ]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
67
+ "alias",
68
+ "inject",
69
+ "external",
70
+ "noExternal",
71
+ "skipNodeModulesBundle",
72
+ "extensions",
73
+ "variant",
74
+ "override"
75
+ ]) : {}, {
76
+ mainFields: context.config.build.mainFields,
77
+ conditions: context.config.build.conditions,
78
+ define: context.config.build.define,
79
+ resolveExtensions: context.config.build.extensions,
80
+ packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
81
+ format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
82
+ platform: context.config.build.platform,
83
+ treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
84
+ outdir: context.config.output.buildPath,
85
+ tsconfig: context.tsconfig.tsconfigFilePath,
86
+ minify: context.config.mode !== "development",
87
+ metafile: context.config.mode === "development",
88
+ sourcemap: context.config.mode === "development"
89
+ }, DEFAULT_ESBUILD_CONFIG);
90
+ }
91
+
92
+ //#endregion
93
+ exports.extractESBuildConfig = extractESBuildConfig;
@@ -0,0 +1,91 @@
1
+ import "../entry.mjs";
2
+ import defu from "defu";
3
+ import { isString } from "@stryke/type-checks/is-string";
4
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
5
+ import { joinPaths } from "@stryke/path/join-paths";
6
+ import { camelCase } from "@stryke/string-format/camel-case";
7
+ import { omit } from "@stryke/helpers/omit";
8
+
9
+ //#region ../powerlines/src/lib/build/esbuild.ts
10
+ const DEFAULT_ESBUILD_CONFIG = {
11
+ target: "esnext",
12
+ platform: "neutral",
13
+ format: "esm",
14
+ write: true,
15
+ minify: true,
16
+ sourcemap: false,
17
+ bundle: true,
18
+ treeShaking: true,
19
+ keepNames: true,
20
+ splitting: true,
21
+ logLevel: "silent"
22
+ };
23
+ /**
24
+ * Resolves the esbuild options.
25
+ *
26
+ * @param context - The build context.
27
+ * @returns The resolved esbuild options.
28
+ */
29
+ function extractESBuildConfig(context) {
30
+ const inject = context.config.build.override.inject ?? context.config.build.inject;
31
+ if (inject && Object.keys(inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
32
+ if (value) if (Array.isArray(value)) {
33
+ if (camelCase(key) !== key) {
34
+ if (value.length === 1) return `
35
+ import ${camelCase(key)} from "${value[0]}";
36
+ export { ${camelCase(key)} as "${key}" }`;
37
+ else if (value.length > 1) return `
38
+ import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
39
+ export { ${camelCase(key)} as "${key}" }`;
40
+ } else if (value.length === 1) return `
41
+ import ${key} from "${value[0]}";
42
+ export { ${key} };`;
43
+ else if (value.length > 1) return `
44
+ import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
45
+ export { ${key} };`;
46
+ } else if (camelCase(key) !== key) return `
47
+ import ${camelCase(key)} from "${value[0]}";
48
+ export { ${camelCase(key)} as "${key}" }`;
49
+ else return `
50
+ import ${key} from "${value}";
51
+ export { ${key} };`;
52
+ return "";
53
+ }).join("\n"));
54
+ return defu({
55
+ alias: context.alias,
56
+ inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
57
+ }, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
58
+ "alias",
59
+ "inject",
60
+ "external",
61
+ "noExternal",
62
+ "skipNodeModulesBundle",
63
+ "extensions"
64
+ ]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
65
+ "alias",
66
+ "inject",
67
+ "external",
68
+ "noExternal",
69
+ "skipNodeModulesBundle",
70
+ "extensions",
71
+ "variant",
72
+ "override"
73
+ ]) : {}, {
74
+ mainFields: context.config.build.mainFields,
75
+ conditions: context.config.build.conditions,
76
+ define: context.config.build.define,
77
+ resolveExtensions: context.config.build.extensions,
78
+ packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
79
+ format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
80
+ platform: context.config.build.platform,
81
+ treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
82
+ outdir: context.config.output.buildPath,
83
+ tsconfig: context.tsconfig.tsconfigFilePath,
84
+ minify: context.config.mode !== "development",
85
+ metafile: context.config.mode === "development",
86
+ sourcemap: context.config.mode === "development"
87
+ }, DEFAULT_ESBUILD_CONFIG);
88
+ }
89
+
90
+ //#endregion
91
+ export { extractESBuildConfig };
@@ -0,0 +1,6 @@
1
+
2
+ //#region ../powerlines/src/lib/constants/environments.ts
3
+ const DEFAULT_ENVIRONMENT = "default";
4
+
5
+ //#endregion
6
+ exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT;
@@ -0,0 +1,5 @@
1
+ //#region ../powerlines/src/lib/constants/environments.ts
2
+ const DEFAULT_ENVIRONMENT = "default";
3
+
4
+ //#endregion
5
+ export { DEFAULT_ENVIRONMENT };
@@ -0,0 +1,11 @@
1
+ require('../plugin-utils/paths.cjs');
2
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
3
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
4
+ let __stryke_path_replace = require("@stryke/path/replace");
5
+ let __stryke_convert_to_array = require("@stryke/convert/to-array");
6
+ let __stryke_path_append = require("@stryke/path/append");
7
+ let __stryke_path_is_type = require("@stryke/path/is-type");
8
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
9
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
10
+ let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
11
+ require("@stryke/hash/murmurhash");
@@ -0,0 +1,13 @@
1
+ import "../plugin-utils/paths.mjs";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+ import { isString } from "@stryke/type-checks/is-string";
4
+ import { replaceExtension, replacePath } from "@stryke/path/replace";
5
+ import { toArray } from "@stryke/convert/to-array";
6
+ import { appendPath } from "@stryke/path/append";
7
+ import { isAbsolutePath } from "@stryke/path/is-type";
8
+ import { joinPaths } from "@stryke/path/join-paths";
9
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
10
+ import { getUniqueBy } from "@stryke/helpers/get-unique";
11
+ import "@stryke/hash/murmurhash";
12
+
13
+ export { };
@@ -0,0 +1,41 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ let chalk = require("chalk");
3
+ chalk = require_rolldown_runtime.__toESM(chalk);
4
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
5
+ require("@storm-software/config-tools/logger");
6
+ require("@storm-software/config-tools/utilities/colors");
7
+ require("@stryke/helpers/noop");
8
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
+
11
+ //#region ../powerlines/src/lib/logger.ts
12
+ const BADGE_COLORS = [
13
+ "#00A0DD",
14
+ "#6FCE4E",
15
+ "#FBBF24",
16
+ "#F43F5E",
17
+ "#3B82F6",
18
+ "#A855F7",
19
+ "#469592",
20
+ "#288EDF",
21
+ "#D8B4FE",
22
+ "#10B981",
23
+ "#EF4444",
24
+ "#F0EC56",
25
+ "#F472B6",
26
+ "#22D3EE",
27
+ "#EAB308",
28
+ "#84CC16",
29
+ "#F87171",
30
+ "#0EA5E9",
31
+ "#D946EF",
32
+ "#FACC15",
33
+ "#34D399",
34
+ "#8B5CF6"
35
+ ];
36
+ const extendLog = (logFn, name) => {
37
+ return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
38
+ };
39
+
40
+ //#endregion
41
+ exports.extendLog = extendLog;
@@ -0,0 +1,39 @@
1
+ import chalk from "chalk";
2
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
+ import "@storm-software/config-tools/logger";
4
+ import "@storm-software/config-tools/utilities/colors";
5
+ import "@stryke/helpers/noop";
6
+ import { kebabCase } from "@stryke/string-format/kebab-case";
7
+ import { titleCase } from "@stryke/string-format/title-case";
8
+
9
+ //#region ../powerlines/src/lib/logger.ts
10
+ const BADGE_COLORS = [
11
+ "#00A0DD",
12
+ "#6FCE4E",
13
+ "#FBBF24",
14
+ "#F43F5E",
15
+ "#3B82F6",
16
+ "#A855F7",
17
+ "#469592",
18
+ "#288EDF",
19
+ "#D8B4FE",
20
+ "#10B981",
21
+ "#EF4444",
22
+ "#F0EC56",
23
+ "#F472B6",
24
+ "#22D3EE",
25
+ "#EAB308",
26
+ "#84CC16",
27
+ "#F87171",
28
+ "#0EA5E9",
29
+ "#D946EF",
30
+ "#FACC15",
31
+ "#34D399",
32
+ "#8B5CF6"
33
+ ];
34
+ const extendLog = (logFn, name) => {
35
+ return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
36
+ };
37
+
38
+ //#endregion
39
+ export { extendLog };
@@ -0,0 +1,3 @@
1
+ require('../../types/build.cjs');
2
+ let defu = require("defu");
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
@@ -0,0 +1,5 @@
1
+ import "../../types/build.mjs";
2
+ import "defu";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+
5
+ export { };
@@ -0,0 +1,66 @@
1
+
2
+ //#region ../powerlines/src/lib/unplugin/module-resolution.ts
3
+ /**
4
+ * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
5
+ *
6
+ * @remarks
7
+ * This includes the `resolveId` and `load` hooks.
8
+ *
9
+ * @see https://rollupjs.org/plugin-development/#resolveid
10
+ * @see https://rollupjs.org/plugin-development/#load
11
+ *
12
+ * @param context - The plugin context.
13
+ * @returns The module resolution hooks (`resolveId` and `load`).
14
+ */
15
+ function createUnpluginModuleResolutionFunctions(context) {
16
+ const ctx = context;
17
+ async function resolveId(id, importer, opts = { isEntry: false }) {
18
+ let result = await ctx.$$internal.callHook("resolveId", {
19
+ sequential: true,
20
+ result: "first",
21
+ order: "pre"
22
+ }, id, importer, opts);
23
+ if (result) return result;
24
+ result = await ctx.$$internal.callHook("resolveId", {
25
+ sequential: true,
26
+ result: "first",
27
+ order: "normal"
28
+ }, id, importer, opts);
29
+ if (result) return result;
30
+ result = await ctx.resolve(id, importer, opts);
31
+ if (result) return result;
32
+ return ctx.$$internal.callHook("resolveId", {
33
+ sequential: true,
34
+ result: "first",
35
+ order: "post"
36
+ }, id, importer, opts);
37
+ }
38
+ async function load(id) {
39
+ let result = await ctx.$$internal.callHook("load", {
40
+ sequential: true,
41
+ result: "first",
42
+ order: "pre"
43
+ }, id);
44
+ if (result) return result;
45
+ result = await ctx.$$internal.callHook("load", {
46
+ sequential: true,
47
+ result: "first",
48
+ order: "normal"
49
+ }, id);
50
+ if (result) return result;
51
+ result = await ctx.load(id);
52
+ if (result) return result;
53
+ return ctx.$$internal.callHook("load", {
54
+ sequential: true,
55
+ result: "first",
56
+ order: "post"
57
+ }, id);
58
+ }
59
+ return {
60
+ resolveId,
61
+ load
62
+ };
63
+ }
64
+
65
+ //#endregion
66
+ exports.createUnpluginModuleResolutionFunctions = createUnpluginModuleResolutionFunctions;
@@ -0,0 +1,65 @@
1
+ //#region ../powerlines/src/lib/unplugin/module-resolution.ts
2
+ /**
3
+ * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
4
+ *
5
+ * @remarks
6
+ * This includes the `resolveId` and `load` hooks.
7
+ *
8
+ * @see https://rollupjs.org/plugin-development/#resolveid
9
+ * @see https://rollupjs.org/plugin-development/#load
10
+ *
11
+ * @param context - The plugin context.
12
+ * @returns The module resolution hooks (`resolveId` and `load`).
13
+ */
14
+ function createUnpluginModuleResolutionFunctions(context) {
15
+ const ctx = context;
16
+ async function resolveId(id, importer, opts = { isEntry: false }) {
17
+ let result = await ctx.$$internal.callHook("resolveId", {
18
+ sequential: true,
19
+ result: "first",
20
+ order: "pre"
21
+ }, id, importer, opts);
22
+ if (result) return result;
23
+ result = await ctx.$$internal.callHook("resolveId", {
24
+ sequential: true,
25
+ result: "first",
26
+ order: "normal"
27
+ }, id, importer, opts);
28
+ if (result) return result;
29
+ result = await ctx.resolve(id, importer, opts);
30
+ if (result) return result;
31
+ return ctx.$$internal.callHook("resolveId", {
32
+ sequential: true,
33
+ result: "first",
34
+ order: "post"
35
+ }, id, importer, opts);
36
+ }
37
+ async function load(id) {
38
+ let result = await ctx.$$internal.callHook("load", {
39
+ sequential: true,
40
+ result: "first",
41
+ order: "pre"
42
+ }, id);
43
+ if (result) return result;
44
+ result = await ctx.$$internal.callHook("load", {
45
+ sequential: true,
46
+ result: "first",
47
+ order: "normal"
48
+ }, id);
49
+ if (result) return result;
50
+ result = await ctx.load(id);
51
+ if (result) return result;
52
+ return ctx.$$internal.callHook("load", {
53
+ sequential: true,
54
+ result: "first",
55
+ order: "post"
56
+ }, id);
57
+ }
58
+ return {
59
+ resolveId,
60
+ load
61
+ };
62
+ }
63
+
64
+ //#endregion
65
+ export { createUnpluginModuleResolutionFunctions };
@@ -0,0 +1,46 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_logger = require('../logger.cjs');
3
+ require('../utilities/source-file.cjs');
4
+ require('./helpers.cjs');
5
+ const require_module_resolution = require('./module-resolution.cjs');
6
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
7
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
8
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
9
+ let unplugin = require("unplugin");
10
+
11
+ //#region ../powerlines/src/lib/unplugin/plugin.ts
12
+ /**
13
+ * Creates a Powerlines unplugin instance.
14
+ *
15
+ * @param context - The plugin context.
16
+ * @returns The unplugin instance.
17
+ */
18
+ function createUnpluginResolver(context, name = "unplugin") {
19
+ const ctx = context;
20
+ (0, unplugin.setParseImpl)(ctx.parse);
21
+ return () => {
22
+ const log = require_logger.extendLog(ctx.log, name);
23
+ log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${(0, __stryke_string_format_title_case.titleCase)(name)} - Unplugin`} plugin`);
24
+ try {
25
+ const { resolveId, load } = require_module_resolution.createUnpluginModuleResolutionFunctions(context);
26
+ return {
27
+ name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${(0, __stryke_string_format_kebab_case.kebabCase)(name)}`,
28
+ api: ctx.$$internal.api,
29
+ resolveId: {
30
+ filter: { id: { include: [/.*/] } },
31
+ handler: resolveId
32
+ },
33
+ load: {
34
+ filter: { id: { include: [/.*/] } },
35
+ handler: load
36
+ }
37
+ };
38
+ } catch (error) {
39
+ log(__storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
40
+ throw error;
41
+ }
42
+ };
43
+ }
44
+
45
+ //#endregion
46
+ exports.createUnpluginResolver = createUnpluginResolver;
@@ -0,0 +1,45 @@
1
+ import { extendLog } from "../logger.mjs";
2
+ import "../utilities/source-file.mjs";
3
+ import "./helpers.mjs";
4
+ import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
5
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
6
+ import { kebabCase } from "@stryke/string-format/kebab-case";
7
+ import { titleCase } from "@stryke/string-format/title-case";
8
+ import { setParseImpl } from "unplugin";
9
+
10
+ //#region ../powerlines/src/lib/unplugin/plugin.ts
11
+ /**
12
+ * Creates a Powerlines unplugin instance.
13
+ *
14
+ * @param context - The plugin context.
15
+ * @returns The unplugin instance.
16
+ */
17
+ function createUnpluginResolver(context, name = "unplugin") {
18
+ const ctx = context;
19
+ setParseImpl(ctx.parse);
20
+ return () => {
21
+ const log = extendLog(ctx.log, name);
22
+ log(LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${titleCase(name)} - Unplugin`} plugin`);
23
+ try {
24
+ const { resolveId, load } = createUnpluginModuleResolutionFunctions(context);
25
+ return {
26
+ name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${kebabCase(name)}`,
27
+ api: ctx.$$internal.api,
28
+ resolveId: {
29
+ filter: { id: { include: [/.*/] } },
30
+ handler: resolveId
31
+ },
32
+ load: {
33
+ filter: { id: { include: [/.*/] } },
34
+ handler: load
35
+ }
36
+ };
37
+ } catch (error) {
38
+ log(LogLevelLabel.FATAL, error?.message);
39
+ throw error;
40
+ }
41
+ };
42
+ }
43
+
44
+ //#endregion
45
+ export { createUnpluginResolver };
@@ -0,0 +1,42 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_esbuild = require('../build/esbuild.cjs');
3
+ const require_plugin = require('../unplugin/plugin.cjs');
4
+ let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
5
+ let defu = require("defu");
6
+ defu = require_rolldown_runtime.__toESM(defu);
7
+ let esbuild = require("esbuild");
8
+ let unplugin = require("unplugin");
9
+
10
+ //#region ../powerlines/src/lib/utilities/bundle.ts
11
+ /**
12
+ * Bundle a type definition to a module.
13
+ *
14
+ * @param context - The context object containing the environment paths.
15
+ * @param file - The file path to bundle.
16
+ * @param overrides - Optional overrides for the ESBuild configuration.
17
+ * @returns A promise that resolves to the bundled module.
18
+ */
19
+ async function bundle(context, file, overrides = {}) {
20
+ const path = await context.fs.resolve(file);
21
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
22
+ const result = await (0, esbuild.build)((0, defu.default)({
23
+ ...require_esbuild.extractESBuildConfig(context),
24
+ entryPoints: [path],
25
+ write: false,
26
+ sourcemap: false,
27
+ splitting: false,
28
+ treeShaking: false,
29
+ bundle: true,
30
+ packages: "bundle",
31
+ platform: "node",
32
+ logLevel: "silent",
33
+ ...overrides
34
+ }, { plugins: [(0, unplugin.createEsbuildPlugin)(require_plugin.createUnpluginResolver(context, `${(0, __stryke_path_file_path_fns.findFileName)(file)} Bundler`))({})] }));
35
+ if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
36
+ if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
37
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
38
+ return result.outputFiles.filter(Boolean)[0];
39
+ }
40
+
41
+ //#endregion
42
+ exports.bundle = bundle;
@@ -0,0 +1,40 @@
1
+ import { extractESBuildConfig } from "../build/esbuild.mjs";
2
+ import { createUnpluginResolver } from "../unplugin/plugin.mjs";
3
+ import { findFileName } from "@stryke/path/file-path-fns";
4
+ import defu from "defu";
5
+ import { build } from "esbuild";
6
+ import { createEsbuildPlugin } from "unplugin";
7
+
8
+ //#region ../powerlines/src/lib/utilities/bundle.ts
9
+ /**
10
+ * Bundle a type definition to a module.
11
+ *
12
+ * @param context - The context object containing the environment paths.
13
+ * @param file - The file path to bundle.
14
+ * @param overrides - Optional overrides for the ESBuild configuration.
15
+ * @returns A promise that resolves to the bundled module.
16
+ */
17
+ async function bundle(context, file, overrides = {}) {
18
+ const path = await context.fs.resolve(file);
19
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
20
+ const result = await build(defu({
21
+ ...extractESBuildConfig(context),
22
+ entryPoints: [path],
23
+ write: false,
24
+ sourcemap: false,
25
+ splitting: false,
26
+ treeShaking: false,
27
+ bundle: true,
28
+ packages: "bundle",
29
+ platform: "node",
30
+ logLevel: "silent",
31
+ ...overrides
32
+ }, { plugins: [createEsbuildPlugin(createUnpluginResolver(context, `${findFileName(file)} Bundler`))({})] }));
33
+ if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
34
+ if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
35
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
36
+ return result.outputFiles.filter(Boolean)[0];
37
+ }
38
+
39
+ //#endregion
40
+ export { bundle };
@@ -0,0 +1,22 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
3
+
4
+ //#region ../powerlines/src/lib/utilities/file-header.ts
5
+ function getBaseFileHeader(context) {
6
+ return `
7
+ // Generated with ${(0, __stryke_string_format_title_case.titleCase)(context.config.framework)}
8
+ // Note: Do not edit this file manually - it will be overwritten automatically
9
+ `;
10
+ }
11
+ function getFileHeader(context, options = {}) {
12
+ const { directive = null, prettierIgnore = false } = options;
13
+ return `/* eslint-disable */
14
+ // biome-ignore lint: disable
15
+ ${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `\n\n${directive}\n` : "\n"}
16
+ ${getBaseFileHeader(context)}
17
+
18
+ `;
19
+ }
20
+
21
+ //#endregion
22
+ exports.getFileHeader = getFileHeader;