@eggjs/standalone-decorator 4.0.0-beta.4 → 4.0.0-beta.6

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/README.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # `@eggjs/standalone-decorator`
2
2
 
3
+ [![NPM version][npm-image]][npm-url]
4
+ [![Known Vulnerabilities][snyk-image]][snyk-url]
5
+ [![npm download][download-image]][download-url]
6
+ [![Node.js Version](https://img.shields.io/node/v/@eggjs/standalone-decorator.svg?style=flat)](https://nodejs.org/en/download/)
7
+
8
+ [npm-image]: https://img.shields.io/npm/v/@eggjs/standalone-decorator.svg?style=flat-square
9
+ [npm-url]: https://npmjs.org/package/@eggjs/standalone-decorator
10
+ [snyk-image]: https://snyk.io/test/npm/@eggjs/standalone-decorator/badge.svg?style=flat-square
11
+ [snyk-url]: https://snyk.io/test/npm/@eggjs/standalone-decorator
12
+ [download-image]: https://img.shields.io/npm/dm/@eggjs/standalone-decorator.svg?style=flat-square
13
+ [download-url]: https://npmjs.org/package/@eggjs/standalone-decorator
14
+
3
15
  ## Usage
4
16
 
5
- Please read [@eggjs/tegg-standalone](../../standalone/standalone)
17
+ Please read [@eggjs/tegg-standalone](../../standalone/standalone/README.md)
@@ -0,0 +1,6 @@
1
+ import { MainRunnerClass } from "../typing.js";
2
+
3
+ //#region src/decorator/Runner.d.ts
4
+ declare function Runner<T>(): (clazz: MainRunnerClass<T>) => void;
5
+ //#endregion
6
+ export { Runner };
@@ -0,0 +1,11 @@
1
+ import { StandaloneUtil } from "../util/StandaloneUtil.js";
2
+
3
+ //#region src/decorator/Runner.ts
4
+ function Runner() {
5
+ return function(clazz) {
6
+ StandaloneUtil.setMainRunner(clazz);
7
+ };
8
+ }
9
+
10
+ //#endregion
11
+ export { Runner };
@@ -0,0 +1,4 @@
1
+ import { MainRunner, MainRunnerClass } from "./typing.js";
2
+ import { StandaloneUtil } from "./util/StandaloneUtil.js";
3
+ import { Runner } from "./decorator/Runner.js";
4
+ export { MainRunner, MainRunnerClass, Runner, StandaloneUtil };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { StandaloneUtil } from "./util/StandaloneUtil.js";
2
+ import { Runner } from "./decorator/Runner.js";
3
+
4
+ export { Runner, StandaloneUtil };
@@ -0,0 +1,7 @@
1
+ //#region src/typing.d.ts
2
+ interface MainRunner<T = void> {
3
+ main(): Promise<T>;
4
+ }
5
+ type MainRunnerClass<T = void> = new () => MainRunner<T>;
6
+ //#endregion
7
+ export { MainRunner, MainRunnerClass };
@@ -0,0 +1,10 @@
1
+ import { MainRunnerClass } from "../typing.js";
2
+
3
+ //#region src/util/StandaloneUtil.d.ts
4
+ declare class StandaloneUtil {
5
+ private static runnerClass;
6
+ static setMainRunner(runnerClass: MainRunnerClass): void;
7
+ static getMainRunner(): MainRunnerClass | undefined;
8
+ }
9
+ //#endregion
10
+ export { StandaloneUtil };
@@ -0,0 +1,13 @@
1
+ //#region src/util/StandaloneUtil.ts
2
+ var StandaloneUtil = class StandaloneUtil {
3
+ static runnerClass;
4
+ static setMainRunner(runnerClass) {
5
+ StandaloneUtil.runnerClass = runnerClass;
6
+ }
7
+ static getMainRunner() {
8
+ return StandaloneUtil.runnerClass;
9
+ }
10
+ };
11
+
12
+ //#endregion
13
+ export { StandaloneUtil };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/standalone-decorator",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.6",
4
4
  "description": "tegg standalone decorator",
5
5
  "keywords": [
6
6
  "egg",
@@ -11,24 +11,15 @@
11
11
  ],
12
12
  "type": "module",
13
13
  "exports": {
14
- ".": {
15
- "types": "./src/index.d.ts",
16
- "default": "./src/index.js"
17
- }
14
+ ".": "./dist/index.js",
15
+ "./package.json": "./package.json"
18
16
  },
19
17
  "files": [
20
- "src/**/*.js",
21
- "src/**/*.d.ts"
18
+ "dist"
22
19
  ],
23
- "scripts": {
24
- "clean": "tsc -b --clean",
25
- "tsc": "npm run clean && tsc -p ./tsconfig.json",
26
- "tsc:pub": "npm run tsc",
27
- "prepublishOnly": "npm run tsc"
28
- },
29
20
  "author": "killagu <killa123@126.com>",
30
21
  "license": "MIT",
31
- "homepage": "https://github.com/eggjs/tegg",
22
+ "homepage": "https://github.com/eggjs/tegg/tree/next/core/standalone-decorator",
32
23
  "bugs": {
33
24
  "url": "https://github.com/eggjs/tegg/issues"
34
25
  },
@@ -38,19 +29,24 @@
38
29
  "directory": "core/standalone-decorator"
39
30
  },
40
31
  "engines": {
41
- "node": ">=20.0.0"
42
- },
43
- "dependencies": {
44
- "@eggjs/tegg-common-util": "^4.0.0-beta.4",
45
- "reflect-metadata": "^0.2.2"
32
+ "node": ">=22.18.0"
46
33
  },
34
+ "dependencies": {},
47
35
  "publishConfig": {
48
36
  "access": "public"
49
37
  },
50
38
  "devDependencies": {
51
- "@types/node": "22",
52
- "ts-node": "10",
53
- "typescript": "5"
54
- },
55
- "gitHead": "9ba90bed3ab9f641ceaa6a7db560095817b7e52c"
56
- }
39
+ "@types/node": "^22.10.5",
40
+ "typescript": "^5.9.3",
41
+ "tsdown": "^0.15.6",
42
+ "unplugin-unused": "^0.5.3"
43
+ },
44
+ "main": "./dist/index.js",
45
+ "module": "./dist/index.js",
46
+ "types": "./dist/index.d.ts",
47
+ "scripts": {
48
+ "clean": "rimraf dist",
49
+ "build": "tsdown",
50
+ "typecheck": "tsc --noEmit"
51
+ }
52
+ }
@@ -1,2 +0,0 @@
1
- import { MainRunnerClass } from '../typing.js';
2
- export declare function Runner<T>(): (clazz: MainRunnerClass<T>) => void;
@@ -1,7 +0,0 @@
1
- import { StandaloneUtil } from '../util/index.js';
2
- export function Runner() {
3
- return function (clazz) {
4
- StandaloneUtil.setMainRunner(clazz);
5
- };
6
- }
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUnVubmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiUnVubmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVsRCxNQUFNLFVBQVUsTUFBTTtJQUNwQixPQUFPLFVBQVMsS0FBeUI7UUFDdkMsY0FBYyxDQUFDLGFBQWEsQ0FBQyxLQUF5QyxDQUFDLENBQUM7SUFDMUUsQ0FBQyxDQUFDO0FBQ0osQ0FBQyJ9
@@ -1 +0,0 @@
1
- export * from './Runner.js';
@@ -1,2 +0,0 @@
1
- export * from './Runner.js';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGFBQWEsQ0FBQyJ9
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './typing.js';
2
- export * from './util/index.js';
3
- export * from './decorator/index.js';
package/src/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from './typing.js';
2
- export * from './util/index.js';
3
- export * from './decorator/index.js';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsc0JBQXNCLENBQUMifQ==
package/src/typing.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export interface MainRunner<T = void> {
2
- main(): Promise<T>;
3
- }
4
- export type MainRunnerClass<T = void> = new () => MainRunner<T>;
package/src/typing.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidHlwaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
@@ -1,6 +0,0 @@
1
- import { MainRunnerClass } from '../typing.js';
2
- export declare class StandaloneUtil {
3
- private static runnerClass;
4
- static setMainRunner(runnerClass: MainRunnerClass): void;
5
- static getMainRunner(): MainRunnerClass | undefined;
6
- }
@@ -1,10 +0,0 @@
1
- export class StandaloneUtil {
2
- static runnerClass;
3
- static setMainRunner(runnerClass) {
4
- StandaloneUtil.runnerClass = runnerClass;
5
- }
6
- static getMainRunner() {
7
- return StandaloneUtil.runnerClass;
8
- }
9
- }
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3RhbmRhbG9uZVV0aWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJTdGFuZGFsb25lVXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLE9BQU8sY0FBYztJQUNqQixNQUFNLENBQUMsV0FBVyxDQUE4QjtJQUV4RCxNQUFNLENBQUMsYUFBYSxDQUFDLFdBQTRCO1FBQy9DLGNBQWMsQ0FBQyxXQUFXLEdBQUcsV0FBVyxDQUFDO0lBQzNDLENBQUM7SUFFRCxNQUFNLENBQUMsYUFBYTtRQUNsQixPQUFPLGNBQWMsQ0FBQyxXQUFXLENBQUM7SUFDcEMsQ0FBQztDQUNGIn0=
@@ -1 +0,0 @@
1
- export * from './StandaloneUtil.js';
package/src/util/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './StandaloneUtil.js';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHFCQUFxQixDQUFDIn0=