@powerlines/plugin-nodejs 0.1.155 → 0.1.157
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/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/components/env.cjs +185 -2
- package/dist/components/env.d.cts +11 -2
- package/dist/components/env.d.cts.map +1 -0
- package/dist/components/env.d.mts +11 -2
- package/dist/components/env.d.mts.map +1 -0
- package/dist/components/env.mjs +184 -2
- package/dist/components/env.mjs.map +1 -0
- package/dist/components/index.cjs +2 -3
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.mts +1 -2
- package/dist/components/index.mjs +1 -2
- package/dist/index.cjs +7 -8
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +0 -3
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +24 -2
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +24 -2
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +0 -2
- package/package.json +7 -7
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-kh0CpIG2.mjs +0 -1
- package/dist/env--9rS0L72.cjs +0 -223
- package/dist/env-BbWlIivm.d.mts +0 -11
- package/dist/env-BbWlIivm.d.mts.map +0 -1
- package/dist/env-CNIW9dZh.mjs +0 -185
- package/dist/env-CNIW9dZh.mjs.map +0 -1
- package/dist/env-i5491Gd4.d.cts +0 -11
- package/dist/env-i5491Gd4.d.cts.map +0 -1
- package/dist/index-9iG2qHLe.d.mts +0 -1
- package/dist/index-D-CYNcT9.d.mts +0 -1
- package/dist/index-D4ELpJXS.d.cts +0 -1
- package/dist/index-DLoAMD9J.d.cts +0 -1
- package/dist/plugin-DIMmxDo0.d.cts +0 -24
- package/dist/plugin-DIMmxDo0.d.cts.map +0 -1
- package/dist/plugin-ifZVa20V.mjs +0 -1
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/plugin-w7U9e4U2.d.mts +0 -24
- package/dist/plugin-w7U9e4U2.d.mts.map +0 -1
- package/dist/types-U3zd8PTP.mjs +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/components/env.cjs
CHANGED
|
@@ -1,3 +1,186 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
+
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
7
|
+
let __powerlines_plugin_env_components_env = require("@powerlines/plugin-env/components/env");
|
|
8
|
+
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
9
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
+
let defu = require("defu");
|
|
11
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
2
12
|
|
|
3
|
-
|
|
13
|
+
//#region src/components/env.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Generates the NodeJs environment configuration module for the Powerlines project.
|
|
16
|
+
*/
|
|
17
|
+
function NodeJsEnvBuiltin(props) {
|
|
18
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
19
|
+
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
20
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_env_components_env.EnvBuiltin, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
21
|
+
get imports() {
|
|
22
|
+
return (0, defu.default)({
|
|
23
|
+
"node:os": "os",
|
|
24
|
+
"node:path": ["basename", "join"]
|
|
25
|
+
}, rest.imports ?? {});
|
|
26
|
+
},
|
|
27
|
+
get children() {
|
|
28
|
+
return [
|
|
29
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
30
|
+
"export": true,
|
|
31
|
+
"const": true,
|
|
32
|
+
name: "isWindows",
|
|
33
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
34
|
+
initializer: __alloy_js_core.code`/^win/i.test(process.platform); `
|
|
35
|
+
}),
|
|
36
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
37
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
38
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__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
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
46
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
47
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
48
|
+
"export": true,
|
|
49
|
+
"const": true,
|
|
50
|
+
name: "isMacOS",
|
|
51
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
52
|
+
initializer: __alloy_js_core.code`/^darwin/i.test(process.platform); `
|
|
53
|
+
}),
|
|
54
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
55
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
56
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
57
|
+
"const": true,
|
|
58
|
+
name: "homedir",
|
|
59
|
+
initializer: __alloy_js_core.code`os.homedir(); `
|
|
60
|
+
}),
|
|
61
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
62
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
63
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
64
|
+
"const": true,
|
|
65
|
+
name: "tmpdir",
|
|
66
|
+
initializer: __alloy_js_core.code`os.tmpdir(); `
|
|
67
|
+
}),
|
|
68
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
69
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
70
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
71
|
+
heading: "The environment path types for storing things like data, config, logs, and cache in the current runtime environment.",
|
|
72
|
+
get children() {
|
|
73
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `These environment path types are accessed in the {@link EnvPaths} type. ` });
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
77
|
+
"export": true,
|
|
78
|
+
name: "EnvPathType",
|
|
79
|
+
children: __alloy_js_core.code`"data" | "config" | "cache" | "log" | "temp"; `
|
|
80
|
+
}),
|
|
81
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
82
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
83
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__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." }),
|
|
84
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
85
|
+
"export": true,
|
|
86
|
+
name: "EnvPaths",
|
|
87
|
+
children: __alloy_js_core.code`Record<EnvPathType, string>; `
|
|
88
|
+
}),
|
|
89
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
90
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
91
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
92
|
+
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
93
|
+
get children() {
|
|
94
|
+
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):
|
|
95
|
+
- **Linux**: directories are generally created in \`~/.config/<name>\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))
|
|
96
|
+
- **Windows**: directories are generally created in \`%AppData%/<name>\`
|
|
97
|
+
- **MacOS**: directories are generally created in \`~/Library/Application Support/<name>\`
|
|
98
|
+
` });
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
102
|
+
"export": true,
|
|
103
|
+
"const": true,
|
|
104
|
+
name: "paths",
|
|
105
|
+
get initializer() {
|
|
106
|
+
return __alloy_js_core.code`isMacOS
|
|
107
|
+
? {
|
|
108
|
+
data: String(env.DATA_DIR)
|
|
109
|
+
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
110
|
+
: join(homedir, "Library", "Application Support", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
111
|
+
config: String(env.CONFIG_DIR)
|
|
112
|
+
? join(String(env.CONFIG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
113
|
+
: join(homedir, "Library", "Preferences", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
114
|
+
cache: String(env.CACHE_DIR)
|
|
115
|
+
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
116
|
+
: join(homedir, "Library", "Caches", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
117
|
+
log: String(env.LOG_DIR)
|
|
118
|
+
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
119
|
+
: join(homedir, "Library", "Logs", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
120
|
+
temp: String(env.TEMP_DIR)
|
|
121
|
+
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
122
|
+
: join(tmpdir, "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
123
|
+
}
|
|
124
|
+
: isWindows
|
|
125
|
+
? {
|
|
126
|
+
data: String(env.DATA_DIR)
|
|
127
|
+
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
128
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}", "Data"),
|
|
129
|
+
config: String(env.CONFIG_DIR)
|
|
130
|
+
? join(env.CONFIG_DIR!, "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
131
|
+
: join(env.APPDATA || join(homedir, "AppData", "Roaming"), "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}", "Config"),
|
|
132
|
+
cache: String(env.CACHE_DIR)
|
|
133
|
+
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
134
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "Cache", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
135
|
+
log: String(env.LOG_DIR)
|
|
136
|
+
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
137
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}", "Log"),
|
|
138
|
+
temp: String(env.TEMP_DIR)
|
|
139
|
+
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
140
|
+
: join(tmpdir, "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
141
|
+
}
|
|
142
|
+
:
|
|
143
|
+
{
|
|
144
|
+
data: String(env.DATA_DIR)
|
|
145
|
+
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
146
|
+
: join(
|
|
147
|
+
env.XDG_DATA_HOME || join(homedir, ".local", "share"),
|
|
148
|
+
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}",
|
|
149
|
+
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"
|
|
150
|
+
),
|
|
151
|
+
config: String(env.CONFIG_DIR)
|
|
152
|
+
? join(String(env.CONFIG_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
153
|
+
: join(
|
|
154
|
+
env.XDG_CONFIG_HOME || join(homedir, ".config"),
|
|
155
|
+
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}",
|
|
156
|
+
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"
|
|
157
|
+
),
|
|
158
|
+
cache: String(env.CACHE_DIR)
|
|
159
|
+
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
160
|
+
: join(env.XDG_CACHE_HOME || join(homedir, ".cache"), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"),
|
|
161
|
+
log: String(env.LOG_DIR)
|
|
162
|
+
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
163
|
+
: join(env.XDG_STATE_HOME || join(homedir, ".local", "state"), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"),
|
|
164
|
+
temp: String(env.TEMP_DIR)
|
|
165
|
+
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
166
|
+
: (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR
|
|
167
|
+
? 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)}")
|
|
168
|
+
: join(tmpdir, basename(homedir), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"))
|
|
169
|
+
} as EnvPaths; `;
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
173
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
174
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
175
|
+
get when() {
|
|
176
|
+
return Boolean(children);
|
|
177
|
+
},
|
|
178
|
+
children
|
|
179
|
+
})
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
exports.NodeJsEnvBuiltin = NodeJsEnvBuiltin;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env";
|
|
3
|
+
|
|
4
|
+
//#region src/components/env.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generates the NodeJs environment configuration module for the Powerlines project.
|
|
7
|
+
*/
|
|
8
|
+
declare function NodeJsEnvBuiltin(props: EnvBuiltinProps): _alloy_js_core0.Children;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { NodeJsEnvBuiltin };
|
|
11
|
+
//# sourceMappingURL=env.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.cts","names":[],"sources":["../../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCgB,iBAAA,gBAAA,CAAwB,KAAA,EAAA,eAAe,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env";
|
|
3
|
+
|
|
4
|
+
//#region src/components/env.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generates the NodeJs environment configuration module for the Powerlines project.
|
|
7
|
+
*/
|
|
8
|
+
declare function NodeJsEnvBuiltin(props: EnvBuiltinProps): _alloy_js_core0.Children;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { NodeJsEnvBuiltin };
|
|
11
|
+
//# sourceMappingURL=env.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.mts","names":[],"sources":["../../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCgB,iBAAA,gBAAA,CAAwB,KAAA,EAAA,eAAe,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
package/dist/components/env.mjs
CHANGED
|
@@ -1,3 +1,185 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Show, code, splitProps } from "@alloy-js/core";
|
|
3
|
+
import { TypeDeclaration, VarDeclaration } from "@alloy-js/typescript";
|
|
4
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
+
import { TSDoc, TSDocRemarks } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
6
|
+
import { EnvBuiltin } from "@powerlines/plugin-env/components/env";
|
|
7
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
8
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
9
|
+
import defu from "defu";
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
//#region src/components/env.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Generates the NodeJs environment configuration module for the Powerlines project.
|
|
14
|
+
*/
|
|
15
|
+
function NodeJsEnvBuiltin(props) {
|
|
16
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
17
|
+
const context = usePowerlines();
|
|
18
|
+
return createComponent(EnvBuiltin, mergeProps(rest, {
|
|
19
|
+
get imports() {
|
|
20
|
+
return defu({
|
|
21
|
+
"node:os": "os",
|
|
22
|
+
"node:path": ["basename", "join"]
|
|
23
|
+
}, rest.imports ?? {});
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return [
|
|
27
|
+
createComponent(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
|
+
createIntrinsic("hbr", {}),
|
|
35
|
+
createIntrinsic("hbr", {}),
|
|
36
|
+
createComponent(VarDeclaration, {
|
|
37
|
+
"export": true,
|
|
38
|
+
"const": true,
|
|
39
|
+
name: "isLinux",
|
|
40
|
+
doc: "An indicator specifying whether the current operating system is Linux.",
|
|
41
|
+
initializer: code`/^linux/i.test(process.platform); `
|
|
42
|
+
}),
|
|
43
|
+
createIntrinsic("hbr", {}),
|
|
44
|
+
createIntrinsic("hbr", {}),
|
|
45
|
+
createComponent(VarDeclaration, {
|
|
46
|
+
"export": true,
|
|
47
|
+
"const": true,
|
|
48
|
+
name: "isMacOS",
|
|
49
|
+
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
50
|
+
initializer: code`/^darwin/i.test(process.platform); `
|
|
51
|
+
}),
|
|
52
|
+
createIntrinsic("hbr", {}),
|
|
53
|
+
createIntrinsic("hbr", {}),
|
|
54
|
+
createComponent(VarDeclaration, {
|
|
55
|
+
"const": true,
|
|
56
|
+
name: "homedir",
|
|
57
|
+
initializer: code`os.homedir(); `
|
|
58
|
+
}),
|
|
59
|
+
createIntrinsic("hbr", {}),
|
|
60
|
+
createIntrinsic("hbr", {}),
|
|
61
|
+
createComponent(VarDeclaration, {
|
|
62
|
+
"const": true,
|
|
63
|
+
name: "tmpdir",
|
|
64
|
+
initializer: code`os.tmpdir(); `
|
|
65
|
+
}),
|
|
66
|
+
createIntrinsic("hbr", {}),
|
|
67
|
+
createIntrinsic("hbr", {}),
|
|
68
|
+
createComponent(TSDoc, {
|
|
69
|
+
heading: "The environment path types for storing things like data, config, logs, and cache in the current runtime environment.",
|
|
70
|
+
get children() {
|
|
71
|
+
return createComponent(TSDocRemarks, { children: `These environment path types are accessed in the {@link EnvPaths} type. ` });
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
createComponent(TypeDeclaration, {
|
|
75
|
+
"export": true,
|
|
76
|
+
name: "EnvPathType",
|
|
77
|
+
children: code`"data" | "config" | "cache" | "log" | "temp"; `
|
|
78
|
+
}),
|
|
79
|
+
createIntrinsic("hbr", {}),
|
|
80
|
+
createIntrinsic("hbr", {}),
|
|
81
|
+
createComponent(TSDoc, { heading: "The environment paths for storing things like data, config, logs, and cache in the current runtime environment." }),
|
|
82
|
+
createComponent(TypeDeclaration, {
|
|
83
|
+
"export": true,
|
|
84
|
+
name: "EnvPaths",
|
|
85
|
+
children: code`Record<EnvPathType, string>; `
|
|
86
|
+
}),
|
|
87
|
+
createIntrinsic("hbr", {}),
|
|
88
|
+
createIntrinsic("hbr", {}),
|
|
89
|
+
createComponent(TSDoc, {
|
|
90
|
+
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
91
|
+
get children() {
|
|
92
|
+
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):
|
|
93
|
+
- **Linux**: directories are generally created in \`~/.config/<name>\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))
|
|
94
|
+
- **Windows**: directories are generally created in \`%AppData%/<name>\`
|
|
95
|
+
- **MacOS**: directories are generally created in \`~/Library/Application Support/<name>\`
|
|
96
|
+
` });
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
createComponent(VarDeclaration, {
|
|
100
|
+
"export": true,
|
|
101
|
+
"const": true,
|
|
102
|
+
name: "paths",
|
|
103
|
+
get initializer() {
|
|
104
|
+
return code`isMacOS
|
|
105
|
+
? {
|
|
106
|
+
data: String(env.DATA_DIR)
|
|
107
|
+
? join(String(env.DATA_DIR), "${titleCase(context.config.name)}")
|
|
108
|
+
: join(homedir, "Library", "Application Support", "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}"),
|
|
109
|
+
config: String(env.CONFIG_DIR)
|
|
110
|
+
? join(String(env.CONFIG_DIR), "${titleCase(context.config.name)}")
|
|
111
|
+
: join(homedir, "Library", "Preferences", "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}"),
|
|
112
|
+
cache: String(env.CACHE_DIR)
|
|
113
|
+
? join(String(env.CACHE_DIR), "${titleCase(context.config.name)}")
|
|
114
|
+
: join(homedir, "Library", "Caches", "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}"),
|
|
115
|
+
log: String(env.LOG_DIR)
|
|
116
|
+
? join(String(env.LOG_DIR), "${titleCase(context.config.name)}")
|
|
117
|
+
: join(homedir, "Library", "Logs", "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}"),
|
|
118
|
+
temp: String(env.TEMP_DIR)
|
|
119
|
+
? join(String(env.TEMP_DIR), "${titleCase(context.config.name)}")
|
|
120
|
+
: join(tmpdir, "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}")
|
|
121
|
+
}
|
|
122
|
+
: isWindows
|
|
123
|
+
? {
|
|
124
|
+
data: String(env.DATA_DIR)
|
|
125
|
+
? join(String(env.DATA_DIR), "${titleCase(context.config.name)}")
|
|
126
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}", "Data"),
|
|
127
|
+
config: String(env.CONFIG_DIR)
|
|
128
|
+
? join(env.CONFIG_DIR!, "${titleCase(context.config.name)}")
|
|
129
|
+
: join(env.APPDATA || join(homedir, "AppData", "Roaming"), "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}", "Config"),
|
|
130
|
+
cache: String(env.CACHE_DIR)
|
|
131
|
+
? join(String(env.CACHE_DIR), "${titleCase(context.config.name)}")
|
|
132
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "Cache", "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}"),
|
|
133
|
+
log: String(env.LOG_DIR)
|
|
134
|
+
? join(String(env.LOG_DIR), "${titleCase(context.config.name)}")
|
|
135
|
+
: join(env.LOCALAPPDATA || join(homedir, "AppData", "Local"), "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}", "Log"),
|
|
136
|
+
temp: String(env.TEMP_DIR)
|
|
137
|
+
? join(String(env.TEMP_DIR), "${titleCase(context.config.name)}")
|
|
138
|
+
: join(tmpdir, "${titleCase(context.config.organization)}", "${titleCase(context.config.name)}")
|
|
139
|
+
}
|
|
140
|
+
:
|
|
141
|
+
{
|
|
142
|
+
data: String(env.DATA_DIR)
|
|
143
|
+
? join(String(env.DATA_DIR), "${kebabCase(context.config.name)}")
|
|
144
|
+
: join(
|
|
145
|
+
env.XDG_DATA_HOME || join(homedir, ".local", "share"),
|
|
146
|
+
"${kebabCase(context.config.organization)}",
|
|
147
|
+
"${kebabCase(context.config.name)}"
|
|
148
|
+
),
|
|
149
|
+
config: String(env.CONFIG_DIR)
|
|
150
|
+
? join(String(env.CONFIG_DIR), "${kebabCase(context.config.name)}")
|
|
151
|
+
: join(
|
|
152
|
+
env.XDG_CONFIG_HOME || join(homedir, ".config"),
|
|
153
|
+
"${kebabCase(context.config.organization)}",
|
|
154
|
+
"${kebabCase(context.config.name)}"
|
|
155
|
+
),
|
|
156
|
+
cache: String(env.CACHE_DIR)
|
|
157
|
+
? join(String(env.CACHE_DIR), "${kebabCase(context.config.name)}")
|
|
158
|
+
: join(env.XDG_CACHE_HOME || join(homedir, ".cache"), "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}"),
|
|
159
|
+
log: String(env.LOG_DIR)
|
|
160
|
+
? join(String(env.LOG_DIR), "${kebabCase(context.config.name)}")
|
|
161
|
+
: join(env.XDG_STATE_HOME || join(homedir, ".local", "state"), "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}"),
|
|
162
|
+
temp: String(env.TEMP_DIR)
|
|
163
|
+
? join(String(env.TEMP_DIR), "${kebabCase(context.config.name)}")
|
|
164
|
+
: (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR
|
|
165
|
+
? join((env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR)!, "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}")
|
|
166
|
+
: join(tmpdir, basename(homedir), "${kebabCase(context.config.organization)}", "${kebabCase(context.config.name)}"))
|
|
167
|
+
} as EnvPaths; `;
|
|
168
|
+
}
|
|
169
|
+
}),
|
|
170
|
+
createIntrinsic("hbr", {}),
|
|
171
|
+
createIntrinsic("hbr", {}),
|
|
172
|
+
createComponent(Show, {
|
|
173
|
+
get when() {
|
|
174
|
+
return Boolean(children);
|
|
175
|
+
},
|
|
176
|
+
children
|
|
177
|
+
})
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
export { NodeJsEnvBuiltin };
|
|
185
|
+
//# sourceMappingURL=env.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.mjs","names":["code","Show","splitProps","TypeDeclaration","VarDeclaration","usePowerlines","TSDoc","TSDocRemarks","EnvBuiltin","kebabCase","titleCase","defu","NodeJsEnvBuiltin","props","children","rest","context","_$createComponent","_$mergeProps","imports","name","doc","initializer","_$createIntrinsic","heading","config","organization","when","Boolean"],"sources":["../../src/components/env.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 { 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\";\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 {...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 <hbr />\n <hbr />\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 <hbr />\n <hbr />\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 <hbr />\n <hbr />\n <VarDeclaration const name=\"homedir\" initializer={code`os.homedir(); `} />\n <hbr />\n <hbr />\n <VarDeclaration const name=\"tmpdir\" initializer={code`os.tmpdir(); `} />\n <hbr />\n <hbr />\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 <hbr />\n <hbr />\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 <hbr />\n <hbr />\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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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: String(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 <hbr />\n <hbr />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgBY,iBAAiBC,OAAwB;CACvD,MAAM,CAAC,EAAEC,YAAYC,QAAQb,WAAWW,OAAO,CAAC,WAAW,CAAC;CAE5D,MAAMG,UAAUX,eAAoC;AAEpD,QAAAY,gBACGT,YAAUU,WACLH,MAAI;EAAA,IACRI,UAAO;AAAA,UAAER,KACP;IACE,WAAW;IACX,aAAa,CAAC,YAAY,OAAM;IACjC,EACDI,KAAKI,WAAW,EAClB,CAAC;;EAAA,IAAAL,WAAA;AAAA,UAAA;IAAAG,gBACAb,gBAAc;KAAA,UAAA;KAAA,SAAA;KAGbgB,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
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
require('../components-BWLXb7a2.cjs');
|
|
1
|
+
const require_components_env = require('./env.cjs');
|
|
3
2
|
|
|
4
|
-
exports.NodeJsEnvBuiltin =
|
|
3
|
+
exports.NodeJsEnvBuiltin = require_components_env.NodeJsEnvBuiltin;
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
require('./components
|
|
4
|
-
require('./
|
|
5
|
-
require('./types-o3zWarRp.cjs');
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_components_env = require('./components/env.cjs');
|
|
4
|
+
require('./components/index.cjs');
|
|
6
5
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
6
|
let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
8
7
|
let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
9
|
-
__powerlines_plugin_babel =
|
|
8
|
+
__powerlines_plugin_babel = require_rolldown_runtime.__toESM(__powerlines_plugin_babel);
|
|
10
9
|
let __powerlines_plugin_env = require("@powerlines/plugin-env");
|
|
11
|
-
__powerlines_plugin_env =
|
|
10
|
+
__powerlines_plugin_env = require_rolldown_runtime.__toESM(__powerlines_plugin_env);
|
|
12
11
|
let powerlines_lib_typescript_tsconfig = require("powerlines/lib/typescript/tsconfig");
|
|
13
12
|
|
|
14
13
|
//#region src/index.tsx
|
|
@@ -30,7 +29,7 @@ const plugin = (options = {}) => {
|
|
|
30
29
|
async prepare() {
|
|
31
30
|
const _self$ = this;
|
|
32
31
|
const result = await (0, __powerlines_plugin_env.readEnvTypeReflection)(this, "env");
|
|
33
|
-
return (0, __powerlines_plugin_alloy_render.render)(this, (0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
32
|
+
return (0, __powerlines_plugin_alloy_render.render)(this, (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_env.NodeJsEnvBuiltin, {
|
|
34
33
|
get defaultConfig() {
|
|
35
34
|
return _self$.config.env.defaultConfig;
|
|
36
35
|
},
|
|
@@ -43,6 +42,6 @@ const plugin = (options = {}) => {
|
|
|
43
42
|
var src_default = plugin;
|
|
44
43
|
|
|
45
44
|
//#endregion
|
|
46
|
-
exports.NodeJsEnvBuiltin =
|
|
45
|
+
exports.NodeJsEnvBuiltin = require_components_env.NodeJsEnvBuiltin;
|
|
47
46
|
exports.default = src_default;
|
|
48
47
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index
|
|
3
|
-
import {
|
|
4
|
-
import "./index
|
|
1
|
+
import { NodeJsEnvBuiltin } from "./components/env.cjs";
|
|
2
|
+
import "./components/index.cjs";
|
|
3
|
+
import { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig } from "./types/plugin.cjs";
|
|
4
|
+
import "./types/index.cjs";
|
|
5
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index
|
|
3
|
-
import {
|
|
4
|
-
import "./index
|
|
1
|
+
import { NodeJsEnvBuiltin } from "./components/env.mjs";
|
|
2
|
+
import "./components/index.mjs";
|
|
3
|
+
import { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
+
import "./types/index.mjs";
|
|
5
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./components
|
|
3
|
-
import "./plugin-ifZVa20V.mjs";
|
|
4
|
-
import "./types-U3zd8PTP.mjs";
|
|
1
|
+
import { NodeJsEnvBuiltin } from "./components/env.mjs";
|
|
2
|
+
import "./components/index.mjs";
|
|
5
3
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
6
4
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
7
5
|
import babel from "@powerlines/plugin-babel";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["render","babel","env","readEnvTypeReflection","isMatchFound","NodeJsEnvBuiltin","plugin","options","name","configResolved","devDependencies","tsconfig","tsconfigJson","compilerOptions","types","push","prepare","_self$","result","_$createComponent","defaultConfig","config","reflection"],"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, { readEnvTypeReflection } from \"@powerlines/plugin-env\";\nimport { isMatchFound } from \"powerlines/lib/typescript/tsconfig\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { NodeJsEnvBuiltin } from \"./components/env\";\nimport { NodeJsPluginContext, NodeJsPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\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) => {\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":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["render","babel","env","readEnvTypeReflection","isMatchFound","NodeJsEnvBuiltin","plugin","options","name","configResolved","devDependencies","tsconfig","tsconfigJson","compilerOptions","types","push","prepare","_self$","result","_$createComponent","defaultConfig","config","reflection"],"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, { readEnvTypeReflection } from \"@powerlines/plugin-env\";\nimport { isMatchFound } from \"powerlines/lib/typescript/tsconfig\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { NodeJsEnvBuiltin } from \"./components/env\";\nimport { NodeJsPluginContext, NodeJsPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\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) => {\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":";;;;;;;;;;;;AAgCA,MAAaM,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;EACLN,MAAMM,QAAQN,MAAM;EACpBC,IAAIK,QAAQL,IAAI;EAChB;GACEM,MAAM;GACNC,iBAAiB;AACf,SAAKC,gBAAgB,iBAAiB;AAEtC,SAAKC,SAASC,aAAaC,oBAAoB,EAAE;AACjD,SAAKF,SAASC,aAAaC,gBAAgBC,UAAU,EAAE;AACvD,QACE,CAACV,aACC,QACA,KAAKO,SAASC,aAAaC,gBAAgBC,MAC5C,CAED,MAAKH,SAASC,aAAaC,gBAAgBC,MAAMC,KAAK,OAAO;;GAGjE,MAAMC,UAAU;IAAA,MAAAC,SAAA;IACd,MAAMC,SAAS,MAAMf,sBAAsB,MAAM,MAAM;AAEvD,WAAOH,OACL,MAAImB,gBACHd,kBAAgB;KAAA,IACfe,gBAAa;AAAA,aAAEH,OAAKI,OAAOnB,IAAIkB;;KAC/BE,YAAYJ;KAAM,CAEtB,CAAC;;GAEJ;EACF;;AAGH,kBAAeZ"}
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-D4ELpJXS.cjs";
|
|
1
|
+
import { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig } from "./plugin.cjs";
|
|
3
2
|
export { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-9iG2qHLe.mjs";
|
|
1
|
+
import { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig } from "./plugin.mjs";
|
|
3
2
|
export { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig };
|