@feathersjs/cli 5.0.0-pre.33 → 5.0.0-pre.35

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 (175) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/index.d.ts +6 -2
  3. package/lib/index.js +59 -2
  4. package/lib/index.js.map +1 -1
  5. package/package.json +30 -30
  6. package/lib/app/index.d.ts +0 -29
  7. package/lib/app/index.js +0 -146
  8. package/lib/app/index.js.map +0 -1
  9. package/lib/app/index.ts +0 -227
  10. package/lib/app/static/.gitignore +0 -121
  11. package/lib/app/templates/app.test.tpl.d.ts +0 -2
  12. package/lib/app/templates/app.test.tpl.js +0 -48
  13. package/lib/app/templates/app.test.tpl.js.map +0 -1
  14. package/lib/app/templates/app.test.tpl.ts +0 -47
  15. package/lib/app/templates/app.tpl.d.ts +0 -2
  16. package/lib/app/templates/app.tpl.js +0 -121
  17. package/lib/app/templates/app.tpl.js.map +0 -1
  18. package/lib/app/templates/app.tpl.ts +0 -136
  19. package/lib/app/templates/channels.tpl.d.ts +0 -2
  20. package/lib/app/templates/channels.tpl.js +0 -48
  21. package/lib/app/templates/channels.tpl.js.map +0 -1
  22. package/lib/app/templates/channels.tpl.ts +0 -54
  23. package/lib/app/templates/client.test.tpl.d.ts +0 -2
  24. package/lib/app/templates/client.test.tpl.js +0 -27
  25. package/lib/app/templates/client.test.tpl.js.map +0 -1
  26. package/lib/app/templates/client.test.tpl.ts +0 -26
  27. package/lib/app/templates/client.tpl.d.ts +0 -2
  28. package/lib/app/templates/client.tpl.js +0 -37
  29. package/lib/app/templates/client.tpl.js.map +0 -1
  30. package/lib/app/templates/client.tpl.ts +0 -44
  31. package/lib/app/templates/config.tpl.d.ts +0 -2
  32. package/lib/app/templates/config.tpl.js +0 -30
  33. package/lib/app/templates/config.tpl.js.map +0 -1
  34. package/lib/app/templates/config.tpl.ts +0 -31
  35. package/lib/app/templates/declarations.tpl.d.ts +0 -2
  36. package/lib/app/templates/declarations.tpl.js +0 -27
  37. package/lib/app/templates/declarations.tpl.js.map +0 -1
  38. package/lib/app/templates/declarations.tpl.ts +0 -36
  39. package/lib/app/templates/index.html.tpl.d.ts +0 -2
  40. package/lib/app/templates/index.html.tpl.js +0 -45
  41. package/lib/app/templates/index.html.tpl.js.map +0 -1
  42. package/lib/app/templates/index.html.tpl.ts +0 -44
  43. package/lib/app/templates/index.tpl.d.ts +0 -2
  44. package/lib/app/templates/index.tpl.js +0 -18
  45. package/lib/app/templates/index.tpl.js.map +0 -1
  46. package/lib/app/templates/index.tpl.ts +0 -22
  47. package/lib/app/templates/logger.tpl.d.ts +0 -2
  48. package/lib/app/templates/logger.tpl.js +0 -39
  49. package/lib/app/templates/logger.tpl.js.map +0 -1
  50. package/lib/app/templates/logger.tpl.ts +0 -44
  51. package/lib/app/templates/package.json.tpl.d.ts +0 -2
  52. package/lib/app/templates/package.json.tpl.js +0 -55
  53. package/lib/app/templates/package.json.tpl.js.map +0 -1
  54. package/lib/app/templates/package.json.tpl.ts +0 -68
  55. package/lib/app/templates/prettierrc.tpl.d.ts +0 -2
  56. package/lib/app/templates/prettierrc.tpl.js +0 -11
  57. package/lib/app/templates/prettierrc.tpl.js.map +0 -1
  58. package/lib/app/templates/prettierrc.tpl.ts +0 -14
  59. package/lib/app/templates/readme.md.tpl.d.ts +0 -2
  60. package/lib/app/templates/readme.md.tpl.js +0 -54
  61. package/lib/app/templates/readme.md.tpl.js.map +0 -1
  62. package/lib/app/templates/readme.md.tpl.ts +0 -57
  63. package/lib/app/templates/schemas.tpl.d.ts +0 -2
  64. package/lib/app/templates/schemas.tpl.js +0 -75
  65. package/lib/app/templates/schemas.tpl.js.map +0 -1
  66. package/lib/app/templates/schemas.tpl.ts +0 -89
  67. package/lib/app/templates/services.tpl.d.ts +0 -2
  68. package/lib/app/templates/services.tpl.js +0 -14
  69. package/lib/app/templates/services.tpl.js.map +0 -1
  70. package/lib/app/templates/services.tpl.ts +0 -18
  71. package/lib/app/templates/tsconfig.json.tpl.d.ts +0 -2
  72. package/lib/app/templates/tsconfig.json.tpl.js +0 -22
  73. package/lib/app/templates/tsconfig.json.tpl.js.map +0 -1
  74. package/lib/app/templates/tsconfig.json.tpl.ts +0 -28
  75. package/lib/authentication/index.d.ts +0 -73
  76. package/lib/authentication/index.js +0 -107
  77. package/lib/authentication/index.js.map +0 -1
  78. package/lib/authentication/index.ts +0 -126
  79. package/lib/authentication/templates/authentication.tpl.d.ts +0 -2
  80. package/lib/authentication/templates/authentication.tpl.js +0 -39
  81. package/lib/authentication/templates/authentication.tpl.js.map +0 -1
  82. package/lib/authentication/templates/authentication.tpl.ts +0 -50
  83. package/lib/authentication/templates/client.test.tpl.d.ts +0 -2
  84. package/lib/authentication/templates/client.test.tpl.js +0 -61
  85. package/lib/authentication/templates/client.test.tpl.js.map +0 -1
  86. package/lib/authentication/templates/client.test.tpl.ts +0 -73
  87. package/lib/authentication/templates/client.tpl.d.ts +0 -2
  88. package/lib/authentication/templates/client.tpl.js +0 -14
  89. package/lib/authentication/templates/client.tpl.js.map +0 -1
  90. package/lib/authentication/templates/client.tpl.ts +0 -19
  91. package/lib/authentication/templates/config.tpl.d.ts +0 -2
  92. package/lib/authentication/templates/config.tpl.js +0 -50
  93. package/lib/authentication/templates/config.tpl.js.map +0 -1
  94. package/lib/authentication/templates/config.tpl.ts +0 -57
  95. package/lib/authentication/templates/declarations.tpl.d.ts +0 -2
  96. package/lib/authentication/templates/declarations.tpl.js +0 -19
  97. package/lib/authentication/templates/declarations.tpl.js.map +0 -1
  98. package/lib/authentication/templates/declarations.tpl.ts +0 -34
  99. package/lib/authentication/templates/knex.tpl.d.ts +0 -2
  100. package/lib/authentication/templates/knex.tpl.js +0 -45
  101. package/lib/authentication/templates/knex.tpl.js.map +0 -1
  102. package/lib/authentication/templates/knex.tpl.ts +0 -62
  103. package/lib/authentication/templates/schema.json.tpl.d.ts +0 -2
  104. package/lib/authentication/templates/schema.json.tpl.js +0 -93
  105. package/lib/authentication/templates/schema.json.tpl.js.map +0 -1
  106. package/lib/authentication/templates/schema.json.tpl.ts +0 -108
  107. package/lib/authentication/templates/schema.typebox.tpl.d.ts +0 -3
  108. package/lib/authentication/templates/schema.typebox.tpl.js +0 -78
  109. package/lib/authentication/templates/schema.typebox.tpl.js.map +0 -1
  110. package/lib/authentication/templates/schema.typebox.tpl.ts +0 -94
  111. package/lib/cli.d.ts +0 -6
  112. package/lib/cli.js +0 -75
  113. package/lib/cli.js.map +0 -1
  114. package/lib/cli.ts +0 -68
  115. package/lib/commons.d.ts +0 -143
  116. package/lib/commons.js +0 -190
  117. package/lib/commons.js.map +0 -1
  118. package/lib/commons.ts +0 -276
  119. package/lib/connection/index.d.ts +0 -55
  120. package/lib/connection/index.js +0 -88
  121. package/lib/connection/index.js.map +0 -1
  122. package/lib/connection/index.ts +0 -123
  123. package/lib/connection/templates/knex.tpl.d.ts +0 -2
  124. package/lib/connection/templates/knex.tpl.js +0 -46
  125. package/lib/connection/templates/knex.tpl.js.map +0 -1
  126. package/lib/connection/templates/knex.tpl.ts +0 -63
  127. package/lib/connection/templates/mongodb.tpl.d.ts +0 -2
  128. package/lib/connection/templates/mongodb.tpl.js +0 -33
  129. package/lib/connection/templates/mongodb.tpl.js.map +0 -1
  130. package/lib/connection/templates/mongodb.tpl.ts +0 -38
  131. package/lib/hook/index.d.ts +0 -22
  132. package/lib/hook/index.js +0 -43
  133. package/lib/hook/index.js.map +0 -1
  134. package/lib/hook/index.ts +0 -47
  135. package/lib/hook/templates/hook.tpl.d.ts +0 -2
  136. package/lib/hook/templates/hook.tpl.js +0 -20
  137. package/lib/hook/templates/hook.tpl.js.map +0 -1
  138. package/lib/hook/templates/hook.tpl.ts +0 -31
  139. package/lib/index.ts +0 -2
  140. package/lib/service/index.d.ts +0 -64
  141. package/lib/service/index.js +0 -116
  142. package/lib/service/index.js.map +0 -1
  143. package/lib/service/index.ts +0 -191
  144. package/lib/service/templates/client.tpl.d.ts +0 -2
  145. package/lib/service/templates/client.tpl.js +0 -31
  146. package/lib/service/templates/client.tpl.js.map +0 -1
  147. package/lib/service/templates/client.tpl.ts +0 -57
  148. package/lib/service/templates/schema.json.tpl.d.ts +0 -2
  149. package/lib/service/templates/schema.json.tpl.js +0 -75
  150. package/lib/service/templates/schema.json.tpl.js.map +0 -1
  151. package/lib/service/templates/schema.json.tpl.ts +0 -87
  152. package/lib/service/templates/schema.typebox.tpl.d.ts +0 -2
  153. package/lib/service/templates/schema.typebox.tpl.js +0 -55
  154. package/lib/service/templates/schema.typebox.tpl.js.map +0 -1
  155. package/lib/service/templates/schema.typebox.tpl.ts +0 -67
  156. package/lib/service/templates/service.tpl.d.ts +0 -3
  157. package/lib/service/templates/service.tpl.js +0 -98
  158. package/lib/service/templates/service.tpl.js.map +0 -1
  159. package/lib/service/templates/service.tpl.ts +0 -134
  160. package/lib/service/templates/test.tpl.d.ts +0 -2
  161. package/lib/service/templates/test.tpl.js +0 -24
  162. package/lib/service/templates/test.tpl.js.map +0 -1
  163. package/lib/service/templates/test.tpl.ts +0 -28
  164. package/lib/service/type/custom.tpl.d.ts +0 -3
  165. package/lib/service/type/custom.tpl.js +0 -94
  166. package/lib/service/type/custom.tpl.js.map +0 -1
  167. package/lib/service/type/custom.tpl.ts +0 -99
  168. package/lib/service/type/knex.tpl.d.ts +0 -3
  169. package/lib/service/type/knex.tpl.js +0 -67
  170. package/lib/service/type/knex.tpl.js.map +0 -1
  171. package/lib/service/type/knex.tpl.ts +0 -88
  172. package/lib/service/type/mongodb.tpl.d.ts +0 -3
  173. package/lib/service/type/mongodb.tpl.js +0 -47
  174. package/lib/service/type/mongodb.tpl.js.map +0 -1
  175. package/lib/service/type/mongodb.tpl.ts +0 -59
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const template = ({ name, description, language, database }) => /* md */ `# ${name}
6
-
7
- > ${description}
8
-
9
- ## About
10
-
11
- This project uses [Feathers](http://feathersjs.com). An open source framework for building APIs and real-time applications.
12
-
13
- ## Getting Started
14
-
15
- 1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.
16
- 2. Install your dependencies
17
-
18
- \`\`\`
19
- cd path/to/${name}
20
- npm install
21
- \`\`\`
22
-
23
- 3. Start your app
24
-
25
- \`\`\`${language === 'ts'
26
- ? `
27
- npm run compile # Compile TypeScript source`
28
- : ''}${database !== 'mongodb'
29
- ? `
30
- npm run migrate # Run migrations to set up the database`
31
- : ''}
32
- npm start
33
- \`\`\`
34
-
35
- ## Testing
36
-
37
- Run \`npm test\` and all your tests in the \`test/\` directory will be run.
38
-
39
- ## Scaffolding
40
-
41
- This app comes with a powerful command line interface for Feathers. Here are a few things it can do:
42
-
43
- \`\`\`
44
- $ npx feathers help # Show all commands
45
- $ npx feathers generate service # Generate a new Service
46
- \`\`\`
47
-
48
- ## Help
49
-
50
- For more information on all the things you can do with Feathers visit [docs.feathersjs.com](http://docs.feathersjs.com).
51
- `;
52
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.renderTemplate)(template, (0, pinion_1.toFile)('readme.md')));
53
- exports.generate = generate;
54
- //# sourceMappingURL=readme.md.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readme.md.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/readme.md.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AAGtE,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,IAAI;;IAEnG,WAAW;;;;;;;;;;;;iBAYE,IAAI;;;;;;YAOf,QAAQ,KAAK,IAAI;IACf,CAAC,CAAC;gDACsC;IACxC,CAAC,CAAC,EACN,GACF,QAAQ,KAAK,SAAS;IACpB,CAAC,CAAC;4DACsD;IACxD,CAAC,CAAC,EACN;;;;;;;;;;;;;;;;;;;;CAoBC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,uBAAc,EAAC,QAAQ,EAAE,IAAA,eAAM,EAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AADvD,QAAA,QAAQ,YAC+C"}
@@ -1,57 +0,0 @@
1
- import { generator, renderTemplate, toFile } from '@feathershq/pinion'
2
- import { AppGeneratorContext } from '../index'
3
-
4
- const template = ({ name, description, language, database }: AppGeneratorContext) => /* md */ `# ${name}
5
-
6
- > ${description}
7
-
8
- ## About
9
-
10
- This project uses [Feathers](http://feathersjs.com). An open source framework for building APIs and real-time applications.
11
-
12
- ## Getting Started
13
-
14
- 1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.
15
- 2. Install your dependencies
16
-
17
- \`\`\`
18
- cd path/to/${name}
19
- npm install
20
- \`\`\`
21
-
22
- 3. Start your app
23
-
24
- \`\`\`${
25
- language === 'ts'
26
- ? `
27
- npm run compile # Compile TypeScript source`
28
- : ''
29
- }${
30
- database !== 'mongodb'
31
- ? `
32
- npm run migrate # Run migrations to set up the database`
33
- : ''
34
- }
35
- npm start
36
- \`\`\`
37
-
38
- ## Testing
39
-
40
- Run \`npm test\` and all your tests in the \`test/\` directory will be run.
41
-
42
- ## Scaffolding
43
-
44
- This app comes with a powerful command line interface for Feathers. Here are a few things it can do:
45
-
46
- \`\`\`
47
- $ npx feathers help # Show all commands
48
- $ npx feathers generate service # Generate a new Service
49
- \`\`\`
50
-
51
- ## Help
52
-
53
- For more information on all the things you can do with Feathers visit [docs.feathersjs.com](http://docs.feathersjs.com).
54
- `
55
-
56
- export const generate = (ctx: AppGeneratorContext) =>
57
- generator(ctx).then(renderTemplate(template, toFile('readme.md')))
@@ -1,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
6
- const validatorTemplate = /* ts */ `import { Ajv, addFormats } from '@feathersjs/schema'
7
- import type { FormatsPluginOptions } from '@feathersjs/schema'
8
-
9
- const formats: FormatsPluginOptions = [
10
- 'date-time',
11
- 'time',
12
- 'date',
13
- 'email',
14
- 'hostname',
15
- 'ipv4',
16
- 'ipv6',
17
- 'uri',
18
- 'uri-reference',
19
- 'uuid',
20
- 'uri-template',
21
- 'json-pointer',
22
- 'relative-json-pointer',
23
- 'regex'
24
- ]
25
-
26
- export const dataValidator = addFormats(new Ajv({}), formats)
27
-
28
- export const queryValidator = addFormats(new Ajv({
29
- coerceTypes: true
30
- }), formats)
31
- `;
32
- const configurationJsonTemplate = ({}) => /* ts */ `import { defaultAppSettings, getValidator } from '@feathersjs/schema'
33
- import type { FromSchema } from '@feathersjs/schema'
34
-
35
- import { dataValidator } from './validators'
36
-
37
- export const configurationSchema = {
38
- type: 'object',
39
- additionalProperties: false,
40
- required: [ 'host', 'port', 'public' ],
41
- properties: {
42
- ...defaultAppSettings,
43
- host: { type: 'string' },
44
- port: { type: 'number' },
45
- public: { type: 'string' }
46
- }
47
- } as const
48
-
49
- export const configurationValidator = getValidator(configurationSchema, dataValidator)
50
-
51
- export type ApplicationConfiguration = FromSchema<typeof configurationSchema>
52
- `;
53
- const configurationTypeboxTemplate = ({}) => /* ts */ `import { Type, getValidator, defaultAppConfiguration } from '@feathersjs/typebox'
54
- import type { Static } from '@feathersjs/typebox'
55
-
56
- import { dataValidator } from './validators'
57
-
58
- export const configurationSchema = Type.Intersect([
59
- defaultAppConfiguration,
60
- Type.Object({
61
- host: Type.String(),
62
- port: Type.Number(),
63
- public: Type.String()
64
- })
65
- ])
66
-
67
- export type ApplicationConfiguration = Static<typeof configurationSchema>
68
-
69
- export const configurationValidator = getValidator(configurationSchema, dataValidator)
70
- `;
71
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
72
- .then((0, commons_1.renderSource)(async (ctx) => ctx.schema === 'typebox' ? configurationTypeboxTemplate(ctx) : configurationJsonTemplate(ctx), (0, pinion_1.toFile)(({ lib }) => lib, 'schemas', 'configuration')))
73
- .then((0, commons_1.renderSource)(validatorTemplate, (0, pinion_1.toFile)(({ lib }) => lib, 'schemas', 'validators')));
74
- exports.generate = generate;
75
- //# sourceMappingURL=schemas.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/schemas.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,iBAAiB,GAAG,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlC,CAAA;AAED,MAAM,yBAAyB,GAC7B,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;CAoBvC,CAAA;AAED,MAAM,4BAA4B,GAChC,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;CAiBvC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,sBAAY,EACV,KAAK,EAAE,GAAG,EAAE,EAAE,CACZ,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAC/F,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,eAAe,CAAC,CAC1E,CACF;KACA,IAAI,CACH,IAAA,sBAAY,EACV,iBAAiB,EACjB,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,CACvE,CACF,CAAA;AAdQ,QAAA,QAAQ,YAchB"}
@@ -1,89 +0,0 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AppGeneratorContext } from '../index'
4
-
5
- const validatorTemplate = /* ts */ `import { Ajv, addFormats } from '@feathersjs/schema'
6
- import type { FormatsPluginOptions } from '@feathersjs/schema'
7
-
8
- const formats: FormatsPluginOptions = [
9
- 'date-time',
10
- 'time',
11
- 'date',
12
- 'email',
13
- 'hostname',
14
- 'ipv4',
15
- 'ipv6',
16
- 'uri',
17
- 'uri-reference',
18
- 'uuid',
19
- 'uri-template',
20
- 'json-pointer',
21
- 'relative-json-pointer',
22
- 'regex'
23
- ]
24
-
25
- export const dataValidator = addFormats(new Ajv({}), formats)
26
-
27
- export const queryValidator = addFormats(new Ajv({
28
- coerceTypes: true
29
- }), formats)
30
- `
31
-
32
- const configurationJsonTemplate =
33
- ({}: AppGeneratorContext) => /* ts */ `import { defaultAppSettings, getValidator } from '@feathersjs/schema'
34
- import type { FromSchema } from '@feathersjs/schema'
35
-
36
- import { dataValidator } from './validators'
37
-
38
- export const configurationSchema = {
39
- type: 'object',
40
- additionalProperties: false,
41
- required: [ 'host', 'port', 'public' ],
42
- properties: {
43
- ...defaultAppSettings,
44
- host: { type: 'string' },
45
- port: { type: 'number' },
46
- public: { type: 'string' }
47
- }
48
- } as const
49
-
50
- export const configurationValidator = getValidator(configurationSchema, dataValidator)
51
-
52
- export type ApplicationConfiguration = FromSchema<typeof configurationSchema>
53
- `
54
-
55
- const configurationTypeboxTemplate =
56
- ({}: AppGeneratorContext) => /* ts */ `import { Type, getValidator, defaultAppConfiguration } from '@feathersjs/typebox'
57
- import type { Static } from '@feathersjs/typebox'
58
-
59
- import { dataValidator } from './validators'
60
-
61
- export const configurationSchema = Type.Intersect([
62
- defaultAppConfiguration,
63
- Type.Object({
64
- host: Type.String(),
65
- port: Type.Number(),
66
- public: Type.String()
67
- })
68
- ])
69
-
70
- export type ApplicationConfiguration = Static<typeof configurationSchema>
71
-
72
- export const configurationValidator = getValidator(configurationSchema, dataValidator)
73
- `
74
-
75
- export const generate = (ctx: AppGeneratorContext) =>
76
- generator(ctx)
77
- .then(
78
- renderSource(
79
- async (ctx) =>
80
- ctx.schema === 'typebox' ? configurationTypeboxTemplate(ctx) : configurationJsonTemplate(ctx),
81
- toFile<AppGeneratorContext>(({ lib }) => lib, 'schemas', 'configuration')
82
- )
83
- )
84
- .then(
85
- renderSource(
86
- validatorTemplate,
87
- toFile<AppGeneratorContext>(({ lib }) => lib, 'schemas', 'validators')
88
- )
89
- )
@@ -1,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
6
- const template = ({}) => /* ts */ `import type { Application } from '../declarations'
7
-
8
- export const services = (app: Application) => {
9
- // All services will be registered here
10
- }
11
- `;
12
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'services', 'index')));
13
- exports.generate = generate;
14
- //# sourceMappingURL=services.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/services.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;CAKtD,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,CACnE,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -1,18 +0,0 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AppGeneratorContext } from '../index'
4
-
5
- const template = ({}: AppGeneratorContext) => /* ts */ `import type { Application } from '../declarations'
6
-
7
- export const services = (app: Application) => {
8
- // All services will be registered here
9
- }
10
- `
11
-
12
- export const generate = (ctx: AppGeneratorContext) =>
13
- generator(ctx).then(
14
- renderSource(
15
- template,
16
- toFile<AppGeneratorContext>(({ lib }) => lib, 'services', 'index')
17
- )
18
- )
@@ -1,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)((ctx) => ctx.language === 'ts', (0, pinion_1.writeJSON)(({ lib }) => ({
6
- 'ts-node': {
7
- files: true
8
- },
9
- compilerOptions: {
10
- target: 'es2020',
11
- module: 'commonjs',
12
- outDir: './lib',
13
- rootDir: `./${lib}`,
14
- declaration: true,
15
- strict: true,
16
- esModuleInterop: true
17
- },
18
- include: [lib],
19
- exclude: ['test']
20
- }), (0, pinion_1.toFile)('tsconfig.json'))));
21
- exports.generate = generate;
22
- //# sourceMappingURL=tsconfig.json.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig.json.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/tsconfig.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAuE;AAGhE,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,IAAA,kBAAS,EACP,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACZ,SAAS,EAAE;QACT,KAAK,EAAE,IAAI;KACZ;IACD,eAAe,EAAE;QACf,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,KAAK,GAAG,EAAE;QACnB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;KACtB;IACD,OAAO,EAAE,CAAC,GAAG,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC,EACF,IAAA,eAAM,EAAC,eAAe,CAAC,CACxB,CACF,CACF,CAAA;AAxBU,QAAA,QAAQ,YAwBlB"}
@@ -1,28 +0,0 @@
1
- import { generator, toFile, when, writeJSON } from '@feathershq/pinion'
2
- import { AppGeneratorContext } from '../index'
3
-
4
- export const generate = (ctx: AppGeneratorContext) =>
5
- generator(ctx).then(
6
- when<AppGeneratorContext>(
7
- (ctx) => ctx.language === 'ts',
8
- writeJSON<AppGeneratorContext>(
9
- ({ lib }) => ({
10
- 'ts-node': {
11
- files: true
12
- },
13
- compilerOptions: {
14
- target: 'es2020',
15
- module: 'commonjs',
16
- outDir: './lib',
17
- rootDir: `./${lib}`,
18
- declaration: true,
19
- strict: true,
20
- esModuleInterop: true
21
- },
22
- include: [lib],
23
- exclude: ['test']
24
- }),
25
- toFile('tsconfig.json')
26
- )
27
- )
28
- )
@@ -1,73 +0,0 @@
1
- import { FeathersBaseContext } from '../commons';
2
- import { ServiceGeneratorContext } from '../service/index';
3
- export interface AuthenticationGeneratorContext extends ServiceGeneratorContext {
4
- service: string;
5
- entity: string;
6
- authStrategies: string[];
7
- dependencies: string[];
8
- }
9
- export declare type AuthenticationGeneratorArguments = FeathersBaseContext & Partial<Pick<AuthenticationGeneratorContext, 'service' | 'authStrategies' | 'entity' | 'path'>>;
10
- export declare const localTemplate: (authStrategies: string[], content: string) => string;
11
- export declare const oauthTemplate: (authStrategies: string[], content: string) => string;
12
- export declare const prompts: (ctx: AuthenticationGeneratorArguments) => ({
13
- type: string;
14
- name: string;
15
- when: boolean;
16
- message: string;
17
- suffix: string;
18
- choices: ({
19
- name: string;
20
- value: string;
21
- checked: boolean;
22
- } | {
23
- name: string;
24
- value: string;
25
- checked?: undefined;
26
- })[];
27
- default?: undefined;
28
- } | {
29
- name: string;
30
- type: string;
31
- when: boolean;
32
- message: string;
33
- default: string;
34
- suffix?: undefined;
35
- choices?: undefined;
36
- } | {
37
- name: string;
38
- type: string;
39
- when: boolean;
40
- message: string;
41
- suffix: string;
42
- default: string;
43
- choices?: undefined;
44
- })[];
45
- export declare const generate: (ctx: AuthenticationGeneratorArguments) => Promise<{
46
- dependencies: string[];
47
- name: string;
48
- path: string;
49
- folder: string[];
50
- camelName: string;
51
- upperName: string;
52
- className: string;
53
- kebabName: string;
54
- fileName: string;
55
- kebabPath: string;
56
- relative: string;
57
- type: "mongodb" | "knex" | "custom";
58
- schema: false | "typebox" | "json";
59
- authentication: boolean;
60
- isEntityService?: boolean;
61
- feathers: import("../commons").FeathersAppInfo;
62
- pkg: import("../commons").AppPackageJson;
63
- lib: string;
64
- test: string;
65
- language: "ts" | "js";
66
- dependencyVersions?: import("../commons").DependencyVersions;
67
- cwd: string;
68
- _?: (string | number)[];
69
- pinion: import("@feathershq/pinion").Configuration;
70
- service: string;
71
- entity: string;
72
- authStrategies: string[];
73
- }>;
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generate = exports.prompts = exports.oauthTemplate = exports.localTemplate = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const pinion_1 = require("@feathershq/pinion");
9
- const commons_1 = require("../commons");
10
- const index_1 = require("../service/index");
11
- const localTemplate = (authStrategies, content) => authStrategies.includes('local') ? content : '';
12
- exports.localTemplate = localTemplate;
13
- const oauthTemplate = (authStrategies, content) => authStrategies.filter((s) => s !== 'local').length > 0 ? content : '';
14
- exports.oauthTemplate = oauthTemplate;
15
- const prompts = (ctx) => [
16
- {
17
- type: 'checkbox',
18
- name: 'authStrategies',
19
- when: !ctx.authStrategies,
20
- message: 'Which authentication methods do you want to use?',
21
- suffix: chalk_1.default.grey(' Other methods and providers can be added at any time.'),
22
- choices: [
23
- {
24
- name: 'Email + Password',
25
- value: 'local',
26
- checked: true
27
- },
28
- {
29
- name: 'Google',
30
- value: 'google'
31
- },
32
- {
33
- name: 'Facebook',
34
- value: 'facebook'
35
- },
36
- {
37
- name: 'Twitter',
38
- value: 'twitter'
39
- },
40
- {
41
- name: 'GitHub',
42
- value: 'github'
43
- },
44
- {
45
- name: 'Auth0',
46
- value: 'auth0'
47
- }
48
- ]
49
- },
50
- {
51
- name: 'service',
52
- type: 'input',
53
- when: !ctx.service,
54
- message: 'What is your authentication service name?',
55
- default: 'user'
56
- },
57
- {
58
- name: 'path',
59
- type: 'input',
60
- when: !ctx.path,
61
- message: 'What path should the service be registered on?',
62
- default: 'users'
63
- },
64
- {
65
- name: 'entity',
66
- type: 'input',
67
- when: !ctx.entity,
68
- message: 'What is your authenticated entity name?',
69
- suffix: chalk_1.default.grey(' Will be available in params (e.g. params.user)'),
70
- default: 'user'
71
- }
72
- ];
73
- exports.prompts = prompts;
74
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
75
- .then((0, commons_1.initializeBaseContext)())
76
- .then((0, commons_1.checkPreconditions)())
77
- .then((0, pinion_1.prompt)(exports.prompts))
78
- .then(async (ctx) => {
79
- var _a;
80
- const serviceContext = await (0, index_1.generate)({
81
- ...ctx,
82
- name: ctx.service,
83
- isEntityService: true,
84
- type: (0, commons_1.getDatabaseAdapter)((_a = ctx.feathers) === null || _a === void 0 ? void 0 : _a.database)
85
- });
86
- return {
87
- ...ctx,
88
- ...serviceContext
89
- };
90
- })
91
- .then((0, pinion_1.runGenerators)(__dirname, 'templates'))
92
- .then((ctx) => {
93
- const dependencies = [];
94
- dependencies.push('@feathersjs/authentication-oauth');
95
- if (ctx.authStrategies.includes('local')) {
96
- dependencies.push('@feathersjs/authentication-local');
97
- }
98
- if (ctx.dependencies) {
99
- return {
100
- ...ctx,
101
- dependencies: [...ctx.dependencies, ...dependencies]
102
- };
103
- }
104
- return (0, pinion_1.install)((0, commons_1.addVersions)(dependencies, ctx.dependencyVersions), false, ctx.feathers.packager)(ctx);
105
- });
106
- exports.generate = generate;
107
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,+CAA8E;AAC9E,wCAMmB;AACnB,4CAAwF;AAYjF,MAAM,aAAa,GAAG,CAAC,cAAwB,EAAE,OAAe,EAAE,EAAE,CACzE,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;AADpC,QAAA,aAAa,iBACuB;AAC1C,MAAM,aAAa,GAAG,CAAC,cAAwB,EAAE,OAAe,EAAE,EAAE,CACzE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;AAD1D,QAAA,aAAa,iBAC6C;AAEhE,MAAM,OAAO,GAAG,CAAC,GAAqC,EAAE,EAAE,CAAC;IAChE;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,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