@yongdall/plugins 0.4.0 → 0.5.2
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/index.d.mts +24 -5
- package/index.mjs +2 -107
- package/package.json +4 -4
- package/plugins-BsoRxhdM.mjs +176 -0
- package/plugins-BsoRxhdM.mjs.map +1 -0
- package/yongdall/enumeration.mjs +15 -0
- package/yongdall/enumeration.mjs.map +1 -0
- package/yongdall.plugin.yml +1 -0
- package/index.mjs.map +0 -1
package/index.d.mts
CHANGED
|
@@ -2,21 +2,40 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @template {object} T
|
|
4
4
|
* @param {string} name
|
|
5
|
-
* @param {
|
|
6
|
-
* @returns {AsyncIterableIterator<[plugin: string, config: T
|
|
5
|
+
* @param {'script' | 'data'} [type]
|
|
6
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}
|
|
7
7
|
*/
|
|
8
|
-
declare function
|
|
8
|
+
declare function loadPluginProfileAndPaths<T extends object>(name: string, type?: "script" | "data"): AsyncIterableIterator<[plugin: string, config: T, path: string]>;
|
|
9
|
+
/**
|
|
10
|
+
* @template {object} T
|
|
11
|
+
* @overload
|
|
12
|
+
* @param {string} name
|
|
13
|
+
* @param {'script' | 'data'} [type]
|
|
14
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}
|
|
15
|
+
*/
|
|
16
|
+
declare function loadPluginProfiles<T extends object>(name: string, type?: "script" | "data" | undefined): AsyncIterableIterator<[plugin: string, config: T, path: string]>;
|
|
17
|
+
/**
|
|
18
|
+
* @template {object} T
|
|
19
|
+
* @overload
|
|
20
|
+
* @param {string} name
|
|
21
|
+
* @param {(config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>} preprocess
|
|
22
|
+
* @param {'script' | 'data'} [type]
|
|
23
|
+
* @returns {AsyncIterableIterator<T>}
|
|
24
|
+
*/
|
|
25
|
+
declare function loadPluginProfiles<T extends object>(name: string, preprocess: (config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>, type?: "script" | "data" | undefined): AsyncIterableIterator<T>;
|
|
9
26
|
/**
|
|
10
27
|
* @template {object} T
|
|
11
28
|
* @param {string} name
|
|
12
29
|
* @returns {AsyncIterableIterator<[plugin: string, config: T]>}
|
|
13
30
|
*/
|
|
14
31
|
declare function loadPluginScripts<T extends object>(name: string): AsyncIterableIterator<[plugin: string, config: T]>;
|
|
15
|
-
/** @type {Record<string, {root: string; source: string; development: boolean}>} */
|
|
32
|
+
/** @type {Record<string, {root: string; source: string; development: boolean; configurator?: any; label?: string}>} */
|
|
16
33
|
declare const pluginRoots: Record<string, {
|
|
17
34
|
root: string;
|
|
18
35
|
source: string;
|
|
19
36
|
development: boolean;
|
|
37
|
+
configurator?: any;
|
|
38
|
+
label?: string;
|
|
20
39
|
}>;
|
|
21
40
|
//#endregion
|
|
22
|
-
export { pluginRoots as default, loadPluginProfiles, loadPluginScripts };
|
|
41
|
+
export { pluginRoots as default, loadPluginProfileAndPaths, loadPluginProfiles, loadPluginScripts };
|
package/index.mjs
CHANGED
|
@@ -1,108 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as fsPromises from "node:fs/promises";
|
|
3
|
-
import { pluginIdRegex } from "@yongdall/common";
|
|
4
|
-
import { loadCfgWithPath, loadProjectConfiguration, loadProjectConfigurationPath } from "@yongdall/configuration";
|
|
5
|
-
import loadConfiguration, { loadConfigurationWithPath } from "@yongdall/load-configuration";
|
|
1
|
+
import { i as plugins_default, n as loadPluginProfiles, r as loadPluginScripts, t as loadPluginProfileAndPaths } from "./plugins-BsoRxhdM.mjs";
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
/** @type {Record<string, {root: string; source: string; development: boolean}>} */
|
|
9
|
-
const pluginRoots = Object.create(null);
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {string} root
|
|
13
|
-
* @param {string} name
|
|
14
|
-
*/
|
|
15
|
-
async function findNodeModule(root, name) {
|
|
16
|
-
for (let basepath = root;;) {
|
|
17
|
-
const path = pathFn.resolve(basepath, "node_modules", name);
|
|
18
|
-
const version = (await fsPromises.readFile(pathFn.resolve(path, "package.json"), "utf-8").then((v) => JSON.parse(v)).catch(() => null))?.version;
|
|
19
|
-
if (version && typeof version === "string") return path;
|
|
20
|
-
const parent = pathFn.dirname(basepath);
|
|
21
|
-
if (parent === basepath) break;
|
|
22
|
-
basepath = parent;
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @returns {Promise<[string, string | boolean | {path?: string; development?: boolean}, string][]>}
|
|
28
|
-
*/
|
|
29
|
-
async function getPlugins() {
|
|
30
|
-
const result = await loadCfgWithPath("plugins").catch(() => {});
|
|
31
|
-
const [path, pluginList] = result && result[1] ? result : [await loadProjectConfigurationPath(), await loadProjectConfiguration().then((v) => v.plugins)];
|
|
32
|
-
if (!pluginList) return [];
|
|
33
|
-
const basePath = pathFn.dirname(path);
|
|
34
|
-
if (Array.isArray(pluginList)) return pluginList.map((a) => [
|
|
35
|
-
a,
|
|
36
|
-
true,
|
|
37
|
-
basePath
|
|
38
|
-
]);
|
|
39
|
-
return Object.entries(pluginList).map(([a, b]) => [
|
|
40
|
-
a,
|
|
41
|
-
b,
|
|
42
|
-
basePath
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
for (const [plugin, define, basePath] of await getPlugins()) {
|
|
46
|
-
if (!define) continue;
|
|
47
|
-
if (!pluginIdRegex.exec(plugin)) throw new Error(`无效的应用名称:${plugin}`);
|
|
48
|
-
const path = typeof define === "object" && define ? define.path : define;
|
|
49
|
-
const development = typeof define === "object" && define ? define.development : false;
|
|
50
|
-
const url = typeof path === "string" ? path : "";
|
|
51
|
-
const index = url.indexOf("#");
|
|
52
|
-
const packagePath = index >= 0 ? url.slice(0, index) : url;
|
|
53
|
-
const packageName = pluginIdRegex.test(packagePath) ? packagePath : "";
|
|
54
|
-
const source = !packageName && packagePath ? pathFn.resolve(basePath, packagePath) : await findNodeModule(basePath, packageName || plugin);
|
|
55
|
-
if (!source) throw new Error(`找不到应用:${plugin}`);
|
|
56
|
-
let pluginPath = source;
|
|
57
|
-
if (index >= 0) {
|
|
58
|
-
const dirOptional = url[index + 1] === "?";
|
|
59
|
-
const dir = url.slice(dirOptional ? index + 2 : index + 1);
|
|
60
|
-
if (dir) {
|
|
61
|
-
const pluginDir = pathFn.join(pluginPath, dir);
|
|
62
|
-
if (await fsPromises.stat(pluginDir).then((s) => s.isDirectory(), () => false)) pluginPath = pluginDir;
|
|
63
|
-
else if (!dirOptional) throw new Error(`找不到应用 ${plugin} 的目录: ${dir}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
pluginRoots[plugin] = {
|
|
67
|
-
root: pluginPath,
|
|
68
|
-
source,
|
|
69
|
-
development: Boolean(development)
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
var plugins_default = pluginRoots;
|
|
73
|
-
/**
|
|
74
|
-
* @template {object} T
|
|
75
|
-
* @param {string} name
|
|
76
|
-
* @param {boolean} [scriptOnly]
|
|
77
|
-
* @returns {AsyncIterableIterator<[plugin: string, config: T | null, path: string]>}
|
|
78
|
-
*/
|
|
79
|
-
async function* loadPluginProfiles(name, scriptOnly) {
|
|
80
|
-
for (const [plugin, { root }] of Object.entries(pluginRoots)) {
|
|
81
|
-
/** @type {[string, T | null] | null} */
|
|
82
|
-
const result = await loadConfigurationWithPath(pathFn.resolve(root, `${name}.yongdall`), scriptOnly) || await loadConfigurationWithPath(pathFn.resolve(root, `yongdall/${name}`), scriptOnly) || await loadConfigurationWithPath(pathFn.resolve(root, `${name}/yongdall`), scriptOnly);
|
|
83
|
-
if (!result) continue;
|
|
84
|
-
const [path, config] = result;
|
|
85
|
-
yield [
|
|
86
|
-
plugin,
|
|
87
|
-
config,
|
|
88
|
-
path
|
|
89
|
-
];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @template {object} T
|
|
94
|
-
* @param {string} name
|
|
95
|
-
* @returns {AsyncIterableIterator<[plugin: string, config: T]>}
|
|
96
|
-
*/
|
|
97
|
-
async function* loadPluginScripts(name) {
|
|
98
|
-
for (const [plugin, { root }] of Object.entries(pluginRoots)) {
|
|
99
|
-
/** @type {T | null} */
|
|
100
|
-
const result = await loadConfiguration(pathFn.resolve(root, `${name}.yongdall`), true) || await loadConfiguration(pathFn.resolve(root, `yongdall/${name}`), true) || await loadConfiguration(pathFn.resolve(root, `${name}/yongdall`), true);
|
|
101
|
-
if (result === null) continue;
|
|
102
|
-
yield [plugin, result];
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
export { plugins_default as default, loadPluginProfiles, loadPluginScripts };
|
|
108
|
-
//# sourceMappingURL=index.mjs.map
|
|
3
|
+
export { plugins_default as default, loadPluginProfileAndPaths, loadPluginProfiles, loadPluginScripts };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yongdall/plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"plugins.yongdall": "./bin.mjs"
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"#index": "./index.mjs"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@yongdall/common": "^0.
|
|
14
|
-
"@yongdall/configuration": "^0.
|
|
15
|
-
"@yongdall/load-configuration": "^0.
|
|
13
|
+
"@yongdall/common": "^0.5.0",
|
|
14
|
+
"@yongdall/configuration": "^0.5.0",
|
|
15
|
+
"@yongdall/load-configuration": "^0.5.0",
|
|
16
16
|
"yaml": "^2.5.0"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import * as pathFn from "node:path";
|
|
2
|
+
import * as fsPromises from "node:fs/promises";
|
|
3
|
+
import { pluginIdRegex } from "@yongdall/common";
|
|
4
|
+
import { loadCfgWithPath, loadProjectConfiguration, loadProjectConfigurationPath } from "@yongdall/configuration";
|
|
5
|
+
import loadConfiguration, { loadConfigurationWithPath } from "@yongdall/load-configuration";
|
|
6
|
+
|
|
7
|
+
//#region cli/plugins/index.mjs
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {string} root
|
|
11
|
+
* @param {string} name
|
|
12
|
+
*/
|
|
13
|
+
async function findNodeModule(root, name) {
|
|
14
|
+
for (let basepath = root;;) {
|
|
15
|
+
const path = pathFn.resolve(basepath, "node_modules", name);
|
|
16
|
+
const version = (await fsPromises.readFile(pathFn.resolve(path, "package.json"), "utf-8").then((v) => JSON.parse(v)).catch(() => null))?.version;
|
|
17
|
+
if (version && typeof version === "string") return path;
|
|
18
|
+
const parent = pathFn.dirname(basepath);
|
|
19
|
+
if (parent === basepath) break;
|
|
20
|
+
basepath = parent;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @returns {Promise<[string, string | boolean | {path?: string; development?: boolean}, string][]>}
|
|
26
|
+
*/
|
|
27
|
+
async function getPlugins() {
|
|
28
|
+
const result = await loadCfgWithPath("plugins").catch(() => {});
|
|
29
|
+
const [path, pluginList] = result && result[1] ? result : [await loadProjectConfigurationPath(), await loadProjectConfiguration().then((v) => v.plugins)];
|
|
30
|
+
if (!pluginList) return [];
|
|
31
|
+
const basePath = pathFn.dirname(path);
|
|
32
|
+
if (Array.isArray(pluginList)) return pluginList.map((a) => [
|
|
33
|
+
a,
|
|
34
|
+
true,
|
|
35
|
+
basePath
|
|
36
|
+
]);
|
|
37
|
+
return Object.entries(pluginList).map(([a, b]) => [
|
|
38
|
+
a,
|
|
39
|
+
b,
|
|
40
|
+
basePath
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param {string} plugin
|
|
46
|
+
* @param {string | boolean | { path?: string; development?: boolean }} define
|
|
47
|
+
* @param {string} basePath
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
async function loadPlugin(plugin, define, basePath) {
|
|
51
|
+
if (!pluginIdRegex.exec(plugin)) throw new Error(`无效的应用名称:${plugin}`);
|
|
52
|
+
const path = typeof define === "object" && define ? define.path : define;
|
|
53
|
+
const development = typeof define === "object" && define ? define.development : false;
|
|
54
|
+
const url = typeof path === "string" ? path : "";
|
|
55
|
+
const index = url.indexOf("#");
|
|
56
|
+
const packagePath = index >= 0 ? url.slice(0, index) : url;
|
|
57
|
+
const packageName = pluginIdRegex.test(packagePath) ? packagePath : "";
|
|
58
|
+
const source = !packageName && packagePath ? pathFn.resolve(basePath, packagePath) : await findNodeModule(basePath, packageName || plugin);
|
|
59
|
+
if (!source) throw new Error(`找不到应用:${plugin}`);
|
|
60
|
+
let pluginPath = source;
|
|
61
|
+
if (index >= 0) {
|
|
62
|
+
const dirOptional = url[index + 1] === "?";
|
|
63
|
+
const dir = url.slice(dirOptional ? index + 2 : index + 1);
|
|
64
|
+
if (dir) {
|
|
65
|
+
const pluginDir = pathFn.join(pluginPath, dir);
|
|
66
|
+
if (await fsPromises.stat(pluginDir).then((s) => s.isDirectory(), () => false)) pluginPath = pluginDir;
|
|
67
|
+
else if (!dirOptional) throw new Error(`找不到应用 ${plugin} 的目录: ${dir}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** @type {{label?: string; configurator?: any}?} */
|
|
71
|
+
const data = await loadConfiguration(pathFn.resolve(pluginPath, `yongdall.plugin`), "data").catch(() => null);
|
|
72
|
+
return {
|
|
73
|
+
root: pluginPath,
|
|
74
|
+
source,
|
|
75
|
+
development: Boolean(development),
|
|
76
|
+
label: data?.label,
|
|
77
|
+
configurator: data?.configurator
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** @type {Record<string, {root: string; source: string; development: boolean; configurator?: any; label?: string}>} */
|
|
81
|
+
const pluginRoots = Object.create(null);
|
|
82
|
+
for (const [plugin, define, basePath] of await getPlugins()) {
|
|
83
|
+
if (!define) continue;
|
|
84
|
+
pluginRoots[plugin] = await loadPlugin(plugin, define, basePath);
|
|
85
|
+
}
|
|
86
|
+
var plugins_default = pluginRoots;
|
|
87
|
+
/**
|
|
88
|
+
* @template {object} T
|
|
89
|
+
* @param {string} name
|
|
90
|
+
* @param {'script' | 'data'} [type]
|
|
91
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}
|
|
92
|
+
*/
|
|
93
|
+
async function* loadPluginProfileAndPaths(name, type) {
|
|
94
|
+
for (const [plugin, { root }] of Object.entries(pluginRoots)) {
|
|
95
|
+
/** @type {[string, T | null] | null} */
|
|
96
|
+
const result = await loadConfigurationWithPath(pathFn.resolve(root, `${name}.yongdall`), type) || await loadConfigurationWithPath(pathFn.resolve(root, `yongdall/${name}`), type) || await loadConfigurationWithPath(pathFn.resolve(root, `${name}/yongdall`), type);
|
|
97
|
+
if (!result) continue;
|
|
98
|
+
const [path, config] = result;
|
|
99
|
+
if (!config) continue;
|
|
100
|
+
yield [
|
|
101
|
+
plugin,
|
|
102
|
+
config,
|
|
103
|
+
path
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @template {object} T
|
|
109
|
+
* @param {string} name
|
|
110
|
+
* @param {(config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>} preprocess
|
|
111
|
+
* @param {'script' | 'data'} [type]
|
|
112
|
+
* @returns {AsyncIterableIterator<T>}
|
|
113
|
+
*/
|
|
114
|
+
async function* loadPluginsByPreprocess(name, preprocess, type) {
|
|
115
|
+
for await (const [plugin, config, path] of loadPluginProfileAndPaths(name, type)) {
|
|
116
|
+
const basePath = pathFn.dirname(path);
|
|
117
|
+
yield* preprocess(config, plugin, (path) => {
|
|
118
|
+
const index = path.indexOf("#");
|
|
119
|
+
const file = index < 0 ? path : path.slice(0, index);
|
|
120
|
+
return import(pathFn.resolve(basePath, file)).then((mod) => {
|
|
121
|
+
const key = index < 0 ? path.slice(index + 1) : "";
|
|
122
|
+
let val = mod;
|
|
123
|
+
for (const k of key.split(".").filter(Boolean)) {
|
|
124
|
+
if (!val || typeof val !== "object") return;
|
|
125
|
+
val = val[k];
|
|
126
|
+
}
|
|
127
|
+
if (typeof val === "function") return val();
|
|
128
|
+
}, (e) => {
|
|
129
|
+
console.error(e);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @template {object} T
|
|
136
|
+
* @overload
|
|
137
|
+
* @param {string} name
|
|
138
|
+
* @param {'script' | 'data'} [type]
|
|
139
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* @template {object} T
|
|
143
|
+
* @overload
|
|
144
|
+
* @param {string} name
|
|
145
|
+
* @param {(config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>} preprocess
|
|
146
|
+
* @param {'script' | 'data'} [type]
|
|
147
|
+
* @returns {AsyncIterableIterator<T>}
|
|
148
|
+
*/
|
|
149
|
+
/**
|
|
150
|
+
* @template {object} T
|
|
151
|
+
* @param {string} name
|
|
152
|
+
* @param {((config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>) | 'script' | 'data'} [preprocess]
|
|
153
|
+
* @param {'script' | 'data'} [type]
|
|
154
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T, path: string] | T>}
|
|
155
|
+
*/
|
|
156
|
+
function loadPluginProfiles(name, preprocess, type) {
|
|
157
|
+
if (typeof preprocess === "function") return loadPluginsByPreprocess(name, preprocess, type);
|
|
158
|
+
return loadPluginProfileAndPaths(name, preprocess);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @template {object} T
|
|
162
|
+
* @param {string} name
|
|
163
|
+
* @returns {AsyncIterableIterator<[plugin: string, config: T]>}
|
|
164
|
+
*/
|
|
165
|
+
async function* loadPluginScripts(name) {
|
|
166
|
+
for (const [plugin, { root }] of Object.entries(pluginRoots)) {
|
|
167
|
+
/** @type {T | null} */
|
|
168
|
+
const result = await loadConfiguration(pathFn.resolve(root, `${name}.yongdall`), "script") || await loadConfiguration(pathFn.resolve(root, `yongdall/${name}`), "script") || await loadConfiguration(pathFn.resolve(root, `${name}/yongdall`), "script");
|
|
169
|
+
if (result === null) continue;
|
|
170
|
+
yield [plugin, result];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
export { plugins_default as i, loadPluginProfiles as n, loadPluginScripts as r, loadPluginProfileAndPaths as t };
|
|
176
|
+
//# sourceMappingURL=plugins-BsoRxhdM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins-BsoRxhdM.mjs","names":[],"sources":["../../cli/plugins/index.mjs"],"sourcesContent":["import * as pathFn from 'node:path';\nimport * as fsPromises from 'node:fs/promises';\nimport { pluginIdRegex } from '@yongdall/common';\nimport { loadCfgWithPath, loadProjectConfiguration, loadProjectConfigurationPath } from '@yongdall/configuration';\nimport loadConfiguration, { loadConfigurationWithPath } from '@yongdall/load-configuration';\n\n\n/**\n * \n * @param {string} root \n * @param {string} name \n */\nasync function findNodeModule(root, name) {\n\tfor (let basepath = root; ;) {\n\t\tconst path = pathFn.resolve(basepath, 'node_modules', name);\n\t\tconst packageJson = await fsPromises.readFile(pathFn.resolve(path, 'package.json'), 'utf-8').then(v => JSON.parse(v)).catch(() => null);\n\t\tconst version = packageJson?.version;\n\t\tif (version && typeof version === 'string') {\n\t\t\treturn path;\n\t\t}\n\t\tconst parent = pathFn.dirname(basepath);\n\t\tif (parent === basepath) { break; }\n\t\tbasepath = parent;\n\t}\n\treturn null;\n}\n/**\n * @returns {Promise<[string, string | boolean | {path?: string; development?: boolean}, string][]>}\n */\nasync function getPlugins() {\n\tconst result = await loadCfgWithPath('plugins').catch(() => { });\n\tconst [path, pluginList] = result && result[1] ? result : [\n\t\tawait loadProjectConfigurationPath(),\n\t\tawait loadProjectConfiguration().then(v => v.plugins),\n\t];\n\tif (!pluginList) { return []; }\n\tconst basePath = pathFn.dirname(path);\n\tif (Array.isArray(pluginList)) {\n\t\treturn pluginList.map(a => [a, true, basePath]);\n\t}\n\treturn Object.entries(pluginList).map(([a, b]) => [a, b, basePath]);\n}\n/**\n * \n * @param {string} plugin \n * @param {string | boolean | { path?: string; development?: boolean }} define \n * @param {string} basePath \n * @returns \n */\nasync function loadPlugin(plugin, define, basePath) {\n\tconst r = pluginIdRegex.exec(plugin);\n\tif (!r) { throw new Error(`无效的应用名称:${plugin}`); }\n\tconst path = typeof define === 'object' && define ? define.path : define;\n\tconst development = typeof define === 'object' && define ? define.development : false;\n\n\tconst url = typeof path === 'string' ? path : '';\n\tconst index = url.indexOf('#');\n\tconst packagePath = index >= 0 ? url.slice(0, index) : url;\n\tconst packageName = pluginIdRegex.test(packagePath) ? packagePath : '';\n\n\tconst source = !packageName && packagePath\n\t\t? pathFn.resolve(basePath, packagePath)\n\t\t: await findNodeModule(basePath, packageName || plugin);\n\tif (!source) { throw new Error(`找不到应用:${plugin}`); }\n\tlet pluginPath = source;\n\n\tif (index >= 0) {\n\t\tconst dirOptional = url[index + 1] === '?';\n\t\tconst dir = url.slice(dirOptional ? index + 2 : index + 1);\n\t\tif (dir) {\n\t\t\tconst pluginDir = pathFn.join(pluginPath, dir);\n\t\t\tif (await fsPromises.stat(pluginDir).then(s => s.isDirectory(), () => false)) {\n\t\t\t\tpluginPath = pluginDir;\n\t\t\t} else if (!dirOptional) {\n\t\t\t\tthrow new Error(`找不到应用 ${plugin} 的目录: ${dir}`);\n\t\t\t}\n\t\t}\n\t}\n\t/** @type {{label?: string; configurator?: any}?} */\n\tconst data = await loadConfiguration(pathFn.resolve(pluginPath, `yongdall.plugin`), 'data').catch(() => null);\n\treturn {\n\t\troot: pluginPath,\n\t\tsource,\n\t\tdevelopment: Boolean(development),\n\t\tlabel: data?.label,\n\t\tconfigurator: data?.configurator,\n\t};\n}\n\n/** @type {Record<string, {root: string; source: string; development: boolean; configurator?: any; label?: string}>} */\nconst pluginRoots = Object.create(null);\nfor (const [plugin, define, basePath] of await getPlugins()) {\n\tif (!define) { continue; }\n\n\tpluginRoots[plugin] = await loadPlugin(plugin, define, basePath);\n}\n\nexport default pluginRoots;\n\n/** \n * @template {object} T\n * @param {string} name\n * @param {'script' | 'data'} [type] \n * @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}\n */\nexport async function* loadPluginProfileAndPaths(name, type) {\n\tfor (const [plugin, { root }] of Object.entries(pluginRoots)) {\n\t\t/** @type {[string, T | null] | null} */\n\t\tconst result = await loadConfigurationWithPath(pathFn.resolve(root, `${name}.yongdall`), type)\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(root, `yongdall/${name}`), type)\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(root, `${name}/yongdall`), type);\n\t\tif (!result) { continue; }\n\t\tconst [path, config] = result;\n\t\tif (!config) { continue; }\n\t\tyield [plugin, config, path];\n\t}\n}\n\n/** \n * @template {object} T\n * @param {string} name\n * @param {(config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>} preprocess\n * @param {'script' | 'data'} [type] \n * @returns {AsyncIterableIterator<T>}\n */\nasync function* loadPluginsByPreprocess(name, preprocess, type) {\n\tfor await (const [plugin, config, path] of loadPluginProfileAndPaths(name, type)) {\n\t\tconst basePath = pathFn.dirname(path);\n\t\tyield* preprocess(config, plugin, path => {\n\t\t\tconst index = path.indexOf('#');\n\t\t\tconst file = index < 0 ? path : path.slice(0, index);\n\t\t\treturn import(pathFn.resolve(basePath, file)).then(mod => {\n\t\t\t\tconst key = index < 0 ? path.slice(index + 1) : '';\n\t\t\t\tlet val = mod;\n\t\t\t\tfor (const k of key.split('.').filter(Boolean)) {\n\t\t\t\t\tif (!val || typeof val !== 'object') { return; }\n\t\t\t\t\tval = val[k];\n\t\t\t\t}\n\t\t\t\tif (typeof val === 'function') {\n\t\t\t\t\treturn val();\n\t\t\t\t}\n\t\t\t}, (e) => {\n\t\t\t\tconsole.error(e);\n\t\t\t});\n\t\t});\n\t}\n}\n\n\n/** \n * @template {object} T\n * @overload\n * @param {string} name\n * @param {'script' | 'data'} [type] \n * @returns {AsyncIterableIterator<[plugin: string, config: T, path: string]>}\n */\n/** \n * @template {object} T\n * @overload\n * @param {string} name\n * @param {(config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>} preprocess\n * @param {'script' | 'data'} [type] \n * @returns {AsyncIterableIterator<T>}\n */\n/** \n * @template {object} T\n * @param {string} name\n * @param {((config: any, plugin: string, load: (path: string) => Promise<any>) => Iterable<T> | AsyncIterable<T>) | 'script' | 'data'} [preprocess]\n * @param {'script' | 'data'} [type] \n * @returns {AsyncIterableIterator<[plugin: string, config: T, path: string] | T>}\n */\nexport function loadPluginProfiles(name, preprocess, type) {\n\tif (typeof preprocess === 'function') {\n\t\treturn loadPluginsByPreprocess(name, preprocess, type);\n\t}\n\treturn loadPluginProfileAndPaths(name, preprocess);\n}\n\n/** \n * @template {object} T\n * @param {string} name\n * @returns {AsyncIterableIterator<[plugin: string, config: T]>}\n */\nexport async function* loadPluginScripts(name) {\n\tfor (const [plugin, { root }] of Object.entries(pluginRoots)) {\n\t\t/** @type {T | null} */\n\t\tconst result = await loadConfiguration(pathFn.resolve(root, `${name}.yongdall`), 'script')\n\t\t\t|| await loadConfiguration(pathFn.resolve(root, `yongdall/${name}`), 'script')\n\t\t\t|| await loadConfiguration(pathFn.resolve(root, `${name}/yongdall`), 'script');\n\t\tif (result === null) { continue; }\n\t\tyield [plugin, result];\n\t}\n}\n"],"mappings":";;;;;;;;;;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EAAE,SAAS,IAC3E,MAAM,kBAAkB,OAAO,QAAQ,MAAM,GAAG,KAAK,WAAW,EAAE,SAAS;AAC/E,MAAI,WAAW,KAAQ;AACvB,QAAM,CAAC,QAAQ,OAAO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as plugins_default } from "../plugins-BsoRxhdM.mjs";
|
|
2
|
+
|
|
3
|
+
//#region cli/plugins/yongdall/enumeration.mjs
|
|
4
|
+
async function plugin() {
|
|
5
|
+
return Object.entries(plugins_default).map(([plugin, { label, development, configurator }]) => ({
|
|
6
|
+
plugin,
|
|
7
|
+
label,
|
|
8
|
+
development,
|
|
9
|
+
configurator
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { plugin };
|
|
15
|
+
//# sourceMappingURL=enumeration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enumeration.mjs","names":["plugins"],"sources":["../../../cli/plugins/yongdall/enumeration.mjs"],"sourcesContent":["import plugins from '../index.mjs';\n\nexport async function plugin() {\n\treturn Object.entries(plugins).map(([plugin, {label, development, configurator}]) => ({\n\t\tplugin, label, development, configurator\n\t}));\n}\n"],"mappings":";;;AAEA,eAAsB,SAAS;AAC9B,QAAO,OAAO,QAAQA,gBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAC,OAAO,aAAa,qBAAoB;EACrF;EAAQ;EAAO;EAAa;EAC5B,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
label: 插件信息
|
package/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../cli/plugins/index.mjs"],"sourcesContent":["import * as pathFn from 'node:path';\nimport * as fsPromises from 'node:fs/promises';\nimport { pluginIdRegex } from '@yongdall/common';\nimport { loadCfgWithPath, loadProjectConfiguration, loadProjectConfigurationPath } from '@yongdall/configuration';\nimport loadConfiguration, { loadConfigurationWithPath } from '@yongdall/load-configuration';\n\n/** @type {Record<string, {root: string; source: string; development: boolean}>} */\nconst pluginRoots = Object.create(null);\n\n/**\n * \n * @param {string} root \n * @param {string} name \n */\nasync function findNodeModule(root, name) {\n\tfor (let basepath = root; ;) {\n\t\tconst path = pathFn.resolve(basepath, 'node_modules', name);\n\t\tconst packageJson = await fsPromises.readFile(pathFn.resolve(path, 'package.json'), 'utf-8').then(v => JSON.parse(v)).catch(() => null);\n\t\tconst version = packageJson?.version;\n\t\tif (version && typeof version === 'string') {\n\t\t\treturn path;\n\t\t}\n\t\tconst parent = pathFn.dirname(basepath);\n\t\tif (parent === basepath) { break; }\n\t\tbasepath = parent;\n\t}\n\treturn null;\n}\n/**\n * @returns {Promise<[string, string | boolean | {path?: string; development?: boolean}, string][]>}\n */\nasync function getPlugins() {\n\tconst result = await loadCfgWithPath('plugins').catch(() => { });\n\tconst [path, pluginList] = result && result[1] ? result : [\n\t\tawait loadProjectConfigurationPath(),\n\t\tawait loadProjectConfiguration().then(v => v.plugins),\n\t];\n\tif (!pluginList) { return []; }\n\tconst basePath = pathFn.dirname(path);\n\tif (Array.isArray(pluginList)) {\n\t\treturn pluginList.map(a => [a, true, basePath]);\n\t}\n\treturn Object.entries(pluginList).map(([a, b]) => [a, b, basePath]);\n}\n\nfor (const [plugin, define, basePath] of await getPlugins()) {\n\tif (!define) { continue; }\n\tconst r = pluginIdRegex.exec(plugin);\n\tif (!r) { throw new Error(`无效的应用名称:${plugin}`); }\n\tconst path = typeof define === 'object' && define ? define.path : define;\n\tconst development = typeof define === 'object' && define ? define.development : false;\n\n\tconst url = typeof path === 'string' ? path : '';\n\tconst index = url.indexOf('#');\n\tconst packagePath = index >= 0 ? url.slice(0, index) : url;\n\tconst packageName = pluginIdRegex.test(packagePath) ? packagePath : '';\n\n\tconst source = !packageName && packagePath\n\t\t? pathFn.resolve(basePath, packagePath)\n\t\t: await findNodeModule(basePath, packageName || plugin);\n\tif (!source) { throw new Error(`找不到应用:${plugin}`); }\n\tlet pluginPath = source;\n\n\tif (index >= 0) {\n\t\tconst dirOptional = url[index + 1] === '?';\n\t\tconst dir = url.slice(dirOptional ? index + 2 : index + 1);\n\t\tif (dir) {\n\t\t\tconst pluginDir = pathFn.join(pluginPath, dir);\n\t\t\tif (await fsPromises.stat(pluginDir).then(s => s.isDirectory(), () => false)) {\n\t\t\t\tpluginPath = pluginDir;\n\t\t\t} else if (!dirOptional) {\n\t\t\t\tthrow new Error(`找不到应用 ${plugin} 的目录: ${dir}`);\n\t\t\t}\n\t\t}\n\n\t}\n\tpluginRoots[plugin] = { root: pluginPath, source, development: Boolean(development) };\n}\n\nexport default pluginRoots;\n\n/** \n * @template {object} T\n * @param {string} name\n * @param {boolean} [scriptOnly] \n * @returns {AsyncIterableIterator<[plugin: string, config: T | null, path: string]>}\n */\nexport async function* loadPluginProfiles(name, scriptOnly) {\n\tfor (const [plugin, { root }] of Object.entries(pluginRoots)) {\n\t\t/** @type {[string, T | null] | null} */\n\t\tconst result = await loadConfigurationWithPath(pathFn.resolve(root, `${name}.yongdall`), scriptOnly)\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(root, `yongdall/${name}`), scriptOnly)\n\t\t\t|| await loadConfigurationWithPath(pathFn.resolve(root, `${name}/yongdall`), scriptOnly);\n\t\tif (!result) { continue; }\n\t\tconst [path, config] = result;\n\t\tyield [plugin, config, path];\n\t}\n}\n\n/** \n * @template {object} T\n * @param {string} name\n * @returns {AsyncIterableIterator<[plugin: string, config: T]>}\n */\nexport async function* loadPluginScripts(name) {\n\tfor (const [plugin, { root }] of Object.entries(pluginRoots)) {\n\t\t/** @type {T | null} */\n\t\tconst result = await loadConfiguration(pathFn.resolve(root, `${name}.yongdall`), true)\n\t\t\t|| await loadConfiguration(pathFn.resolve(root, `yongdall/${name}`), true)\n\t\t\t|| await loadConfiguration(pathFn.resolve(root, `${name}/yongdall`), true);\n\t\tif (result === null) { continue; }\n\t\tyield [plugin, result];\n\t}\n}\n"],"m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