@feathersjs/generators 5.0.13 → 5.0.15

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 (158) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/app/index.d.ts +19 -27
  3. package/lib/app/index.js +25 -30
  4. package/lib/app/index.js.map +1 -1
  5. package/lib/app/index.ts +17 -8
  6. package/lib/app/templates/app.test.tpl.d.ts +5 -2
  7. package/lib/app/templates/app.test.tpl.js +3 -7
  8. package/lib/app/templates/app.test.tpl.js.map +1 -1
  9. package/lib/app/templates/app.test.tpl.ts +4 -4
  10. package/lib/app/templates/app.tpl.d.ts +1 -1
  11. package/lib/app/templates/app.tpl.js +3 -7
  12. package/lib/app/templates/app.tpl.js.map +1 -1
  13. package/lib/app/templates/app.tpl.ts +4 -4
  14. package/lib/app/templates/channels.tpl.d.ts +1 -1
  15. package/lib/app/templates/channels.tpl.js +3 -7
  16. package/lib/app/templates/channels.tpl.js.map +1 -1
  17. package/lib/app/templates/channels.tpl.ts +4 -4
  18. package/lib/app/templates/client.test.tpl.d.ts +1 -1
  19. package/lib/app/templates/client.test.tpl.js +3 -7
  20. package/lib/app/templates/client.test.tpl.js.map +1 -1
  21. package/lib/app/templates/client.test.tpl.ts +4 -4
  22. package/lib/app/templates/client.tpl.d.ts +1 -1
  23. package/lib/app/templates/client.tpl.js +3 -7
  24. package/lib/app/templates/client.tpl.js.map +1 -1
  25. package/lib/app/templates/client.tpl.ts +4 -4
  26. package/lib/app/templates/configuration.tpl.d.ts +1 -1
  27. package/lib/app/templates/configuration.tpl.js +7 -11
  28. package/lib/app/templates/configuration.tpl.js.map +1 -1
  29. package/lib/app/templates/configuration.tpl.ts +4 -4
  30. package/lib/app/templates/declarations.tpl.d.ts +1 -1
  31. package/lib/app/templates/declarations.tpl.js +2 -6
  32. package/lib/app/templates/declarations.tpl.js.map +1 -1
  33. package/lib/app/templates/declarations.tpl.ts +3 -3
  34. package/lib/app/templates/index.html.tpl.d.ts +5 -2
  35. package/lib/app/templates/index.html.tpl.js +2 -6
  36. package/lib/app/templates/index.html.tpl.js.map +1 -1
  37. package/lib/app/templates/index.html.tpl.ts +3 -3
  38. package/lib/app/templates/index.tpl.d.ts +1 -1
  39. package/lib/app/templates/index.tpl.js +3 -7
  40. package/lib/app/templates/index.tpl.js.map +1 -1
  41. package/lib/app/templates/index.tpl.ts +4 -4
  42. package/lib/app/templates/logger.tpl.d.ts +1 -1
  43. package/lib/app/templates/logger.tpl.js +6 -10
  44. package/lib/app/templates/logger.tpl.js.map +1 -1
  45. package/lib/app/templates/logger.tpl.ts +4 -4
  46. package/lib/app/templates/package.json.tpl.d.ts +5 -2
  47. package/lib/app/templates/package.json.tpl.js +2 -6
  48. package/lib/app/templates/package.json.tpl.js.map +1 -1
  49. package/lib/app/templates/package.json.tpl.ts +3 -3
  50. package/lib/app/templates/prettierrc.tpl.d.ts +1 -1
  51. package/lib/app/templates/prettierrc.tpl.js +5 -9
  52. package/lib/app/templates/prettierrc.tpl.js.map +1 -1
  53. package/lib/app/templates/prettierrc.tpl.ts +4 -4
  54. package/lib/app/templates/readme.md.tpl.d.ts +5 -2
  55. package/lib/app/templates/readme.md.tpl.js +2 -6
  56. package/lib/app/templates/readme.md.tpl.js.map +1 -1
  57. package/lib/app/templates/readme.md.tpl.ts +3 -3
  58. package/lib/app/templates/services.tpl.d.ts +1 -1
  59. package/lib/app/templates/services.tpl.js +3 -7
  60. package/lib/app/templates/services.tpl.js.map +1 -1
  61. package/lib/app/templates/services.tpl.ts +4 -4
  62. package/lib/app/templates/tsconfig.json.tpl.d.ts +1 -1
  63. package/lib/app/templates/tsconfig.json.tpl.js +3 -7
  64. package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
  65. package/lib/app/templates/tsconfig.json.tpl.ts +3 -3
  66. package/lib/app/templates/validators.tpl.d.ts +1 -1
  67. package/lib/app/templates/validators.tpl.js +3 -7
  68. package/lib/app/templates/validators.tpl.js.map +1 -1
  69. package/lib/app/templates/validators.tpl.ts +4 -4
  70. package/lib/authentication/index.d.ts +10 -10
  71. package/lib/authentication/index.js +16 -19
  72. package/lib/authentication/index.js.map +1 -1
  73. package/lib/authentication/index.ts +65 -56
  74. package/lib/authentication/templates/authentication.tpl.d.ts +1 -1
  75. package/lib/authentication/templates/authentication.tpl.js +11 -15
  76. package/lib/authentication/templates/authentication.tpl.js.map +1 -1
  77. package/lib/authentication/templates/authentication.tpl.ts +5 -5
  78. package/lib/authentication/templates/client.test.tpl.d.ts +1 -1
  79. package/lib/authentication/templates/client.test.tpl.js +7 -11
  80. package/lib/authentication/templates/client.test.tpl.js.map +1 -1
  81. package/lib/authentication/templates/client.test.tpl.ts +5 -5
  82. package/lib/authentication/templates/config.tpl.d.ts +1 -1
  83. package/lib/authentication/templates/config.tpl.js +8 -15
  84. package/lib/authentication/templates/config.tpl.js.map +1 -1
  85. package/lib/authentication/templates/config.tpl.ts +3 -3
  86. package/lib/authentication/templates/declarations.tpl.d.ts +1 -1
  87. package/lib/authentication/templates/declarations.tpl.js +5 -9
  88. package/lib/authentication/templates/declarations.tpl.js.map +1 -1
  89. package/lib/authentication/templates/declarations.tpl.ts +3 -3
  90. package/lib/commons.d.ts +10 -2
  91. package/lib/commons.js +43 -76
  92. package/lib/commons.js.map +1 -1
  93. package/lib/commons.ts +22 -4
  94. package/lib/connection/index.d.ts +1 -1
  95. package/lib/connection/index.js +24 -30
  96. package/lib/connection/index.js.map +1 -1
  97. package/lib/connection/index.ts +10 -4
  98. package/lib/connection/templates/knex.tpl.d.ts +1 -1
  99. package/lib/connection/templates/knex.tpl.js +13 -20
  100. package/lib/connection/templates/knex.tpl.js.map +1 -1
  101. package/lib/connection/templates/knex.tpl.ts +4 -4
  102. package/lib/connection/templates/mongodb.tpl.d.ts +1 -1
  103. package/lib/connection/templates/mongodb.tpl.js +10 -14
  104. package/lib/connection/templates/mongodb.tpl.js.map +1 -1
  105. package/lib/connection/templates/mongodb.tpl.ts +4 -4
  106. package/lib/hook/index.d.ts +6 -6
  107. package/lib/hook/index.js +13 -17
  108. package/lib/hook/index.js.map +1 -1
  109. package/lib/hook/index.ts +7 -3
  110. package/lib/hook/templates/hook.tpl.d.ts +1 -1
  111. package/lib/hook/templates/hook.tpl.js +3 -7
  112. package/lib/hook/templates/hook.tpl.js.map +1 -1
  113. package/lib/hook/templates/hook.tpl.ts +4 -4
  114. package/lib/index.d.ts +7 -7
  115. package/lib/index.js +7 -36
  116. package/lib/index.js.map +1 -1
  117. package/lib/index.ts +7 -7
  118. package/lib/service/index.d.ts +1 -1
  119. package/lib/service/index.js +27 -31
  120. package/lib/service/index.js.map +1 -1
  121. package/lib/service/index.ts +94 -92
  122. package/lib/service/templates/client.tpl.d.ts +1 -1
  123. package/lib/service/templates/client.tpl.js +4 -8
  124. package/lib/service/templates/client.tpl.js.map +1 -1
  125. package/lib/service/templates/client.tpl.ts +4 -4
  126. package/lib/service/templates/schema.json.tpl.d.ts +1 -1
  127. package/lib/service/templates/schema.json.tpl.js +10 -14
  128. package/lib/service/templates/schema.json.tpl.js.map +1 -1
  129. package/lib/service/templates/schema.json.tpl.ts +4 -4
  130. package/lib/service/templates/schema.typebox.tpl.d.ts +1 -1
  131. package/lib/service/templates/schema.typebox.tpl.js +8 -12
  132. package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
  133. package/lib/service/templates/schema.typebox.tpl.ts +4 -4
  134. package/lib/service/templates/service.tpl.d.ts +1 -1
  135. package/lib/service/templates/service.tpl.js +9 -14
  136. package/lib/service/templates/service.tpl.js.map +1 -1
  137. package/lib/service/templates/service.tpl.ts +4 -4
  138. package/lib/service/templates/shared.tpl.d.ts +1 -1
  139. package/lib/service/templates/shared.tpl.js +3 -7
  140. package/lib/service/templates/shared.tpl.js.map +1 -1
  141. package/lib/service/templates/shared.tpl.ts +4 -4
  142. package/lib/service/templates/test.tpl.d.ts +1 -1
  143. package/lib/service/templates/test.tpl.js +3 -7
  144. package/lib/service/templates/test.tpl.js.map +1 -1
  145. package/lib/service/templates/test.tpl.ts +4 -4
  146. package/lib/service/type/custom.tpl.d.ts +1 -1
  147. package/lib/service/type/custom.tpl.js +4 -9
  148. package/lib/service/type/custom.tpl.js.map +1 -1
  149. package/lib/service/type/custom.tpl.ts +4 -4
  150. package/lib/service/type/knex.tpl.d.ts +1 -1
  151. package/lib/service/type/knex.tpl.js +6 -11
  152. package/lib/service/type/knex.tpl.js.map +1 -1
  153. package/lib/service/type/knex.tpl.ts +4 -4
  154. package/lib/service/type/mongodb.tpl.d.ts +1 -1
  155. package/lib/service/type/mongodb.tpl.js +4 -9
  156. package/lib/service/type/mongodb.tpl.js.map +1 -1
  157. package/lib/service/type/mongodb.tpl.ts +4 -4
  158. package/package.json +31 -30
@@ -1,6 +1,6 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource, yyyymmddhhmmss } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile } from '@featherscloud/pinion'
2
+ import { renderSource, yyyymmddhhmmss } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const migrationTemplate = ({
6
6
  kebabPath,
@@ -85,7 +85,7 @@ export const getOptions = (app: Application): KnexAdapterOptions => {
85
85
  `
86
86
 
87
87
  export const generate = (ctx: ServiceGeneratorContext) =>
88
- generator(ctx)
88
+ Promise.resolve(ctx)
89
89
  .then(
90
90
  renderSource(
91
91
  template,
@@ -1,3 +1,3 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const template: ({ className, upperName, schema, fileName, kebabPath, relative }: ServiceGeneratorContext) => string;
3
3
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = exports.template = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
6
- const template = ({ className, upperName, schema, fileName, kebabPath, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#database-services
1
+ import { toFile } from '@featherscloud/pinion';
2
+ import { renderSource } from '../../commons.js';
3
+ export const template = ({ className, upperName, schema, fileName, kebabPath, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#database-services
7
4
  import type { Params } from '@feathersjs/feathers'
8
5
  import { MongoDBService } from \'@feathersjs/mongodb\'
9
6
  import type { MongoDBAdapterParams, MongoDBAdapterOptions } from \'@feathersjs/mongodb\'
@@ -41,12 +38,10 @@ export const getOptions = (app: Application): MongoDBAdapterOptions => {
41
38
  }
42
39
  }
43
40
  `;
44
- exports.template = template;
45
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(exports.template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
41
+ export const generate = (ctx) => Promise.resolve(ctx).then(renderSource(template, toFile(({ lib, folder, fileName }) => [
46
42
  lib,
47
43
  'services',
48
44
  ...folder,
49
45
  `${fileName}.class`
50
46
  ])));
51
- exports.generate = generate;
52
47
  //# 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,+CAAsD;AACtD,2CAA4C;AAGrC,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACgB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;oCAKJ,QAAQ;EAE1C,MAAM;IACJ,CAAC,CAAC;IACF,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;CACnB;IACG,CAAC,CAAC;OACC,SAAS;OACT,SAAS;OACT,SAAS;OACT,SAAS;CAEhB;;gBAEgB,SAAS,KAAK,SAAS,SAAS,SAAS,UAAU,SAAS;;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CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,YAAY,CACV,QAAQ,EACR,MAAM,CAA0B,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC7D,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,QAAQ;CACpB,CAAC,CACH,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile } from '@featherscloud/pinion'
2
+ import { renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  export const template = ({
6
6
  className,
@@ -51,7 +51,7 @@ export const getOptions = (app: Application): MongoDBAdapterOptions => {
51
51
  `
52
52
 
53
53
  export const generate = (ctx: ServiceGeneratorContext) =>
54
- generator(ctx).then(
54
+ Promise.resolve(ctx).then(
55
55
  renderSource(
56
56
  template,
57
57
  toFile<ServiceGeneratorContext>(({ lib, folder, fileName }) => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feathersjs/generators",
3
- "version": "5.0.13",
3
+ "version": "5.0.15",
4
4
  "description": "Feathers CLI core generators, powered by Pinion",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "keywords": [
@@ -29,8 +29,9 @@
29
29
  "engines": {
30
30
  "node": ">= 16"
31
31
  },
32
- "main": "lib/",
32
+ "main": "lib/index.js",
33
33
  "types": "lib/",
34
+ "type": "module",
34
35
  "files": [
35
36
  "CHANGELOG.md",
36
37
  "LICENSE",
@@ -43,7 +44,7 @@
43
44
  "scripts": {
44
45
  "prepublish": "npm run compile",
45
46
  "compile": "shx rm -rf lib/ && tsc && shx cp -r src/. lib/",
46
- "test": "npm run compile && mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
47
+ "test": "npm run compile && mocha --config ../../.mocharc.json --require tsx --recursive test/**.test.ts test/**/*.test.ts"
47
48
  },
48
49
  "directories": {
49
50
  "lib": "lib"
@@ -52,45 +53,45 @@
52
53
  "access": "public"
53
54
  },
54
55
  "dependencies": {
55
- "@feathershq/pinion": "^0.3.5",
56
- "chalk": "^4.0.1",
56
+ "@featherscloud/pinion": "^0.5.0",
57
+ "chalk": "^5.3.0",
57
58
  "lodash": "^4.17.21",
58
- "prettier": "^3.1.1",
59
+ "prettier": "^3.2.4",
59
60
  "typescript": "^5.3.3"
60
61
  },
61
62
  "devDependencies": {
62
- "@feathersjs/adapter-commons": "^5.0.13",
63
- "@feathersjs/authentication": "^5.0.13",
64
- "@feathersjs/authentication-client": "^5.0.13",
65
- "@feathersjs/authentication-local": "^5.0.13",
66
- "@feathersjs/authentication-oauth": "^5.0.13",
67
- "@feathersjs/configuration": "^5.0.13",
68
- "@feathersjs/errors": "^5.0.13",
69
- "@feathersjs/express": "^5.0.13",
70
- "@feathersjs/feathers": "^5.0.13",
71
- "@feathersjs/knex": "^5.0.13",
72
- "@feathersjs/koa": "^5.0.13",
73
- "@feathersjs/mongodb": "^5.0.13",
74
- "@feathersjs/rest-client": "^5.0.13",
75
- "@feathersjs/schema": "^5.0.13",
76
- "@feathersjs/socketio": "^5.0.13",
77
- "@feathersjs/transport-commons": "^5.0.13",
78
- "@feathersjs/typebox": "^5.0.13",
63
+ "@feathersjs/adapter-commons": "^5.0.15",
64
+ "@feathersjs/authentication": "^5.0.15",
65
+ "@feathersjs/authentication-client": "^5.0.15",
66
+ "@feathersjs/authentication-local": "^5.0.15",
67
+ "@feathersjs/authentication-oauth": "^5.0.15",
68
+ "@feathersjs/configuration": "^5.0.15",
69
+ "@feathersjs/errors": "^5.0.15",
70
+ "@feathersjs/express": "^5.0.15",
71
+ "@feathersjs/feathers": "^5.0.15",
72
+ "@feathersjs/knex": "^5.0.15",
73
+ "@feathersjs/koa": "^5.0.15",
74
+ "@feathersjs/mongodb": "^5.0.15",
75
+ "@feathersjs/rest-client": "^5.0.15",
76
+ "@feathersjs/schema": "^5.0.15",
77
+ "@feathersjs/socketio": "^5.0.15",
78
+ "@feathersjs/transport-commons": "^5.0.15",
79
+ "@feathersjs/typebox": "^5.0.15",
79
80
  "@types/mocha": "^10.0.6",
80
- "@types/node": "^20.10.5",
81
+ "@types/node": "^20.11.5",
81
82
  "@types/prettier": "^2.7.3",
82
- "axios": "^1.6.2",
83
+ "axios": "^1.6.5",
83
84
  "knex": "^3.1.0",
84
85
  "mocha": "^10.2.0",
85
86
  "mongodb": "^6.3.0",
86
- "mssql": "^10.0.1",
87
+ "mssql": "^10.0.2",
87
88
  "mysql": "^2.18.1",
88
89
  "pg": "^8.11.3",
89
90
  "shx": "^0.3.4",
90
- "sqlite3": "^5.1.6",
91
- "ts-node": "^10.9.2",
92
- "type-fest": "^4.8.3",
91
+ "sqlite3": "^5.1.7",
92
+ "tsx": "^4.7.0",
93
+ "type-fest": "^4.9.0",
93
94
  "typescript": "^5.3.3"
94
95
  },
95
- "gitHead": "486f4e781015f05944f3200da277a9e50759f513"
96
+ "gitHead": "a39910e534c5685aa9093b395ca1625ee8b187a6"
96
97
  }