@feathersjs/cli 5.0.0-pre.25 → 5.0.0-pre.28

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/lib/app/index.js +1 -1
  3. package/lib/app/index.js.map +1 -1
  4. package/lib/app/index.ts +1 -1
  5. package/lib/app/templates/app.tpl.js +2 -2
  6. package/lib/app/templates/app.tpl.ts +2 -2
  7. package/lib/app/templates/client.tpl.js +1 -1
  8. package/lib/app/templates/client.tpl.ts +1 -1
  9. package/lib/app/templates/configuration.tpl.js +23 -20
  10. package/lib/app/templates/configuration.tpl.js.map +1 -1
  11. package/lib/app/templates/configuration.tpl.ts +23 -20
  12. package/lib/app/templates/declarations.tpl.js +3 -2
  13. package/lib/app/templates/declarations.tpl.js.map +1 -1
  14. package/lib/app/templates/declarations.tpl.ts +3 -2
  15. package/lib/app/templates/package.json.tpl.js +5 -4
  16. package/lib/app/templates/package.json.tpl.js.map +1 -1
  17. package/lib/app/templates/package.json.tpl.ts +5 -4
  18. package/lib/app/templates/prettierrc.tpl.d.ts +2 -0
  19. package/lib/app/templates/prettierrc.tpl.js +11 -0
  20. package/lib/app/templates/prettierrc.tpl.js.map +1 -0
  21. package/lib/app/templates/prettierrc.tpl.ts +14 -0
  22. package/lib/app/templates/tsconfig.json.tpl.js +1 -0
  23. package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
  24. package/lib/app/templates/tsconfig.json.tpl.ts +1 -0
  25. package/lib/authentication/index.d.ts +0 -2
  26. package/lib/authentication/templates/authentication.tpl.js +3 -3
  27. package/lib/authentication/templates/authentication.tpl.js.map +1 -1
  28. package/lib/authentication/templates/authentication.tpl.ts +5 -5
  29. package/lib/authentication/templates/declarations.tpl.js +1 -1
  30. package/lib/authentication/templates/declarations.tpl.js.map +1 -1
  31. package/lib/authentication/templates/declarations.tpl.ts +2 -2
  32. package/lib/authentication/templates/knex.tpl.js +6 -5
  33. package/lib/authentication/templates/knex.tpl.js.map +1 -1
  34. package/lib/authentication/templates/knex.tpl.ts +16 -17
  35. package/lib/authentication/templates/test.tpl.js +2 -2
  36. package/lib/authentication/templates/test.tpl.js.map +1 -1
  37. package/lib/authentication/templates/test.tpl.ts +2 -2
  38. package/lib/authentication/templates/user.resolver.tpl.js +10 -8
  39. package/lib/authentication/templates/user.resolver.tpl.js.map +1 -1
  40. package/lib/authentication/templates/user.resolver.tpl.ts +10 -8
  41. package/lib/authentication/templates/user.schema.tpl.js +7 -13
  42. package/lib/authentication/templates/user.schema.tpl.js.map +1 -1
  43. package/lib/authentication/templates/user.schema.tpl.ts +7 -13
  44. package/lib/commons.d.ts +19 -9
  45. package/lib/commons.js +56 -23
  46. package/lib/commons.js.map +1 -1
  47. package/lib/commons.ts +87 -26
  48. package/lib/connection/templates/knex.tpl.js +13 -16
  49. package/lib/connection/templates/knex.tpl.js.map +1 -1
  50. package/lib/connection/templates/knex.tpl.ts +18 -20
  51. package/lib/connection/templates/mongodb.tpl.js +5 -9
  52. package/lib/connection/templates/mongodb.tpl.js.map +1 -1
  53. package/lib/connection/templates/mongodb.tpl.ts +10 -12
  54. package/lib/hook/templates/hook.tpl.js +2 -2
  55. package/lib/hook/templates/hook.tpl.js.map +1 -1
  56. package/lib/hook/templates/hook.tpl.ts +4 -3
  57. package/lib/index.js +2 -1
  58. package/lib/index.js.map +1 -1
  59. package/lib/index.ts +2 -1
  60. package/lib/service/index.d.ts +0 -16
  61. package/lib/service/index.js +3 -8
  62. package/lib/service/index.js.map +1 -1
  63. package/lib/service/index.ts +3 -16
  64. package/lib/service/templates/class.tpl.d.ts +2 -0
  65. package/lib/service/templates/class.tpl.js +63 -0
  66. package/lib/service/templates/class.tpl.js.map +1 -0
  67. package/lib/service/templates/class.tpl.ts +79 -0
  68. package/lib/service/templates/client.tpl.js +7 -7
  69. package/lib/service/templates/client.tpl.js.map +1 -1
  70. package/lib/service/templates/client.tpl.ts +13 -16
  71. package/lib/service/templates/resolver.tpl.js +4 -4
  72. package/lib/service/templates/resolver.tpl.js.map +1 -1
  73. package/lib/service/templates/resolver.tpl.ts +4 -4
  74. package/lib/service/templates/schema.tpl.js +2 -2
  75. package/lib/service/templates/schema.tpl.js.map +1 -1
  76. package/lib/service/templates/schema.tpl.ts +2 -2
  77. package/lib/service/templates/service.tpl.js +12 -58
  78. package/lib/service/templates/service.tpl.js.map +1 -1
  79. package/lib/service/templates/service.tpl.ts +17 -79
  80. package/lib/service/templates/test.tpl.js +4 -4
  81. package/lib/service/templates/test.tpl.js.map +1 -1
  82. package/lib/service/templates/test.tpl.ts +4 -4
  83. package/lib/service/type/custom.tpl.d.ts +1 -1
  84. package/lib/service/type/custom.tpl.js +24 -16
  85. package/lib/service/type/custom.tpl.js.map +1 -1
  86. package/lib/service/type/custom.tpl.ts +28 -19
  87. package/lib/service/type/knex.tpl.js +11 -5
  88. package/lib/service/type/knex.tpl.js.map +1 -1
  89. package/lib/service/type/knex.tpl.ts +14 -9
  90. package/lib/service/type/mongodb.tpl.js +11 -5
  91. package/lib/service/type/mongodb.tpl.js.map +1 -1
  92. package/lib/service/type/mongodb.tpl.ts +14 -9
  93. package/package.json +21 -21
