@powerlines/plugin-nodejs 0.1.156 → 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
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require('../plugin-pBKbb5K9.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
|
|
2
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
interface NodeJsPluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
8
|
+
*/
|
|
9
|
+
babel?: Partial<BabelPluginOptions>;
|
|
10
|
+
/**
|
|
11
|
+
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
12
|
+
*/
|
|
13
|
+
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
14
|
+
}
|
|
15
|
+
type NodeJsPluginUserConfig = EnvPluginUserConfig;
|
|
16
|
+
type NodeJsPluginResolvedConfig = EnvPluginResolvedConfig;
|
|
17
|
+
type NodeJsPluginContext<TResolvedConfig extends NodeJsPluginResolvedConfig = NodeJsPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
|
|
18
|
+
declare type __ΩNodeJsPluginOptions = any[];
|
|
19
|
+
declare type __ΩNodeJsPluginUserConfig = any[];
|
|
20
|
+
declare type __ΩNodeJsPluginResolvedConfig = any[];
|
|
21
|
+
declare type __ΩNodeJsPluginContext = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig };
|
|
24
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UA0BiB,mBAAA;;AAAjB;;EAIU,KAAA,CAAA,EAAA,OAAA,CAAQ,kBAAR,CAAA;EAKW;;;EAAN,GAAA,CAAA,EAAP,OAAO,CAAC,IAAD,CAAM,gBAAN,EAAA,OAAA,CAAA,CAAA;AAGf;AAEY,KAFA,sBAAA,GAAyB,mBAEI;AAE7B,KAFA,0BAAA,GAA6B,uBAEV;AACL,KADd,mBACc,CAAA,wBAAA,0BAAA,GACtB,0BADsB,CAAA,GAEtB,gBAFsB,CAEL,eAFK,CAAA;AACtB,sCAAA,GAAA,EAAA;AACiB,yCAAA,GAAA,EAAA;AAAjB,6CAAA,GAAA,EAAA;AAAgB,sCAAA,GAAA,EAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
|
|
2
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
interface NodeJsPluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
8
|
+
*/
|
|
9
|
+
babel?: Partial<BabelPluginOptions>;
|
|
10
|
+
/**
|
|
11
|
+
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
12
|
+
*/
|
|
13
|
+
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
14
|
+
}
|
|
15
|
+
type NodeJsPluginUserConfig = EnvPluginUserConfig;
|
|
16
|
+
type NodeJsPluginResolvedConfig = EnvPluginResolvedConfig;
|
|
17
|
+
type NodeJsPluginContext<TResolvedConfig extends NodeJsPluginResolvedConfig = NodeJsPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
|
|
18
|
+
declare type __ΩNodeJsPluginOptions = any[];
|
|
19
|
+
declare type __ΩNodeJsPluginUserConfig = any[];
|
|
20
|
+
declare type __ΩNodeJsPluginResolvedConfig = any[];
|
|
21
|
+
declare type __ΩNodeJsPluginContext = any[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { NodeJsPluginContext, NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig, __ΩNodeJsPluginContext, __ΩNodeJsPluginOptions, __ΩNodeJsPluginResolvedConfig, __ΩNodeJsPluginUserConfig };
|
|
24
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UA0BiB,mBAAA;;AAAjB;;EAIU,KAAA,CAAA,EAAA,OAAA,CAAQ,kBAAR,CAAA;EAKW;;;EAAN,GAAA,CAAA,EAAP,OAAO,CAAC,IAAD,CAAM,gBAAN,EAAA,OAAA,CAAA,CAAA;AAGf;AAEY,KAFA,sBAAA,GAAyB,mBAEI;AAE7B,KAFA,0BAAA,GAA6B,uBAEV;AACL,KADd,mBACc,CAAA,wBAAA,0BAAA,GACtB,0BADsB,CAAA,GAEtB,gBAFsB,CAEL,eAFK,CAAA;AACtB,sCAAA,GAAA,EAAA;AACiB,yCAAA,GAAA,EAAA;AAAjB,6CAAA,GAAA,EAAA;AAAgB,sCAAA,GAAA,EAAA"}
|
package/dist/types/plugin.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-nodejs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.157",
|
|
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.22.0",
|
|
121
121
|
"@alloy-js/typescript": "^0.22.0",
|
|
122
|
-
"@powerlines/plugin-alloy": "^0.19.
|
|
123
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
124
|
-
"@powerlines/plugin-env": "^0.15.
|
|
125
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
122
|
+
"@powerlines/plugin-alloy": "^0.19.34",
|
|
123
|
+
"@powerlines/plugin-babel": "^0.12.263",
|
|
124
|
+
"@powerlines/plugin-env": "^0.15.162",
|
|
125
|
+
"@powerlines/plugin-plugin": "^0.12.205",
|
|
126
126
|
"@storm-software/config-tools": "^1.189.0",
|
|
127
127
|
"@stryke/string-format": "^0.13.7",
|
|
128
128
|
"defu": "^6.1.4",
|
|
129
|
-
"powerlines": "^0.38.
|
|
129
|
+
"powerlines": "^0.38.21"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": { "@types/node": "^24.10.9" },
|
|
132
132
|
"publishConfig": { "access": "public" },
|
|
133
133
|
"types": "./dist/index.d.cts",
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "6000a15bf3fbc1b7eaaf967088c68eef9949786a"
|
|
135
135
|
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/env--9rS0L72.cjs
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
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
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
29
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
30
|
-
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
31
|
-
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
32
|
-
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
33
|
-
let __powerlines_plugin_env_components_env = require("@powerlines/plugin-env/components/env");
|
|
34
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
35
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
36
|
-
let defu = require("defu");
|
|
37
|
-
defu = __toESM(defu);
|
|
38
|
-
|
|
39
|
-
//#region src/components/env.tsx
|
|
40
|
-
/**
|
|
41
|
-
* Generates the NodeJs environment configuration module for the Powerlines project.
|
|
42
|
-
*/
|
|
43
|
-
function NodeJsEnvBuiltin(props) {
|
|
44
|
-
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
45
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
46
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_env_components_env.EnvBuiltin, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
47
|
-
get imports() {
|
|
48
|
-
return (0, defu.default)({
|
|
49
|
-
"node:os": "os",
|
|
50
|
-
"node:path": ["basename", "join"]
|
|
51
|
-
}, rest.imports ?? {});
|
|
52
|
-
},
|
|
53
|
-
get children() {
|
|
54
|
-
return [
|
|
55
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
56
|
-
"export": true,
|
|
57
|
-
"const": true,
|
|
58
|
-
name: "isWindows",
|
|
59
|
-
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
60
|
-
initializer: __alloy_js_core.code`/^win/i.test(process.platform); `
|
|
61
|
-
}),
|
|
62
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
63
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
64
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
65
|
-
"export": true,
|
|
66
|
-
"const": true,
|
|
67
|
-
name: "isLinux",
|
|
68
|
-
doc: "An indicator specifying whether the current operating system is Linux.",
|
|
69
|
-
initializer: __alloy_js_core.code`/^linux/i.test(process.platform); `
|
|
70
|
-
}),
|
|
71
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
72
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
73
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
74
|
-
"export": true,
|
|
75
|
-
"const": true,
|
|
76
|
-
name: "isMacOS",
|
|
77
|
-
doc: "An indicator specifying whether the current operating system is MacOS (darwin kernel).",
|
|
78
|
-
initializer: __alloy_js_core.code`/^darwin/i.test(process.platform); `
|
|
79
|
-
}),
|
|
80
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
81
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
82
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
83
|
-
"const": true,
|
|
84
|
-
name: "homedir",
|
|
85
|
-
initializer: __alloy_js_core.code`os.homedir(); `
|
|
86
|
-
}),
|
|
87
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
88
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
89
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
90
|
-
"const": true,
|
|
91
|
-
name: "tmpdir",
|
|
92
|
-
initializer: __alloy_js_core.code`os.tmpdir(); `
|
|
93
|
-
}),
|
|
94
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
95
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
96
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
97
|
-
heading: "The environment path types for storing things like data, config, logs, and cache in the current runtime environment.",
|
|
98
|
-
get children() {
|
|
99
|
-
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. ` });
|
|
100
|
-
}
|
|
101
|
-
}),
|
|
102
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
103
|
-
"export": true,
|
|
104
|
-
name: "EnvPathType",
|
|
105
|
-
children: __alloy_js_core.code`"data" | "config" | "cache" | "log" | "temp"; `
|
|
106
|
-
}),
|
|
107
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
108
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
109
|
-
(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." }),
|
|
110
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
111
|
-
"export": true,
|
|
112
|
-
name: "EnvPaths",
|
|
113
|
-
children: __alloy_js_core.code`Record<EnvPathType, string>; `
|
|
114
|
-
}),
|
|
115
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
116
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
117
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
118
|
-
heading: "The resolved application directories based on the current operating system and environment variables.",
|
|
119
|
-
get children() {
|
|
120
|
-
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):
|
|
121
|
-
- **Linux**: directories are generally created in \`~/.config/<name>\` (this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/))
|
|
122
|
-
- **Windows**: directories are generally created in \`%AppData%/<name>\`
|
|
123
|
-
- **MacOS**: directories are generally created in \`~/Library/Application Support/<name>\`
|
|
124
|
-
` });
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
128
|
-
"export": true,
|
|
129
|
-
"const": true,
|
|
130
|
-
name: "paths",
|
|
131
|
-
get initializer() {
|
|
132
|
-
return __alloy_js_core.code`isMacOS
|
|
133
|
-
? {
|
|
134
|
-
data: String(env.DATA_DIR)
|
|
135
|
-
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
136
|
-
: 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)}"),
|
|
137
|
-
config: String(env.CONFIG_DIR)
|
|
138
|
-
? join(String(env.CONFIG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
139
|
-
: join(homedir, "Library", "Preferences", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
140
|
-
cache: String(env.CACHE_DIR)
|
|
141
|
-
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
142
|
-
: join(homedir, "Library", "Caches", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
143
|
-
log: String(env.LOG_DIR)
|
|
144
|
-
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
145
|
-
: join(homedir, "Library", "Logs", "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}"),
|
|
146
|
-
temp: String(env.TEMP_DIR)
|
|
147
|
-
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
148
|
-
: join(tmpdir, "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
149
|
-
}
|
|
150
|
-
: isWindows
|
|
151
|
-
? {
|
|
152
|
-
data: String(env.DATA_DIR)
|
|
153
|
-
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
154
|
-
: 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"),
|
|
155
|
-
config: String(env.CONFIG_DIR)
|
|
156
|
-
? join(env.CONFIG_DIR!, "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
157
|
-
: 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"),
|
|
158
|
-
cache: String(env.CACHE_DIR)
|
|
159
|
-
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
160
|
-
: 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)}"),
|
|
161
|
-
log: String(env.LOG_DIR)
|
|
162
|
-
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
163
|
-
: 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"),
|
|
164
|
-
temp: String(env.TEMP_DIR)
|
|
165
|
-
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
166
|
-
: join(tmpdir, "${(0, __stryke_string_format_title_case.titleCase)(context.config.organization)}", "${(0, __stryke_string_format_title_case.titleCase)(context.config.name)}")
|
|
167
|
-
}
|
|
168
|
-
:
|
|
169
|
-
{
|
|
170
|
-
data: String(env.DATA_DIR)
|
|
171
|
-
? join(String(env.DATA_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
172
|
-
: join(
|
|
173
|
-
env.XDG_DATA_HOME || join(homedir, ".local", "share"),
|
|
174
|
-
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}",
|
|
175
|
-
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"
|
|
176
|
-
),
|
|
177
|
-
config: String(env.CONFIG_DIR)
|
|
178
|
-
? join(String(env.CONFIG_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
179
|
-
: join(
|
|
180
|
-
env.XDG_CONFIG_HOME || join(homedir, ".config"),
|
|
181
|
-
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}",
|
|
182
|
-
"${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"
|
|
183
|
-
),
|
|
184
|
-
cache: String(env.CACHE_DIR)
|
|
185
|
-
? join(String(env.CACHE_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
186
|
-
: 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)}"),
|
|
187
|
-
log: String(env.LOG_DIR)
|
|
188
|
-
? join(String(env.LOG_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
189
|
-
: 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)}"),
|
|
190
|
-
temp: String(env.TEMP_DIR)
|
|
191
|
-
? join(String(env.TEMP_DIR), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}")
|
|
192
|
-
: (env.DEVENV_RUNTIME || env.XDG_RUNTIME_DIR
|
|
193
|
-
? 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)}")
|
|
194
|
-
: join(tmpdir, basename(homedir), "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.organization)}", "${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}"))
|
|
195
|
-
} as EnvPaths; `;
|
|
196
|
-
}
|
|
197
|
-
}),
|
|
198
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
199
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
200
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
201
|
-
get when() {
|
|
202
|
-
return Boolean(children);
|
|
203
|
-
},
|
|
204
|
-
children
|
|
205
|
-
})
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
//#endregion
|
|
212
|
-
Object.defineProperty(exports, 'NodeJsEnvBuiltin', {
|
|
213
|
-
enumerable: true,
|
|
214
|
-
get: function () {
|
|
215
|
-
return NodeJsEnvBuiltin;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
Object.defineProperty(exports, '__toESM', {
|
|
219
|
-
enumerable: true,
|
|
220
|
-
get: function () {
|
|
221
|
-
return __toESM;
|
|
222
|
-
}
|
|
223
|
-
});
|
package/dist/env-BbWlIivm.d.mts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 as t };
|
|
11
|
-
//# sourceMappingURL=env-BbWlIivm.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-BbWlIivm.d.mts","names":[],"sources":["../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCgB,iBAAA,gBAAA,CAAwB,KAAA,EAAA,eAAe,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
package/dist/env-CNIW9dZh.mjs
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
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";
|
|
10
|
-
|
|
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 as t };
|
|
185
|
-
//# sourceMappingURL=env-CNIW9dZh.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-CNIW9dZh.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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AAA;;gDAE+BX,UAAUO,QAAQS,OAAOL,KAAK,CAAA;;4EAEFX,UAAUO,QAAQS,OAAOC,aAAa,CAAA,MAAOjB,UACnGO,QAAQS,OAAOL,KAChB,CAAA;yDACoCX,UAAUO,QAAQS,OAAOC,aAAa,CAAA,MAAOjB,UAAUO,QAAQS,OAAOL,KAAK,CAAA;;;KAC1G,CAAA;IAAAG,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAN,gBAInBhB,MAAI;KAAA,IAAC0B,OAAI;AAAA,aAAEC,QAAQd,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
package/dist/env-i5491Gd4.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 as t };
|
|
11
|
-
//# sourceMappingURL=env-i5491Gd4.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-i5491Gd4.d.cts","names":[],"sources":["../src/components/env.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCgB,iBAAA,gBAAA,CAAwB,KAAA,EAAA,eAAe,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
|
|
2
|
-
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
-
|
|
4
|
-
//#region src/types/plugin.d.ts
|
|
5
|
-
interface NodeJsPluginOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
8
|
-
*/
|
|
9
|
-
babel?: Partial<BabelPluginOptions>;
|
|
10
|
-
/**
|
|
11
|
-
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
12
|
-
*/
|
|
13
|
-
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
14
|
-
}
|
|
15
|
-
type NodeJsPluginUserConfig = EnvPluginUserConfig;
|
|
16
|
-
type NodeJsPluginResolvedConfig = EnvPluginResolvedConfig;
|
|
17
|
-
type NodeJsPluginContext<TResolvedConfig extends NodeJsPluginResolvedConfig = NodeJsPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
|
|
18
|
-
declare type __ΩNodeJsPluginOptions = any[];
|
|
19
|
-
declare type __ΩNodeJsPluginUserConfig = any[];
|
|
20
|
-
declare type __ΩNodeJsPluginResolvedConfig = any[];
|
|
21
|
-
declare type __ΩNodeJsPluginContext = any[];
|
|
22
|
-
//#endregion
|
|
23
|
-
export { __ΩNodeJsPluginContext as a, __ΩNodeJsPluginUserConfig as c, NodeJsPluginUserConfig as i, NodeJsPluginOptions as n, __ΩNodeJsPluginOptions as o, NodeJsPluginResolvedConfig as r, __ΩNodeJsPluginResolvedConfig as s, NodeJsPluginContext as t };
|
|
24
|
-
//# sourceMappingURL=plugin-DIMmxDo0.d.cts.map
|