@powerlines/plugin-date 0.12.260 → 0.12.261

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 (184) hide show
  1. package/dist/components/date-fns.cjs +3 -2
  2. package/dist/components/date-fns.mjs +1 -1
  3. package/dist/components/dayjs.cjs +3 -2
  4. package/dist/components/dayjs.mjs +1 -1
  5. package/dist/components/luxon.cjs +3 -2
  6. package/dist/components/luxon.mjs +1 -1
  7. package/dist/components/moment.cjs +3 -2
  8. package/dist/components/moment.mjs +1 -1
  9. package/dist/index.cjs +3 -2
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.mts +1 -1
  12. package/dist/index.mjs +2 -2
  13. package/dist/types/plugin.d.cts +1 -1
  14. package/dist/types/plugin.d.mts +1 -1
  15. package/package.json +4 -4
  16. package/dist/deepkit/schemas/reflection.cjs +0 -3998
  17. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  18. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  19. package/dist/deepkit/schemas/reflection.mjs +0 -3996
  20. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  21. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  22. package/dist/deepkit/src/capnp.cjs +0 -913
  23. package/dist/deepkit/src/capnp.mjs +0 -911
  24. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  25. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  26. package/dist/deepkit/src/reflect-type.cjs +0 -22
  27. package/dist/deepkit/src/reflect-type.mjs +0 -20
  28. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  29. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  30. package/dist/deepkit/src/transformer.cjs +0 -52
  31. package/dist/deepkit/src/transformer.mjs +0 -49
  32. package/dist/deepkit/src/transpile.cjs +0 -29
  33. package/dist/deepkit/src/transpile.mjs +0 -27
  34. package/dist/deepkit/src/types.d.cts +0 -10
  35. package/dist/deepkit/src/types.d.mts +0 -10
  36. package/dist/deepkit/src/utilities.cjs +0 -67
  37. package/dist/deepkit/src/utilities.mjs +0 -66
  38. package/dist/plugin-alloy/src/core/components/output.cjs +0 -36
  39. package/dist/plugin-alloy/src/core/components/output.mjs +0 -35
  40. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -20
  41. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -19
  42. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -60
  43. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -58
  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 -102
  53. package/dist/plugin-alloy/src/index.mjs +0 -100
  54. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -89
  55. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -88
  56. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -33
  57. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -32
  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.mts +0 -3
  61. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  62. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
  63. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
  64. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -52
  65. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -51
  66. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -78
  67. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -76
  68. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -364
  69. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -355
  70. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -157
  71. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -154
  72. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -57
  73. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -56
  74. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -94
  75. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -93
  76. package/dist/plugin-automd/src/index.cjs +0 -101
  77. package/dist/plugin-automd/src/index.mjs +0 -98
  78. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  79. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  80. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  81. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  82. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  83. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  84. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  85. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  86. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  87. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  88. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  89. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  90. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  91. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  92. package/dist/plugin-babel/src/helpers/options.cjs +0 -49
  93. package/dist/plugin-babel/src/helpers/options.mjs +0 -46
  94. package/dist/plugin-babel/src/index.cjs +0 -85
  95. package/dist/plugin-babel/src/index.mjs +0 -83
  96. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  97. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  98. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  99. package/dist/plugin-env/src/babel/index.cjs +0 -1
  100. package/dist/plugin-env/src/babel/index.mjs +0 -3
  101. package/dist/plugin-env/src/babel/plugin.cjs +0 -70
  102. package/dist/plugin-env/src/babel/plugin.mjs +0 -69
  103. package/dist/plugin-env/src/components/docs.cjs +0 -60
  104. package/dist/plugin-env/src/components/docs.mjs +0 -59
  105. package/dist/plugin-env/src/components/env.cjs +0 -497
  106. package/dist/plugin-env/src/components/env.mjs +0 -494
  107. package/dist/plugin-env/src/components/index.cjs +0 -2
  108. package/dist/plugin-env/src/components/index.mjs +0 -4
  109. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  110. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  111. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  112. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  113. package/dist/plugin-env/src/helpers/docs-helper.cjs +0 -16
  114. package/dist/plugin-env/src/helpers/docs-helper.mjs +0 -15
  115. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  116. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  117. package/dist/plugin-env/src/helpers/load.cjs +0 -84
  118. package/dist/plugin-env/src/helpers/load.mjs +0 -81
  119. package/dist/plugin-env/src/helpers/persistence.cjs +0 -201
  120. package/dist/plugin-env/src/helpers/persistence.mjs +0 -190
  121. package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
  122. package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
  123. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  124. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  125. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  126. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  127. package/dist/plugin-env/src/index.cjs +0 -174
  128. package/dist/plugin-env/src/index.mjs +0 -172
  129. package/dist/plugin-env/src/types/plugin.d.cts +0 -148
  130. package/dist/plugin-env/src/types/plugin.d.mts +0 -150
  131. package/dist/plugin-env/src/types/runtime.d.cts +0 -789
  132. package/dist/plugin-env/src/types/runtime.d.mts +0 -789
  133. package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
  134. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
  135. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -93
  136. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -91
  137. package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
  138. package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
  139. package/dist/powerlines/src/lib/entry.cjs +0 -11
  140. package/dist/powerlines/src/lib/entry.mjs +0 -13
  141. package/dist/powerlines/src/lib/logger.cjs +0 -41
  142. package/dist/powerlines/src/lib/logger.mjs +0 -39
  143. package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -3
  144. package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -5
  145. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -66
  146. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -65
  147. package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -46
  148. package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -45
  149. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -42
  150. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -40
  151. package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -22
  152. package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -21
  153. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -50
  154. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -49
  155. package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -5
  156. package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -5
  157. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  158. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  159. package/dist/powerlines/src/types/api.d.cts +0 -104
  160. package/dist/powerlines/src/types/api.d.mts +0 -104
  161. package/dist/powerlines/src/types/babel.d.cts +0 -22
  162. package/dist/powerlines/src/types/babel.d.mts +0 -22
  163. package/dist/powerlines/src/types/build.cjs +0 -21
  164. package/dist/powerlines/src/types/build.d.cts +0 -185
  165. package/dist/powerlines/src/types/build.d.mts +0 -185
  166. package/dist/powerlines/src/types/build.mjs +0 -21
  167. package/dist/powerlines/src/types/commands.d.cts +0 -8
  168. package/dist/powerlines/src/types/commands.d.mts +0 -9
  169. package/dist/powerlines/src/types/config.d.cts +0 -435
  170. package/dist/powerlines/src/types/config.d.mts +0 -436
  171. package/dist/powerlines/src/types/context.d.cts +0 -514
  172. package/dist/powerlines/src/types/context.d.mts +0 -514
  173. package/dist/powerlines/src/types/fs.d.cts +0 -486
  174. package/dist/powerlines/src/types/fs.d.mts +0 -486
  175. package/dist/powerlines/src/types/hooks.d.cts +0 -32
  176. package/dist/powerlines/src/types/hooks.d.mts +0 -32
  177. package/dist/powerlines/src/types/plugin.d.cts +0 -205
  178. package/dist/powerlines/src/types/plugin.d.mts +0 -205
  179. package/dist/powerlines/src/types/resolved.d.cts +0 -94
  180. package/dist/powerlines/src/types/resolved.d.mts +0 -94
  181. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  182. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  183. package/dist/powerlines/src/types/unplugin.d.cts +0 -22
  184. package/dist/powerlines/src/types/unplugin.d.mts +0 -23
