@tsed/cli 4.2.2 → 4.2.3

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.
@@ -17,16 +17,7 @@ function fillImports(ctx) {
17
17
  ].filter(Boolean));
18
18
  ctx.imports = [
19
19
  ctx.express && { from: "@tsed/platform-express", comment: " // /!\\ keep this import" },
20
- ctx.express && { symbols: "bodyParser", from: "body-parser" },
21
- ctx.express && { symbols: "compress", from: "compression" },
22
- ctx.express && { symbols: "cookieParser", from: "cookie-parser" },
23
- ctx.express && { symbols: "methodOverride", from: "method-override" },
24
- ctx.express && { symbols: "cors", from: "cors" },
25
20
  ctx.koa && { from: "@tsed/platform-koa", comment: " // /!\\ keep this import" },
26
- ctx.koa && { symbols: "bodyParser", from: "koa-bodyparser" },
27
- ctx.koa && { symbols: "compress", from: "koa-compress" },
28
- ctx.koa && { symbols: "cors", from: "@koa/cors" },
29
- ctx.koa && { symbols: "methodOverride", from: "koa-override", tsIgnore: true },
30
21
  { from: "@tsed/ajv" },
31
22
  ctx.swagger && { from: "@tsed/swagger" },
32
23
  ctx.mongoose && { from: "@tsed/mongoose" },
@@ -1 +1 @@
1
- {"version":3,"file":"fillImports.js","sourceRoot":"","sources":["../../../src/utils/fillImports.ts"],"names":[],"mappings":";;;AAAA,8CAAmE;AAEnE,SAAgB,WAAW,CAAC,GAAQ;IAClC,GAAG,GAAG,EAAC,GAAG,GAAG,EAAC,CAAC;IACf,MAAM,CAAC,MAAM,CAAC,yBAAY,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,KAAK,mCAAsB,CAAC,OAAO,CAAC;IAEtE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAC1B;QACE,SAAS,CAA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W,EAAC;QAC/C,GAAG,CAAC,GAAG,IAAI,EAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAC;QAC5E,EAAC,IAAI,EAAE,WAAW,EAAC;QACnB,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,eAAe,EAAC;QACtC,GAAG,CAAC,QAAQ,IAAI,EAAC,IAAI,EAAE,gBAAgB,EAAC;QACxC,GAAG,CAAC,IAAI,IAAI,EAAC,IAAI,EAAE,qBAAqB,EAAC;QACzC,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,mBAAmB,EAAC;QAC1C,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,qBAAqB,EAAC;QAC5C,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,mBAAmB,EAAC;QAC1C,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAC;QAC7C,EAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,0BAA0B,EAAC;QACrF,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI;YAC3B,OAAO,EAAE,YAAY;YACrB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,2BAA2B;SAChE;QACD,GAAG,CAAC,IAAI,IAAI,EAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,2CAA2C,EAAC;KACrG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,GAAG,CAAC;AACb,CAAC;AA/CD,kCA+CC","sourcesContent":["import {ArchitectureConvention, PlatformType} from \"../interfaces\";\n\nexport function fillImports(ctx: any) {\n ctx = {...ctx};\n Object.values(PlatformType).forEach((type) => {\n ctx[type] = ctx.platform === type;\n });\n\n const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;\n\n ctx.barrels = JSON.stringify(\n [\n isFeature ? \"./src/rest\" : \"./src/controllers/rest\",\n (ctx.swagger || ctx.oidc) && (isFeature ? \"./src/pages\" : \"./src/controllers/pages\"),\n ctx.oidc && \"./src/interactions\",\n ctx.graphql && \"./src/datasources\",\n ctx.graphql && \"./src/resolvers\"\n ].filter(Boolean)\n );\n\n ctx.imports = [\n ctx.express && {from: \"@tsed/platform-express\", comment: \" // /!\\\\ keep this import\"},\n ctx.express && {symbols: \"bodyParser\", from: \"body-parser\"},\n ctx.express && {symbols: \"compress\", from: \"compression\"},\n ctx.express && {symbols: \"cookieParser\", from: \"cookie-parser\"},\n ctx.express && {symbols: \"methodOverride\", from: \"method-override\"},\n ctx.express && {symbols: \"cors\", from: \"cors\"},\n ctx.koa && {from: \"@tsed/platform-koa\", comment: \" // /!\\\\ keep this import\"},\n ctx.koa && {symbols: \"bodyParser\", from: \"koa-bodyparser\"},\n ctx.koa && {symbols: \"compress\", from: \"koa-compress\"},\n ctx.koa && {symbols: \"cors\", from: \"@koa/cors\"},\n ctx.koa && {symbols: \"methodOverride\", from: \"koa-override\", tsIgnore: true},\n {from: \"@tsed/ajv\"},\n ctx.swagger && {from: \"@tsed/swagger\"},\n ctx.mongoose && {from: \"@tsed/mongoose\"},\n ctx.oidc && {from: \"@tsed/oidc-provider\"},\n ctx.graphql && {from: \"@tsed/typegraphql\"},\n ctx.graphql && {from: \"./datasources/index\"},\n ctx.graphql && {from: \"./resolvers/index\"},\n {symbols: \"{config}\", from: \"./config/index\"},\n {symbols: \"* as rest\", from: isFeature ? \"./rest/index\" : \"./controllers/rest/index\"},\n (ctx.swagger || ctx.oidc) && {\n symbols: \"* as pages\",\n from: isFeature ? \"./pages/index\" : \"./controllers/pages/index\"\n },\n ctx.oidc && {symbols: \"{InteractionsController}\", from: \"./controllers/oidc/InteractionsController\"}\n ].filter(Boolean);\n\n return ctx;\n}\n"]}
1
+ {"version":3,"file":"fillImports.js","sourceRoot":"","sources":["../../../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C;QACzC,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,mBAAmB,EAAC;QAC1C,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,qBAAqB,EAAC;QAC5C,GAAG,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,mBAAmB,EAAC;QAC1C,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAC;QAC7C,EAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,0BAA0B,EAAC;QACrF,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI;YAC3B,OAAO,EAAE,YAAY;YACrB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,2BAA2B;SAChE;QACD,GAAG,CAAC,IAAI,IAAI,EAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,2CAA2C,EAAC;KACrG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,GAAG,CAAC;AACb,CAAC;AAtCD,kCAsCC","sourcesContent":["import {ArchitectureConvention, PlatformType} from \"../interfaces\";\n\nexport function fillImports(ctx: any) {\n ctx = {...ctx};\n Object.values(PlatformType).forEach((type) => {\n ctx[type] = ctx.platform === type;\n });\n\n const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;\n\n ctx.barrels = JSON.stringify(\n [\n isFeature ? \"./src/rest\" : \"./src/controllers/rest\",\n (ctx.swagger || ctx.oidc) && (isFeature ? \"./src/pages\" : \"./src/controllers/pages\"),\n ctx.oidc && \"./src/interactions\",\n ctx.graphql && \"./src/datasources\",\n ctx.graphql && \"./src/resolvers\"\n ].filter(Boolean)\n );\n\n ctx.imports = [\n ctx.express && {from: \"@tsed/platform-express\", comment: \" // /!\\\\ keep this import\"},\n ctx.koa && {from: \"@tsed/platform-koa\", comment: \" // /!\\\\ keep this import\"},\n {from: \"@tsed/ajv\"},\n ctx.swagger && {from: \"@tsed/swagger\"},\n ctx.mongoose && {from: \"@tsed/mongoose\"},\n ctx.oidc && {from: \"@tsed/oidc-provider\"},\n ctx.graphql && {from: \"@tsed/typegraphql\"},\n ctx.graphql && {from: \"./datasources/index\"},\n ctx.graphql && {from: \"./resolvers/index\"},\n {symbols: \"{config}\", from: \"./config/index\"},\n {symbols: \"* as rest\", from: isFeature ? \"./rest/index\" : \"./controllers/rest/index\"},\n (ctx.swagger || ctx.oidc) && {\n symbols: \"* as pages\",\n from: isFeature ? \"./pages/index\" : \"./controllers/pages/index\"\n },\n ctx.oidc && {symbols: \"{InteractionsController}\", from: \"./controllers/oidc/InteractionsController\"}\n ].filter(Boolean);\n\n return ctx;\n}\n"]}
@@ -14,16 +14,7 @@ export function fillImports(ctx) {
14
14
  ].filter(Boolean));
15
15
  ctx.imports = [
16
16
  ctx.express && { from: "@tsed/platform-express", comment: " // /!\\ keep this import" },
17
- ctx.express && { symbols: "bodyParser", from: "body-parser" },
18
- ctx.express && { symbols: "compress", from: "compression" },
19
- ctx.express && { symbols: "cookieParser", from: "cookie-parser" },
20
- ctx.express && { symbols: "methodOverride", from: "method-override" },
21
- ctx.express && { symbols: "cors", from: "cors" },
22
17
  ctx.koa && { from: "@tsed/platform-koa", comment: " // /!\\ keep this import" },
23
- ctx.koa && { symbols: "bodyParser", from: "koa-bodyparser" },
24
- ctx.koa && { symbols: "compress", from: "koa-compress" },
25
- ctx.koa && { symbols: "cors", from: "@koa/cors" },
26
- ctx.koa && { symbols: "methodOverride", from: "koa-override", tsIgnore: true },
27
18
  { from: "@tsed/ajv" },
28
19
  ctx.swagger && { from: "@tsed/swagger" },
29
20
  ctx.mongoose && { from: "@tsed/mongoose" },
@@ -1 +1 @@
1
- {"version":3,"file":"fillImports.js","sourceRoot":"","sources":["../../../src/utils/fillImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAE,YAAY,EAAC,MAAM,eA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IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,2BAA2B;SAChE;QACD,GAAG,CAAC,IAAI,IAAI,EAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,2CAA2C,EAAC;KACrG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {ArchitectureConvention, PlatformType} from \"../interfaces\";\n\nexport function fillImports(ctx: any) {\n ctx = {...ctx};\n Object.values(PlatformType).forEach((type) => {\n ctx[type] = ctx.platform === type;\n });\n\n const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;\n\n ctx.barrels = JSON.stringify(\n [\n isFeature ? \"./src/rest\" : \"./src/controllers/rest\",\n (ctx.swagger || ctx.oidc) && (isFeature ? \"./src/pages\" : \"./src/controllers/pages\"),\n ctx.oidc && \"./src/interactions\",\n ctx.graphql && \"./src/datasources\",\n ctx.graphql && \"./src/resolvers\"\n ].filter(Boolean)\n );\n\n ctx.imports = [\n ctx.express && {from: \"@tsed/platform-express\", comment: \" // /!\\\\ keep this import\"},\n ctx.express && {symbols: \"bodyParser\", from: \"body-parser\"},\n ctx.express && {symbols: \"compress\", from: \"compression\"},\n ctx.express && {symbols: \"cookieParser\", from: \"cookie-parser\"},\n ctx.express && {symbols: \"methodOverride\", from: \"method-override\"},\n ctx.express && {symbols: \"cors\", from: \"cors\"},\n ctx.koa && {from: \"@tsed/platform-koa\", comment: \" // /!\\\\ keep this import\"},\n ctx.koa && {symbols: \"bodyParser\", from: \"koa-bodyparser\"},\n ctx.koa && {symbols: \"compress\", from: \"koa-compress\"},\n ctx.koa && {symbols: \"cors\", from: \"@koa/cors\"},\n ctx.koa && {symbols: \"methodOverride\", from: \"koa-override\", tsIgnore: true},\n {from: \"@tsed/ajv\"},\n ctx.swagger && {from: \"@tsed/swagger\"},\n ctx.mongoose && {from: \"@tsed/mongoose\"},\n ctx.oidc && {from: \"@tsed/oidc-provider\"},\n ctx.graphql && {from: \"@tsed/typegraphql\"},\n ctx.graphql && {from: \"./datasources/index\"},\n ctx.graphql && {from: \"./resolvers/index\"},\n {symbols: \"{config}\", from: \"./config/index\"},\n {symbols: \"* as rest\", from: isFeature ? \"./rest/index\" : \"./controllers/rest/index\"},\n (ctx.swagger || ctx.oidc) && {\n symbols: \"* as pages\",\n from: isFeature ? \"./pages/index\" : \"./controllers/pages/index\"\n },\n ctx.oidc && {symbols: \"{InteractionsController}\", from: \"./controllers/oidc/InteractionsController\"}\n ].filter(Boolean);\n\n return ctx;\n}\n"]}
1
+ {"version":3,"file":"fillImports.js","sourceRoot":"","sources":["../../../src/utils/fillImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAEnE,MAAM,UAAU,WAAW,CAAC,GAAQ;IAClC,GAAG,GAAG,EAAC,GAAG,GAAG,EAAC,CAAC;IACf,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,KAAK,sBAAsB,CAAC,OAAO,CAAC;IAEtE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAC1B;QACE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,wBAAwB;QACnD,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,yBAAyB,CAAC;QACpF,GAAG,CAAC,IAAI,IAAI,oBAAoB;QAChC,GAAG,CAAC,OAAO,IAAI,mBAAmB;QAClC,GAAG,CAAC,OAAO,IAAI,iBAAiB;KACjC,CAAC,MAAM,CA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ctx = {...ctx};\n Object.values(PlatformType).forEach((type) => {\n ctx[type] = ctx.platform === type;\n });\n\n const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;\n\n ctx.barrels = JSON.stringify(\n [\n isFeature ? \"./src/rest\" : \"./src/controllers/rest\",\n (ctx.swagger || ctx.oidc) && (isFeature ? \"./src/pages\" : \"./src/controllers/pages\"),\n ctx.oidc && \"./src/interactions\",\n ctx.graphql && \"./src/datasources\",\n ctx.graphql && \"./src/resolvers\"\n ].filter(Boolean)\n );\n\n ctx.imports = [\n ctx.express && {from: \"@tsed/platform-express\", comment: \" // /!\\\\ keep this import\"},\n ctx.koa && {from: \"@tsed/platform-koa\", comment: \" // /!\\\\ keep this import\"},\n {from: \"@tsed/ajv\"},\n ctx.swagger && {from: \"@tsed/swagger\"},\n ctx.mongoose && {from: \"@tsed/mongoose\"},\n ctx.oidc && {from: \"@tsed/oidc-provider\"},\n ctx.graphql && {from: \"@tsed/typegraphql\"},\n ctx.graphql && {from: \"./datasources/index\"},\n ctx.graphql && {from: \"./resolvers/index\"},\n {symbols: \"{config}\", from: \"./config/index\"},\n {symbols: \"* as rest\", from: isFeature ? \"./rest/index\" : \"./controllers/rest/index\"},\n (ctx.swagger || ctx.oidc) && {\n symbols: \"* as pages\",\n from: isFeature ? \"./pages/index\" : \"./controllers/pages/index\"\n },\n ctx.oidc && {symbols: \"{InteractionsController}\", from: \"./controllers/oidc/InteractionsController\"}\n ].filter(Boolean);\n\n return ctx;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/cli",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "source": "./src/index.ts",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -59,7 +59,7 @@
59
59
  "node": ">=14"
60
60
  },
61
61
  "dependencies": {
62
- "@tsed/cli-core": "4.2.2",
62
+ "@tsed/cli-core": "4.2.3",
63
63
  "@tsed/core": ">=7.0.0",
64
64
  "@tsed/di": ">=7.0.0",
65
65
  "@tsed/logger": ">=6.2.1",
@@ -28,18 +28,16 @@ import {PlatformApplication} from "@tsed/common";
28
28
  }
29
29
  ],{{/if}}
30
30
  middlewares: [{{#if express}}
31
- cors(),
32
- cookieParser(),
33
- compress({}),
34
- methodOverride(),
35
- bodyParser.json(),
36
- bodyParser.urlencoded({
37
- extended: true
38
- }){{/if}}{{#if koa}}
39
- cors(),
40
- compress({}),
41
- methodOverride(),
42
- bodyParser(){{/if}}
31
+ "cors",
32
+ "cookie-parser",
33
+ "compression",
34
+ "method-override",
35
+ "json-parser",
36
+ { use: "urlencoded-parser", options: { extended: true }}{{/if}}{{#if koa}}
37
+ "@koa/cors",
38
+ "koa-compress",
39
+ "koa-override",
40
+ "koa-bodyparser"{{/if}}
43
41
  ],
44
42
  views: {
45
43
  root: join(process.cwd(), "../views"),