@gasket/preset-nextjs 7.4.9 → 7.5.1
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, "__esModule", {
|
|
3
2
|
value: true
|
|
4
3
|
});
|
|
@@ -9,9 +8,9 @@ Object.defineProperty(exports, /** @type {import('@gasket/core').Preset} */ "def
|
|
|
9
8
|
}
|
|
10
9
|
});
|
|
11
10
|
const _module = require("module");
|
|
12
|
-
const _presetprompt = /*#__PURE__*/ _interop_require_default(require("./preset-prompt.
|
|
13
|
-
const _presetconfig = /*#__PURE__*/ _interop_require_default(require("./preset-config.
|
|
14
|
-
const _create = /*#__PURE__*/ _interop_require_default(require("./create.
|
|
11
|
+
const _presetprompt = /*#__PURE__*/ _interop_require_default(require("./preset-prompt.cjs"));
|
|
12
|
+
const _presetconfig = /*#__PURE__*/ _interop_require_default(require("./preset-config.cjs"));
|
|
13
|
+
const _create = /*#__PURE__*/ _interop_require_default(require("./create.cjs"));
|
|
15
14
|
function _interop_require_default(obj) {
|
|
16
15
|
return obj && obj.__esModule ? obj : {
|
|
17
16
|
default: obj
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Default Plugins - included by default for all presets
|
|
2
|
-
"use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
@@ -27,35 +26,6 @@ const _pluginintl = /*#__PURE__*/ _interop_require_default(require("@gasket/plug
|
|
|
27
26
|
const _pluginwebpack = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-webpack"));
|
|
28
27
|
const _pluginwinston = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-winston"));
|
|
29
28
|
const _pluginlint = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-lint"));
|
|
30
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
31
|
-
try {
|
|
32
|
-
var info = gen[key](arg);
|
|
33
|
-
var value = info.value;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
reject(error);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (info.done) {
|
|
39
|
-
resolve(value);
|
|
40
|
-
} else {
|
|
41
|
-
Promise.resolve(value).then(_next, _throw);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function _async_to_generator(fn) {
|
|
45
|
-
return function() {
|
|
46
|
-
var self = this, args = arguments;
|
|
47
|
-
return new Promise(function(resolve, reject) {
|
|
48
|
-
var gen = fn.apply(self, args);
|
|
49
|
-
function _next(value) {
|
|
50
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
51
|
-
}
|
|
52
|
-
function _throw(err) {
|
|
53
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
54
|
-
}
|
|
55
|
-
_next(undefined);
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
29
|
function _interop_require_default(obj) {
|
|
60
30
|
return obj && obj.__esModule ? obj : {
|
|
61
31
|
default: obj
|
|
@@ -102,53 +72,42 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
102
72
|
}
|
|
103
73
|
return newObj;
|
|
104
74
|
}
|
|
105
|
-
function presetConfig(gasket, context) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}()));
|
|
144
|
-
}
|
|
145
|
-
if (context.typescript) {
|
|
146
|
-
typescriptPlugin = yield Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@gasket/plugin-typescript")));
|
|
147
|
-
plugins.add(typescriptPlugin.default || typescriptPlugin);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
plugins: Array.from(plugins)
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
return _presetConfig.apply(this, arguments);
|
|
75
|
+
async function presetConfig(gasket, context) {
|
|
76
|
+
let typescriptPlugin;
|
|
77
|
+
const plugins = new Set([
|
|
78
|
+
_plugincommand.default,
|
|
79
|
+
_plugindocs.default,
|
|
80
|
+
_plugindocusaurus.default,
|
|
81
|
+
_plugindynamicplugins.default,
|
|
82
|
+
_plugingit.default,
|
|
83
|
+
_pluginlogger.default,
|
|
84
|
+
_pluginnextjs.default,
|
|
85
|
+
_pluginintl.default,
|
|
86
|
+
_pluginwebpack.default,
|
|
87
|
+
_pluginwinston.default,
|
|
88
|
+
_pluginlint.default
|
|
89
|
+
]);
|
|
90
|
+
if (context.nextServerType === 'customServer') {
|
|
91
|
+
const frameworkPlugin = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@gasket/plugin-express")));
|
|
92
|
+
plugins.add(_pluginhttps.default);
|
|
93
|
+
plugins.add(frameworkPlugin.default || frameworkPlugin);
|
|
94
|
+
} else if (context.nextDevProxy) {
|
|
95
|
+
plugins.add(_pluginhttpsproxy.default);
|
|
96
|
+
}
|
|
97
|
+
if (context.nextDevProxy) {
|
|
98
|
+
plugins.add(_pluginhttpsproxy.default);
|
|
99
|
+
}
|
|
100
|
+
if ('testPlugins' in context && context.testPlugins.length > 0) {
|
|
101
|
+
await Promise.all(context.testPlugins.map(async (testPlugin)=>{
|
|
102
|
+
const plugin = await Promise.resolve(testPlugin).then((p)=>/*#__PURE__*/ _interop_require_wildcard(require(p)));
|
|
103
|
+
plugins.add(plugin ? plugin.default || plugin : null);
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
if (context.typescript) {
|
|
107
|
+
typescriptPlugin = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@gasket/plugin-typescript")));
|
|
108
|
+
plugins.add(typescriptPlugin.default || typescriptPlugin);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
plugins: Array.from(plugins)
|
|
112
|
+
};
|
|
154
113
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
Object.defineProperty(exports, /**
|
|
5
|
+
* presetPrompt hook
|
|
6
|
+
* @param {Gasket} gasket - Gasket API
|
|
7
|
+
* @param {Create} context - Create context
|
|
8
|
+
* @param {Object} utils - Prompt utils
|
|
9
|
+
* @param {Function} utils.prompt - Inquirer prompt
|
|
10
|
+
*/ "default", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return presetPrompt;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-nextjs/prompts"));
|
|
17
|
+
const _prompts1 = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-typescript/prompts"));
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function presetPrompt(gasket, context, { prompt }) {
|
|
24
|
+
await _prompts1.default.promptTypescript(context, prompt);
|
|
25
|
+
await _prompts.default.promptNextServerType(context, prompt);
|
|
26
|
+
await _prompts.default.promptNextDevProxy(context, prompt);
|
|
27
|
+
return context;
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-nextjs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.1",
|
|
4
4
|
"description": "Basic NextJS Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./lib/index.d.ts",
|
|
15
15
|
"import": "./lib/index.js",
|
|
16
|
-
"require": "./cjs/index.
|
|
17
|
-
"default": "./cjs/index.
|
|
16
|
+
"require": "./cjs/index.cjs",
|
|
17
|
+
"default": "./cjs/index.cjs"
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
@@ -27,30 +27,28 @@
|
|
|
27
27
|
"bugs": "https://github.com/godaddy/gasket/issues",
|
|
28
28
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-preset-nextjs",
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@gasket/plugin-command": "^7.5.0",
|
|
30
31
|
"@gasket/plugin-cypress": "^7.5.1",
|
|
31
|
-
"@gasket/plugin-
|
|
32
|
-
"@gasket/plugin-
|
|
33
|
-
"@gasket/plugin-dynamic-plugins": "^7.
|
|
34
|
-
"@gasket/plugin-command": "^7.4.3",
|
|
32
|
+
"@gasket/plugin-docusaurus": "^7.4.4",
|
|
33
|
+
"@gasket/plugin-docs": "^7.4.5",
|
|
34
|
+
"@gasket/plugin-dynamic-plugins": "^7.4.0",
|
|
35
35
|
"@gasket/plugin-express": "^7.4.1",
|
|
36
|
-
"@gasket/plugin-https": "^7.3.
|
|
37
|
-
"@gasket/plugin-
|
|
38
|
-
"@gasket/plugin-intl": "^7.5.
|
|
39
|
-
"@gasket/plugin-
|
|
40
|
-
"@gasket/plugin-jest": "^7.5.3",
|
|
41
|
-
"@gasket/plugin-lint": "^7.4.1",
|
|
36
|
+
"@gasket/plugin-https": "^7.3.9",
|
|
37
|
+
"@gasket/plugin-git": "^7.4.4",
|
|
38
|
+
"@gasket/plugin-intl": "^7.5.6",
|
|
39
|
+
"@gasket/plugin-https-proxy": "^7.4.0",
|
|
42
40
|
"@gasket/plugin-logger": "^7.3.5",
|
|
41
|
+
"@gasket/plugin-jest": "^7.5.3",
|
|
43
42
|
"@gasket/plugin-mocha": "^7.5.3",
|
|
44
|
-
"@gasket/plugin-nextjs": "^7.5.6",
|
|
45
43
|
"@gasket/plugin-typescript": "^7.4.4",
|
|
44
|
+
"@gasket/plugin-vitest": "^7.1.0",
|
|
45
|
+
"@gasket/plugin-webpack": "^7.3.6",
|
|
46
46
|
"@gasket/plugin-winston": "^7.3.5",
|
|
47
|
-
"@gasket/utils": "^7.
|
|
48
|
-
"@gasket/plugin-
|
|
49
|
-
"@gasket/plugin-
|
|
47
|
+
"@gasket/utils": "^7.6.0",
|
|
48
|
+
"@gasket/plugin-nextjs": "^7.6.1",
|
|
49
|
+
"@gasket/plugin-lint": "^7.4.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@swc/cli": "^0.6.0",
|
|
53
|
-
"@swc/core": "^1.10.18",
|
|
54
52
|
"@types/jest": "^29.5.14",
|
|
55
53
|
"@types/node": "^20.17.19",
|
|
56
54
|
"cross-env": "^7.0.3",
|
|
@@ -60,7 +58,8 @@
|
|
|
60
58
|
"eslint-plugin-jest": "^27.9.0",
|
|
61
59
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
62
60
|
"jest": "^29.7.0",
|
|
63
|
-
"typescript": "^5.8.2"
|
|
61
|
+
"typescript": "^5.8.2",
|
|
62
|
+
"@gasket/cjs": "^7.0.0"
|
|
64
63
|
},
|
|
65
64
|
"eslintConfig": {
|
|
66
65
|
"extends": [
|
|
@@ -82,11 +81,10 @@
|
|
|
82
81
|
"transform": {}
|
|
83
82
|
},
|
|
84
83
|
"scripts": {
|
|
85
|
-
"build": "
|
|
84
|
+
"build": "gasket-cjs ./lib",
|
|
86
85
|
"build:watch": "pnpm run build --watch",
|
|
87
86
|
"lint": "eslint .",
|
|
88
87
|
"lint:fix": "pnpm run lint --fix",
|
|
89
|
-
"postbuild": "node -e \"require('fs').writeFileSync('cjs/package.json', '{}')\"",
|
|
90
88
|
"posttest": "pnpm run lint",
|
|
91
89
|
"test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict --experimental-vm-modules' jest",
|
|
92
90
|
"test:coverage": "pnpm run test --coverage",
|
package/cjs/index.d.ts
DELETED
package/cjs/preset-prompt.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, /**
|
|
6
|
-
* presetPrompt hook
|
|
7
|
-
* @param {Gasket} gasket - Gasket API
|
|
8
|
-
* @param {Create} context - Create context
|
|
9
|
-
* @param {Object} utils - Prompt utils
|
|
10
|
-
* @param {Function} utils.prompt - Inquirer prompt
|
|
11
|
-
*/ "default", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function() {
|
|
14
|
-
return presetPrompt;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
const _prompts = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-nextjs/prompts"));
|
|
18
|
-
const _prompts1 = /*#__PURE__*/ _interop_require_default(require("@gasket/plugin-typescript/prompts"));
|
|
19
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
20
|
-
try {
|
|
21
|
-
var info = gen[key](arg);
|
|
22
|
-
var value = info.value;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
reject(error);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (info.done) {
|
|
28
|
-
resolve(value);
|
|
29
|
-
} else {
|
|
30
|
-
Promise.resolve(value).then(_next, _throw);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function _async_to_generator(fn) {
|
|
34
|
-
return function() {
|
|
35
|
-
var self = this, args = arguments;
|
|
36
|
-
return new Promise(function(resolve, reject) {
|
|
37
|
-
var gen = fn.apply(self, args);
|
|
38
|
-
function _next(value) {
|
|
39
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
40
|
-
}
|
|
41
|
-
function _throw(err) {
|
|
42
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
43
|
-
}
|
|
44
|
-
_next(undefined);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function _interop_require_default(obj) {
|
|
49
|
-
return obj && obj.__esModule ? obj : {
|
|
50
|
-
default: obj
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function presetPrompt(gasket, context, _) {
|
|
54
|
-
return _presetPrompt.apply(this, arguments);
|
|
55
|
-
}
|
|
56
|
-
function _presetPrompt() {
|
|
57
|
-
_presetPrompt = _async_to_generator(function*(gasket, context, { prompt }) {
|
|
58
|
-
yield _prompts1.default.promptTypescript(context, prompt);
|
|
59
|
-
yield _prompts.default.promptNextServerType(context, prompt);
|
|
60
|
-
yield _prompts.default.promptNextDevProxy(context, prompt);
|
|
61
|
-
return context;
|
|
62
|
-
});
|
|
63
|
-
return _presetPrompt.apply(this, arguments);
|
|
64
|
-
}
|