@feathersjs/cli 5.0.0-pre.27 → 5.0.0-pre.28
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 +11 -0
- package/lib/app/templates/declarations.tpl.js +2 -1
- package/lib/app/templates/declarations.tpl.js.map +1 -1
- package/lib/app/templates/declarations.tpl.ts +2 -1
- package/lib/app/templates/package.json.tpl.js +1 -2
- package/lib/app/templates/package.json.tpl.js.map +1 -1
- package/lib/app/templates/package.json.tpl.ts +1 -2
- package/lib/app/templates/tsconfig.json.tpl.js +1 -0
- package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
- package/lib/app/templates/tsconfig.json.tpl.ts +1 -0
- package/lib/authentication/templates/user.resolver.tpl.js +4 -2
- package/lib/authentication/templates/user.resolver.tpl.js.map +1 -1
- package/lib/authentication/templates/user.resolver.tpl.ts +4 -2
- package/lib/hook/templates/hook.tpl.js +2 -2
- package/lib/hook/templates/hook.tpl.js.map +1 -1
- package/lib/hook/templates/hook.tpl.ts +4 -3
- package/lib/service/templates/client.tpl.js +4 -2
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +4 -2
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [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
18
|
|
|
8
19
|
|
|
@@ -16,7 +16,8 @@ export interface ServiceTypes {}
|
|
|
16
16
|
// The application instance type that will be used everywhere else
|
|
17
17
|
export type Application = FeathersApplication<ServiceTypes, Configuration>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// The context for hook functions - can be typed with a service class
|
|
20
|
+
export type HookContext<S = any> = FeathersHookContext<Application, S>
|
|
20
21
|
`;
|
|
21
22
|
const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ language }) => language === 'ts', (0, pinion_1.renderTemplate)(template, (0, pinion_1.toFile)(({ lib }) => lib, 'declarations.ts'))));
|
|
22
23
|
exports.generate = generate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/declarations.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4E;AAG5E,MAAM,QAAQ,GAAG,CAAC,EAAE,SAAS,EAAuB,EAAE,EAAE,CACtD;kEACgE,SAAS
|
|
1
|
+
{"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/declarations.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4E;AAG5E,MAAM,QAAQ,GAAG,CAAC,EAAE,SAAS,EAAuB,EAAE,EAAE,CACtD;kEACgE,SAAS;;;;;;;;;;;;;;;CAe1E,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,IAAI,EACnC,IAAA,uBAAc,EACZ,QAAQ,EACR,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,CACjE,CACF,CACF,CAAA;AATU,QAAA,QAAQ,YASlB"}
|
|
@@ -16,7 +16,8 @@ export interface ServiceTypes {}
|
|
|
16
16
|
// The application instance type that will be used everywhere else
|
|
17
17
|
export type Application = FeathersApplication<ServiceTypes, Configuration>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// The context for hook functions - can be typed with a service class
|
|
20
|
+
export type HookContext<S = any> = FeathersHookContext<Application, S>
|
|
20
21
|
`
|
|
21
22
|
|
|
22
23
|
export const generate = (ctx: AppGeneratorContext) =>
|
|
@@ -46,8 +46,7 @@ const packageJson = ({ name, description, language, packager, database, framewor
|
|
|
46
46
|
lib,
|
|
47
47
|
test
|
|
48
48
|
},
|
|
49
|
-
main: `${lib}
|
|
50
|
-
browser: language === 'ts' ? 'dist/client' : `${lib}/client`,
|
|
49
|
+
main: language === 'ts' ? 'lib/client' : `${lib}/client`,
|
|
51
50
|
...(language === 'ts' ? tsPackageJson(lib) : jsPackageJson(lib))
|
|
52
51
|
});
|
|
53
52
|
const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.writeJSON)(packageJson, (0, pinion_1.toFile)('package.json')));
|
|
@@ -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,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,
|
|
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,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS;IACxD,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"}
|
|
@@ -58,8 +58,7 @@ const packageJson = ({
|
|
|
58
58
|
lib,
|
|
59
59
|
test
|
|
60
60
|
},
|
|
61
|
-
main: `${lib}
|
|
62
|
-
browser: language === 'ts' ? 'dist/client' : `${lib}/client`,
|
|
61
|
+
main: language === 'ts' ? 'lib/client' : `${lib}/client`,
|
|
63
62
|
...(language === 'ts' ? tsPackageJson(lib) : jsPackageJson(lib))
|
|
64
63
|
})
|
|
65
64
|
|
|
@@ -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,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;
|
|
1
|
+
{"version":3,"file":"tsconfig.json.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/tsconfig.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAuE;AAGhE,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,IAAA,kBAAS,EACP,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACZ,SAAS,EAAE;QACT,KAAK,EAAE,IAAI;KACZ;IACD,eAAe,EAAE;QACf,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,KAAK,GAAG,EAAE;QACnB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;KACtB;IACD,OAAO,EAAE,CAAC,GAAG,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC,EACF,IAAA,eAAM,EAAC,eAAe,CAAC,CACxB,CACF,CACF,CAAA;AAxBU,QAAA,QAAQ,YAwBlB"}
|
|
@@ -25,7 +25,7 @@ export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
|
|
|
25
25
|
schema: ${camelName}DataSchema,
|
|
26
26
|
validate: 'before',
|
|
27
27
|
properties: {
|
|
28
|
-
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
28
|
+
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
29
29
|
}
|
|
30
30
|
})
|
|
31
31
|
|
|
@@ -34,7 +34,9 @@ export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
|
|
|
34
34
|
export const ${camelName}PatchResolver = resolve<${upperName}Patch, HookContext>({
|
|
35
35
|
schema: ${camelName}PatchSchema,
|
|
36
36
|
validate: 'before',
|
|
37
|
-
properties: {
|
|
37
|
+
properties: {
|
|
38
|
+
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
39
|
+
}
|
|
38
40
|
})
|
|
39
41
|
|
|
40
42
|
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;MAGf,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC,EAAE;;;;;;eAM9E,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,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAkC,EAAE,EAAE,CAAC;IACpE,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,WAAW;CACvB,CAAC,EACF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAA;AAZU,QAAA,QAAQ,YAYlB"}
|
|
@@ -32,7 +32,7 @@ export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
|
|
|
32
32
|
schema: ${camelName}DataSchema,
|
|
33
33
|
validate: 'before',
|
|
34
34
|
properties: {
|
|
35
|
-
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
35
|
+
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
|
|
@@ -41,7 +41,9 @@ export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
|
|
|
41
41
|
export const ${camelName}PatchResolver = resolve<${upperName}Patch, HookContext>({
|
|
42
42
|
schema: ${camelName}PatchSchema,
|
|
43
43
|
validate: 'before',
|
|
44
|
-
properties: {
|
|
44
|
+
properties: {
|
|
45
|
+
${authStrategies.includes('local') ? `password: passwordHash({ strategy: 'local' })` : ''}
|
|
46
|
+
}
|
|
45
47
|
})
|
|
46
48
|
|
|
47
49
|
|
|
@@ -4,14 +4,14 @@ exports.generate = void 0;
|
|
|
4
4
|
const pinion_1 = require("@feathershq/pinion");
|
|
5
5
|
const commons_1 = require("../../commons");
|
|
6
6
|
const aroundTemplate = ({ camelName, name }) => `
|
|
7
|
-
import { HookContext, NextFunction } from '../declarations'
|
|
7
|
+
import type { HookContext, NextFunction } from '../declarations'
|
|
8
8
|
|
|
9
9
|
export const ${camelName} = async (context: HookContext, next: NextFunction) => {
|
|
10
10
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
11
11
|
await next()
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
|
-
const regularTemplate = ({ camelName }) => `import { HookContext } from '../declarations'
|
|
14
|
+
const regularTemplate = ({ camelName, name }) => `import type { HookContext } from '../declarations'
|
|
15
15
|
|
|
16
16
|
export const ${camelName} = async (context: HookContext) => {
|
|
17
17
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.tpl.js","sourceRoot":"","sources":["../../../src/hook/templates/hook.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAEtD,2CAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAwB,EAAE,EAAE,CAAC;;;eAGvD,SAAS;+BACO,IAAI;;;CAGlC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,
|
|
1
|
+
{"version":3,"file":"hook.tpl.js","sourceRoot":"","sources":["../../../src/hook/templates/hook.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAEtD,2CAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAwB,EAAE,EAAE,CAAC;;;eAGvD,SAAS;+BACO,IAAI;;;CAGlC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,IAAI,EACiB,EAAE,EAAE,CAAC;;eAEb,SAAS;+BACO,IAAI;EACjC,CAAA;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAyB,EAAE,EAAE,CACpD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAC7E,IAAA,eAAM,EAAuB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAChF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
|
|
@@ -3,7 +3,7 @@ import { HookGeneratorContext } from '../index'
|
|
|
3
3
|
import { renderSource } from '../../commons'
|
|
4
4
|
|
|
5
5
|
const aroundTemplate = ({ camelName, name }: HookGeneratorContext) => `
|
|
6
|
-
import { HookContext, NextFunction } from '../declarations'
|
|
6
|
+
import type { HookContext, NextFunction } from '../declarations'
|
|
7
7
|
|
|
8
8
|
export const ${camelName} = async (context: HookContext, next: NextFunction) => {
|
|
9
9
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
@@ -12,8 +12,9 @@ export const ${camelName} = async (context: HookContext, next: NextFunction) =>
|
|
|
12
12
|
`
|
|
13
13
|
|
|
14
14
|
const regularTemplate = ({
|
|
15
|
-
camelName
|
|
16
|
-
|
|
15
|
+
camelName,
|
|
16
|
+
name
|
|
17
|
+
}: HookGeneratorContext) => `import type { HookContext } from '../declarations'
|
|
17
18
|
|
|
18
19
|
export const ${camelName} = async (context: HookContext) => {
|
|
19
20
|
console.log(\`Running hook ${name} on \${context.path}\.\${context.method}\`)
|
|
@@ -6,8 +6,10 @@ const schemaImports = ({ upperName, folder, fileName }) => `import type {
|
|
|
6
6
|
${upperName}Data,
|
|
7
7
|
${upperName}Result,
|
|
8
8
|
${upperName}Query,
|
|
9
|
-
} from './services/${folder.join('/')}/${fileName}.schema'
|
|
10
|
-
|
|
9
|
+
} from './services/${folder.join('/')}/${fileName}.schema'
|
|
10
|
+
|
|
11
|
+
export * from './services/${folder.join('/')}/${fileName}.schema'`;
|
|
12
|
+
const declarationTemplate = ({ path, upperName }) => ` '${path}': Service<${upperName}Result, ${upperName}Data, Params<${upperName}Query>>`;
|
|
11
13
|
const toClientFile = (0, pinion_1.toFile)(({ lib }) => [lib, 'client.ts']);
|
|
12
14
|
const generate = async (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)((ctx) => ctx.language === 'ts', (0, pinion_1.inject)(schemaImports, (0, pinion_1.after)("from '@feathersjs/feathers'"), toClientFile), (0, pinion_1.inject)(declarationTemplate, (0, pinion_1.after)('export interface ServiceTypes'), toClientFile)));
|
|
13
15
|
exports.generate = generate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/client.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA2E;AAG3E,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC;IAChF,SAAS;IACT,SAAS;IACT,SAAS;qBACQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/client.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA2E;AAG3E,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC;IAChF,SAAS;IACT,SAAS;IACT,SAAS;qBACQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ;;4BAErB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,UAAU,CAAA;AAElE,MAAM,mBAAmB,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAA2B,EAAE,EAAE,CAC3E,MAAM,IAAI,cAAc,SAAS,WAAW,SAAS,gBAAgB,SAAS,SAAS,CAAA;AAEzF,MAAM,YAAY,GAAG,IAAA,eAAM,EAA0B,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAA;AAE9E,MAAM,QAAQ,GAAG,KAAK,EAAE,GAA4B,EAAE,EAAE,CAC7D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,IAAA,eAAM,EAAC,aAAa,EAAE,IAAA,cAAK,EAAC,6BAA6B,CAAC,EAAE,YAAY,CAAC,EACzE,IAAA,eAAM,EAAC,mBAAmB,EAAE,IAAA,cAAK,EAAC,+BAA+B,CAAC,EAAE,YAAY,CAAC,CAClF,CACF,CAAA;AAPU,QAAA,QAAQ,YAOlB"}
|
|
@@ -5,10 +5,12 @@ const schemaImports = ({ upperName, folder, fileName }: ServiceGeneratorContext)
|
|
|
5
5
|
${upperName}Data,
|
|
6
6
|
${upperName}Result,
|
|
7
7
|
${upperName}Query,
|
|
8
|
-
} from './services/${folder.join('/')}/${fileName}.schema'
|
|
8
|
+
} from './services/${folder.join('/')}/${fileName}.schema'
|
|
9
|
+
|
|
10
|
+
export * from './services/${folder.join('/')}/${fileName}.schema'`
|
|
9
11
|
|
|
10
12
|
const declarationTemplate = ({ path, upperName }: ServiceGeneratorContext) =>
|
|
11
|
-
` '${path}': Service<${upperName}
|
|
13
|
+
` '${path}': Service<${upperName}Result, ${upperName}Data, Params<${upperName}Query>>`
|
|
12
14
|
|
|
13
15
|
const toClientFile = toFile<ServiceGeneratorContext>(({ lib }) => [lib, 'client.ts'])
|
|
14
16
|
|
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.
|
|
4
|
+
"version": "5.0.0-pre.28",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"bin": {
|
|
@@ -54,34 +54,34 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@feathershq/pinion": "^0.3.
|
|
57
|
+
"@feathershq/pinion": "^0.3.4",
|
|
58
58
|
"chalk": "^4.0.1",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
60
|
"prettier": "^2.7.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@feathersjs/authentication": "^5.0.0-pre.
|
|
64
|
-
"@feathersjs/authentication-local": "^5.0.0-pre.
|
|
65
|
-
"@feathersjs/authentication-oauth": "^5.0.0-pre.
|
|
66
|
-
"@feathersjs/configuration": "^5.0.0-pre.
|
|
67
|
-
"@feathersjs/errors": "^5.0.0-pre.
|
|
68
|
-
"@feathersjs/express": "^5.0.0-pre.
|
|
69
|
-
"@feathersjs/feathers": "^5.0.0-pre.
|
|
70
|
-
"@feathersjs/knex": "^5.0.0-pre.
|
|
71
|
-
"@feathersjs/koa": "^5.0.0-pre.
|
|
72
|
-
"@feathersjs/mongodb": "^5.0.0-pre.
|
|
73
|
-
"@feathersjs/schema": "^5.0.0-pre.
|
|
74
|
-
"@feathersjs/socketio": "^5.0.0-pre.
|
|
75
|
-
"@feathersjs/transport-commons": "^5.0.0-pre.
|
|
63
|
+
"@feathersjs/authentication": "^5.0.0-pre.28",
|
|
64
|
+
"@feathersjs/authentication-local": "^5.0.0-pre.28",
|
|
65
|
+
"@feathersjs/authentication-oauth": "^5.0.0-pre.28",
|
|
66
|
+
"@feathersjs/configuration": "^5.0.0-pre.28",
|
|
67
|
+
"@feathersjs/errors": "^5.0.0-pre.28",
|
|
68
|
+
"@feathersjs/express": "^5.0.0-pre.28",
|
|
69
|
+
"@feathersjs/feathers": "^5.0.0-pre.28",
|
|
70
|
+
"@feathersjs/knex": "^5.0.0-pre.28",
|
|
71
|
+
"@feathersjs/koa": "^5.0.0-pre.28",
|
|
72
|
+
"@feathersjs/mongodb": "^5.0.0-pre.28",
|
|
73
|
+
"@feathersjs/schema": "^5.0.0-pre.28",
|
|
74
|
+
"@feathersjs/socketio": "^5.0.0-pre.28",
|
|
75
|
+
"@feathersjs/transport-commons": "^5.0.0-pre.28",
|
|
76
76
|
"@types/mocha": "^9.1.1",
|
|
77
|
-
"@types/node": "^18.
|
|
78
|
-
"@types/prettier": "^2.6.
|
|
77
|
+
"@types/node": "^18.6.3",
|
|
78
|
+
"@types/prettier": "^2.6.4",
|
|
79
79
|
"axios": "^0.27.2",
|
|
80
80
|
"mocha": "^10.0.0",
|
|
81
81
|
"shx": "^0.3.4",
|
|
82
|
-
"ts-node": "^10.
|
|
83
|
-
"type-fest": "^2.
|
|
82
|
+
"ts-node": "^10.9.1",
|
|
83
|
+
"type-fest": "^2.18.0",
|
|
84
84
|
"typescript": "^4.7.4"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "bf8e54fddc14d688ba8f505e72c9630a71656ff1"
|
|
87
87
|
}
|