@gasket/preset-api 7.3.0-canary.4 → 7.3.0-canary.6
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/lib/index.d.ts +1 -1
- package/lib/preset-config.js +5 -2
- package/lib/preset-prompt.js +14 -7
- package/package.json +13 -12
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@gasket/plugin-data';
|
|
2
2
|
import '@gasket/plugin-express';
|
|
3
|
+
import '@gasket/plugin-fastify';
|
|
3
4
|
import '@gasket/plugin-https';
|
|
4
5
|
import '@gasket/plugin-lint';
|
|
5
|
-
import '@gasket/plugin-start';
|
|
6
6
|
import '@gasket/plugin-swagger';
|
|
7
7
|
import '@gasket/plugin-winston';
|
package/lib/preset-config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import pluginExpress from '@gasket/plugin-express';
|
|
2
1
|
import pluginHttps from '@gasket/plugin-https';
|
|
3
2
|
import pluginData from '@gasket/plugin-data';
|
|
4
3
|
import pluginWinston from '@gasket/plugin-winston';
|
|
@@ -14,6 +13,10 @@ import pluginLint from '@gasket/plugin-lint';
|
|
|
14
13
|
export default async function presetConfig(gasket, context) {
|
|
15
14
|
let typescriptPlugin;
|
|
16
15
|
const testPlugins = [];
|
|
16
|
+
// TODO: test canary publish without fastify dependency
|
|
17
|
+
const frameworkPlugin = context.server === 'express'
|
|
18
|
+
? await import('@gasket/plugin-express')
|
|
19
|
+
: await import('@gasket/plugin-fastify');
|
|
17
20
|
|
|
18
21
|
if ('testPlugins' in context && context.testPlugins.length > 0) {
|
|
19
22
|
await Promise.all(context.testPlugins.map(async (testPlugin) => {
|
|
@@ -28,12 +31,12 @@ export default async function presetConfig(gasket, context) {
|
|
|
28
31
|
|
|
29
32
|
return {
|
|
30
33
|
plugins: [
|
|
31
|
-
pluginExpress,
|
|
32
34
|
pluginHttps,
|
|
33
35
|
pluginData,
|
|
34
36
|
pluginWinston,
|
|
35
37
|
pluginSwagger,
|
|
36
38
|
pluginLint,
|
|
39
|
+
frameworkPlugin.default || frameworkPlugin,
|
|
37
40
|
typescriptPlugin ? typescriptPlugin.default || typescriptPlugin : null,
|
|
38
41
|
...testPlugins
|
|
39
42
|
].filter(Boolean)
|
package/lib/preset-prompt.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import typescriptPrompts from '@gasket/plugin-typescript/prompts';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* presetPrompt hook
|
|
3
5
|
* @param {Gasket} gasket - Gasket API
|
|
@@ -8,16 +10,21 @@
|
|
|
8
10
|
export default async function presetPrompt(gasket, context, { prompt }) {
|
|
9
11
|
context.apiApp = true;
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
await typescriptPrompts.promptTypescript(context, prompt);
|
|
14
|
+
|
|
15
|
+
if (!('server' in context)) {
|
|
16
|
+
const { server } = await prompt([
|
|
13
17
|
{
|
|
14
|
-
name: '
|
|
15
|
-
message: '
|
|
16
|
-
type: '
|
|
17
|
-
|
|
18
|
+
name: 'server',
|
|
19
|
+
message: 'Which server framework would you like to use?',
|
|
20
|
+
type: 'list',
|
|
21
|
+
choices: [
|
|
22
|
+
{ name: 'Express', value: 'express' },
|
|
23
|
+
{ name: 'Fastify', value: 'fastify' }
|
|
24
|
+
]
|
|
18
25
|
}
|
|
19
26
|
]);
|
|
20
27
|
|
|
21
|
-
Object.assign(context, {
|
|
28
|
+
Object.assign(context, { server });
|
|
22
29
|
}
|
|
23
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-api",
|
|
3
|
-
"version": "7.3.0-canary.
|
|
3
|
+
"version": "7.3.0-canary.6",
|
|
4
4
|
"description": "Create Express-based API with Gasket",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -30,16 +30,17 @@
|
|
|
30
30
|
"url": "https://github.com/godaddy/gasket/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@gasket/plugin-cypress": "^7.3.0-canary.
|
|
34
|
-
"@gasket/plugin-data": "^7.
|
|
35
|
-
"@gasket/plugin-express": "^7.
|
|
36
|
-
"@gasket/plugin-
|
|
37
|
-
"@gasket/plugin-
|
|
38
|
-
"@gasket/plugin-
|
|
39
|
-
"@gasket/plugin-
|
|
40
|
-
"@gasket/plugin-
|
|
41
|
-
"@gasket/plugin-
|
|
42
|
-
"@gasket/plugin-
|
|
33
|
+
"@gasket/plugin-cypress": "^7.3.0-canary.6",
|
|
34
|
+
"@gasket/plugin-data": "^7.0.0-next.41",
|
|
35
|
+
"@gasket/plugin-express": "^7.0.0-next.41",
|
|
36
|
+
"@gasket/plugin-fastify": "^7.0.0-next.41",
|
|
37
|
+
"@gasket/plugin-https": "^7.0.0-next.41",
|
|
38
|
+
"@gasket/plugin-jest": "^7.3.0-canary.6",
|
|
39
|
+
"@gasket/plugin-lint": "^7.0.0-next.41",
|
|
40
|
+
"@gasket/plugin-mocha": "^7.3.0-canary.6",
|
|
41
|
+
"@gasket/plugin-swagger": "^7.0.0-next.41",
|
|
42
|
+
"@gasket/plugin-typescript": "^7.3.0-canary.6",
|
|
43
|
+
"@gasket/plugin-winston": "^7.0.0-next.41"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"cross-env": "^7.0.3",
|
|
@@ -68,5 +69,5 @@
|
|
|
68
69
|
"jest": {
|
|
69
70
|
"transform": {}
|
|
70
71
|
},
|
|
71
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f2ed263d6d5b6b43098cfaf80db4cffe3959934c"
|
|
72
73
|
}
|