@gasket/preset-nextjs 7.0.0-next.1 → 7.0.0-next.11

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,3 +1,13 @@
1
- module.exports = {
2
- require
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,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,12 +1,21 @@
1
1
  {
2
2
  "name": "@gasket/preset-nextjs",
3
- "version": "7.0.0-next.1",
3
+ "version": "7.0.0-next.11",
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": "jest --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-express": "^7.0.0-next.1",
24
- "@gasket/plugin-https": "^7.0.0-next.1",
25
- "@gasket/plugin-nextjs": "^7.0.0-next.1",
26
- "@gasket/plugin-redux": "^7.0.0-next.1",
27
- "@gasket/plugin-webpack": "^7.0.0-next.1",
28
- "@gasket/plugin-winston": "^7.0.0-next.1"
32
+ "@gasket/plugin-cypress": "^7.0.0-next.11",
33
+ "@gasket/plugin-express": "^7.0.0-next.11",
34
+ "@gasket/plugin-https": "^7.0.0-next.11",
35
+ "@gasket/plugin-jest": "^7.0.0-next.11",
36
+ "@gasket/plugin-lint": "^7.0.0-next.11",
37
+ "@gasket/plugin-mocha": "^7.0.0-next.11",
38
+ "@gasket/plugin-nextjs": "^7.0.0-next.11",
39
+ "@gasket/plugin-redux": "^7.0.0-next.11",
40
+ "@gasket/plugin-typescript": "^7.0.0-next.11",
41
+ "@gasket/plugin-webpack": "^7.0.0-next.11",
42
+ "@gasket/plugin-winston": "^7.0.0-next.11",
43
+ "@gasket/utils": "^7.0.0-next.11"
29
44
  },
30
45
  "devDependencies": {
31
- "@gasket/plugin-start": "^7.0.0-next.1"
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": "05300b094247de1fdfaf06afcdfed24280e3f084"
71
+ "gitHead": "4ed929c6805746fd9a1a201c24dca11b78809a14"
34
72
  }