@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
@@ -0,0 +1,21 @@
1
+ import { titleCase } from "@stryke/string-format/title-case";
2
+
3
+ //#region ../powerlines/src/lib/utilities/file-header.ts
4
+ function getBaseFileHeader(context) {
5
+ return `
6
+ // Generated with ${titleCase(context.config.framework)}
7
+ // Note: Do not edit this file manually - it will be overwritten automatically
8
+ `;
9
+ }
10
+ function getFileHeader(context, options = {}) {
11
+ const { directive = null, prettierIgnore = false } = options;
12
+ return `/* eslint-disable */
13
+ // biome-ignore lint: disable
14
+ ${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `\n\n${directive}\n` : "\n"}
15
+ ${getBaseFileHeader(context)}
16
+
17
+ `;
18
+ }
19
+
20
+ //#endregion
21
+ export { getFileHeader };
@@ -0,0 +1,50 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_bundle = require('./bundle.cjs');
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
4
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
5
+
6
+ //#region ../powerlines/src/lib/utilities/resolve.ts
7
+ /**
8
+ * Compiles a type definition to a module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the compiled module.
14
+ */
15
+ async function resolve(context, type, overrides = {}) {
16
+ let typeDefinition;
17
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
18
+ else typeDefinition = type;
19
+ const result = await require_bundle.bundle(context, typeDefinition.file, overrides);
20
+ let resolved;
21
+ try {
22
+ resolved = await context.resolver.evalModule(result.text, {
23
+ filename: result.path,
24
+ forceTranspile: true
25
+ });
26
+ } catch (error) {
27
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
28
+ const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
29
+ throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
30
+
31
+ Bundle output for module:
32
+ ${result.text}` : ""}`);
33
+ }
34
+ throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
35
+
36
+ Bundle output for module:
37
+ ${result.text}` : ""}`);
38
+ }
39
+ let exportName = typeDefinition.name;
40
+ if (!exportName) exportName = "default";
41
+ const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
42
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
43
+
44
+ Bundle output for module:
45
+ ${result.text}` : ""}`);
46
+ return resolvedExport;
47
+ }
48
+
49
+ //#endregion
50
+ exports.resolve = resolve;
@@ -0,0 +1,49 @@
1
+ import { bundle } from "./bundle.mjs";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
4
+
5
+ //#region ../powerlines/src/lib/utilities/resolve.ts
6
+ /**
7
+ * Compiles a type definition to a module.
8
+ *
9
+ * @param context - The context object containing the environment paths.
10
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
+ * @param overrides - Optional overrides for the ESBuild configuration.
12
+ * @returns A promise that resolves to the compiled module.
13
+ */
14
+ async function resolve(context, type, overrides = {}) {
15
+ let typeDefinition;
16
+ if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
+ else typeDefinition = type;
18
+ const result = await bundle(context, typeDefinition.file, overrides);
19
+ let resolved;
20
+ try {
21
+ resolved = await context.resolver.evalModule(result.text, {
22
+ filename: result.path,
23
+ forceTranspile: true
24
+ });
25
+ } catch (error) {
26
+ if (isSetString(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
27
+ const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
28
+ throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
29
+
30
+ Bundle output for module:
31
+ ${result.text}` : ""}`);
32
+ }
33
+ throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
34
+
35
+ Bundle output for module:
36
+ ${result.text}` : ""}`);
37
+ }
38
+ let exportName = typeDefinition.name;
39
+ if (!exportName) exportName = "default";
40
+ const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
41
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
42
+
43
+ Bundle output for module:
44
+ ${result.text}` : ""}`);
45
+ return resolvedExport;
46
+ }
47
+
48
+ //#endregion
49
+ export { resolve };
@@ -0,0 +1,5 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
3
+ let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
4
+ require("@stryke/fs/read-file");
5
+ require("magic-string");
@@ -0,0 +1,5 @@
1
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
+ import { isString } from "@stryke/type-checks/is-string";
3
+ import "@stryke/fs/read-file";
4
+
5
+ export { };
@@ -0,0 +1 @@
1
+ let __stryke_path_replace = require("@stryke/path/replace");
@@ -0,0 +1,3 @@
1
+ import { replacePath } from "@stryke/path/replace";
2
+
3
+ export { };
@@ -0,0 +1,21 @@
1
+
2
+ //#region ../powerlines/src/types/build.ts
3
+ const UNPLUGIN_BUILDER_VARIANTS = [
4
+ "rollup",
5
+ "webpack",
6
+ "rspack",
7
+ "vite",
8
+ "esbuild",
9
+ "farm",
10
+ "unloader",
11
+ "rolldown",
12
+ "bun"
13
+ ];
14
+ const BUILDER_VARIANTS = [
15
+ ...UNPLUGIN_BUILDER_VARIANTS,
16
+ "tsup",
17
+ "tsdown",
18
+ "unbuild"
19
+ ];
20
+
21
+ //#endregion
@@ -1,9 +1,9 @@
1
+ import { BuildOptions } from "esbuild";
1
2
  import { OutputOptions, RollupOptions } from "rollup";
