@gasket/preset-nextjs 7.0.0-next.5 → 7.0.0-next.7

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