@gasket/preset-api 7.4.1 → 7.4.3
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/cjs/create.js +10 -2
- package/lib/create.js +12 -2
- package/package.json +15 -15
package/cjs/create.js
CHANGED
|
@@ -19,7 +19,15 @@ function _interop_require_default(obj) {
|
|
|
19
19
|
const require1 = (0, _module.createRequire)(require("url").pathToFileURL(__filename).toString());
|
|
20
20
|
const { devDependencies } = require1('../package.json');
|
|
21
21
|
function create(gasket, context) {
|
|
22
|
-
const { pkg, files } = context;
|
|
22
|
+
const { pkg, files, packageManager } = context;
|
|
23
|
+
let runCmd;
|
|
24
|
+
if (packageManager === 'yarn') {
|
|
25
|
+
runCmd = 'yarn';
|
|
26
|
+
} else if (packageManager === 'pnpm') {
|
|
27
|
+
runCmd = 'pnpm';
|
|
28
|
+
} else {
|
|
29
|
+
runCmd = 'npm run';
|
|
30
|
+
}
|
|
23
31
|
const __dirname = (0, _url.fileURLToPath)(require("url").pathToFileURL(__filename).toString());
|
|
24
32
|
const generatorDir = _path.default.join(__dirname, '..', '..', 'generator');
|
|
25
33
|
files.add(`${generatorDir}/*.md`);
|
|
@@ -31,7 +39,7 @@ function create(gasket, context) {
|
|
|
31
39
|
pkg.add('scripts', {
|
|
32
40
|
start: 'node server.js',
|
|
33
41
|
local: 'nodemon server.js',
|
|
34
|
-
preview:
|
|
42
|
+
preview: `${runCmd} start`
|
|
35
43
|
});
|
|
36
44
|
}
|
|
37
45
|
}
|
package/lib/create.js
CHANGED
|
@@ -6,7 +6,17 @@ const { devDependencies } = require('../package.json');
|
|
|
6
6
|
|
|
7
7
|
/** @type {import('@gasket/core').HookHandler<'create'>} */
|
|
8
8
|
export default function create(gasket, context) {
|
|
9
|
-
const { pkg, files } = context;
|
|
9
|
+
const { pkg, files, packageManager } = context;
|
|
10
|
+
|
|
11
|
+
let runCmd;
|
|
12
|
+
if (packageManager === 'yarn') {
|
|
13
|
+
runCmd = 'yarn';
|
|
14
|
+
} else if (packageManager === 'pnpm') {
|
|
15
|
+
runCmd = 'pnpm';
|
|
16
|
+
} else {
|
|
17
|
+
runCmd = 'npm run';
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
const __dirname = fileURLToPath(import.meta.url);
|
|
11
21
|
const generatorDir = path.join(__dirname, '..', '..', 'generator');
|
|
12
22
|
files.add(`${generatorDir}/*.md`);
|
|
@@ -21,7 +31,7 @@ export default function create(gasket, context) {
|
|
|
21
31
|
pkg.add('scripts', {
|
|
22
32
|
start: 'node server.js',
|
|
23
33
|
local: 'nodemon server.js',
|
|
24
|
-
preview:
|
|
34
|
+
preview: `${runCmd} start`
|
|
25
35
|
});
|
|
26
36
|
}
|
|
27
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-api",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.3",
|
|
4
4
|
"description": "Create Express-based API with Gasket",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"bugs": "https://github.com/godaddy/gasket/issues",
|
|
28
28
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-preset-api",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gasket/plugin-cypress": "7.5.0",
|
|
31
30
|
"@gasket/plugin-command": "7.4.0",
|
|
32
|
-
"@gasket/plugin-
|
|
31
|
+
"@gasket/plugin-cypress": "7.5.0",
|
|
32
|
+
"@gasket/plugin-docs": "7.4.1",
|
|
33
33
|
"@gasket/plugin-docusaurus": "7.4.2",
|
|
34
34
|
"@gasket/plugin-dynamic-plugins": "7.3.7",
|
|
35
35
|
"@gasket/plugin-express": "7.4.0",
|
|
36
|
-
"@gasket/plugin-
|
|
37
|
-
"@gasket/plugin-
|
|
38
|
-
"@gasket/plugin-https": "7.3.5",
|
|
39
|
-
"@gasket/plugin-jest": "7.5.0",
|
|
40
|
-
"@gasket/plugin-logger": "7.3.4",
|
|
36
|
+
"@gasket/plugin-https": "7.3.6",
|
|
37
|
+
"@gasket/plugin-jest": "7.5.1",
|
|
41
38
|
"@gasket/plugin-lint": "7.4.0",
|
|
42
|
-
"@gasket/plugin-
|
|
43
|
-
"@gasket/plugin-
|
|
44
|
-
"@gasket/plugin-
|
|
45
|
-
"@gasket/plugin-typescript": "7.4.
|
|
46
|
-
"@gasket/plugin-winston": "7.3.4"
|
|
39
|
+
"@gasket/plugin-logger": "7.3.4",
|
|
40
|
+
"@gasket/plugin-mocha": "7.5.1",
|
|
41
|
+
"@gasket/plugin-swagger": "7.3.7",
|
|
42
|
+
"@gasket/plugin-typescript": "7.4.2",
|
|
43
|
+
"@gasket/plugin-winston": "7.3.4",
|
|
44
|
+
"@gasket/plugin-vitest": "7.0.2",
|
|
45
|
+
"@gasket/plugin-git": "7.4.0",
|
|
46
|
+
"@gasket/plugin-fastify": "7.4.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@swc/cli": "^0.6.0",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
60
|
"nodemon": "^3.1.9",
|
|
61
61
|
"typescript": "^5.8.2",
|
|
62
|
-
"@gasket/plugin-metadata": "7.4.
|
|
63
|
-
"create-gasket-app": "7.4.
|
|
62
|
+
"@gasket/plugin-metadata": "7.4.2",
|
|
63
|
+
"create-gasket-app": "7.4.4"
|
|
64
64
|
},
|
|
65
65
|
"eslintConfig": {
|
|
66
66
|
"extends": [
|