@powerlines/plugin-env 0.15.133 → 0.15.135
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/babel/plugin.cjs +3 -3
- package/dist/babel/plugin.d.cts +2 -2
- package/dist/babel/plugin.d.mts +3 -2
- package/dist/babel/plugin.mjs +1 -1
- package/dist/helpers/automd-generator.cjs +2 -2
- package/dist/helpers/automd-generator.d.cts +1 -1
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/load.cjs +4 -4
- package/dist/helpers/load.mjs +2 -2
- package/dist/helpers/persistence.cjs +5 -5
- package/dist/helpers/persistence.d.cts +1 -1
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/helpers/persistence.mjs +1 -1
- package/dist/helpers/reflect.cjs +0 -13
- package/dist/helpers/reflect.mjs +0 -13
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/plugin-alloy/src/core/components/output.cjs +33 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +32 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +116 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +116 -0
- package/dist/plugin-alloy/src/index.cjs +98 -0
- package/dist/plugin-alloy/src/index.mjs +96 -0
- package/dist/plugin-alloy/src/internal/unctx.cjs +9 -0
- package/dist/plugin-alloy/src/internal/unctx.mjs +8 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +49 -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/types/api.d.cts +104 -0
- package/dist/powerlines/src/types/api.d.mts +104 -0
- package/dist/powerlines/src/types/babel.cjs +11 -0
- package/dist/powerlines/src/types/babel.d.cts +21 -0
- package/dist/powerlines/src/types/babel.d.mts +21 -0
- package/dist/powerlines/src/types/babel.mjs +10 -0
- package/dist/powerlines/src/types/build.d.cts +185 -0
- package/dist/powerlines/src/types/build.d.mts +185 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.cjs +30 -0
- package/dist/powerlines/src/types/config.d.cts +424 -0
- package/dist/powerlines/src/types/config.d.mts +426 -0
- package/dist/powerlines/src/types/config.mjs +29 -0
- package/dist/powerlines/src/types/context.cjs +285 -0
- package/dist/powerlines/src/types/context.d.cts +514 -0
- package/dist/powerlines/src/types/context.d.mts +514 -0
- package/dist/powerlines/src/types/context.mjs +283 -0
- package/dist/powerlines/src/types/fs.d.cts +486 -0
- package/dist/powerlines/src/types/fs.d.mts +486 -0
- package/dist/powerlines/src/types/hooks.d.cts +32 -0
- package/dist/powerlines/src/types/hooks.d.mts +32 -0
- package/dist/powerlines/src/types/index.d.mts +12 -0
- package/dist/powerlines/src/types/plugin.d.cts +205 -0
- package/dist/powerlines/src/types/plugin.d.mts +205 -0
- package/dist/powerlines/src/types/resolved.d.cts +93 -0
- package/dist/powerlines/src/types/resolved.d.mts +93 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/powerlines/src/types/unplugin.d.cts +22 -0
- package/dist/powerlines/src/types/unplugin.d.mts +23 -0
- package/dist/types/plugin.d.cts +1 -1
- package/package.json +16 -16
package/dist/babel/plugin.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
|
-
|
|
3
|
+
const require_babel = require('../powerlines/src/types/babel.cjs');
|
|
4
4
|
let __babel_core = require("@babel/core");
|
|
5
5
|
let __powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
6
6
|
let __powerlines_plugin_babel_helpers_create_plugin = require("@powerlines/plugin-babel/helpers/create-plugin");
|
|
@@ -91,7 +91,7 @@ const envBabelPlugin = (__powerlines_plugin_babel_helpers_create_plugin.createBa
|
|
|
91
91
|
}
|
|
92
92
|
extractEnv.__type = [
|
|
93
93
|
"node",
|
|
94
|
-
() =>
|
|
94
|
+
() => require_babel.__ΩBabelPluginPass,
|
|
95
95
|
"pass",
|
|
96
96
|
"isInjectable",
|
|
97
97
|
"extractEnv",
|
|
@@ -126,7 +126,7 @@ const envBabelPlugin = (__powerlines_plugin_babel_helpers_create_plugin.createBa
|
|
|
126
126
|
}, [
|
|
127
127
|
() => __babel_core.NodePath,
|
|
128
128
|
"path",
|
|
129
|
-
() =>
|
|
129
|
+
() => require_babel.__ΩBabelPluginPass,
|
|
130
130
|
"pass",
|
|
131
131
|
"MemberExpression",
|
|
132
132
|
"PP!7!2\"n#2$\"/%"
|
package/dist/babel/plugin.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.cjs";
|
|
1
2
|
import { EnvPluginContext, EnvPluginResolvedConfig } from "../types/plugin.cjs";
|
|
2
3
|
import "../index.cjs";
|
|
3
|
-
import * as powerlines_types0 from "powerlines/types";
|
|
4
4
|
|
|
5
5
|
//#region src/babel/plugin.d.ts
|
|
6
|
-
declare const envBabelPlugin:
|
|
6
|
+
declare const envBabelPlugin: DeclareBabelTransformPluginReturn<EnvPluginContext<EnvPluginResolvedConfig>, Record<string, any>>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { envBabelPlugin };
|
package/dist/babel/plugin.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { DeclareBabelTransformPluginReturn } from "../powerlines/src/types/babel.mjs";
|
|
1
2
|
import { EnvPluginContext, EnvPluginResolvedConfig } from "../types/plugin.mjs";
|
|
2
3
|
import "../index.mjs";
|
|
3
|
-
import
|
|
4
|
+
import "../powerlines/src/types/index.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/babel/plugin.d.ts
|
|
6
|
-
declare const envBabelPlugin:
|
|
7
|
+
declare const envBabelPlugin: DeclareBabelTransformPluginReturn<EnvPluginContext<EnvPluginResolvedConfig>, Record<string, any>>;
|
|
7
8
|
//#endregion
|
|
8
9
|
export { envBabelPlugin };
|
package/dist/babel/plugin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __ΩEnvPluginContext } from "../types/plugin.mjs";
|
|
2
|
-
import { __ΩBabelPluginPass } from "powerlines/types/babel";
|
|
2
|
+
import { __ΩBabelPluginPass } from "../powerlines/src/types/babel.mjs";
|
|
3
3
|
import { NodePath } from "@babel/core";
|
|
4
4
|
import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
|
|
5
5
|
import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
|
|
2
|
+
const require_context = require('../powerlines/src/types/context.cjs');
|
|
3
3
|
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
4
|
let automd = require("automd");
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ const env = __assignType((context) => (0, automd.defineGenerator)({
|
|
|
22
22
|
return { contents: await context.fs.read(envDocFile) || "" };
|
|
23
23
|
}, ["generate", "P\"/!"])
|
|
24
24
|
}), [
|
|
25
|
-
() =>
|
|
25
|
+
() => require_context.__ΩUnresolvedContext,
|
|
26
26
|
"context",
|
|
27
27
|
"",
|
|
28
28
|
"Pn!2\"\"/#"
|
package/dist/helpers/load.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
3
|
const require_helpers_source_file_env = require('./source-file-env.cjs');
|
|
4
|
+
const require_config = require('../powerlines/src/types/config.cjs');
|
|
5
|
+
const require_environments = require('../powerlines/src/lib/constants/environments.cjs');
|
|
4
6
|
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
5
|
-
let powerlines_types_config = require("powerlines/types/config");
|
|
6
7
|
let __stryke_env_load_env = require("@stryke/env/load-env");
|
|
7
8
|
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
8
9
|
let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
9
10
|
let c12 = require("c12");
|
|
10
11
|
let defu = require("defu");
|
|
11
12
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
12
|
-
let powerlines_lib_constants_environments = require("powerlines/lib/constants/environments");
|
|
13
13
|
|
|
14
14
|
//#region src/helpers/load.ts
|
|
15
15
|
function __assignType(fn, args) {
|
|
@@ -63,7 +63,7 @@ loadEnvDirectory.__type = [
|
|
|
63
63
|
"mode",
|
|
64
64
|
"cacheDir",
|
|
65
65
|
"packageJson",
|
|
66
|
-
() =>
|
|
66
|
+
() => require_config.__ΩWorkspaceConfig,
|
|
67
67
|
"workspaceConfig",
|
|
68
68
|
"loadEnvDirectory",
|
|
69
69
|
"Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
|
|
@@ -94,7 +94,7 @@ function loadEnvFromContext(context, parsed) {
|
|
|
94
94
|
TEST: context.config.mode === "test",
|
|
95
95
|
DEBUG: context.config.mode === "development",
|
|
96
96
|
STACKTRACE: context.config.mode !== "production",
|
|
97
|
-
ENVIRONMENT: !context.environment.name || context.environment.name ===
|
|
97
|
+
ENVIRONMENT: !context.environment.name || context.environment.name === require_environments.DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
|
|
98
98
|
}, (0, __stryke_type_checks_is_set_object.isSetObject)(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
|
|
99
99
|
ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
|
|
100
100
|
return ret;
|
package/dist/helpers/load.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __ΩEnvPluginContext, __ΩEnvPluginOptions } from "../types/plugin.mjs";
|
|
2
2
|
import { removeEnvPrefix } from "./source-file-env.mjs";
|
|
3
|
+
import { __ΩWorkspaceConfig } from "../powerlines/src/types/config.mjs";
|
|
4
|
+
import { DEFAULT_ENVIRONMENT } from "../powerlines/src/lib/constants/environments.mjs";
|
|
3
5
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import { __ΩWorkspaceConfig } from "powerlines/types/config";
|
|
5
6
|
import { loadEnv as loadEnv$1, loadEnvFile } from "@stryke/env/load-env";
|
|
6
7
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
7
8
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
8
9
|
import { loadConfig } from "c12";
|
|
9
10
|
import defu from "defu";
|
|
10
|
-
import { DEFAULT_ENVIRONMENT } from "powerlines/lib/constants/environments";
|
|
11
11
|
|
|
12
12
|
//#region src/helpers/load.ts
|
|
13
13
|
function __assignType(fn, args) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
|
+
const require_context = require('../powerlines/src/types/context.cjs');
|
|
3
4
|
const require_helpers_reflect = require('./reflect.cjs');
|
|
4
5
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
|
-
let powerlines_types_context = require("powerlines/types/context");
|
|
6
6
|
let __powerlines_deepkit_capnp = require("@powerlines/deepkit/capnp");
|
|
7
7
|
let __powerlines_deepkit_resolve_reflections = require("@powerlines/deepkit/resolve-reflections");
|
|
8
8
|
let __powerlines_deepkit_schemas_reflection = require("@powerlines/deepkit/schemas/reflection");
|
|
@@ -26,7 +26,7 @@ async function resolveRuntimeTypeFile(context) {
|
|
|
26
26
|
return resolved;
|
|
27
27
|
}
|
|
28
28
|
resolveRuntimeTypeFile.__type = [
|
|
29
|
-
() =>
|
|
29
|
+
() => require_context.__ΩUnresolvedContext,
|
|
30
30
|
() => require_types_plugin.__ΩEnvPluginResolvedConfig,
|
|
31
31
|
"context",
|
|
32
32
|
"resolveRuntimeTypeFile",
|
|
@@ -46,7 +46,7 @@ async function getEnvDefaultTypeDefinition(context) {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
getEnvDefaultTypeDefinition.__type = [
|
|
49
|
-
() =>
|
|
49
|
+
() => require_context.__ΩUnresolvedContext,
|
|
50
50
|
() => require_types_plugin.__ΩEnvPluginResolvedConfig,
|
|
51
51
|
"context",
|
|
52
52
|
"getEnvDefaultTypeDefinition",
|
|
@@ -65,7 +65,7 @@ async function getSecretsDefaultTypeDefinition(context) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
getSecretsDefaultTypeDefinition.__type = [
|
|
68
|
-
() =>
|
|
68
|
+
() => require_context.__ΩUnresolvedContext,
|
|
69
69
|
() => require_types_plugin.__ΩEnvPluginResolvedConfig,
|
|
70
70
|
"context",
|
|
71
71
|
"getSecretsDefaultTypeDefinition",
|
|
@@ -82,7 +82,7 @@ function getEnvTypeReflectionsPath(context, name = "env") {
|
|
|
82
82
|
return (0, __stryke_path_join_paths.joinPaths)((0, __powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}-types.bin`);
|
|
83
83
|
}
|
|
84
84
|
getEnvTypeReflectionsPath.__type = [
|
|
85
|
-
() =>
|
|
85
|
+
() => require_context.__ΩContext,
|
|
86
86
|
() => require_types_plugin.__ΩEnvPluginResolvedConfig,
|
|
87
87
|
"context",
|
|
88
88
|
() => require_types_plugin.__ΩEnvType,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Context, UnresolvedContext } from "../powerlines/src/types/context.cjs";
|
|
1
2
|
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.cjs";
|
|
2
3
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
3
4
|
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { Context, UnresolvedContext } from "powerlines/types/context";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/persistence.d.ts
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Context, UnresolvedContext } from "../powerlines/src/types/context.mjs";
|
|
1
2
|
import { EnvPluginContext, EnvPluginResolvedConfig, EnvType } from "../types/plugin.mjs";
|
|
2
3
|
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
import { Context, UnresolvedContext } from "powerlines/types/context";
|
|
4
4
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
5
5
|
|
|
6
6
|
//#region src/helpers/persistence.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __ΩEnvPluginContext, __ΩEnvPluginResolvedConfig, __ΩEnvType } from "../types/plugin.mjs";
|
|
2
|
+
import { __ΩContext, __ΩUnresolvedContext } from "../powerlines/src/types/context.mjs";
|
|
2
3
|
import { createEnvReflection } from "./reflect.mjs";
|
|
3
4
|
import { ReflectionClass, ReflectionKind, deserializeType, resolveClassType } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
import { __ΩContext, __ΩUnresolvedContext } from "powerlines/types/context";
|
|
5
5
|
import { convertFromCapnp, convertToCapnp } from "@powerlines/deepkit/capnp";
|
|
6
6
|
import { getReflectionsPath } from "@powerlines/deepkit/resolve-reflections";
|
|
7
7
|
import { SerializedTypes } from "@powerlines/deepkit/schemas/reflection";
|
package/dist/helpers/reflect.cjs
CHANGED
|
@@ -55,17 +55,8 @@ const __ΩCreateEnvReflectionOptions = [
|
|
|
55
55
|
"PPn!n\"J4#8P\"7$4%8Mw&y"
|
|
56
56
|
];
|
|
57
57
|
var BaseEnv = class {
|
|
58
|
-
APP_NAME;
|
|
59
|
-
APP_VERSION;
|
|
60
|
-
BUILD_ID;
|
|
61
|
-
BUILD_TIMESTAMP;
|
|
62
|
-
BUILD_CHECKSUM;
|
|
63
|
-
RELEASE_ID;
|
|
64
|
-
RELEASE_TAG;
|
|
65
|
-
ORGANIZATION;
|
|
66
58
|
PLATFORM = "neutral";
|
|
67
59
|
MODE = "production";
|
|
68
|
-
ENVIRONMENT;
|
|
69
60
|
DEBUG = false;
|
|
70
61
|
TEST = false;
|
|
71
62
|
MINIMAL = false;
|
|
@@ -74,9 +65,6 @@ var BaseEnv = class {
|
|
|
74
65
|
FORCE_HYPERLINK = false;
|
|
75
66
|
STACKTRACE = false;
|
|
76
67
|
INCLUDE_ERROR_DATA = false;
|
|
77
|
-
ERROR_URL;
|
|
78
|
-
DEFAULT_TIMEZONE;
|
|
79
|
-
DEFAULT_LOCALE;
|
|
80
68
|
CI = false;
|
|
81
69
|
static __type = [
|
|
82
70
|
"APP_NAME",
|
|
@@ -147,7 +135,6 @@ var BaseEnv = class {
|
|
|
147
135
|
];
|
|
148
136
|
};
|
|
149
137
|
var BaseSecrets = class {
|
|
150
|
-
ENCRYPTION_KEY;
|
|
151
138
|
static __type = [
|
|
152
139
|
"ENCRYPTION_KEY",
|
|
153
140
|
() => require_types_runtime.__ΩSecretsInterface,
|
package/dist/helpers/reflect.mjs
CHANGED
|
@@ -54,17 +54,8 @@ const __ΩCreateEnvReflectionOptions = [
|
|
|
54
54
|
"PPn!n\"J4#8P\"7$4%8Mw&y"
|
|
55
55
|
];
|
|
56
56
|
var BaseEnv = class {
|
|
57
|
-
APP_NAME;
|
|
58
|
-
APP_VERSION;
|
|
59
|
-
BUILD_ID;
|
|
60
|
-
BUILD_TIMESTAMP;
|
|
61
|
-
BUILD_CHECKSUM;
|
|
62
|
-
RELEASE_ID;
|
|
63
|
-
RELEASE_TAG;
|
|
64
|
-
ORGANIZATION;
|
|
65
57
|
PLATFORM = "neutral";
|
|
66
58
|
MODE = "production";
|
|
67
|
-
ENVIRONMENT;
|
|
68
59
|
DEBUG = false;
|
|
69
60
|
TEST = false;
|
|
70
61
|
MINIMAL = false;
|
|
@@ -73,9 +64,6 @@ var BaseEnv = class {
|
|
|
73
64
|
FORCE_HYPERLINK = false;
|
|
74
65
|
STACKTRACE = false;
|
|
75
66
|
INCLUDE_ERROR_DATA = false;
|
|
76
|
-
ERROR_URL;
|
|
77
|
-
DEFAULT_TIMEZONE;
|
|
78
|
-
DEFAULT_LOCALE;
|
|
79
67
|
CI = false;
|
|
80
68
|
static __type = [
|
|
81
69
|
"APP_NAME",
|
|
@@ -146,7 +134,6 @@ var BaseEnv = class {
|
|
|
146
134
|
];
|
|
147
135
|
};
|
|
148
136
|
var BaseSecrets = class {
|
|
149
|
-
ENCRYPTION_KEY;
|
|
150
137
|
static __type = [
|
|
151
138
|
"ENCRYPTION_KEY",
|
|
152
139
|
() => __ΩSecretsInterface,
|
package/dist/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ const require_components_env = require('./components/env.cjs');
|
|
|
17
17
|
require('./components/index.cjs');
|
|
18
18
|
const require_babel_plugin = require('./babel/plugin.cjs');
|
|
19
19
|
require('./babel/index.cjs');
|
|
20
|
+
const require_index = require('./plugin-alloy/src/index.cjs');
|
|
20
21
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
21
22
|
let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
22
23
|
let __stryke_env_types = require("@stryke/env/types");
|
|
@@ -24,8 +25,6 @@ let defu = require("defu");
|
|
|
24
25
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
25
26
|
let __stryke_path_join = require("@stryke/path/join");
|
|
26
27
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
27
|
-
let __powerlines_plugin_alloy = require("@powerlines/plugin-alloy");
|
|
28
|
-
__powerlines_plugin_alloy = require_rolldown_runtime.__toESM(__powerlines_plugin_alloy);
|
|
29
28
|
let __powerlines_plugin_automd = require("@powerlines/plugin-automd");
|
|
30
29
|
__powerlines_plugin_automd = require_rolldown_runtime.__toESM(__powerlines_plugin_automd);
|
|
31
30
|
let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
@@ -41,7 +40,7 @@ let __stryke_string_format_constant_case = require("@stryke/string-format/consta
|
|
|
41
40
|
*/
|
|
42
41
|
const plugin = (options = {}) => {
|
|
43
42
|
return [
|
|
44
|
-
|
|
43
|
+
require_index.default(options.alloy),
|
|
45
44
|
(0, __powerlines_plugin_babel.default)(options.babel),
|
|
46
45
|
{
|
|
47
46
|
name: "env",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
1
2
|
import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.cjs";
|
|
2
3
|
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.cjs";
|
|
3
4
|
import { EnvDocsFile, EnvDocsFileProps, __ΩEnvDocsFileProps } from "./components/docs.cjs";
|
|
@@ -13,7 +14,6 @@ import "./helpers/index.cjs";
|
|
|
13
14
|
import "./types/index.cjs";
|
|
14
15
|
import { envBabelPlugin } from "./babel/plugin.cjs";
|
|
15
16
|
import "./babel/index.cjs";
|
|
16
|
-
import { Plugin } from "powerlines/types/plugin";
|
|
17
17
|
|
|
18
18
|
//#region src/index.d.ts
|
|
19
19
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
1
2
|
import { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface } from "./types/runtime.mjs";
|
|
2
3
|
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType } from "./types/plugin.mjs";
|
|
3
4
|
import { EnvDocsFile, EnvDocsFileProps, __ΩEnvDocsFileProps } from "./components/docs.mjs";
|
|
@@ -13,7 +14,6 @@ import "./helpers/index.mjs";
|
|
|
13
14
|
import "./types/index.mjs";
|
|
14
15
|
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
15
16
|
import "./babel/index.mjs";
|
|
16
|
-
import { Plugin } from "powerlines/types/plugin";
|
|
17
17
|
|
|
18
18
|
//#region src/index.d.ts
|
|
19
19
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -15,13 +15,13 @@ import { EnvBuiltin, EnvTypeDefinition } from "./components/env.mjs";
|
|
|
15
15
|
import "./components/index.mjs";
|
|
16
16
|
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
17
17
|
import "./babel/index.mjs";
|
|
18
|
+
import src_default$1 from "./plugin-alloy/src/index.mjs";
|
|
18
19
|
import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
19
20
|
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
20
21
|
import { ENV_PREFIXES } from "@stryke/env/types";
|
|
21
22
|
import defu from "defu";
|
|
22
23
|
import { joinPaths } from "@stryke/path/join";
|
|
23
24
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
24
|
-
import alloy from "@powerlines/plugin-alloy";
|
|
25
25
|
import automd from "@powerlines/plugin-automd";
|
|
26
26
|
import babel from "@powerlines/plugin-babel";
|
|
27
27
|
import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
|
|
@@ -35,7 +35,7 @@ import { constantCase } from "@stryke/string-format/constant-case";
|
|
|
35
35
|
*/
|
|
36
36
|
const plugin = (options = {}) => {
|
|
37
37
|
return [
|
|
38
|
-
|
|
38
|
+
src_default$1(options.alloy),
|
|
39
39
|
babel(options.babel),
|
|
40
40
|
{
|
|
41
41
|
name: "env",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
3
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
+
|
|
6
|
+
//#region ../plugin-alloy/src/core/components/output.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
9
|
+
*/
|
|
10
|
+
function Output(props) {
|
|
11
|
+
const [{ children, context, basePath }, rest] = (0, __alloy_js_core.splitProps)(props, [
|
|
12
|
+
"children",
|
|
13
|
+
"context",
|
|
14
|
+
"basePath"
|
|
15
|
+
]);
|
|
16
|
+
const basePathRef = (0, __alloy_js_core.computed)(() => basePath ? (0, __stryke_path_replace.replacePath)(basePath, context.workspaceConfig.workspaceRoot) : context.workspaceConfig.workspaceRoot);
|
|
17
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Output, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
18
|
+
get basePath() {
|
|
19
|
+
return basePathRef.value;
|
|
20
|
+
},
|
|
21
|
+
get children() {
|
|
22
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
23
|
+
get when() {
|
|
24
|
+
return Boolean(context);
|
|
25
|
+
},
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.Output = Output;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Output, Show, computed, splitProps } from "@alloy-js/core";
|
|
2
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { replacePath } from "@stryke/path/replace";
|
|
4
|
+
|
|
5
|
+
//#region ../plugin-alloy/src/core/components/output.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
8
|
+
*/
|
|
9
|
+
function Output$1(props) {
|
|
10
|
+
const [{ children, context, basePath }, rest] = splitProps(props, [
|
|
11
|
+
"children",
|
|
12
|
+
"context",
|
|
13
|
+
"basePath"
|
|
14
|
+
]);
|
|
15
|
+
const basePathRef = computed(() => basePath ? replacePath(basePath, context.workspaceConfig.workspaceRoot) : context.workspaceConfig.workspaceRoot);
|
|
16
|
+
return createComponent(Output, mergeProps(rest, {
|
|
17
|
+
get basePath() {
|
|
18
|
+
return basePathRef.value;
|
|
19
|
+
},
|
|
20
|
+
get children() {
|
|
21
|
+
return createComponent(Show, {
|
|
22
|
+
get when() {
|
|
23
|
+
return Boolean(context);
|
|
24
|
+
},
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Output$1 as Output };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const require_unctx = require('../../internal/unctx.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../plugin-alloy/src/core/contexts/context.ts
|
|
4
|
+
const __ΩRecord = [
|
|
5
|
+
"K",
|
|
6
|
+
"T",
|
|
7
|
+
"Record",
|
|
8
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
9
|
+
];
|
|
10
|
+
const __ΩMetaItem = [
|
|
11
|
+
"builtin",
|
|
12
|
+
"entry",
|
|
13
|
+
"kind",
|
|
14
|
+
"The kind of metadata item.",
|
|
15
|
+
"skipFormat",
|
|
16
|
+
"Whether to skip formatting for this output.",
|
|
17
|
+
"StoragePreset",
|
|
18
|
+
"storage",
|
|
19
|
+
"The storage preset or adapter name for the output files.",
|
|
20
|
+
"MetaItem",
|
|
21
|
+
"PP.!.\"&J4#8?$)4%8?&P\"w'&J4(8?)&\"LMw*y"
|
|
22
|
+
];
|
|
23
|
+
const __ΩPowerlinesContextInterface = [
|
|
24
|
+
"PluginContext",
|
|
25
|
+
"TContext",
|
|
26
|
+
() => __ΩRecord,
|
|
27
|
+
() => __ΩMetaItem,
|
|
28
|
+
"TMeta",
|
|
29
|
+
"value",
|
|
30
|
+
"The current Powerlines context.",
|
|
31
|
+
"meta",
|
|
32
|
+
"The current render metadata.",
|
|
33
|
+
"PowerlinesContextInterface",
|
|
34
|
+
"\"w!c\"&n$o##c%Pe\"!4&?'e\"\"4(?)Mw*y"
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Hook to access the Powerlines Context.
|
|
38
|
+
*
|
|
39
|
+
* @returns The Context.
|
|
40
|
+
*/
|
|
41
|
+
function usePowerlinesContext() {
|
|
42
|
+
return require_unctx.unctx.tryUse();
|
|
43
|
+
}
|
|
44
|
+
usePowerlinesContext.__type = [
|
|
45
|
+
() => __ΩPowerlinesContextInterface,
|
|
46
|
+
"usePowerlinesContext",
|
|
47
|
+
"Hook to access the Powerlines Context.",
|
|
48
|
+
"PP\"\"o!#,J/\"?#"
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
52
|
+
*
|
|
53
|
+
* @returns The Powerlines context or null if not set.
|
|
54
|
+
*/
|
|
55
|
+
function usePowerlinesSafe() {
|
|
56
|
+
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"]], usePowerlinesContext())?.value ?? null;
|
|
57
|
+
}
|
|
58
|
+
usePowerlinesSafe.__type = [
|
|
59
|
+
"usePowerlinesSafe",
|
|
60
|
+
"Hook to safely access the {@link PluginContext | Powerlines context}.",
|
|
61
|
+
"PP\",J/!?\""
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
65
|
+
*
|
|
66
|
+
* @returns The Powerlines context.
|
|
67
|
+
*/
|
|
68
|
+
function usePowerlines() {
|
|
69
|
+
const powerlines = (usePowerlinesSafe.Ω = [["PluginContext", "\"w!"]], usePowerlinesSafe());
|
|
70
|
+
if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
71
|
+
return powerlines;
|
|
72
|
+
}
|
|
73
|
+
usePowerlines.__type = [
|
|
74
|
+
"usePowerlines",
|
|
75
|
+
"Hook to access the {@link PluginContext | Powerlines context}.",
|
|
76
|
+
"P\"/!?\""
|
|
77
|
+
];
|
|
78
|
+
/**
|
|
79
|
+
* Hook to safely access the render context's metadata.
|
|
80
|
+
*
|
|
81
|
+
* @returns The Powerlines context or null if not set.
|
|
82
|
+
*/
|
|
83
|
+
function useMetaSafe() {
|
|
84
|
+
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"], [
|
|
85
|
+
() => __ΩRecord,
|
|
86
|
+
() => __ΩMetaItem,
|
|
87
|
+
"&n\"o!#"
|
|
88
|
+
]], usePowerlinesContext())?.meta ?? null;
|
|
89
|
+
}
|
|
90
|
+
useMetaSafe.__type = [
|
|
91
|
+
"useMetaSafe",
|
|
92
|
+
"Hook to safely access the render context's metadata.",
|
|
93
|
+
"PP\",J/!?\""
|
|
94
|
+
];
|
|
95
|
+
/**
|
|
96
|
+
* Hook to access the render context's metadata.
|
|
97
|
+
*
|
|
98
|
+
* @returns The Powerlines context.
|
|
99
|
+
*/
|
|
100
|
+
function useMeta() {
|
|
101
|
+
const meta = (useMetaSafe.Ω = [[
|
|
102
|
+
() => __ΩRecord,
|
|
103
|
+
() => __ΩMetaItem,
|
|
104
|
+
"&n\"o!#"
|
|
105
|
+
]], useMetaSafe());
|
|
106
|
+
if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
107
|
+
return meta;
|
|
108
|
+
}
|
|
109
|
+
useMeta.__type = [
|
|
110
|
+
"useMeta",
|
|
111
|
+
"Hook to access the render context's metadata.",
|
|
112
|
+
"P\"/!?\""
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
116
|
+
exports.__ΩPowerlinesContextInterface = __ΩPowerlinesContextInterface;
|