@powerlines/plugin-nodejs 0.1.263 → 0.1.265
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/env-builtin.cjs +81 -91
- package/dist/components/env-builtin.mjs +81 -91
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/index.cjs +3 -6
- package/dist/index.mjs +3 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/_virtual/_rolldown/runtime.mjs +0 -3
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
4
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
5
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
@@ -11,6 +10,7 @@ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case
|
|
|
11
10
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
12
11
|
let defu = require("defu");
|
|
13
12
|
defu = require_runtime.__toESM(defu);
|
|
13
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
14
14
|
|
|
15
15
|
//#region src/components/env-builtin.tsx
|
|
16
16
|
/**
|
|
@@ -19,86 +19,80 @@ defu = require_runtime.__toESM(defu);
|
|
|
19
19
|
function NodeJsEnvBuiltin(props) {
|
|
20
20
|
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
21
21
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
22
|
-
return (0, _alloy_js_core_jsx_runtime.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(0, _alloy_js_core_jsx_runtime.
|
|
86
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
87
|
-
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
88
|
-
get children() {
|
|
89
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`If the \`DATA_DIR\`, \`CONFIG_DIR\`, \`CACHE_DIR\`, \`LOG_DIR\`, or \`TEMP_DIR\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):
|
|
22
|
+
return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_powerlines_plugin_env_components_env_builtin.EnvBuiltin, {
|
|
23
|
+
defaultConfig: _alloy_js_core.code`process.env`,
|
|
24
|
+
...rest,
|
|
25
|
+
imports: (0, defu.default)({
|
|
26
|
+
"node:os": "os",
|
|
27
|
+
"node:path": ["basename", "join"]
|
|
28
|
+
}, rest.imports ?? {}),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
31
|
+
export: true,
|
|
32
|
+
const: true,
|
|
33
|
+
name: "isWindows",
|
|
34
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
35
|
+
initializer: _alloy_js_core.code`/^win/i.test(process.platform); `
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
38
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
39
|
+
export: true,
|
|
40
|
+
const: true,
|
|
41
|
+
name: "isLinux",
|
|
42
|
+
doc: "An indicator specifying whether the current operating system is Linux.",
|
|
43
|
+
initializer: _alloy_js_core.code`/^linux/i.test(process.platform); `
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
46
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
47
|
+
export: true,
|
|
48
|
+
const: true,
|
|
49
|
+
name: "isMacOS",
|
|
50
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
51
|
+
initializer: _alloy_js_core.code`/^darwin/i.test(process.platform); `
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
54
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
55
|
+
const: true,
|
|
56
|
+
name: "homedir",
|
|
57
|
+
initializer: _alloy_js_core.code`os.homedir(); `
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
60
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
61
|
+
const: true,
|
|
62
|
+
name: "tmpdir",
|
|
63
|
+
initializer: _alloy_js_core.code`os.tmpdir(); `
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
66
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
67
|
+
heading: "The environment path types for storing things like data, config, logs, and cache in the current runtime environment.",
|
|
68
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `These environment path types are accessed in the {@link EnvPaths} type. ` })
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeDeclaration, {
|
|
71
|
+
export: true,
|
|
72
|
+
name: "EnvPathType",
|
|
73
|
+
children: _alloy_js_core.code`"data" | "config" | "cache" | "log" | "temp"; `
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
76
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "The environment paths for storing things like data, config, logs, and cache in the current runtime environment." }),
|
|
77
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeDeclaration, {
|
|
78
|
+
export: true,
|
|
79
|
+
name: "EnvPaths",
|
|
80
|
+
children: _alloy_js_core.code`Record<EnvPathType, string>; `
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
83
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
84
|
+
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
85
|
+
children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`If the \`DATA_DIR\`, \`CONFIG_DIR\`, \`CACHE_DIR\`, \`LOG_DIR\`, or \`TEMP_DIR\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):
|
|
90
86
|
- **Linux**: directories are generally created in \`~/.config/<name>\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))
|
|
91
87
|
- **Windows**: directories are generally created in \`%AppData%/<name>\`
|
|
92
88
|
- **MacOS**: directories are generally created in \`~/Library/Application Support/<name>\`
|
|
93
|
-
` })
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
get initializer() {
|
|
101
|
-
return _alloy_js_core.code`isMacOS
|
|
89
|
+
` })
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
|
|
92
|
+
export: true,
|
|
93
|
+
const: true,
|
|
94
|
+
name: "paths",
|
|
95
|
+
initializer: _alloy_js_core.code`isMacOS
|
|
102
96
|
? {
|
|
103
97
|
data: env.DATA_DIR
|
|
104
98
|
? join(String(env.DATA_DIR), "${(0, _stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
@@ -161,19 +155,15 @@ function NodeJsEnvBuiltin(props) {
|
|
|
161
155
|
: (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR
|
|
162
156
|
? join((env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR)!, "${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
163
157
|
: join(tmpdir, basename(homedir), "${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.name)}"))
|
|
164
|
-
} as EnvPaths;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
})
|
|
174
|
-
];
|
|
175
|
-
}
|
|
176
|
-
}));
|
|
158
|
+
} as EnvPaths; `
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
161
|
+
/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
|
|
162
|
+
when: Boolean(children),
|
|
163
|
+
children
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
});
|
|
177
167
|
}
|
|
178
168
|
|
|
179
169
|
//#endregion
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { Show, code, splitProps } from "@alloy-js/core";
|
|
3
2
|
import { TypeDeclaration, VarDeclaration } from "@alloy-js/typescript";
|
|
4
3
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
@@ -8,6 +7,7 @@ import { EnvBuiltin } from "@powerlines/plugin-env/components/env-builtin";
|
|
|
8
7
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
9
8
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
10
9
|
import defu from "defu";
|
|
10
|
+
import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/components/env-builtin.tsx
|
|
13
13
|
/**
|
|
@@ -16,86 +16,80 @@ import defu from "defu";
|
|
|
16
16
|
function NodeJsEnvBuiltin(props) {
|
|
17
17
|
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
18
18
|
const context = usePowerlines();
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
createComponent(TSDoc, {
|
|
84
|
-
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
85
|
-
get children() {
|
|
86
|
-
return createComponent(TSDocRemarks, { children: code`If the \`DATA_DIR\`, \`CONFIG_DIR\`, \`CACHE_DIR\`, \`LOG_DIR\`, or \`TEMP_DIR\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):
|
|
19
|
+
return /* @__PURE__ */ jsxs(EnvBuiltin, {
|
|
20
|
+
defaultConfig: code`process.env`,
|
|
21
|
+
...rest,
|
|
22
|
+
imports: defu({
|
|
23
|
+
"node:os": "os",
|
|
24
|
+
"node:path": ["basename", "join"]
|
|
25
|
+
}, rest.imports ?? {}),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
28
|
+
export: true,
|
|
29
|
+
const: true,
|
|
30
|
+
name: "isWindows",
|
|
31
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
32
|
+
initializer: code`/^win/i.test(process.platform); `
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
35
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
36
|
+
export: true,
|
|
37
|
+
const: true,
|
|
38
|
+
name: "isLinux",
|
|
39
|
+
doc: "An indicator specifying whether the current operating system is Linux.",
|
|
40
|
+
initializer: code`/^linux/i.test(process.platform); `
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
43
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
44
|
+
export: true,
|
|
45
|
+
const: true,
|
|
46
|
+
name: "isMacOS",
|
|
47
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
48
|
+
initializer: code`/^darwin/i.test(process.platform); `
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
51
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
52
|
+
const: true,
|
|
53
|
+
name: "homedir",
|
|
54
|
+
initializer: code`os.homedir(); `
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
58
|
+
const: true,
|
|
59
|
+
name: "tmpdir",
|
|
60
|
+
initializer: code`os.tmpdir(); `
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
63
|
+
/* @__PURE__ */ jsx(TSDoc, {
|
|
64
|
+
heading: "The environment path types for storing things like data, config, logs, and cache in the current runtime environment.",
|
|
65
|
+
children: /* @__PURE__ */ jsx(TSDocRemarks, { children: `These environment path types are accessed in the {@link EnvPaths} type. ` })
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ jsx(TypeDeclaration, {
|
|
68
|
+
export: true,
|
|
69
|
+
name: "EnvPathType",
|
|
70
|
+
children: code`"data" | "config" | "cache" | "log" | "temp"; `
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
73
|
+
/* @__PURE__ */ jsx(TSDoc, { heading: "The environment paths for storing things like data, config, logs, and cache in the current runtime environment." }),
|
|
74
|
+
/* @__PURE__ */ jsx(TypeDeclaration, {
|
|
75
|
+
export: true,
|
|
76
|
+
name: "EnvPaths",
|
|
77
|
+
children: code`Record<EnvPathType, string>; `
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
80
|
+
/* @__PURE__ */ jsx(TSDoc, {
|
|
81
|
+
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
82
|
+
children: /* @__PURE__ */ jsx(TSDocRemarks, { children: code`If the \`DATA_DIR\`, \`CONFIG_DIR\`, \`CACHE_DIR\`, \`LOG_DIR\`, or \`TEMP_DIR\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):
|
|
87
83
|
- **Linux**: directories are generally created in \`~/.config/<name>\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))
|
|
88
84
|
- **Windows**: directories are generally created in \`%AppData%/<name>\`
|
|
89
85
|
- **MacOS**: directories are generally created in \`~/Library/Application Support/<name>\`
|
|
90
|
-
` })
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
get initializer() {
|
|
98
|
-
return code`isMacOS
|
|
86
|
+
` })
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx(VarDeclaration, {
|
|
89
|
+
export: true,
|
|
90
|
+
const: true,
|
|
91
|
+
name: "paths",
|
|
92
|
+
initializer: code`isMacOS
|
|
99
93
|
? {
|
|
100
94
|
data: env.DATA_DIR
|
|
101
95
|
? join(String(env.DATA_DIR), "${titleCase(context.config.name)}")
|
|
@@ -158,19 +152,15 @@ function NodeJsEnvBuiltin(props) {
|
|
|
158
152
|
: (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR
|
|
159
153
|
? join((env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR)!, "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}")
|
|
160
154
|
: join(tmpdir, basename(homedir), "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}"))
|
|
161
|
-
} as EnvPaths;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
})
|
|
171
|
-
];
|
|
172
|
-
}
|
|
173
|
-
}));
|
|
155
|
+
} as EnvPaths; `
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ jsx(Spacing, {}),
|
|
158
|
+
/* @__PURE__ */ jsx(Show, {
|
|
159
|
+
when: Boolean(children),
|
|
160
|
+
children
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
});
|
|
174
164
|
}
|
|
175
165
|
|
|
176
166
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.mjs","names":["code","Show","splitProps","TypeDeclaration","VarDeclaration","Spacing","usePowerlines","TSDoc","TSDocRemarks","EnvBuiltin","kebabCase","titleCase","defu","NodeJsEnvBuiltin","props","children","rest","context","_$createComponent","_$mergeProps","defaultConfig","imports","name","doc","initializer","heading","config","organization","when","Boolean"],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { TypeDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n EnvBuiltin,\n EnvBuiltinProps\n} from \"@powerlines/plugin-env/components/env-builtin\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport defu from \"defu\";\nimport { NodeJsPluginContext } from \"../types\";\n\n/**\n * Generates the NodeJs environment configuration module for the Powerlines project.\n */\nexport function NodeJsEnvBuiltin(props: EnvBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines<NodeJsPluginContext>();\n\n return (\n <EnvBuiltin\n defaultConfig={code`process.env`}\n {...rest}\n imports={defu(\n {\n \"node:os\": \"os\",\n \"node:path\": [\"basename\", \"join\"]\n },\n rest.imports ?? {}\n )}>\n <VarDeclaration\n export\n const\n name=\"isWindows\"\n doc=\"An indicator specifying whether the current operating system is MacOS (darwin kernel).\"\n initializer={code`/^win/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"isLinux\"\n doc=\"An indicator specifying whether the current operating system is Linux.\"\n initializer={code`/^linux/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"isMacOS\"\n doc=\"An indicator specifying whether the current operating system is MacOS (darwin kernel).\"\n initializer={code`/^darwin/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration const name=\"homedir\" initializer={code`os.homedir(); `} />\n <Spacing />\n <VarDeclaration const name=\"tmpdir\" initializer={code`os.tmpdir(); `} />\n <Spacing />\n <TSDoc heading=\"The environment path types for storing things like data, config, logs, and cache in the current runtime environment.\">\n <TSDocRemarks>\n {`These environment path types are accessed in the {@link EnvPaths} type. `}\n </TSDocRemarks>\n </TSDoc>\n <TypeDeclaration export name=\"EnvPathType\">\n {code`\"data\" | \"config\" | \"cache\" | \"log\" | \"temp\"; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"The environment paths for storing things like data, config, logs, and cache in the current runtime environment.\" />\n <TypeDeclaration export name=\"EnvPaths\">\n {code`Record<EnvPathType, string>; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"The resolved application directories based on the current operating system and environment variables.\">\n <TSDocRemarks>\n {code`If the \\`DATA_DIR\\`, \\`CONFIG_DIR\\`, \\`CACHE_DIR\\`, \\`LOG_DIR\\`, or \\`TEMP_DIR\\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):\n - **Linux**: directories are generally created in \\`~/.config/<name>\\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))\n - **Windows**: directories are generally created in \\`%AppData%/<name>\\`\n - **MacOS**: directories are generally created in \\`~/Library/Application Support/<name>\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"paths\"\n initializer={code`isMacOS\n ? {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Application Support\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n config: env.CONFIG_DIR\n ? join(String(env.CONFIG_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Preferences\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Caches\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${titleCase(context.config.name)}\")\n : join(homedir, \"Library\", \"Logs\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(tmpdir, \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\")\n }\n : isWindows\n ? {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Data\"),\n config: env.CONFIG_DIR\n ? join(env.CONFIG_DIR!, \"${titleCase(context.config.name)}\")\n : join(env.APPDATA || join(homedir, \"AppData\", \"Roaming\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Config\"),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"Cache\", \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Log\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${titleCase(context.config.name)}\")\n : join(tmpdir, \"${titleCase(context.config.organization)}\", \"${titleCase(context.config.name)}\")\n }\n :\n {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${kebabCase(context.config.name)}\")\n : join(\n env.XDG_DATA_HOME || join(homedir, \".local\", \"share\"),\n \"${kebabCase(context.config.organization)}\",\n \"${kebabCase(context.config.name)}\"\n ),\n config: env.CONFIG_DIR\n ? join(String(env.CONFIG_DIR), \"${kebabCase(context.config.name)}\")\n : join(\n env.XDG_CONFIG_HOME || join(homedir, \".config\"),\n \"${kebabCase(context.config.organization)}\",\n \"${kebabCase(context.config.name)}\"\n ),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${kebabCase(context.config.name)}\")\n : join(env.XDG_CACHE_HOME || join(homedir, \".cache\"), \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${kebabCase(context.config.name)}\")\n : join(env.XDG_STATE_HOME || join(homedir, \".local\", \"state\"), \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${kebabCase(context.config.name)}\")\n : (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR\n ? join((env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR)!, \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\")\n : join(tmpdir, basename(homedir), \"${kebabCase(context.config.organization)}\", \"${kebabCase(context.config.name)}\"))\n } as EnvPaths; `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,SAAgBa,iBAAiBC,OAAwB;CACvD,MAAM,CAAC,EAAEC,YAAYC,QAAQd,WAAWY,OAAO,CAAC,WAAW,CAAC;CAE5D,MAAMG,UAAUX,eAAoC;AAEpD,QAAAY,gBACGT,YAAUU,WAAA,EACTC,eAAepB,IAAI,eAAa,EAC5BgB,MAAI;EAAA,IACRK,UAAO;AAAA,UAAET,KACP;IACE,WAAW;IACX,aAAa,CAAC,YAAY,OAAM;IACjC,EACDI,KAAKK,WAAW,EAClB,CAAC;;EAAA,IAAAN,WAAA;AAAA,UAAA;IAAAG,gBACAd,gBAAc;KAAA,UAAA;KAAA,SAAA;KAGbkB,MAAI;KACJC,KAAG;KACHC,aAAaxB,IAAI;KAAkC,CAAA;IAAAkB,gBAEpDb,SAAO,EAAA,CAAA;IAAAa,gBACPd,gBAAc;KAAA,UAAA;KAAA,SAAA;KAGbkB,MAAI;KACJC,KAAG;KACHC,aAAaxB,IAAI;KAAoC,CAAA;IAAAkB,gBAEtDb,SAAO,EAAA,CAAA;IAAAa,gBACPd,gBAAc;KAAA,UAAA;KAAA,SAAA;KAGbkB,MAAI;KACJC,KAAG;KACHC,aAAaxB,IAAI;KAAqC,CAAA;IAAAkB,gBAEvDb,SAAO,EAAA,CAAA;IAAAa,gBACPd,gBAAc;KAAA,SAAA;KAAOkB,MAAI;KAAWE,aAAaxB,IAAI;KAAgB,CAAA;IAAAkB,gBACrEb,SAAO,EAAA,CAAA;IAAAa,gBACPd,gBAAc;KAAA,SAAA;KAAOkB,MAAI;KAAUE,aAAaxB,IAAI;KAAe,CAAA;IAAAkB,gBACnEb,SAAO,EAAA,CAAA;IAA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QS,OAAOJ,KAChB,CAAA;;gDAE+BZ,UAAUO,QAAQS,OAAOJ,KAAK,CAAA;;4EAEFZ,UAAUO,QAAQS,OAAOC,aAAa,CAAA,MAAOjB,UACnGO,QAAQS,OAAOJ,KAChB,CAAA;yDACoCZ,UAAUO,QAAQS,OAAOC,aAAa,CAAA,MAAOjB,UAAUO,QAAQS,OAAOJ,KAAK,CAAA;;;KAC1G,CAAA;IAAAJ,gBAEnBb,SAAO,EAAA,CAAA;IAAAa,gBACPjB,MAAI;KAAA,IAAC2B,OAAI;AAAA,aAAEC,QAAQd,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { TypeDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n EnvBuiltin,\n EnvBuiltinProps\n} from \"@powerlines/plugin-env/components/env-builtin\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport defu from \"defu\";\nimport { NodeJsPluginContext } from \"../types\";\n\n/**\n * Generates the NodeJs environment configuration module for the Powerlines project.\n */\nexport function NodeJsEnvBuiltin(props: EnvBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines<NodeJsPluginContext>();\n\n return (\n <EnvBuiltin\n defaultConfig={code`process.env`}\n {...rest}\n imports={defu(\n {\n \"node:os\": \"os\",\n \"node:path\": [\"basename\", \"join\"]\n },\n rest.imports ?? {}\n )}>\n <VarDeclaration\n export\n const\n name=\"isWindows\"\n doc=\"An indicator specifying whether the current operating system is MacOS (darwin kernel).\"\n initializer={code`/^win/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"isLinux\"\n doc=\"An indicator specifying whether the current operating system is Linux.\"\n initializer={code`/^linux/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"isMacOS\"\n doc=\"An indicator specifying whether the current operating system is MacOS (darwin kernel).\"\n initializer={code`/^darwin/i.test(process.platform); `}\n />\n <Spacing />\n <VarDeclaration const name=\"homedir\" initializer={code`os.homedir(); `} />\n <Spacing />\n <VarDeclaration const name=\"tmpdir\" initializer={code`os.tmpdir(); `} />\n <Spacing />\n <TSDoc heading=\"The environment path types for storing things like data, config, logs, and cache in the current runtime environment.\">\n <TSDocRemarks>\n {`These environment path types are accessed in the {@link EnvPaths} type. `}\n </TSDocRemarks>\n </TSDoc>\n <TypeDeclaration export name=\"EnvPathType\">\n {code`\"data\" | \"config\" | \"cache\" | \"log\" | \"temp\"; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"The environment paths for storing things like data, config, logs, and cache in the current runtime environment.\" />\n <TypeDeclaration export name=\"EnvPaths\">\n {code`Record<EnvPathType, string>; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"The resolved application directories based on the current operating system and environment variables.\">\n <TSDocRemarks>\n {code`If the \\`DATA_DIR\\`, \\`CONFIG_DIR\\`, \\`CACHE_DIR\\`, \\`LOG_DIR\\`, or \\`TEMP_DIR\\` environment variables are set, they will be treated as overrides and used by default. If the environment variables are not set, the paths are determined based on the specific conventions for each operating system (with additional overrides available through operating system specific environment variables):\n - **Linux**: directories are generally created in \\`~/.config/<name>\\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))\n - **Windows**: directories are generally created in \\`%AppData%/<name>\\`\n - **MacOS**: directories are generally created in \\`~/Library/Application Support/<name>\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"paths\"\n initializer={code`isMacOS\n ? {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Application Support\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n config: env.CONFIG_DIR\n ? join(String(env.CONFIG_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Preferences\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(homedir, \"Library\", \"Caches\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${titleCase(context.config.name)}\")\n : join(homedir, \"Library\", \"Logs\", \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${titleCase(\n context.config.name\n )}\")\n : join(tmpdir, \"${titleCase(\n context.config.organization\n )}\", \"${titleCase(context.config.name)}\")\n }\n : isWindows\n ? {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Data\"),\n config: env.CONFIG_DIR\n ? join(env.CONFIG_DIR!, \"${titleCase(context.config.name)}\")\n : join(env.APPDATA || join(homedir, \"AppData\", \"Roaming\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Config\"),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"Cache\", \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${titleCase(context.config.name)}\")\n : join(env.LOCALAPPDATA || join(homedir, \"AppData\", \"Local\"), \"${titleCase(context.config.organization)}\", \"${titleCase(\n context.config.name\n )}\", \"Log\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${titleCase(context.config.name)}\")\n : join(tmpdir, \"${titleCase(context.config.organization)}\", \"${titleCase(context.config.name)}\")\n }\n :\n {\n data: env.DATA_DIR\n ? join(String(env.DATA_DIR), \"${kebabCase(context.config.name)}\")\n : join(\n env.XDG_DATA_HOME || join(homedir, \".local\", \"share\"),\n \"${kebabCase(context.config.organization)}\",\n \"${kebabCase(context.config.name)}\"\n ),\n config: env.CONFIG_DIR\n ? join(String(env.CONFIG_DIR), \"${kebabCase(context.config.name)}\")\n : join(\n env.XDG_CONFIG_HOME || join(homedir, \".config\"),\n \"${kebabCase(context.config.organization)}\",\n \"${kebabCase(context.config.name)}\"\n ),\n cache: env.CACHE_DIR\n ? join(String(env.CACHE_DIR), \"${kebabCase(context.config.name)}\")\n : join(env.XDG_CACHE_HOME || join(homedir, \".cache\"), \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\"),\n log: env.LOG_DIR\n ? join(String(env.LOG_DIR), \"${kebabCase(context.config.name)}\")\n : join(env.XDG_STATE_HOME || join(homedir, \".local\", \"state\"), \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\"),\n temp: env.TEMP_DIR\n ? join(String(env.TEMP_DIR), \"${kebabCase(context.config.name)}\")\n : (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR\n ? join((env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR)!, \"${kebabCase(context.config.organization)}\", \"${kebabCase(\n context.config.name\n )}\")\n : join(tmpdir, basename(homedir), \"${kebabCase(context.config.organization)}\", \"${kebabCase(context.config.name)}\"))\n } as EnvPaths; `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,SAAgB,iBAAiB,OAAwB;CACvD,MAAM,CAAC,EAAE,YAAY,QAAQ,WAAW,OAAO,CAAC,WAAW,CAAC;CAE5D,MAAM,UAAU,eAAoC;AAEpD,QACE,qBAAC,YAAD;EACE,eAAe,IAAI;EACnB,GAAI;EACJ,SAAS,KACP;GACE,WAAW;GACX,aAAa,CAAC,YAAY,OAAO;GAClC,EACD,KAAK,WAAW,EAAE,CACnB;YATH;GAUE,oBAAC,gBAAD;IACE;IACA;IACA,MAAK;IACL,KAAI;IACJ,aAAa,IAAI;IACjB;GACF,oBAAC,SAAD,EAAW;GACX,oBAAC,gBAAD;IACE;IACA;IACA,MAAK;IACL,KAAI;IACJ,aAAa,IAAI;IACjB;GACF,oBAAC,SAAD,EAAW;GACX,oBAAC,gBAAD;IACE;IACA;IACA,MAAK;IACL,KAAI;IACJ,aAAa,IAAI;IACjB;GACF,oBAAC,SAAD,EAAW;GACX,oBAAC,gBAAD;IAAgB;IAAM,MAAK;IAAU,aAAa,IAAI;IAAoB;GAC1E,oBAAC,SAAD,EAAW;GACX,oBAAC,gBAAD;IAAgB;IAAM,MAAK;IAAS,aAAa,IAAI;IAAmB;GACxE,oBAAC,SAAD,EAAW;GACX,oBAAC,OAAD;IAAO,SAAQ;cACb,oBAAC,cAAD,YACG,4EACY;IACT;GACR,oBAAC,iBAAD;IAAiB;IAAO,MAAK;cAC1B,IAAI;IACW;GAClB,oBAAC,SA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K,CAAC;iFACG,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UAC5G,QAAQ,OAAO,KAChB,CAAC;;gDAE8B,UAAU,QAAQ,OAAO,KAAK,CAAC;kCAC7C,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UAAU,QAAQ,OAAO,KAAK,CAAC;;;;;gDAK9D,UAAU,QAAQ,OAAO,KAAK,CAAC;;;uBAGxD,UAAU,QAAQ,OAAO,aAAa,CAAC;uBACvC,UAAU,QAAQ,OAAO,KAAK,CAAC;;;kDAGJ,UAAU,QAAQ,OAAO,KAAK,CAAC;;;uBAG1D,UAAU,QAAQ,OAAO,aAAa,CAAC;uBACvC,UAAU,QAAQ,OAAO,KAAK,CAAC;;;iDAGL,UAAU,QAAQ,OAAO,KAAK,CAAC;yEACP,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UACpG,QAAQ,OAAO,KAChB,CAAC;;+CAE6B,UAAU,QAAQ,OAAO,KAAK,CAAC;kFACI,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UAC7G,QAAQ,OAAO,KAChB,CAAC;;gDAE8B,UAAU,QAAQ,OAAO,KAAK,CAAC;;4EAEH,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UACnG,QAAQ,OAAO,KAChB,CAAC;yDACmC,UAAU,QAAQ,OAAO,aAAa,CAAC,MAAM,UAAU,QAAQ,OAAO,KAAK,CAAC;;IAE7H;GACF,oBAAC,SAAD,EAAW;GACX,oBAAC,MAAD;IAAM,MAAM,QAAQ,SAAS;IAAG;IAAgB;GACrC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_components_env_builtin = require('./components/env-builtin.cjs');
|
|
4
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
4
|
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
6
5
|
let _powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
7
6
|
_powerlines_plugin_babel = require_runtime.__toESM(_powerlines_plugin_babel);
|
|
@@ -9,6 +8,7 @@ let _powerlines_plugin_env = require("@powerlines/plugin-env");
|
|
|
9
8
|
_powerlines_plugin_env = require_runtime.__toESM(_powerlines_plugin_env);
|
|
10
9
|
let _powerlines_plugin_env_helpers_persistence = require("@powerlines/plugin-env/helpers/persistence");
|
|
11
10
|
let powerlines_typescript = require("powerlines/typescript");
|
|
11
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
12
12
|
|
|
13
13
|
//#region src/index.tsx
|
|
14
14
|
/**
|
|
@@ -27,12 +27,9 @@ const plugin = (options = {}) => {
|
|
|
27
27
|
if (!(0, powerlines_typescript.isMatchFound)("node", this.tsconfig.tsconfigJson.compilerOptions.types)) this.tsconfig.tsconfigJson.compilerOptions.types.push("node");
|
|
28
28
|
},
|
|
29
29
|
async prepare() {
|
|
30
|
-
const _self$ = this;
|
|
31
30
|
const result = await (0, _powerlines_plugin_env_helpers_persistence.readEnvTypeReflection)(this, "env");
|
|
32
|
-
return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.
|
|
33
|
-
|
|
34
|
-
return _self$.config.env.defaultConfig;
|
|
35
|
-
},
|
|
31
|
+
return (0, _powerlines_plugin_alloy_render.render)(this, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_components_env_builtin.NodeJsEnvBuiltin, {
|
|
32
|
+
defaultConfig: this.config.env.defaultConfig,
|
|
36
33
|
reflection: result
|
|
37
34
|
}));
|
|
38
35
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NodeJsEnvBuiltin } from "./components/env-builtin.mjs";
|
|
2
|
-
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
4
3
|
import babel from "@powerlines/plugin-babel";
|
|
5
4
|
import env from "@powerlines/plugin-env";
|
|
6
5
|
import { readEnvTypeReflection } from "@powerlines/plugin-env/helpers/persistence";
|
|
7
6
|
import { isMatchFound } from "powerlines/typescript";
|
|
7
|
+
import { jsx } from "@alloy-js/core/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/index.tsx
|
|
10
10
|
/**
|
|
@@ -23,12 +23,9 @@ const plugin = (options = {}) => {
|
|
|
23
23
|
if (!isMatchFound("node", this.tsconfig.tsconfigJson.compilerOptions.types)) this.tsconfig.tsconfigJson.compilerOptions.types.push("node");
|
|
24
24
|
},
|
|
25
25
|
async prepare() {
|
|
26
|
-
const _self$ = this;
|
|
27
26
|
const result = await readEnvTypeReflection(this, "env");
|
|
28
|
-
return render(this,
|
|
29
|
-
|
|
30
|
-
return _self$.config.env.defaultConfig;
|
|
31
|
-
},
|
|
27
|
+
return render(this, /* @__PURE__ */ jsx(NodeJsEnvBuiltin, {
|
|
28
|
+
defaultConfig: this.config.env.defaultConfig,
|
|
32
29
|
reflection: result
|
|
33
30
|
}));
|
|
34
31
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport babel from \"@powerlines/plugin-babel\";\nimport env from \"@powerlines/plugin-env\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers/persistence\";\nimport { Plugin } from \"powerlines\";\nimport { isMatchFound } from \"powerlines/typescript\";\nimport { NodeJsEnvBuiltin } from \"./components/env-builtin\";\nimport { NodeJsPluginContext, NodeJsPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n nodejs?: NodeJsPluginOptions;\n }\n}\n\n/**\n * A package containing a Powerlines plugin for building a NodeJs application.\n */\nexport const plugin = <\n TContext extends NodeJsPluginContext = NodeJsPluginContext\n>(\n options: NodeJsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n babel(options.babel),\n env(options.env),\n {\n name: \"nodejs\",\n configResolved() {\n this.devDependencies[\"@types/node\"] = \"^22.14.6\";\n\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.types ??= [];\n if (\n !isMatchFound(\n \"node\",\n this.tsconfig.tsconfigJson.compilerOptions.types\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.types.push(\"node\");\n }\n },\n async prepare() {\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <NodeJsEnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACV;AACvB,QAAO;EACL,MAAM,QAAQ,MAAM;EACpB,IAAI,QAAQ,IAAI;EAChB;GACE,MAAM;GACN,iBAAiB;AACf,SAAK,gBAAgB,iBAAiB;AAEtC,SAAK,SAAS,aAAa,oBAAoB,EAAE;AACjD,SAAK,SAAS,aAAa,gBAAgB,UAAU,EAAE;AACvD,QACE,CAAC,aACC,QACA,KAAK,SAAS,aAAa,gBAAgB,MAC5C,CAED,MAAK,SAAS,aAAa,gBAAgB,MAAM,KAAK,OAAO;;GAGjE,MAAM,UAAU;IACd,MAAM,SAAS,MAAM,sBAAsB,MAAM,MAAM;AAEvD,WAAO,OACL,MACA,oBAAC,kBAAD;KACE,eAAe,KAAK,OAAO,IAAI;KAC/B,YAAY;KACZ,EACH;;GAEJ;EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-nodejs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.265",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for building a Node.js application.",
|
|
6
6
|
"repository": {
|
|
@@ -119,17 +119,17 @@
|
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
121
121
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
122
|
-
"@powerlines/plugin-alloy": "^0.25.
|
|
123
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
124
|
-
"@powerlines/plugin-env": "^0.16.
|
|
125
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
122
|
+
"@powerlines/plugin-alloy": "^0.25.29",
|
|
123
|
+
"@powerlines/plugin-babel": "^0.12.348",
|
|
124
|
+
"@powerlines/plugin-env": "^0.16.64",
|
|
125
|
+
"@powerlines/plugin-plugin": "^0.12.296",
|
|
126
126
|
"@storm-software/config-tools": "1.189.28",
|
|
127
127
|
"@stryke/string-format": "^0.17.3",
|
|
128
128
|
"defu": "^6.1.4",
|
|
129
|
-
"powerlines": "^0.41.
|
|
129
|
+
"powerlines": "^0.41.10"
|
|
130
130
|
},
|
|
131
|
-
"devDependencies": { "@types/node": "^25.
|
|
131
|
+
"devDependencies": { "@types/node": "^25.5.0" },
|
|
132
132
|
"publishConfig": { "access": "public" },
|
|
133
133
|
"types": "./dist/index.d.cts",
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "8ab1d6e9a7ab44ee184b19c58d6de2c4c101ec01"
|
|
135
135
|
}
|