@kanjijs/cli 0.2.0-beta.11 → 0.2.0-beta.13
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/commands/base.d.ts +4 -0
- package/dist/commands/client.command.d.ts +5 -0
- package/dist/commands/dev.command.d.ts +5 -0
- package/dist/commands/generate.command.d.ts +5 -0
- package/dist/commands/new.command.d.ts +5 -0
- package/dist/commands/openapi.command.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -57
- package/package.json +4 -4
- package/templates/starter/package.json +6 -6
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -4108,7 +4108,7 @@ class ModuleCompiler {
|
|
|
4108
4108
|
const paramTypes = Reflect.getMetadata("design:paramtypes", clazz) || [];
|
|
4109
4109
|
const injectionTokens = MetadataStorage.getInjections(clazz) || new Map;
|
|
4110
4110
|
dependencies = paramTypes.map((t, i) => injectionTokens.get(i) || t);
|
|
4111
|
-
} else if ("useFactory" in provider
|
|
4111
|
+
} else if ("useFactory" in provider) {
|
|
4112
4112
|
targetName = provider.provide?.name || String(provider.provide);
|
|
4113
4113
|
dependencies = provider.inject || [];
|
|
4114
4114
|
}
|
|
@@ -5595,7 +5595,7 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
5595
5595
|
enumerable: true
|
|
5596
5596
|
});
|
|
5597
5597
|
return to;
|
|
5598
|
-
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), require_Reflect, import_reflect_metadata, methodMetadataStore, controllerMetadataStore, moduleMetadataStore, injectionMetadataStore, MetadataStorage, Get, Post, Put, Delete, Patch, import_reflect_metadata2, KanjijsIoC, kanjijsContext, GLOBAL_MIDDLEWARE_TOKEN, ignoreOverride, defaultOptions, getDefaultOptions = (options) => typeof options === "string" ? {
|
|
5598
|
+
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), require_Reflect, import_reflect_metadata, methodMetadataStore, controllerMetadataStore, moduleMetadataStore, injectionMetadataStore, globalStore, MetadataStorage, Get, Post, Put, Delete, Patch, import_reflect_metadata2, KanjijsIoC, kanjijsContext, GLOBAL_MIDDLEWARE_TOKEN, ignoreOverride, defaultOptions, getDefaultOptions = (options) => typeof options === "string" ? {
|
|
5599
5599
|
...defaultOptions,
|
|
5600
5600
|
name: options
|
|
5601
5601
|
} : {
|
|
@@ -7064,69 +7064,73 @@ var init_dist = __esm(() => {
|
|
|
7064
7064
|
controllerMetadataStore = new WeakMap;
|
|
7065
7065
|
moduleMetadataStore = new WeakMap;
|
|
7066
7066
|
injectionMetadataStore = new WeakMap;
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
methods =
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
methods = new Map;
|
|
7081
|
-
methodMetadataStore.set(target, methods);
|
|
7082
|
-
}
|
|
7083
|
-
const existing = methods.get(methodName) || {};
|
|
7084
|
-
existing.contract = contract;
|
|
7085
|
-
methods.set(methodName, existing);
|
|
7086
|
-
},
|
|
7087
|
-
addMiddleware(target, middleware, methodName) {
|
|
7088
|
-
if (methodName) {
|
|
7067
|
+
globalStore = globalThis;
|
|
7068
|
+
if (!globalStore.KANJI_METADATA_STORAGE) {
|
|
7069
|
+
globalStore.KANJI_METADATA_STORAGE = {
|
|
7070
|
+
addRoute(target, methodName, meta) {
|
|
7071
|
+
let methods = methodMetadataStore.get(target);
|
|
7072
|
+
if (!methods) {
|
|
7073
|
+
methods = new Map;
|
|
7074
|
+
methodMetadataStore.set(target, methods);
|
|
7075
|
+
}
|
|
7076
|
+
const existing = methods.get(methodName) || {};
|
|
7077
|
+
methods.set(methodName, { ...existing, ...meta });
|
|
7078
|
+
},
|
|
7079
|
+
addContract(target, methodName, contract) {
|
|
7089
7080
|
let methods = methodMetadataStore.get(target);
|
|
7090
7081
|
if (!methods) {
|
|
7091
7082
|
methods = new Map;
|
|
7092
7083
|
methodMetadataStore.set(target, methods);
|
|
7093
7084
|
}
|
|
7094
7085
|
const existing = methods.get(methodName) || {};
|
|
7095
|
-
existing.
|
|
7086
|
+
existing.contract = contract;
|
|
7096
7087
|
methods.set(methodName, existing);
|
|
7097
|
-
}
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7088
|
+
},
|
|
7089
|
+
addMiddleware(target, middleware, methodName) {
|
|
7090
|
+
if (methodName) {
|
|
7091
|
+
let methods = methodMetadataStore.get(target);
|
|
7092
|
+
if (!methods) {
|
|
7093
|
+
methods = new Map;
|
|
7094
|
+
methodMetadataStore.set(target, methods);
|
|
7095
|
+
}
|
|
7096
|
+
const existing = methods.get(methodName) || {};
|
|
7097
|
+
existing.middlewares = [...existing.middlewares || [], middleware];
|
|
7098
|
+
methods.set(methodName, existing);
|
|
7099
|
+
} else {
|
|
7100
|
+
const existing = controllerMetadataStore.get(target) || { prefix: "/" };
|
|
7101
|
+
existing.middlewares = [...existing.middlewares || [], middleware];
|
|
7102
|
+
controllerMetadataStore.set(target, existing);
|
|
7103
|
+
}
|
|
7104
|
+
},
|
|
7105
|
+
getRoutes(target) {
|
|
7106
|
+
return methodMetadataStore.get(target);
|
|
7107
|
+
},
|
|
7108
|
+
setController(target, meta) {
|
|
7109
|
+
controllerMetadataStore.set(target, meta);
|
|
7110
|
+
},
|
|
7111
|
+
getController(target) {
|
|
7112
|
+
return controllerMetadataStore.get(target);
|
|
7113
|
+
},
|
|
7114
|
+
defineModule(target, meta) {
|
|
7115
|
+
moduleMetadataStore.set(target, meta);
|
|
7116
|
+
},
|
|
7117
|
+
getModule(target) {
|
|
7118
|
+
return moduleMetadataStore.get(target);
|
|
7119
|
+
},
|
|
7120
|
+
addInjection(target, index, token) {
|
|
7121
|
+
let injections = injectionMetadataStore.get(target);
|
|
7122
|
+
if (!injections) {
|
|
7123
|
+
injections = new Map;
|
|
7124
|
+
injectionMetadataStore.set(target, injections);
|
|
7125
|
+
}
|
|
7126
|
+
injections.set(index, token);
|
|
7127
|
+
},
|
|
7128
|
+
getInjections(target) {
|
|
7129
|
+
return injectionMetadataStore.get(target);
|
|
7123
7130
|
}
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
return injectionMetadataStore.get(target);
|
|
7128
|
-
}
|
|
7129
|
-
};
|
|
7131
|
+
};
|
|
7132
|
+
}
|
|
7133
|
+
MetadataStorage = globalStore.KANJI_METADATA_STORAGE;
|
|
7130
7134
|
Get = createMethodDecorator("GET");
|
|
7131
7135
|
Post = createMethodDecorator("POST");
|
|
7132
7136
|
Put = createMethodDecorator("PUT");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanjijs/cli",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kanji": "./dist/index.js"
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"templates"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "bun build src/index.ts --outdir dist --target bun",
|
|
16
|
-
"watch": "bun build src/index.ts --outdir dist --target bun --watch"
|
|
15
|
+
"build": "bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
16
|
+
"watch": "bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist --watch"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@inquirer/prompts": "^8.2.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"fs-extra": "^11.3.3",
|
|
22
22
|
"picocolors": "^1.1.1",
|
|
23
23
|
"openapi-typescript-codegen": "^0.25.0",
|
|
24
|
-
"@kanjijs/openapi": "^0.2.0-beta.
|
|
24
|
+
"@kanjijs/openapi": "^0.2.0-beta.13"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/fs-extra": "^11.0.4"
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"start": "bun run src/main.ts"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@kanjijs/core": "^0.2.0-beta.
|
|
11
|
-
"@kanjijs/platform-bun": "^0.2.0-beta.
|
|
12
|
-
"@kanjijs/platform-hono": "^0.2.0-beta.
|
|
13
|
-
"@kanjijs/auth": "^0.2.0-beta.
|
|
14
|
-
"@kanjijs/logger": "^0.2.0-beta.
|
|
15
|
-
"@kanjijs/throttler": "^0.2.0-beta.
|
|
10
|
+
"@kanjijs/core": "^0.2.0-beta.13",
|
|
11
|
+
"@kanjijs/platform-bun": "^0.2.0-beta.13",
|
|
12
|
+
"@kanjijs/platform-hono": "^0.2.0-beta.13",
|
|
13
|
+
"@kanjijs/auth": "^0.2.0-beta.13",
|
|
14
|
+
"@kanjijs/logger": "^0.2.0-beta.13",
|
|
15
|
+
"@kanjijs/throttler": "^0.2.0-beta.13",
|
|
16
16
|
"hono": "^4.0.0",
|
|
17
17
|
"reflect-metadata": "^0.2.0",
|
|
18
18
|
"zod": "^3.0.0"
|