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