2
3
  import { UserConfig } from "@farmfe/core";
3
4
  import { Configuration } from "@rspack/core";
4
- import { BuildOptions } from "@storm-software/tsup/types";
5
+ import { BuildOptions as BuildOptions$1 } from "@storm-software/tsup/types";
5
6
  import { UnbuildOptions } from "@storm-software/unbuild/types";
6
- import { BuildOptions as BuildOptions$1 } from "esbuild";
7
7
  import { RolldownOptions } from "rolldown";
8
8
  import { UserConfig as UserConfig$1 } from "tsdown";
9
9
  import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
@@ -153,8 +153,8 @@ interface BuildConfig {
153
153
  override?: Record<string, any>;
154
154
  }
155
155
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
- type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
- type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
156
+ type ESBuildBuildConfig = Omit<BuildOptions, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
+ type ESBuildResolvedBuildConfig = Omit<BuildOptions, "inject"> & BuildResolvedConfig;
158
158
  type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
159
  /**
160
160
  * Optimize deps config
@@ -173,8 +173,8 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
173
173
  type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
174
174
  type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfig" | "logLevel" | "output"> & BuildConfig;
175
175
  type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
176
- type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
- type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
176
+ type TsupBuildConfig = Partial<Omit<BuildOptions$1, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
+ type TsupResolvedBuildConfig = BuildOptions$1 & BuildResolvedConfig;
178
178
  type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
179
  type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
180
180
  type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
@@ -0,0 +1,21 @@
1
+ //#region ../powerlines/src/types/build.ts
2
+ const UNPLUGIN_BUILDER_VARIANTS = [
3
+ "rollup",
4
+ "webpack",
5
+ "rspack",
6
+ "vite",
7
+ "esbuild",
8
+ "farm",
9
+ "unloader",
10
+ "rolldown",
11
+ "bun"
12
+ ];
13
+ const BUILDER_VARIANTS = [
14
+ ...UNPLUGIN_BUILDER_VARIANTS,
15
+ "tsup",
16
+ "tsdown",
17
+ "unbuild"
18
+ ];
19
+
20
+ //#endregion
21
+ export { };
@@ -1,3 +1,4 @@
1
+ import "./context.mjs";
1
2
  import { ArrayValues } from "@stryke/types/array";
2
3
  import { MaybePromise } from "@stryke/types/base";
3
4
 
@@ -4,11 +4,12 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
4
4
  import { TSConfig } from "./tsconfig.mjs";
5
5
  import { PluginContext } from "./context.mjs";
6
6
  import { Plugin } from "./plugin.mjs";
7
+ import { transformAsync } from "@babel/core";
8
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
9
+ import "c12";
7
10
  import { MaybePromise } from "@stryke/types/base";
8
11
  import { PreviewOptions } from "vite";
9
- import { transformAsync } from "@babel/core";
10
12
  import { Format } from "@storm-software/build-tools/types";
11
- import { LogLevelLabel } from "@storm-software/config-tools/types";
12
13
  import { StormWorkspaceConfig } from "@storm-software/config/types";
13
14
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
14
15
  import { AssetGlob } from "@stryke/types/file";
@@ -4,13 +4,13 @@ import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
4
4
  import { HooksList, InferHooksListItem } from "./hooks.mjs";
5
5
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
6
6
  import { Plugin } from "./plugin.mjs";
7
- import { NonUndefined } from "@stryke/types/base";
8
7
  import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
8
+ import { SourceMap } from "magic-string";
9
+ import { NonUndefined } from "@stryke/types/base";
9
10
  import { EnvPaths } from "@stryke/env/get-env-paths";
10
11
  import { FetchRequestOptions } from "@stryke/http/fetch";
11
12
  import { PackageJson } from "@stryke/types/package-json";
12
13
  import { Jiti } from "jiti";
13
- import { SourceMap } from "magic-string";
14
14
  import { ParseResult, ParserOptions } from "oxc-parser";
15
15
  import { Range } from "semver";
16
16
  import { RequestInfo, Response } from "undici";
@@ -4,10 +4,10 @@ import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
4
4
  import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
5
5
  import { CommandType } from "./commands.mjs";
6
6
  import { InferUnpluginOptions } from "./unplugin.mjs";
7
+ import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
7
8
  import { ArrayValues } from "@stryke/types/array";
8
9
  import { AnyFunction, MaybePromise } from "@stryke/types/base";
9
10
  import { LoadResult } from "rollup";
10
- import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
11
11
 
12
12
  //#region ../powerlines/src/types/plugin.d.ts
13
13
  interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
@@ -1,5 +1,5 @@
1
- import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
2
1
  import ts from "typescript";
2
+ import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
3
3
 
4
4
  //#region ../powerlines/src/types/tsconfig.d.ts
5
5
  type ReflectionMode = "default" | "explicit" | "never";
@@ -1,10 +1,11 @@
1
1
  import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
2
+ import "./config.mjs";
2
3
  import { InferResolvedConfig } from "./resolved.mjs";
3
4
  import { Context } from "./context.mjs";
4
5
  import { API } from "./api.mjs";
5
6
  import { PluginHook } from "./plugin.mjs";
6
- import { MaybePromise } from "@stryke/types/base";
7
7
  import { HookFilter, UnpluginOptions } from "unplugin";
8
+ import { MaybePromise } from "@stryke/types/base";
8
9
 
9
10
  //#region ../powerlines/src/types/unplugin.d.ts
10
11
  interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
@@ -1,4 +1,4 @@
1
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../packages/plugin-env/src/types/plugin.mjs";
1
+ import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../plugin-env/src/types/plugin.mjs";
2
2
 
3
3
  //#region src/types/plugin.d.ts
4
4
  type DateLibraryType = "date-fns" | "dayjs" | "luxon" | "moment";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-date",
3
- "version": "0.12.259",
3
+ "version": "0.12.260",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -128,15 +128,15 @@
128
128
  "files": ["dist/**/*"],
