mushroom-cli 1.2.0-alpha.10 → 1.2.0-alpha.12

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.
Files changed (43) hide show
  1. package/README.md +233 -211
  2. package/dist/check-update.js +5 -0
  3. package/dist/common.js +260 -0
  4. package/dist/config.js +394 -0
  5. package/{docs → dist/docs}/doc-mt.js +471 -523
  6. package/dist/docs/docs.v2.js +1758 -0
  7. package/{docs → dist/docs}/mt-dom-1.0.js +1025 -1268
  8. package/{docs → dist/docs}/mt.extension.js +142 -174
  9. package/dist/gen/gen-api-docs-v1.js +106 -0
  10. package/dist/gen/gen-api-docs.js +292 -0
  11. package/{gen → dist/gen}/gen-csharp.js +1265 -1399
  12. package/{gen → dist/gen}/gen-db-docs.js +204 -222
  13. package/{gen → dist/gen}/gen-js-driver-tarball.js +81 -101
  14. package/{gen → dist/gen}/gen-js-driver.js +116 -133
  15. package/{gen → dist/gen}/gen-ts-driver.js +427 -471
  16. package/{gen.js → dist/gen.js} +109 -124
  17. package/{help.js → dist/help.js} +53 -55
  18. package/dist/init/init-json.js +91 -0
  19. package/dist/init/init-netcore.js +30 -0
  20. package/dist/init.js +23 -0
  21. package/dist/master-file/master-file.js +185 -0
  22. package/dist/merge.js +70 -0
  23. package/dist/mr.js +75 -0
  24. package/dist/types.js +1 -0
  25. package/dist/update/tsCode.js +82 -0
  26. package/dist/update.js +20 -0
  27. package/package.json +54 -29
  28. package/check-update.js +0 -9
  29. package/common.js +0 -273
  30. package/config.js +0 -445
  31. package/docs/docs.html +0 -5190
  32. package/docs/docs.v2.html +0 -5066
  33. package/docs/docs.v2.js +0 -1563
  34. package/gen/gen-api-docs-v1.js +0 -125
  35. package/gen/gen-api-docs.js +0 -298
  36. package/init/init-json.js +0 -106
  37. package/init/init-netcore.js +0 -32
  38. package/init.js +0 -28
  39. package/master-file/master-file.js +0 -234
  40. package/merge.js +0 -84
  41. package/mr.js +0 -82
  42. package/update/tsCode.js +0 -20
  43. package/update.js +0 -24
package/README.md CHANGED
@@ -1,211 +1,233 @@
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
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.12
136
+
137
+ New:
138
+
139
+ - init netcore:
140
+ - Support new set-functions: `New-RandomNumber`, `New-RandomString`
141
+
142
+ ### 1.2.0-alpha.11
143
+
144
+ New:
145
+
146
+ - gen-ts:
147
+ - export type for object fields
148
+
149
+ Improvement:
150
+
151
+ - gen-docs:
152
+ - allow user add and change API root url
153
+ - filter role list
154
+ - format cURL to easy to copy and paste to Postman
155
+ - lighten font on MacOS
156
+
157
+ ### 1.2.0-alpha.10
158
+
159
+ Improvement:
160
+
161
+ - gen-docs: add default-value information of fields
162
+
163
+ ### 1.2.0-alpha.9
164
+
165
+ Improvement:
166
+
167
+ - gen-docs
168
+ - v1.2: minify, fix bug (some fields are not excluded)
169
+
170
+ ### 1.2.0-alpha.8
171
+
172
+ Improvement:
173
+
174
+ - gen-docs
175
+ - v1.2: deal with very big api docs
176
+ - v1: prerender all docs html (need more RAM, less performance)
177
+
178
+ ### 1.2.0-alpha.7
179
+
180
+ New features:
181
+
182
+ - init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`, `Replace`
183
+
184
+ Changes:
185
+
186
+ - init netcore: Operating fail if unknown command or set-function found
187
+
188
+ ### 1.2.0-alpha.6
189
+
190
+ New features:
191
+
192
+ - gen-ts-driver: Support offline mode
193
+
194
+ Changes:
195
+
196
+ - gen-api-docs: Improve generating api-docs
197
+ - gen-csharp: Generate resource classes with `partial`
198
+
199
+ ### 1.2.0-alpha.5
200
+
201
+ New features:
202
+
203
+ - Improve documentation generation: view, custom action.
204
+
205
+ ### 1.2.0-alpha.4
206
+
207
+ Fixed bugs:
208
+
209
+ - Generate api docs: doesn't exclude fields of object in an array
210
+
211
+ ### 1.2.0-alpha.3
212
+
213
+ Fixed bugs:
214
+
215
+ - Generate wrong required field for view parameter
216
+
217
+ ### 1.2.0-alpha.2
218
+
219
+ New features:
220
+
221
+ - Support merge command
222
+
223
+ ### 1.2.0-alpha.1
224
+
225
+ New features:
226
+
227
+ - Support type for View result
228
+
229
+ ### 1.1.0
230
+
231
+ Support MushroomServer 0.2.25.4 or later
232
+
233
+ Support mushroomjs 1.1.0 or later
@@ -0,0 +1,5 @@
1
+ import fetch from 'node-fetch';
2
+ export default async function checkUpdate() {
3
+ const res = await fetch('https://registry.npmjs.org/mushroom-cli/');
4
+ return await res.json();
5
+ }