@tsed/cli-plugin-typegraphql 3.20.16 → 3.21.0-rc.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/lib/{TypeGraphqlModule.js → cjs/TypeGraphqlModule.js} +0 -0
- package/lib/cjs/TypeGraphqlModule.js.map +1 -0
- package/lib/{hooks → cjs/hooks}/TypeGraphqlInitHook.js +0 -0
- package/lib/cjs/hooks/TypeGraphqlInitHook.js.map +1 -0
- package/lib/{index.js → cjs/index.js} +1 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/utils/templateDir.js +13 -0
- package/lib/cjs/utils/templateDir.js.map +1 -0
- package/lib/esm/TypeGraphqlModule.js +38 -0
- package/lib/esm/TypeGraphqlModule.js.map +1 -0
- package/lib/esm/hooks/TypeGraphqlInitHook.js +46 -0
- package/lib/esm/hooks/TypeGraphqlInitHook.js.map +1 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/templateDir.js +9 -0
- package/lib/esm/utils/templateDir.js.map +1 -0
- package/lib/{TypeGraphqlModule.d.ts → types/TypeGraphqlModule.d.ts} +0 -0
- package/lib/{hooks → types/hooks}/TypeGraphqlInitHook.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +1 -0
- package/lib/{utils → types/utils}/templateDir.d.ts +0 -0
- package/package.json +22 -10
- package/lib/TypeGraphqlModule.js.map +0 -1
- package/lib/hooks/TypeGraphqlInitHook.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/utils/templateDir.js +0 -6
- package/lib/utils/templateDir.js.map +0 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGraphqlModule.js","sourceRoot":"","sources":["../../src/TypeGraphqlModule.ts"],"names":[],"mappings":";;;;AAAA,6CAAiE;AACjE,iCAAgC;AAChC,qEAAgE;AAKhE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAK5B,OAAO,CAAC,GAAQ;QACd,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B;YACE,mBAAmB,EAAE,iBAAiB;YACtC,mBAAmB,EAAE,QAAQ;YAC7B,wBAAwB,EAAE,QAAQ;YAClC,oBAAoB,EAAE,QAAQ;YAC9B,cAAc,EAAE,QAAQ;YACxB,iBAAiB,EAAE,SAAS;YAC5B,OAAO,EAAE,SAAS;SACnB,EACD,GAAG,CACJ,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,kBAAkB,CACjC;YACE,kBAAkB,EAAE,QAAQ;YAC5B,uBAAuB,EAAE,QAAQ;SAClC,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAxBC;IADC,IAAA,WAAM,GAAE;sCACI,6BAAkB;sDAAC;AAGhC;IADC,IAAA,gBAAK,EAAC,8BAA8B,CAAC;;;;gDAqBrC;AAzBU,iBAAiB;IAH7B,IAAA,iBAAM,EAAC;QACN,OAAO,EAAE,CAAC,yCAAmB,CAAC;KAC/B,CAAC;GACW,iBAAiB,CA0B7B;AA1BY,8CAAiB","sourcesContent":["import {Module, OnAdd, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Inject} from \"@tsed/di\";\nimport {TypeGraphqlInitHook} from \"./hooks/TypeGraphqlInitHook\";\n\n@Module({\n imports: [TypeGraphqlInitHook]\n})\nexport class TypeGraphqlModule {\n @Inject()\n packageJson: ProjectPackageJson;\n\n @OnAdd(\"@tsed/cli-plugin-typegraphql\")\n install(ctx: any) {\n this.packageJson.addDependencies(\n {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\",\n \"apollo-datasource\": \"^3.3.1\",\n \"apollo-datasource-rest\": \"^3.5.1\",\n \"apollo-server-core\": \"^3.6.2\",\n \"type-graphql\": \"^1.1.1\",\n \"class-validator\": \"^0.13.2\",\n graphql: \"^15.7.2\"\n },\n ctx\n );\n this.packageJson.addDevDependencies(\n {\n \"@types/validator\": \"latest\",\n \"apollo-server-testing\": \"latest\"\n },\n ctx\n );\n }\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGraphqlInitHook.js","sourceRoot":"","sources":["../../../src/hooks/TypeGraphqlInitHook.ts"],"names":[],"mappings":";;;;AACA,6CAA2G;AAC3G,iCAAoC;AACpC,sDAAkD;AAGlD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAW9B,MAAM,CAAC,GAAmB;QACxB,OAAO;YACL;gBACE,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,KAAK,IAAI,EAAE,CACf,IAAI,CAAC,YAAY,CAAC,SAAS,CACzB;oBACE,2BAA2B;oBAC3B,kCAAkC;oBAClC,kCAAkC;oBAClC,+CAA+C;oBAC/C,0CAA0C;oBAC1C,yBAAyB;iBAC1B,EACD,GAAG,EACH;oBACE,WAAW,EAAE,GAAG,0BAAY,OAAO;iBACpC,CACF;aACJ;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA/BC;IADC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;wDAAC;AAG1C;IADC,IAAA,iBAAM,GAAE;sCACe,8BAAmB;yDAAC;AAG5C;IADC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;wDAAC;AAG1C;IADC,IAAA,iBAAM,EAAC,MAAM,CAAC;;;;iDAsBd;AAhCU,mBAAmB;IAD/B,IAAA,eAAU,GAAE;GACA,mBAAmB,CAiC/B;AAjCY,kDAAmB","sourcesContent":["import {InitCmdContext} from \"@tsed/cli\";\nimport {Inject, OnExec, ProjectPackageJson, RootRendererService, SrcRendererService} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\nimport {TEMPLATE_DIR} from \"../utils/templateDir\";\n\n@Injectable()\nexport class TypeGraphqlInitHook {\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @Inject()\n protected rootRenderer: RootRendererService;\n\n @Inject()\n protected srcRenderer: SrcRendererService;\n\n @OnExec(\"init\")\n onExec(ctx: InitCmdContext) {\n return [\n {\n title: \"Generate files\",\n task: async () =>\n this.rootRenderer.renderAll(\n [\n \"/src/datasources/index.ts\",\n \"/src/datasources/MyDataSource.ts\",\n \"/src/resolvers/recipes/Recipe.ts\",\n \"/src/resolvers/recipes/RecipeNotFoundError.ts\",\n \"/src/resolvers/recipes/RecipeResolver.ts\",\n \"/src/resolvers/index.ts\"\n ],\n ctx,\n {\n templateDir: `${TEMPLATE_DIR}/init`\n }\n )\n }\n ];\n }\n}\n"]}
|
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const TypeGraphqlModule_1 = require("./TypeGraphqlModule");
|
|
5
5
|
tslib_1.__exportStar(require("./hooks/TypeGraphqlInitHook"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./utils/templateDir"), exports);
|
|
6
7
|
exports.default = TypeGraphqlModule_1.TypeGraphqlModule;
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,sEAA4C;AAC5C,8DAAoC;AAEpC,kBAAe,qCAAiB,CAAC","sourcesContent":["import {TypeGraphqlModule} from \"./TypeGraphqlModule\";\n\nexport * from \"./hooks/TypeGraphqlInitHook\";\nexport * from \"./utils/templateDir\";\n\nexport default TypeGraphqlModule;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEMPLATE_DIR = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const read_pkg_up_1 = tslib_1.__importDefault(require("read-pkg-up"));
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const filedirname_1 = tslib_1.__importDefault(require("filedirname"));
|
|
8
|
+
const [, dir] = (0, filedirname_1.default)();
|
|
9
|
+
const { path } = read_pkg_up_1.default.sync({
|
|
10
|
+
cwd: dir
|
|
11
|
+
});
|
|
12
|
+
exports.TEMPLATE_DIR = (0, path_1.join)((0, path_1.dirname)(path), "templates");
|
|
13
|
+
//# sourceMappingURL=templateDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":";;;;AAAA,sEAAoC;AACpC,+BAAmC;AACnC,sEAAsC;AACtC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,IAAA,qBAAW,GAAE,CAAC;AAE9B,MAAM,EAAC,IAAI,EAAC,GAAG,qBAAS,CAAC,IAAI,CAAC;IAC5B,GAAG,EAAE,GAAG;CACT,CAAE,CAAC;AAES,QAAA,YAAY,GAAG,IAAA,WAAI,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import readPkgUp from \"read-pkg-up\";\nimport {dirname, join} from \"path\";\nimport filedirname from \"filedirname\";\nconst [, dir] = filedirname();\n\nconst {path} = readPkgUp.sync({\n cwd: dir\n})!;\n\nexport const TEMPLATE_DIR = join(dirname(path), \"templates\");\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Module, OnAdd, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
|
+
import { Inject } from "@tsed/di";
|
|
4
|
+
import { TypeGraphqlInitHook } from "./hooks/TypeGraphqlInitHook.js";
|
|
5
|
+
let TypeGraphqlModule = class TypeGraphqlModule {
|
|
6
|
+
install(ctx) {
|
|
7
|
+
this.packageJson.addDependencies({
|
|
8
|
+
"@tsed/typegraphql": "{{tsedVersion}}",
|
|
9
|
+
"apollo-datasource": "^3.3.1",
|
|
10
|
+
"apollo-datasource-rest": "^3.5.1",
|
|
11
|
+
"apollo-server-core": "^3.6.2",
|
|
12
|
+
"type-graphql": "^1.1.1",
|
|
13
|
+
"class-validator": "^0.13.2",
|
|
14
|
+
graphql: "^15.7.2"
|
|
15
|
+
}, ctx);
|
|
16
|
+
this.packageJson.addDevDependencies({
|
|
17
|
+
"@types/validator": "latest",
|
|
18
|
+
"apollo-server-testing": "latest"
|
|
19
|
+
}, ctx);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
Inject(),
|
|
24
|
+
__metadata("design:type", ProjectPackageJson)
|
|
25
|
+
], TypeGraphqlModule.prototype, "packageJson", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
OnAdd("@tsed/cli-plugin-typegraphql"),
|
|
28
|
+
__metadata("design:type", Function),
|
|
29
|
+
__metadata("design:paramtypes", [Object]),
|
|
30
|
+
__metadata("design:returntype", void 0)
|
|
31
|
+
], TypeGraphqlModule.prototype, "install", null);
|
|
32
|
+
TypeGraphqlModule = __decorate([
|
|
33
|
+
Module({
|
|
34
|
+
imports: [TypeGraphqlInitHook]
|
|
35
|
+
})
|
|
36
|
+
], TypeGraphqlModule);
|
|
37
|
+
export { TypeGraphqlModule };
|
|
38
|
+
//# sourceMappingURL=TypeGraphqlModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGraphqlModule.js","sourceRoot":"","sources":["../../src/TypeGraphqlModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAKhE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAK5B,OAAO,CAAC,GAAQ;QACd,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B;YACE,mBAAmB,EAAE,iBAAiB;YACtC,mBAAmB,EAAE,QAAQ;YAC7B,wBAAwB,EAAE,QAAQ;YAClC,oBAAoB,EAAE,QAAQ;YAC9B,cAAc,EAAE,QAAQ;YACxB,iBAAiB,EAAE,SAAS;YAC5B,OAAO,EAAE,SAAS;SACnB,EACD,GAAG,CACJ,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,kBAAkB,CACjC;YACE,kBAAkB,EAAE,QAAQ;YAC5B,uBAAuB,EAAE,QAAQ;SAClC,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAxBC;IADC,MAAM,EAAE;8BACI,kBAAkB;sDAAC;AAGhC;IADC,KAAK,CAAC,8BAA8B,CAAC;;;;gDAqBrC;AAzBU,iBAAiB;IAH7B,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,mBAAmB,CAAC;KAC/B,CAAC;GACW,iBAAiB,CA0B7B;SA1BY,iBAAiB","sourcesContent":["import {Module, OnAdd, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Inject} from \"@tsed/di\";\nimport {TypeGraphqlInitHook} from \"./hooks/TypeGraphqlInitHook\";\n\n@Module({\n imports: [TypeGraphqlInitHook]\n})\nexport class TypeGraphqlModule {\n @Inject()\n packageJson: ProjectPackageJson;\n\n @OnAdd(\"@tsed/cli-plugin-typegraphql\")\n install(ctx: any) {\n this.packageJson.addDependencies(\n {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\",\n \"apollo-datasource\": \"^3.3.1\",\n \"apollo-datasource-rest\": \"^3.5.1\",\n \"apollo-server-core\": \"^3.6.2\",\n \"type-graphql\": \"^1.1.1\",\n \"class-validator\": \"^0.13.2\",\n graphql: \"^15.7.2\"\n },\n ctx\n );\n this.packageJson.addDevDependencies(\n {\n \"@types/validator\": \"latest\",\n \"apollo-server-testing\": \"latest\"\n },\n ctx\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Inject, OnExec, ProjectPackageJson, RootRendererService, SrcRendererService } from "@tsed/cli-core";
|
|
3
|
+
import { Injectable } from "@tsed/di";
|
|
4
|
+
import { TEMPLATE_DIR } from "../utils/templateDir.js";
|
|
5
|
+
let TypeGraphqlInitHook = class TypeGraphqlInitHook {
|
|
6
|
+
onExec(ctx) {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
title: "Generate files",
|
|
10
|
+
task: async () => this.rootRenderer.renderAll([
|
|
11
|
+
"/src/datasources/index.ts",
|
|
12
|
+
"/src/datasources/MyDataSource.ts",
|
|
13
|
+
"/src/resolvers/recipes/Recipe.ts",
|
|
14
|
+
"/src/resolvers/recipes/RecipeNotFoundError.ts",
|
|
15
|
+
"/src/resolvers/recipes/RecipeResolver.ts",
|
|
16
|
+
"/src/resolvers/index.ts"
|
|
17
|
+
], ctx, {
|
|
18
|
+
templateDir: `${TEMPLATE_DIR}/init`
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
Inject(),
|
|
26
|
+
__metadata("design:type", ProjectPackageJson)
|
|
27
|
+
], TypeGraphqlInitHook.prototype, "packageJson", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Inject(),
|
|
30
|
+
__metadata("design:type", RootRendererService)
|
|
31
|
+
], TypeGraphqlInitHook.prototype, "rootRenderer", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Inject(),
|
|
34
|
+
__metadata("design:type", SrcRendererService)
|
|
35
|
+
], TypeGraphqlInitHook.prototype, "srcRenderer", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
OnExec("init"),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", [Object]),
|
|
40
|
+
__metadata("design:returntype", void 0)
|
|
41
|
+
], TypeGraphqlInitHook.prototype, "onExec", null);
|
|
42
|
+
TypeGraphqlInitHook = __decorate([
|
|
43
|
+
Injectable()
|
|
44
|
+
], TypeGraphqlInitHook);
|
|
45
|
+
export { TypeGraphqlInitHook };
|
|
46
|
+
//# sourceMappingURL=TypeGraphqlInitHook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGraphqlInitHook.js","sourceRoot":"","sources":["../../../src/hooks/TypeGraphqlInitHook.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAC3G,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAGlD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAW9B,MAAM,CAAC,GAAmB;QACxB,OAAO;YACL;gBACE,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,KAAK,IAAI,EAAE,CACf,IAAI,CAAC,YAAY,CAAC,SAAS,CACzB;oBACE,2BAA2B;oBAC3B,kCAAkC;oBAClC,kCAAkC;oBAClC,+CAA+C;oBAC/C,0CAA0C;oBAC1C,yBAAyB;iBAC1B,EACD,GAAG,EACH;oBACE,WAAW,EAAE,GAAG,YAAY,OAAO;iBACpC,CACF;aACJ;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA/BC;IADC,MAAM,EAAE;8BACc,kBAAkB;wDAAC;AAG1C;IADC,MAAM,EAAE;8BACe,mBAAmB;yDAAC;AAG5C;IADC,MAAM,EAAE;8BACc,kBAAkB;wDAAC;AAG1C;IADC,MAAM,CAAC,MAAM,CAAC;;;;iDAsBd;AAhCU,mBAAmB;IAD/B,UAAU,EAAE;GACA,mBAAmB,CAiC/B;SAjCY,mBAAmB","sourcesContent":["import {InitCmdContext} from \"@tsed/cli\";\nimport {Inject, OnExec, ProjectPackageJson, RootRendererService, SrcRendererService} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\nimport {TEMPLATE_DIR} from \"../utils/templateDir\";\n\n@Injectable()\nexport class TypeGraphqlInitHook {\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @Inject()\n protected rootRenderer: RootRendererService;\n\n @Inject()\n protected srcRenderer: SrcRendererService;\n\n @OnExec(\"init\")\n onExec(ctx: InitCmdContext) {\n return [\n {\n title: \"Generate files\",\n task: async () =>\n this.rootRenderer.renderAll(\n [\n \"/src/datasources/index.ts\",\n \"/src/datasources/MyDataSource.ts\",\n \"/src/resolvers/recipes/Recipe.ts\",\n \"/src/resolvers/recipes/RecipeNotFoundError.ts\",\n \"/src/resolvers/recipes/RecipeResolver.ts\",\n \"/src/resolvers/index.ts\"\n ],\n ctx,\n {\n templateDir: `${TEMPLATE_DIR}/init`\n }\n )\n }\n ];\n }\n}\n"]}
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAEpC,eAAe,iBAAiB,CAAC","sourcesContent":["import {TypeGraphqlModule} from \"./TypeGraphqlModule\";\n\nexport * from \"./hooks/TypeGraphqlInitHook\";\nexport * from \"./utils/templateDir\";\n\nexport default TypeGraphqlModule;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import readPkgUp from "read-pkg-up";
|
|
2
|
+
import { dirname, join } from "path";
|
|
3
|
+
import filedirname from "filedirname";
|
|
4
|
+
const [, dir] = filedirname();
|
|
5
|
+
const { path } = readPkgUp.sync({
|
|
6
|
+
cwd: dir
|
|
7
|
+
});
|
|
8
|
+
export const TEMPLATE_DIR = join(dirname(path), "templates");
|
|
9
|
+
//# sourceMappingURL=templateDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,MAAM,CAAC;AACnC,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,WAAW,EAAE,CAAC;AAE9B,MAAM,EAAC,IAAI,EAAC,GAAG,SAAS,CAAC,IAAI,CAAC;IAC5B,GAAG,EAAE,GAAG;CACT,CAAE,CAAC;AAEJ,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import readPkgUp from \"read-pkg-up\";\nimport {dirname, join} from \"path\";\nimport filedirname from \"filedirname\";\nconst [, dir] = filedirname();\n\nconst {path} = readPkgUp.sync({\n cwd: dir\n})!;\n\nexport const TEMPLATE_DIR = join(dirname(path), \"templates\");\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-plugin-typegraphql",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"main": "./lib/index.js",
|
|
5
|
-
"typings": "./lib/index.d.ts",
|
|
3
|
+
"version": "3.21.0-rc.2",
|
|
6
4
|
"description": "Ts.ED CLI plugin. Add TypeGraphql support.",
|
|
5
|
+
"source": "./src/index.ts",
|
|
6
|
+
"main": "./lib/cjs/index.js",
|
|
7
|
+
"module": "./lib/esm/index.js",
|
|
8
|
+
"typings": "./lib/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"import": "./lib/esm/index.js",
|
|
12
|
+
"require": "./lib/cjs/index.js",
|
|
13
|
+
"default": "./lib/esm/index.js"
|
|
14
|
+
},
|
|
7
15
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"build:
|
|
16
|
+
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
10
19
|
},
|
|
11
20
|
"files": [
|
|
12
21
|
"lib",
|
|
@@ -16,12 +25,12 @@
|
|
|
16
25
|
"tslib": "2.3.1"
|
|
17
26
|
},
|
|
18
27
|
"devDependencies": {
|
|
19
|
-
"@tsed/cli": "3.
|
|
20
|
-
"@tsed/cli-core": "3.
|
|
28
|
+
"@tsed/cli": "3.21.0-rc.2",
|
|
29
|
+
"@tsed/cli-core": "3.21.0-rc.2"
|
|
21
30
|
},
|
|
22
31
|
"peerDependencies": {
|
|
23
|
-
"@tsed/cli": "^3.
|
|
24
|
-
"@tsed/cli-core": "^3.
|
|
32
|
+
"@tsed/cli": "^3.21.0-rc.2",
|
|
33
|
+
"@tsed/cli-core": "^3.21.0-rc.2"
|
|
25
34
|
},
|
|
26
35
|
"repository": "https://github.com/tsedio/tsed-cli",
|
|
27
36
|
"bugs": {
|
|
@@ -29,5 +38,8 @@
|
|
|
29
38
|
},
|
|
30
39
|
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-plugin-typegraphql",
|
|
31
40
|
"author": "Romain Lenzotti",
|
|
32
|
-
"license": "MIT"
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"tag": "rc"
|
|
44
|
+
}
|
|
33
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypeGraphqlModule.js","sourceRoot":"","sources":["../src/TypeGraphqlModule.ts"],"names":[],"mappings":";;;;AAAA,6CAAiE;AACjE,iCAAgC;AAChC,qEAAgE;AAKhE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAK5B,OAAO,CAAC,GAAQ;QACd,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B;YACE,mBAAmB,EAAE,iBAAiB;YACtC,mBAAmB,EAAE,QAAQ;YAC7B,wBAAwB,EAAE,QAAQ;YAClC,oBAAoB,EAAE,QAAQ;YAC9B,cAAc,EAAE,QAAQ;YACxB,iBAAiB,EAAE,SAAS;YAC5B,OAAO,EAAE,SAAS;SACnB,EACD,GAAG,CACJ,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,kBAAkB,CACjC;YACE,kBAAkB,EAAE,QAAQ;YAC5B,uBAAuB,EAAE,QAAQ;SAClC,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAxBC;IADC,IAAA,WAAM,GAAE;sCACI,6BAAkB;sDAAC;AAGhC;IADC,IAAA,gBAAK,EAAC,8BAA8B,CAAC;;;;gDAqBrC;AAzBU,iBAAiB;IAH7B,IAAA,iBAAM,EAAC;QACN,OAAO,EAAE,CAAC,yCAAmB,CAAC;KAC/B,CAAC;GACW,iBAAiB,CA0B7B;AA1BY,8CAAiB","sourcesContent":["import {Module, OnAdd, ProjectPackageJson} from \"@tsed/cli-core\";\nimport {Inject} from \"@tsed/di\";\nimport {TypeGraphqlInitHook} from \"./hooks/TypeGraphqlInitHook\";\n\n@Module({\n imports: [TypeGraphqlInitHook]\n})\nexport class TypeGraphqlModule {\n @Inject()\n packageJson: ProjectPackageJson;\n\n @OnAdd(\"@tsed/cli-plugin-typegraphql\")\n install(ctx: any) {\n this.packageJson.addDependencies(\n {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\",\n \"apollo-datasource\": \"^3.3.1\",\n \"apollo-datasource-rest\": \"^3.5.1\",\n \"apollo-server-core\": \"^3.6.2\",\n \"type-graphql\": \"^1.1.1\",\n \"class-validator\": \"^0.13.2\",\n graphql: \"^15.7.2\"\n },\n ctx\n );\n this.packageJson.addDevDependencies(\n {\n \"@types/validator\": \"latest\",\n \"apollo-server-testing\": \"latest\"\n },\n ctx\n );\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypeGraphqlInitHook.js","sourceRoot":"","sources":["../../src/hooks/TypeGraphqlInitHook.ts"],"names":[],"mappings":";;;;AACA,6CAA2G;AAC3G,iCAAoC;AACpC,sDAAkD;AAGlD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAW9B,MAAM,CAAC,GAAmB;QACxB,OAAO;YACL;gBACE,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,KAAK,IAAI,EAAE,CACf,IAAI,CAAC,YAAY,CAAC,SAAS,CACzB;oBACE,2BAA2B;oBAC3B,kCAAkC;oBAClC,kCAAkC;oBAClC,+CAA+C;oBAC/C,0CAA0C;oBAC1C,yBAAyB;iBAC1B,EACD,GAAG,EACH;oBACE,WAAW,EAAE,GAAG,0BAAY,OAAO;iBACpC,CACF;aACJ;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA/BC;IADC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;wDAAC;AAG1C;IADC,IAAA,iBAAM,GAAE;sCACe,8BAAmB;yDAAC;AAG5C;IADC,IAAA,iBAAM,GAAE;sCACc,6BAAkB;wDAAC;AAG1C;IADC,IAAA,iBAAM,EAAC,MAAM,CAAC;;;;iDAsBd;AAhCU,mBAAmB;IAD/B,IAAA,eAAU,GAAE;GACA,mBAAmB,CAiC/B;AAjCY,kDAAmB","sourcesContent":["import {InitCmdContext} from \"@tsed/cli\";\nimport {Inject, OnExec, ProjectPackageJson, RootRendererService, SrcRendererService} from \"@tsed/cli-core\";\nimport {Injectable} from \"@tsed/di\";\nimport {TEMPLATE_DIR} from \"../utils/templateDir\";\n\n@Injectable()\nexport class TypeGraphqlInitHook {\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @Inject()\n protected rootRenderer: RootRendererService;\n\n @Inject()\n protected srcRenderer: SrcRendererService;\n\n @OnExec(\"init\")\n onExec(ctx: InitCmdContext) {\n return [\n {\n title: \"Generate files\",\n task: async () =>\n this.rootRenderer.renderAll(\n [\n \"/src/datasources/index.ts\",\n \"/src/datasources/MyDataSource.ts\",\n \"/src/resolvers/recipes/Recipe.ts\",\n \"/src/resolvers/recipes/RecipeNotFoundError.ts\",\n \"/src/resolvers/recipes/RecipeResolver.ts\",\n \"/src/resolvers/index.ts\"\n ],\n ctx,\n {\n templateDir: `${TEMPLATE_DIR}/init`\n }\n )\n }\n ];\n }\n}\n"]}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,sEAA4C;AAE5C,kBAAe,qCAAiB,CAAC","sourcesContent":["import {TypeGraphqlModule} from \"./TypeGraphqlModule\";\n\nexport * from \"./hooks/TypeGraphqlInitHook\";\n\nexport default TypeGraphqlModule;\n"]}
|
package/lib/utils/templateDir.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../src/utils/templateDir.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAEhB,QAAA,YAAY,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import {resolve} from \"path\";\n\nexport const TEMPLATE_DIR = resolve(__dirname, \"..\", \"..\", \"templates\");\n"]}
|