@eggjs/utils 5.0.0-beta.34 → 5.0.0-beta.36
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.js +7 -0
- package/dist/deprecated.d.ts +12 -9
- package/dist/deprecated.js +35 -50
- package/dist/error/ImportResolveError.d.ts +7 -4
- package/dist/error/ImportResolveError.js +16 -13
- package/dist/framework.d.ts +15 -13
- package/dist/framework.js +53 -74
- package/dist/import.d.ts +13 -10
- package/dist/import.js +214 -371
- package/dist/index.d.ts +24 -23
- package/dist/index.js +40 -47
- package/dist/plugin.d.ts +39 -37
- package/dist/plugin.js +97 -102
- package/dist/utils.js +11 -17
- package/package.json +22 -26
- package/dist/error/index.d.ts +0 -1
- package/dist/error/index.js +0 -2
- package/dist/utils.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { getFrameworkOrEggPath } from "./deprecated.js";
|
|
2
|
+
import { getFrameworkPath } from "./framework.js";
|
|
3
|
+
import { findEggCore, getConfig, getLoadUnits, getLoader, getPlugins } from "./plugin.js";
|
|
4
|
+
import { ImportModuleOptions, ImportResolveOptions, getExtensions, getRequire, importModule, importResolve, isESM, isSupportTypeScript } from "./import.js";
|
|
5
|
+
import { ImportResolveError } from "./error/ImportResolveError.js";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
|
|
9
9
|
declare const _default: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
getFrameworkPath: typeof getFrameworkPath;
|
|
11
|
+
getPlugins: typeof getPlugins;
|
|
12
|
+
getConfig: typeof getConfig;
|
|
13
|
+
getLoadUnits: typeof getLoadUnits;
|
|
14
|
+
getFrameworkOrEggPath: typeof getFrameworkOrEggPath;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly unknown: "unknown";
|
|
16
|
+
declare const EggType: {
|
|
17
|
+
readonly framework: "framework";
|
|
18
|
+
readonly plugin: "plugin";
|
|
19
|
+
readonly application: "application";
|
|
20
|
+
readonly unknown: "unknown";
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
type EggType = (typeof EggType)[keyof typeof EggType];
|
|
24
23
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
* Detect the type of egg project
|
|
25
|
+
*/
|
|
26
|
+
declare function detectType(baseDir: string): Promise<keyof typeof EggType>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { EggType, ImportModuleOptions, ImportResolveError, ImportResolveOptions, _default as default, detectType, findEggCore, getConfig, getExtensions, getFrameworkOrEggPath, getFrameworkPath, getLoadUnits, getLoader, getPlugins, getRequire, importModule, importResolve, isESM, isSupportTypeScript };
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import { getFrameworkPath } from "./framework.js";
|
|
4
|
-
import { getPlugins, getConfig, getLoadUnits } from "./plugin.js";
|
|
5
1
|
import { getFrameworkOrEggPath } from "./deprecated.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { ImportResolveError } from "./error/ImportResolveError.js";
|
|
3
|
+
import { getExtensions, getRequire, importModule, importResolve, isESM, isSupportTypeScript } from "./import.js";
|
|
4
|
+
import { getFrameworkPath } from "./framework.js";
|
|
5
|
+
import { findEggCore, getConfig, getLoadUnits, getLoader, getPlugins } from "./plugin.js";
|
|
6
|
+
import fs from "node:fs/promises";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
//#region src/index.ts
|
|
10
|
+
var src_default = {
|
|
11
|
+
getFrameworkPath,
|
|
12
|
+
getPlugins,
|
|
13
|
+
getConfig,
|
|
14
|
+
getLoadUnits,
|
|
15
|
+
getFrameworkOrEggPath
|
|
19
16
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
const EggType = {
|
|
18
|
+
framework: "framework",
|
|
19
|
+
plugin: "plugin",
|
|
20
|
+
application: "application",
|
|
21
|
+
unknown: "unknown"
|
|
25
22
|
};
|
|
26
23
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return EggType.framework;
|
|
46
|
-
}
|
|
47
|
-
if (pkg.eggPlugin?.name) {
|
|
48
|
-
return EggType.plugin;
|
|
49
|
-
}
|
|
50
|
-
return EggType.application;
|
|
24
|
+
* Detect the type of egg project
|
|
25
|
+
*/
|
|
26
|
+
async function detectType(baseDir) {
|
|
27
|
+
const pkgFile = path.join(baseDir, "package.json");
|
|
28
|
+
let pkg;
|
|
29
|
+
try {
|
|
30
|
+
await fs.access(pkgFile);
|
|
31
|
+
} catch {
|
|
32
|
+
return EggType.unknown;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
pkg = JSON.parse(await fs.readFile(pkgFile, "utf-8"));
|
|
36
|
+
} catch {
|
|
37
|
+
return EggType.unknown;
|
|
38
|
+
}
|
|
39
|
+
if (pkg.egg?.framework) return EggType.framework;
|
|
40
|
+
if (pkg.eggPlugin?.name) return EggType.plugin;
|
|
41
|
+
return EggType.application;
|
|
51
42
|
}
|
|
52
|
-
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { EggType, ImportResolveError, src_default as default, detectType, findEggCore, getConfig, getExtensions, getFrameworkOrEggPath, getFrameworkPath, getLoadUnits, getLoader, getPlugins, getRequire, importModule, importResolve, isESM, isSupportTypeScript };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/plugin.d.ts
|
|
2
|
+
interface LoaderOptions {
|
|
3
|
+
framework: string;
|
|
4
|
+
baseDir: string;
|
|
5
|
+
env?: string;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
interface Plugin {
|
|
8
|
+
name: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
enable: boolean;
|
|
11
|
+
implicitEnable: boolean;
|
|
12
|
+
path: string;
|
|
13
|
+
dependencies: string[];
|
|
14
|
+
optionalDependencies: string[];
|
|
15
|
+
env: string[];
|
|
16
|
+
from: string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* @see https://github.com/eggjs/egg-core/blob/2920f6eade07959d25f5c4f96b154d3fbae877db/lib/loader/mixin/plugin.js#L203
|
|
20
|
+
*/
|
|
21
|
+
declare function getPlugins(options: LoaderOptions): Promise<Record<string, Plugin>>;
|
|
21
22
|
interface Unit {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
type: "plugin" | "framework" | "app";
|
|
24
|
+
path: string;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* @see https://github.com/eggjs/egg-core/blob/2920f6eade07959d25f5c4f96b154d3fbae877db/lib/loader/egg_loader.js#L348
|
|
28
|
+
*/
|
|
29
|
+
declare function getLoadUnits(options: LoaderOptions): Promise<Unit[]>;
|
|
30
|
+
declare function getConfig(options: LoaderOptions): Promise<Record<string, any>>;
|
|
30
31
|
interface IEggLoader {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
loadPlugin(): Promise<void>;
|
|
33
|
+
loadConfig(): Promise<void>;
|
|
34
|
+
config: Record<string, any>;
|
|
35
|
+
getLoadUnits(): Unit[];
|
|
36
|
+
allPlugins: Record<string, Plugin>;
|
|
36
37
|
}
|
|
37
38
|
interface IEggLoaderOptions {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
baseDir: string;
|
|
40
|
+
app: unknown;
|
|
41
|
+
logger: object;
|
|
42
|
+
EggCoreClass?: unknown;
|
|
42
43
|
}
|
|
43
44
|
type EggLoaderImplClass<T = IEggLoader> = new (options: IEggLoaderOptions) => T;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
declare function getLoader(options: LoaderOptions): Promise<IEggLoader>;
|
|
46
|
+
declare function findEggCore(options: LoaderOptions): Promise<{
|
|
47
|
+
EggCore?: object;
|
|
48
|
+
EggLoader: EggLoaderImplClass;
|
|
48
49
|
}>;
|
|
49
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
export { findEggCore, getConfig, getLoadUnits, getLoader, getPlugins };
|
package/dist/plugin.js
CHANGED
|
@@ -1,115 +1,110 @@
|
|
|
1
|
-
import { debuglog } from 'node:util';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import assert from 'node:assert';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import { stat, mkdir, writeFile, realpath } from 'node:fs/promises';
|
|
6
1
|
import { importModule } from "./import.js";
|
|
7
|
-
|
|
2
|
+
import { mkdir, realpath, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import assert from "node:assert";
|
|
5
|
+
import { debuglog } from "node:util";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
|
|
8
|
+
//#region src/plugin.ts
|
|
9
|
+
const debug = debuglog("egg/utils/plugin");
|
|
8
10
|
const tmpDir = os.tmpdir();
|
|
9
|
-
function noop() {
|
|
11
|
+
function noop() {}
|
|
10
12
|
const logger = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
debug: noop,
|
|
14
|
+
info: noop,
|
|
15
|
+
warn: noop,
|
|
16
|
+
error: noop
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* @see https://github.com/eggjs/egg-core/blob/2920f6eade07959d25f5c4f96b154d3fbae877db/lib/loader/mixin/plugin.js#L203
|
|
20
|
+
*/
|
|
21
|
+
async function getPlugins(options) {
|
|
22
|
+
const loader = await getLoader(options);
|
|
23
|
+
await loader.loadPlugin();
|
|
24
|
+
return loader.allPlugins;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
* @see https://github.com/eggjs/egg-core/blob/2920f6eade07959d25f5c4f96b154d3fbae877db/lib/loader/egg_loader.js#L348
|
|
28
|
+
*/
|
|
29
|
+
async function getLoadUnits(options) {
|
|
30
|
+
const loader = await getLoader(options);
|
|
31
|
+
await loader.loadPlugin();
|
|
32
|
+
return loader.getLoadUnits();
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
async function getConfig(options) {
|
|
35
|
+
const loader = await getLoader(options);
|
|
36
|
+
await loader.loadPlugin();
|
|
37
|
+
await loader.loadConfig();
|
|
38
|
+
return loader.config;
|
|
37
39
|
}
|
|
38
40
|
async function exists(filepath) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
41
|
+
try {
|
|
42
|
+
await stat(filepath);
|
|
43
|
+
return true;
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
EggCoreClass: EggCore,
|
|
71
|
-
});
|
|
48
|
+
async function getLoader(options) {
|
|
49
|
+
assert(options.framework, "framework is required");
|
|
50
|
+
assert(await exists(options.framework), `${options.framework} should exist`);
|
|
51
|
+
if (!(options.baseDir && await exists(options.baseDir))) {
|
|
52
|
+
options.baseDir = path.join(tmpDir, "egg_utils", `${Date.now()}`, "tmp_app");
|
|
53
|
+
await mkdir(options.baseDir, { recursive: true });
|
|
54
|
+
await writeFile(path.join(options.baseDir, "package.json"), JSON.stringify({
|
|
55
|
+
name: "tmp_app",
|
|
56
|
+
type: "module"
|
|
57
|
+
}));
|
|
58
|
+
debug("[getLoader] create baseDir: %o", options.baseDir);
|
|
59
|
+
}
|
|
60
|
+
const { EggCore, EggLoader } = await findEggCore(options);
|
|
61
|
+
const mod = await importModule(options.framework);
|
|
62
|
+
const Application = mod.Application ?? mod.default?.Application;
|
|
63
|
+
assert(Application, `Application not export on ${options.framework}`);
|
|
64
|
+
if (options.env) process.env.EGG_SERVER_ENV = options.env;
|
|
65
|
+
return new EggLoader({
|
|
66
|
+
baseDir: options.baseDir,
|
|
67
|
+
logger,
|
|
68
|
+
app: new Application({}),
|
|
69
|
+
EggCoreClass: EggCore
|
|
70
|
+
});
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
eggCorePath = path.join(options.framework, `node_modules/${eggCodeName}`);
|
|
109
|
-
}
|
|
110
|
-
if (await exists(eggCorePath)) {
|
|
111
|
-
return await importModule(eggCorePath);
|
|
112
|
-
}
|
|
113
|
-
assert(false, `Can't find egg or ${eggCodeName} from ${options.baseDir} and ${options.framework}`);
|
|
72
|
+
async function findEggCore(options) {
|
|
73
|
+
const baseDirRealpath = await realpath(options.baseDir);
|
|
74
|
+
const paths = [await realpath(options.framework), baseDirRealpath];
|
|
75
|
+
try {
|
|
76
|
+
const { EggCore, EggLoader } = await importModule("egg", { paths });
|
|
77
|
+
if (EggLoader) return {
|
|
78
|
+
EggCore,
|
|
79
|
+
EggLoader
|
|
80
|
+
};
|
|
81
|
+
} catch (err) {
|
|
82
|
+
debug("[findEggCore] import \"egg\" from paths:%o error: %o", paths, err);
|
|
83
|
+
}
|
|
84
|
+
const eggCodeName = "@eggjs/core";
|
|
85
|
+
try {
|
|
86
|
+
const { EggCore, EggLoader } = await importModule(eggCodeName, { paths });
|
|
87
|
+
if (EggLoader) return {
|
|
88
|
+
EggCore,
|
|
89
|
+
EggLoader
|
|
90
|
+
};
|
|
91
|
+
} catch (err) {
|
|
92
|
+
debug("[findEggCore] import \"%s\" from paths:%o error: %o", eggCodeName, paths, err);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const { EggCore, EggLoader } = await importModule(eggCodeName);
|
|
96
|
+
if (EggLoader) return {
|
|
97
|
+
EggCore,
|
|
98
|
+
EggLoader
|
|
99
|
+
};
|
|
100
|
+
} catch (err) {
|
|
101
|
+
debug("[findEggCore] import \"%s\" error: %o", eggCodeName, err);
|
|
102
|
+
}
|
|
103
|
+
let eggCorePath = path.join(options.baseDir, `node_modules/${eggCodeName}`);
|
|
104
|
+
if (!await exists(eggCorePath)) eggCorePath = path.join(options.framework, `node_modules/${eggCodeName}`);
|
|
105
|
+
if (await exists(eggCorePath)) return await importModule(eggCorePath);
|
|
106
|
+
assert(false, `Can't find egg or ${eggCodeName} from ${options.baseDir} and ${options.framework}`);
|
|
114
107
|
}
|
|
115
|
-
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { findEggCore, getConfig, getLoadUnits, getLoader, getPlugins };
|
package/dist/utils.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
//#region src/utils.ts
|
|
6
|
+
function readJSONSync(file) {
|
|
7
|
+
if (!existsSync(file)) throw new Error(`${file} is not found`);
|
|
8
|
+
return JSON.parse(readFileSync(file, "utf-8"));
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
return path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDbkQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUN6QyxPQUFPLElBQUksTUFBTSxXQUFXLENBQUM7QUFFN0IsTUFBTSxVQUFVLFlBQVksQ0FBQyxJQUFZO0lBQ3ZDLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQztRQUN0QixNQUFNLElBQUksS0FBSyxDQUFDLEdBQUcsSUFBSSxlQUFlLENBQUMsQ0FBQztJQUMxQyxDQUFDO0lBQ0QsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUMsQ0FBQztBQUNqRCxDQUFDO0FBRUQsTUFBTSxVQUFVLFVBQVU7SUFDeEIsSUFBSSxPQUFPLFNBQVMsS0FBSyxXQUFXLEVBQUUsQ0FBQztRQUNyQyxPQUFPLFNBQVMsQ0FBQztJQUNuQixDQUFDO0lBQ0QsNkRBQTZEO0lBQzdELGFBQWE7SUFDYixPQUFPLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUN0RCxDQUFDIn0=
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { readJSONSync };
|
package/package.json
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/utils",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
4
|
-
"engines": {
|
|
5
|
-
"node": ">=22.18.0"
|
|
6
|
-
},
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"main": "./dist/index.js",
|
|
11
|
-
"module": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"type": "module",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": "./dist/index.js",
|
|
19
|
-
"./package.json": "./package.json"
|
|
20
|
-
},
|
|
3
|
+
"version": "5.0.0-beta.36",
|
|
21
4
|
"description": "Utils for all egg projects",
|
|
22
5
|
"keywords": [
|
|
23
6
|
"egg",
|
|
24
7
|
"utils"
|
|
25
8
|
],
|
|
9
|
+
"homepage": "https://github.com/eggjs/egg/tree/next/packages/utils",
|
|
10
|
+
"license": "MIT",
|
|
26
11
|
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)",
|
|
27
12
|
"repository": {
|
|
28
13
|
"type": "git",
|
|
29
|
-
"url": "git://github.com/eggjs/egg.git",
|
|
14
|
+
"url": "git+https://github.com/eggjs/egg.git",
|
|
30
15
|
"directory": "packages/utils"
|
|
31
16
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./dist/index.js",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
34
31
|
"dependencies": {},
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"coffee": "5",
|
|
37
34
|
"mm": "^4.0.2",
|
|
38
35
|
"runscript": "^2.0.1",
|
|
39
|
-
"tsdown": "0.15.11",
|
|
40
36
|
"typescript": "^5.9.3"
|
|
41
37
|
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.18.0"
|
|
40
|
+
},
|
|
42
41
|
"scripts": {
|
|
43
|
-
"
|
|
44
|
-
"lint": "oxlint --type-aware",
|
|
45
|
-
"typecheck": "tsc --noEmit",
|
|
46
|
-
"test": "vitest run"
|
|
42
|
+
"typecheck": "tsgo --noEmit"
|
|
47
43
|
}
|
|
48
44
|
}
|
package/dist/error/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ImportResolveError.ts';
|
package/dist/error/index.js
DELETED
package/dist/utils.d.ts
DELETED