@feathersjs/cli 5.0.0-pre.34 → 5.0.0-pre.36

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 (173) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/lib/index.d.ts +6 -2
  5. package/lib/index.js +59 -2
  6. package/lib/index.js.map +1 -1
  7. package/package.json +28 -30
  8. package/lib/app/index.d.ts +0 -29
  9. package/lib/app/index.js +0 -146
  10. package/lib/app/index.js.map +0 -1
  11. package/lib/app/index.ts +0 -228
  12. package/lib/app/static/.gitignore +0 -121
  13. package/lib/app/templates/app.test.tpl.d.ts +0 -2
  14. package/lib/app/templates/app.test.tpl.js +0 -49
  15. package/lib/app/templates/app.test.tpl.js.map +0 -1
  16. package/lib/app/templates/app.test.tpl.ts +0 -50
  17. package/lib/app/templates/app.tpl.d.ts +0 -2
  18. package/lib/app/templates/app.tpl.js +0 -123
  19. package/lib/app/templates/app.tpl.js.map +0 -1
  20. package/lib/app/templates/app.tpl.ts +0 -138
  21. package/lib/app/templates/channels.tpl.d.ts +0 -2
  22. package/lib/app/templates/channels.tpl.js +0 -49
  23. package/lib/app/templates/channels.tpl.js.map +0 -1
  24. package/lib/app/templates/channels.tpl.ts +0 -55
  25. package/lib/app/templates/client.test.tpl.d.ts +0 -2
  26. package/lib/app/templates/client.test.tpl.js +0 -27
  27. package/lib/app/templates/client.test.tpl.js.map +0 -1
  28. package/lib/app/templates/client.test.tpl.ts +0 -26
  29. package/lib/app/templates/client.tpl.d.ts +0 -2
  30. package/lib/app/templates/client.tpl.js +0 -38
  31. package/lib/app/templates/client.tpl.js.map +0 -1
  32. package/lib/app/templates/client.tpl.ts +0 -45
  33. package/lib/app/templates/configuration.tpl.d.ts +0 -2
  34. package/lib/app/templates/configuration.tpl.js +0 -71
  35. package/lib/app/templates/configuration.tpl.js.map +0 -1
  36. package/lib/app/templates/configuration.tpl.ts +0 -82
  37. package/lib/app/templates/declarations.tpl.d.ts +0 -2
  38. package/lib/app/templates/declarations.tpl.js +0 -28
  39. package/lib/app/templates/declarations.tpl.js.map +0 -1
  40. package/lib/app/templates/declarations.tpl.ts +0 -37
  41. package/lib/app/templates/index.html.tpl.d.ts +0 -2
  42. package/lib/app/templates/index.html.tpl.js +0 -45
  43. package/lib/app/templates/index.html.tpl.js.map +0 -1
  44. package/lib/app/templates/index.html.tpl.ts +0 -44
  45. package/lib/app/templates/index.tpl.d.ts +0 -2
  46. package/lib/app/templates/index.tpl.js +0 -18
  47. package/lib/app/templates/index.tpl.js.map +0 -1
  48. package/lib/app/templates/index.tpl.ts +0 -22
  49. package/lib/app/templates/logger.tpl.d.ts +0 -3
  50. package/lib/app/templates/logger.tpl.js +0 -45
  51. package/lib/app/templates/logger.tpl.js.map +0 -1
  52. package/lib/app/templates/logger.tpl.ts +0 -56
  53. package/lib/app/templates/package.json.tpl.d.ts +0 -2
  54. package/lib/app/templates/package.json.tpl.js +0 -58
  55. package/lib/app/templates/package.json.tpl.js.map +0 -1
  56. package/lib/app/templates/package.json.tpl.ts +0 -71
  57. package/lib/app/templates/prettierrc.tpl.d.ts +0 -2
  58. package/lib/app/templates/prettierrc.tpl.js +0 -11
  59. package/lib/app/templates/prettierrc.tpl.js.map +0 -1
  60. package/lib/app/templates/prettierrc.tpl.ts +0 -14
  61. package/lib/app/templates/readme.md.tpl.d.ts +0 -2
  62. package/lib/app/templates/readme.md.tpl.js +0 -54
  63. package/lib/app/templates/readme.md.tpl.js.map +0 -1
  64. package/lib/app/templates/readme.md.tpl.ts +0 -57
  65. package/lib/app/templates/services.tpl.d.ts +0 -2
  66. package/lib/app/templates/services.tpl.js +0 -15
  67. package/lib/app/templates/services.tpl.js.map +0 -1
  68. package/lib/app/templates/services.tpl.ts +0 -20
  69. package/lib/app/templates/tsconfig.json.tpl.d.ts +0 -2
  70. package/lib/app/templates/tsconfig.json.tpl.js +0 -22
  71. package/lib/app/templates/tsconfig.json.tpl.js.map +0 -1
  72. package/lib/app/templates/tsconfig.json.tpl.ts +0 -28
  73. package/lib/app/templates/validators.tpl.d.ts +0 -2
  74. package/lib/app/templates/validators.tpl.js +0 -36
  75. package/lib/app/templates/validators.tpl.js.map +0 -1
  76. package/lib/app/templates/validators.tpl.ts +0 -40
  77. package/lib/authentication/index.d.ts +0 -73
  78. package/lib/authentication/index.js +0 -107
  79. package/lib/authentication/index.js.map +0 -1
  80. package/lib/authentication/index.ts +0 -126
  81. package/lib/authentication/templates/authentication.tpl.d.ts +0 -2
  82. package/lib/authentication/templates/authentication.tpl.js +0 -40
  83. package/lib/authentication/templates/authentication.tpl.js.map +0 -1
  84. package/lib/authentication/templates/authentication.tpl.ts +0 -51
  85. package/lib/authentication/templates/client.test.tpl.d.ts +0 -2
  86. package/lib/authentication/templates/client.test.tpl.js +0 -62
  87. package/lib/authentication/templates/client.test.tpl.js.map +0 -1
  88. package/lib/authentication/templates/client.test.tpl.ts +0 -74
  89. package/lib/authentication/templates/config.tpl.d.ts +0 -2
  90. package/lib/authentication/templates/config.tpl.js +0 -50
  91. package/lib/authentication/templates/config.tpl.js.map +0 -1
  92. package/lib/authentication/templates/config.tpl.ts +0 -57
  93. package/lib/authentication/templates/declarations.tpl.d.ts +0 -2
  94. package/lib/authentication/templates/declarations.tpl.js +0 -19
  95. package/lib/authentication/templates/declarations.tpl.js.map +0 -1
  96. package/lib/authentication/templates/declarations.tpl.ts +0 -34
  97. package/lib/authentication/templates/knex.tpl.d.ts +0 -2
  98. package/lib/authentication/templates/knex.tpl.js +0 -45
  99. package/lib/authentication/templates/knex.tpl.js.map +0 -1
  100. package/lib/authentication/templates/knex.tpl.ts +0 -62
  101. package/lib/authentication/templates/schema.json.tpl.d.ts +0 -2
  102. package/lib/authentication/templates/schema.json.tpl.js +0 -103
  103. package/lib/authentication/templates/schema.json.tpl.js.map +0 -1
  104. package/lib/authentication/templates/schema.json.tpl.ts +0 -124
  105. package/lib/authentication/templates/schema.typebox.tpl.d.ts +0 -3
  106. package/lib/authentication/templates/schema.typebox.tpl.js +0 -86
  107. package/lib/authentication/templates/schema.typebox.tpl.js.map +0 -1
  108. package/lib/authentication/templates/schema.typebox.tpl.ts +0 -108
  109. package/lib/cli.d.ts +0 -6
  110. package/lib/cli.js +0 -75
  111. package/lib/cli.js.map +0 -1
  112. package/lib/cli.ts +0 -68
  113. package/lib/commons.d.ts +0 -150
  114. package/lib/commons.js +0 -198
  115. package/lib/commons.js.map +0 -1
  116. package/lib/commons.ts +0 -284
  117. package/lib/connection/index.d.ts +0 -55
  118. package/lib/connection/index.js +0 -88
  119. package/lib/connection/index.js.map +0 -1
  120. package/lib/connection/index.ts +0 -123
  121. package/lib/connection/templates/knex.tpl.d.ts +0 -2
  122. package/lib/connection/templates/knex.tpl.js +0 -48
  123. package/lib/connection/templates/knex.tpl.js.map +0 -1
  124. package/lib/connection/templates/knex.tpl.ts +0 -67
  125. package/lib/connection/templates/mongodb.tpl.d.ts +0 -2
  126. package/lib/connection/templates/mongodb.tpl.js +0 -34
  127. package/lib/connection/templates/mongodb.tpl.js.map +0 -1
  128. package/lib/connection/templates/mongodb.tpl.ts +0 -40
  129. package/lib/hook/index.d.ts +0 -22
  130. package/lib/hook/index.js +0 -43
  131. package/lib/hook/index.js.map +0 -1
  132. package/lib/hook/index.ts +0 -47
  133. package/lib/hook/templates/hook.tpl.d.ts +0 -2
  134. package/lib/hook/templates/hook.tpl.js +0 -22
  135. package/lib/hook/templates/hook.tpl.js.map +0 -1
  136. package/lib/hook/templates/hook.tpl.ts +0 -33
  137. package/lib/index.ts +0 -2
  138. package/lib/service/index.d.ts +0 -64
  139. package/lib/service/index.js +0 -116
  140. package/lib/service/index.js.map +0 -1
  141. package/lib/service/index.ts +0 -191
  142. package/lib/service/templates/client.tpl.d.ts +0 -2
  143. package/lib/service/templates/client.tpl.js +0 -31
  144. package/lib/service/templates/client.tpl.js.map +0 -1
  145. package/lib/service/templates/client.tpl.ts +0 -57
  146. package/lib/service/templates/schema.json.tpl.d.ts +0 -2
  147. package/lib/service/templates/schema.json.tpl.js +0 -83
  148. package/lib/service/templates/schema.json.tpl.js.map +0 -1
  149. package/lib/service/templates/schema.json.tpl.ts +0 -98
  150. package/lib/service/templates/schema.typebox.tpl.d.ts +0 -2
  151. package/lib/service/templates/schema.typebox.tpl.js +0 -61
  152. package/lib/service/templates/schema.typebox.tpl.js.map +0 -1
  153. package/lib/service/templates/schema.typebox.tpl.ts +0 -76
  154. package/lib/service/templates/service.tpl.d.ts +0 -3
  155. package/lib/service/templates/service.tpl.js +0 -112
  156. package/lib/service/templates/service.tpl.js.map +0 -1
  157. package/lib/service/templates/service.tpl.ts +0 -152
  158. package/lib/service/templates/test.tpl.d.ts +0 -2
  159. package/lib/service/templates/test.tpl.js +0 -25
  160. package/lib/service/templates/test.tpl.js.map +0 -1
  161. package/lib/service/templates/test.tpl.ts +0 -33
  162. package/lib/service/type/custom.tpl.d.ts +0 -3
  163. package/lib/service/type/custom.tpl.js +0 -98
  164. package/lib/service/type/custom.tpl.js.map +0 -1
  165. package/lib/service/type/custom.tpl.ts +0 -109
  166. package/lib/service/type/knex.tpl.d.ts +0 -3
  167. package/lib/service/type/knex.tpl.js +0 -71
  168. package/lib/service/type/knex.tpl.js.map +0 -1
  169. package/lib/service/type/knex.tpl.ts +0 -92
  170. package/lib/service/type/mongodb.tpl.d.ts +0 -3
  171. package/lib/service/type/mongodb.tpl.js +0 -50
  172. package/lib/service/type/mongodb.tpl.js.map +0 -1
  173. package/lib/service/type/mongodb.tpl.ts +0 -62
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ - Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0))
11
+
12
+ # [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **cli:** Add unhandledRejection handler to generated index file ([#2932](https://github.com/feathersjs/feathers/issues/2932)) ([e3cedc8](https://github.com/feathersjs/feathers/commit/e3cedc8e00f52d892f21fd6a3eb4ca4fe40a903c))
17
+ - **cli:** Minor generated app improvements ([#2936](https://github.com/feathersjs/feathers/issues/2936)) ([ba1a550](https://github.com/feathersjs/feathers/commit/ba1a5500a8a5ea4ab44da44ac509e48c723d7efd))
18
+ - **cli:** Properly log validation errors in log-error hook ([54c883c](https://github.com/feathersjs/feathers/commit/54c883c2bb5c35c02b1a2081b2f17554550aa1d4))
19
+ - **cli:** Use correct package manager when installing an app ([#2973](https://github.com/feathersjs/feathers/issues/2973)) ([99c2a70](https://github.com/feathersjs/feathers/commit/99c2a70b77f0b68698a66180b69a56cb20c2ca0d))
20
+
21
+ ### Features
22
+
23
+ - **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17))
24
+
6
25
  # [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14)
7
26
 
8
27
  ### Bug Fixes
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Feathers
3
+ Copyright (c) 2023 Feathers Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -24,6 +24,6 @@ Refer to the [Feathers documentation](https://docs.feathersjs.com) for more deta
24
24
 
25
25
  ## License
26
26
 
27
- Copyright (c) 2022 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
27
+ Copyright (c) 2023 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
28
28
 
29
29
  Licensed under the [MIT license](LICENSE).
package/lib/index.d.ts CHANGED
@@ -1,2 +1,6 @@
1
- export * from './cli';
2
- export * from './commons';
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ export * from 'commander';
4
+ export { chalk };
5
+ export declare const commandRunner: (name: string) => (options: any) => Promise<void>;
6
+ export declare const program: Command;
package/lib/index.js CHANGED
@@ -13,7 +13,64 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
16
19
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./cli"), exports);
18
- __exportStar(require("./commons"), exports);
20
+ exports.program = exports.commandRunner = exports.chalk = void 0;
21
+ const chalk_1 = __importDefault(require("chalk"));
22
+ exports.chalk = chalk_1.default;
23
+ const commander_1 = require("commander");
24
+ const path_1 = require("path");
25
+ const generators_1 = require("@feathersjs/generators");
26
+ __exportStar(require("commander"), exports);
27
+ const commandRunner = (name) => async (options) => {
28
+ const folder = (0, path_1.dirname)(require.resolve('@feathersjs/generators'));
29
+ const ctx = (0, generators_1.getContext)({
30
+ ...options
31
+ });
32
+ await (0, generators_1.generator)(ctx)
33
+ .then((0, generators_1.runGenerator)(folder, name, 'index'))
34
+ .catch((error) => {
35
+ const { logger } = ctx.pinion;
36
+ logger.error(`Error: ${chalk_1.default.white(error.message)}`);
37
+ });
38
+ };
39
+ exports.commandRunner = commandRunner;
40
+ exports.program = new commander_1.Command();
41
+ exports.program
42
+ .name('feathers')
43
+ .description('The Feathers command line interface 🕊️')
44
+ .version(generators_1.version)
45
+ .showHelpAfterError();
46
+ const generate = exports.program.command('generate').alias('g');
47
+ generate
48
+ .command('app')
49
+ .description('Generate a new application')
50
+ .option('--name <name>', 'The name of the application')
51
+ .action((0, exports.commandRunner)('app'));
52
+ generate
53
+ .command('service')
54
+ .description('Generate a new service')
55
+ .option('--name <name>', 'The service name')
56
+ .option('--path <path>', 'The path to register the service on')
57
+ .option('--type <type>', 'The service type (knex, mongodb, custom)')
58
+ .action((0, exports.commandRunner)('service'));
59
+ generate
60
+ .command('hook')
61
+ .description('Generate a hook')
62
+ .option('--name <name>', 'The name of the hook')
63
+ .option('--type <type>', 'The hook type (around or regular)')
64
+ .action((0, exports.commandRunner)('hook'));
65
+ generate
66
+ .command('connection')
67
+ .description('Add a new database connection')
68
+ .action((0, exports.commandRunner)('connection'));
69
+ generate
70
+ .command('authentication')
71
+ .description('Add authentication to the application')
72
+ .action((0, exports.commandRunner)('authentication'));
73
+ generate.description(`Run a generator. Currently available: \n ${generate.commands
74
+ .map((cmd) => `${chalk_1.default.blue(cmd.name())}: ${cmd.description()} `)
75
+ .join('\n ')}`);
19
76
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AAMhB,gBANF,eAAK,CAME;AALd,yCAAmC;AACnC,+BAA8B;AAC9B,uDAA0G;AAE1G,4CAAyB;AAGlB,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,OAAY,EAAE,EAAE;IACpE,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,C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;KACL,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,iBAAiB,CAAC;KAC9B,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC;KAC/C,MAAM,CAAC,eAAe,EAAE,mCAAmC,CAAC;KAC5D,MAAM,CAAC,IAAA,qBAAa,EAAC,MAAM,CAAC,CAAC,CAAA;AAEhC,QAAQ;KACL,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,IAAA,qBAAa,EAAC,YAAY,CAAC,CAAC,CAAA;AAEtC,QAAQ;KACL,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,uCAAuC,CAAC;KACpD,MAAM,CAAC,IAAA,qBAAa,EAAC,gBAAgB,CAAC,CAAC,CAAA;AAE1C,QAAQ,CAAC,WAAW,CAClB,6CAA6C,QAAQ,CAAC,QAAQ;KAC3D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC;KAChE,IAAI,CAAC,MAAM,CAAC,EAAE,CAClB,CAAA"}
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.34",
4
+ "version": "5.0.0-pre.36",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "bin": {
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "scripts": {
46
46
  "prepublish": "npm run compile",
47
- "compile": "shx rm -rf lib/ && tsc && shx cp -r src/. lib/",
47
+ "compile": "shx rm -rf lib/ && tsc",
48
48
  "mocha": "mocha --timeout 60000 --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
49
49
  "test": "npm run compile && npm run mocha"
50
50
  },
@@ -52,39 +52,37 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@feathershq/pinion": "^0.3.5",
55
+ "@feathersjs/generators": "^5.0.0-pre.36",
56
56
  "chalk": "^4.0.1",
57
- "commander": "^9.4.1",
58
- "lodash": "^4.17.21",
59
- "prettier": "^2.8.0"
57
+ "commander": "^10.0.0"
60
58
  },
61
59
  "devDependencies": {
62
- "@feathersjs/adapter-commons": "^5.0.0-pre.34",
63
- "@feathersjs/authentication": "^5.0.0-pre.34",
64
- "@feathersjs/authentication-client": "^5.0.0-pre.34",
65
- "@feathersjs/authentication-local": "^5.0.0-pre.34",
66
- "@feathersjs/authentication-oauth": "^5.0.0-pre.34",
67
- "@feathersjs/configuration": "^5.0.0-pre.34",
68
- "@feathersjs/errors": "^5.0.0-pre.34",
69
- "@feathersjs/express": "^5.0.0-pre.34",
70
- "@feathersjs/feathers": "^5.0.0-pre.34",
71
- "@feathersjs/knex": "^5.0.0-pre.34",
72
- "@feathersjs/koa": "^5.0.0-pre.34",
73
- "@feathersjs/mongodb": "^5.0.0-pre.34",
74
- "@feathersjs/rest-client": "^5.0.0-pre.34",
75
- "@feathersjs/schema": "^5.0.0-pre.34",
76
- "@feathersjs/socketio": "^5.0.0-pre.34",
77
- "@feathersjs/transport-commons": "^5.0.0-pre.34",
78
- "@feathersjs/typebox": "^5.0.0-pre.34",
60
+ "@feathersjs/adapter-commons": "^5.0.0-pre.36",
61
+ "@feathersjs/authentication": "^5.0.0-pre.36",
62
+ "@feathersjs/authentication-client": "^5.0.0-pre.36",
63
+ "@feathersjs/authentication-local": "^5.0.0-pre.36",
64
+ "@feathersjs/authentication-oauth": "^5.0.0-pre.36",
65
+ "@feathersjs/configuration": "^5.0.0-pre.36",
66
+ "@feathersjs/errors": "^5.0.0-pre.36",
67
+ "@feathersjs/express": "^5.0.0-pre.36",
68
+ "@feathersjs/feathers": "^5.0.0-pre.36",
69
+ "@feathersjs/knex": "^5.0.0-pre.36",
70
+ "@feathersjs/koa": "^5.0.0-pre.36",
71
+ "@feathersjs/mongodb": "^5.0.0-pre.36",
72
+ "@feathersjs/rest-client": "^5.0.0-pre.36",
73
+ "@feathersjs/schema": "^5.0.0-pre.36",
74
+ "@feathersjs/socketio": "^5.0.0-pre.36",
75
+ "@feathersjs/transport-commons": "^5.0.0-pre.36",
76
+ "@feathersjs/typebox": "^5.0.0-pre.36",
79
77
  "@types/mocha": "^10.0.1",
80
- "@types/node": "^18.11.10",
81
- "@types/prettier": "^2.7.1",
82
- "axios": "^1.2.0",
83
- "mocha": "^10.1.0",
78
+ "@types/node": "^18.11.18",
79
+ "@types/prettier": "^2.7.2",
80
+ "axios": "^1.2.6",
81
+ "mocha": "^10.2.0",
84
82
  "shx": "^0.3.4",
85
83
  "ts-node": "^10.9.1",
86
- "type-fest": "^3.3.0",
87
- "typescript": "^4.9.3"
84
+ "type-fest": "^3.5.3",
85
+ "typescript": "^4.9.4"
88
86
  },
89
- "gitHead": "42cca600d00f0b3b9d89fa79be30fcd46bc50132"
87
+ "gitHead": "9a107b463cc80d7f3c28553c908987e05b0b634a"
90
88
  }
@@ -1,29 +0,0 @@
1
- import { FeathersBaseContext, FeathersAppInfo } from '../commons';
2
- export interface AppGeneratorData extends FeathersAppInfo {
3
- /**
4
- * The application name
5
- */
6
- name: string;
7
- /**
8
- * A short description of the app
9
- */
10
- description: string;
11
- /**
12
- * The selected user authentication strategies
13
- */
14
- authStrategies: string[];
15
- /**
16
- * The database connection string
17
- */
18
- connectionString: string;
19
- /**
20
- * The source folder where files are put
21
- */
22
- lib: string;
23
- }
24
- export type AppGeneratorContext = FeathersBaseContext & AppGeneratorData & {
25
- dependencies: string[];
26
- devDependencies: string[];
27
- };
28
- export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>;
29
- export declare const generate: (ctx: AppGeneratorArguments) => Promise<AppGeneratorContext>;
package/lib/app/index.js DELETED
@@ -1,146 +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 = void 0;
7
- const path_1 = require("path");
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const pinion_1 = require("@feathershq/pinion");
10
- const commons_1 = require("../commons");
11
- const authentication_1 = require("../authentication");
12
- const connection_1 = require("../connection");
13
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
14
- .then((0, commons_1.initializeBaseContext)())
15
- .then((ctx) => ({
16
- ...ctx,
17
- dependencies: [],
18
- devDependencies: []
19
- }))
20
- .then((0, pinion_1.prompt)((ctx) => [
21
- {
22
- name: 'language',
23
- type: 'list',
24
- message: 'Do you want to use JavaScript or TypeScript?',
25
- when: !ctx.language,
26
- choices: [
27
- { name: 'TypeScript', value: 'ts' },
28
- { name: 'JavaScript', value: 'js' }
29
- ]
30
- },
31
- {
32
- name: 'name',
33
- type: 'input',
34
- when: !ctx.name,
35
- message: 'What is the name of your application?',
36
- default: ctx.cwd.split(path_1.sep).pop(),
37
- validate: (input) => {
38
- if (ctx.dependencyVersions[input]) {
39
- return `Application can not have the same name as a dependency`;
40
- }
41
- return true;
42
- }
43
- },
44
- {
45
- name: 'description',
46
- type: 'input',
47
- when: !ctx.description,
48
- message: 'Write a short description'
49
- },
50
- {
51
- type: 'list',
52
- name: 'framework',
53
- when: !ctx.framework,
54
- message: 'Which HTTP framework do you want to use?',
55
- choices: [
56
- { value: 'koa', name: `KoaJS ${chalk_1.default.grey('(recommended)')}` },
57
- { value: 'express', name: 'Express' }
58
- ]
59
- },
60
- {
61
- type: 'checkbox',
62
- name: 'transports',
63
- when: !ctx.transports,
64
- message: 'What APIs do you want to offer?',
65
- choices: [
66
- { value: 'rest', name: 'HTTP (REST)', checked: true },
67
- { value: 'websockets', name: 'Real-time', checked: true }
68
- ]
69
- },
70
- {
71
- name: 'packager',
72
- type: 'list',
73
- when: !ctx.packager,
74
- message: 'Which package manager are you using?',
75
- choices: [
76
- { value: 'npm', name: 'npm' },
77
- { value: 'yarn', name: 'Yarn' },
78
- { value: 'pnpm', name: 'pnpm' }
79
- ]
80
- },
81
- {
82
- type: 'list',
83
- name: 'schema',
84
- when: !ctx.schema,
85
- message: 'What is your preferred schema (model) definition format?',
86
- choices: [
87
- { value: 'typebox', name: `TypeBox ${chalk_1.default.grey('(recommended)')}` },
88
- { value: 'json', name: 'JSON schema' }
89
- ]
90
- },
91
- ...(0, connection_1.prompts)(ctx),
92
- ...(0, authentication_1.prompts)({
93
- ...ctx,
94
- service: 'user',
95
- path: 'users',
96
- entity: 'user'
97
- })
98
- ]))
99
- .then((0, pinion_1.runGenerators)(__dirname, 'templates'))
100
- .then((0, pinion_1.copyFiles)((0, pinion_1.fromFile)(__dirname, 'static'), (0, pinion_1.toFile)('.')))
101
- .then((0, commons_1.initializeBaseContext)())
102
- .then(async (ctx) => {
103
- const { dependencies } = await (0, connection_1.generate)(ctx);
104
- return {
105
- ...ctx,
106
- dependencies
107
- };
108
- })
109
- .then((0, pinion_1.when)(({ authStrategies }) => authStrategies.length > 0, async (ctx) => {
110
- const { dependencies } = await (0, authentication_1.generate)({
111
- ...ctx,
112
- service: 'user',
113
- path: 'users',
114
- entity: 'user'
115
- });
116
- return {
117
- ...ctx,
118
- dependencies
119
- };
120
- }))
121
- .then((0, pinion_1.install)(({ transports, framework, dependencyVersions, dependencies, schema }) => {
122
- const hasSocketio = transports.includes('websockets');
123
- dependencies.push('@feathersjs/feathers', '@feathersjs/errors', '@feathersjs/schema', '@feathersjs/configuration', '@feathersjs/transport-commons', '@feathersjs/adapter-commons', '@feathersjs/authentication', '@feathersjs/authentication-client', 'winston');
124
- if (hasSocketio) {
125
- dependencies.push('@feathersjs/socketio');
126
- }
127
- if (framework === 'koa') {
128
- dependencies.push('@feathersjs/koa');
129
- }
130
- if (framework === 'express') {
131
- dependencies.push('@feathersjs/express', 'compression');
132
- }
133
- if (schema === 'typebox') {
134
- dependencies.push('@feathersjs/typebox');
135
- }
136
- return (0, commons_1.addVersions)(dependencies, dependencyVersions);
137
- }, false, ctx.packager))
138
- .then((0, pinion_1.install)(({ language, devDependencies, dependencyVersions }) => {
139
- devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env', 'prettier', '@feathersjs/cli', '@feathersjs/rest-client');
140
- if (language === 'ts') {
141
- devDependencies.push('@types/mocha', '@types/node', 'nodemon', 'ts-node', 'typescript', 'shx');
142
- }
143
- return (0, commons_1.addVersions)(devDependencies, dependencyVersions);
144
- }, true, ctx.packager));
145
- exports.generate = generate;
146
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA0B;AAC1B,kDAAyB;AACzB,+CAS2B;AAC3B,wCAAqG;AACrG,sDAAyG;AACzG,8CAA6F;AAiCtF,MAAM,QAAQ,GAAG,CAAC,GAA0B,EAAE,EAAE,CACrD,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CAAC,IAAA,+BAAqB,GAAE,CAAC;KAC7B,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACd,GAAG,GAAG;IACN,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE;CACpB,CAAC,CAAC;KACF,IAAI,CACH,IAAA,eAAM,EAA6C,CAAC,GAAG,EAAE,EAAE,CAAC;IAC1D;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,8CAA8C;QACvD,IAAI,EAAE,CAAC,GAAG,CAAC,QAAQ;QACnB,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE;YACnC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE;SACpC;KACF;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI;QACf,OAAO,EA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V,iBAAiB,EACjB,yBAAyB,CAC1B,CAAA;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAA;KAC/F;IAED,OAAO,IAAA,qBAAW,EAAC,eAAe,EAAE,kBAAkB,CAAC,CAAA;AACzD,CAAC,EACD,IAAI,EACJ,GAAG,CAAC,QAAQ,CACb,CACF,CAAA;AApLQ,QAAA,QAAQ,YAoLhB"}
package/lib/app/index.ts DELETED
@@ -1,228 +0,0 @@
1
- import { sep } from 'path'
2
- import chalk from 'chalk'
3
- import {
4
- generator,
5
- prompt,
6
- runGenerators,
7
- fromFile,
8
- install,
9
- copyFiles,
10
- toFile,
11
- when
12
- } from '@feathershq/pinion'
13
- import { FeathersBaseContext, FeathersAppInfo, initializeBaseContext, addVersions } from '../commons'
14
- import { generate as authenticationGenerator, prompts as authenticationPrompts } from '../authentication'
15
- import { generate as connectionGenerator, prompts as connectionPrompts } from '../connection'
16
-
17
- export interface AppGeneratorData extends FeathersAppInfo {
18
- /**
19
- * The application name
20
- */
21
- name: string
22
- /**
23
- * A short description of the app
24
- */
25
- description: string
26
- /**
27
- * The selected user authentication strategies
28
- */
29
- authStrategies: string[]
30
- /**
31
- * The database connection string
32
- */
33
- connectionString: string
34
- /**
35
- * The source folder where files are put
36
- */
37
- lib: string
38
- }
39
-
40
- export type AppGeneratorContext = FeathersBaseContext &
41
- AppGeneratorData & {
42
- dependencies: string[]
43
- devDependencies: string[]
44
- }
45
-
46
- export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>
47
-
48
- export const generate = (ctx: AppGeneratorArguments) =>
49
- generator(ctx)
50
- .then(initializeBaseContext())
51
- .then((ctx) => ({
52
- ...ctx,
53
- dependencies: [],
54
- devDependencies: []
55
- }))
56
- .then(
57
- prompt<AppGeneratorArguments, AppGeneratorContext>((ctx) => [
58
- {
59
- name: 'language',
60
- type: 'list',
61
- message: 'Do you want to use JavaScript or TypeScript?',
62
- when: !ctx.language,
63
- choices: [
64
- { name: 'TypeScript', value: 'ts' },
65
- { name: 'JavaScript', value: 'js' }
66
- ]
67
- },
68
- {
69
- name: 'name',
70
- type: 'input',
71
- when: !ctx.name,
72
- message: 'What is the name of your application?',
73
- default: ctx.cwd.split(sep).pop(),
74
- validate: (input) => {
75
- if (ctx.dependencyVersions[input]) {
76
- return `Application can not have the same name as a dependency`
77
- }
78
-
79
- return true
80
- }
81
- },
82
- {
83
- name: 'description',
84
- type: 'input',
85
- when: !ctx.description,
86
- message: 'Write a short description'
87
- },
88
- {
89
- type: 'list',
90
- name: 'framework',
91
- when: !ctx.framework,
92
- message: 'Which HTTP framework do you want to use?',
93
- choices: [
94
- { value: 'koa', name: `KoaJS ${chalk.grey('(recommended)')}` },
95
- { value: 'express', name: 'Express' }
96
- ]
97
- },
98
- {
99
- type: 'checkbox',
100
- name: 'transports',
101
- when: !ctx.transports,
102
- message: 'What APIs do you want to offer?',
103
- choices: [
104
- { value: 'rest', name: 'HTTP (REST)', checked: true },
105
- { value: 'websockets', name: 'Real-time', checked: true }
106
- ]
107
- },
108
- {
109
- name: 'packager',
110
- type: 'list',
111
- when: !ctx.packager,
112
- message: 'Which package manager are you using?',
113
- choices: [
114
- { value: 'npm', name: 'npm' },
115
- { value: 'yarn', name: 'Yarn' },
116
- { value: 'pnpm', name: 'pnpm' }
117
- ]
118
- },
119
- {
120
- type: 'list',
121
- name: 'schema',
122
- when: !ctx.schema,
123
- message: 'What is your preferred schema (model) definition format?',
124
- choices: [
125
- { value: 'typebox', name: `TypeBox ${chalk.grey('(recommended)')}` },
126
- { value: 'json', name: 'JSON schema' }
127
- ]
128
- },
129
- ...connectionPrompts(ctx),
130
- ...authenticationPrompts({
131
- ...ctx,
132
- service: 'user',
133
- path: 'users',
134
- entity: 'user'
135
- })
136
- ])
137
- )
138
- .then(runGenerators(__dirname, 'templates'))
139
- .then(copyFiles(fromFile(__dirname, 'static'), toFile('.')))
140
- .then(initializeBaseContext())
141
- .then(async (ctx) => {
142
- const { dependencies } = await connectionGenerator(ctx)
143
-
144
- return {
145
- ...ctx,
146
- dependencies
147
- }
148
- })
149
- .then(
150
- when<AppGeneratorContext>(
151
- ({ authStrategies }) => authStrategies.length > 0,
152
- async (ctx) => {
153
- const { dependencies } = await authenticationGenerator({
154
- ...ctx,
155
- service: 'user',
156
- path: 'users',
157
- entity: 'user'
158
- })
159
-
160
- return {
161
- ...ctx,
162
- dependencies
163
- }
164
- }
165
- )
166
- )
167
- .then(
168
- install<AppGeneratorContext>(
169
- ({ transports, framework, dependencyVersions, dependencies, schema }) => {
170
- const hasSocketio = transports.includes('websockets')
171
-
172
- dependencies.push(
173
- '@feathersjs/feathers',
174
- '@feathersjs/errors',
175
- '@feathersjs/schema',
176
- '@feathersjs/configuration',
177
- '@feathersjs/transport-commons',
178
- '@feathersjs/adapter-commons',
179
- '@feathersjs/authentication',
180
- '@feathersjs/authentication-client',
181
- 'winston'
182
- )
183
-
184
- if (hasSocketio) {
185
- dependencies.push('@feathersjs/socketio')
186
- }
187
-
188
- if (framework === 'koa') {
189
- dependencies.push('@feathersjs/koa')
190
- }
191
-
192
- if (framework === 'express') {
193
- dependencies.push('@feathersjs/express', 'compression')
194
- }
195
-
196
- if (schema === 'typebox') {
197
- dependencies.push('@feathersjs/typebox')
198
- }
199
-
200
- return addVersions(dependencies, dependencyVersions)
201
- },
202
- false,
203
- ctx.packager
204
- )
205
- )
206
- .then(
207
- install<AppGeneratorContext>(
208
- ({ language, devDependencies, dependencyVersions }) => {
209
- devDependencies.push(
210
- 'nodemon',
211
- 'axios',
212
- 'mocha',
213
- 'cross-env',
214
- 'prettier',
215
- '@feathersjs/cli',
216
- '@feathersjs/rest-client'
217
- )
218
-
219
- if (language === 'ts') {
220
- devDependencies.push('@types/mocha', '@types/node', 'nodemon', 'ts-node', 'typescript', 'shx')
221
- }
222
-
223
- return addVersions(devDependencies, dependencyVersions)
224
- },
225
- true,
226
- ctx.packager
227
- )
228
- )