@trackunit/iris-app-build-utilities 0.0.67 → 0.0.70
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.70](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.69...iris-app-build-utilities/0.0.70) (2022-12-01)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
10
|
+
## [0.0.69](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.68...iris-app-build-utilities/0.0.69) (2022-11-24)
|
|
11
|
+
|
|
12
|
+
## [0.0.68](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.67...iris-app-build-utilities/0.0.68) (2022-11-24)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `iris-app-api` updated to version `0.0.1`
|
|
5
17
|
### [0.0.67](https://github.com/Trackunit/manager/compare/iris-app-build-utilities/0.0.66...iris-app-build-utilities/0.0.67) (2022-11-21)
|
|
6
18
|
|
|
7
19
|
### Dependency Updates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-build-utilities",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tsconfig-paths": "^3.14.1",
|
|
10
10
|
"typescript": "4.7.3",
|
|
11
|
-
"@trackunit/iris-app-api": "0.0.
|
|
11
|
+
"@trackunit/iris-app-api": "0.0.64",
|
|
12
|
+
"node-fetch": "^2.6.7",
|
|
12
13
|
"tslib": "^2.4.0"
|
|
13
14
|
},
|
|
14
15
|
"peerDependencies": {}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTileWebpackDevServer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
5
6
|
/**
|
|
6
7
|
* Generates a dev server configuration for webpack configuration.
|
|
7
8
|
* @param webpackDevServerConfiguration The configuration to extend.
|
|
@@ -16,7 +17,7 @@ const getTileWebpackDevServer = (webpackDevServerConfiguration = {}) => tslib_1.
|
|
|
16
17
|
}, open: {
|
|
17
18
|
target: ["https://dev.manager.trackunit.com/iris-sdk-portal/main#runLocal"],
|
|
18
19
|
}, onListening: (server) => { }, setupMiddlewares: (middlewares, devServer) => {
|
|
19
|
-
var _a;
|
|
20
|
+
var _a, _b;
|
|
20
21
|
middlewares.push({
|
|
21
22
|
name: "cors-preflight",
|
|
22
23
|
path: "/",
|
|
@@ -33,6 +34,20 @@ const getTileWebpackDevServer = (webpackDevServerConfiguration = {}) => tslib_1.
|
|
|
33
34
|
response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
|
|
34
35
|
next();
|
|
35
36
|
});
|
|
37
|
+
(_b = devServer.app) === null || _b === void 0 ? void 0 : _b.use("/manifestAndToken", (request, response, next) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
response.header("Access-Control-Allow-Origin", request.headers.origin || "https://dev.manager.trackunit.com");
|
|
39
|
+
response.header("Access-Control-Allow-Headers", "X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, x-trackunitappversion");
|
|
40
|
+
try {
|
|
41
|
+
const resp = yield (0, node_fetch_1.default)("http://localhost:22220/manifest.json");
|
|
42
|
+
const body = yield resp.json();
|
|
43
|
+
response.send({ manifest: body });
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error("ERROR: ", e);
|
|
47
|
+
response.status(500);
|
|
48
|
+
response.send(e);
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
36
51
|
return middlewares;
|
|
37
52
|
} }, webpackDevServerConfiguration);
|
|
38
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTileWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTileWebpackDevServer.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"getTileWebpackDevServer.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/getTileWebpackDevServer.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAG/B;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,CACrC,gCAA+C,EAAE,EACzB,EAAE;IAC1B,uBACE,IAAI,EAAE,KAAK,EACX,kBAAkB,EAAE,IAAI,EACxB,OAAO,EAAE;YACP,kCAAkC,EAAE,MAAM;YAC1C,wBAAwB,EAAE,MAAM;YAChC,8BAA8B,EAAE,iCAAiC;YACjE,8BAA8B,EAC5B,yGAAyG;SAC5G,EACD,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,iEAAiE,CAAC;SAC5E,EACD,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE,GAAE,CAAC,EACnC,gBAAgB,EAAE,CAAC,WAAyB,EAAE,SAAiB,EAAE,EAAE;;YACjE,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,GAAG;gBACT,UAAU,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,IAAgB,EAAE,EAAE;oBAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE;wBACxB,IAAI,EAAE,CAAC;qBACR;yBAAM;wBACL,GAAG,CAAC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"webpack-dev-server\";\n\n/**\n * Generates a dev server configuration for webpack configuration.\n * @param webpackDevServerConfiguration The configuration to extend.\n * @returns {Configuration} The dev server for tiles.\n */\nexport const getTileWebpackDevServer = async (\n webpackDevServerConfiguration: Configuration = {}\n): Promise<Configuration> => {\n return {\n port: 22220,\n historyApiFallback: true,\n headers: {\n \"Access-Control-Allow-Credentials\": \"true\",\n \"Access-Control-Max-Age\": \"3600\",\n \"Access-Control-Allow-Methods\": \"GET, POST, PUT, DELETE, OPTIONS\",\n \"Access-Control-Allow-Headers\":\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, x-trackunitappversion\",\n },\n open: {\n target: [\"https://dev.manager.trackunit.com/iris-sdk-portal/main#runLocal\"],\n },\n onListening: (server: Server) => {},\n setupMiddlewares: (middlewares: Middleware[], devServer: Server) => {\n middlewares.push({\n name: \"cors-preflight\",\n path: \"/\",\n middleware: (req: Request, res: Response, next: () => void) => {\n if (req.method === \"GET\") {\n next();\n } else {\n res.send(\"GET, HEAD\");\n }\n },\n });\n devServer.app?.use(\"/\", (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n next();\n });\n devServer.app?.use(\"/manifestAndToken\", async (request, response, next) => {\n response.header(\"Access-Control-Allow-Origin\", request.headers.origin || \"https://dev.manager.trackunit.com\");\n response.header(\n \"Access-Control-Allow-Headers\",\n \"X-Requested-With, baggage, content-type, Authorization, sentry-trace, session-id, x-trackunitappversion\"\n );\n try {\n const resp = await fetch(\"http://localhost:22220/manifest.json\");\n const body = await resp.json();\n response.send({ manifest: body });\n } catch (e) {\n console.error(\"ERROR: \", e);\n response.status(500);\n response.send(e);\n }\n });\n return middlewares;\n },\n ...webpackDevServerConfiguration,\n };\n};\n"]}
|