@feathersjs/generators 5.0.27 → 5.0.29
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 +10 -0
- package/lib/app/index.d.ts +3 -3
- package/lib/app/index.js +1 -2
- package/lib/app/index.js.map +1 -1
- package/lib/app/templates/gitignore.tpl.d.ts +5 -0
- package/lib/app/{static/.gitignore → templates/gitignore.tpl.js} +5 -1
- package/lib/app/templates/gitignore.tpl.js.map +1 -0
- package/lib/authentication/index.d.ts +3 -3
- package/lib/commons.d.ts +4 -4
- package/lib/commons.js +4 -0
- package/lib/commons.js.map +1 -1
- package/lib/hook/index.d.ts +2 -2
- package/package.json +32 -33
- package/lib/app/index.ts +0 -215
- package/lib/app/templates/app.test.tpl.ts +0 -50
- package/lib/app/templates/app.tpl.ts +0 -141
- package/lib/app/templates/channels.tpl.ts +0 -54
- package/lib/app/templates/client.test.tpl.ts +0 -28
- package/lib/app/templates/client.tpl.ts +0 -53
- package/lib/app/templates/configuration.tpl.ts +0 -89
- package/lib/app/templates/declarations.tpl.ts +0 -42
- package/lib/app/templates/index.html.tpl.ts +0 -44
- package/lib/app/templates/index.tpl.ts +0 -26
- package/lib/app/templates/logger.tpl.ts +0 -56
- package/lib/app/templates/package.json.tpl.ts +0 -78
- package/lib/app/templates/prettierrc.tpl.ts +0 -14
- package/lib/app/templates/readme.md.tpl.ts +0 -57
- package/lib/app/templates/services.tpl.ts +0 -20
- package/lib/app/templates/tsconfig.json.tpl.ts +0 -29
- package/lib/app/templates/validators.tpl.ts +0 -39
- package/lib/authentication/index.ts +0 -119
- package/lib/authentication/templates/authentication.tpl.ts +0 -52
- package/lib/authentication/templates/client.test.tpl.ts +0 -78
- package/lib/authentication/templates/config.tpl.ts +0 -60
- package/lib/authentication/templates/declarations.tpl.ts +0 -38
- package/lib/commons.ts +0 -341
- package/lib/connection/index.ts +0 -138
- package/lib/connection/templates/knex.tpl.ts +0 -73
- package/lib/connection/templates/mongodb.tpl.ts +0 -50
- package/lib/hook/index.ts +0 -52
- package/lib/hook/templates/hook.tpl.ts +0 -33
- package/lib/index.ts +0 -8
- package/lib/service/index.ts +0 -214
- package/lib/service/templates/client.tpl.ts +0 -33
- package/lib/service/templates/schema.json.tpl.ts +0 -143
- package/lib/service/templates/schema.typebox.tpl.ts +0 -131
- package/lib/service/templates/service.tpl.ts +0 -161
- package/lib/service/templates/shared.tpl.ts +0 -64
- package/lib/service/templates/test.tpl.ts +0 -33
- package/lib/service/type/custom.tpl.ts +0 -112
- package/lib/service/type/knex.tpl.ts +0 -105
- package/lib/service/type/mongodb.tpl.ts +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **generators:** Fix generating of gitignore ([#3514](https://github.com/feathersjs/feathers/issues/3514)) ([cabc397](https://github.com/feathersjs/feathers/commit/cabc397d2e4378c4bce79a60f2d196713cce4d8c))
|
|
11
|
+
|
|
12
|
+
## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @feathersjs/generators
|
|
15
|
+
|
|
6
16
|
## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @feathersjs/generators
|
package/lib/app/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare const generate: (ctx: AppGeneratorArguments) => Promise<{
|
|
|
33
33
|
pkg: import("../commons.js").AppPackageJson & import("@featherscloud/pinion").JSONData;
|
|
34
34
|
lib: string;
|
|
35
35
|
test: string;
|
|
36
|
-
language: "
|
|
36
|
+
language: "js" | "ts";
|
|
37
37
|
dependencyVersions: import("../commons.js").DependencyVersions & {
|
|
38
38
|
'@feathersjs/cli': any;
|
|
39
39
|
} & {
|
|
@@ -46,9 +46,9 @@ export declare const generate: (ctx: AppGeneratorArguments) => Promise<{
|
|
|
46
46
|
description?: string;
|
|
47
47
|
connectionString?: string;
|
|
48
48
|
client?: boolean;
|
|
49
|
-
database?: "
|
|
49
|
+
database?: import("../commons.js").DatabaseType;
|
|
50
50
|
packager?: "yarn" | "npm" | "pnpm";
|
|
51
51
|
transports?: ("rest" | "websockets")[];
|
|
52
52
|
framework?: "koa" | "express";
|
|
53
|
-
schema?:
|
|
53
|
+
schema?: "typebox" | "json" | false;
|
|
54
54
|
}>;
|
package/lib/app/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sep, dirname } from 'path';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { prompt, runGenerators
|
|
3
|
+
import { prompt, runGenerators } from '@featherscloud/pinion';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { initializeBaseContext, addVersions, install } from '../commons.js';
|
|
6
6
|
import { generate as connectionGenerator, prompts as connectionPrompts } from '../connection/index.js';
|
|
@@ -96,7 +96,6 @@ export const generate = (ctx) => Promise.resolve(ctx)
|
|
|
96
96
|
...connectionPrompts(ctx)
|
|
97
97
|
]))
|
|
98
98
|
.then(runGenerators(__dirname, 'templates'))
|
|
99
|
-
.then(copyFiles(fromFile(__dirname, 'static'), toFile('.')))
|
|
100
99
|
.then(initializeBaseContext())
|
|
101
100
|
.then(async (ctx) => {
|
|
102
101
|
const { dependencies } = await connectionGenerator(ctx);
|
package/lib/app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EA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,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,yBAAyB,CAC1B,CAAA;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAA;IAChG,CAAC;IAED,OAAO,WAAW,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAA;AACzD,CAAC,EACD,IAAI,EACJ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAC3B,CACF,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
2
|
+
const template = `# Logs
|
|
2
3
|
logs
|
|
3
4
|
*.log
|
|
4
5
|
npm-debug.log*
|
|
@@ -119,3 +120,6 @@ dist
|
|
|
119
120
|
.sqlite
|
|
120
121
|
|
|
121
122
|
lib/
|
|
123
|
+
`;
|
|
124
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(renderTemplate(template, toFile('.gitignore')));
|
|
125
|
+
//# sourceMappingURL=gitignore.tpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/gitignore.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9D,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHhB,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -22,15 +22,15 @@ export declare const generate: (ctx: AuthenticationGeneratorArguments) => Promis
|
|
|
22
22
|
fileName: string;
|
|
23
23
|
kebabPath: string;
|
|
24
24
|
relative: string;
|
|
25
|
-
type: "
|
|
26
|
-
schema:
|
|
25
|
+
type: "knex" | "mongodb" | "custom";
|
|
26
|
+
schema: "typebox" | "json" | false;
|
|
27
27
|
authentication: boolean;
|
|
28
28
|
isEntityService?: boolean;
|
|
29
29
|
feathers: import("../commons.js").FeathersAppInfo;
|
|
30
30
|
pkg: import("../commons.js").AppPackageJson;
|
|
31
31
|
lib: string;
|
|
32
32
|
test: string;
|
|
33
|
-
language: "
|
|
33
|
+
language: "js" | "ts";
|
|
34
34
|
dependencyVersions?: import("../commons.js").DependencyVersions;
|
|
35
35
|
cwd: string;
|
|
36
36
|
argv: string[];
|
package/lib/commons.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export declare const getJavaScript: (typescript: string, options?: ts.TranspileO
|
|
|
121
121
|
*/
|
|
122
122
|
export declare const PRETTIERRC: PrettierOptions;
|
|
123
123
|
export declare const prettify: <C extends PinionContext & {
|
|
124
|
-
language:
|
|
124
|
+
language: "js" | "ts";
|
|
125
125
|
}>(target: Callable<string, C>, options?: PrettierOptions) => (ctx: C) => Promise<C>;
|
|
126
126
|
/**
|
|
127
127
|
* Render a source file template for the language set in the context.
|
|
@@ -131,12 +131,12 @@ export declare const prettify: <C extends PinionContext & {
|
|
|
131
131
|
* @returns The updated context
|
|
132
132
|
*/
|
|
133
133
|
export declare const renderSource: <C extends PinionContext & {
|
|
134
|
-
language:
|
|
134
|
+
language: "js" | "ts";
|
|
135
135
|
}>(template: Callable<string, C>, target: Callable<string, C>, options?: {
|
|
136
136
|
force: boolean;
|
|
137
137
|
}) => (ctx: C) => Promise<C>;
|
|
138
138
|
export declare const install: <C extends PinionContext & {
|
|
139
|
-
language:
|
|
139
|
+
language: "js" | "ts";
|
|
140
140
|
}>(dependencies: Callable<string[], C>, dev: Callable<boolean, C>, packager: Callable<string, C>) => (ctx: C) => Promise<C>;
|
|
141
141
|
/**
|
|
142
142
|
* Inject a source template as the language set in the context.
|
|
@@ -148,7 +148,7 @@ export declare const install: <C extends PinionContext & {
|
|
|
148
148
|
* @returns
|
|
149
149
|
*/
|
|
150
150
|
export declare const injectSource: <C extends PinionContext & {
|
|
151
|
-
language:
|
|
151
|
+
language: "js" | "ts";
|
|
152
152
|
}>(template: Callable<string, C>, location: Location<C>, target: Callable<string, C>, transpile?: boolean) => (ctx: C) => Promise<C>;
|
|
153
153
|
/**
|
|
154
154
|
* Synchronously checks if a file exits
|
package/lib/commons.js
CHANGED
|
@@ -87,6 +87,10 @@ export const getJavaScript = (typescript, options = {}) => {
|
|
|
87
87
|
...options.compilerOptions
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
+
const { outputText } = transpiled;
|
|
91
|
+
if (outputText.startsWith('export {}') && typescript.startsWith('import')) {
|
|
92
|
+
return fixLocalImports(typescript);
|
|
93
|
+
}
|
|
90
94
|
return fixLocalImports(restoreNewLines(transpiled.outputText));
|
|
91
95
|
};
|
|
92
96
|
const getFileName = async (target, ctx) => `${await getCallable(target, ctx)}.${ctx.language}`;
|
package/lib/commons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons.js","sourceRoot":"","sources":["../src/commons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAGL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,MAAM,EAEN,IAAI,EACL,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,O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EAAE,OAAe,EAAE,EAAE,CACzE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA"}
|
package/lib/hook/index.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ export declare const generate: (ctx: HookGeneratorContext) => Promise<{
|
|
|
9
9
|
kebabName: string;
|
|
10
10
|
camelName: string;
|
|
11
11
|
name: string;
|
|
12
|
-
type:
|
|
12
|
+
type: "regular" | "around";
|
|
13
13
|
feathers: import("../commons.js").FeathersAppInfo;
|
|
14
14
|
pkg: import("../commons.js").AppPackageJson;
|
|
15
15
|
lib: string;
|
|
16
16
|
test: string;
|
|
17
|
-
language: "
|
|
17
|
+
language: "js" | "ts";
|
|
18
18
|
dependencyVersions?: import("../commons.js").DependencyVersions;
|
|
19
19
|
cwd: string;
|
|
20
20
|
argv: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/generators",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.29",
|
|
4
4
|
"description": "Feathers CLI core generators, powered by Pinion",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"keywords": [
|
|
@@ -37,13 +37,12 @@
|
|
|
37
37
|
"LICENSE",
|
|
38
38
|
"README.md",
|
|
39
39
|
"lib/**",
|
|
40
|
-
"lib/app/static/.gitignore",
|
|
41
40
|
"*.d.ts",
|
|
42
41
|
"*.js"
|
|
43
42
|
],
|
|
44
43
|
"scripts": {
|
|
45
44
|
"prepublish": "npm run compile",
|
|
46
|
-
"compile": "shx rm -rf lib/ && tsc
|
|
45
|
+
"compile": "shx rm -rf lib/ && tsc",
|
|
47
46
|
"test": "npm run compile && mocha --config ../../.mocharc.json --require tsx --recursive test/**.test.ts test/**/*.test.ts"
|
|
48
47
|
},
|
|
49
48
|
"directories": {
|
|
@@ -56,42 +55,42 @@
|
|
|
56
55
|
"@featherscloud/pinion": "^0.5.4",
|
|
57
56
|
"chalk": "^5.3.0",
|
|
58
57
|
"lodash": "^4.17.21",
|
|
59
|
-
"prettier": "^3.2
|
|
60
|
-
"typescript": "^5.
|
|
58
|
+
"prettier": "^3.3.2",
|
|
59
|
+
"typescript": "^5.5.3"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
|
-
"@feathersjs/adapter-commons": "^5.0.
|
|
64
|
-
"@feathersjs/authentication": "^5.0.
|
|
65
|
-
"@feathersjs/authentication-client": "^5.0.
|
|
66
|
-
"@feathersjs/authentication-local": "^5.0.
|
|
67
|
-
"@feathersjs/authentication-oauth": "^5.0.
|
|
68
|
-
"@feathersjs/configuration": "^5.0.
|
|
69
|
-
"@feathersjs/errors": "^5.0.
|
|
70
|
-
"@feathersjs/express": "^5.0.
|
|
71
|
-
"@feathersjs/feathers": "^5.0.
|
|
72
|
-
"@feathersjs/knex": "^5.0.
|
|
73
|
-
"@feathersjs/koa": "^5.0.
|
|
74
|
-
"@feathersjs/mongodb": "^5.0.
|
|
75
|
-
"@feathersjs/rest-client": "^5.0.
|
|
76
|
-
"@feathersjs/schema": "^5.0.
|
|
77
|
-
"@feathersjs/socketio": "^5.0.
|
|
78
|
-
"@feathersjs/transport-commons": "^5.0.
|
|
79
|
-
"@feathersjs/typebox": "^5.0.
|
|
80
|
-
"@types/mocha": "^10.0.
|
|
81
|
-
"@types/node": "^20.
|
|
62
|
+
"@feathersjs/adapter-commons": "^5.0.29",
|
|
63
|
+
"@feathersjs/authentication": "^5.0.29",
|
|
64
|
+
"@feathersjs/authentication-client": "^5.0.29",
|
|
65
|
+
"@feathersjs/authentication-local": "^5.0.29",
|
|
66
|
+
"@feathersjs/authentication-oauth": "^5.0.29",
|
|
67
|
+
"@feathersjs/configuration": "^5.0.29",
|
|
68
|
+
"@feathersjs/errors": "^5.0.29",
|
|
69
|
+
"@feathersjs/express": "^5.0.29",
|
|
70
|
+
"@feathersjs/feathers": "^5.0.29",
|
|
71
|
+
"@feathersjs/knex": "^5.0.29",
|
|
72
|
+
"@feathersjs/koa": "^5.0.29",
|
|
73
|
+
"@feathersjs/mongodb": "^5.0.29",
|
|
74
|
+
"@feathersjs/rest-client": "^5.0.29",
|
|
75
|
+
"@feathersjs/schema": "^5.0.29",
|
|
76
|
+
"@feathersjs/socketio": "^5.0.29",
|
|
77
|
+
"@feathersjs/transport-commons": "^5.0.29",
|
|
78
|
+
"@feathersjs/typebox": "^5.0.29",
|
|
79
|
+
"@types/mocha": "^10.0.7",
|
|
80
|
+
"@types/node": "^20.14.10",
|
|
82
81
|
"@types/prettier": "^2.7.3",
|
|
83
|
-
"axios": "^1.
|
|
82
|
+
"axios": "^1.7.2",
|
|
84
83
|
"knex": "^3.1.0",
|
|
85
|
-
"mocha": "^10.
|
|
86
|
-
"mongodb": "^6.
|
|
87
|
-
"mssql": "^
|
|
84
|
+
"mocha": "^10.6.0",
|
|
85
|
+
"mongodb": "^6.8.0",
|
|
86
|
+
"mssql": "^11.0.1",
|
|
88
87
|
"mysql": "^2.18.1",
|
|
89
|
-
"pg": "^8.
|
|
88
|
+
"pg": "^8.12.0",
|
|
90
89
|
"shx": "^0.3.4",
|
|
91
90
|
"sqlite3": "^5.1.7",
|
|
92
|
-
"tsx": "^4.
|
|
93
|
-
"type-fest": "^4.
|
|
94
|
-
"typescript": "^5.
|
|
91
|
+
"tsx": "^4.16.2",
|
|
92
|
+
"type-fest": "^4.21.0",
|
|
93
|
+
"typescript": "^5.5.3"
|
|
95
94
|
},
|
|
96
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "6330134f97a1de4b627d41e8bcc2287498d5faa2"
|
|
97
96
|
}
|
package/lib/app/index.ts
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { sep, dirname } from 'path'
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { prompt, runGenerators, fromFile, copyFiles, toFile } from '@featherscloud/pinion'
|
|
4
|
-
import { fileURLToPath } from 'url'
|
|
5
|
-
import {
|
|
6
|
-
FeathersBaseContext,
|
|
7
|
-
FeathersAppInfo,
|
|
8
|
-
initializeBaseContext,
|
|
9
|
-
addVersions,
|
|
10
|
-
install
|
|
11
|
-
} from '../commons.js'
|
|
12
|
-
import { generate as connectionGenerator, prompts as connectionPrompts } from '../connection/index.js'
|
|
13
|
-
|
|
14
|
-
// Set __dirname in es module
|
|
15
|
-
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
16
|
-
|
|
17
|
-
export interface AppGeneratorData extends FeathersAppInfo {
|
|
18
|
-
/**
|
|
19
|
-
* The application name
|
|
20
|
-
*/
|
|
21
|
-
name: string
|
|
22
|
-
/**
|
|
23
|
-
* A short description of the app
|
|
24
|
-
*/
|
|
25
|
-
description: string
|
|
26
|
-
/**
|
|
27
|
-
* The database connection string
|
|
28
|
-
*/
|
|
29
|
-
connectionString: string
|
|
30
|
-
/**
|
|
31
|
-
* The source folder where files are put
|
|
32
|
-
*/
|
|
33
|
-
lib: string
|
|
34
|
-
/**
|
|
35
|
-
* Generate a client
|
|
36
|
-
*/
|
|
37
|
-
client: boolean
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export type AppGeneratorContext = FeathersBaseContext &
|
|
41
|
-
AppGeneratorData & {
|
|
42
|
-
dependencies: string[]
|
|
43
|
-
devDependencies: string[]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorData>
|
|
47
|
-
|
|
48
|
-
export const generate = (ctx: AppGeneratorArguments) =>
|
|
49
|
-
Promise.resolve(ctx)
|
|
50
|
-
.then(initializeBaseContext())
|
|
51
|
-
.then((ctx) => ({
|
|
52
|
-
...ctx,
|
|
53
|
-
dependencies: [],
|
|
54
|
-
devDependencies: []
|
|
55
|
-
}))
|
|
56
|
-
.then(
|
|
57
|
-
prompt((ctx) => [
|
|
58
|
-
{
|
|
59
|
-
name: 'language',
|
|
60
|
-
type: 'list',
|
|
61
|
-
message: 'Do you want to use JavaScript or TypeScript?',
|
|
62
|
-
when: !ctx.language,
|
|
63
|
-
choices: [
|
|
64
|
-
{ name: 'TypeScript', value: 'ts' },
|
|
65
|
-
{ name: 'JavaScript', value: 'js' }
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'name',
|
|
70
|
-
type: 'input',
|
|
71
|
-
when: !ctx.name,
|
|
72
|
-
message: 'What is the name of your application?',
|
|
73
|
-
default: ctx.cwd.split(sep).pop(),
|
|
74
|
-
validate: (input) => {
|
|
75
|
-
if (ctx.dependencyVersions[input]) {
|
|
76
|
-
return `Application can not have the same name as a dependency`
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'description',
|
|
84
|
-
type: 'input',
|
|
85
|
-
when: !ctx.description,
|
|
86
|
-
message: 'Write a short description'
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
type: 'list',
|
|
90
|
-
name: 'framework',
|
|
91
|
-
when: !ctx.framework,
|
|
92
|
-
message: 'Which HTTP framework do you want to use?',
|
|
93
|
-
choices: [
|
|
94
|
-
{ value: 'koa', name: `KoaJS ${chalk.grey('(recommended)')}` },
|
|
95
|
-
{ value: 'express', name: 'Express' }
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: 'checkbox',
|
|
100
|
-
name: 'transports',
|
|
101
|
-
when: !ctx.transports,
|
|
102
|
-
message: 'What APIs do you want to offer?',
|
|
103
|
-
choices: [
|
|
104
|
-
{ value: 'rest', name: 'HTTP (REST)', checked: true },
|
|
105
|
-
{ value: 'websockets', name: 'Real-time', checked: true }
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'packager',
|
|
110
|
-
type: 'list',
|
|
111
|
-
when: !ctx.packager,
|
|
112
|
-
message: 'Which package manager are you using?',
|
|
113
|
-
choices: [
|
|
114
|
-
{ value: 'npm', name: 'npm' },
|
|
115
|
-
{ value: 'yarn', name: 'Yarn' },
|
|
116
|
-
{ value: 'pnpm', name: 'pnpm' }
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'client',
|
|
121
|
-
type: 'confirm',
|
|
122
|
-
when: ctx.client === undefined,
|
|
123
|
-
message: (answers) => `Generate ${answers.language === 'ts' ? 'end-to-end typed ' : ''}client?`,
|
|
124
|
-
suffix: chalk.grey(' Can be used with React, Angular, Vue, React Native, Node.js etc.')
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
type: 'list',
|
|
128
|
-
name: 'schema',
|
|
129
|
-
when: !ctx.schema,
|
|
130
|
-
message: 'What is your preferred schema (model) definition format?',
|
|
131
|
-
suffix: chalk.grey(
|
|
132
|
-
' Schemas allow to type, validate, secure and populate your data and configuration'
|
|
133
|
-
),
|
|
134
|
-
choices: [
|
|
135
|
-
{ value: 'typebox', name: `TypeBox ${chalk.grey('(recommended)')}` },
|
|
136
|
-
{ value: 'json', name: 'JSON schema' },
|
|
137
|
-
{ value: false, name: `No schema ${chalk.grey('(not recommended)')}` }
|
|
138
|
-
]
|
|
139
|
-
},
|
|
140
|
-
...connectionPrompts(ctx)
|
|
141
|
-
])
|
|
142
|
-
)
|
|
143
|
-
.then(runGenerators(__dirname, 'templates'))
|
|
144
|
-
.then(copyFiles(fromFile(__dirname, 'static'), toFile('.')))
|
|
145
|
-
.then(initializeBaseContext())
|
|
146
|
-
.then(async (ctx) => {
|
|
147
|
-
const { dependencies } = await connectionGenerator(ctx)
|
|
148
|
-
|
|
149
|
-
return {
|
|
150
|
-
...ctx,
|
|
151
|
-
dependencies
|
|
152
|
-
}
|
|
153
|
-
})
|
|
154
|
-
.then(
|
|
155
|
-
install(
|
|
156
|
-
({ transports, framework, dependencyVersions, dependencies, schema }) => {
|
|
157
|
-
const hasSocketio = transports.includes('websockets')
|
|
158
|
-
|
|
159
|
-
dependencies.push(
|
|
160
|
-
'@feathersjs/feathers',
|
|
161
|
-
'@feathersjs/errors',
|
|
162
|
-
'@feathersjs/schema',
|
|
163
|
-
'@feathersjs/configuration',
|
|
164
|
-
'@feathersjs/transport-commons',
|
|
165
|
-
'@feathersjs/adapter-commons',
|
|
166
|
-
'@feathersjs/authentication',
|
|
167
|
-
'@feathersjs/authentication-client',
|
|
168
|
-
'winston'
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
if (hasSocketio) {
|
|
172
|
-
dependencies.push('@feathersjs/socketio')
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (framework === 'koa') {
|
|
176
|
-
dependencies.push('@feathersjs/koa')
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (framework === 'express') {
|
|
180
|
-
dependencies.push('@feathersjs/express', 'compression')
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (schema === 'typebox') {
|
|
184
|
-
dependencies.push('@feathersjs/typebox')
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return addVersions(dependencies, dependencyVersions)
|
|
188
|
-
},
|
|
189
|
-
false,
|
|
190
|
-
({ packager }) => packager
|
|
191
|
-
)
|
|
192
|
-
)
|
|
193
|
-
.then(
|
|
194
|
-
install(
|
|
195
|
-
({ language, devDependencies, dependencyVersions }) => {
|
|
196
|
-
devDependencies.push(
|
|
197
|
-
'nodemon',
|
|
198
|
-
'axios',
|
|
199
|
-
'mocha',
|
|
200
|
-
'cross-env',
|
|
201
|
-
'prettier',
|
|
202
|
-
'@feathersjs/cli',
|
|
203
|
-
'@feathersjs/rest-client'
|
|
204
|
-
)
|
|
205
|
-
|
|
206
|
-
if (language === 'ts') {
|
|
207
|
-
devDependencies.push('@types/mocha', '@types/node', 'nodemon', 'ts-node', 'typescript', 'shx')
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return addVersions(devDependencies, dependencyVersions)
|
|
211
|
-
},
|
|
212
|
-
true,
|
|
213
|
-
({ packager }) => packager
|
|
214
|
-
)
|
|
215
|
-
)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { toFile } from '@featherscloud/pinion'
|
|
2
|
-
import { renderSource } from '../../commons.js'
|
|
3
|
-
import { AppGeneratorContext } from '../index.js'
|
|
4
|
-
|
|
5
|
-
const template = ({
|
|
6
|
-
lib
|
|
7
|
-
}: AppGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/app.test.html
|
|
8
|
-
import assert from 'assert'
|
|
9
|
-
import axios from 'axios'
|
|
10
|
-
import type { Server } from 'http'
|
|
11
|
-
import { app } from '../${lib}/app'
|
|
12
|
-
|
|
13
|
-
const port = app.get('port')
|
|
14
|
-
const appUrl = \`http://\${app.get('host')}:\${port}\`
|
|
15
|
-
|
|
16
|
-
describe('Feathers application tests', () => {
|
|
17
|
-
let server: Server
|
|
18
|
-
|
|
19
|
-
before(async () => {
|
|
20
|
-
server = await app.listen(port)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
after(async () => {
|
|
24
|
-
await app.teardown()
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('starts and shows the index page', async () => {
|
|
28
|
-
const { data } = await axios.get<string>(appUrl)
|
|
29
|
-
|
|
30
|
-
assert.ok(data.indexOf('<html lang="en">') !== -1)
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('shows a 404 JSON error', async () => {
|
|
34
|
-
try {
|
|
35
|
-
await axios.get(\`\${appUrl}/path/to/nowhere\`, {
|
|
36
|
-
responseType: 'json'
|
|
37
|
-
})
|
|
38
|
-
assert.fail('should never get here')
|
|
39
|
-
} catch (error: any) {
|
|
40
|
-
const { response } = error
|
|
41
|
-
assert.strictEqual(response?.status, 404)
|
|
42
|
-
assert.strictEqual(response?.data?.code, 404)
|
|
43
|
-
assert.strictEqual(response?.data?.name, 'NotFound')
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
export const generate = (ctx: AppGeneratorContext) =>
|
|
50
|
-
Promise.resolve(ctx).then(renderSource(template, toFile('test', 'app.test')))
|