@ms-cloudpack/bundle-server 0.5.18 → 0.6.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/startBundleServer.js
CHANGED
|
@@ -6,12 +6,12 @@ import { handleBundleRequest } from './handleBundleRequest.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export async function startBundleServer(options, context) {
|
|
8
8
|
const { config } = context.session;
|
|
9
|
-
const domain = getDomain(config.
|
|
9
|
+
const domain = getDomain(config.server?.domain);
|
|
10
10
|
const { app, port, close, url } = await createExpressApp({
|
|
11
11
|
portRange: options.port ?? [5500, 5501, 5502, 5503],
|
|
12
12
|
requireSpecifiedPort: !!options.port,
|
|
13
13
|
hostname: domain,
|
|
14
|
-
sslOptions: config.
|
|
14
|
+
sslOptions: config.server?.https,
|
|
15
15
|
cwd: config.appPath,
|
|
16
16
|
});
|
|
17
17
|
// Set up the express app routes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startBundleServer.js","sourceRoot":"","sources":["../src/startBundleServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAA4B,EAC5B,OAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IACnC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"startBundleServer.js","sourceRoot":"","sources":["../src/startBundleServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAA4B,EAC5B,OAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IACnC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,gBAAgB,CAAC;QACvD,SAAS,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACnD,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI;QACpC,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK;QAChC,GAAG,EAAE,MAAM,CAAC,OAAO;KACpB,CAAC,CAAC;IAEH,iCAAiC;IACjC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxB,mBAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACnE,OAAO,CAAC,KAAK,CAAE,GAAa,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC;YAC5C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,gBAAgB;IAChB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;IAExC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { createExpressApp, getDomain } from '@ms-cloudpack/create-express-app';\nimport { handleBundleRequest } from './handleBundleRequest.js';\nimport type { BundleServer } from './types/BundleServer.js';\nimport type { BundleServerContext } from './types/BundleServerContext.js';\nimport type { BundleServerOptions } from './types/BundleServerOptions.js';\n\n/**\n * The bundle server handles package requests and returns bundled resources.\n * Resources are bundled on demand and cached locally to avoid re-bundling on each request.\n */\nexport async function startBundleServer(\n options: BundleServerOptions,\n context: BundleServerContext,\n): Promise<BundleServer> {\n const { config } = context.session;\n const domain = getDomain(config.server?.domain);\n const { app, port, close, url } = await createExpressApp({\n portRange: options.port ?? [5500, 5501, 5502, 5503],\n requireSpecifiedPort: !!options.port,\n hostname: domain,\n sslOptions: config.server?.https,\n cwd: config.appPath,\n });\n\n // Set up the express app routes.\n app.get('*', (req, res) => {\n handleBundleRequest({ req, res, ...options }, context).catch((err) => {\n console.error((err as Error)?.stack || err);\n res.status(500).send(`Error bundling: ${err}`);\n });\n });\n\n // Save the URL.\n context.session.urls.bundleServer = url;\n\n return { close, port, url };\n}\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/bundle-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An implementation of the Bundle server for Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ms-cloudpack/api-server": "^0.
|
|
18
|
-
"@ms-cloudpack/create-express-app": "^1.9.
|
|
19
|
-
"@ms-cloudpack/import-map": "^0.8.
|
|
20
|
-
"@ms-cloudpack/package-utilities": "^10.1.
|
|
17
|
+
"@ms-cloudpack/api-server": "^0.53.0",
|
|
18
|
+
"@ms-cloudpack/create-express-app": "^1.9.2",
|
|
19
|
+
"@ms-cloudpack/import-map": "^0.8.1",
|
|
20
|
+
"@ms-cloudpack/package-utilities": "^10.1.3",
|
|
21
21
|
"@ms-cloudpack/path-string-parsing": "^1.2.4",
|
|
22
22
|
"es-module-shims": "^1.10.0",
|
|
23
23
|
"ts-dedent": "^2.2.0"
|