@tego/core 1.3.44
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/LICENSE +201 -0
- package/lib/acl/available-action.d.ts +5 -0
- package/lib/acl/available-action.js +62 -0
- package/lib/acl/index.d.ts +2 -0
- package/lib/acl/index.js +49 -0
- package/lib/aes-encryptor.d.ts +11 -0
- package/lib/aes-encryptor.js +116 -0
- package/lib/app-command.d.ts +12 -0
- package/lib/app-command.js +76 -0
- package/lib/app-supervisor.d.ts +61 -0
- package/lib/app-supervisor.js +299 -0
- package/lib/application.d.ts +354 -0
- package/lib/application.js +878 -0
- package/lib/cache/index.d.ts +3 -0
- package/lib/cache/index.js +35 -0
- package/lib/commands/console.d.ts +3 -0
- package/lib/commands/console.js +48 -0
- package/lib/commands/create-migration.d.ts +3 -0
- package/lib/commands/create-migration.js +80 -0
- package/lib/commands/db-auth.d.ts +3 -0
- package/lib/commands/db-auth.js +28 -0
- package/lib/commands/db-clean.d.ts +3 -0
- package/lib/commands/db-clean.js +31 -0
- package/lib/commands/db-sync.d.ts +3 -0
- package/lib/commands/db-sync.js +40 -0
- package/lib/commands/destroy.d.ts +3 -0
- package/lib/commands/destroy.js +30 -0
- package/lib/commands/index.d.ts +2 -0
- package/lib/commands/index.js +71 -0
- package/lib/commands/install.d.ts +3 -0
- package/lib/commands/install.js +33 -0
- package/lib/commands/migrator.d.ts +3 -0
- package/lib/commands/migrator.js +31 -0
- package/lib/commands/pm.d.ts +3 -0
- package/lib/commands/pm.js +75 -0
- package/lib/commands/refresh.d.ts +3 -0
- package/lib/commands/refresh.js +31 -0
- package/lib/commands/restart.d.ts +3 -0
- package/lib/commands/restart.js +35 -0
- package/lib/commands/start.d.ts +3 -0
- package/lib/commands/start.js +74 -0
- package/lib/commands/stop.d.ts +3 -0
- package/lib/commands/stop.js +34 -0
- package/lib/commands/upgrade.d.ts +3 -0
- package/lib/commands/upgrade.js +29 -0
- package/lib/cron/cron-job-manager.d.ts +25 -0
- package/lib/cron/cron-job-manager.js +89 -0
- package/lib/environment.d.ts +10 -0
- package/lib/environment.js +73 -0
- package/lib/errors/application-not-install.d.ts +4 -0
- package/lib/errors/application-not-install.js +35 -0
- package/lib/errors/handler.d.ts +3 -0
- package/lib/errors/handler.js +41 -0
- package/lib/errors/plugin-command-error.d.ts +2 -0
- package/lib/errors/plugin-command-error.js +31 -0
- package/lib/errors/plugin-not-exist.d.ts +2 -0
- package/lib/errors/plugin-not-exist.js +31 -0
- package/lib/gateway/errors.d.ts +22 -0
- package/lib/gateway/errors.js +138 -0
- package/lib/gateway/gateway.d.ts +56 -0
- package/lib/gateway/gateway.js +408 -0
- package/lib/gateway/index.d.ts +2 -0
- package/lib/gateway/index.js +30 -0
- package/lib/gateway/ipc-socket-client.d.ts +17 -0
- package/lib/gateway/ipc-socket-client.js +99 -0
- package/lib/gateway/ipc-socket-server.d.ts +12 -0
- package/lib/gateway/ipc-socket-server.js +140 -0
- package/lib/gateway/types.d.ts +25 -0
- package/lib/gateway/types.js +15 -0
- package/lib/gateway/ws-server.d.ts +63 -0
- package/lib/gateway/ws-server.js +335 -0
- package/lib/helper.d.ts +11 -0
- package/lib/helper.js +193 -0
- package/lib/helpers/application-version.d.ts +10 -0
- package/lib/helpers/application-version.js +77 -0
- package/lib/helpers/multiple-instance-manager.d.ts +6 -0
- package/lib/helpers/multiple-instance-manager.js +40 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +57 -0
- package/lib/locale/index.d.ts +1 -0
- package/lib/locale/index.js +21 -0
- package/lib/locale/locale.d.ts +22 -0
- package/lib/locale/locale.js +166 -0
- package/lib/locale/resource.d.ts +1 -0
- package/lib/locale/resource.js +74 -0
- package/lib/main-data-source.d.ts +4 -0
- package/lib/main-data-source.js +45 -0
- package/lib/middlewares/data-template.d.ts +2 -0
- package/lib/middlewares/data-template.js +39 -0
- package/lib/middlewares/data-wrapping.d.ts +3 -0
- package/lib/middlewares/data-wrapping.js +90 -0
- package/lib/middlewares/db2resource.d.ts +6 -0
- package/lib/middlewares/db2resource.js +76 -0
- package/lib/middlewares/extract-client-ip.d.ts +2 -0
- package/lib/middlewares/extract-client-ip.js +37 -0
- package/lib/middlewares/i18n.d.ts +1 -0
- package/lib/middlewares/i18n.js +44 -0
- package/lib/middlewares/index.d.ts +3 -0
- package/lib/middlewares/index.js +32 -0
- package/lib/middlewares/parse-variables.d.ts +1 -0
- package/lib/middlewares/parse-variables.js +84 -0
- package/lib/migration.d.ts +12 -0
- package/lib/migration.js +47 -0
- package/lib/migrations/20230912193824-package-name-unique.d.ts +6 -0
- package/lib/migrations/20230912193824-package-name-unique.js +52 -0
- package/lib/migrations/20230912294620-update-pkg.d.ts +6 -0
- package/lib/migrations/20230912294620-update-pkg.js +58 -0
- package/lib/migrations/20240106082756-update-plugins.d.ts +6 -0
- package/lib/migrations/20240106082756-update-plugins.js +44 -0
- package/lib/migrations/20240705000001-remove-pkgs-approval.d.ts +6 -0
- package/lib/migrations/20240705000001-remove-pkgs-approval.js +47 -0
- package/lib/notice/index.d.ts +25 -0
- package/lib/notice/index.js +91 -0
- package/lib/plugin-manager/clientStaticUtils.d.ts +24 -0
- package/lib/plugin-manager/clientStaticUtils.js +156 -0
- package/lib/plugin-manager/constants.d.ts +7 -0
- package/lib/plugin-manager/constants.js +120 -0
- package/lib/plugin-manager/deps.d.ts +2 -0
- package/lib/plugin-manager/deps.js +68 -0
- package/lib/plugin-manager/index.d.ts +2 -0
- package/lib/plugin-manager/index.js +23 -0
- package/lib/plugin-manager/middleware.d.ts +2 -0
- package/lib/plugin-manager/middleware.js +36 -0
- package/lib/plugin-manager/options/collection.d.ts +2 -0
- package/lib/plugin-manager/options/collection.js +39 -0
- package/lib/plugin-manager/options/resource.d.ts +15 -0
- package/lib/plugin-manager/options/resource.js +185 -0
- package/lib/plugin-manager/plugin-manager-repository.d.ts +27 -0
- package/lib/plugin-manager/plugin-manager-repository.js +136 -0
- package/lib/plugin-manager/plugin-manager.d.ts +205 -0
- package/lib/plugin-manager/plugin-manager.js +1032 -0
- package/lib/plugin-manager/types.d.ts +15 -0
- package/lib/plugin-manager/types.js +15 -0
- package/lib/plugin-manager/utils.d.ts +101 -0
- package/lib/plugin-manager/utils.js +513 -0
- package/lib/plugin-manager/web-service.d.ts +6 -0
- package/lib/plugin-manager/web-service.js +116 -0
- package/lib/plugin.d.ts +125 -0
- package/lib/plugin.js +359 -0
- package/lib/pub-sub-manager/handler-manager.d.ts +28 -0
- package/lib/pub-sub-manager/handler-manager.js +149 -0
- package/lib/pub-sub-manager/index.d.ts +3 -0
- package/lib/pub-sub-manager/index.js +25 -0
- package/lib/pub-sub-manager/memory-pub-sub-adapter.d.ts +21 -0
- package/lib/pub-sub-manager/memory-pub-sub-adapter.js +82 -0
- package/lib/pub-sub-manager/pub-sub-manager.d.ts +19 -0
- package/lib/pub-sub-manager/pub-sub-manager.js +108 -0
- package/lib/pub-sub-manager/types.d.ts +20 -0
- package/lib/pub-sub-manager/types.js +15 -0
- package/lib/sync-message-manager.d.ts +16 -0
- package/lib/sync-message-manager.js +112 -0
- package/package.json +58 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PluginData {
|
|
2
|
+
name?: string;
|
|
3
|
+
packageName?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
preVersion?: string;
|
|
6
|
+
registry?: string;
|
|
7
|
+
clientUrl?: string;
|
|
8
|
+
compressedFileUrl?: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
type?: 'url' | 'npm' | 'upload';
|
|
11
|
+
authToken?: string;
|
|
12
|
+
installed?: boolean;
|
|
13
|
+
builtIn?: boolean;
|
|
14
|
+
options?: any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { PluginData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* get temp dir
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* getTempDir() => '/tmp/tachybase'
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTempDir(): Promise<string>;
|
|
10
|
+
export declare function getPluginStoragePath(): string;
|
|
11
|
+
export declare function getLocalPluginPackagesPathArr(): string[];
|
|
12
|
+
export declare function getStoragePluginDir(packageName: string): string;
|
|
13
|
+
export declare function getLocalPluginDir(packageDirBasename: string): string;
|
|
14
|
+
export declare function getAuthorizationHeaders(registry?: string, authToken?: string): {};
|
|
15
|
+
/**
|
|
16
|
+
* get latest version from npm
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* getLatestVersion('dayjs', 'https://registry.npmjs.org') => '1.10.6'
|
|
20
|
+
*/
|
|
21
|
+
export declare function getLatestVersion(packageName: string, registry: string, token?: string): Promise<any>;
|
|
22
|
+
export declare function getNpmInfo(packageName: string, registry: string, token?: string): Promise<any>;
|
|
23
|
+
export declare function download(url: string, destination: string, options?: AxiosRequestConfig): Promise<unknown>;
|
|
24
|
+
export declare function removeTmpDir(tempFile: string, tempPackageContentDir: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* download and unzip to node_modules
|
|
27
|
+
*/
|
|
28
|
+
export declare function downloadAndUnzipToTempDir(fileUrl: string, authToken?: string): Promise<{
|
|
29
|
+
packageName: any;
|
|
30
|
+
version: any;
|
|
31
|
+
tempPackageContentDir: string;
|
|
32
|
+
tempFile: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function copyTempPackageToStorageAndLinkToNodeModules(tempFile: string, tempPackageContentDir: string, packageName: string): Promise<{
|
|
35
|
+
packageDir: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* get package info from npm
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* getPluginInfoByNpm('dayjs', 'https://registry.npmjs.org')
|
|
42
|
+
* => { fileUrl: 'https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz', latestVersion: '1.10.6' }
|
|
43
|
+
*
|
|
44
|
+
* getPluginInfoByNpm('dayjs', 'https://registry.npmjs.org', '1.1.0')
|
|
45
|
+
* => { fileUrl: 'https://registry.npmjs.org/dayjs/-/dayjs-1.1.0.tgz', latestVersion: '1.1.0' }
|
|
46
|
+
*/
|
|
47
|
+
interface GetPluginInfoOptions {
|
|
48
|
+
packageName: string;
|
|
49
|
+
registry: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
authToken?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function getPluginInfoByNpm(options: GetPluginInfoOptions): Promise<{
|
|
54
|
+
compressedFileUrl: string;
|
|
55
|
+
version: string;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* scan `src/server` directory to get server packages
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* getServerPackages('src/server') => ['dayjs', '@tachybase/plugin-bbb']
|
|
62
|
+
*/
|
|
63
|
+
export declare function getServerPackages(packageDir: string): string[];
|
|
64
|
+
/**
|
|
65
|
+
* get package.json
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* getPackageJson('dayjs') => { name: 'dayjs', version: '1.0.0', ... }
|
|
69
|
+
*/
|
|
70
|
+
export declare function getPackageJson(pluginName: string): Promise<any>;
|
|
71
|
+
export declare function getPackageJsonByLocalPath(localPath: string): Promise<any>;
|
|
72
|
+
export declare function updatePluginByCompressedFileUrl(options: Partial<Pick<PluginData, 'compressedFileUrl' | 'packageName' | 'authToken'>>): Promise<{
|
|
73
|
+
packageName: any;
|
|
74
|
+
packageDir: string;
|
|
75
|
+
version: any;
|
|
76
|
+
}>;
|
|
77
|
+
export declare function getNewVersion(plugin: PluginData): Promise<string | false>;
|
|
78
|
+
export declare function removeRequireCache(fileOrPackageName: string): void;
|
|
79
|
+
export declare function requireNoCache(fileOrPackageName: string): Promise<any>;
|
|
80
|
+
export declare function readJSONFileContent(filePath: string): Promise<any>;
|
|
81
|
+
export declare function requireModule(m: any): any;
|
|
82
|
+
export declare function isNotBuiltinModule(packageName: string): boolean;
|
|
83
|
+
export declare const isValidPackageName: (str: string) => boolean;
|
|
84
|
+
export declare function getPackageNameFromString(str: string): string;
|
|
85
|
+
export declare function getPackagesFromFiles(files: string[]): string[];
|
|
86
|
+
export declare function getIncludePackages(sourcePackages: string[], external: string[], pluginPrefix: string[]): string[];
|
|
87
|
+
export declare function getExcludePackages(sourcePackages: string[], external: string[], pluginPrefix: string[]): string[];
|
|
88
|
+
export declare function getExternalVersionFromSource(packageName: string): Promise<Record<string, string>>;
|
|
89
|
+
export interface DepCompatible {
|
|
90
|
+
name: string;
|
|
91
|
+
result: boolean;
|
|
92
|
+
versionRange: string;
|
|
93
|
+
packageVersion: string;
|
|
94
|
+
}
|
|
95
|
+
export declare function getCompatible(packageName: string): Promise<false | DepCompatible[]>;
|
|
96
|
+
export declare function checkCompatible(packageName: string): Promise<boolean>;
|
|
97
|
+
export declare function checkAndGetCompatible(packageName: string): Promise<{
|
|
98
|
+
isCompatible: boolean;
|
|
99
|
+
depsCompatible: DepCompatible[];
|
|
100
|
+
}>;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
checkAndGetCompatible: () => checkAndGetCompatible,
|
|
32
|
+
checkCompatible: () => checkCompatible,
|
|
33
|
+
copyTempPackageToStorageAndLinkToNodeModules: () => copyTempPackageToStorageAndLinkToNodeModules,
|
|
34
|
+
download: () => download,
|
|
35
|
+
downloadAndUnzipToTempDir: () => downloadAndUnzipToTempDir,
|
|
36
|
+
getAuthorizationHeaders: () => getAuthorizationHeaders,
|
|
37
|
+
getCompatible: () => getCompatible,
|
|
38
|
+
getExcludePackages: () => getExcludePackages,
|
|
39
|
+
getExternalVersionFromSource: () => getExternalVersionFromSource,
|
|
40
|
+
getIncludePackages: () => getIncludePackages,
|
|
41
|
+
getLatestVersion: () => getLatestVersion,
|
|
42
|
+
getLocalPluginDir: () => getLocalPluginDir,
|
|
43
|
+
getLocalPluginPackagesPathArr: () => getLocalPluginPackagesPathArr,
|
|
44
|
+
getNewVersion: () => getNewVersion,
|
|
45
|
+
getNpmInfo: () => getNpmInfo,
|
|
46
|
+
getPackageJson: () => getPackageJson,
|
|
47
|
+
getPackageJsonByLocalPath: () => getPackageJsonByLocalPath,
|
|
48
|
+
getPackageNameFromString: () => getPackageNameFromString,
|
|
49
|
+
getPackagesFromFiles: () => getPackagesFromFiles,
|
|
50
|
+
getPluginInfoByNpm: () => getPluginInfoByNpm,
|
|
51
|
+
getPluginStoragePath: () => getPluginStoragePath,
|
|
52
|
+
getServerPackages: () => getServerPackages,
|
|
53
|
+
getStoragePluginDir: () => getStoragePluginDir,
|
|
54
|
+
getTempDir: () => getTempDir,
|
|
55
|
+
isNotBuiltinModule: () => isNotBuiltinModule,
|
|
56
|
+
isValidPackageName: () => isValidPackageName,
|
|
57
|
+
readJSONFileContent: () => readJSONFileContent,
|
|
58
|
+
removeRequireCache: () => removeRequireCache,
|
|
59
|
+
removeTmpDir: () => removeTmpDir,
|
|
60
|
+
requireModule: () => requireModule,
|
|
61
|
+
requireNoCache: () => requireNoCache,
|
|
62
|
+
updatePluginByCompressedFileUrl: () => updatePluginByCompressedFileUrl
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(utils_exports);
|
|
65
|
+
var import_node_module = require("node:module");
|
|
66
|
+
var import_node_os = __toESM(require("node:os"));
|
|
67
|
+
var import_node_path = __toESM(require("node:path"));
|
|
68
|
+
var import_utils = require("@tachybase/utils");
|
|
69
|
+
var import_axios = __toESM(require("axios"));
|
|
70
|
+
var import_decompress = __toESM(require("decompress"));
|
|
71
|
+
var import_fast_glob = __toESM(require("fast-glob"));
|
|
72
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
73
|
+
var import_ini = __toESM(require("ini"));
|
|
74
|
+
var import_semver = __toESM(require("semver"));
|
|
75
|
+
var import_clientStaticUtils = require("./clientStaticUtils");
|
|
76
|
+
var import_constants = require("./constants");
|
|
77
|
+
var import_deps = __toESM(require("./deps"));
|
|
78
|
+
async function getTempDir() {
|
|
79
|
+
const temporaryDirectory = await import_fs_extra.default.realpath(import_node_os.default.tmpdir());
|
|
80
|
+
return import_node_path.default.join(temporaryDirectory, import_constants.APP_NAME);
|
|
81
|
+
}
|
|
82
|
+
__name(getTempDir, "getTempDir");
|
|
83
|
+
function getPluginStoragePath() {
|
|
84
|
+
const pluginStoragePath = process.env.PLUGIN_STORAGE_PATH || import_constants.DEFAULT_PLUGIN_STORAGE_PATH;
|
|
85
|
+
return import_node_path.default.isAbsolute(pluginStoragePath) ? pluginStoragePath : import_node_path.default.join(process.cwd(), pluginStoragePath);
|
|
86
|
+
}
|
|
87
|
+
__name(getPluginStoragePath, "getPluginStoragePath");
|
|
88
|
+
function getLocalPluginPackagesPathArr() {
|
|
89
|
+
const pluginPackagesPathArr = process.env.PLUGIN_PATH || import_constants.DEFAULT_PLUGIN_PATH;
|
|
90
|
+
return pluginPackagesPathArr.split(",").map((pluginPackagesPath) => {
|
|
91
|
+
pluginPackagesPath = pluginPackagesPath.trim();
|
|
92
|
+
return import_node_path.default.isAbsolute(pluginPackagesPath) ? pluginPackagesPath : import_node_path.default.join(process.cwd(), pluginPackagesPath);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
__name(getLocalPluginPackagesPathArr, "getLocalPluginPackagesPathArr");
|
|
96
|
+
function getStoragePluginDir(packageName) {
|
|
97
|
+
const pluginStoragePath = getPluginStoragePath();
|
|
98
|
+
return import_node_path.default.join(pluginStoragePath, packageName);
|
|
99
|
+
}
|
|
100
|
+
__name(getStoragePluginDir, "getStoragePluginDir");
|
|
101
|
+
function getLocalPluginDir(packageDirBasename) {
|
|
102
|
+
const localPluginDir = getLocalPluginPackagesPathArr().map((pluginPackagesPath) => import_node_path.default.join(pluginPackagesPath, packageDirBasename)).find((pluginDir) => import_fs_extra.default.existsSync(pluginDir));
|
|
103
|
+
if (!localPluginDir) {
|
|
104
|
+
throw new Error(`local plugin "${packageDirBasename}" not found`);
|
|
105
|
+
}
|
|
106
|
+
return localPluginDir;
|
|
107
|
+
}
|
|
108
|
+
__name(getLocalPluginDir, "getLocalPluginDir");
|
|
109
|
+
function getAuthorizationHeaders(registry, authToken) {
|
|
110
|
+
const headers = {};
|
|
111
|
+
if (registry && !authToken) {
|
|
112
|
+
const npmrcPath = import_node_path.default.join(process.cwd(), ".npmrc");
|
|
113
|
+
const url = new URL(registry);
|
|
114
|
+
let envConfig = process.env;
|
|
115
|
+
if (import_fs_extra.default.existsSync(npmrcPath)) {
|
|
116
|
+
const content = import_fs_extra.default.readFileSync(import_node_path.default.join(process.cwd(), ".npmrc"), "utf-8");
|
|
117
|
+
envConfig = {
|
|
118
|
+
...envConfig,
|
|
119
|
+
...import_ini.default.parse(content)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const key = Object.keys(envConfig).find((key2) => key2.includes(url.host) && key2.includes("_authToken"));
|
|
123
|
+
if (key) {
|
|
124
|
+
authToken = envConfig[key];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (authToken) {
|
|
128
|
+
headers["Authorization"] = `Bearer ${authToken}`;
|
|
129
|
+
}
|
|
130
|
+
return headers;
|
|
131
|
+
}
|
|
132
|
+
__name(getAuthorizationHeaders, "getAuthorizationHeaders");
|
|
133
|
+
async function getLatestVersion(packageName, registry, token) {
|
|
134
|
+
const npmInfo = await getNpmInfo(packageName, registry, token);
|
|
135
|
+
const latestVersion = npmInfo["dist-tags"].latest;
|
|
136
|
+
return latestVersion;
|
|
137
|
+
}
|
|
138
|
+
__name(getLatestVersion, "getLatestVersion");
|
|
139
|
+
async function getNpmInfo(packageName, registry, token) {
|
|
140
|
+
registry.endsWith("/") && (registry = registry.slice(0, -1));
|
|
141
|
+
const response = await import_axios.default.get(`${registry}/${packageName}`, {
|
|
142
|
+
headers: getAuthorizationHeaders(registry, token)
|
|
143
|
+
});
|
|
144
|
+
try {
|
|
145
|
+
const data = response.data;
|
|
146
|
+
return data;
|
|
147
|
+
} catch (e) {
|
|
148
|
+
console.error(e);
|
|
149
|
+
throw new Error(`${registry} is not a valid registry, '${registry}/${packageName}' response is not a valid json.`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
__name(getNpmInfo, "getNpmInfo");
|
|
153
|
+
async function download(url, destination, options = {}) {
|
|
154
|
+
const response = await import_axios.default.get(url, {
|
|
155
|
+
...options,
|
|
156
|
+
responseType: "stream"
|
|
157
|
+
});
|
|
158
|
+
import_fs_extra.default.mkdirpSync(import_node_path.default.dirname(destination));
|
|
159
|
+
const writer = import_fs_extra.default.createWriteStream(destination);
|
|
160
|
+
response.data.pipe(writer);
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
writer.on("finish", resolve);
|
|
163
|
+
writer.on("error", reject);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
__name(download, "download");
|
|
167
|
+
async function removeTmpDir(tempFile, tempPackageContentDir) {
|
|
168
|
+
await import_fs_extra.default.remove(tempFile);
|
|
169
|
+
await import_fs_extra.default.remove(tempPackageContentDir);
|
|
170
|
+
}
|
|
171
|
+
__name(removeTmpDir, "removeTmpDir");
|
|
172
|
+
async function downloadAndUnzipToTempDir(fileUrl, authToken) {
|
|
173
|
+
const fileName = import_node_path.default.basename(fileUrl);
|
|
174
|
+
const tempDir = await getTempDir();
|
|
175
|
+
const tempFile = import_node_path.default.join(tempDir, fileName);
|
|
176
|
+
const tempPackageDir = tempFile.replace(import_node_path.default.extname(fileName), "");
|
|
177
|
+
await import_fs_extra.default.remove(tempPackageDir);
|
|
178
|
+
await import_fs_extra.default.remove(tempFile);
|
|
179
|
+
if ((0, import_utils.isURL)(fileUrl)) {
|
|
180
|
+
await download(fileUrl, tempFile, {
|
|
181
|
+
headers: getAuthorizationHeaders(fileUrl, authToken)
|
|
182
|
+
});
|
|
183
|
+
} else if (await import_fs_extra.default.exists(fileUrl)) {
|
|
184
|
+
await import_fs_extra.default.copy(fileUrl, tempFile);
|
|
185
|
+
} else {
|
|
186
|
+
throw new Error(`${fileUrl} does not exist`);
|
|
187
|
+
}
|
|
188
|
+
if (!import_fs_extra.default.existsSync(tempFile)) {
|
|
189
|
+
throw new Error(`download ${fileUrl} failed`);
|
|
190
|
+
}
|
|
191
|
+
await (0, import_decompress.default)(tempFile, tempPackageDir);
|
|
192
|
+
if (!import_fs_extra.default.existsSync(tempPackageDir)) {
|
|
193
|
+
await import_fs_extra.default.remove(tempFile);
|
|
194
|
+
throw new Error(`File is not a valid compressed file. Maybe the file need authorization.`);
|
|
195
|
+
}
|
|
196
|
+
let tempPackageContentDir = tempPackageDir;
|
|
197
|
+
const files = import_fs_extra.default.readdirSync(tempPackageDir, { recursive: false, withFileTypes: true }).filter((item) => item.name !== "__MACOSX");
|
|
198
|
+
if (files.length === 1 && files[0].isDirectory() && import_fs_extra.default.existsSync(import_node_path.default.join(tempPackageDir, files[0]["name"], "package.json"))) {
|
|
199
|
+
tempPackageContentDir = import_node_path.default.join(tempPackageDir, files[0]["name"]);
|
|
200
|
+
}
|
|
201
|
+
const packageJsonPath = import_node_path.default.join(tempPackageContentDir, "package.json");
|
|
202
|
+
if (!import_fs_extra.default.existsSync(packageJsonPath)) {
|
|
203
|
+
await removeTmpDir(tempFile, tempPackageContentDir);
|
|
204
|
+
throw new Error(`decompress ${fileUrl} failed`);
|
|
205
|
+
}
|
|
206
|
+
const packageJson = await readJSONFileContent(packageJsonPath);
|
|
207
|
+
const mainFile = import_node_path.default.join(tempPackageContentDir, packageJson.main);
|
|
208
|
+
if (!import_fs_extra.default.existsSync(mainFile)) {
|
|
209
|
+
await removeTmpDir(tempFile, tempPackageContentDir);
|
|
210
|
+
throw new Error(`main file ${packageJson.main} not found, Please check if the plugin has been built.`);
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
packageName: packageJson.name,
|
|
214
|
+
version: packageJson.version,
|
|
215
|
+
tempPackageContentDir,
|
|
216
|
+
tempFile
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
__name(downloadAndUnzipToTempDir, "downloadAndUnzipToTempDir");
|
|
220
|
+
async function copyTempPackageToStorageAndLinkToNodeModules(tempFile, tempPackageContentDir, packageName) {
|
|
221
|
+
const packageDir = getStoragePluginDir(packageName);
|
|
222
|
+
await import_fs_extra.default.remove(packageDir);
|
|
223
|
+
await import_fs_extra.default.move(tempPackageContentDir, packageDir, { overwrite: true });
|
|
224
|
+
await (0, import_utils.createStoragePluginSymLink)(packageName);
|
|
225
|
+
await removeTmpDir(tempFile, tempPackageContentDir);
|
|
226
|
+
return {
|
|
227
|
+
packageDir
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
__name(copyTempPackageToStorageAndLinkToNodeModules, "copyTempPackageToStorageAndLinkToNodeModules");
|
|
231
|
+
async function getPluginInfoByNpm(options) {
|
|
232
|
+
let { registry, version } = options;
|
|
233
|
+
const { packageName, authToken } = options;
|
|
234
|
+
if (registry.endsWith("/")) {
|
|
235
|
+
registry = registry.slice(0, -1);
|
|
236
|
+
}
|
|
237
|
+
if (!version) {
|
|
238
|
+
version = await getLatestVersion(packageName, registry, authToken);
|
|
239
|
+
}
|
|
240
|
+
const compressedFileUrl = `${registry}/${packageName}/-/${packageName.split("/").pop()}-${version}.tgz`;
|
|
241
|
+
return { compressedFileUrl, version };
|
|
242
|
+
}
|
|
243
|
+
__name(getPluginInfoByNpm, "getPluginInfoByNpm");
|
|
244
|
+
function getServerPackages(packageDir) {
|
|
245
|
+
function isBuiltinModule(packageName) {
|
|
246
|
+
return import_node_module.builtinModules.includes(packageName);
|
|
247
|
+
}
|
|
248
|
+
__name(isBuiltinModule, "isBuiltinModule");
|
|
249
|
+
function getSrcPlugins(sourceDir) {
|
|
250
|
+
const importedPlugins = /* @__PURE__ */ new Set();
|
|
251
|
+
const exts = [".js", ".ts", ".jsx", ".tsx"];
|
|
252
|
+
const importRegex2 = /import\s+.*?\s+from\s+['"]([^'"\s.].+?)['"];?/g;
|
|
253
|
+
const requireRegex2 = /require\s*\(\s*[`'"]([^`'"\s.].+?)[`'"]\s*\)/g;
|
|
254
|
+
function setPluginsFromContent(reg, content) {
|
|
255
|
+
let match;
|
|
256
|
+
while (match = reg.exec(content)) {
|
|
257
|
+
let importedPlugin = match[1];
|
|
258
|
+
if (importedPlugin.startsWith("@")) {
|
|
259
|
+
importedPlugin = importedPlugin.split("/").slice(0, 2).join("/");
|
|
260
|
+
} else {
|
|
261
|
+
importedPlugin = importedPlugin.split("/")[0];
|
|
262
|
+
}
|
|
263
|
+
if (!isBuiltinModule(importedPlugin)) {
|
|
264
|
+
importedPlugins.add(importedPlugin);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
__name(setPluginsFromContent, "setPluginsFromContent");
|
|
269
|
+
function traverseDirectory(directory) {
|
|
270
|
+
const files = import_fs_extra.default.readdirSync(directory);
|
|
271
|
+
for (const file of files) {
|
|
272
|
+
const filePath = import_node_path.default.join(directory, file);
|
|
273
|
+
const stat = import_fs_extra.default.statSync(filePath);
|
|
274
|
+
if (stat.isDirectory()) {
|
|
275
|
+
traverseDirectory(filePath);
|
|
276
|
+
} else if (stat.isFile() && !filePath.includes("__tests__")) {
|
|
277
|
+
if (exts.includes(import_node_path.default.extname(filePath).toLowerCase())) {
|
|
278
|
+
const content = import_fs_extra.default.readFileSync(filePath, "utf-8");
|
|
279
|
+
setPluginsFromContent(importRegex2, content);
|
|
280
|
+
setPluginsFromContent(requireRegex2, content);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
__name(traverseDirectory, "traverseDirectory");
|
|
286
|
+
traverseDirectory(sourceDir);
|
|
287
|
+
return [...importedPlugins];
|
|
288
|
+
}
|
|
289
|
+
__name(getSrcPlugins, "getSrcPlugins");
|
|
290
|
+
const srcServerPlugins = getSrcPlugins(import_node_path.default.join(packageDir, "src/server"));
|
|
291
|
+
return srcServerPlugins;
|
|
292
|
+
}
|
|
293
|
+
__name(getServerPackages, "getServerPackages");
|
|
294
|
+
async function getPackageJson(pluginName) {
|
|
295
|
+
const packageDir = getStoragePluginDir(pluginName);
|
|
296
|
+
return await getPackageJsonByLocalPath(packageDir);
|
|
297
|
+
}
|
|
298
|
+
__name(getPackageJson, "getPackageJson");
|
|
299
|
+
async function getPackageJsonByLocalPath(localPath) {
|
|
300
|
+
if (!import_fs_extra.default.existsSync(localPath)) {
|
|
301
|
+
return null;
|
|
302
|
+
} else {
|
|
303
|
+
const fullPath = import_node_path.default.join(localPath, "package.json");
|
|
304
|
+
const data = await import_fs_extra.default.promises.readFile(fullPath, { encoding: "utf-8" });
|
|
305
|
+
return JSON.parse(data);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
__name(getPackageJsonByLocalPath, "getPackageJsonByLocalPath");
|
|
309
|
+
async function updatePluginByCompressedFileUrl(options) {
|
|
310
|
+
const { packageName, version, tempFile, tempPackageContentDir } = await downloadAndUnzipToTempDir(
|
|
311
|
+
options.compressedFileUrl,
|
|
312
|
+
options.authToken
|
|
313
|
+
);
|
|
314
|
+
if (options.packageName && options.packageName !== packageName) {
|
|
315
|
+
await removeTmpDir(tempFile, tempPackageContentDir);
|
|
316
|
+
throw new Error(`Plugin name in package.json must be ${options.packageName}, but got ${packageName}`);
|
|
317
|
+
}
|
|
318
|
+
const { packageDir } = await copyTempPackageToStorageAndLinkToNodeModules(
|
|
319
|
+
tempFile,
|
|
320
|
+
tempPackageContentDir,
|
|
321
|
+
packageName
|
|
322
|
+
);
|
|
323
|
+
return {
|
|
324
|
+
packageName,
|
|
325
|
+
packageDir,
|
|
326
|
+
version
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
__name(updatePluginByCompressedFileUrl, "updatePluginByCompressedFileUrl");
|
|
330
|
+
async function getNewVersion(plugin) {
|
|
331
|
+
if (!(plugin.packageName && plugin.registry)) return false;
|
|
332
|
+
const { version } = await getPluginInfoByNpm({
|
|
333
|
+
packageName: plugin.packageName,
|
|
334
|
+
registry: plugin.registry,
|
|
335
|
+
authToken: plugin.authToken
|
|
336
|
+
});
|
|
337
|
+
return version !== plugin.version ? version : false;
|
|
338
|
+
}
|
|
339
|
+
__name(getNewVersion, "getNewVersion");
|
|
340
|
+
function removeRequireCache(fileOrPackageName) {
|
|
341
|
+
delete require.cache[require.resolve(fileOrPackageName)];
|
|
342
|
+
delete require.cache[fileOrPackageName];
|
|
343
|
+
}
|
|
344
|
+
__name(removeRequireCache, "removeRequireCache");
|
|
345
|
+
async function requireNoCache(fileOrPackageName) {
|
|
346
|
+
return await (0, import_utils.importModule)(fileOrPackageName);
|
|
347
|
+
}
|
|
348
|
+
__name(requireNoCache, "requireNoCache");
|
|
349
|
+
async function readJSONFileContent(filePath) {
|
|
350
|
+
const data = await import_fs_extra.default.promises.readFile(filePath, { encoding: "utf-8" });
|
|
351
|
+
return JSON.parse(data);
|
|
352
|
+
}
|
|
353
|
+
__name(readJSONFileContent, "readJSONFileContent");
|
|
354
|
+
function requireModule(m) {
|
|
355
|
+
if (typeof m === "string") {
|
|
356
|
+
m = require(m);
|
|
357
|
+
}
|
|
358
|
+
if (typeof m !== "object") {
|
|
359
|
+
return m;
|
|
360
|
+
}
|
|
361
|
+
return m.__esModule ? m.default : m;
|
|
362
|
+
}
|
|
363
|
+
__name(requireModule, "requireModule");
|
|
364
|
+
async function getExternalVersionFromDistFile(packageName) {
|
|
365
|
+
const { exists, filePath } = (0, import_clientStaticUtils.getPackageFilePathWithExistCheck)(packageName, "dist/externalVersion.js");
|
|
366
|
+
if (!exists) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
return await requireNoCache(filePath);
|
|
371
|
+
} catch (e) {
|
|
372
|
+
console.error(e);
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
__name(getExternalVersionFromDistFile, "getExternalVersionFromDistFile");
|
|
377
|
+
function isNotBuiltinModule(packageName) {
|
|
378
|
+
return !import_node_module.builtinModules.includes(packageName);
|
|
379
|
+
}
|
|
380
|
+
__name(isNotBuiltinModule, "isNotBuiltinModule");
|
|
381
|
+
const isValidPackageName = /* @__PURE__ */ __name((str) => {
|
|
382
|
+
const pattern = /^(?:@[a-zA-Z0-9_-]+\/)?[a-zA-Z0-9_-]+$/;
|
|
383
|
+
return pattern.test(str);
|
|
384
|
+
}, "isValidPackageName");
|
|
385
|
+
function getPackageNameFromString(str) {
|
|
386
|
+
if (str.startsWith(".")) return null;
|
|
387
|
+
const arr = str.split("/");
|
|
388
|
+
let packageName;
|
|
389
|
+
if (arr[0].startsWith("@")) {
|
|
390
|
+
packageName = arr.slice(0, 2).join("/");
|
|
391
|
+
} else {
|
|
392
|
+
packageName = arr[0];
|
|
393
|
+
}
|
|
394
|
+
packageName = packageName.trim();
|
|
395
|
+
return isValidPackageName(packageName) ? packageName : null;
|
|
396
|
+
}
|
|
397
|
+
__name(getPackageNameFromString, "getPackageNameFromString");
|
|
398
|
+
function getPackagesFromFiles(files) {
|
|
399
|
+
const packageNames = files.map((item) => [
|
|
400
|
+
...[...item.matchAll(import_constants.importRegex)].map((item2) => item2[2]),
|
|
401
|
+
...[...item.matchAll(import_constants.requireRegex)].map((item2) => item2[1])
|
|
402
|
+
]).flat().map(getPackageNameFromString).filter(Boolean).filter(isNotBuiltinModule);
|
|
403
|
+
return [...new Set(packageNames)];
|
|
404
|
+
}
|
|
405
|
+
__name(getPackagesFromFiles, "getPackagesFromFiles");
|
|
406
|
+
function getIncludePackages(sourcePackages, external, pluginPrefix2) {
|
|
407
|
+
return sourcePackages.filter((packageName) => !external.includes(packageName)).filter((packageName) => !pluginPrefix2.some((prefix) => packageName.startsWith(prefix)));
|
|
408
|
+
}
|
|
409
|
+
__name(getIncludePackages, "getIncludePackages");
|
|
410
|
+
function getExcludePackages(sourcePackages, external, pluginPrefix2) {
|
|
411
|
+
const includePackages = getIncludePackages(sourcePackages, external, pluginPrefix2);
|
|
412
|
+
return sourcePackages.filter((packageName) => !includePackages.includes(packageName));
|
|
413
|
+
}
|
|
414
|
+
__name(getExcludePackages, "getExcludePackages");
|
|
415
|
+
async function getExternalVersionFromSource(packageName) {
|
|
416
|
+
const packageDir = (0, import_clientStaticUtils.getPackageDir)(packageName);
|
|
417
|
+
const sourceGlobalFiles = ["src/**/*.{ts,js,tsx,jsx}", "!src/**/__tests__"];
|
|
418
|
+
const sourceFilePaths = await import_fast_glob.default.glob(sourceGlobalFiles, { cwd: packageDir, absolute: true });
|
|
419
|
+
const sourceFiles = await Promise.all(sourceFilePaths.map((item) => import_fs_extra.default.readFile(item, "utf-8")));
|
|
420
|
+
const sourcePackages = getPackagesFromFiles(sourceFiles);
|
|
421
|
+
const excludePackages = getExcludePackages(sourcePackages, import_constants.EXTERNAL, import_constants.pluginPrefix);
|
|
422
|
+
const data = excludePackages.reduce((prev, packageName2) => {
|
|
423
|
+
const depPkgPath = (0, import_clientStaticUtils.getDepPkgPath)(packageName2, packageDir);
|
|
424
|
+
const depPkg = require(depPkgPath);
|
|
425
|
+
prev[packageName2] = depPkg.version;
|
|
426
|
+
return prev;
|
|
427
|
+
}, {});
|
|
428
|
+
return data;
|
|
429
|
+
}
|
|
430
|
+
__name(getExternalVersionFromSource, "getExternalVersionFromSource");
|
|
431
|
+
async function getCompatible(packageName) {
|
|
432
|
+
let externalVersion;
|
|
433
|
+
if (!process.env.IS_DEV_CMD) {
|
|
434
|
+
const res = await getExternalVersionFromDistFile(packageName);
|
|
435
|
+
if (!res) {
|
|
436
|
+
return false;
|
|
437
|
+
} else {
|
|
438
|
+
externalVersion = res;
|
|
439
|
+
}
|
|
440
|
+
} else {
|
|
441
|
+
externalVersion = await getExternalVersionFromSource(packageName);
|
|
442
|
+
}
|
|
443
|
+
return Object.keys(externalVersion).reduce((result, packageName2) => {
|
|
444
|
+
const packageVersion = externalVersion[packageName2];
|
|
445
|
+
const globalPackageName = import_deps.default[packageName2] ? packageName2 : import_deps.default[packageName2.split("/")[0]] ? packageName2.split("/")[0] : void 0;
|
|
446
|
+
if (globalPackageName) {
|
|
447
|
+
const versionRange = import_deps.default[globalPackageName];
|
|
448
|
+
result.push({
|
|
449
|
+
name: packageName2,
|
|
450
|
+
result: import_semver.default.satisfies(packageVersion, versionRange, { includePrerelease: true }),
|
|
451
|
+
versionRange,
|
|
452
|
+
packageVersion
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
return result;
|
|
456
|
+
}, []);
|
|
457
|
+
}
|
|
458
|
+
__name(getCompatible, "getCompatible");
|
|
459
|
+
async function checkCompatible(packageName) {
|
|
460
|
+
const compatible = await getCompatible(packageName);
|
|
461
|
+
if (!compatible) return false;
|
|
462
|
+
return compatible.every((item) => item.result);
|
|
463
|
+
}
|
|
464
|
+
__name(checkCompatible, "checkCompatible");
|
|
465
|
+
async function checkAndGetCompatible(packageName) {
|
|
466
|
+
const compatible = await getCompatible(packageName);
|
|
467
|
+
if (!compatible) {
|
|
468
|
+
return {
|
|
469
|
+
isCompatible: false,
|
|
470
|
+
depsCompatible: []
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
return {
|
|
474
|
+
isCompatible: compatible.every((item) => item.result),
|
|
475
|
+
depsCompatible: compatible
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
__name(checkAndGetCompatible, "checkAndGetCompatible");
|
|
479
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
480
|
+
0 && (module.exports = {
|
|
481
|
+
checkAndGetCompatible,
|
|
482
|
+
checkCompatible,
|
|
483
|
+
copyTempPackageToStorageAndLinkToNodeModules,
|
|
484
|
+
download,
|
|
485
|
+
downloadAndUnzipToTempDir,
|
|
486
|
+
getAuthorizationHeaders,
|
|
487
|
+
getCompatible,
|
|
488
|
+
getExcludePackages,
|
|
489
|
+
getExternalVersionFromSource,
|
|
490
|
+
getIncludePackages,
|
|
491
|
+
getLatestVersion,
|
|
492
|
+
getLocalPluginDir,
|
|
493
|
+
getLocalPluginPackagesPathArr,
|
|
494
|
+
getNewVersion,
|
|
495
|
+
getNpmInfo,
|
|
496
|
+
getPackageJson,
|
|
497
|
+
getPackageJsonByLocalPath,
|
|
498
|
+
getPackageNameFromString,
|
|
499
|
+
getPackagesFromFiles,
|
|
500
|
+
getPluginInfoByNpm,
|
|
501
|
+
getPluginStoragePath,
|
|
502
|
+
getServerPackages,
|
|
503
|
+
getStoragePluginDir,
|
|
504
|
+
getTempDir,
|
|
505
|
+
isNotBuiltinModule,
|
|
506
|
+
isValidPackageName,
|
|
507
|
+
readJSONFileContent,
|
|
508
|
+
removeRequireCache,
|
|
509
|
+
removeTmpDir,
|
|
510
|
+
requireModule,
|
|
511
|
+
requireNoCache,
|
|
512
|
+
updatePluginByCompressedFileUrl
|
|
513
|
+
});
|