@@ -1,125 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- const require_reflect_type = require('../../../deepkit/src/reflect-type.cjs');
3
- const require_persistence = require('./persistence.cjs');
4
- let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
5
- let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
6
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
8
-
9
- //#region ../plugin-env/src/helpers/reflect.ts
10
- function mergeEnvReflections(context, reflections) {
11
- return createEnvReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map((reflection) => reflection.type)) });
12
- }
13
- function mergeSecretsReflections(context, reflections) {
14
- return createSecretsReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map((reflection) => reflection.type)) });
15
- }
16
- var BaseEnv = class {
17
- APP_NAME;
18
- APP_VERSION;
19
- BUILD_ID;
20
- BUILD_TIMESTAMP;
21
- BUILD_CHECKSUM;
22
- RELEASE_ID;
23
- RELEASE_TAG;
24
- ORGANIZATION;
25
- PLATFORM = "neutral";
26
- MODE = "production";
27
- ENVIRONMENT;
28
- DEBUG = false;
29
- TEST = false;
30
- MINIMAL = false;
31
- NO_COLOR = false;
32
- FORCE_COLOR = false;
33
- FORCE_HYPERLINK = false;
34
- STACKTRACE = false;
35
- INCLUDE_ERROR_DATA = false;
36
- ERROR_URL;
37
- DEFAULT_TIMEZONE;
38
- DEFAULT_LOCALE;
39
- CI = false;
40
- };
41
- var BaseSecrets = class {
42
- ENCRYPTION_KEY;
43
- };
44
- function createEnvReflection(context, options = {}) {
45
- const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
46
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
47
- description: `The base environment configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
48
- classType: BaseEnv,
49
- types: [],
50
- implements: [{
51
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
52
- typeName: "EnvInterface",
53
- description: `The environment configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
54
- types: []
55
- }]
56
- });
57
- parent.name = "Env";
58
- const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
59
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
60
- typeName: "Env",
61
- description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
62
- types: []
63
- }, parent);
64
- result.name = "Env";
65
- return result;
66
- }
67
- function createSecretsReflection(context, options = {}) {
68
- const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
69
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
70
- description: `The base secrets configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
71
- classType: BaseSecrets,
72
- types: [],
73
- implements: [{
74
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
75
- typeName: "SecretsInterface",
76
- description: `The secrets configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
77
- types: []
78
- }]
79
- });
80
- parent.name = "Secrets";
81
- const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
82
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
83
- typeName: "Secrets",
84
- description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
85
- types: []
86
- }, parent);
87
- result.name = "Secrets";
88
- return result;
89
- }
90
- async function reflectEnv(context, file, name) {
91
- let config;
92
- if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await require_reflect_type.reflectType(context, {
93
- file: !(0, __stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
94
- name
95
- }));
96
- const defaultConfigType = await require_reflect_type.reflectType(context, await require_persistence.getEnvDefaultTypeDefinition(context));
97
- return mergeEnvReflections(context, [
98
- await require_persistence.readEnvTypeReflection(context, "env"),
99
- config,
100
- (0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultConfigType)
101
- ].filter(Boolean));
102
- }
103
- async function reflectSecrets(context, file, name) {
104
- let config;
105
- if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await require_reflect_type.reflectType(context, {
106
- file: !(0, __stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
107
- name
108
- }));
109
- const defaultSecretsType = await require_reflect_type.reflectType(context, await require_persistence.getSecretsDefaultTypeDefinition(context));
110
- return mergeSecretsReflections(context, [
111
- await require_persistence.readSecretsReflection(context),
112
- config,
113
- (0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultSecretsType)
114
- ].filter(Boolean));
115
- }
116
-
117
- //#endregion
118
- exports.BaseEnv = BaseEnv;
119
- exports.BaseSecrets = BaseSecrets;
120
- exports.createEnvReflection = createEnvReflection;
121
- exports.createSecretsReflection = createSecretsReflection;
122
- exports.mergeEnvReflections = mergeEnvReflections;
123
- exports.mergeSecretsReflections = mergeSecretsReflections;
124
- exports.reflectEnv = reflectEnv;
125
- exports.reflectSecrets = reflectSecrets;
@@ -1,117 +0,0 @@
1
- import { reflectType } from "../../../deepkit/src/reflect-type.mjs";
2
- import { getEnvDefaultTypeDefinition, getSecretsDefaultTypeDefinition, readEnvTypeReflection, readSecretsReflection } from "./persistence.mjs";
3
- import { ReflectionClass, ReflectionKind, merge, resolveClassType } from "@powerlines/deepkit/vendor/type";
4
- import { isParentPath } from "@stryke/path/is-parent-path";
5
- import { titleCase } from "@stryke/string-format/title-case";
6
- import { joinPaths } from "@stryke/path/join-paths";
7
-
8
- //#region ../plugin-env/src/helpers/reflect.ts
9
- function mergeEnvReflections(context, reflections) {
10
- return createEnvReflection(context, { type: merge(reflections.map((reflection) => reflection.type)) });
11
- }
12
- function mergeSecretsReflections(context, reflections) {
13
- return createSecretsReflection(context, { type: merge(reflections.map((reflection) => reflection.type)) });
14
- }
15
- var BaseEnv = class {
16
- APP_NAME;
17
- APP_VERSION;
18
- BUILD_ID;
19
- BUILD_TIMESTAMP;
20
- BUILD_CHECKSUM;
21
- RELEASE_ID;
22
- RELEASE_TAG;
23
- ORGANIZATION;
24
- PLATFORM = "neutral";
25
- MODE = "production";
26
- ENVIRONMENT;
27
- DEBUG = false;
28
- TEST = false;
29
- MINIMAL = false;
30
- NO_COLOR = false;
31
- FORCE_COLOR = false;
32
- FORCE_HYPERLINK = false;
33
- STACKTRACE = false;
34
- INCLUDE_ERROR_DATA = false;
35
- ERROR_URL;
36
- DEFAULT_TIMEZONE;
37
- DEFAULT_LOCALE;
38
- CI = false;
39
- };
40
- var BaseSecrets = class {
41
- ENCRYPTION_KEY;
42
- };
43
- function createEnvReflection(context, options = {}) {
44
- const parent = options.superReflection ?? new ReflectionClass({
45
- kind: ReflectionKind.class,
46
- description: `The base environment configuration definition for the ${titleCase(context.config.name)} project.`,
47
- classType: BaseEnv,
48
- types: [],
49
- implements: [{
50
- kind: ReflectionKind.objectLiteral,
51
- typeName: "EnvInterface",
52
- description: `The environment configuration interface definition for the ${titleCase(context.config.name)} project.`,
53
- types: []
54
- }]
55
- });
56
- parent.name = "Env";
57
- const result = new ReflectionClass(options.type ?? {
58
- kind: ReflectionKind.objectLiteral,
59
- typeName: "Env",
60
- description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
61
- types: []
62
- }, parent);
63
- result.name = "Env";
64
- return result;
65
- }
66
- function createSecretsReflection(context, options = {}) {
67
- const parent = options.superReflection ?? new ReflectionClass({
68
- kind: ReflectionKind.class,
69
- description: `The base secrets configuration definition for the ${titleCase(context.config.name)} project.`,
70
- classType: BaseSecrets,
71
- types: [],
72
- implements: [{
73
- kind: ReflectionKind.objectLiteral,
74
- typeName: "SecretsInterface",
75
- description: `The secrets configuration interface definition for the ${titleCase(context.config.name)} project.`,
76
- types: []
77
- }]
78
- });
79
- parent.name = "Secrets";
80
- const result = new ReflectionClass(options.type ?? {
81
- kind: ReflectionKind.objectLiteral,
82
- typeName: "Secrets",
83
- description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
84
- types: []
85
- }, parent);
86
- result.name = "Secrets";
87
- return result;
88
- }
89
- async function reflectEnv(context, file, name) {
90
- let config;
91
- if (file) config = resolveClassType(await reflectType(context, {
92
- file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
93
- name
94
- }));
95
- const defaultConfigType = await reflectType(context, await getEnvDefaultTypeDefinition(context));
96
- return mergeEnvReflections(context, [
97
- await readEnvTypeReflection(context, "env"),
98
- config,
99
- resolveClassType(defaultConfigType)
100
- ].filter(Boolean));
101
- }
102
- async function reflectSecrets(context, file, name) {
103
- let config;
104
- if (file) config = resolveClassType(await reflectType(context, {
105
- file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
106
- name
107
- }));
108
- const defaultSecretsType = await reflectType(context, await getSecretsDefaultTypeDefinition(context));
109
- return mergeSecretsReflections(context, [
110
- await readSecretsReflection(context),
111
- config,
112
- resolveClassType(defaultSecretsType)
113
- ].filter(Boolean));
114
- }
115
-
116
- //#endregion
117
- export { BaseEnv, BaseSecrets, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
@@ -1,24 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
3
- let __stryke_env_types = require("@stryke/env/types");
4
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
5
-
6
- //#region ../plugin-env/src/helpers/source-file-env.ts
7
- function removeEnvPrefix(env) {
8
- if ((0, __stryke_type_checks_is_string.isString)(env)) {
9
- let name = __stryke_env_types.ENV_PREFIXES.reduce((ret, prefix) => {
10
- if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
11
- return ret;
12
- }, env.toUpperCase());
13
- while (name.startsWith("_")) name = name.slice(1);
14
- return name;
15
- }
16
- return Object.keys(env).reduce((ret, key) => {
17
- const name = removeEnvPrefix(key);
18
- if (name) ret[name] = env[key];
19
- return ret;
20
- }, {});
21
- }
22
-
23
- //#endregion
24
- exports.removeEnvPrefix = removeEnvPrefix;
@@ -1,23 +0,0 @@
1
- import { isString } from "@stryke/type-checks/is-string";
2
- import { ENV_PREFIXES } from "@stryke/env/types";
3
- import { camelCase } from "@stryke/string-format/camel-case";
4
-
5
- //#region ../plugin-env/src/helpers/source-file-env.ts
6
- function removeEnvPrefix(env) {
7
- if (isString(env)) {
8
- let name = ENV_PREFIXES.reduce((ret, prefix) => {
9
- if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
10
- return ret;
11
- }, env.toUpperCase());
12
- while (name.startsWith("_")) name = name.slice(1);
13
- return name;
14
- }
15
- return Object.keys(env).reduce((ret, key) => {
16
- const name = removeEnvPrefix(key);
17
- if (name) ret[name] = env[key];
18
- return ret;
19
- }, {});
20
- }
21
-
22
- //#endregion
23
- export { removeEnvPrefix };
@@ -1,2 +0,0 @@
1
- require('./persistence.cjs');
2
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
@@ -1,4 +0,0 @@
1
- import "./persistence.mjs";
2
- import { titleCase } from "@stryke/string-format/title-case";
3
-
4
- export { };
@@ -1,174 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../plugin-babel/src/index.cjs');
3
- const require_index$1 = require('../../plugin-alloy/src/index.cjs');
4
- const require_index$2 = require('../../plugin-automd/src/index.cjs');
5
- const require_plugin = require('./babel/plugin.cjs');
6
- const require_source_file_env = require('./helpers/source-file-env.cjs');
7
- const require_load = require('./helpers/load.cjs');
8
- const require_reflect = require('./helpers/reflect.cjs');
9
- const require_persistence = require('./helpers/persistence.cjs');
10
- const require_create_reflection_resource = require('./helpers/create-reflection-resource.cjs');
11
- const require_docs_helper = require('./helpers/docs-helper.cjs');
12
- const require_docs = require('./components/docs.cjs');
13
- const require_env = require('./components/env.cjs');
14
- const require_automd_generator = require('./helpers/automd-generator.cjs');
15
- require('./babel/index.cjs');
16
- require('./components/index.cjs');
17
- require('./helpers/index.cjs');
18
- let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
19
- let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
20
- let defu = require("defu");
21
- defu = require_rolldown_runtime.__toESM(defu);
22
- let react_jsx_runtime = require("react/jsx-runtime");
23
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
24
- let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
25
- let __stryke_env_types = require("@stryke/env/types");
26
- let __stryke_fs_exists = require("@stryke/fs/exists");
27
- let __stryke_path_join = require("@stryke/path/join");
28
- let __stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
29
-
30
- //#region ../plugin-env/src/index.tsx
31
- /**
32
- * A Powerlines plugin to inject environment variables into the source code.
33
- */
34
- const plugin = (options = {}) => {
35
- return [
36
- require_index$1.default(options.alloy),
37
- require_index.default(options.babel),
38
- {
39
- name: "env",
40
- async config() {
41
- this.debug("Providing default configuration for the Powerlines `env` build plugin.");
42
- const config = {
43
- env: (0, defu.default)(options, {
44
- types: {},
45
- prefix: []
46
- }),
47
- transform: { babel: { plugins: [require_plugin.envBabelPlugin] } }
48
- };
49
- if (config.env.types) config.env.types = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(config.env.types);
50
- else {
51
- this.warn("The `env.types` configuration parameter was not provided. Please ensure this is expected.");
52
- const envDefaultTypeDefinition = await require_persistence.getEnvDefaultTypeDefinition(this);
53
- config.env.types = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(`${envDefaultTypeDefinition.file}#${envDefaultTypeDefinition.name}`);
54
- }
55
- if (config.env.secrets) config.env.secrets = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(config.env.secrets);
56
- else {
57
- const secretsDefaultTypeDefinition = await require_persistence.getSecretsDefaultTypeDefinition(this);
58
- config.env.secrets = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(`${secretsDefaultTypeDefinition.file}#${secretsDefaultTypeDefinition.name}`);
59
- }
60
- config.env.prefix = (0, __stryke_convert_to_array.toArray)(config.env.prefix ?? []).reduce((ret, prefix) => {
61
- const formattedPrefix = (0, __stryke_string_format_constant_case.constantCase)(prefix);
62
- if (!ret.includes(formattedPrefix)) ret.push(formattedPrefix);
63
- return ret;
64
- }, [
65
- ...__stryke_env_types.ENV_PREFIXES,
66
- "POWERLINES_",
67
- this.config.framework && this.config.framework !== "powerlines" && `${(0, __stryke_string_format_constant_case.constantCase)(this.config.framework)}_`
68
- ].filter(Boolean));
69
- config.env.prefix = (0, __stryke_convert_to_array.toArray)(config.env.prefix).reduce((ret, prefix) => {
70
- if (!ret.includes(prefix.replace(/_$/g, ""))) ret.push(prefix.replace(/_$/g, ""));
71
- return ret;
72
- }, []);
73
- return config;
74
- },
75
- async configResolved() {
76
- this.debug(`Environment plugin configuration has been resolved for the Powerlines project.`);
77
- this.env = (0, defu.default)({ parsed: await require_load.loadEnv(this, this.config.env) }, this.env ?? {}, {
78
- types: { env: {} },
79
- used: {
80
- env: {},
81
- secrets: {}
82
- },
83
- parsed: {},
84
- injected: {}
85
- });
86
- if (this.config.command !== "prepare" && !this.config.skipCache && this.persistedMeta?.checksum === this.meta.checksum && (0, __stryke_fs_exists.existsSync)(require_persistence.getEnvTypeReflectionsPath(this, "env"))) {
87
- this.debug(`Skipping reflection initialization as the meta checksum has not changed.`);
88
- this.env.types.env = await require_persistence.readEnvTypeReflection(this, "env");
89
- if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvReflectionsPath(this, "env"))) this.env.used.env = await require_persistence.readEnvReflection(this);
90
- if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvTypeReflectionsPath(this, "secrets"))) this.env.types.secrets = await require_persistence.readEnvTypeReflection(this, "secrets");
91
- if ((0, __stryke_fs_exists.existsSync)(require_persistence.getEnvReflectionsPath(this, "secrets"))) this.env.used.secrets = await require_persistence.readSecretsReflection(this);
92
- } else {
93
- this.debug(`Starting environment configuration reflection initialization.`);
94
- this.env.types.env = await require_reflect.reflectEnv(this, this.config.env.types?.file ? (0, __stryke_path_is_parent_path.isParentPath)(this.config.env.types?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.types?.file : (0, __stryke_path_join.joinPaths)(this.config.projectRoot, this.config.env.types?.file) : void 0, this.config.env.types?.name);
95
- if (!this.env.types.env) throw new Error("Failed to find the environment configuration type reflection in the context.");
96
- await require_persistence.writeEnvTypeReflection(this, this.env.types.env, "env");
97
- this.env.types.secrets = await require_reflect.reflectSecrets(this, this.config.env.secrets?.file ? (0, __stryke_path_is_parent_path.isParentPath)(this.config.env.secrets?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.secrets?.file : (0, __stryke_path_join.joinPaths)(this.config.projectRoot, this.config.env.secrets?.file) : void 0, this.config.env.secrets?.name);
98
- if (!this.env.types.secrets) throw new Error("Failed to find the secrets configuration type reflection in the context.");
99
- await require_persistence.writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
100
- this.debug(`Resolved ${this.env.types.env.getProperties().length ?? 0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length ?? 0} secret configuration parameters`);
101
- const envWithAlias = this.env.types.env.getProperties().filter((prop) => prop.getAlias().length > 0);
102
- Object.entries(await require_load.loadEnv(this, this.config.env)).forEach(([key, value]) => {
103
- const unprefixedKey = this.config.env.prefix.reduce((ret, prefix) => {
104
- if (key.replace(/_$/g, "").startsWith(prefix)) return key.replace(/_$/g, "").slice(prefix.length);
105
- return ret;
106
- }, key);
107
- const aliasKey = envWithAlias.find((prop) => prop?.getAlias().reverse().includes(unprefixedKey));
108
- if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) this.env.types.env.getProperty(unprefixedKey).setDefaultValue(value);
109
- });
110
- this.env.used.env = new __powerlines_deepkit_vendor_type.ReflectionClass({
111
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
112
- typeName: "Env",
113
- description: `An object containing the environment configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
114
- types: []
115
- }, this.env.types.env);
116
- await require_persistence.writeEnvReflection(this, this.env.used.env, "env");
117
- if (this.env.types.secrets) {
118
- await require_persistence.writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
119
- this.env.used.secrets = new __powerlines_deepkit_vendor_type.ReflectionClass({
120
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
121
- typeName: "Secrets",
122
- description: `An object containing the secret configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
123
- types: []
124
- }, this.env.types.secrets);
125
- await require_persistence.writeEnvReflection(this, this.env.used.secrets, "secrets");
126
- }
127
- }
128
- },
129
- async prepare() {
130
- this.debug(`Preparing the Environment runtime artifacts for the Powerlines project.`);
131
- return this.render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_env.EnvBuiltin, { defaultConfig: this.config.env.defaultConfig }));
132
- },
133
- transform: {
134
- order: "post",
135
- async handler() {
136
- if (this.env.used.env.getProperties().length > 0) {
137
- this.trace(`Persisting used environment configuration reflections to ${require_persistence.getEnvReflectionsPath(this, "env")}.`);
138
- await require_persistence.writeEnvReflection(this, this.env.used.env, "env");
139
- }
140
- if (this.env.used.secrets.getProperties().length > 0) {
141
- this.trace(`Persisting used secret configuration reflections to ${require_persistence.getEnvReflectionsPath(this, "secrets")}.`);
142
- await require_persistence.writeEnvReflection(this, this.env.used.secrets, "secrets");
143
- }
144
- }
145
- },
146
- async docs() {
147
- this.debug(`Documenting environment variables configuration values in "${(0, __stryke_path_join.joinPaths)(require_docs_helper.getDocsOutputPath(this), "env.md")}"`);
148
- return this.render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs.EnvDocsFile, { levelOffset: 0 }));
149
- },
150
- async buildEnd() {
151
- const reflectionPath = require_persistence.getEnvReflectionsPath(this, "env");
152
- this.debug(`Writing env reflection types to ${reflectionPath}.`);
153
- await require_persistence.writeEnvReflection(this, this.env.used.env, "env");
154
- }
155
- },
156
- {
157
- name: "env:automd-generator",
158
- config() {
159
- return { automd: (0, defu.default)(options.automd ?? {}, { generators: { "env": require_automd_generator.env(this) } }) };
160
- }
161
- },
162
- {
163
- name: "env:vite",
164
- vite: { configResolved() {
165
- return { envPrefix: this.config?.env?.prefix };
166
- } }
167
- },
168
- require_index$2.default(options.automd)
169
- ];
170
- };
171
- var src_default$3 = plugin;
172
-
173
- //#endregion
174
- exports.default = src_default$3;
@@ -1,172 +0,0 @@
1
- import src_default$2 from "../../plugin-babel/src/index.mjs";
2
- import src_default from "../../plugin-alloy/src/index.mjs";
3
- import src_default$1 from "../../plugin-automd/src/index.mjs";
4
- import { envBabelPlugin } from "./babel/plugin.mjs";
5
- import { removeEnvPrefix } from "./helpers/source-file-env.mjs";
6
- import { loadEnv, loadEnvFromContext } from "./helpers/load.mjs";
7
- import { BaseEnv, BaseSecrets, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./helpers/reflect.mjs";
8
- import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvTypeReflection } from "./helpers/persistence.mjs";
9
- import { createReflectionResource } from "./helpers/create-reflection-resource.mjs";
10
- import { getDocsOutputPath } from "./helpers/docs-helper.mjs";
11
- import { EnvDocsFile } from "./components/docs.mjs";
12
- import { EnvBuiltin, EnvTypeDefinition } from "./components/env.mjs";
13
- import { env } from "./helpers/automd-generator.mjs";
14
- import "./babel/index.mjs";
15
- import "./components/index.mjs";
16
- import "./helpers/index.mjs";
17
- import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
18
- import { isParentPath } from "@stryke/path/is-parent-path";
19
- import defu from "defu";
20
- import { jsx } from "react/jsx-runtime";
21
- import { toArray } from "@stryke/convert/to-array";
22
- import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
23
- import { ENV_PREFIXES } from "@stryke/env/types";
24
- import { existsSync } from "@stryke/fs/exists";
25
- import { joinPaths } from "@stryke/path/join";
26
- import { constantCase } from "@stryke/string-format/constant-case";
27
-
28
- //#region ../plugin-env/src/index.tsx
29
- /**
30
- * A Powerlines plugin to inject environment variables into the source code.
31
- */
32
- const plugin = (options = {}) => {
33
- return [
34
- src_default(options.alloy),
35
- src_default$2(options.babel),
36
- {
37
- name: "env",
38
- async config() {
39
- this.debug("Providing default configuration for the Powerlines `env` build plugin.");
40
- const config = {
41
- env: defu(options, {
42
- types: {},
43
- prefix: []
44
- }),
45
- transform: { babel: { plugins: [envBabelPlugin] } }
46
- };
47
- if (config.env.types) config.env.types = parseTypeDefinition(config.env.types);
48
- else {
49
- this.warn("The `env.types` configuration parameter was not provided. Please ensure this is expected.");
50
- const envDefaultTypeDefinition = await getEnvDefaultTypeDefinition(this);
51
- config.env.types = parseTypeDefinition(`${envDefaultTypeDefinition.file}#${envDefaultTypeDefinition.name}`);
52
- }
53
- if (config.env.secrets) config.env.secrets = parseTypeDefinition(config.env.secrets);
54
- else {
55
- const secretsDefaultTypeDefinition = await getSecretsDefaultTypeDefinition(this);
56
- config.env.secrets = parseTypeDefinition(`${secretsDefaultTypeDefinition.file}#${secretsDefaultTypeDefinition.name}`);
57
- }
58
- config.env.prefix = toArray(config.env.prefix ?? []).reduce((ret, prefix) => {
59
- const formattedPrefix = constantCase(prefix);
60
- if (!ret.includes(formattedPrefix)) ret.push(formattedPrefix);
61
- return ret;
62
- }, [
63
- ...ENV_PREFIXES,
64
- "POWERLINES_",
65
- this.config.framework && this.config.framework !== "powerlines" && `${constantCase(this.config.framework)}_`
66
- ].filter(Boolean));
67
- config.env.prefix = toArray(config.env.prefix).reduce((ret, prefix) => {
68
- if (!ret.includes(prefix.replace(/_$/g, ""))) ret.push(prefix.replace(/_$/g, ""));
69
- return ret;
70
- }, []);
71
- return config;
72
- },
73
- async configResolved() {
74
- this.debug(`Environment plugin configuration has been resolved for the Powerlines project.`);
75
- this.env = defu({ parsed: await loadEnv(this, this.config.env) }, this.env ?? {}, {
76
- types: { env: {} },
77
- used: {
78
- env: {},
79
- secrets: {}
80
- },
81
- parsed: {},
82
- injected: {}
83
- });
84
- if (this.config.command !== "prepare" && !this.config.skipCache && this.persistedMeta?.checksum === this.meta.checksum && existsSync(getEnvTypeReflectionsPath(this, "env"))) {
85
- this.debug(`Skipping reflection initialization as the meta checksum has not changed.`);
86
- this.env.types.env = await readEnvTypeReflection(this, "env");
87
- if (existsSync(getEnvReflectionsPath(this, "env"))) this.env.used.env = await readEnvReflection(this);
88
- if (existsSync(getEnvTypeReflectionsPath(this, "secrets"))) this.env.types.secrets = await readEnvTypeReflection(this, "secrets");
89
- if (existsSync(getEnvReflectionsPath(this, "secrets"))) this.env.used.secrets = await readSecretsReflection(this);
90
- } else {
91
- this.debug(`Starting environment configuration reflection initialization.`);
92
- this.env.types.env = await reflectEnv(this, this.config.env.types?.file ? isParentPath(this.config.env.types?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.types?.file : joinPaths(this.config.projectRoot, this.config.env.types?.file) : void 0, this.config.env.types?.name);
93
- if (!this.env.types.env) throw new Error("Failed to find the environment configuration type reflection in the context.");
94
- await writeEnvTypeReflection(this, this.env.types.env, "env");
95
- this.env.types.secrets = await reflectSecrets(this, this.config.env.secrets?.file ? isParentPath(this.config.env.secrets?.file, this.workspaceConfig.workspaceRoot) ? this.config.env.secrets?.file : joinPaths(this.config.projectRoot, this.config.env.secrets?.file) : void 0, this.config.env.secrets?.name);
96
- if (!this.env.types.secrets) throw new Error("Failed to find the secrets configuration type reflection in the context.");
97
- await writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
98
- this.debug(`Resolved ${this.env.types.env.getProperties().length ?? 0} environment configuration parameters and ${this.env.types.secrets?.getProperties().length ?? 0} secret configuration parameters`);
99
- const envWithAlias = this.env.types.env.getProperties().filter((prop) => prop.getAlias().length > 0);
100
- Object.entries(await loadEnv(this, this.config.env)).forEach(([key, value]) => {
101
- const unprefixedKey = this.config.env.prefix.reduce((ret, prefix) => {
102
- if (key.replace(/_$/g, "").startsWith(prefix)) return key.replace(/_$/g, "").slice(prefix.length);
103
- return ret;
104
- }, key);
105
- const aliasKey = envWithAlias.find((prop) => prop?.getAlias().reverse().includes(unprefixedKey));
106
- if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) this.env.types.env.getProperty(unprefixedKey).setDefaultValue(value);
107
- });
108
- this.env.used.env = new ReflectionClass({
109
- kind: ReflectionKind.objectLiteral,
110
- typeName: "Env",
111
- description: `An object containing the environment configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
112
- types: []
113
- }, this.env.types.env);
114
- await writeEnvReflection(this, this.env.used.env, "env");
115
- if (this.env.types.secrets) {
116
- await writeEnvTypeReflection(this, this.env.types.secrets, "secrets");
117
- this.env.used.secrets = new ReflectionClass({
118
- kind: ReflectionKind.objectLiteral,
119
- typeName: "Secrets",
120
- description: `An object containing the secret configuration parameters used by the ${this.config.name ? `${this.config.name} application` : "application"}.`,
121
- types: []
122
- }, this.env.types.secrets);
123
- await writeEnvReflection(this, this.env.used.secrets, "secrets");
124
- }
125
- }
126
- },
127
- async prepare() {
128
- this.debug(`Preparing the Environment runtime artifacts for the Powerlines project.`);
129
- return this.render(/* @__PURE__ */ jsx(EnvBuiltin, { defaultConfig: this.config.env.defaultConfig }));
130
- },
131
- transform: {
132
- order: "post",
133
- async handler() {
134
- if (this.env.used.env.getProperties().length > 0) {
135
- this.trace(`Persisting used environment configuration reflections to ${getEnvReflectionsPath(this, "env")}.`);
136
- await writeEnvReflection(this, this.env.used.env, "env");
137
- }
138
- if (this.env.used.secrets.getProperties().length > 0) {
139
- this.trace(`Persisting used secret configuration reflections to ${getEnvReflectionsPath(this, "secrets")}.`);
140
- await writeEnvReflection(this, this.env.used.secrets, "secrets");
141
- }
142
- }
143
- },
144
- async docs() {
145
- this.debug(`Documenting environment variables configuration values in "${joinPaths(getDocsOutputPath(this), "env.md")}"`);
146
- return this.render(/* @__PURE__ */ jsx(EnvDocsFile, { levelOffset: 0 }));
147
- },
148
- async buildEnd() {
149
- const reflectionPath = getEnvReflectionsPath(this, "env");
150
- this.debug(`Writing env reflection types to ${reflectionPath}.`);
151
- await writeEnvReflection(this, this.env.used.env, "env");
152
- }
153
- },
154
- {
155
- name: "env:automd-generator",
156
- config() {
157
- return { automd: defu(options.automd ?? {}, { generators: { "env": env(this) } }) };
158
- }
159
- },
160
- {
161
- name: "env:vite",
162
- vite: { configResolved() {
163
- return { envPrefix: this.config?.env?.prefix };
164
- } }
165
- },
166
- src_default$1(options.automd)
167
- ];
168
- };
169
- var src_default$3 = plugin;
170
-
171
- //#endregion
172
- export { src_default$3 as default };