@trackunit/iris-app 0.0.128 → 0.0.135
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 +14 -0
- package/package.json +1 -1
- package/src/executors/build/executor.js +7 -29
- package/src/executors/build/executor.js.map +1 -1
- package/src/executors/build/webpack.d.ts +3 -0
- package/src/executors/build/webpack.js +36 -0
- package/src/executors/build/webpack.js.map +1 -0
- package/src/executors/serve/executor.js +7 -31
- package/src/executors/serve/executor.js.map +1 -1
- package/src/executors/serve/webpackDevServer.d.ts +6 -0
- package/src/executors/serve/webpackDevServer.js +34 -0
- package/src/executors/serve/webpackDevServer.js.map +1 -0
- package/src/executors/utils/defaultWebpackConfig.js +1 -2
- package/src/executors/utils/defaultWebpackConfig.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.135](https://github.com/Trackunit/manager/compare/iris-app/0.0.134...iris-app/0.0.135) (2022-11-02)
|
|
6
|
+
|
|
7
|
+
### [0.0.134](https://github.com/Trackunit/manager/compare/iris-app/0.0.133...iris-app/0.0.134) (2022-11-02)
|
|
8
|
+
|
|
9
|
+
### [0.0.133](https://github.com/Trackunit/manager/compare/iris-app/0.0.132...iris-app/0.0.133) (2022-11-02)
|
|
10
|
+
|
|
11
|
+
### [0.0.132](https://github.com/Trackunit/manager/compare/iris-app/0.0.131...iris-app/0.0.132) (2022-11-02)
|
|
12
|
+
|
|
13
|
+
### [0.0.131](https://github.com/Trackunit/manager/compare/iris-app/0.0.130...iris-app/0.0.131) (2022-11-02)
|
|
14
|
+
|
|
15
|
+
### [0.0.130](https://github.com/Trackunit/manager/compare/iris-app/0.0.129...iris-app/0.0.130) (2022-11-02)
|
|
16
|
+
|
|
17
|
+
### [0.0.129](https://github.com/Trackunit/manager/compare/iris-app/0.0.128...iris-app/0.0.129) (2022-11-02)
|
|
18
|
+
|
|
5
19
|
### [0.0.128](https://github.com/Trackunit/manager/compare/iris-app/0.0.127...iris-app/0.0.128) (2022-11-01)
|
|
6
20
|
|
|
7
21
|
### Dependency Updates
|
package/package.json
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.deleteOutputDir = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
27
5
|
const rxjs_for_await_1 = require("@nrwl/devkit/src/utils/rxjs-for-await");
|
|
28
|
-
const operators_1 = require("@nrwl/webpack/node_modules/rxjs/operators");
|
|
29
|
-
const run_webpack_1 = require("@nrwl/webpack/src/executors/webpack/lib/run-webpack");
|
|
30
6
|
const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
|
|
31
7
|
const fs_1 = require("fs");
|
|
32
8
|
const path_1 = require("path");
|
|
9
|
+
const op = tslib_1.__importStar(require("rxjs/operators"));
|
|
33
10
|
require("webpack-dev-server");
|
|
34
11
|
const checkPackageVersion_1 = require("../utils/checkPackageVersion");
|
|
35
12
|
const defaultWebpackConfig_1 = require("../utils/defaultWebpackConfig");
|
|
13
|
+
const webpack_1 = require("./webpack");
|
|
36
14
|
function deleteOutputDir(root, outputPath) {
|
|
37
15
|
const resolvedOutputPath = (0, path_1.resolve)(root, outputPath);
|
|
38
16
|
if (resolvedOutputPath === root) {
|
|
@@ -51,15 +29,15 @@ async function* default_1(options, context) {
|
|
|
51
29
|
if (!options.webpackConfig) {
|
|
52
30
|
throw new Error("option.webpackConfig is required");
|
|
53
31
|
}
|
|
54
|
-
const IrisAppManifest = (await Promise.resolve().then(() => __importStar(require(tileManifestPath)))).default;
|
|
32
|
+
const IrisAppManifest = (await Promise.resolve().then(() => tslib_1.__importStar(require(tileManifestPath)))).default;
|
|
55
33
|
const defaultConfig = (0, defaultWebpackConfig_1.getDefaultConfig)("production", context.root, projectRootDir, IrisAppManifest);
|
|
56
|
-
const customConfigFile = await Promise.resolve().then(() => __importStar(require(options.webpackConfig)));
|
|
34
|
+
const customConfigFile = await Promise.resolve().then(() => tslib_1.__importStar(require(options.webpackConfig)));
|
|
57
35
|
const config = await customConfigFile.default(defaultConfig);
|
|
58
36
|
deleteOutputDir(context.root, options.outputPath);
|
|
59
|
-
const observable = (0,
|
|
37
|
+
const observable = (0, webpack_1.doRunWebpack)(config).pipe(op.tap(stats => {
|
|
60
38
|
// eslint-disable-next-line no-console
|
|
61
39
|
console.info(stats.toString(config.stats));
|
|
62
|
-
}),
|
|
40
|
+
}), op.map(stats => {
|
|
63
41
|
return {
|
|
64
42
|
success: !stats.hasErrors(),
|
|
65
43
|
outfile: (0, path_1.resolve)(context.root, options.outputPath),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/build/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/build/executor.ts"],"names":[],"mappings":";;;;AAEA,0EAAsE;AACtE,kFAAyE;AACzE,2BAA4B;AAC5B,+BAAqC;AAErC,2DAAqC;AAErC,8BAA4B;AAC5B,sEAAmE;AACnE,wEAAiE;AAEjE,uCAAyC;AAOzC,SAAgB,eAAe,CAAC,IAAY,EAAE,UAAkB;IAC9D,MAAM,kBAAkB,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,kBAAkB,KAAK,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;KACpE;IACD,IAAA,WAAM,EAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC;AAND,0CAMC;AAEc,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,yCAAmB,GAAE,CAAC;IAC5B,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAC,CAAC,IAAI,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAC3B,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAC,CAAC,IAAI,EACrD,sBAAsB,CACvB,CAAC;IACF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;KACrD;IACD,MAAM,eAAe,GAAG,CAAC,gEAAa,gBAAgB,GAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,aAAa,GAAG,IAAA,uCAAgB,EAAC,YAAY,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IACpG,MAAM,gBAAgB,GAAG,gEAAa,OAAO,CAAC,aAAa,GAAC,CAAC;IAE7D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,IAAA,sBAAY,EAAC,MAAM,CAAC,CAAC,IAAI,CAC1C,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACb,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACb,OAAO;YACL,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE;YAC3B,OAAO,EAAE,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;SACjC,CAAC;IACtB,CAAC,CAAC,CACH,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAwC,CAAC,CAAC;AACxE,CAAC;AAjCD,4BAiCC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nrwl/devkit\";\nimport { eachValueFrom } from \"@nrwl/devkit/src/utils/rxjs-for-await\";\nimport { enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { rmSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport \"webpack-dev-server\";\nimport { checkPackageVersion } from \"../utils/checkPackageVersion\";\nimport { getDefaultConfig } from \"../utils/defaultWebpackConfig\";\nimport { BuildExecutorSchema } from \"./schema\";\nimport { doRunWebpack } from \"./webpack\";\n\nexport type NodeBuildEvent = {\n outfile: string;\n success: boolean;\n};\n\nexport function deleteOutputDir(root: string, outputPath: string) {\n const resolvedOutputPath = resolve(root, outputPath);\n if (resolvedOutputPath === root) {\n throw new Error(\"Output path MUST not be project root directory!\");\n }\n rmSync(resolvedOutputPath, { recursive: true, force: true });\n}\n\nexport default async function* (options: BuildExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion();\n const projectRootDir = join(context.root, context.workspace.projects[context.projectName!].root);\n const tileManifestPath = join(\n context.root,\n context.workspace.projects[context.projectName!].root,\n \"iris-app-manifest.ts\"\n );\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.webpackConfig) {\n throw new Error(\"option.webpackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"production\", context.root, projectRootDir, IrisAppManifest);\n const customConfigFile = await import(options.webpackConfig);\n\n const config = await customConfigFile.default(defaultConfig);\n deleteOutputDir(context.root, options.outputPath);\n const observable = doRunWebpack(config).pipe(\n op.tap(stats => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(stats => {\n return {\n success: !stats.hasErrors(),\n outfile: resolve(context.root, options.outputPath),\n } as NodeBuildEvent;\n })\n );\n return yield* eachValueFrom(observable as unknown as Observable<any>);\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doRunWebpack = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const webpack = require("webpack");
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
function doRunWebpack(config) {
|
|
8
|
+
return new rxjs_1.Observable(subscriber => {
|
|
9
|
+
const { watch, ...normalizedConfig } = config;
|
|
10
|
+
const webpackCompiler = webpack(normalizedConfig);
|
|
11
|
+
const callback = (err, stats) => {
|
|
12
|
+
if (err) {
|
|
13
|
+
subscriber.error(err);
|
|
14
|
+
}
|
|
15
|
+
subscriber.next(stats);
|
|
16
|
+
};
|
|
17
|
+
if (config.watch) {
|
|
18
|
+
const watchOptions = config.watchOptions || {};
|
|
19
|
+
const watching = webpackCompiler.watch(watchOptions, callback);
|
|
20
|
+
return () => watching.close(() => subscriber.complete());
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return webpackCompiler.run((err, stats) => {
|
|
24
|
+
callback(err, stats);
|
|
25
|
+
webpackCompiler.close((closeErr) => {
|
|
26
|
+
if (closeErr) {
|
|
27
|
+
subscriber.error(closeErr);
|
|
28
|
+
}
|
|
29
|
+
subscriber.complete();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.doRunWebpack = doRunWebpack;
|
|
36
|
+
//# sourceMappingURL=webpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/build/webpack.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAClC,mCAAoC;AAEpC,8DAA8D;AAC9D,SAAgB,YAAY,CAAC,MAA6B;IACxD,OAAO,IAAI,iBAAU,CAAC,UAAU,CAAC,EAAE;QACjC,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAElD,MAAM,QAAQ,GAAG,CAAC,GAA6B,EAAE,KAAgC,EAAE,EAAE;YACnF,IAAI,GAAG,EAAE;gBACP,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvB;YACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;YAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC/D,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC1D;aAAM;YACL,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,GAA6B,EAAE,KAAgC,EAAE,EAAE;gBAC7F,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACrB,eAAe,CAAC,KAAK,CAAC,CAAC,QAAkC,EAAE,EAAE;oBAC3D,IAAI,QAAQ,EAAE;wBACZ,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;qBAC5B;oBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACxB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,oCA4BC","sourcesContent":["import { Observable } from \"rxjs\";\nimport webpack = require(\"webpack\");\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function doRunWebpack(config: webpack.Configuration): Observable<any> {\n return new Observable(subscriber => {\n const { watch, ...normalizedConfig } = config;\n const webpackCompiler = webpack(normalizedConfig);\n\n const callback = (err: Error | null | undefined, stats: webpack.Stats | undefined) => {\n if (err) {\n subscriber.error(err);\n }\n subscriber.next(stats);\n };\n\n if (config.watch) {\n const watchOptions = config.watchOptions || {};\n const watching = webpackCompiler.watch(watchOptions, callback);\n return () => watching.close(() => subscriber.complete());\n } else {\n return webpackCompiler.run((err: Error | null | undefined, stats: webpack.Stats | undefined) => {\n callback(err, stats);\n webpackCompiler.close((closeErr: Error | null | undefined) => {\n if (closeErr) {\n subscriber.error(closeErr);\n }\n subscriber.complete();\n });\n });\n }\n });\n}\n"]}
|
|
@@ -1,39 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
26
4
|
const rxjs_for_await_1 = require("@nrwl/devkit/src/utils/rxjs-for-await");
|
|
27
|
-
const operators_1 = require("@nrwl/webpack/node_modules/rxjs/operators");
|
|
28
5
|
const get_emitted_files_1 = require("@nrwl/webpack/src/executors/webpack/lib/get-emitted-files");
|
|
29
|
-
const run_webpack_1 = require("@nrwl/webpack/src/utils/run-webpack");
|
|
30
6
|
const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
|
|
31
7
|
const path_1 = require("path");
|
|
8
|
+
const op = tslib_1.__importStar(require("rxjs/operators"));
|
|
32
9
|
require("webpack-dev-server");
|
|
33
10
|
const checkPackageVersion_1 = require("../utils/checkPackageVersion");
|
|
34
11
|
const defaultWebpackConfig_1 = require("../utils/defaultWebpackConfig");
|
|
35
|
-
const
|
|
36
|
-
const WebpackDevServer = require("webpack-dev-server");
|
|
12
|
+
const webpackDevServer_1 = require("./webpackDevServer");
|
|
37
13
|
async function* default_1(options, context) {
|
|
38
14
|
await (0, checkPackageVersion_1.checkPackageVersion)();
|
|
39
15
|
const projectRootDir = (0, path_1.join)(context.root, context.workspace.projects[context.projectName].root);
|
|
@@ -44,14 +20,14 @@ async function* default_1(options, context) {
|
|
|
44
20
|
if (!options.webpackConfig) {
|
|
45
21
|
throw new Error("option.webpackConfig is required");
|
|
46
22
|
}
|
|
47
|
-
const IrisAppManifest = (await Promise.resolve().then(() => __importStar(require(tileManifestPath)))).default;
|
|
23
|
+
const IrisAppManifest = (await Promise.resolve().then(() => tslib_1.__importStar(require(tileManifestPath)))).default;
|
|
48
24
|
const defaultConfig = (0, defaultWebpackConfig_1.getDefaultConfig)("development", context.root, projectRootDir, IrisAppManifest);
|
|
49
|
-
const customConfigFile = await Promise.resolve().then(() => __importStar(require(options.webpackConfig)));
|
|
25
|
+
const customConfigFile = await Promise.resolve().then(() => tslib_1.__importStar(require(options.webpackConfig)));
|
|
50
26
|
const config = await customConfigFile.default(defaultConfig);
|
|
51
|
-
const observable = (0,
|
|
27
|
+
const observable = (0, webpackDevServer_1.doRunWebpackDevServer)(config).pipe(op.tap(({ stats }) => {
|
|
52
28
|
// eslint-disable-next-line no-console
|
|
53
29
|
console.info(stats.toString(config.stats));
|
|
54
|
-
}),
|
|
30
|
+
}), op.map(({ baseUrl, stats }) => {
|
|
55
31
|
return {
|
|
56
32
|
baseUrl,
|
|
57
33
|
emittedFiles: (0, get_emitted_files_1.getEmittedFiles)(stats),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/serve/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/serve/executor.ts"],"names":[],"mappings":";;;AAEA,0EAAsE;AACtE,iGAA4F;AAC5F,kFAAyE;AACzE,+BAA4B;AAE5B,2DAAqC;AAErC,8BAA4B;AAC5B,sEAAmE;AACnE,wEAAiE;AAEjE,yDAA2D;AAI5C,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,yCAAmB,GAAE,CAAC;IAC5B,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAC,CAAC,IAAI,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAC3B,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAC,CAAC,IAAI,EACrD,sBAAsB,CACvB,CAAC;IACF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;KACrD;IACD,MAAM,eAAe,GAAG,CAAC,gEAAa,gBAAgB,GAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,aAAa,GAAG,IAAA,uCAAgB,EAAC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IACrG,MAAM,gBAAgB,GAAG,gEAAa,OAAO,CAAC,aAAa,GAAC,CAAC;IAE7D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAE7D,MAAM,UAAU,GAAG,IAAA,wCAAqB,EAAC,MAAM,CAAC,CAAC,IAAI,CACnD,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACnB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAE,MAAgC,CAAC,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5B,OAAO;YACL,OAAO;YACP,YAAY,EAAE,IAAA,mCAAe,EAAC,KAAK,CAAC;YACpC,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE;SAC5B,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAwC,CAAC,CAAC;AACxE,CAAC;AAnCD,4BAmCC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nrwl/devkit\";\nimport { eachValueFrom } from \"@nrwl/devkit/src/utils/rxjs-for-await\";\nimport { getEmittedFiles } from \"@nrwl/webpack/src/executors/webpack/lib/get-emitted-files\";\nimport { enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport \"webpack-dev-server\";\nimport { checkPackageVersion } from \"../utils/checkPackageVersion\";\nimport { getDefaultConfig } from \"../utils/defaultWebpackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\nimport { doRunWebpackDevServer } from \"./webpackDevServer\";\n\nimport type webpack = require(\"webpack\");\n\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion();\n const projectRootDir = join(context.root, context.workspace.projects[context.projectName!].root);\n const tileManifestPath = join(\n context.root,\n context.workspace.projects[context.projectName!].root,\n \"iris-app-manifest.ts\"\n );\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.webpackConfig) {\n throw new Error(\"option.webpackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest);\n const customConfigFile = await import(options.webpackConfig);\n\n const config = await customConfigFile.default(defaultConfig);\n\n const observable = doRunWebpackDevServer(config).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString((config as webpack.Configuration).stats));\n }),\n op.map(({ baseUrl, stats }) => {\n return {\n baseUrl,\n emittedFiles: getEmittedFiles(stats),\n success: !stats.hasErrors(),\n };\n })\n );\n\n return yield* eachValueFrom(observable as unknown as Observable<any>);\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doRunWebpackDevServer = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const webpack = require("webpack");
|
|
6
|
+
const WebpackDevServer = require("webpack-dev-server");
|
|
7
|
+
function doRunWebpackDevServer(config) {
|
|
8
|
+
return new rxjs_1.Observable(subscriber => {
|
|
9
|
+
const webpackCompiler = webpack.webpack(config);
|
|
10
|
+
let baseUrl;
|
|
11
|
+
webpackCompiler.hooks.done.tap("build-webpack", stats => {
|
|
12
|
+
subscriber.next({ stats, baseUrl });
|
|
13
|
+
});
|
|
14
|
+
const devServerConfig = config.devServer || {};
|
|
15
|
+
const originalOnListen = devServerConfig.onListening;
|
|
16
|
+
devServerConfig.onListening = function (server) {
|
|
17
|
+
if (originalOnListen) {
|
|
18
|
+
originalOnListen(server);
|
|
19
|
+
}
|
|
20
|
+
const devServerOptions = server.options;
|
|
21
|
+
baseUrl = `${server.options.https ? "https" : "http"}://${server.options.host}:${server.options.port}${devServerOptions?.devMiddleware?.publicPath}`;
|
|
22
|
+
};
|
|
23
|
+
const webpackServer = new WebpackDevServer(devServerConfig, webpackCompiler);
|
|
24
|
+
try {
|
|
25
|
+
webpackServer.start().catch((err) => subscriber.error(err));
|
|
26
|
+
return () => webpackServer.stop();
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
throw new Error("Could not start start dev server");
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.doRunWebpackDevServer = doRunWebpackDevServer;
|
|
34
|
+
//# sourceMappingURL=webpackDevServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpackDevServer.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/serve/webpackDevServer.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAClC,mCAAoC;AACpC,uDAAwD;AAExD,SAAgB,qBAAqB,CACnC,MAA6B;IAE7B,OAAO,IAAI,iBAAU,CAAC,UAAU,CAAC,EAAE;QACjC,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEhD,IAAI,OAAe,CAAC;QAEpB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE;YACtD,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAI,MAAgC,CAAC,SAAS,IAAI,EAAE,CAAC;QAE1E,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC;QAErD,eAAe,CAAC,WAAW,GAAG,UAAU,MAAwB;YAC9D,IAAI,gBAAgB,EAAE;gBACpB,gBAAgB,CAAC,MAAM,CAAC,CAAC;aAC1B;YAED,MAAM,gBAAgB,GAAmC,MAAM,CAAC,OAAO,CAAC;YAExE,OAAO,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,GAClG,gBAAgB,EAAE,aAAa,EAAE,UACnC,EAAE,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,IAAI,gBAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QAE7E,IAAI;YACF,aAAa,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACnE,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;SACnC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACrD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AArCD,sDAqCC","sourcesContent":["import { Observable } from \"rxjs\";\nimport webpack = require(\"webpack\");\nimport WebpackDevServer = require(\"webpack-dev-server\");\n\nexport function doRunWebpackDevServer(\n config: webpack.Configuration\n): Observable<{ stats: webpack.Stats; baseUrl: string }> {\n return new Observable(subscriber => {\n const webpackCompiler = webpack.webpack(config);\n\n let baseUrl: string;\n\n webpackCompiler.hooks.done.tap(\"build-webpack\", stats => {\n subscriber.next({ stats, baseUrl });\n });\n\n const devServerConfig = (config as webpack.Configuration).devServer || {};\n\n const originalOnListen = devServerConfig.onListening;\n\n devServerConfig.onListening = function (server: WebpackDevServer) {\n if (originalOnListen) {\n originalOnListen(server);\n }\n\n const devServerOptions: WebpackDevServer.Configuration = server.options;\n\n baseUrl = `${server.options.https ? \"https\" : \"http\"}://${server.options.host}:${server.options.port}${\n devServerOptions?.devMiddleware?.publicPath\n }`;\n };\n\n const webpackServer = new WebpackDevServer(devServerConfig, webpackCompiler);\n\n try {\n webpackServer.start().catch((err: Error) => subscriber.error(err));\n return () => webpackServer.stop();\n } catch (e) {\n throw new Error(\"Could not start start dev server\");\n }\n });\n}\n"]}
|
|
@@ -131,9 +131,8 @@ const getDefaultConfig = async (mode, nxRootDir, appDir, irisAppManifest) => {
|
|
|
131
131
|
new CopyWebpackPlugin({
|
|
132
132
|
patterns: [
|
|
133
133
|
{
|
|
134
|
-
from: path.join(
|
|
134
|
+
from: path.join(relativeAppDir.substring(1), "assets") + "/**/(*.png|*.jpg|*.jpeg|*.webp|*.md)",
|
|
135
135
|
to: path.join(nxRootDir, "dist"),
|
|
136
|
-
noErrorOnMissing: true,
|
|
137
136
|
},
|
|
138
137
|
],
|
|
139
138
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,kFAK6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,yDAAmC;AACnC,8BAA4B;AAC5B,8DAA8D;AAC9D,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAElD,MAAM,gBAAgB,GAAG,KAAK,EACnC,IAAkC,EAClC,SAAiB,EACjB,MAAc,EACd,eAAgC,EACA,EAAE;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC;SACnD;QAED,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,GA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N,QAAQ,EAAE,eAAe;aAC1B,CAAC;YACF,IAAI,iBAAiB,CAAC;gBACpB,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"defaultWebpackConfig.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/executors/utils/defaultWebpackConfig.ts"],"names":[],"mappings":";;;;AACA,kFAK6C;AAC7C,gFAAmF;AACnF,mDAA6B;AAC7B,yDAAmC;AACnC,8BAA4B;AAC5B,8DAA8D;AAC9D,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAElD,MAAM,gBAAgB,GAAG,KAAK,EACnC,IAAkC,EAClC,SAAiB,EACjB,MAAc,EACd,eAAgC,EACA,EAAE;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC;SACnD;QAED,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,WAAW;QACnD,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,MAAM,IAAA,kDAAuB,GAAE;QAC1C,OAAO,EAAE;YACP,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;YACnD,KAAK,EAAE,MAAM,IAAA,iDAAsB,EAAC,EAAE,SAAS,EAAE,CAAC;SACnD;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE;wBACP,cAAc,EAAE,KAAK;qBACtB;iBACF;gBACD;oBACE,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FromTsConfig,\n getExposedExtensions,\n getSharedDependencies,\n getTileWebpackDevServer,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { TrackunitIrisAppWebpackPlugin } from \"@trackunit/iris-app-webpack-plugin\";\nimport * as path from \"path\";\nimport * as webpack from \"webpack\";\nimport \"webpack-dev-server\";\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\n\nexport const getDefaultConfig = async (\n mode: \"production\" | \"development\",\n nxRootDir: string,\n appDir: string,\n irisAppManifest: IrisAppManifest\n): Promise<webpack.Configuration> => {\n const relativeAppDir = appDir.split(nxRootDir)[1];\n return {\n mode: mode,\n output: {\n publicPath: \"auto\",\n path: path.join(nxRootDir, \"dist\", relativeAppDir),\n },\n\n entry: path.resolve(__dirname, \"src\") + \"/index.js\",\n devtool: false,\n devServer: await getTileWebpackDevServer(),\n resolve: {\n extensions: [\".tsx\", \".ts\", \".jsx\", \".js\", \".json\"],\n alias: await getAliasesFromTsConfig({ nxRootDir }),\n },\n module: {\n rules: [\n {\n test: /\\.m?js/,\n type: \"javascript/auto\",\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.svg$/,\n use: [\"@svgr/webpack\", \"url-loader\"],\n },\n {\n test: /\\.(png|jpg|gif|woff|ico)$/,\n exclude: /(node_modules)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,\n include: /(node_modules\\/@okta)/,\n type: \"asset/resource\",\n },\n {\n test: /\\.(css|s[ac]ss)$/i,\n use: [\n \"style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\",\n options: {\n postcssOptions: {\n plugins: {\n \"postcss-import\": {},\n \"tailwindcss/nesting\": {},\n tailwindcss: {\n config: path.resolve(appDir, \"tailwind.config.js\"),\n },\n autoprefixer: {},\n },\n },\n },\n },\n ],\n },\n {\n test: /\\.json$/,\n loader: \"json-loader\",\n },\n {\n test: /\\.(ts|tsx|js|jsx)$/,\n exclude: /node_modules/,\n use: {\n loader: \"babel-loader\",\n options: {\n cacheDirectory: true,\n babelrc: false,\n presets: [\n [\n \"@babel/preset-env\",\n {\n useBuiltIns: \"usage\",\n corejs: { version: 3, proposals: true },\n },\n ],\n \"@babel/preset-typescript\",\n [\"@babel/preset-react\", { runtime: \"automatic\" }],\n ],\n exclude: /node_modules/,\n plugins: [\n [\"@babel/plugin-proposal-decorators\", { legacy: true }],\n [\"@babel/plugin-proposal-class-properties\", { loose: true }],\n [\"@babel/plugin-proposal-private-methods\", { loose: true }],\n [\"@babel/plugin-proposal-private-property-in-object\", { loose: true }],\n [\n \"babel-plugin-styled-components\",\n\n {\n ssr: false,\n pure: true,\n },\n ],\n ],\n },\n },\n },\n ],\n },\n\n plugins: [\n new webpack.container.ModuleFederationPlugin({\n name: irisAppManifest.moduleFederationName,\n filename: \"remoteEntry.js\",\n library: { type: \"global\", name: irisAppManifest.moduleFederationName },\n remotes: {},\n exposes: await getExposedExtensions({\n nxRootDir,\n manifest: irisAppManifest,\n }),\n shared: await getSharedDependencies({ manifest: irisAppManifest }),\n }),\n new TrackunitIrisAppWebpackPlugin({\n nxRootDir: nxRootDir,\n appDir,\n manifest: irisAppManifest,\n }),\n new CopyWebpackPlugin({\n patterns: [\n {\n from: path.join(relativeAppDir.substring(1), \"assets\") + \"/**/(*.png|*.jpg|*.jpeg|*.webp|*.md)\",\n to: path.join(nxRootDir, \"dist\"),\n },\n ],\n }),\n ],\n };\n};\n"]}
|