@ms-cloudpack/cli 0.23.14 → 0.24.0
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/commands/start/appServer/createRoutes.d.ts +15 -0
- package/lib/commands/start/appServer/createRoutes.js +70 -0
- package/lib/commands/start/appServer/createRoutes.js.map +1 -0
- package/lib/commands/start/appServer/error.d.ts +1 -0
- package/lib/commands/start/appServer/error.js +4 -0
- package/lib/commands/start/appServer/error.js.map +1 -0
- package/lib/commands/start/appServer/exitIfPortUnavailable.d.ts +4 -0
- package/lib/commands/start/appServer/exitIfPortUnavailable.js +15 -0
- package/lib/commands/start/appServer/exitIfPortUnavailable.js.map +1 -0
- package/lib/commands/start/appServer/getDefaultHtmlResponse.d.ts +5 -0
- package/lib/commands/start/appServer/getDefaultHtmlResponse.js +18 -0
- package/lib/commands/start/appServer/getDefaultHtmlResponse.js.map +1 -0
- package/lib/commands/start/appServer/getHtmlResponse.d.ts +5 -0
- package/lib/commands/start/appServer/getHtmlResponse.js +108 -0
- package/lib/commands/start/appServer/getHtmlResponse.js.map +1 -0
- package/lib/commands/start/appServer/handleSessionVersion.d.ts +7 -0
- package/lib/commands/start/appServer/handleSessionVersion.js +12 -0
- package/lib/commands/start/appServer/handleSessionVersion.js.map +1 -0
- package/lib/commands/start/{inlineScripts.d.ts → appServer/inlineScripts.d.ts} +0 -0
- package/lib/commands/start/{inlineScripts.js → appServer/inlineScripts.js} +0 -0
- package/lib/commands/start/appServer/inlineScripts.js.map +1 -0
- package/lib/commands/start/appServer/log.d.ts +1 -0
- package/lib/commands/start/appServer/log.js +5 -0
- package/lib/commands/start/appServer/log.js.map +1 -0
- package/lib/commands/start/appServer/setHeaders.d.ts +10 -0
- package/lib/commands/start/appServer/setHeaders.js +13 -0
- package/lib/commands/start/appServer/setHeaders.js.map +1 -0
- package/lib/commands/start/{startAppServer.d.ts → appServer/startAppServer.d.ts} +5 -5
- package/lib/commands/start/appServer/startAppServer.js +49 -0
- package/lib/commands/start/appServer/startAppServer.js.map +1 -0
- package/lib/commands/start/createBundleTask.js +0 -1
- package/lib/commands/start/createBundleTask.js.map +1 -1
- package/lib/commands/start/start.js +12 -3
- package/lib/commands/start/start.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +66 -2
- package/package.json +5 -3
- package/CHANGELOG.json +0 -2199
- package/CHANGELOG.md +0 -819
- package/lib/commands/start/inlineScripts.js.map +0 -1
- package/lib/commands/start/startAppServer.js +0 -155
- package/lib/commands/start/startAppServer.js.map +0 -1
package/lib/types.d.ts
CHANGED
|
@@ -150,6 +150,28 @@ export interface PackageOverride {
|
|
|
150
150
|
isInternal?: boolean;
|
|
151
151
|
overrides: PackageJson;
|
|
152
152
|
}
|
|
153
|
+
export interface Route {
|
|
154
|
+
/**
|
|
155
|
+
* The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also
|
|
156
|
+
* use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.
|
|
157
|
+
*/
|
|
158
|
+
match: string;
|
|
159
|
+
/**
|
|
160
|
+
* The path relative to the app root to static assets. If this is provided, renderScript/exportEntry
|
|
161
|
+
* will be ignored.
|
|
162
|
+
*/
|
|
163
|
+
staticPath?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Path to a .js or .html file used for rendering the route. If a script is provided, it must
|
|
166
|
+
* export a default function implementing `CreateHtmlFunction` defined in `@ms-cloudpack/cli`.
|
|
167
|
+
*/
|
|
168
|
+
renderScript?: string;
|
|
169
|
+
/**
|
|
170
|
+
* The key in the exports map which represents the entry point app script for this route.
|
|
171
|
+
* Default is '.', meaning the main package export key.
|
|
172
|
+
*/
|
|
173
|
+
exportEntry?: string;
|
|
174
|
+
}
|
|
153
175
|
export interface DevServer {
|
|
154
176
|
/**
|
|
155
177
|
* The domain name of the server.
|
|
@@ -171,14 +193,56 @@ export interface DevServer {
|
|
|
171
193
|
https?: HttpsConfig;
|
|
172
194
|
/**
|
|
173
195
|
* If provided, will override where the publicDir is located, relative to the app package folder.
|
|
174
|
-
* Defaults to `./public`.
|
|
196
|
+
* Defaults to `./public`. The same thing can be achieved with `routes`, using route: '*' and
|
|
197
|
+
* staticPath: './public', so the `publicPath` setting may be removed in the future.
|
|
175
198
|
*/
|
|
176
|
-
|
|
199
|
+
publicPath?: string;
|
|
200
|
+
/**
|
|
201
|
+
* If provided, will register routes with the dev server to host various pages.
|
|
202
|
+
*/
|
|
203
|
+
routes?: Route[];
|
|
177
204
|
}
|
|
178
205
|
/**
|
|
179
206
|
* Per-application configuration for Cloudpack.
|
|
180
207
|
*/
|
|
181
208
|
export interface CloudpackConfig {
|
|
209
|
+
/**
|
|
210
|
+
* An array of PackageOverride objects, used to provide overrides for packages without modifying their
|
|
211
|
+
* definitions directly. This is primarily used for providing exports maps for packages that don't have them.
|
|
212
|
+
*/
|
|
182
213
|
packageOverrides?: PackageOverride[];
|
|
214
|
+
/**
|
|
215
|
+
* A set of options for configuring how the dev server works.
|
|
216
|
+
*/
|
|
183
217
|
devServer?: DevServer;
|
|
184
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* The input options for a createHtml custom server render function.
|
|
221
|
+
*/
|
|
222
|
+
export type CreateHtmlOptions = {
|
|
223
|
+
session: Session;
|
|
224
|
+
route: Route;
|
|
225
|
+
baseUrl: string;
|
|
226
|
+
definition: PackageJson;
|
|
227
|
+
importMap: ImportMap;
|
|
228
|
+
overlayScript: string | undefined;
|
|
229
|
+
entryScript: string | undefined;
|
|
230
|
+
inlineScripts: string[];
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* The expected result of the createHtml custom server render function.
|
|
234
|
+
*/
|
|
235
|
+
export type CreateHtmlResult = string | {
|
|
236
|
+
html: string;
|
|
237
|
+
statusCode: number;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* A custom server render function that can be used to override the default HTML response.
|
|
241
|
+
*/
|
|
242
|
+
export type CreateHtmlFunction = (options: CreateHtmlOptions) => Promise<CreateHtmlResult> | CreateHtmlResult;
|
|
243
|
+
/**
|
|
244
|
+
* The expected shape of the createHtml custom server render function script.
|
|
245
|
+
*/
|
|
246
|
+
export type CreateHtmlScript = {
|
|
247
|
+
default: CreateHtmlFunction;
|
|
248
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"cloudpack": "./bin/cloudpack.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ms-cloudpack/bundler": "^0.9.
|
|
20
|
-
"@ms-cloudpack/create-express-app": "^1.
|
|
19
|
+
"@ms-cloudpack/bundler": "^0.9.5",
|
|
20
|
+
"@ms-cloudpack/create-express-app": "^1.2.0",
|
|
21
21
|
"@ms-cloudpack/data-bus": "^0.1.1",
|
|
22
22
|
"@ms-cloudpack/json-utilities": "^0.0.4",
|
|
23
23
|
"@ms-cloudpack/overlay": "^0.11.3",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"filenamify": "^5.1.0",
|
|
31
31
|
"fs-extra": "^10.1.0",
|
|
32
32
|
"glob": "^8.0.0",
|
|
33
|
+
"jsdom": "^21.1.0",
|
|
33
34
|
"object-hash": "^3.0.0",
|
|
34
35
|
"open": "^8.4.0",
|
|
35
36
|
"p-queue": "^7.3.0",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"@ms-cloudpack/scripts": "*",
|
|
44
45
|
"@types/chokidar": "2.1.3",
|
|
45
46
|
"@types/glob": "8.0.1",
|
|
47
|
+
"@types/jsdom": "20.0.1",
|
|
46
48
|
"@types/object-hash": "3.0.2",
|
|
47
49
|
"@types/uuid": "9.0.0",
|
|
48
50
|
"@types/ws": "8.5.4"
|