@powerlines/plugin-react 0.1.251 → 0.1.252

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 (192) hide show
  1. package/dist/components/react-optimized.cjs +7 -7
  2. package/dist/components/react-optimized.d.cts +1 -1
  3. package/dist/components/react-optimized.d.mts +1 -1
  4. package/dist/components/react-optimized.mjs +4 -4
  5. package/dist/index.cjs +13 -11
  6. package/dist/index.d.cts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.mjs +6 -6
  9. package/dist/types/plugin.d.cts +2 -2
  10. package/dist/types/plugin.d.mts +2 -2
  11. package/dist/types/runtime.d.cts +1 -1
  12. package/dist/types/runtime.d.mts +1 -1
  13. package/package.json +6 -6
  14. package/dist/deepkit/schemas/reflection.cjs +0 -3998
  15. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  16. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  17. package/dist/deepkit/schemas/reflection.mjs +0 -3996
  18. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  19. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  20. package/dist/deepkit/src/capnp.cjs +0 -913
  21. package/dist/deepkit/src/capnp.mjs +0 -911
  22. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  23. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  24. package/dist/deepkit/src/reflect-type.cjs +0 -22
  25. package/dist/deepkit/src/reflect-type.mjs +0 -20
  26. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  27. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  28. package/dist/deepkit/src/transformer.cjs +0 -52
  29. package/dist/deepkit/src/transformer.mjs +0 -49
  30. package/dist/deepkit/src/transpile.cjs +0 -29
  31. package/dist/deepkit/src/transpile.mjs +0 -27
  32. package/dist/deepkit/src/types.d.cts +0 -10
  33. package/dist/deepkit/src/types.d.mts +0 -10
  34. package/dist/deepkit/src/utilities.cjs +0 -67
  35. package/dist/deepkit/src/utilities.mjs +0 -66
  36. package/dist/plugin-alloy/src/core/components/output.cjs +0 -43
  37. package/dist/plugin-alloy/src/core/components/output.mjs +0 -42
  38. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
  39. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
  40. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
  41. package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
  42. package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
  43. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
  44. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -38
  45. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -34
  46. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  47. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  48. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  49. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  50. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  51. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  52. package/dist/plugin-alloy/src/index.cjs +0 -105
  53. package/dist/plugin-alloy/src/index.mjs +0 -103
  54. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
  55. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
  56. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
  57. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
  58. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
  59. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  60. package/dist/plugin-alloy/src/types/components.d.cts +0 -20
  61. package/dist/plugin-alloy/src/types/components.d.mts +0 -21
  62. package/dist/plugin-alloy/src/types/index.d.cts +0 -2
  63. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  64. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
  65. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
  66. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -62
  67. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
  68. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
  69. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -61
  70. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -131
  71. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -129
  72. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -451
  73. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
  74. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
  75. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -442
  76. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -216
  77. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
  78. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
  79. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -213
  80. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -72
  81. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -71
  82. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
  83. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
  84. package/dist/plugin-automd/src/index.cjs +0 -101
  85. package/dist/plugin-automd/src/index.mjs +0 -98
  86. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  87. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  88. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  89. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  90. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  91. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  92. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  93. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  94. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  95. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  96. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  97. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  98. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  99. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  100. package/dist/plugin-babel/src/helpers/options.cjs +0 -49
  101. package/dist/plugin-babel/src/helpers/options.mjs +0 -46
  102. package/dist/plugin-babel/src/index.cjs +0 -85
  103. package/dist/plugin-babel/src/index.mjs +0 -83
  104. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  105. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  106. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  107. package/dist/plugin-env/src/babel/index.cjs +0 -1
  108. package/dist/plugin-env/src/babel/index.mjs +0 -3
  109. package/dist/plugin-env/src/babel/plugin.cjs +0 -70
  110. package/dist/plugin-env/src/babel/plugin.mjs +0 -69
  111. package/dist/plugin-env/src/components/docs.cjs +0 -70
  112. package/dist/plugin-env/src/components/docs.mjs +0 -69
  113. package/dist/plugin-env/src/components/env.cjs +0 -589
  114. package/dist/plugin-env/src/components/env.mjs +0 -586
  115. package/dist/plugin-env/src/components/index.cjs +0 -2
  116. package/dist/plugin-env/src/components/index.mjs +0 -4
  117. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  118. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  119. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  120. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  121. package/dist/plugin-env/src/helpers/docs-helper.cjs +0 -16
  122. package/dist/plugin-env/src/helpers/docs-helper.mjs +0 -15
  123. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  124. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  125. package/dist/plugin-env/src/helpers/load.cjs +0 -84
  126. package/dist/plugin-env/src/helpers/load.mjs +0 -81
  127. package/dist/plugin-env/src/helpers/persistence.cjs +0 -201
  128. package/dist/plugin-env/src/helpers/persistence.mjs +0 -190
  129. package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
  130. package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
  131. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  132. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  133. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  134. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  135. package/dist/plugin-env/src/index.cjs +0 -177
  136. package/dist/plugin-env/src/index.mjs +0 -175
  137. package/dist/plugin-env/src/types/plugin.d.cts +0 -149
  138. package/dist/plugin-env/src/types/plugin.d.mts +0 -150
  139. package/dist/plugin-env/src/types/runtime.d.cts +0 -789
  140. package/dist/plugin-env/src/types/runtime.d.mts +0 -789
  141. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  142. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  143. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -93
  144. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -91
  145. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  146. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  147. package/dist/powerlines/src/lib/entry.cjs +0 -11
  148. package/dist/powerlines/src/lib/entry.mjs +0 -13
  149. package/dist/powerlines/src/lib/logger.cjs +0 -41
  150. package/dist/powerlines/src/lib/logger.mjs +0 -39
  151. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +0 -38
  152. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +0 -35
  153. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -3
  154. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -5
  155. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -66
  156. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -65
  157. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -46
  158. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -45
  159. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -42
  160. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -40
  161. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -50
  162. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -49
  163. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -5
  164. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -5
  165. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  166. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  167. package/dist/powerlines/src/types/api.d.cts +0 -104
  168. package/dist/powerlines/src/types/api.d.mts +0 -104
  169. package/dist/powerlines/src/types/babel.d.cts +0 -22
  170. package/dist/powerlines/src/types/babel.d.mts +0 -22
  171. package/dist/powerlines/src/types/build.cjs +0 -21
  172. package/dist/powerlines/src/types/build.d.cts +0 -185
  173. package/dist/powerlines/src/types/build.d.mts +0 -185
  174. package/dist/powerlines/src/types/build.mjs +0 -21
  175. package/dist/powerlines/src/types/commands.d.cts +0 -8
  176. package/dist/powerlines/src/types/commands.d.mts +0 -9
  177. package/dist/powerlines/src/types/config.d.cts +0 -435
  178. package/dist/powerlines/src/types/config.d.mts +0 -436
  179. package/dist/powerlines/src/types/context.d.cts +0 -514
  180. package/dist/powerlines/src/types/context.d.mts +0 -514
  181. package/dist/powerlines/src/types/fs.d.cts +0 -486
  182. package/dist/powerlines/src/types/fs.d.mts +0 -486
  183. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  184. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  185. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  186. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  187. package/dist/powerlines/src/types/resolved.d.cts +0 -94
  188. package/dist/powerlines/src/types/resolved.d.mts +0 -94
  189. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  190. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  191. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  192. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,47 +0,0 @@
