@gasket/preset-api 7.0.0-next.4 → 7.0.0-next.5
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 +11 -13
- package/package.json +13 -14
package/lib/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import pluginExpress from '@gasket/plugin-express';
|
|
2
|
-
import pluginTypescript from '@gasket/plugin-typescript';
|
|
3
2
|
import pluginHttps from '@gasket/plugin-https';
|
|
4
3
|
import pluginDocs from '@gasket/plugin-docs';
|
|
5
4
|
import pluginDocusaurus from '@gasket/plugin-docusaurus';
|
|
6
5
|
import pluginResponseData from '@gasket/plugin-response-data';
|
|
7
6
|
import pluginWinston from '@gasket/plugin-winston';
|
|
8
7
|
import pluginSwagger from '@gasket/plugin-swagger';
|
|
9
|
-
|
|
8
|
+
import pluginLint from '@gasket/plugin-lint';
|
|
10
9
|
import { createRequire } from 'module';
|
|
11
10
|
import { fileURLToPath } from 'url';
|
|
12
11
|
const require = createRequire(import.meta.url);
|
|
@@ -17,6 +16,7 @@ export default {
|
|
|
17
16
|
hooks: {
|
|
18
17
|
async presetPrompt(gasket, context, { prompt }) {
|
|
19
18
|
context.apiApp = true;
|
|
19
|
+
// TODOfollowup - TS prompt could possibly be global
|
|
20
20
|
if (!('typescript' in context)) {
|
|
21
21
|
const { typescript } = await prompt([
|
|
22
22
|
{
|
|
@@ -31,11 +31,15 @@ export default {
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
async presetConfig(gasket, context) {
|
|
34
|
-
let testPlugin;
|
|
34
|
+
let testPlugin, typescriptPlugin;
|
|
35
35
|
if ('testPlugin' in context) {
|
|
36
36
|
testPlugin = await import(context.testPlugin);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
if (context.typescript) {
|
|
40
|
+
typescriptPlugin = await import('@gasket/plugin-typescript');
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
return {
|
|
40
44
|
plugins: [
|
|
41
45
|
pluginExpress,
|
|
@@ -45,8 +49,8 @@ export default {
|
|
|
45
49
|
pluginResponseData,
|
|
46
50
|
pluginWinston,
|
|
47
51
|
pluginSwagger,
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
pluginLint,
|
|
53
|
+
typescriptPlugin ? typescriptPlugin.default || typescriptPlugin : null,
|
|
50
54
|
testPlugin ? testPlugin.default || testPlugin : null
|
|
51
55
|
].filter(Boolean)
|
|
52
56
|
}
|
|
@@ -56,18 +60,12 @@ export default {
|
|
|
56
60
|
const __dirname = fileURLToPath(import.meta.url);
|
|
57
61
|
const generatorDir = `${__dirname}/../../generator`;
|
|
58
62
|
|
|
59
|
-
pkg.add('dependencies',
|
|
60
|
-
'@gasket/engine': dependencies['@gasket/engine'],
|
|
61
|
-
'@gasket/core': dependencies['@gasket/core'],
|
|
62
|
-
'@gasket/utils': dependencies['@gasket/utils']
|
|
63
|
-
});
|
|
63
|
+
pkg.add('dependencies', dependencies);
|
|
64
64
|
|
|
65
65
|
if (!context.typescript) {
|
|
66
66
|
files.add(`${generatorDir}/*`);
|
|
67
67
|
|
|
68
|
-
pkg.add('devDependencies',
|
|
69
|
-
nodemon: devDependencies.nodemon
|
|
70
|
-
});
|
|
68
|
+
pkg.add('devDependencies', devDependencies);
|
|
71
69
|
|
|
72
70
|
pkg.add('scripts', {
|
|
73
71
|
start: 'node server.js',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/preset-api",
|
|
3
|
-
"version": "7.0.0-next.
|
|
3
|
+
"version": "7.0.0-next.5",
|
|
4
4
|
"description": "Create Express-based API with Gasket",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -21,21 +21,20 @@
|
|
|
21
21
|
"url": "https://github.com/godaddy/gasket/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@gasket/core": "^7.0.0-next.
|
|
25
|
-
"@gasket/engine": "^7.0.0-next.
|
|
26
|
-
"@gasket/plugin-docs": "^7.0.0-next.
|
|
27
|
-
"@gasket/plugin-docusaurus": "^7.0.0-next.
|
|
28
|
-
"@gasket/plugin-express": "^7.0.0-next.
|
|
29
|
-
"@gasket/plugin-https": "^7.0.0-next.
|
|
30
|
-
"@gasket/plugin-lint": "^7.0.0-next.
|
|
31
|
-
"@gasket/plugin-response-data": "^7.0.0-next.
|
|
32
|
-
"@gasket/plugin-swagger": "^7.0.0-next.
|
|
33
|
-
"@gasket/plugin-winston": "^7.0.0-next.
|
|
34
|
-
"@gasket/utils": "^7.0.0-next.
|
|
24
|
+
"@gasket/core": "^7.0.0-next.5",
|
|
25
|
+
"@gasket/engine": "^7.0.0-next.5",
|
|
26
|
+
"@gasket/plugin-docs": "^7.0.0-next.5",
|
|
27
|
+
"@gasket/plugin-docusaurus": "^7.0.0-next.5",
|
|
28
|
+
"@gasket/plugin-express": "^7.0.0-next.5",
|
|
29
|
+
"@gasket/plugin-https": "^7.0.0-next.5",
|
|
30
|
+
"@gasket/plugin-lint": "^7.0.0-next.5",
|
|
31
|
+
"@gasket/plugin-response-data": "^7.0.0-next.5",
|
|
32
|
+
"@gasket/plugin-swagger": "^7.0.0-next.5",
|
|
33
|
+
"@gasket/plugin-winston": "^7.0.0-next.5",
|
|
34
|
+
"@gasket/utils": "^7.0.0-next.5"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@gasket/plugin-start": "^7.0.0-next.4",
|
|
38
37
|
"nodemon": "^3.1.0"
|
|
39
38
|
},
|
|
40
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "b3b132ef284ac43616794283b969c23c45c0a90e"
|
|
41
40
|
}
|