mushroom-cli 1.1.2 → 1.2.0-alpha.10
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/README.md +211 -91
- package/check-update.js +9 -9
- package/common.js +273 -237
- package/config.js +445 -475
- package/docs/doc-mt.js +523 -526
- package/docs/docs.html +5190 -5380
- package/docs/docs.v2.html +5066 -0
- package/docs/docs.v2.js +1563 -0
- package/docs/mt-dom-1.0.js +1268 -1398
- package/docs/mt.extension.js +174 -199
- package/gen/gen-api-docs-v1.js +125 -0
- package/gen/gen-api-docs.js +298 -157
- package/gen/gen-csharp.js +1399 -1687
- package/gen/gen-db-docs.js +222 -238
- package/gen/gen-js-driver-tarball.js +101 -119
- package/gen/gen-js-driver.js +133 -154
- package/gen/gen-ts-driver.js +471 -482
- package/gen.js +124 -146
- package/help.js +55 -51
- package/init/init-json.js +106 -110
- package/init/init-netcore.js +32 -37
- package/init.js +28 -27
- package/master-file/master-file.js +234 -254
- package/merge.js +84 -0
- package/mr.js +65 -63
- package/package.json +29 -27
- package/update/tsCode.js +20 -90
- package/update.js +24 -24
- package/.vscode/settings.json +0 -3
package/README.md
CHANGED
|
@@ -1,91 +1,211 @@
|
|
|
1
|
-
# Mushroom CLI
|
|
2
|
-
|
|
3
|
-
## Init
|
|
4
|
-
|
|
5
|
-
Init a mushroom json file
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Config gen
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Generate
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
# Mushroom CLI
|
|
2
|
+
|
|
3
|
+
## Init
|
|
4
|
+
|
|
5
|
+
Init a mushroom json file
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx mushroom-cli init json ./api/SampleProject.json [silent]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Init a DotNet Core project which pre-install Mushroom Server
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx mushroom-cli init netcore [projectName]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configure
|
|
18
|
+
|
|
19
|
+
Add the mushroom json file into mushroom-config.json
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx mushroom-cli config add ./api/yourProjectName.json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Config gen docs api
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx mushroom-cli config gen projectName docs ./wwwroot/docs.html [alias aliasName] [features file,auth,mail,driver] [roles Admin,User-Contributor]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Config gen database docs
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx mushroom-cli config gen projectName "db-docs" ./wwwroot/db-docs.html [alias aliasName] [features file,auth,mail]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Config gen javascript driver
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx mushroom-cli config gen projectName "js-driver" ./src/api/mushroom.api.js [alias aliasName] [roles Admin,User-Contributor] [tarball tarballName]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Config gen typescript driver
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx mushroom-cli config gen projectName "ts-driver" ./src/api/mushroom.api.ts [alias aliasName] [roles Admin,User-Contributor]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Config gen entities for Mushroom project in CSharp and using MongoDb
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx mushroom-cli config gen projectName "c#-mongo" ./API/Generated.cs [alias aliasName]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Config gen entities for CSharp project which calls Mushroom API
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx mushroom-cli config gen projectName "c#-driver" ./API/Generated.cs [roles Admin,User-Contributor] [alias aliasName] [access-modifier public] [features file,auth,mail]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Genarate
|
|
62
|
+
|
|
63
|
+
Generate docs api (html format)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx mushroom-cli gen projectName[@aliasName] docs [v1] [tmp]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Generate database docs (html format)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx mushroom-cli gen projectName[@aliasName] "db-docs" [tmp]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Generate npm package (tarball file)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx mushroom-cli gen projectName[@aliasName] "js-driver-tarball"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Generate javascript driver
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx mushroom-cli gen projectName[@aliasName] "js-driver"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Generate typescript driver
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx mushroom-cli gen projectName[@aliasName] "ts-driver"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Generate entities for Mushroom project in CSharp and using MongoDb
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx mushroom-cli gen projectName[@aliasName] "c#-mongo"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Generate entities for CSharp project which calls Mushroom API
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx mushroom-cli gen projectName[@aliasName] "c#-driver"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Merge
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx mushroom-cli merge output-path.json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Update
|
|
112
|
+
|
|
113
|
+
Update ts code (configuration was stored in mushroom-config.json file)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx mushroom-cli update "ts-code"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Update ts code (simple call)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx mushroom-cli update "ts-code" file-path.ts remote-ts-code-url
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Other
|
|
126
|
+
|
|
127
|
+
Disable checking for update:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx mushroom-cli parameters --no-check-update
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Version
|
|
134
|
+
|
|
135
|
+
### 1.2.0-alpha.10
|
|
136
|
+
|
|
137
|
+
Improvement:
|
|
138
|
+
|
|
139
|
+
* gen-docs: add default-value information of fields
|
|
140
|
+
|
|
141
|
+
### 1.2.0-alpha.9
|
|
142
|
+
|
|
143
|
+
Improvement:
|
|
144
|
+
|
|
145
|
+
* gen-docs
|
|
146
|
+
* v1.2: minify, fix bug (some fields are not excluded)
|
|
147
|
+
|
|
148
|
+
### 1.2.0-alpha.8
|
|
149
|
+
|
|
150
|
+
Improvement:
|
|
151
|
+
|
|
152
|
+
* gen-docs
|
|
153
|
+
* v1.2: deal with very big api docs
|
|
154
|
+
* v1: prerender all docs html (need more RAM, less performance)
|
|
155
|
+
|
|
156
|
+
### 1.2.0-alpha.7
|
|
157
|
+
|
|
158
|
+
New features:
|
|
159
|
+
|
|
160
|
+
* init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`, `Replace`
|
|
161
|
+
|
|
162
|
+
Changes:
|
|
163
|
+
|
|
164
|
+
* init netcore: Operating fail if unknown command or set-function found
|
|
165
|
+
|
|
166
|
+
### 1.2.0-alpha.6
|
|
167
|
+
|
|
168
|
+
New features:
|
|
169
|
+
|
|
170
|
+
* gen-ts-driver: Support offline mode
|
|
171
|
+
|
|
172
|
+
Changes:
|
|
173
|
+
|
|
174
|
+
* gen-api-docs: Improve generating api-docs
|
|
175
|
+
* gen-csharp: Generate resource classes with `partial`
|
|
176
|
+
|
|
177
|
+
### 1.2.0-alpha.5
|
|
178
|
+
|
|
179
|
+
New features:
|
|
180
|
+
|
|
181
|
+
* Improve documentation generation: view, custom action.
|
|
182
|
+
|
|
183
|
+
### 1.2.0-alpha.4
|
|
184
|
+
|
|
185
|
+
Fixed bugs:
|
|
186
|
+
|
|
187
|
+
* Generate api docs: doesn't exclude fields of object in an array
|
|
188
|
+
|
|
189
|
+
### 1.2.0-alpha.3
|
|
190
|
+
|
|
191
|
+
Fixed bugs:
|
|
192
|
+
|
|
193
|
+
* Generate wrong required field for view parameter
|
|
194
|
+
|
|
195
|
+
### 1.2.0-alpha.2
|
|
196
|
+
|
|
197
|
+
New features:
|
|
198
|
+
|
|
199
|
+
* Support merge command
|
|
200
|
+
|
|
201
|
+
### 1.2.0-alpha.1
|
|
202
|
+
|
|
203
|
+
New features:
|
|
204
|
+
|
|
205
|
+
* Support type for View result
|
|
206
|
+
|
|
207
|
+
### 1.1.0
|
|
208
|
+
|
|
209
|
+
Support MushroomServer 0.2.25.4 or later
|
|
210
|
+
|
|
211
|
+
Support mushroomjs 1.1.0 or later
|
package/check-update.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const fetch = require(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
module.exports = checkUpdate;
|
|
1
|
+
const fetch = require('node-fetch');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function checkUpdate() {
|
|
5
|
+
return fetch('https://registry.npmjs.org/mushroom-cli/')
|
|
6
|
+
.then(res => res.json());
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
module.exports = checkUpdate;
|