@powerlines/plugin-nodejs 0.1.136 → 0.1.138
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.cjs +2 -185
- package/dist/components/env.d.cts +1 -9
- package/dist/components/env.d.mts +1 -9
- package/dist/components/env.mjs +1 -182
- package/dist/components/index.cjs +3 -2
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.mts +2 -1
- package/dist/components/index.mjs +2 -1
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-kh0CpIG2.mjs +1 -0
- package/dist/env--9rS0L72.cjs +223 -0
- package/dist/env-BbWlIivm.d.mts +11 -0
- package/dist/env-BbWlIivm.d.mts.map +1 -0
- package/dist/env-CNIW9dZh.mjs +185 -0
- package/dist/env-CNIW9dZh.mjs.map +1 -0
- package/dist/env-i5491Gd4.d.cts +11 -0
- package/dist/env-i5491Gd4.d.cts.map +1 -0
- package/dist/index-9iG2qHLe.d.mts +1 -0
- package/dist/index-D-CYNcT9.d.mts +1 -0
- package/dist/index-D4ELpJXS.d.cts +1 -0
- package/dist/index-DLoAMD9J.d.cts +1 -0
- package/dist/index.cjs +8 -7
- package/dist/index.d.cts +6 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-DIMmxDo0.d.cts +24 -0
- package/dist/plugin-DIMmxDo0.d.cts.map +1 -0
- package/dist/plugin-ifZVa20V.mjs +1 -0
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/plugin-w7U9e4U2.d.mts +24 -0
- package/dist/plugin-w7U9e4U2.d.mts.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -22
- package/dist/types/plugin.d.mts +1 -22
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-U3zd8PTP.mjs +1 -0
- package/dist/types-o3zWarRp.cjs +0 -0
- package/package.json +7 -7
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
package/dist/components/env.cjs
CHANGED
|
@@ -1,186 +1,3 @@
|
|
|
1
|
-
const
|
|
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);
|
|
1
|
+
const require_env = require('../env--9rS0L72.cjs');
|
|
12
2
|
|
|
13
|
-
|
|
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;
|
|
3
|
+
exports.NodeJsEnvBuiltin = require_env.NodeJsEnvBuiltin;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
|
1
|
+
import { t as NodeJsEnvBuiltin } from "../env-i5491Gd4.cjs";
|
|
10
2
|
export { NodeJsEnvBuiltin };
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
|
1
|
+
import { t as NodeJsEnvBuiltin } from "../env-BbWlIivm.mjs";
|
|
10
2
|
export { NodeJsEnvBuiltin };
|
package/dist/components/env.mjs
CHANGED
|
@@ -1,184 +1,3 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
1
|
+
import { t as NodeJsEnvBuiltin } from "../env-CNIW9dZh.mjs";
|
|
10
2
|
|
|
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
3
|
export { NodeJsEnvBuiltin };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_env = require('../env--9rS0L72.cjs');
|
|
2
|
+
require('../components-BWLXb7a2.cjs');
|
|
2
3
|
|
|
3
|
-
exports.NodeJsEnvBuiltin =
|
|
4
|
+
exports.NodeJsEnvBuiltin = require_env.NodeJsEnvBuiltin;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|