@feathersjs/cli 5.0.0-pre.26 → 5.0.0-pre.27

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 (86) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/lib/app/index.js +1 -1
  3. package/lib/app/index.js.map +1 -1
  4. package/lib/app/index.ts +1 -1
  5. package/lib/app/templates/app.tpl.js +2 -2
  6. package/lib/app/templates/app.tpl.ts +2 -2
  7. package/lib/app/templates/client.tpl.js +1 -1
  8. package/lib/app/templates/client.tpl.ts +1 -1
  9. package/lib/app/templates/configuration.tpl.js +23 -20
  10. package/lib/app/templates/configuration.tpl.js.map +1 -1
  11. package/lib/app/templates/configuration.tpl.ts +23 -20
  12. package/lib/app/templates/declarations.tpl.js +1 -1
  13. package/lib/app/templates/declarations.tpl.ts +1 -1
  14. package/lib/app/templates/package.json.tpl.js +2 -0
  15. package/lib/app/templates/package.json.tpl.js.map +1 -1
  16. package/lib/app/templates/package.json.tpl.ts +2 -0
  17. package/lib/app/templates/prettierrc.tpl.d.ts +2 -0
  18. package/lib/app/templates/prettierrc.tpl.js +11 -0
  19. package/lib/app/templates/prettierrc.tpl.js.map +1 -0
  20. package/lib/app/templates/prettierrc.tpl.ts +14 -0
  21. package/lib/authentication/index.d.ts +0 -2
  22. package/lib/authentication/templates/authentication.tpl.js +3 -3
  23. package/lib/authentication/templates/authentication.tpl.js.map +1 -1
  24. package/lib/authentication/templates/authentication.tpl.ts +5 -5
  25. package/lib/authentication/templates/declarations.tpl.js +1 -1
  26. package/lib/authentication/templates/declarations.tpl.js.map +1 -1
  27. package/lib/authentication/templates/declarations.tpl.ts +2 -2
  28. package/lib/authentication/templates/knex.tpl.js +6 -5
  29. package/lib/authentication/templates/knex.tpl.js.map +1 -1
  30. package/lib/authentication/templates/knex.tpl.ts +16 -17
  31. package/lib/authentication/templates/test.tpl.js +2 -2
  32. package/lib/authentication/templates/test.tpl.js.map +1 -1
  33. package/lib/authentication/templates/test.tpl.ts +2 -2
  34. package/lib/authentication/templates/user.resolver.tpl.js +6 -6
  35. package/lib/authentication/templates/user.resolver.tpl.js.map +1 -1
  36. package/lib/authentication/templates/user.resolver.tpl.ts +6 -6
  37. package/lib/authentication/templates/user.schema.tpl.js +7 -13
  38. package/lib/authentication/templates/user.schema.tpl.js.map +1 -1
  39. package/lib/authentication/templates/user.schema.tpl.ts +7 -13
  40. package/lib/commons.d.ts +19 -9
  41. package/lib/commons.js +56 -23
  42. package/lib/commons.js.map +1 -1
  43. package/lib/commons.ts +87 -26
  44. package/lib/connection/templates/knex.tpl.js +13 -16
  45. package/lib/connection/templates/knex.tpl.js.map +1 -1
  46. package/lib/connection/templates/knex.tpl.ts +18 -20
  47. package/lib/connection/templates/mongodb.tpl.js +5 -9
  48. package/lib/connection/templates/mongodb.tpl.js.map +1 -1
  49. package/lib/connection/templates/mongodb.tpl.ts +10 -12
  50. package/lib/index.js +2 -1
  51. package/lib/index.js.map +1 -1
  52. package/lib/index.ts +2 -1
  53. package/lib/service/index.d.ts +0 -16
  54. package/lib/service/index.js +3 -8
  55. package/lib/service/index.js.map +1 -1
  56. package/lib/service/index.ts +3 -16
  57. package/lib/service/templates/class.tpl.d.ts +2 -0
  58. package/lib/service/templates/class.tpl.js +63 -0
  59. package/lib/service/templates/class.tpl.js.map +1 -0
  60. package/lib/service/templates/class.tpl.ts +79 -0
  61. package/lib/service/templates/client.tpl.js +4 -6
  62. package/lib/service/templates/client.tpl.js.map +1 -1
  63. package/lib/service/templates/client.tpl.ts +10 -15
  64. package/lib/service/templates/resolver.tpl.js +4 -4
  65. package/lib/service/templates/resolver.tpl.js.map +1 -1
  66. package/lib/service/templates/resolver.tpl.ts +4 -4
  67. package/lib/service/templates/schema.tpl.js +2 -2
  68. package/lib/service/templates/schema.tpl.js.map +1 -1
  69. package/lib/service/templates/schema.tpl.ts +2 -2
  70. package/lib/service/templates/service.tpl.js +12 -58
  71. package/lib/service/templates/service.tpl.js.map +1 -1
  72. package/lib/service/templates/service.tpl.ts +17 -79
  73. package/lib/service/templates/test.tpl.js +4 -4
  74. package/lib/service/templates/test.tpl.js.map +1 -1
  75. package/lib/service/templates/test.tpl.ts +4 -4
  76. package/lib/service/type/custom.tpl.d.ts +1 -1
  77. package/lib/service/type/custom.tpl.js +24 -16
  78. package/lib/service/type/custom.tpl.js.map +1 -1
  79. package/lib/service/type/custom.tpl.ts +28 -19
  80. package/lib/service/type/knex.tpl.js +11 -5
  81. package/lib/service/type/knex.tpl.js.map +1 -1
  82. package/lib/service/type/knex.tpl.ts +14 -9
  83. package/lib/service/type/mongodb.tpl.js +11 -5
  84. package/lib/service/type/mongodb.tpl.js.map +1 -1
  85. package/lib/service/type/mongodb.tpl.ts +14 -9
  86. package/package.json +19 -19
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
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.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cli:** Fix flaky authentication migration and SQL id schema types ([#2676](https://github.com/feathersjs/feathers/issues/2676)) ([04ce9a5](https://github.com/feathersjs/feathers/commit/04ce9a53f4226cd6283f9dc241876e90ddf48618))
12
+
13
+
14
+ ### Features
15
+
16
+ * **cli:** Add support for Prettier ([#2684](https://github.com/feathersjs/feathers/issues/2684)) ([83aa8f9](https://github.com/feathersjs/feathers/commit/83aa8f9f212cb122d831dca8858852b0ac9b4da8))
17
+ * **cli:** Improve generated application folder structure ([#2678](https://github.com/feathersjs/feathers/issues/2678)) ([d114557](https://github.com/feathersjs/feathers/commit/d114557721e73d6302aa88c11e3726dbcbd5c92b))
18
+
19
+
20
+
21
+
22
+
6
23
  # [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22)
7
24
 
8
25
 
package/lib/app/index.js CHANGED
@@ -113,7 +113,7 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
113
113
  return (0, commons_1.addVersions)(dependencies, dependencyVersions);
114
114
  }))
115
115
  .then((0, pinion_1.install)(({ language, framework, devDependencies, dependencyVersions }) => {
116
- devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env');
116
+ devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env', 'prettier');
117
117
  if (language === 'ts') {
118
118
  devDependencies.push('@types/mocha', framework === 'koa' ? '@types/koa-static' : '@types/compression', '@types/node', 'nodemon', 'ts-node', 'typescript', 'shx');
119
119
  }
@@ -1 +1 @@
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,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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AAA;IAE1E,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,eAAe,CAAC,IAAI,CAClB,cAAc,EACd,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,oBAAoB,EAChE,aAAa,EACb,SAAS,EACT,SAAS,EACT,YAAY,EACZ,KAAK,CACN,CAAA;KACF;IAED,OAAO,IAAA,qBAAW,EAAC,eAAe,EAAE,kBAAkB,CAAC,CAAA;AACzD,CAAC,EAAE,IAAI,CAAC,CACT,CAAA;AAtJQ,QAAA,QAAQ,YAsJhB"}
package/lib/app/index.ts CHANGED
@@ -179,7 +179,7 @@ export const generate = (ctx: AppGeneratorArguments) =>
179
179
  )
180
180
  .then(
181
181
  install<AppGeneratorContext>(({ language, framework, devDependencies, dependencyVersions }) => {
182
- devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env')
182
+ devDependencies.push('nodemon', 'axios', 'mocha', 'cross-env', 'prettier')
183
183
 
184
184
  if (language === 'ts') {
185
185
  devDependencies.push(
@@ -10,7 +10,7 @@ import { koa, rest, bodyParser, errorHandler, parseAuthentication } from '@feath
10
10
  ${transports.includes('websockets') ? "import socketio from '@feathersjs/socketio'" : ''}
11
11
 
12
12
  import type { Application } from './declarations'
13
- import { configurationSchema } from './schemas/configuration.schema'
13
+ import { configurationSchema } from './configuration'
14
14
  import { logErrorHook } from './logger'
15
15
  import { services } from './services/index'
16
16
  import { channels } from './channels'
@@ -61,7 +61,7 @@ import configuration from '@feathersjs/configuration'
61
61
  ${transports.includes('websockets') ? "import socketio from '@feathersjs/socketio'" : ''}
62
62
 
63
63
  import type { Application } from './declarations'
64
- import { configurationSchema } from './schemas/configuration.schema'
64
+ import { configurationSchema } from './configuration'
65
65
  import { logger, logErrorHook } from './logger'
66
66
  import { services } from './services/index'
67
67
  import { channels } from './channels'
@@ -10,7 +10,7 @@ import { koa, rest, bodyParser, errorHandler, parseAuthentication } from '@feath
10
10
  ${transports.includes('websockets') ? "import socketio from '@feathersjs/socketio'" : ''}
11
11
 
12
12
  import type { Application } from './declarations'
13
- import { configurationSchema } from './schemas/configuration.schema'
13
+ import { configurationSchema } from './configuration'
14
14
  import { logErrorHook } from './logger'
15
15
  import { services } from './services/index'
16
16
  import { channels } from './channels'
@@ -63,7 +63,7 @@ import configuration from '@feathersjs/configuration'
63
63
  ${transports.includes('websockets') ? "import socketio from '@feathersjs/socketio'" : ''}
64
64
 
65
65
  import type { Application } from './declarations'
66
- import { configurationSchema } from './schemas/configuration.schema'
66
+ import { configurationSchema } from './configuration'
67
67
  import { logger, logErrorHook } from './logger'
68
68
  import { services } from './services/index'
69
69
  import { channels } from './channels'
@@ -6,8 +6,8 @@ const commons_1 = require("../../commons");
6
6
  const template = ({}) => `import { feathers } from '@feathersjs/feathers'
7
7
  import type { Service, TransportConnection, Params } from '@feathersjs/feathers'
8
8
 
9
- // A mapping of client side services
10
9
  export interface ServiceTypes {
10
+ // A mapping of client side services
11
11
  }
12
12
 
13
13
  export const createClient = <Configuration = any> (connection: TransportConnection<ServiceTypes>) => {
@@ -6,8 +6,8 @@ const template = ({}: AppGeneratorContext) =>
6
6
  `import { feathers } from '@feathersjs/feathers'
7
7
  import type { Service, TransportConnection, Params } from '@feathersjs/feathers'
8
8
 
9
- // A mapping of client side services
10
9
  export interface ServiceTypes {
10
+ // A mapping of client side services
11
11
  }
12
12
 
13
13
  export const createClient = <Configuration = any> (connection: TransportConnection<ServiceTypes>) => {
@@ -7,30 +7,33 @@ const template = ({}) => `import { schema, Ajv } from '@feathersjs/schema'
7
7
  import type { Infer } from '@feathersjs/schema'
8
8
  import { authenticationSettingsSchema } from '@feathersjs/authentication'
9
9
 
10
- export const configurationSchema = schema({
11
- $id: 'ApplicationConfiguration',
12
- type: 'object',
13
- additionalProperties: false,
14
- required: [ 'host', 'port', 'public', 'paginate' ],
15
- properties: {
16
- host: { type: 'string' },
17
- port: { type: 'number' },
18
- public: { type: 'string' },
19
- authentication: authenticationSettingsSchema,
20
- paginate: {
21
- type: 'object',
22
- additionalProperties: false,
23
- required: [ 'default', 'max' ],
24
- properties: {
25
- default: { type: 'number' },
26
- max: { type: 'number' }
10
+ export const configurationSchema = schema(
11
+ {
12
+ $id: 'ApplicationConfiguration',
13
+ type: 'object',
14
+ additionalProperties: false,
15
+ required: [ 'host', 'port', 'public', 'paginate' ],
16
+ properties: {
17
+ host: { type: 'string' },
18
+ port: { type: 'number' },
19
+ public: { type: 'string' },
20
+ authentication: authenticationSettingsSchema,
21
+ paginate: {
22
+ type: 'object',
23
+ additionalProperties: false,
24
+ required: [ 'default', 'max' ],
25
+ properties: {
26
+ default: { type: 'number' },
27
+ max: { type: 'number' }
28
+ }
27
29
  }
28
30
  }
29
- }
30
- } as const, new Ajv())
31
+ } as const,
32
+ new Ajv()
33
+ )
31
34
 
32
35
  export type ConfigurationSchema = Infer<typeof configurationSchema>
33
36
  `;
34
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'schemas', 'configuration.schema')));
37
+ const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'configuration')));
35
38
  exports.generate = generate;
36
39
  //# sourceMappingURL=configuration.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/configuration.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BD,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,SAAS,EAAE,sBAAsB,CAAC,CACjF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
1
+ {"version":3,"file":"configuration.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/configuration.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BD,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,eAAe,CAAC,CAC/D,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -7,27 +7,30 @@ const template = ({}: AppGeneratorContext) =>
7
7
  import type { Infer } from '@feathersjs/schema'
8
8
  import { authenticationSettingsSchema } from '@feathersjs/authentication'
9
9
 
10
- export const configurationSchema = schema({
11
- $id: 'ApplicationConfiguration',
12
- type: 'object',
13
- additionalProperties: false,
14
- required: [ 'host', 'port', 'public', 'paginate' ],
15
- properties: {
16
- host: { type: 'string' },
17
- port: { type: 'number' },
18
- public: { type: 'string' },
19
- authentication: authenticationSettingsSchema,
20
- paginate: {
21
- type: 'object',
22
- additionalProperties: false,
23
- required: [ 'default', 'max' ],
24
- properties: {
25
- default: { type: 'number' },
26
- max: { type: 'number' }
10
+ export const configurationSchema = schema(
11
+ {
12
+ $id: 'ApplicationConfiguration',
13
+ type: 'object',
14
+ additionalProperties: false,
15
+ required: [ 'host', 'port', 'public', 'paginate' ],
16
+ properties: {
17
+ host: { type: 'string' },
18
+ port: { type: 'number' },
19
+ public: { type: 'string' },
20
+ authentication: authenticationSettingsSchema,
21
+ paginate: {
22
+ type: 'object',
23
+ additionalProperties: false,
24
+ required: [ 'default', 'max' ],
25
+ properties: {
26
+ default: { type: 'number' },
27
+ max: { type: 'number' }
28
+ }
27
29
  }
28
30
  }
29
- }
30
- } as const, new Ajv())
31
+ } as const,
32
+ new Ajv()
33
+ )
31
34
 
32
35
  export type ConfigurationSchema = Infer<typeof configurationSchema>
33
36
  `
@@ -36,6 +39,6 @@ export const generate = (ctx: AppGeneratorContext) =>
36
39
  generator(ctx).then(
37
40
  renderSource(
38
41
  template,
39
- toFile<AppGeneratorContext>(({ lib }) => lib, 'schemas', 'configuration.schema')
42
+ toFile<AppGeneratorContext>(({ lib }) => lib, 'configuration')
40
43
  )
41
44
  )
@@ -4,7 +4,7 @@ exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const template = ({ framework }) => `import { HookContext as FeathersHookContext, NextFunction } from '@feathersjs/feathers'
6
6
  import { Application as FeathersApplication } from '@feathersjs/${framework}'
7
- import { ConfigurationSchema } from './schemas/configuration.schema'
7
+ import { ConfigurationSchema } from './configuration'
8
8
 
9
9
  export { NextFunction }
10
10
 
@@ -4,7 +4,7 @@ import { AppGeneratorContext } from '../index'
4
4
  const template = ({ framework }: AppGeneratorContext) =>
5
5
  `import { HookContext as FeathersHookContext, NextFunction } from '@feathersjs/feathers'
6
6
  import { Application as FeathersApplication } from '@feathersjs/${framework}'
7
- import { ConfigurationSchema } from './schemas/configuration.schema'
7
+ import { ConfigurationSchema } from './configuration'
8
8
 
9
9
  export { NextFunction }
10
10
 
@@ -7,6 +7,7 @@ const jsPackageJson = (lib) => ({
7
7
  scripts: {
8
8
  start: `node ${lib}`,
9
9
  dev: `nodemon ${lib}/`,
10
+ prettier: 'npx prettier "**/*.js" --write',
10
11
  mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
11
12
  test: 'npm run mocha'
12
13
  }
@@ -16,6 +17,7 @@ const tsPackageJson = (lib) => ({
16
17
  dev: `nodemon -x ts-node ${lib}/index.ts`,
17
18
  compile: 'shx rm -rf lib/ && tsc',
18
19
  start: 'npm run compile && node lib/',
20
+ prettier: 'npx prettier "**/*.ts" --write',
19
21
  mocha: 'cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit',
20
22
  test: 'npm run mocha'
21
23
  }
@@ -1 +1 @@
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,KAAK,EAAE,wDAAwD;QAC/D,IAAI,EAAE,eAAe;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE;QACP,GAAG,EAAE,sBAAsB,GAAG,WAAW;QACzC,OAAO,EAAE,wBAAwB;QACjC,KAAK,EAAE,8BAA8B;QACrC,KAAK,EACH,mGAAmG;QACrG,IAAI,EAAE,eAAe;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,GAAG,EACH,IAAI,EACgB,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI;IACJ,WAAW;IACX,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,MAAM,EAAE,EAAE;IACV,YAAY,EAAE,EAAc;IAC5B,IAAI,EAAE,EAAE;IACR,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;K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ettier: 'npx prettier "**/*.js" --write',
9
10
  mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
10
11
  test: 'npm run mocha'
11
12
  }
@@ -16,6 +17,7 @@ const tsPackageJson = (lib: string) => ({
16
17
  dev: `nodemon -x ts-node ${lib}/index.ts`,
17
18
  compile: 'shx rm -rf lib/ && tsc',
18
19
  start: 'npm run compile && node lib/',
20
+ prettier: 'npx prettier "**/*.ts" --write',
19
21
  mocha:
20
22
  'cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit',
21
23
  test: 'npm run mocha'
@@ -0,0 +1,2 @@
1
+ import { AppGeneratorContext } from '../index';
2
+ export declare const generate: (ctx: AppGeneratorContext) => Promise<AppGeneratorContext>;
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
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
+ )
@@ -54,8 +54,6 @@ export declare const generate: (ctx: AuthenticationGeneratorArguments) => Promis
54
54
  type: "custom" | "mongodb" | "knex";
55
55
  authentication: boolean;
56
56
  isEntityService?: boolean;
57
- schemaPath: string;
58
- resolverPath: string;
59
57
  feathers: import("../commons").FeathersAppInfo;
60
58
  pkg: import("../commons").AppPackageJson;
61
59
  lib: string;
@@ -31,10 +31,10 @@ export const authentication = (app: Application) => {
31
31
  `;
32
32
  const importTemplate = "import { authentication } from './authentication'";
33
33
  const configureTemplate = 'app.configure(authentication)';
34
- const toAppFile = (0, pinion_1.toFile)(({ lib, language }) => [lib, `app.${language}`]);
34
+ const toAppFile = (0, pinion_1.toFile)(({ lib }) => [lib, 'app']);
35
35
  const generate = (ctx) => (0, pinion_1.generator)(ctx)
36
36
  .then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'authentication')))
37
- .then((0, pinion_1.inject)((0, commons_1.getSource)(importTemplate), (0, pinion_1.before)('import { services } from'), toAppFile))
38
- .then((0, pinion_1.inject)((0, commons_1.getSource)(configureTemplate), (0, pinion_1.before)('app.configure(services)'), toAppFile));
37
+ .then((0, commons_1.injectSource)(importTemplate, (0, pinion_1.before)('import { services } from'), toAppFile))
38
+ .then((0, commons_1.injectSource)(configureTemplate, (0, pinion_1.before)('app.configure(services)'), toAppFile));
39
39
  exports.generate = generate;
40
40
  //# sourceMappingURL=authentication.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AACtE,2CAAuD;AAGvD,MAAM,QAAQ,GAAG,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAkC,EAAE,EAAE,CAChF;;;EAGA,QAAQ,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;IAavG,cAAc;KACb,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CACX,8BAA8B,QAAQ,MACpC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBACjD,GAAG,CACN;KACA,IAAI,CAAC,IAAI,CAAC;;6CAGX,QAAQ,CAAC,SAAS,KAAK,SAAS;IAC9B,CAAC,CAAC;gCACwB;IAC1B,CAAC,CAAC,EACN;;CAED,CAAA;AAED,MAAM,cAAc,GAAG,mDAAmD,CAAA;AAC1E,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,SAAS,GAAG,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAA;AAElG,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAC3E,CACF;KACA,IAAI,CAAC,IAAA,eAAM,EAAC,IAAA,mBAAS,EAAC,cAAc,CAAC,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,E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ACA,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAT3E,QAAA,QAAQ,YASmE"}
@@ -1,5 +1,5 @@
1
- import { generator, inject, before, toFile } from '@feathershq/pinion'
2
- import { getSource, renderSource } from '../../commons'
1
+ import { generator, before, toFile } from '@feathershq/pinion'
2
+ import { injectSource, renderSource } from '../../commons'
3
3
  import { AuthenticationGeneratorContext } from '../index'
4
4
 
5
5
  const template = ({ authStrategies, feathers }: AuthenticationGeneratorContext) =>
@@ -39,7 +39,7 @@ export const authentication = (app: Application) => {
39
39
 
40
40
  const importTemplate = "import { authentication } from './authentication'"
41
41
  const configureTemplate = 'app.configure(authentication)'
42
- const toAppFile = toFile<AuthenticationGeneratorContext>(({ lib, language }) => [lib, `app.${language}`])
42
+ const toAppFile = toFile<AuthenticationGeneratorContext>(({ lib }) => [lib, 'app'])
43
43
 
44
44
  export const generate = (ctx: AuthenticationGeneratorContext) =>
45
45
  generator(ctx)
@@ -49,5 +49,5 @@ export const generate = (ctx: AuthenticationGeneratorContext) =>
49
49
  toFile<AuthenticationGeneratorContext>(({ lib }) => lib, 'authentication')
50
50
  )
51
51
  )
52
- .then(inject(getSource(importTemplate), before('import { services } from'), toAppFile))
53
- .then(inject(getSource(configureTemplate), before('app.configure(services)'), toAppFile))
52
+ .then(injectSource(importTemplate, before('import { services } from'), toAppFile))
53
+ .then(injectSource(configureTemplate, before('app.configure(services)'), toAppFile))
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
- const importTemplate = ({ upperName, schemaPath }) => `import { ${upperName}Result } from './${schemaPath}'
5
+ const importTemplate = ({ upperName, folder, fileName }) => `import { ${upperName}Result } from './services/${folder.join('/')}/${fileName}.schema'
6
6
  `;
7
7
  const paramsTemplate = ({ entity, upperName }) => `// Add the ${entity} as an optional property to all params
8
8
  declare module '@feathersjs/feathers' {
@@ -1 +1 @@
1
- {"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/declarations.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AAGpF,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAE,UAAU,EAAkC,EAAE,EAAE,CACnF,YAAY,SAAS,oBAAoB,UAAU;CACpD,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,EACtB,MAAM,EACN,SAAS,EACsB,EAAE,EAAE,CAAC,cAAc,MAAM;;;MAGpD,MAAM,MAAM,SAAS;;;CAG1B,CAAA;AAED,MAAM,iBAAiB,GAAG,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;AAE9F,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,IAAA,eAAM,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,iBAAiB,CAAC,CAC7E,CACF;KACA,IAAI,CAAC,IAAA,aAAI,EAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAAE,IAAA,eAAM,EAAC,cAAc,EAAE,IAAA,eAAM,GAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;AARvF,QAAA,QAAQ,YAQ+E"}
1
+ {"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/declarations.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AAGpF,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkC,EAAE,EAAE,CACzF,YAAY,SAAS,6BAA6B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ;CAC/E,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,EACtB,MAAM,EACN,SAAS,EACsB,EAAE,EAAE,CAAC,cAAc,MAAM;;;MAGpD,MAAM,MAAM,SAAS;;;CAG1B,CAAA;AAED,MAAM,iBAAiB,GAAG,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;AAE9F,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,IAAA,eAAM,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,iBAAiB,CAAC,CAC7E,CACF;KACA,IAAI,CAAC,IAAA,aAAI,EAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAAE,IAAA,eAAM,EAAC,cAAc,EAAE,IAAA,eAAM,GAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;AARvF,QAAA,QAAQ,YAQ+E"}
@@ -1,8 +1,8 @@
1
1
  import { generator, inject, before, toFile, when, append } from '@feathershq/pinion'
2
2
  import { AuthenticationGeneratorContext } from '../index'
3
3
 
4
- const importTemplate = ({ upperName, schemaPath }: AuthenticationGeneratorContext) =>
5
- `import { ${upperName}Result } from './${schemaPath}'
4
+ const importTemplate = ({ upperName, folder, fileName }: AuthenticationGeneratorContext) =>
5
+ `import { ${upperName}Result } from './services/${folder.join('/')}/${fileName}.schema'
6
6
  `
7
7
 
8
8
  const paramsTemplate = ({
@@ -31,12 +31,13 @@ export async function down(knex: Knex): Promise<void> {
31
31
  })
32
32
  }
33
33
  `;
34
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
35
- // We need to wait a second otherwise the migration filenames won't be in the right order
36
- .then((ctx) => new Promise((resolve) => setTimeout(() => resolve(ctx), 1100)))
37
- .then((0, pinion_1.when)((ctx) => (0, commons_1.getDatabaseAdapter)(ctx.feathers.database) === 'knex', (0, commons_1.renderSource)(migrationTemplate, (0, pinion_1.toFile)((0, pinion_1.toFile)('migrations', () => {
34
+ const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)((ctx) => (0, commons_1.getDatabaseAdapter)(ctx.feathers.database) === 'knex', (0, commons_1.renderSource)(migrationTemplate, (0, pinion_1.toFile)((0, pinion_1.toFile)('migrations', () => {
38
35
  // Probably not great but it works to align with the Knex migration file format
39
- const migrationDate = new Date().toISOString().replace(/\D/g, '').substring(0, 14);
36
+ // We add 2 seconds so that the migrations run in the correct order
37
+ const migrationDate = new Date(Date.now() + 2000)
38
+ .toISOString()
39
+ .replace(/\D/g, '')
40
+ .substring(0, 14);
40
41
  return `${migrationDate}_authentication`;
41
42
  })))));
42
43
  exports.generate = generate;
@@ -1 +1 @@
1
- {"version":3,"file":"knex.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/knex.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAgE;AAGhE,MAAM,iBAAiB,GAAG,CAAC,EACzB,SAAS,EACT,cAAc,EACiB,EAAE,EAAE,CAAC;;;kCAGJ,SAAS;8BACb,cAAc;KACrC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;;6BAEiB;IACnB,CAAC,CAAC;oBACQ,IAAI,MAAM,CACvB;KACA,IAAI,CAAC,IAAI,CAAC;;;;;kCAKiB,SAAS;0BACjB,cAAc;KACjC,GAAG,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AE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;;6BAEiB;IACnB,CAAC,CAAC;oBACQ,IAAI,MAAM,CACvB;KACA,IAAI,CAAC,IAAI,CAAC;;;;;kCAKiB,SAAS;0BACjB,cAAc;KACjC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;;iCAEqB;IACvB,CAAC,CAAC;wBACY,IAAI,MAAM,CAC3B;KACA,IAAI,CAAC,KAAK,CAAC;;;CAGjB,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,4BAAkB,EAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,MAAM,EAC7D,IAAA,sBAAY,EACV,iBAAiB,EACjB,IAAA,eAAM,EACJ,IAAA,eAAM,EAAiC,YAAY,EAAE,GAAG,EAAE;IACxD,+EAA+E;IAC/E,mEAAmE;IACnE,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;SAC9C,WAAW,EAAE;SACb,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEnB,OAAO,GAAG,aAAa,iBAAiB,CAAA;AAC1C,CAAC,CAAC,CACH,CACF,CACF,CACF,CAAA;AApBU,QAAA,QAAQ,YAoBlB"}
@@ -39,24 +39,23 @@ export async function down(knex: Knex): Promise<void> {
39
39
  `
40
40
 
41
41
  export const generate = (ctx: AuthenticationGeneratorContext) =>
42
- generator(ctx)
43
- // We need to wait a second otherwise the migration filenames won't be in the right order
44
- .then(
45
- (ctx) => new Promise<AuthenticationGeneratorContext>((resolve) => setTimeout(() => resolve(ctx), 1100))
46
- )
47
- .then(
48
- when(
49
- (ctx) => getDatabaseAdapter(ctx.feathers.database) === 'knex',
50
- renderSource(
51
- migrationTemplate,
52
- toFile(
53
- toFile<AuthenticationGeneratorContext>('migrations', () => {
54
- // Probably not great but it works to align with the Knex migration file format
55
- const migrationDate = new Date().toISOString().replace(/\D/g, '').substring(0, 14)
42
+ generator(ctx).then(
43
+ when(
44
+ (ctx) => getDatabaseAdapter(ctx.feathers.database) === 'knex',
45
+ renderSource(
46
+ migrationTemplate,
47
+ toFile(
48
+ toFile<AuthenticationGeneratorContext>('migrations', () => {
49
+ // Probably not great but it works to align with the Knex migration file format
50
+ // We add 2 seconds so that the migrations run in the correct order
51
+ const migrationDate = new Date(Date.now() + 2000)
52
+ .toISOString()
53
+ .replace(/\D/g, '')
54
+ .substring(0, 14)
56
55
 
57
- return `${migrationDate}_authentication`
58
- })
59
- )
56
+ return `${migrationDate}_authentication`
57
+ })
60
58
  )
61
59
  )
62
60
  )
61
+ )
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
- const template = ({ authStrategies, relative, lib }) => `import assert from 'assert';
7
- import { app } from '${relative}/${lib}/app';
6
+ const template = ({ authStrategies, lib }) => `import assert from 'assert';
7
+ import { app } from '../${lib}/app';
8
8
 
9
9
  describe('authentication', () => {
10
10
  ${authStrategies.includes('local')
@@ -1 +1 @@
1
- {"version":3,"file":"test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,EAAkC,EAAE,EAAE,CACrF;uBACqB,QAAQ,IAAI,GAAG;;;IAIlC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC9B,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;KAsBH;IACC,CAAC,CAAC,EACN;;;;;;CAMD,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAClF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
1
+ {"version":3,"file":"test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,EAAkC,EAAE,EAAE,CAC3E;0BACwB,GAAG;;;IAIzB,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC9B,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;KAsBH;IACC,CAAC,CAAC,EACN;;;;;;CAMD,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAClF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -2,9 +2,9 @@ import { generator, toFile } from '@feathershq/pinion'
2
2
  import { renderSource } from '../../commons'
3
3
  import { AuthenticationGeneratorContext } from '../index'
4
4
 
5
- const template = ({ authStrategies, relative, lib }: AuthenticationGeneratorContext) =>
5
+ const template = ({ authStrategies, lib }: AuthenticationGeneratorContext) =>
6
6
  `import assert from 'assert';
7
- import { app } from '${relative}/${lib}/app';
7
+ import { app } from '../${lib}/app';
8
8
 
9
9
  describe('authentication', () => {
10
10
  ${
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
- const template = ({ camelName, upperName, relative, authStrategies, type, schemaPath }) => `import { resolve } from '@feathersjs/schema'
6
+ const template = ({ camelName, upperName, relative, authStrategies, type, fileName }) => `import { resolve } from '@feathersjs/schema'
7
7
  ${authStrategies.includes('local') ? `import { passwordHash } from '@feathersjs/authentication-local'` : ''}
8
8
  import type { HookContext } from '${relative}/declarations'
9
9
  import type {
@@ -11,13 +11,13 @@ import type {
11
11
  ${upperName}Patch,
12
12
  ${upperName}Result,
13
13
  ${upperName}Query,
14
- } from '../${schemaPath}'
14
+ } from './${fileName}.schema'
15
15
  import {
16
16
  ${camelName}DataSchema,
17
17
  ${camelName}PatchSchema,
18
18
  ${camelName}ResultSchema,
19
19
  ${camelName}QuerySchema
20
- } from '../${schemaPath}'
20
+ } from './${fileName}.schema'
21
21
 
22
22
 
23
23
  // Resolver for the basic data model (e.g. creating new entries)
@@ -86,11 +86,11 @@ export const ${camelName}Resolvers = {
86
86
  query: ${camelName}QueryResolver
87
87
  }
88
88
  `;
89
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib, folder, kebabName }) => [
89
+ const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
90
90
  lib,
91
- 'resolvers',
91
+ 'services',
92
92
  ...folder,
93
- `${kebabName}.resolver`
93
+ `${fileName}.resolver`
94
94
  ]), { force: true }));
95
95
  exports.generate = generate;
96
96
  //# sourceMappingURL=user.resolver.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.resolver.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/user.resolver.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2C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EACF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAA;AAZU,QAAA,QAAQ,YAYlB"}
1
+ {"version":3,"file":"user.resolver.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/user.resolver.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,CACnC;EACA,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,EAAE;oCACvE,QAAQ;;IAExC,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;;IAEhB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;;;;eAIL,SAAS,0BAA0B,SAAS;YAC/C,SAAS;;;MAGf,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC,EAAE;;;;;;eAM9E,SAAS,2BAA2B,SAAS;YAChD,SAAS;;;;;;;eAON,SAAS,4BAA4B,SAAS;YACjD,SAAS;;;;;;;eAON,SAAS,8BAA8B,SAAS;YACnD,SAAS;;;;;;;;;;eAUN,SAAS,2BAA2B,SAAS;YAChD,SAAS;;;;MAIf,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;qCAEF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;eAUvD,SAAS;YACZ,SAAS;cACP,SAAS;;cAET,SAAS;cACT,SAAS;aACV,SAAS;;WAEX,SAAS;;CAEnB,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,I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