@gasket/preset-api 7.0.0-next.56 → 7.0.0-next.58
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/README.md +0 -1
- package/generator/server.js +4 -0
- package/lib/index.d.ts +0 -2
- package/lib/preset-config.js +17 -16
- package/lib/preset-prompt.js +2 -0
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -14,7 +14,6 @@ To see complete the list of plugins configured in your app, and what commands, l
|
|
|
14
14
|
|
|
15
15
|
## Plugins
|
|
16
16
|
|
|
17
|
-
- [@gasket/plugin-data](/packages/gasket-plugin-data/README.md)
|
|
18
17
|
- [@gasket/plugin-swagger](/packages/gasket-plugin-swagger/README.md)
|
|
19
18
|
- [@gasket/plugin-docs](/packages/gasket-plugin-docs/README.md)
|
|
20
19
|
- [@gasket/plugin-docusaurus](/packages/gasket-plugin-docusaurus/README.md)
|
package/generator/server.js
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/preset-config.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import pluginHttps from '@gasket/plugin-https';
|
|
2
|
-
import pluginData from '@gasket/plugin-data';
|
|
3
2
|
import pluginWinston from '@gasket/plugin-winston';
|
|
4
|
-
import pluginSwagger from '@gasket/plugin-swagger';
|
|
5
3
|
import pluginLint from '@gasket/plugin-lint';
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -11,33 +9,36 @@ import pluginLint from '@gasket/plugin-lint';
|
|
|
11
9
|
* @returns {Promise<CreateContext.presetConfig>} config
|
|
12
10
|
*/
|
|
13
11
|
export default async function presetConfig(gasket, context) {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const plugins = [
|
|
13
|
+
pluginHttps,
|
|
14
|
+
pluginWinston,
|
|
15
|
+
pluginLint
|
|
16
|
+
];
|
|
17
|
+
|
|
16
18
|
const frameworkPlugin = context.server === 'express'
|
|
17
19
|
? await import('@gasket/plugin-express')
|
|
18
20
|
: await import('@gasket/plugin-fastify');
|
|
19
21
|
|
|
22
|
+
plugins.push(frameworkPlugin.default || frameworkPlugin);
|
|
23
|
+
|
|
20
24
|
if ('testPlugins' in context && context.testPlugins.length > 0) {
|
|
21
25
|
await Promise.all(context.testPlugins.map(async (testPlugin) => {
|
|
22
26
|
const plugin = await import(testPlugin);
|
|
23
|
-
|
|
27
|
+
plugins.push(plugin ? plugin.default || plugin : null);
|
|
24
28
|
}));
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
if (context.typescript) {
|
|
28
|
-
typescriptPlugin = await import('@gasket/plugin-typescript');
|
|
32
|
+
const typescriptPlugin = await import('@gasket/plugin-typescript');
|
|
33
|
+
plugins.push(typescriptPlugin.default || typescriptPlugin);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (context.useSwagger) {
|
|
37
|
+
const swaggerPlugin = await import('@gasket/plugin-swagger');
|
|
38
|
+
plugins.push(swaggerPlugin.default || swaggerPlugin);
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
return {
|
|
32
|
-
plugins:
|
|
33
|
-
pluginHttps,
|
|
34
|
-
pluginData,
|
|
35
|
-
pluginWinston,
|
|
36
|
-
pluginSwagger,
|
|
37
|
-
pluginLint,
|
|
38
|
-
frameworkPlugin.default || frameworkPlugin,
|
|
39
|
-
typescriptPlugin ? typescriptPlugin.default || typescriptPlugin : null,
|
|
40
|
-
...testPlugins
|
|
41
|
-
].filter(Boolean)
|
|
42
|
+
plugins: plugins.filter(Boolean)
|
|
42
43
|
};
|
|
43
44
|
}
|
package/lib/preset-prompt.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import typescriptPrompts from '@gasket/plugin-typescript/prompts';
|
|
2
|
+
import swaggerPrompts from '@gasket/plugin-swagger/prompts';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* presetPrompt hook
|
|
@@ -11,6 +12,7 @@ export default async function presetPrompt(gasket, context, { prompt }) {
|
|
|
11
12
|
context.apiApp = true;
|
|
12
13
|
|
|
13
14
|
await typescriptPrompts.promptTypescript(context, prompt);
|
|
15
|
+
await swaggerPrompts.promptSwagger(context, prompt);
|
|
14
16
|
|
|
15
17
|
if (!('server' in context)) {
|
|
16
18
|
const { server } = await prompt([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-api",
|
|
3
|
-
"version": "7.0.0-next.
|
|
3
|
+
"version": "7.0.0-next.58",
|
|
4
4
|
"description": "Create Express-based API with Gasket",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -30,17 +30,16 @@
|
|
|
30
30
|
"url": "https://github.com/godaddy/gasket/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@gasket/plugin-cypress": "7.0.0-next.
|
|
34
|
-
"@gasket/plugin-
|
|
35
|
-
"@gasket/plugin-
|
|
36
|
-
"@gasket/plugin-
|
|
37
|
-
"@gasket/plugin-
|
|
38
|
-
"@gasket/plugin-
|
|
39
|
-
"@gasket/plugin-
|
|
40
|
-
"@gasket/plugin-
|
|
41
|
-
"@gasket/plugin-
|
|
42
|
-
"@gasket/plugin-
|
|
43
|
-
"@gasket/plugin-winston": "7.0.0-next.56"
|
|
33
|
+
"@gasket/plugin-cypress": "7.0.0-next.58",
|
|
34
|
+
"@gasket/plugin-express": "7.0.0-next.58",
|
|
35
|
+
"@gasket/plugin-fastify": "7.0.0-next.58",
|
|
36
|
+
"@gasket/plugin-https": "7.0.0-next.58",
|
|
37
|
+
"@gasket/plugin-jest": "7.0.0-next.58",
|
|
38
|
+
"@gasket/plugin-lint": "7.0.0-next.58",
|
|
39
|
+
"@gasket/plugin-mocha": "7.0.0-next.58",
|
|
40
|
+
"@gasket/plugin-swagger": "7.0.0-next.58",
|
|
41
|
+
"@gasket/plugin-typescript": "7.0.0-next.58",
|
|
42
|
+
"@gasket/plugin-winston": "7.0.0-next.58"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"cross-env": "^7.0.3",
|
|
@@ -64,10 +63,11 @@
|
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
65
|
"eslintIgnore": [
|
|
67
|
-
"test/fixtures"
|
|
66
|
+
"test/fixtures",
|
|
67
|
+
"generator"
|
|
68
68
|
],
|
|
69
69
|
"jest": {
|
|
70
70
|
"transform": {}
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "800032d942a80eec38ae3cf80e738e73e411db7f"
|
|
73
73
|
}
|