1
- import { SelectHooksOptions } from "../../types/context.cjs";
2
- import { MaybePromise } from "@stryke/types/base";
3
-
4
- //#region ../powerlines/src/internal/helpers/hooks.d.ts
5
- type CallHookOptions = SelectHooksOptions & (({
6
- /**
7
- * Whether to call the hooks sequentially or in parallel.
8
- *
9
- * @defaultValue true
10
- */
11
- sequential?: true;
12
- } & ({
13
- /**
14
- * How to handle multiple return values from hooks.
15
- * - "merge": Merge all non-undefined return values (if they are objects).
16
- * - "first": Return the first non-undefined value.
17
- *
18
- * @remarks
19
- * Merging only works if the return values are objects.
20
- *
21
- * @defaultValue "merge"
22
- */
23
- result: "first";
24
- } | {
25
- /**
26
- * How to handle multiple return values from hooks.
27
- * - "merge": Merge all non-undefined return values (if they are objects).
28
- * - "first": Return the first non-undefined value.
29
- *
30
- * @remarks
31
- * Merging only works if the return values are objects.
32
- *
33
- * @defaultValue "merge"
34
- */
35
- result?: "merge" | "last";
36
- /**
37
- * 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
38
- */
39
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
40
- })) | {
41
- /**
42
- * Whether to call the hooks sequentially or in parallel.
43
- */
44
- sequential: false;
45
- });
46
- //#endregion
47
- export { CallHookOptions };
@@ -1,49 +0,0 @@
1
- import "../../types/hooks.mjs";
2
- import { SelectHooksOptions } from "../../types/context.mjs";
3
- import "../../types/resolved.mjs";
4
- import { MaybePromise } from "@stryke/types/base";
5
-
6
- //#region ../powerlines/src/internal/helpers/hooks.d.ts
7
- type CallHookOptions = SelectHooksOptions & (({
8
- /**
9
- * Whether to call the hooks sequentially or in parallel.
10
- *
11
- * @defaultValue true
12
- */
13
- sequential?: true;
14
- } & ({
15
- /**
16
- * How to handle multiple return values from hooks.
17
- * - "merge": Merge all non-undefined return values (if they are objects).
18
- * - "first": Return the first non-undefined value.
19
- *
20
- * @remarks
21
- * Merging only works if the return values are objects.
22
- *
23
- * @defaultValue "merge"
24
- */
25
- result: "first";
26
- } | {
27
- /**
28
- * How to handle multiple return values from hooks.
29
- * - "merge": Merge all non-undefined return values (if they are objects).
30
- * - "first": Return the first non-undefined value.
31
- *
32
- * @remarks
33
- * Merging only works if the return values are objects.
34
- *
35
- * @defaultValue "merge"
36
- */
37
- result?: "merge" | "last";
38
- /**
39
- * 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
40
- */
41
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
42
- })) | {
43
- /**
44
- * Whether to call the hooks sequentially or in parallel.
45
- */
46
- sequential: false;
47
- });
48
- //#endregion
49
- export { CallHookOptions };
@@ -1,93 +0,0 @@
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;
@@ -1,91 +0,0 @@
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 };
@@ -1,6 +0,0 @@
1
-
2
- //#region ../powerlines/src/lib/constants/environments.ts
3
- const DEFAULT_ENVIRONMENT = "default";
4
-
5
- //#endregion
6
- exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT;
@@ -1,5 +0,0 @@
1
- //#region ../powerlines/src/lib/constants/environments.ts
2
- const DEFAULT_ENVIRONMENT = "default";
3
-
4
- //#endregion
5
- export { DEFAULT_ENVIRONMENT };
@@ -1,11 +0,0 @@
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");
@@ -1,13 +0,0 @@
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 { };
@@ -1,41 +0,0 @@
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;
@@ -1,39 +0,0 @@
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 };
@@ -1,38 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- let defu = require("defu");
3
- defu = require_rolldown_runtime.__toESM(defu);
4
- let __stryke_path_append = require("@stryke/path/append");
5
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
6
- let __stryke_fs_exists = require("@stryke/fs/exists");
7
- let typescript = require("typescript");
8
- typescript = require_rolldown_runtime.__toESM(typescript);
9
- require("@stryke/fs/json");
10
-
11
- //#region ../powerlines/src/lib/typescript/tsconfig.ts
12
- /**
13
- * Check if the TypeScript configuration type matches any of the provided types.
14
- *
15
- * @param tsconfigType - The type from the TypeScript configuration.
16
- * @param types - An array of type names to check against.
17
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
18
- */
19
- function findMatch(tsconfigType, types, extensions = [
20
- ".ts",
21
- ".tsx",
22
- ".d.ts"
23
- ]) {
24
- return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
25
- }
26
- /**
27
- * Check if the TypeScript configuration type matches any of the provided types.
28
- *
29
- * @param tsconfigType - The type from the TypeScript configuration.
30
- * @param types - An array of type names to check against.
31
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
32
- */
33
- function isMatchFound(tsconfigType, types) {
34
- return findMatch(tsconfigType, types) !== void 0;
35
- }
36
-
37
- //#endregion
38
- exports.isMatchFound = isMatchFound;
@@ -1,35 +0,0 @@
1
- import defu from "defu";
2
- import { appendPath } from "@stryke/path/append";
3
- import { joinPaths } from "@stryke/path/join-paths";
4
- import { existsSync } from "@stryke/fs/exists";
5
- import ts from "typescript";
6
- import "@stryke/fs/json";
7
-
8
- //#region ../powerlines/src/lib/typescript/tsconfig.ts
9
- /**
10
- * Check if the TypeScript configuration type matches any of the provided types.
11
- *
12
- * @param tsconfigType - The type from the TypeScript configuration.
13
- * @param types - An array of type names to check against.
14
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
15
- */
16
- function findMatch(tsconfigType, types, extensions = [
17
- ".ts",
18
- ".tsx",
19
- ".d.ts"
20
- ]) {
21
- return types.find((type) => tsconfigType?.toString().toLowerCase() === type?.toString().toLowerCase() || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}` || `./${tsconfigType?.toString().toLowerCase()}` === type?.toString().toLowerCase() || extensions.some((ext) => `${tsconfigType?.toString().toLowerCase()}${ext}` === type?.toString().toLowerCase() || `${tsconfigType?.toString().toLowerCase()}${ext}` === `./${type?.toString().toLowerCase()}` || `${type?.toString().toLowerCase()}${ext}` === `./${tsconfigType?.toString().toLowerCase()}` || tsconfigType?.toString().toLowerCase() === `${type?.toString().toLowerCase()}${ext}` || tsconfigType?.toString().toLowerCase() === `./${type?.toString().toLowerCase()}${ext}` || type?.toString().toLowerCase() === `./${tsconfigType?.toString().toLowerCase()}${ext}`));
22
- }
23
- /**
24
- * Check if the TypeScript configuration type matches any of the provided types.
25
- *
26
- * @param tsconfigType - The type from the TypeScript configuration.
27
- * @param types - An array of type names to check against.
28
- * @returns True if the TypeScript configuration type matches any of the provided types, false otherwise.
29
- */
30
- function isMatchFound(tsconfigType, types) {
31
- return findMatch(tsconfigType, types) !== void 0;
32
- }
33
-
34
- //#endregion
35
- export { isMatchFound };
@@ -1,3 +0,0 @@
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");
@@ -1,5 +0,0 @@
1
- import "../../types/build.mjs";
2
- import "defu";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
4
-
5
- export { };
@@ -1,66 +0,0 @@
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;
@@ -1,65 +0,0 @@
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 };