129
129
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
130
130
  "dependencies": {
131
- "@powerlines/plugin-env": "^0.15.121",
131
+ "@powerlines/plugin-env": "^0.15.122",
132
132
  "@storm-software/config-tools": "^1.189.0",
133
133
  "@stryke/path": "^0.26.0",
134
134
  "powerlines": "^0.37.95"
135
135
  },
136
136
  "devDependencies": {
137
- "@powerlines/plugin-plugin": "^0.12.173",
137
+ "@powerlines/plugin-plugin": "^0.12.174",
138
138
  "@types/node": "^24.10.9"
139
139
  },
140
140
  "publishConfig": { "access": "public" },
141
- "gitHead": "e16caf75f522908b123bf7941a1f0f658fe4ba7b"
141
+ "gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
142
142
  }
@@ -1,43 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
3
- function isPlainObject(value) {
4
- if (value === null || typeof value !== "object") return false;
5
- const prototype = Object.getPrototypeOf(value);
6
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
7
- if (Symbol.iterator in value) return false;
8
- if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
9
- return true;
10
- }
11
- function _defu(baseObject, defaults, namespace = ".", merger) {
12
- if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
13
- const object = Object.assign({}, defaults);
14
- for (const key in baseObject) {
15
- if (key === "__proto__" || key === "constructor") continue;
16
- const value = baseObject[key];
17
- if (value === null || value === void 0) continue;
18
- if (merger && merger(object, key, value, namespace)) continue;
19
- if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
20
- else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
21
- else object[key] = value;
22
- }
23
- return object;
24
- }
25
- function createDefu(merger) {
26
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
27
- }
28
- const defu = createDefu();
29
- const defuFn = createDefu((object, key, currentValue) => {
30
- if (object[key] !== void 0 && typeof currentValue === "function") {
31
- object[key] = currentValue(object[key]);
32
- return true;
33
- }
34
- });
35
- const defuArrayFn = createDefu((object, key, currentValue) => {
36
- if (Array.isArray(object[key]) && typeof currentValue === "function") {
37
- object[key] = currentValue(object[key]);
38
- return true;
39
- }
40
- });
41
-
42
- //#endregion
43
- exports.defu = defu;
@@ -1,42 +0,0 @@
1
- //#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
2
- function isPlainObject(value) {
3
- if (value === null || typeof value !== "object") return false;
4
- const prototype = Object.getPrototypeOf(value);
5
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
6
- if (Symbol.iterator in value) return false;
7
- if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
8
- return true;
9
- }
10
- function _defu(baseObject, defaults, namespace = ".", merger) {
11
- if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
12
- const object = Object.assign({}, defaults);
13
- for (const key in baseObject) {
14
- if (key === "__proto__" || key === "constructor") continue;
15
- const value = baseObject[key];
16
- if (value === null || value === void 0) continue;
17
- if (merger && merger(object, key, value, namespace)) continue;
18
- if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
19
- else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
20
- else object[key] = value;
21
- }
22
- return object;
23
- }
24
- function createDefu(merger) {
25
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
26
- }
27
- const defu = createDefu();
28
- const defuFn = createDefu((object, key, currentValue) => {
29
- if (object[key] !== void 0 && typeof currentValue === "function") {
30
- object[key] = currentValue(object[key]);
31
- return true;
32
- }
33
- });
34
- const defuArrayFn = createDefu((object, key, currentValue) => {
35
- if (Array.isArray(object[key]) && typeof currentValue === "function") {
36
- object[key] = currentValue(object[key]);
37
- return true;
38
- }
39
- });
40
-
41
- //#endregion
42
- export { defu };