@gasket/preset-nextjs 6.47.0 → 7.0.0-1.0
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 -1
- package/lib/index.js +12 -2
- package/lib/preset-config.js +41 -0
- package/lib/preset-prompt.js +21 -0
- package/package.json +48 -10
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ gasket create <app-name> --presets @gasket/preset-nextjs
|
|
|
12
12
|
|
|
13
13
|
- [@gasket/plugin-express](/packages/gasket-plugin-express/README.md)
|
|
14
14
|
- [@gasket/plugin-https](/packages/gasket-plugin-https/README.md)
|
|
15
|
-
- [@gasket/plugin-
|
|
15
|
+
- [@gasket/plugin-winston](/packages/gasket-plugin-winston/README.md)
|
|
16
16
|
- [@gasket/plugin-nextjs](/packages/gasket-plugin-nextjs/README.md)
|
|
17
17
|
- [@gasket/plugin-redux](/packages/gasket-plugin-redux/README.md)
|
|
18
18
|
- [@gasket/plugin-webpack](/packages/gasket-plugin-webpack/README.md)
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@gasket/plugin-express';
|
|
2
2
|
import '@gasket/plugin-https';
|
|
3
|
-
import '@gasket/plugin-log';
|
|
4
3
|
import '@gasket/plugin-nextjs';
|
|
5
4
|
import '@gasket/plugin-redux';
|
|
6
5
|
import '@gasket/plugin-start';
|
|
7
6
|
import '@gasket/plugin-webpack';
|
|
7
|
+
import '@gasket/plugin-winston';
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import presetPrompt from './preset-prompt.js';
|
|
3
|
+
import presetConfig from './preset-config.js';
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const { name } = require('../package.json');
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name,
|
|
9
|
+
hooks: {
|
|
10
|
+
presetPrompt,
|
|
11
|
+
presetConfig
|
|
12
|
+
}
|
|
3
13
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import pluginExpress from '@gasket/plugin-express';
|
|
2
|
+
import pluginHttps from '@gasket/plugin-https';
|
|
3
|
+
import pluginNext from '@gasket/plugin-nextjs';
|
|
4
|
+
import pluginRedux from '@gasket/plugin-redux';
|
|
5
|
+
import pluginWebpack from '@gasket/plugin-webpack';
|
|
6
|
+
import pluginWinston from '@gasket/plugin-winston';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* presetConfig hook
|
|
10
|
+
* @param {Gasket} gasket - Gasket API
|
|
11
|
+
* @param {Create} context - Create context
|
|
12
|
+
* @returns {Promise<CreateContext.presetConfig>} config
|
|
13
|
+
*/
|
|
14
|
+
export default async function presetConfig(gasket, context) {
|
|
15
|
+
let typescriptPlugin;
|
|
16
|
+
const testPlugins = [];
|
|
17
|
+
|
|
18
|
+
if ('testPlugins' in context && context.testPlugins.length > 0) {
|
|
19
|
+
await Promise.all(context.testPlugins.map(async (testPlugin) => {
|
|
20
|
+
const plugin = await import(testPlugin);
|
|
21
|
+
testPlugins.push(plugin ? plugin.default || plugin : null);
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (context.typescript) {
|
|
26
|
+
typescriptPlugin = await import('@gasket/plugin-typescript');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
plugins: [
|
|
31
|
+
pluginWebpack,
|
|
32
|
+
pluginExpress,
|
|
33
|
+
pluginHttps,
|
|
34
|
+
pluginNext,
|
|
35
|
+
pluginRedux,
|
|
36
|
+
pluginWinston,
|
|
37
|
+
typescriptPlugin ? typescriptPlugin.default || typescriptPlugin : null,
|
|
38
|
+
...testPlugins
|
|
39
|
+
].filter(Boolean)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* presetPrompt hook
|
|
3
|
+
* @param {Gasket} gasket - Gasket API
|
|
4
|
+
* @param {Create} context - Create context
|
|
5
|
+
* @param {Object} utils - Prompt utils
|
|
6
|
+
* @param {Function} utils.prompt - Inquirer prompt
|
|
7
|
+
*/
|
|
8
|
+
export default async function presetPrompt(gasket, context, { prompt }) {
|
|
9
|
+
if (!('typescript' in context)) {
|
|
10
|
+
const { typescript } = await prompt([
|
|
11
|
+
{
|
|
12
|
+
name: 'typescript',
|
|
13
|
+
message: 'Do you want to use TypeScript?',
|
|
14
|
+
type: 'confirm',
|
|
15
|
+
default: false
|
|
16
|
+
}
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
Object.assign(context, { typescript });
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-1.0",
|
|
4
4
|
"description": "Basic NextJS Framework",
|
|
5
|
-
"main": "lib",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib"
|
|
9
9
|
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"lint:fix": "npm run lint -- --fix",
|
|
14
|
+
"test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict --experimental-vm-modules' jest",
|
|
15
|
+
"test:watch": "npm run test -- --watch",
|
|
16
|
+
"test:coverage": "jest --coverage",
|
|
17
|
+
"posttest": "npm run lint"
|
|
18
|
+
},
|
|
10
19
|
"repository": {
|
|
11
20
|
"type": "git",
|
|
12
21
|
"url": "git+ssh://git@github.com/godaddy/gasket.git"
|
|
@@ -20,15 +29,44 @@
|
|
|
20
29
|
"url": "https://github.com/godaddy/gasket/issues"
|
|
21
30
|
},
|
|
22
31
|
"dependencies": {
|
|
23
|
-
"@gasket/plugin-
|
|
24
|
-
"@gasket/plugin-
|
|
25
|
-
"@gasket/plugin-
|
|
26
|
-
"@gasket/plugin-
|
|
27
|
-
"@gasket/plugin-
|
|
28
|
-
"@gasket/plugin-
|
|
32
|
+
"@gasket/plugin-cypress": "^7.0.0-next.34",
|
|
33
|
+
"@gasket/plugin-express": "^7.0.0-next.34",
|
|
34
|
+
"@gasket/plugin-https": "^7.0.0-next.34",
|
|
35
|
+
"@gasket/plugin-jest": "^7.0.0-next.34",
|
|
36
|
+
"@gasket/plugin-lint": "^7.0.0-next.34",
|
|
37
|
+
"@gasket/plugin-mocha": "^7.0.0-next.34",
|
|
38
|
+
"@gasket/plugin-nextjs": "^7.0.0-1.0",
|
|
39
|
+
"@gasket/plugin-redux": "^7.0.0-next.34",
|
|
40
|
+
"@gasket/plugin-typescript": "^7.0.0-next.34",
|
|
41
|
+
"@gasket/plugin-webpack": "^7.0.0-next.34",
|
|
42
|
+
"@gasket/plugin-winston": "^7.0.0-next.34",
|
|
43
|
+
"@gasket/utils": "^7.0.0-next.34"
|
|
29
44
|
},
|
|
30
45
|
"devDependencies": {
|
|
31
|
-
"
|
|
46
|
+
"cross-env": "^7.0.3",
|
|
47
|
+
"eslint": "^8.56.0",
|
|
48
|
+
"eslint-config-godaddy": "^7.0.2",
|
|
49
|
+
"eslint-plugin-jest": "^27.6.3",
|
|
50
|
+
"eslint-plugin-unicorn": "^44.0.0",
|
|
51
|
+
"jest": "^29.7.0"
|
|
52
|
+
},
|
|
53
|
+
"eslintConfig": {
|
|
54
|
+
"extends": [
|
|
55
|
+
"godaddy",
|
|
56
|
+
"plugin:jest/recommended"
|
|
57
|
+
],
|
|
58
|
+
"plugins": [
|
|
59
|
+
"unicorn"
|
|
60
|
+
],
|
|
61
|
+
"rules": {
|
|
62
|
+
"unicorn/filename-case": "error"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"eslintIgnore": [
|
|
66
|
+
"test/fixtures"
|
|
67
|
+
],
|
|
68
|
+
"jest": {
|
|
69
|
+
"transform": {}
|
|
32
70
|
},
|
|
33
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "3b16c19dd078a1d65f4492654e637c5dc85efdd1"
|
|
34
72
|
}
|