@@ -15,15 +15,21 @@ export class ${className} extends MongoDBService<${upperName}Result, ${upperName
15
15
  exports.classCode = classCode;
16
16
  const optionTemplate = ({ kebabName }) => ` paginate: app.get('paginate'),
17
17
  Model: app.get('mongodbClient').then(db => db.collection('${kebabName}'))`;
18
- const toServiceFile = (0, pinion_1.toFile)(({ lib, folder, fileName, language }) => [
18
+ const toServiceFile = (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
19
19
  lib,
20
20
  'services',
21
21
  ...folder,
22
- `${fileName}.${language}`
22
+ `${fileName}.service`
23
+ ]);
24
+ const toClassFile = (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
25
+ lib,
26
+ 'services',
27
+ ...folder,
28
+ `${fileName}.class`
23
29
  ]);
24
30
  const generate = (ctx) => (0, pinion_1.generator)(ctx)
25
- .then((0, pinion_1.inject)((0, commons_1.getSource)(exports.classCode), (0, pinion_1.before)('export const hooks ='), toServiceFile))
26
- .then((0, pinion_1.inject)((0, commons_1.getSource)(exports.importTemplate), (0, pinion_1.prepend)(), toServiceFile))
27
- .then((0, pinion_1.inject)(optionTemplate, (0, pinion_1.after)('const options ='), toServiceFile));
31
+ .then((0, commons_1.injectSource)(exports.classCode, (0, pinion_1.append)(), toClassFile))
32
+ .then((0, commons_1.injectSource)(exports.importTemplate, (0, pinion_1.prepend)(), toClassFile))
33
+ .then((0, commons_1.injectSource)(optionTemplate, (0, pinion_1.after)('const options ='), toServiceFile, false));
28
34
  exports.generate = generate;
29
35
  //# sourceMappingURL=mongodb.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb.tpl.js","sourceRoot":"","sources":["../../../src/service/type/mongodb.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsF;AACtF,2CAAyC;AAG5B,QAAA,cAAc,GAAG;kEACoC,CAAA;AAE3D,MAAM,SAAS,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,EAA2B,EAAE,EAAE,CAC7E,oBAAoB,SAAS,uCAAuC,SAAS;;;;eAIhE,SAAS,2BAA2B,SAAS,WAAW,SAAS,SAAS,SAAS;;CAEjG,CAAA;AAPY,QAAA,SAAS,aAOrB;AAED,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAA2B,EAAE,EAAE,CAChE;gEAC8D,SAAS,KAAK,CAAA;AAE9E,MAAM,aAAa,GAAG,IAAA,eAAM,EAA0B,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC7F,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,IAAI,QAAQ,EAAE;CAC1B,CAAC,CAAA;AAEK,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,IAAA,kBAAS,EAAC,GAAG,CA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;AAEK,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAS,EAAE,IAAA,eAAM,GAAE,EAAE,WAAW,CAAC,CAAC;KACpD,IAAI,CAAC,IAAA,sBAAY,EAAC,sBAAc,EAAE,IAAA,gBAAO,GAAE,EAAE,WAAW,CAAC,CAAC;KAC1D,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,cAAK,EAAC,iBAAiB,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;AAJ1E,QAAA,QAAQ,YAIkE"}
@@ -1,5 +1,5 @@
1
- import { generator, inject, toFile, before, after, prepend } from '@feathershq/pinion'
2
- import { getSource } from '../../commons'
1
+ import { generator, toFile, after, prepend, append } from '@feathershq/pinion'
2
+ import { injectSource } from '../../commons'
3
3
  import { ServiceGeneratorContext } from '../index'
4
4
 
5
5
  export const importTemplate = `import { MongoDBService } from \'@feathersjs/mongodb\'
@@ -18,17 +18,22 @@ const optionTemplate = ({ kebabName }: ServiceGeneratorContext) =>
18
18
  ` paginate: app.get('paginate'),
19
19
  Model: app.get('mongodbClient').then(db => db.collection('${kebabName}'))`
20
20
 
21
- const toServiceFile = toFile<ServiceGeneratorContext>(({ lib, folder, fileName, language }) => [
21
+ const toServiceFile = toFile<ServiceGeneratorContext>(({ lib, folder, fileName }) => [
22
22
  lib,
23
23
  'services',
24
24
  ...folder,
25
- `${fileName}.${language}`
25
+ `${fileName}.service`
26
+ ])
27
+
28
+ const toClassFile = toFile<ServiceGeneratorContext>(({ lib, folder, fileName }) => [
29
+ lib,
30
+ 'services',
31
+ ...folder,
32
+ `${fileName}.class`
26
33
  ])
27
34
 
28
35
  export const generate = (ctx: ServiceGeneratorContext) =>
29
36
  generator(ctx)
30
- .then(
31
- inject(getSource(classCode), before<ServiceGeneratorContext>('export const hooks ='), toServiceFile)
32
- )
33
- .then(inject(getSource(importTemplate), prepend(), toServiceFile))
34
- .then(inject(optionTemplate, after('const options ='), toServiceFile))
37
+ .then(injectSource(classCode, append(), toClassFile))
38
+ .then(injectSource(importTemplate, prepend(), toClassFile))
39
+ .then(injectSource(optionTemplate, after('const options ='), toServiceFile, false))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/cli",
3
3
  "description": "The command line interface for creating Feathers applications",
4
- "version": "5.0.0-pre.25",
4
+ "version": "5.0.0-pre.28",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "bin": {
@@ -54,34 +54,34 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@feathershq/pinion": "^0.3.3",
57
+ "@feathershq/pinion": "^0.3.4",
58
58
  "chalk": "^4.0.1",
59
59
  "lodash": "^4.17.21",
60
60
  "prettier": "^2.7.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@feathersjs/authentication": "^5.0.0-pre.25",
64
- "@feathersjs/authentication-local": "^5.0.0-pre.25",
65
- "@feathersjs/authentication-oauth": "^5.0.0-pre.25",
66
- "@feathersjs/configuration": "^5.0.0-pre.25",
67
- "@feathersjs/errors": "^5.0.0-pre.25",
68
- "@feathersjs/express": "^5.0.0-pre.25",
69
- "@feathersjs/feathers": "^5.0.0-pre.25",
70
- "@feathersjs/knex": "^5.0.0-pre.25",
71
- "@feathersjs/koa": "^5.0.0-pre.25",
72
- "@feathersjs/mongodb": "^5.0.0-pre.25",
73
- "@feathersjs/schema": "^5.0.0-pre.25",
74
- "@feathersjs/socketio": "^5.0.0-pre.25",
75
- "@feathersjs/transport-commons": "^5.0.0-pre.25",
63
+ "@feathersjs/authentication": "^5.0.0-pre.28",
64
+ "@feathersjs/authentication-local": "^5.0.0-pre.28",
65
+ "@feathersjs/authentication-oauth": "^5.0.0-pre.28",
66
+ "@feathersjs/configuration": "^5.0.0-pre.28",
67
+ "@feathersjs/errors": "^5.0.0-pre.28",
68
+ "@feathersjs/express": "^5.0.0-pre.28",
69
+ "@feathersjs/feathers": "^5.0.0-pre.28",
70
+ "@feathersjs/knex": "^5.0.0-pre.28",
71
+ "@feathersjs/koa": "^5.0.0-pre.28",
72
+ "@feathersjs/mongodb": "^5.0.0-pre.28",
73
+ "@feathersjs/schema": "^5.0.0-pre.28",
74
+ "@feathersjs/socketio": "^5.0.0-pre.28",
75
+ "@feathersjs/transport-commons": "^5.0.0-pre.28",
76
76
  "@types/mocha": "^9.1.1",
77
- "@types/node": "^17.0.40",
78
- "@types/prettier": "^2.6.3",
77
+ "@types/node": "^18.6.3",
78
+ "@types/prettier": "^2.6.4",
79
79
  "axios": "^0.27.2",
80
80
  "mocha": "^10.0.0",
81
81
  "shx": "^0.3.4",
82
- "ts-node": "^10.8.1",
83
- "type-fest": "^2.13.0",
84
- "typescript": "^4.7.3"
82
+ "ts-node": "^10.9.1",
83
+ "type-fest": "^2.18.0",
84
+ "typescript": "^4.7.4"
85
85
  },
86
- "gitHead": "c0ab3b603920dff6e9c912b2767cf168094d45c8"
86
+ "gitHead": "bf8e54fddc14d688ba8f505e72c9630a71656ff1"
87
87
  }