@feathersjs/cli 5.0.0-pre.24 → 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.
- package/CHANGELOG.md +39 -0
- package/lib/app/index.js +1 -1
- package/lib/app/index.js.map +1 -1
- package/lib/app/index.ts +1 -1
- package/lib/app/templates/app.test.tpl.js +2 -2
- package/lib/app/templates/app.test.tpl.ts +2 -2
- package/lib/app/templates/app.tpl.js +2 -2
- package/lib/app/templates/app.tpl.ts +2 -2
- package/lib/app/templates/channels.tpl.js +2 -4
- package/lib/app/templates/channels.tpl.js.map +1 -1
- package/lib/app/templates/channels.tpl.ts +2 -4
- package/lib/app/templates/client.tpl.js +3 -2
- package/lib/app/templates/client.tpl.js.map +1 -1
- package/lib/app/templates/client.tpl.ts +3 -2
- package/lib/app/templates/configuration.tpl.js +23 -20
- package/lib/app/templates/configuration.tpl.js.map +1 -1
- package/lib/app/templates/configuration.tpl.ts +23 -20
- package/lib/app/templates/declarations.tpl.js +1 -1
- package/lib/app/templates/declarations.tpl.ts +1 -1
- package/lib/app/templates/package.json.tpl.js +4 -2
- package/lib/app/templates/package.json.tpl.js.map +1 -1
- package/lib/app/templates/package.json.tpl.ts +4 -2
- package/lib/app/templates/prettierrc.tpl.d.ts +2 -0
- package/lib/app/templates/prettierrc.tpl.js +11 -0
- package/lib/app/templates/prettierrc.tpl.js.map +1 -0
- package/lib/app/templates/prettierrc.tpl.ts +14 -0
- package/lib/app/templates/tsconfig.json.tpl.js +2 -1
- package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
- package/lib/app/templates/tsconfig.json.tpl.ts +2 -1
- package/lib/authentication/index.d.ts +0 -2
- package/lib/authentication/templates/authentication.tpl.js +3 -3
- package/lib/authentication/templates/authentication.tpl.js.map +1 -1
- package/lib/authentication/templates/authentication.tpl.ts +5 -5
- package/lib/authentication/templates/declarations.tpl.js +1 -1
- package/lib/authentication/templates/declarations.tpl.js.map +1 -1
- package/lib/authentication/templates/declarations.tpl.ts +2 -2
- package/lib/authentication/templates/knex.tpl.js +6 -3
- package/lib/authentication/templates/knex.tpl.js.map +1 -1
- package/lib/authentication/templates/knex.tpl.ts +6 -4
- package/lib/authentication/templates/test.tpl.js +2 -2
- package/lib/authentication/templates/test.tpl.js.map +1 -1
- package/lib/authentication/templates/test.tpl.ts +2 -2
- package/lib/authentication/templates/user.resolver.tpl.js +6 -6
- package/lib/authentication/templates/user.resolver.tpl.js.map +1 -1
- package/lib/authentication/templates/user.resolver.tpl.ts +6 -6
- package/lib/authentication/templates/user.schema.tpl.js +7 -13
- package/lib/authentication/templates/user.schema.tpl.js.map +1 -1
- package/lib/authentication/templates/user.schema.tpl.ts +7 -13
- package/lib/commons.d.ts +19 -9
- package/lib/commons.js +56 -23
- package/lib/commons.js.map +1 -1
- package/lib/commons.ts +87 -26
- package/lib/connection/templates/knex.tpl.js +14 -17
- package/lib/connection/templates/knex.tpl.js.map +1 -1
- package/lib/connection/templates/knex.tpl.ts +19 -21
- package/lib/connection/templates/mongodb.tpl.js +5 -9
- package/lib/connection/templates/mongodb.tpl.js.map +1 -1
- package/lib/connection/templates/mongodb.tpl.ts +10 -12
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/index.ts +2 -1
- package/lib/service/index.d.ts +0 -16
- package/lib/service/index.js +3 -8
- package/lib/service/index.js.map +1 -1
- package/lib/service/index.ts +3 -16
- package/lib/service/templates/class.tpl.d.ts +2 -0
- package/lib/service/templates/class.tpl.js +63 -0
- package/lib/service/templates/class.tpl.js.map +1 -0
- package/lib/service/templates/class.tpl.ts +79 -0
- package/lib/service/templates/client.tpl.js +4 -6
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +10 -15
- package/lib/service/templates/resolver.tpl.js +4 -4
- package/lib/service/templates/resolver.tpl.js.map +1 -1
- package/lib/service/templates/resolver.tpl.ts +4 -4
- package/lib/service/templates/schema.tpl.js +2 -2
- package/lib/service/templates/schema.tpl.js.map +1 -1
- package/lib/service/templates/schema.tpl.ts +2 -2
- package/lib/service/templates/service.tpl.js +12 -58
- package/lib/service/templates/service.tpl.js.map +1 -1
- package/lib/service/templates/service.tpl.ts +17 -79
- package/lib/service/templates/test.tpl.js +4 -4
- package/lib/service/templates/test.tpl.js.map +1 -1
- package/lib/service/templates/test.tpl.ts +4 -4
- package/lib/service/type/custom.tpl.d.ts +1 -1
- package/lib/service/type/custom.tpl.js +24 -16
- package/lib/service/type/custom.tpl.js.map +1 -1
- package/lib/service/type/custom.tpl.ts +28 -19
- package/lib/service/type/knex.tpl.js +13 -8
- package/lib/service/type/knex.tpl.js.map +1 -1
- package/lib/service/type/knex.tpl.ts +16 -13
- package/lib/service/type/mongodb.tpl.js +11 -5
- package/lib/service/type/mongodb.tpl.js.map +1 -1
- package/lib/service/type/mongodb.tpl.ts +14 -9
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,45 @@
|
|
|
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
|
+
|
|
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)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **cli:** Fix compilation folders that got mixed up ([fc4cb74](https://github.com/feathersjs/feathers/commit/fc4cb742f7f9164096d9319b13dfaaa5f54686a6))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* **cli:** Generator fixes to work with the new guide ([#2674](https://github.com/feathersjs/feathers/issues/2674)) ([b773fa5](https://github.com/feathersjs/feathers/commit/b773fa5dbd7ff450cfb2f7b93e64882592262712))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
6
45
|
# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21)
|
|
7
46
|
|
|
8
47
|
|
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
|
}
|
package/lib/app/index.js.map
CHANGED
|
@@ -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;QACf,OAAO,EAAE,uCAAuC;QAChD,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,UAAG,CAAC,CAAC,GAAG,EAAE;KAClC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,CAAC,GAAG,CAAC,WAAW;QACtB,OAAO,EAAE,2BAA2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B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,SAAS,CACV,CAAA;IAED,IAAI,WAAW,EAAE;QACf,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;KAC1C;IAED,IAAI,SAAS,KAAK,KAAK,EAAE;QACvB,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAA;KACnD;IAED,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAA;KAClE;IAED,OAAO,IAAA,qBAAW,EAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA;AACtD,CAAC,CAAC,CACH;KACA,IAAI,CACH,IAAA,gBAAO,EAAsB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,EAAE,EAAE;IAC5F,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;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 './
|
|
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 './
|
|
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 './
|
|
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 './
|
|
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'
|
|
@@ -24,8 +24,8 @@ export const channels = (app: Application) => {
|
|
|
24
24
|
// connection can be undefined if there is no
|
|
25
25
|
// real-time connection, e.g. when logging in via REST
|
|
26
26
|
if(connection) {
|
|
27
|
-
// Obtain the logged in user
|
|
28
|
-
// const user =
|
|
27
|
+
// Obtain the logged in user
|
|
28
|
+
// const user = authResult.user
|
|
29
29
|
|
|
30
30
|
// The connection is no longer anonymous, remove it
|
|
31
31
|
app.channel('anonymous').leave(connection)
|
|
@@ -52,8 +52,6 @@ export const channels = (app: Application) => {
|
|
|
52
52
|
// Here you can add event publishers to channels set up in \`channels.js\`
|
|
53
53
|
// To publish only for a specific event use \`app.publish(eventname, () => {})\`
|
|
54
54
|
|
|
55
|
-
console.log('Publishing all events to all authenticated users. See \`channels.js\` and https://docs.feathersjs.com/api/channels.html for more information.') // eslint-disable-line
|
|
56
|
-
|
|
57
55
|
// e.g. to publish all service events to all authenticated users use
|
|
58
56
|
return app.channel('authenticated')
|
|
59
57
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/channels.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAuB,EAAE,EAAE,CACrD;;;;;;;;;;kFAUgF,QAAQ
|
|
1
|
+
{"version":3,"file":"channels.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/channels.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAuB,EAAE,EAAE,CACrD;;;;;;;;;;kFAUgF,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDzF,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,CAAC,CAC1D,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
|
|
@@ -24,8 +24,8 @@ export const channels = (app: Application) => {
|
|
|
24
24
|
// connection can be undefined if there is no
|
|
25
25
|
// real-time connection, e.g. when logging in via REST
|
|
26
26
|
if(connection) {
|
|
27
|
-
// Obtain the logged in user
|
|
28
|
-
// const user =
|
|
27
|
+
// Obtain the logged in user
|
|
28
|
+
// const user = authResult.user
|
|
29
29
|
|
|
30
30
|
// The connection is no longer anonymous, remove it
|
|
31
31
|
app.channel('anonymous').leave(connection)
|
|
@@ -52,8 +52,6 @@ export const channels = (app: Application) => {
|
|
|
52
52
|
// Here you can add event publishers to channels set up in \`channels.js\`
|
|
53
53
|
// To publish only for a specific event use \`app.publish(eventname, () => {})\`
|
|
54
54
|
|
|
55
|
-
console.log('Publishing all events to all authenticated users. See \`channels.js\` and https://docs.feathersjs.com/api/channels.html for more information.') // eslint-disable-line
|
|
56
|
-
|
|
57
55
|
// e.g. to publish all service events to all authenticated users use
|
|
58
56
|
return app.channel('authenticated')
|
|
59
57
|
})
|
|
@@ -3,10 +3,11 @@ 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 = ({}) => `import { feathers
|
|
6
|
+
const template = ({}) => `import { feathers } from '@feathersjs/feathers'
|
|
7
|
+
import type { Service, TransportConnection, Params } from '@feathersjs/feathers'
|
|
7
8
|
|
|
8
|
-
// A mapping of client side services
|
|
9
9
|
export interface ServiceTypes {
|
|
10
|
+
// A mapping of client side services
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const createClient = <Configuration = any> (connection: TransportConnection<ServiceTypes>) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAC3C
|
|
1
|
+
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/client.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAC3C;;;;;;;;;;;;;;CAcD,CAAA;AAEM,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAwB,EAAE,EAAE,CACzD,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,QAAQ,CAAC,CACxD,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
|
|
@@ -3,10 +3,11 @@ import { renderSource } from '../../commons'
|
|
|
3
3
|
import { AppGeneratorContext } from '../index'
|
|
4
4
|
|
|
5
5
|
const template = ({}: AppGeneratorContext) =>
|
|
6
|
-
`import { feathers
|
|
6
|
+
`import { feathers } from '@feathersjs/feathers'
|
|
7
|
+
import type { Service, TransportConnection, Params } from '@feathersjs/feathers'
|
|
7
8
|
|
|
8
|
-
// A mapping of client side services
|
|
9
9
|
export interface ServiceTypes {
|
|
10
|
+
// A mapping of client side services
|
|
10
11
|
}
|
|
11
12
|
|
|
12
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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, '
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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, '
|
|
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 './
|
|
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 './
|
|
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
|
}
|
|
@@ -14,8 +15,9 @@ const jsPackageJson = (lib) => ({
|
|
|
14
15
|
const tsPackageJson = (lib) => ({
|
|
15
16
|
scripts: {
|
|
16
17
|
dev: `nodemon -x ts-node ${lib}/index.ts`,
|
|
17
|
-
compile: 'shx rm -rf
|
|
18
|
-
start: 'npm run compile && node
|
|
18
|
+
compile: 'shx rm -rf lib/ && tsc',
|
|
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,
|
|
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,EAAE,gCAAgC;QAC1C,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,QAAQ,EAAE,gCAAgC;QAC1C,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;KAC3C;IACD,QAAQ,EAAE;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,UAAU;KACX;IACD,WAAW,EAAE;QACX,GAAG;QACH,IAAI;KACL;IACD,IAAI,EAAE,GAAG,GAAG,GAAG;IACf,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS;IAC5D,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,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"}
|
|
@@ -6,6 +6,7 @@ const jsPackageJson = (lib: string) => ({
|
|
|
6
6
|
scripts: {
|
|
7
7
|
start: `node ${lib}`,
|
|
8
8
|
dev: `nodemon ${lib}/`,
|
|
9
|
+
prettier: 'npx prettier "**/*.js" --write',
|
|
9
10
|
mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
|
|
10
11
|
test: 'npm run mocha'
|
|
11
12
|
}
|
|
@@ -14,8 +15,9 @@ const jsPackageJson = (lib: string) => ({
|
|
|
14
15
|
const tsPackageJson = (lib: string) => ({
|
|
15
16
|
scripts: {
|
|
16
17
|
dev: `nodemon -x ts-node ${lib}/index.ts`,
|
|
17
|
-
compile: 'shx rm -rf
|
|
18
|
-
start: 'npm run compile && node
|
|
18
|
+
compile: 'shx rm -rf lib/ && tsc',
|
|
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,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
|
+
)
|
|
@@ -9,11 +9,12 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)((
|
|
|
9
9
|
compilerOptions: {
|
|
10
10
|
target: 'es2020',
|
|
11
11
|
module: 'commonjs',
|
|
12
|
-
outDir: './
|
|
12
|
+
outDir: './lib',
|
|
13
13
|
rootDir: `./${lib}`,
|
|
14
14
|
strict: true,
|
|
15
15
|
esModuleInterop: true
|
|
16
16
|
},
|
|
17
|
+
include: [lib],
|
|
17
18
|
exclude: ['test']
|
|
18
19
|
}), (0, pinion_1.toFile)('tsconfig.json'))));
|
|
19
20
|
exports.generate = generate;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,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;AAvBU,QAAA,QAAQ,YAuBlB"}
|
|
@@ -13,11 +13,12 @@ export const generate = (ctx: AppGeneratorContext) =>
|
|
|
13
13
|
compilerOptions: {
|
|
14
14
|
target: 'es2020',
|
|
15
15
|
module: 'commonjs',
|
|
16
|
-
outDir: './
|
|
16
|
+
outDir: './lib',
|
|
17
17
|
rootDir: `./${lib}`,
|
|
18
18
|
strict: true,
|
|
19
19
|
esModuleInterop: true
|
|
20
20
|
},
|
|
21
|
+
include: [lib],
|
|
21
22
|
exclude: ['test']
|
|
22
23
|
}),
|
|
23
24
|
toFile('tsconfig.json')
|
|
@@ -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
|
|
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,
|
|
38
|
-
.then((0,
|
|
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,+
|
|
1
|
+
{"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAC9D,2CAA0D;AAG1D,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,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAE5E,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,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,
|
|
2
|
-
import {
|
|
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
|
|
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(
|
|
53
|
-
.then(
|
|
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,
|
|
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,
|
|
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,
|
|
5
|
-
`import { ${upperName}Result } from '
|
|
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 = ({
|
|
@@ -32,9 +32,12 @@ export async function down(knex: Knex): Promise<void> {
|
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
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', () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Probably not great but it works to align with the Knex migration file format
|
|
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);
|
|
38
41
|
return `${migrationDate}_authentication`;
|
|
39
42
|
})))));
|
|
40
43
|
exports.generate = generate;
|