@feathersjs/cli 5.0.0-pre.34 → 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 (171) hide show
  1. package/CHANGELOG.md +13 -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 +28 -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 -228
  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 -49
  13. package/lib/app/templates/app.test.tpl.js.map +0 -1
  14. package/lib/app/templates/app.test.tpl.ts +0 -50
  15. package/lib/app/templates/app.tpl.d.ts +0 -2
  16. package/lib/app/templates/app.tpl.js +0 -123
  17. package/lib/app/templates/app.tpl.js.map +0 -1
  18. package/lib/app/templates/app.tpl.ts +0 -138
  19. package/lib/app/templates/channels.tpl.d.ts +0 -2
  20. package/lib/app/templates/channels.tpl.js +0 -49
  21. package/lib/app/templates/channels.tpl.js.map +0 -1
  22. package/lib/app/templates/channels.tpl.ts +0 -55
  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 -38
  29. package/lib/app/templates/client.tpl.js.map +0 -1
  30. package/lib/app/templates/client.tpl.ts +0 -45
  31. package/lib/app/templates/configuration.tpl.d.ts +0 -2
  32. package/lib/app/templates/configuration.tpl.js +0 -71
  33. package/lib/app/templates/configuration.tpl.js.map +0 -1
  34. package/lib/app/templates/configuration.tpl.ts +0 -82
  35. package/lib/app/templates/declarations.tpl.d.ts +0 -2
  36. package/lib/app/templates/declarations.tpl.js +0 -28
  37. package/lib/app/templates/declarations.tpl.js.map +0 -1
  38. package/lib/app/templates/declarations.tpl.ts +0 -37
  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 -3
  48. package/lib/app/templates/logger.tpl.js +0 -45
  49. package/lib/app/templates/logger.tpl.js.map +0 -1
  50. package/lib/app/templates/logger.tpl.ts +0 -56
  51. package/lib/app/templates/package.json.tpl.d.ts +0 -2
  52. package/lib/app/templates/package.json.tpl.js +0 -58
  53. package/lib/app/templates/package.json.tpl.js.map +0 -1
  54. package/lib/app/templates/package.json.tpl.ts +0 -71
  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/services.tpl.d.ts +0 -2
  64. package/lib/app/templates/services.tpl.js +0 -15
  65. package/lib/app/templates/services.tpl.js.map +0 -1
  66. package/lib/app/templates/services.tpl.ts +0 -20
  67. package/lib/app/templates/tsconfig.json.tpl.d.ts +0 -2
  68. package/lib/app/templates/tsconfig.json.tpl.js +0 -22
  69. package/lib/app/templates/tsconfig.json.tpl.js.map +0 -1
  70. package/lib/app/templates/tsconfig.json.tpl.ts +0 -28
  71. package/lib/app/templates/validators.tpl.d.ts +0 -2
  72. package/lib/app/templates/validators.tpl.js +0 -36
  73. package/lib/app/templates/validators.tpl.js.map +0 -1
  74. package/lib/app/templates/validators.tpl.ts +0 -40
  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 -40
  81. package/lib/authentication/templates/authentication.tpl.js.map +0 -1
  82. package/lib/authentication/templates/authentication.tpl.ts +0 -51
  83. package/lib/authentication/templates/client.test.tpl.d.ts +0 -2
  84. package/lib/authentication/templates/client.test.tpl.js +0 -62
  85. package/lib/authentication/templates/client.test.tpl.js.map +0 -1
  86. package/lib/authentication/templates/client.test.tpl.ts +0 -74
  87. package/lib/authentication/templates/config.tpl.d.ts +0 -2
  88. package/lib/authentication/templates/config.tpl.js +0 -50
  89. package/lib/authentication/templates/config.tpl.js.map +0 -1
  90. package/lib/authentication/templates/config.tpl.ts +0 -57
  91. package/lib/authentication/templates/declarations.tpl.d.ts +0 -2
  92. package/lib/authentication/templates/declarations.tpl.js +0 -19
  93. package/lib/authentication/templates/declarations.tpl.js.map +0 -1
  94. package/lib/authentication/templates/declarations.tpl.ts +0 -34
  95. package/lib/authentication/templates/knex.tpl.d.ts +0 -2
  96. package/lib/authentication/templates/knex.tpl.js +0 -45
  97. package/lib/authentication/templates/knex.tpl.js.map +0 -1
  98. package/lib/authentication/templates/knex.tpl.ts +0 -62
  99. package/lib/authentication/templates/schema.json.tpl.d.ts +0 -2
  100. package/lib/authentication/templates/schema.json.tpl.js +0 -103
  101. package/lib/authentication/templates/schema.json.tpl.js.map +0 -1
  102. package/lib/authentication/templates/schema.json.tpl.ts +0 -124
  103. package/lib/authentication/templates/schema.typebox.tpl.d.ts +0 -3
  104. package/lib/authentication/templates/schema.typebox.tpl.js +0 -86
  105. package/lib/authentication/templates/schema.typebox.tpl.js.map +0 -1
  106. package/lib/authentication/templates/schema.typebox.tpl.ts +0 -108
  107. package/lib/cli.d.ts +0 -6
  108. package/lib/cli.js +0 -75
  109. package/lib/cli.js.map +0 -1
  110. package/lib/cli.ts +0 -68
  111. package/lib/commons.d.ts +0 -150
  112. package/lib/commons.js +0 -198
  113. package/lib/commons.js.map +0 -1
  114. package/lib/commons.ts +0 -284
  115. package/lib/connection/index.d.ts +0 -55
  116. package/lib/connection/index.js +0 -88
  117. package/lib/connection/index.js.map +0 -1
  118. package/lib/connection/index.ts +0 -123
  119. package/lib/connection/templates/knex.tpl.d.ts +0 -2
  120. package/lib/connection/templates/knex.tpl.js +0 -48
  121. package/lib/connection/templates/knex.tpl.js.map +0 -1
  122. package/lib/connection/templates/knex.tpl.ts +0 -67
  123. package/lib/connection/templates/mongodb.tpl.d.ts +0 -2
  124. package/lib/connection/templates/mongodb.tpl.js +0 -34
  125. package/lib/connection/templates/mongodb.tpl.js.map +0 -1
  126. package/lib/connection/templates/mongodb.tpl.ts +0 -40
  127. package/lib/hook/index.d.ts +0 -22
  128. package/lib/hook/index.js +0 -43
  129. package/lib/hook/index.js.map +0 -1
  130. package/lib/hook/index.ts +0 -47
  131. package/lib/hook/templates/hook.tpl.d.ts +0 -2
  132. package/lib/hook/templates/hook.tpl.js +0 -22
  133. package/lib/hook/templates/hook.tpl.js.map +0 -1
  134. package/lib/hook/templates/hook.tpl.ts +0 -33
  135. package/lib/index.ts +0 -2
  136. package/lib/service/index.d.ts +0 -64
  137. package/lib/service/index.js +0 -116
  138. package/lib/service/index.js.map +0 -1
  139. package/lib/service/index.ts +0 -191
  140. package/lib/service/templates/client.tpl.d.ts +0 -2
  141. package/lib/service/templates/client.tpl.js +0 -31
  142. package/lib/service/templates/client.tpl.js.map +0 -1
  143. package/lib/service/templates/client.tpl.ts +0 -57
  144. package/lib/service/templates/schema.json.tpl.d.ts +0 -2
  145. package/lib/service/templates/schema.json.tpl.js +0 -83
  146. package/lib/service/templates/schema.json.tpl.js.map +0 -1
  147. package/lib/service/templates/schema.json.tpl.ts +0 -98
  148. package/lib/service/templates/schema.typebox.tpl.d.ts +0 -2
  149. package/lib/service/templates/schema.typebox.tpl.js +0 -61
  150. package/lib/service/templates/schema.typebox.tpl.js.map +0 -1
  151. package/lib/service/templates/schema.typebox.tpl.ts +0 -76
  152. package/lib/service/templates/service.tpl.d.ts +0 -3
  153. package/lib/service/templates/service.tpl.js +0 -112
  154. package/lib/service/templates/service.tpl.js.map +0 -1
  155. package/lib/service/templates/service.tpl.ts +0 -152
  156. package/lib/service/templates/test.tpl.d.ts +0 -2
  157. package/lib/service/templates/test.tpl.js +0 -25
  158. package/lib/service/templates/test.tpl.js.map +0 -1
  159. package/lib/service/templates/test.tpl.ts +0 -33
  160. package/lib/service/type/custom.tpl.d.ts +0 -3
  161. package/lib/service/type/custom.tpl.js +0 -98
  162. package/lib/service/type/custom.tpl.js.map +0 -1
  163. package/lib/service/type/custom.tpl.ts +0 -109
  164. package/lib/service/type/knex.tpl.d.ts +0 -3
  165. package/lib/service/type/knex.tpl.js +0 -71
  166. package/lib/service/type/knex.tpl.js.map +0 -1
  167. package/lib/service/type/knex.tpl.ts +0 -92
  168. package/lib/service/type/mongodb.tpl.d.ts +0 -3
  169. package/lib/service/type/mongodb.tpl.js +0 -50
  170. package/lib/service/type/mongodb.tpl.js.map +0 -1
  171. package/lib/service/type/mongodb.tpl.ts +0 -62
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.json.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/package.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAGjE,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC;IACtC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,KAAK,EAAE,QAAQ,GAAG,EAAE;QACpB,GAAG,EAAE,WAAW,GAAG,GAAG;QACtB,QAAQ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a,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CACjE,CAAC,CAAA;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,kBAAS,EAAC,WAAW,EAAE,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC,CAAC,CAAA;AADxD,QAAA,QAAQ,YACgD"}
@@ -1,71 +0,0 @@
1
- import { generator, toFile, writeJSON } from '@feathershq/pinion'
2
- import { AppGeneratorContext } from '../index'
3
-
4
- const jsPackageJson = (lib: string) => ({
5
- type: 'module',
6
- scripts: {
7
- start: `node ${lib}`,
8
- dev: `nodemon ${lib}/`,
9
- prettier: 'npx prettier "**/*.js" --write',
10
- mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
11
- test: 'npm run mocha',
12
- 'bundle:client': 'npm pack --pack-destination ./public'
13
- }
14
- })
15
-
16
- const tsPackageJson = (lib: string) => ({
17
- scripts: {
18
- dev: `nodemon -x ts-node ${lib}/index.ts`,
19
- compile: 'shx rm -rf lib/ && tsc',
20
- start: 'node lib/',
21
- prettier: 'npx prettier "**/*.ts" --write',
22
- mocha:
23
- 'cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit',
24
- test: 'npm run mocha',
25
- 'bundle:client': 'npm run compile && npm pack --pack-destination ./public'
26
- }
27
- })
28
-
29
- const packageJson = ({
30
- name,
31
- description,
32
- language,
33
- packager,
34
- database,
35
- framework,
36
- transports,
37
- lib,
38
- test,
39
- schema
40
- }: AppGeneratorContext) => ({
41
- name,
42
- description,
43
- version: '0.0.0',
44
- homepage: '',
45
- private: true,
46
- keywords: ['feathers'],
47
- author: {},
48
- contributors: [] as string[],
49
- bugs: {},
50
- engines: {
51
- node: `>= ${process.version.substring(1)}`
52
- },
53
- feathers: {
54
- language,
55
- packager,
56
- database,
57
- framework,
58
- transports,
59
- schema
60
- },
61
- directories: {
62
- lib,
63
- test
64
- },
65
- files: ['lib/client.js', 'lib/**/*.d.ts'],
66
- main: language === 'ts' ? 'lib/client' : `${lib}/client`,
67
- ...(language === 'ts' ? tsPackageJson(lib) : jsPackageJson(lib))
68
- })
69
-
70
- export const generate = (ctx: AppGeneratorContext) =>
71
- generator(ctx).then(writeJSON(packageJson, toFile('package.json')))
@@ -1,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -1,11 +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 generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.writeJSON)((ctx) => ({
7
- ...commons_1.PRETTIERRC,
8
- parser: ctx.language === 'ts' ? 'typescript' : 'babel'
9
- }), (0, pinion_1.toFile)('.prettierrc')));
10
- exports.generate = generate;
11
- //# sourceMappingURL=prettierrc.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettierrc.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/prettierrc.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAEjE,2CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,kBAAS,EACP,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACR,GAAG,oBAAU;IACb,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO;CACvD,CAAC,EACF,IAAA,eAAM,EAAC,aAAa,CAAC,CACtB,CACF,CAAA;AATU,QAAA,QAAQ,YASlB"}
@@ -1,14 +0,0 @@
1
- import { generator, toFile, writeJSON } from '@feathershq/pinion'
2
- import { AppGeneratorContext } from '../index'
3
- import { PRETTIERRC } from '../../commons'
4
-
5
- export const generate = (ctx: AppGeneratorContext) =>
6
- generator(ctx).then(
7
- writeJSON<AppGeneratorContext>(
8
- (ctx) => ({
9
- ...PRETTIERRC,
10
- parser: ctx.language === 'ts' ? 'typescript' : 'babel'
11
- }),
12
- toFile('.prettierrc')
13
- )
14
- )
@@ -1,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -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,15 +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 */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/application.html#configure-functions
7
- import type { Application } from '../declarations'
8
-
9
- export const services = (app: Application) => {
10
- // All services will be registered here
11
- }
12
- `;
13
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'services', 'index')));
14
- exports.generate = generate;
15
- //# 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,GACZ,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;CAMvC,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,20 +0,0 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AppGeneratorContext } from '../index'
4
-
5
- const template =
6
- ({}: AppGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/application.html#configure-functions
7
- import type { Application } from '../declarations'
8
-
9
- export const services = (app: Application) => {
10
- // All services will be registered here
11
- }
12
- `
13
-
14
- export const generate = (ctx: AppGeneratorContext) =>
15
- generator(ctx).then(
16
- renderSource(
17
- template,
18
- toFile<AppGeneratorContext>(({ lib }) => lib, 'services', 'index')
19
- )
20
- )
@@ -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,2 +0,0 @@
1
- import { AppGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -1,36 +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 */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
7
- import { Ajv, addFormats } from '@feathersjs/schema'
8
- import type { FormatsPluginOptions } from '@feathersjs/schema'
9
-
10
- const formats: FormatsPluginOptions = [
11
- 'date-time',
12
- 'time',
13
- 'date',
14
- 'email',
15
- 'hostname',
16
- 'ipv4',
17
- 'ipv6',
18
- 'uri',
19
- 'uri-reference',
20
- 'uuid',
21
- 'uri-template',
22
- 'json-pointer',
23
- 'relative-json-pointer',
24
- 'regex'
25
- ]
26
-
27
- export const dataValidator: Ajv = addFormats(new Ajv({}), formats)
28
-
29
- export const queryValidator: Ajv = addFormats(new Ajv({
30
- coerceTypes: true,
31
- removeAdditional: true
32
- }), formats)
33
- `;
34
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(validatorTemplate, (0, pinion_1.toFile)(({ lib }) => lib, 'validators')));
35
- exports.generate = generate;
36
- //# sourceMappingURL=validators.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/validators.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,iBAAiB,GAAG,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,iBAAiB,EACjB,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,CAAC,CAC5D,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -1,40 +0,0 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AppGeneratorContext } from '../index'
4
-
5
- const validatorTemplate = /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
6
- 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: Ajv = addFormats(new Ajv({}), formats)
27
-
28
- export const queryValidator: Ajv = addFormats(new Ajv({
29
- coerceTypes: true,
30
- removeAdditional: true
31
- }), formats)
32
- `
33
-
34
- export const generate = (ctx: AppGeneratorContext) =>
35
- generator(ctx).then(
36
- renderSource(
37
- validatorTemplate,
38
- toFile<AppGeneratorContext>(({ lib }) => lib, 'validators')
39
- )
40
- )
@@ -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 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,gBAAgB;QACtB,IAAI,EAAE,CAAC,GAAG,CAAC,cAAc;QACzB,OAAO,EAAE,kDAAkD;QAC3D,MAAM,EAAE,eAAK,CAAC,IAAI,CAAC,wDAAwD,CAAC;QAC5E,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,IAAI;aACd;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;aAChB;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,UAAU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