@powerlines/plugin-date 0.12.258 → 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.
- package/dist/components/date-fns.cjs +2 -3
- package/dist/components/date-fns.mjs +1 -1
- package/dist/components/dayjs.cjs +2 -3
- package/dist/components/dayjs.mjs +1 -1
- package/dist/components/luxon.cjs +2 -3
- package/dist/components/luxon.mjs +1 -1
- package/dist/components/moment.cjs +2 -3
- package/dist/components/moment.mjs +1 -1
- package/dist/deepkit/schemas/reflection.cjs +3998 -0
- package/dist/deepkit/schemas/reflection.mjs +3996 -0
- package/dist/deepkit/schemas/reflection2.cjs +4112 -0
- package/dist/deepkit/schemas/reflection2.mjs +4110 -0
- package/dist/deepkit/src/capnp.cjs +913 -0
- package/dist/deepkit/src/capnp.mjs +911 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
- package/dist/deepkit/src/reflect-type.cjs +22 -0
- package/dist/deepkit/src/reflect-type.mjs +20 -0
- package/dist/deepkit/src/resolve-reflections.cjs +16 -0
- package/dist/deepkit/src/resolve-reflections.mjs +15 -0
- package/dist/deepkit/src/transformer.cjs +52 -0
- package/dist/deepkit/src/transformer.mjs +49 -0
- package/dist/deepkit/src/transpile.cjs +29 -0
- package/dist/deepkit/src/transpile.mjs +27 -0
- package/dist/deepkit/src/utilities.cjs +67 -0
- package/dist/deepkit/src/utilities.mjs +66 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/plugin-alloy/src/core/components/output.cjs +36 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +35 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +20 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +19 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +60 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +58 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +38 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +34 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
- package/dist/plugin-alloy/src/index.cjs +102 -0
- package/dist/plugin-alloy/src/index.mjs +100 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +89 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +88 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +33 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +32 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +18 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
- package/dist/plugin-alloy/src/types/components.d.mts +3 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +52 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +51 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +78 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +76 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +364 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +355 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +157 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +154 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +57 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +56 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +94 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +93 -0
- package/dist/plugin-automd/src/index.cjs +101 -0
- package/dist/plugin-automd/src/index.mjs +98 -0
- package/dist/{packages/plugin-automd → plugin-automd}/src/types/plugin.d.mts +3 -1
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
- package/dist/plugin-babel/src/helpers/options.cjs +49 -0
- package/dist/plugin-babel/src/helpers/options.mjs +46 -0
- package/dist/plugin-babel/src/index.cjs +85 -0
- package/dist/plugin-babel/src/index.mjs +83 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-env/src/babel/index.cjs +1 -0
- package/dist/plugin-env/src/babel/index.mjs +3 -0
- package/dist/plugin-env/src/babel/plugin.cjs +70 -0
- package/dist/plugin-env/src/babel/plugin.mjs +69 -0
- package/dist/plugin-env/src/components/docs.cjs +60 -0
- package/dist/plugin-env/src/components/docs.mjs +59 -0
- package/dist/plugin-env/src/components/env.cjs +497 -0
- package/dist/plugin-env/src/components/env.mjs +494 -0
- package/dist/plugin-env/src/components/index.cjs +2 -0
- package/dist/plugin-env/src/components/index.mjs +4 -0
- package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
- package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
- package/dist/plugin-env/src/helpers/docs-helper.cjs +16 -0
- package/dist/plugin-env/src/helpers/docs-helper.mjs +15 -0
- package/dist/plugin-env/src/helpers/index.cjs +6 -0
- package/dist/plugin-env/src/helpers/index.mjs +8 -0
- package/dist/plugin-env/src/helpers/load.cjs +84 -0
- package/dist/plugin-env/src/helpers/load.mjs +81 -0
- package/dist/plugin-env/src/helpers/persistence.cjs +201 -0
- package/dist/plugin-env/src/helpers/persistence.mjs +190 -0
- package/dist/plugin-env/src/helpers/reflect.cjs +125 -0
- package/dist/plugin-env/src/helpers/reflect.mjs +117 -0
- package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
- package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
- package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
- package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
- package/dist/plugin-env/src/index.cjs +174 -0
- package/dist/plugin-env/src/index.mjs +172 -0
- package/dist/{packages/plugin-env → plugin-env}/src/types/plugin.d.mts +3 -1
- package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +2 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +93 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +91 -0
- package/dist/powerlines/src/lib/constants/environments.cjs +6 -0
- package/dist/powerlines/src/lib/constants/environments.mjs +5 -0
- package/dist/powerlines/src/lib/entry.cjs +11 -0
- package/dist/powerlines/src/lib/entry.mjs +13 -0
- package/dist/powerlines/src/lib/logger.cjs +41 -0
- package/dist/powerlines/src/lib/logger.mjs +39 -0
- package/dist/powerlines/src/lib/unplugin/helpers.cjs +3 -0
- package/dist/powerlines/src/lib/unplugin/helpers.mjs +5 -0
- package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +66 -0
- package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +65 -0
- package/dist/powerlines/src/lib/unplugin/plugin.cjs +46 -0
- package/dist/powerlines/src/lib/unplugin/plugin.mjs +45 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +42 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +40 -0
- package/dist/powerlines/src/lib/utilities/file-header.cjs +22 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +21 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +50 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +49 -0
- package/dist/powerlines/src/lib/utilities/source-file.cjs +5 -0
- package/dist/powerlines/src/lib/utilities/source-file.mjs +5 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
- package/dist/powerlines/src/types/build.cjs +21 -0
- package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +6 -6
- package/dist/powerlines/src/types/build.mjs +21 -0
- package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +1 -0
- package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +3 -2
- package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +2 -2
- package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +1 -1
- package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +1 -1
- package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +2 -1
- package/dist/types/plugin.d.mts +1 -1
- package/package.json +4 -4
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -42
- /package/dist/{packages/deepkit → deepkit}/schemas/reflection.d.mts +0 -0
- /package/dist/{packages/deepkit → deepkit}/src/types.d.mts +0 -0
- /package/dist/{packages/plugin-alloy → plugin-alloy}/src/types/plugin.d.mts +0 -0
- /package/dist/{packages/plugin-automd → plugin-automd}/src/types/toc.d.mts +0 -0
- /package/dist/{packages/plugin-babel → plugin-babel}/src/types/plugin.d.mts +0 -0
- /package/dist/{packages/plugin-env → plugin-env}/src/types/runtime.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/babel.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_context = require('../../../plugin-alloy/src/core/contexts/context.cjs');
|
|
3
|
+
const require_load = require('../helpers/load.cjs');
|
|
4
|
+
const require_create_reflection_resource = require('../helpers/create-reflection-resource.cjs');
|
|
5
|
+
const require_refkey = require('../../../plugin-alloy/src/helpers/refkey.cjs');
|
|
6
|
+
const require_tsdoc = require('../../../plugin-alloy/src/typescript/components/tsdoc.cjs');
|
|
7
|
+
const require_builtin_file = require('../../../plugin-alloy/src/typescript/components/builtin-file.cjs');
|
|
8
|
+
const require_typescript_interface = require('../../../plugin-alloy/src/typescript/components/typescript-interface.cjs');
|
|
9
|
+
const require_typescript_object = require('../../../plugin-alloy/src/typescript/components/typescript-object.cjs');
|
|
10
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
11
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
12
|
+
let defu = require("defu");
|
|
13
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
14
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
17
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
18
|
+
|
|
19
|
+
//#region ../plugin-env/src/components/env.tsx
|
|
20
|
+
/**
|
|
21
|
+
* Generates the environment configuration typescript definition for the Powerlines project.
|
|
22
|
+
*/
|
|
23
|
+
function EnvTypeDefinition(props) {
|
|
24
|
+
const [{ defaultValue, reflection }] = (0, __alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
|
|
25
|
+
const context = require_context.usePowerlinesSafe();
|
|
26
|
+
if (!context) return null;
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_typescript_interface.TypeScriptInterface, {
|
|
29
|
+
name: " EnvBase",
|
|
30
|
+
defaultValue,
|
|
31
|
+
reflection,
|
|
32
|
+
export: true
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
35
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
36
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDoc, {
|
|
37
|
+
heading: "The environment configuration object with prefixed keys.",
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`EnvBase\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.` })
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.TypeDeclaration, {
|
|
41
|
+
name: "Env",
|
|
42
|
+
export: true,
|
|
43
|
+
children: __alloy_js_core.code` {
|
|
44
|
+
[Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
|
|
45
|
+
}
|
|
46
|
+
`
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
49
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
function ConfigPropertyConditional(props) {
|
|
53
|
+
const [{ context, name }] = (0, __alloy_js_core.splitProps)(props, ["context", "name"]);
|
|
54
|
+
if (!context) return null;
|
|
55
|
+
return __alloy_js_core.code`propertyName === "${name}" || propertyName.replace(/^(${context.config.env.prefix.sort((a, b) => a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)).map((prefix) => `${prefix.replace(/_$/, "")}_`).join("|")})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${name.toLowerCase().replace(/[\s\-_]+/g, "")}"`;
|
|
56
|
+
}
|
|
57
|
+
function ConfigPropertyGet(props) {
|
|
58
|
+
const [{ context, property, index }] = (0, __alloy_js_core.splitProps)(props, [
|
|
59
|
+
"context",
|
|
60
|
+
"property",
|
|
61
|
+
"index"
|
|
62
|
+
]);
|
|
63
|
+
if (!context) return null;
|
|
64
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: index === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.IfStatement, {
|
|
65
|
+
condition: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
66
|
+
name: property.getNameAsString(),
|
|
67
|
+
context
|
|
68
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
69
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
70
|
+
children: [__alloy_js_core.code` || `, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
71
|
+
each: property.getAlias(),
|
|
72
|
+
joiner: __alloy_js_core.code` || `,
|
|
73
|
+
children: (alias) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
74
|
+
name: alias,
|
|
75
|
+
context
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
})] }),
|
|
79
|
+
children: __alloy_js_core.code`return target["${property.getNameAsString()}"];`
|
|
80
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ElseIfClause, {
|
|
81
|
+
condition: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
82
|
+
name: property.getNameAsString(),
|
|
83
|
+
context
|
|
84
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
85
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
86
|
+
children: [__alloy_js_core.code` || `, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
87
|
+
each: property.getAlias(),
|
|
88
|
+
joiner: __alloy_js_core.code` || `,
|
|
89
|
+
children: (alias) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
90
|
+
name: alias,
|
|
91
|
+
context
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
})] }),
|
|
95
|
+
children: __alloy_js_core.code`return target["${property.getNameAsString()}"];`
|
|
96
|
+
}) });
|
|
97
|
+
}
|
|
98
|
+
function ConfigPropertySet(props) {
|
|
99
|
+
const [{ context, property, index }] = (0, __alloy_js_core.splitProps)(props, [
|
|
100
|
+
"context",
|
|
101
|
+
"property",
|
|
102
|
+
"index"
|
|
103
|
+
]);
|
|
104
|
+
if (!context) return null;
|
|
105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: index === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.IfStatement, {
|
|
106
|
+
condition: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
107
|
+
name: property.getNameAsString(),
|
|
108
|
+
context
|
|
109
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
110
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
111
|
+
children: [__alloy_js_core.code` || `, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
112
|
+
each: property.getAlias(),
|
|
113
|
+
joiner: __alloy_js_core.code` || `,
|
|
114
|
+
children: (alias) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
115
|
+
name: alias,
|
|
116
|
+
context
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
})] }),
|
|
120
|
+
children: __alloy_js_core.code`
|
|
121
|
+
target["${property.getNameAsString()}"] = newValue;
|
|
122
|
+
return true;
|
|
123
|
+
`
|
|
124
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ElseIfClause, {
|
|
125
|
+
condition: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
126
|
+
name: property.getNameAsString(),
|
|
127
|
+
context
|
|
128
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
129
|
+
when: property.getAlias() && property.getAlias().length > 0,
|
|
130
|
+
children: [__alloy_js_core.code` || `, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
131
|
+
each: property.getAlias(),
|
|
132
|
+
joiner: __alloy_js_core.code` || `,
|
|
133
|
+
children: (alias) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyConditional, {
|
|
134
|
+
name: alias,
|
|
135
|
+
context
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
})] }),
|
|
139
|
+
children: __alloy_js_core.code`
|
|
140
|
+
target["${property.getNameAsString()}"] = newValue;
|
|
141
|
+
return true;
|
|
142
|
+
`
|
|
143
|
+
}) });
|
|
144
|
+
}
|
|
145
|
+
const createEnvRefkey = require_refkey.refkey("createEnv");
|
|
146
|
+
const envRefkey = require_refkey.refkey("env");
|
|
147
|
+
const envSerializerRefkey = require_refkey.refkey("EnvSerializer");
|
|
148
|
+
/**
|
|
149
|
+
* Generates the environment configuration module for the Powerlines project.
|
|
150
|
+
*/
|
|
151
|
+
function EnvBuiltin(props) {
|
|
152
|
+
const [{ defaultConfig, children }, rest] = (0, __alloy_js_core.splitProps)(props, ["defaultConfig", "children"]);
|
|
153
|
+
const context = require_context.usePowerlinesSafe();
|
|
154
|
+
const defaultValue = (0, __alloy_js_core.computed)(() => context && require_load.loadEnvFromContext(context, process.env));
|
|
155
|
+
const reflection = require_create_reflection_resource.createReflectionResource(context);
|
|
156
|
+
const envInstance = (0, __alloy_js_core.computed)(() => {
|
|
157
|
+
return new __powerlines_deepkit_vendor_type.ReflectionClass({
|
|
158
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
159
|
+
description: `The initial environment configuration state for the ${(0, __stryke_string_format_title_case.titleCase)(context?.config?.name)} project.`,
|
|
160
|
+
types: []
|
|
161
|
+
}, reflection.data ?? void 0);
|
|
162
|
+
});
|
|
163
|
+
const reflectionGetProperties = (0, __alloy_js_core.computed)(() => reflection.data?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
164
|
+
const reflectionSetProperties = (0, __alloy_js_core.computed)(() => reflection.data?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
165
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_builtin_file.BuiltinFile, {
|
|
166
|
+
id: "env",
|
|
167
|
+
description: "The environment configuration module provides an interface to define environment configuration parameters.",
|
|
168
|
+
...rest,
|
|
169
|
+
imports: (0, defu.default)({ "@powerlines/deepkit/vendor/type": [
|
|
170
|
+
"stringify",
|
|
171
|
+
"serializer",
|
|
172
|
+
"serializeFunction",
|
|
173
|
+
"deserializeFunction",
|
|
174
|
+
"ReflectionKind",
|
|
175
|
+
"Serializer",
|
|
176
|
+
"TemplateState",
|
|
177
|
+
"Type",
|
|
178
|
+
"TypeProperty",
|
|
179
|
+
"TypePropertySignature"
|
|
180
|
+
] }, rest.imports ?? {}),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
|
|
183
|
+
when: !(0, __stryke_type_checks_is_null.isNull)(reflection.data),
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnvTypeDefinition, {
|
|
186
|
+
defaultValue: defaultValue.value,
|
|
187
|
+
reflection: reflection.data
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
190
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
|
|
191
|
+
]
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_typescript_object.TypescriptObject, {
|
|
194
|
+
name: "initialEnv",
|
|
195
|
+
type: "Partial<EnvBase>",
|
|
196
|
+
defaultValue,
|
|
197
|
+
reflection: envInstance,
|
|
198
|
+
export: true,
|
|
199
|
+
const: true,
|
|
200
|
+
doc: "The initial environment configuration object values for the runtime."
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
203
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
204
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
205
|
+
heading: "The environment configuration serializer for the Powerlines application.",
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
208
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
|
|
209
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
|
|
210
|
+
]
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ClassDeclaration, {
|
|
213
|
+
refkey: envSerializerRefkey,
|
|
214
|
+
name: "EnvSerializer",
|
|
215
|
+
extends: "Serializer",
|
|
216
|
+
export: true,
|
|
217
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.ClassMethod, {
|
|
218
|
+
name: "constructor",
|
|
219
|
+
public: true,
|
|
220
|
+
doc: "Initializes a new instance of the `EnvSerializer` class.",
|
|
221
|
+
children: __alloy_js_core.code`
|
|
222
|
+
super("env");
|
|
223
|
+
|
|
224
|
+
this.deserializeRegistry.register(
|
|
225
|
+
ReflectionKind.boolean,
|
|
226
|
+
(type: Type, state: TemplateState) => {
|
|
227
|
+
state.addSetter(
|
|
228
|
+
\`typeof \${state.accessor.toString()} !== "boolean" ? \${state.accessor.toString()} === 1 || \${state.accessor.toString()} === "1" || \${state.accessor.toString()}.toLowerCase() === "t" || \${state.accessor.toString()}.toLowerCase() === "true" || \${state.accessor.toString()}.toLowerCase() === "y" || \${state.accessor.toString()}.toLowerCase() === "yes" : \${state.accessor.toString()}\`
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
`
|
|
233
|
+
})
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
237
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
238
|
+
heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
241
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
|
|
242
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
|
|
243
|
+
]
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
246
|
+
name: "envSerializer",
|
|
247
|
+
export: false,
|
|
248
|
+
const: true,
|
|
249
|
+
initializer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.NewExpression, {
|
|
250
|
+
args: [],
|
|
251
|
+
target: "EnvSerializer"
|
|
252
|
+
})
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
255
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
256
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
257
|
+
heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `The resulting JSON object can be stringified using \`JSON.stringify()\`.` }),
|
|
260
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocExample, { children: `const json = serializeEnv(env);` }),
|
|
261
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
265
|
+
name: "serializeEnv",
|
|
266
|
+
export: true,
|
|
267
|
+
const: true,
|
|
268
|
+
initializer: "serializeFunction<EnvBase>(envSerializer)"
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
271
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
272
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
273
|
+
heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
|
|
274
|
+
children: [
|
|
275
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
|
|
276
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocExample, { children: `const env = deserializeEnv(json);` }),
|
|
277
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocThrows, { children: `ValidationError when deserialization fails.` })
|
|
278
|
+
]
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
281
|
+
name: "deserializeEnv",
|
|
282
|
+
export: true,
|
|
283
|
+
const: true,
|
|
284
|
+
initializer: "deserializeFunction<EnvBase>(envSerializer)"
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
287
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
288
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
289
|
+
heading: "Initializes the Powerlines environment configuration module.",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
|
|
292
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocParam, {
|
|
293
|
+
name: "environmentConfig",
|
|
294
|
+
children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocReturns, { children: `The initialized Powerlines configuration object.` })
|
|
297
|
+
]
|
|
298
|
+
}),
|
|
299
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
300
|
+
when: Boolean(context?.entryPath),
|
|
301
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_typescript.FunctionDeclaration, {
|
|
302
|
+
refkey: createEnvRefkey,
|
|
303
|
+
async: false,
|
|
304
|
+
export: true,
|
|
305
|
+
name: "createEnv",
|
|
306
|
+
parameters: [{
|
|
307
|
+
name: "environmentConfig",
|
|
308
|
+
type: `Partial<Env>`,
|
|
309
|
+
optional: false,
|
|
310
|
+
default: "{}"
|
|
311
|
+
}],
|
|
312
|
+
returnType: "Env",
|
|
313
|
+
children: [
|
|
314
|
+
__alloy_js_core.code`
|
|
315
|
+
return new Proxy<Env>(
|
|
316
|
+
deserializeEnv({
|
|
317
|
+
...initialEnv,
|
|
318
|
+
...environmentConfig
|
|
319
|
+
}) as Env,
|
|
320
|
+
{
|
|
321
|
+
get: (target: EnvBase, propertyName: string) => { `,
|
|
322
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
323
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
324
|
+
each: reflectionGetProperties,
|
|
325
|
+
children: (property, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertyGet, {
|
|
326
|
+
index,
|
|
327
|
+
context,
|
|
328
|
+
property
|
|
329
|
+
})
|
|
330
|
+
}),
|
|
331
|
+
__alloy_js_core.code`
|
|
332
|
+
return undefined;
|
|
333
|
+
}, `,
|
|
334
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
335
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
336
|
+
__alloy_js_core.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,
|
|
337
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
338
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
|
|
339
|
+
each: reflectionSetProperties,
|
|
340
|
+
ender: __alloy_js_core.code` else `,
|
|
341
|
+
children: (property, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigPropertySet, {
|
|
342
|
+
index,
|
|
343
|
+
context,
|
|
344
|
+
property
|
|
345
|
+
})
|
|
346
|
+
}),
|
|
347
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
348
|
+
__alloy_js_core.code`return false;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
`
|
|
353
|
+
]
|
|
354
|
+
})
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
357
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
358
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
359
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDoc, {
|
|
360
|
+
heading: "The environment configuration object.",
|
|
361
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: `This object provides access to the environment configuration parameters in the application runtime.` })
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
364
|
+
refkey: envRefkey,
|
|
365
|
+
name: "env",
|
|
366
|
+
type: "Env",
|
|
367
|
+
export: true,
|
|
368
|
+
const: true,
|
|
369
|
+
initializer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: __alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);` })
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
372
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
373
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
374
|
+
export: true,
|
|
375
|
+
const: true,
|
|
376
|
+
name: "isCI",
|
|
377
|
+
doc: "Detect if the application is running in a continuous integration (CI) environment.",
|
|
378
|
+
initializer: __alloy_js_core.code`Boolean(
|
|
379
|
+
env.CI ||
|
|
380
|
+
env.RUN_ID ||
|
|
381
|
+
env.AGOLA_GIT_REF ||
|
|
382
|
+
env.AC_APPCIRCLE ||
|
|
383
|
+
env.APPVEYOR ||
|
|
384
|
+
env.CODEBUILD ||
|
|
385
|
+
env.TF_BUILD ||
|
|
386
|
+
env.bamboo_planKey ||
|
|
387
|
+
env.BITBUCKET_COMMIT ||
|
|
388
|
+
env.BITRISE_IO ||
|
|
389
|
+
env.BUDDY_WORKSPACE_ID ||
|
|
390
|
+
env.BUILDKITE ||
|
|
391
|
+
env.CIRCLECI ||
|
|
392
|
+
env.CIRRUS_CI ||
|
|
393
|
+
env.CF_BUILD_ID ||
|
|
394
|
+
env.CM_BUILD_ID ||
|
|
395
|
+
env.CI_NAME ||
|
|
396
|
+
env.DRONE ||
|
|
397
|
+
env.DSARI ||
|
|
398
|
+
env.EARTHLY_CI ||
|
|
399
|
+
env.EAS_BUILD ||
|
|
400
|
+
env.GERRIT_PROJECT ||
|
|
401
|
+
env.GITEA_ACTIONS ||
|
|
402
|
+
env.GITHUB_ACTIONS ||
|
|
403
|
+
env.GITLAB_CI ||
|
|
404
|
+
env.GOCD ||
|
|
405
|
+
env.BUILDER_OUTPUT ||
|
|
406
|
+
env.HARNESS_BUILD_ID ||
|
|
407
|
+
env.JENKINS_URL ||
|
|
408
|
+
env.LAYERCI ||
|
|
409
|
+
env.MAGNUM ||
|
|
410
|
+
env.NETLIFY ||
|
|
411
|
+
env.NEVERCODE ||
|
|
412
|
+
env.PROW_JOB_ID ||
|
|
413
|
+
env.RELEASE_BUILD_ID ||
|
|
414
|
+
env.RENDER ||
|
|
415
|
+
env.SAILCI ||
|
|
416
|
+
env.HUDSON ||
|
|
417
|
+
env.SCREWDRIVER ||
|
|
418
|
+
env.SEMAPHORE ||
|
|
419
|
+
env.SOURCEHUT ||
|
|
420
|
+
env.STRIDER ||
|
|
421
|
+
env.TASK_ID ||
|
|
422
|
+
env.RUN_ID ||
|
|
423
|
+
env.TEAMCITY_VERSION ||
|
|
424
|
+
env.TRAVIS ||
|
|
425
|
+
env.VELA ||
|
|
426
|
+
env.NOW_BUILDER ||
|
|
427
|
+
env.APPCENTER_BUILD_ID ||
|
|
428
|
+
env.CI_XCODE_PROJECT ||
|
|
429
|
+
env.XCS || false
|
|
430
|
+
);
|
|
431
|
+
`
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
434
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
435
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDoc, {
|
|
436
|
+
heading: "Detect the \\`mode\\` of the current runtime environment.",
|
|
437
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocRemarks, { children: __alloy_js_core.code`The \`mode\` is determined by the \`MODE\` environment variable, or falls back to the \`NEXT_PUBLIC_VERCEL_ENV\`, \`NODE_ENV\`, or defaults to \`production\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:
|
|
438
|
+
- \`production\`
|
|
439
|
+
- \`test\`
|
|
440
|
+
- \`development\`
|
|
441
|
+
` })
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
444
|
+
export: true,
|
|
445
|
+
const: true,
|
|
446
|
+
name: "mode",
|
|
447
|
+
initializer: __alloy_js_core.code`String(env.MODE) || "production"; `
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
450
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
451
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
452
|
+
export: true,
|
|
453
|
+
const: true,
|
|
454
|
+
name: "isProduction",
|
|
455
|
+
doc: "Detect if the application is running in `\"production\"` mode",
|
|
456
|
+
initializer: __alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
459
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
461
|
+
export: true,
|
|
462
|
+
const: true,
|
|
463
|
+
name: "isTest",
|
|
464
|
+
doc: "Detect if the application is running in `\"test\"` mode",
|
|
465
|
+
initializer: __alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
468
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
469
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
470
|
+
export: true,
|
|
471
|
+
const: true,
|
|
472
|
+
name: "isDevelopment",
|
|
473
|
+
doc: "Detect if the application is running in `\"development\"` mode",
|
|
474
|
+
initializer: __alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
|
|
475
|
+
}),
|
|
476
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
477
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
478
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_typescript.VarDeclaration, {
|
|
479
|
+
export: true,
|
|
480
|
+
const: true,
|
|
481
|
+
name: "isDebug",
|
|
482
|
+
doc: "Detect if the application is currently being debugged",
|
|
483
|
+
initializer: __alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
|
|
484
|
+
}),
|
|
485
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
486
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
|
|
487
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
488
|
+
when: Boolean(children),
|
|
489
|
+
children
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
//#endregion
|
|
496
|
+
exports.EnvBuiltin = EnvBuiltin;
|
|
497
|
+
exports.EnvTypeDefinition = EnvTypeDefinition;
|