@trackunit/iris-app-sdk-rspack 1.11.0 → 1.11.6

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
@@ -1,3 +1,55 @@
1
+ ## 1.11.6 (2026-01-27)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated iris-app-build-utilities to 1.12.6
6
+ - Updated iris-app-webpack-plugin to 1.11.6
7
+ - Updated iris-app-api to 1.14.6
8
+
9
+ ## 1.11.5 (2026-01-27)
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated iris-app-build-utilities to 1.12.5
14
+ - Updated iris-app-webpack-plugin to 1.11.5
15
+ - Updated iris-app-api to 1.14.5
16
+
17
+ ## 1.11.4 (2026-01-26)
18
+
19
+ ### 🧱 Updated Dependencies
20
+
21
+ - Updated iris-app-build-utilities to 1.12.4
22
+ - Updated iris-app-webpack-plugin to 1.11.4
23
+ - Updated iris-app-api to 1.14.4
24
+ - Updated shared-utils to 1.13.4
25
+
26
+ ## 1.11.3 (2026-01-26)
27
+
28
+ ### 🧱 Updated Dependencies
29
+
30
+ - Updated iris-app-build-utilities to 1.12.3
31
+ - Updated iris-app-webpack-plugin to 1.11.3
32
+ - Updated iris-app-api to 1.14.3
33
+ - Updated shared-utils to 1.13.3
34
+
35
+ ## 1.11.2 (2026-01-26)
36
+
37
+ ### 🧱 Updated Dependencies
38
+
39
+ - Updated iris-app-build-utilities to 1.12.2
40
+ - Updated iris-app-webpack-plugin to 1.11.2
41
+ - Updated iris-app-api to 1.14.2
42
+ - Updated shared-utils to 1.13.2
43
+
44
+ ## 1.11.1 (2026-01-26)
45
+
46
+ ### 🧱 Updated Dependencies
47
+
48
+ - Updated iris-app-build-utilities to 1.12.1
49
+ - Updated iris-app-webpack-plugin to 1.11.1
50
+ - Updated iris-app-api to 1.14.1
51
+ - Updated shared-utils to 1.13.1
52
+
1
53
  ## 1.11.0 (2026-01-26)
2
54
 
3
55
  ### 🚀 Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-sdk-rspack",
3
- "version": "1.11.0",
3
+ "version": "1.11.6",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "executors": "./executors.json",
@@ -13,13 +13,9 @@
13
13
  "@nx/devkit": "22.0.4",
14
14
  "rxjs": "7.8.1",
15
15
  "win-ca": "^3.5.1",
16
- "pacote": "^21.0.4",
17
- "semver": "7.5.4",
18
16
  "webpack-bundle-analyzer": "^4.8.0",
19
- "@trackunit/iris-app-build-utilities": "1.12.0",
20
- "@trackunit/shared-utils": "1.13.0",
21
- "@trackunit/iris-app-api": "1.14.0",
22
- "@trackunit/iris-app-webpack-plugin": "1.11.0",
17
+ "@trackunit/iris-app-api": "1.14.6",
18
+ "@trackunit/iris-app-webpack-plugin": "1.11.6",
23
19
  "tslib": "^2.6.2",
24
20
  "ts-checker-rspack-plugin": "^1.1.1"
25
21
  },
@@ -9,7 +9,6 @@ const path_1 = require("path");
9
9
  const rxjs_1 = require("rxjs");
10
10
  const op = tslib_1.__importStar(require("rxjs/operators"));
11
11
  require("win-ca");
12
- const checkPackageVersion_1 = require("../utils/checkPackageVersion");
13
12
  const defaultRspackConfig_1 = require("../utils/defaultRspackConfig");
14
13
  const deleteOutputDir = (root, outputPath) => {
15
14
  const resolvedOutputPath = (0, path_1.resolve)(root, outputPath);
@@ -26,7 +25,7 @@ const deleteOutputDir = (root, outputPath) => {
26
25
  * @yields {NodeBuildEvent} the build event
27
26
  */
28
27
  async function* default_1(options, context) {
29
- await (0, checkPackageVersion_1.checkPackageVersion)(false);
28
+ await (0, iris_app_build_utilities_1.checkPackageVersion)(false);
30
29
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
31
30
  const projectRootDir = (0, path_1.join)(context.root, projectRoot);
32
31
  const tileManifestPath = (0, path_1.join)(context.root, projectRoot, "iris-app-manifest.ts");
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/build/executor.ts"],"names":[],"mappings":";;AAmCA,4BAkFC;;AAnHD,wEAAoE;AACpE,kFAAyE;AACzE,2BAA4B;AAC5B,+BAAqC;AACrC,+BAAkC;AAClC,2DAAqC;AAGrC,kBAAgB;AAChB,sEAAmE;AACnE,sEAAgE;AAQhE,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,UAAkB,EAAE,EAAE;IAC3D,MAAM,kBAAkB,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,IAAA,WAAM,EAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,yCAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAE,CAAC,IAAI,CAAC;IACxF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,eAAe,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C,CAAC;AAC7D,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/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 { Configuration } from \"@rspack/core\";\nimport \"win-ca\";\nimport { checkPackageVersion } from \"../utils/checkPackageVersion\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { BuildExecutorSchema } from \"./schema\";\n\nexport type NodeBuildEvent = {\n outfile: string;\n success: boolean;\n};\n\nconst 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\n/**\n * Build executor for building iris apps.\n *\n * @param {BuildExecutorSchema} options build executor options for this nx executor\n * @param {ExecutorContext} context build executor context for this nx executor\n * @yields {NodeBuildEvent} the build event\n */\nexport default async function* (options: BuildExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = await getDefaultConfig(\"production\", context.root, projectRootDir, IrisAppManifest, context);\n\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n deleteOutputDir(context.root, options.outputPath);\n const observable = new Observable(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, local-rules/no-typescript-assertion\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n\n // Add signal handlers\n const signals: Array<NodeJS.Signals> = [\"SIGINT\", \"SIGTERM\", \"SIGQUIT\"];\n const cleanup = () => {\n compiler.close((err: Error | null) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n process.exit(0);\n });\n };\n\n signals.forEach(signal => {\n process.on(signal, cleanup);\n });\n\n compiler.run((err: Error | null, stats: any) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n subscriber.error(err);\n return;\n }\n\n subscriber.next(stats);\n subscriber.complete();\n });\n\n // Update cleanup function to remove signal handlers\n return () => {\n signals.forEach(signal => {\n process.off(signal, cleanup);\n });\n compiler.close((err: Error | null) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n };\n }).pipe(\n op.tap((stats: any) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map((stats: any) => {\n // eslint-disable-next-line local-rules/no-typescript-assertion\n return {\n success: !stats.hasErrors(),\n outfile: resolve(context.root, options.outputPath),\n } as NodeBuildEvent;\n })\n );\n\n // eslint-disable-next-line local-rules/no-typescript-assertion\n return yield* eachValueFrom(observable as Observable<any>);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/build/executor.ts"],"names":[],"mappings":";;AAkCA,4BAkFC;;AAlHD,wEAAoE;AACpE,kFAA8F;AAC9F,2BAA4B;AAC5B,+BAAqC;AACrC,+BAAkC;AAClC,2DAAqC;AAGrC,kBAAgB;AAChB,sEAAgE;AAQhE,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,UAAkB,EAAE,EAAE;IAC3D,MAAM,kBAAkB,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;QAChC,MAAM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YAC/B,CAAC,CAAC,CAAC;YACH,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAiB,EAAE,EAAE;gBACnC,IAAI,GAAG,EAAE,CAAC;oBACR,sCAAsC;oBACtC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CACL,EAAE,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;QACpB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;QACpB,+DAA+D;QAC/D,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;IAEF,+DAA+D;IAC/D,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAA6B,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { checkPackageVersion, 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 { Configuration } from \"@rspack/core\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { BuildExecutorSchema } from \"./schema\";\n\nexport type NodeBuildEvent = {\n outfile: string;\n success: boolean;\n};\n\nconst 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\n/**\n * Build executor for building iris apps.\n *\n * @param {BuildExecutorSchema} options build executor options for this nx executor\n * @param {ExecutorContext} context build executor context for this nx executor\n * @yields {NodeBuildEvent} the build event\n */\nexport default async function* (options: BuildExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = await getDefaultConfig(\"production\", context.root, projectRootDir, IrisAppManifest, context);\n\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n deleteOutputDir(context.root, options.outputPath);\n const observable = new Observable(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, local-rules/no-typescript-assertion\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n\n // Add signal handlers\n const signals: Array<NodeJS.Signals> = [\"SIGINT\", \"SIGTERM\", \"SIGQUIT\"];\n const cleanup = () => {\n compiler.close((err: Error | null) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n process.exit(0);\n });\n };\n\n signals.forEach(signal => {\n process.on(signal, cleanup);\n });\n\n compiler.run((err: Error | null, stats: any) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n subscriber.error(err);\n return;\n }\n\n subscriber.next(stats);\n subscriber.complete();\n });\n\n // Update cleanup function to remove signal handlers\n return () => {\n signals.forEach(signal => {\n process.off(signal, cleanup);\n });\n compiler.close((err: Error | null) => {\n if (err) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n });\n };\n }).pipe(\n op.tap((stats: any) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map((stats: any) => {\n // eslint-disable-next-line local-rules/no-typescript-assertion\n return {\n success: !stats.hasErrors(),\n outfile: resolve(context.root, options.outputPath),\n } as NodeBuildEvent;\n })\n );\n\n // eslint-disable-next-line local-rules/no-typescript-assertion\n return yield* eachValueFrom(observable as Observable<any>);\n}\n"]}
@@ -9,7 +9,6 @@ const rxjs_1 = require("rxjs");
9
9
  const op = tslib_1.__importStar(require("rxjs/operators"));
10
10
  const dev_server_1 = require("@rspack/dev-server");
11
11
  require("win-ca");
12
- const checkPackageVersion_1 = require("../utils/checkPackageVersion");
13
12
  const defaultRspackConfig_1 = require("../utils/defaultRspackConfig");
14
13
  /**
15
14
  * Serve executor for serving iris apps.
@@ -19,7 +18,7 @@ const defaultRspackConfig_1 = require("../utils/defaultRspackConfig");
19
18
  * @yields {AsyncGenerator<any, void, unknown>} the serve observable
20
19
  */
21
20
  async function* default_1(options, context) {
22
- await (0, checkPackageVersion_1.checkPackageVersion)(false);
21
+ await (0, iris_app_build_utilities_1.checkPackageVersion)(false);
23
22
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
24
23
  const projectRootDir = (0, path_1.join)(context.root, projectRoot);
25
24
  const tileManifestPath = (0, path_1.join)(context.root, projectRoot, "iris-app-manifest.ts");
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAsBA,4BAgEC;;AApFD,wEAAoE;AACpE,kFAAyE;AACzE,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AAGrC,mDAAqD;AACrD,kBAAgB;AAChB,sEAAmE;AACnE,sEAAgE;AAGhE;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACp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OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport { Configuration } from \"@rspack/core\";\nimport { RspackDevServer } from \"@rspack/dev-server\";\nimport \"win-ca\";\nimport { checkPackageVersion } from \"../utils/checkPackageVersion\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\n\n/**\n * Serve executor for serving iris apps.\n *\n * @param {ServeExecutorSchema} options serve executor options for this nx executor\n * @param {ExecutorContext} context serve executor context for this nx executor\n * @yields {AsyncGenerator<any, void, unknown>} the serve observable\n */\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest, context);\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using config\", JSON.stringify(config.plugins, null, 2));\n }\n const observable = new Observable<{ baseUrl: string; success: boolean; stats: any }>(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n const devServer = new RspackDevServer(\n {\n ...config.devServer,\n },\n compiler\n );\n\n devServer.startCallback(() => {\n const baseUrl = `http${config.devServer?.https ? \"s\" : \"\"}://${config.devServer?.host || \"localhost\"}:${config.devServer?.port || 8080}`;\n\n compiler.hooks.done.tap(\"iris-serve\", (stats: any) => {\n subscriber.next({\n baseUrl,\n success: !stats.hasErrors(),\n stats,\n });\n });\n });\n\n return () => {\n devServer.stopCallback(() => {\n subscriber.complete();\n });\n };\n }).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n }))\n );\n\n return yield* eachValueFrom(observable);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/serve/executor.ts"],"names":[],"mappings":";;AAqBA,4BAgEC;;AAnFD,wEAAoE;AACpE,kFAA8F;AAC9F,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AAGrC,mDAAqD;AACrD,kBAAgB;AAChB,sEAAgE;AAGhE;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,WAAE,OAA4B,EAAE,OAAwB;IACpF,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAY,CAAE,CAAC,IAAI,CAAC;IACxF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjF,IAAA,6CAAkB,EAAC;QACjB,cAAc;KACf,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CA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Q,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,KAAU,EAAE,EAAE;gBACnD,UAAU,CAAC,IAAI,CAAC;oBACd,OAAO;oBACP,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE;oBAC3B,KAAK;iBACN,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE;gBAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CACL,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACnB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO;QACP,OAAO;KACR,CAAC,CAAC,CACJ,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,IAAA,8BAAa,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/src/utils/rxjs-for-await\";\nimport { checkPackageVersion, enableTsConfigPath } from \"@trackunit/iris-app-build-utilities\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\n\nimport { Configuration } from \"@rspack/core\";\nimport { RspackDevServer } from \"@rspack/dev-server\";\nimport \"win-ca\";\nimport { getDefaultConfig } from \"../utils/defaultRspackConfig\";\nimport { ServeExecutorSchema } from \"./schema\";\n\n/**\n * Serve executor for serving iris apps.\n *\n * @param {ServeExecutorSchema} options serve executor options for this nx executor\n * @param {ExecutorContext} context serve executor context for this nx executor\n * @yields {AsyncGenerator<any, void, unknown>} the serve observable\n */\nexport default async function* (options: ServeExecutorSchema, context: ExecutorContext) {\n await checkPackageVersion(false);\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n const tileManifestPath = join(context.root, projectRoot, \"iris-app-manifest.ts\");\n enableTsConfigPath({\n projectRootDir,\n });\n if (!options.rspackConfig) {\n throw new Error(\"option.rspackConfig is required\");\n }\n const IrisAppManifest = (await import(tileManifestPath)).default;\n const defaultConfig = getDefaultConfig(\"development\", context.root, projectRootDir, IrisAppManifest, context);\n const customConfigFile = await import(options.rspackConfig);\n\n let config = customConfigFile.default(await defaultConfig);\n const isPromise = config instanceof Promise;\n if (isPromise) {\n config = await config;\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using config\", JSON.stringify(config.plugins, null, 2));\n }\n const observable = new Observable<{ baseUrl: string; success: boolean; stats: any }>(subscriber => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const compiler = require(\"@rspack/core\").rspack(config as Configuration);\n const devServer = new RspackDevServer(\n {\n ...config.devServer,\n },\n compiler\n );\n\n devServer.startCallback(() => {\n const baseUrl = `http${config.devServer?.https ? \"s\" : \"\"}://${config.devServer?.host || \"localhost\"}:${config.devServer?.port || 8080}`;\n\n compiler.hooks.done.tap(\"iris-serve\", (stats: any) => {\n subscriber.next({\n baseUrl,\n success: !stats.hasErrors(),\n stats,\n });\n });\n });\n\n return () => {\n devServer.stopCallback(() => {\n subscriber.complete();\n });\n };\n }).pipe(\n op.tap(({ stats }) => {\n // eslint-disable-next-line no-console\n console.info(stats.toString(config.stats));\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n }))\n );\n\n return yield* eachValueFrom(observable);\n}\n"]}
@@ -1,30 +0,0 @@
1
- /**
2
- *
3
- * @param pkg package to look for.
4
- * @param localRange local version of the package.
5
- * @param range range
6
- * @returns { boolean } true if its a valid version
7
- */
8
- export declare const versionCheck: (pkg: string, localRange: string, range: string, throwError?: boolean) => boolean;
9
- /**
10
- * Get the latest version of the package from the registry.
11
- *
12
- * @param pkg package to look for.
13
- * @returns { Promise<string> } returns version
14
- */
15
- export declare const getLatestRemoteVersion: (pkg: string) => Promise<string>;
16
- /**
17
- * Check if the current version of the package is the same as the one in the manager.
18
- *
19
- * @param {string} managerNxVersion version of nx in the manager
20
- * @returns { boolean} true if its a valid version
21
- */
22
- export declare function checkNxVersion(managerNxVersion: string, throwError?: boolean): Promise<boolean>;
23
- /**
24
- *
25
- */
26
- export declare function checkTrackunitPackages(dependencies: Record<string, string>, throwError?: boolean): Promise<boolean>;
27
- /**
28
- *
29
- */
30
- export declare function checkPackageVersion(throwError?: boolean): Promise<boolean>;
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLatestRemoteVersion = exports.versionCheck = void 0;
4
- exports.checkNxVersion = checkNxVersion;
5
- exports.checkTrackunitPackages = checkTrackunitPackages;
6
- exports.checkPackageVersion = checkPackageVersion;
7
- const tslib_1 = require("tslib");
8
- const devkit_1 = require("@nx/devkit");
9
- const shared_utils_1 = require("@trackunit/shared-utils");
10
- const child_process_1 = require("child_process");
11
- const pacote = tslib_1.__importStar(require("pacote"));
12
- const semver = tslib_1.__importStar(require("semver"));
13
- /**
14
- *
15
- * @param pkg package to look for.
16
- * @param localRange local version of the package.
17
- * @param range range
18
- * @returns { boolean } true if its a valid version
19
- */
20
- const versionCheck = (pkg, localRange, range, throwError = true) => {
21
- const localVersion = semver.minVersion(localRange) ?? localRange; // ('^1.0.0') => '1.0.0'
22
- const remoteVersion = semver.minVersion(range) ?? range; // Assume range is in a format that semver.minVersion can handle
23
- if (!semver.satisfies(localVersion, range)) {
24
- const msg = `Package "${pkg}" outdated. Remote Version: ${range} Local version: ${localRange}. 👈\n Update package using command: \n npm i ${pkg}@${range}\n ...or to update all trackunit dependencies: \n npx npm-check-updates "/@trackunit/" -u`;
25
- if (semver.major(localVersion) < semver.major(remoteVersion) && throwError) {
26
- throw new Error(msg);
27
- }
28
- else {
29
- // eslint-disable-next-line no-console
30
- console.warn("⚠️ " + msg + "\n");
31
- return true;
32
- }
33
- }
34
- return true;
35
- };
36
- exports.versionCheck = versionCheck;
37
- /**
38
- * Get the latest version of the package from the registry.
39
- *
40
- * @param pkg package to look for.
41
- * @returns { Promise<string> } returns version
42
- */
43
- const getLatestRemoteVersion = async (pkg) => {
44
- try {
45
- const manifest = await pacote.manifest(pkg);
46
- return manifest.version;
47
- }
48
- catch (error) {
49
- throw new Error(`Error fetching manifest for package ${pkg}. This package might need to be published, or it has been included as a dependency by mistake.`);
50
- }
51
- };
52
- exports.getLatestRemoteVersion = getLatestRemoteVersion;
53
- /**
54
- * Check if the current version of the package is the same as the one in the manager.
55
- *
56
- * @param {string} managerNxVersion version of nx in the manager
57
- * @returns { boolean} true if its a valid version
58
- */
59
- async function checkNxVersion(managerNxVersion, throwError = true) {
60
- const currentNxVersion = (0, child_process_1.execSync)("nx --version")
61
- .toString("utf-8")
62
- .replace(/\r?\n|\r/, ""); // regex removes any line breaks
63
- return (0, exports.versionCheck)("nx", currentNxVersion, managerNxVersion, throwError);
64
- }
65
- /**
66
- *
67
- */
68
- async function checkTrackunitPackages(dependencies, throwError = true) {
69
- for (const key in dependencies) {
70
- const remoteVersion = await (0, exports.getLatestRemoteVersion)(key);
71
- if (remoteVersion) {
72
- const localDependencyVersion = dependencies[key];
73
- // If @trackunit dependencies are linked/added locally using "file:", skip the version check, used for E2E tests.
74
- if (localDependencyVersion && !localDependencyVersion.includes("file:")) {
75
- (0, exports.versionCheck)(key, localDependencyVersion, remoteVersion, throwError);
76
- }
77
- }
78
- }
79
- return true;
80
- }
81
- function getLibraries() {
82
- const packageJsonLocal = (0, devkit_1.readJsonFile)("package.json");
83
- const trackunitDependencies = (0, shared_utils_1.objectFromEntries)(Object.entries(packageJsonLocal.dependencies || {}).filter(([key]) => key.startsWith("@trackunit/")));
84
- const trackunitDevDependencies = (0, shared_utils_1.objectFromEntries)(Object.entries(packageJsonLocal.devDependencies || {}).filter(([key]) => key.startsWith("@trackunit/")));
85
- return { trackunitDependencies, trackunitDevDependencies };
86
- }
87
- /**
88
- *
89
- */
90
- async function checkPackageVersion(throwError = true) {
91
- const { trackunitDependencies, trackunitDevDependencies } = getLibraries();
92
- // const managerNxVersion = version.managerNxVersion;
93
- // await checkNxVersion(managerNxVersion, throwError);
94
- await checkTrackunitPackages(trackunitDependencies, throwError);
95
- await checkTrackunitPackages(trackunitDevDependencies, throwError);
96
- return true;
97
- }
98
- //# sourceMappingURL=checkPackageVersion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkPackageVersion.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/checkPackageVersion.ts"],"names":[],"mappings":";;;AAqDA,wCAKC;AAKD,wDAYC;AAgBD,kDAOC;;AAlGD,uCAA0C;AAC1C,0DAA4D;AAC5D,iDAAyC;AACzC,uDAAiC;AACjC,uDAAiC;AAEjC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,UAAkB,EAAE,KAAa,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IAChG,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,CAAC,wBAAwB;IAC1F,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,gEAAgE;IAEzH,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;QAC3C,MAAM,GAAG,GAAG,YAAY,GAAG,+BAA+B,KAAK,mBAAmB,UAAU,kDAAkD,GAAG,IAAI,KAAK,6FAA6F,CAAC;QACxP,IAAI,MA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AU,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { readJsonFile } from \"@nx/devkit\";\nimport { objectFromEntries } from \"@trackunit/shared-utils\";\nimport { execSync } from \"child_process\";\nimport * as pacote from \"pacote\";\nimport * as semver from \"semver\";\n\n/**\n *\n * @param pkg package to look for.\n * @param localRange local version of the package.\n * @param range range\n * @returns { boolean } true if its a valid version\n */\nexport const versionCheck = (pkg: string, localRange: string, range: string, throwError = true) => {\n const localVersion = semver.minVersion(localRange) ?? localRange; // ('^1.0.0') => '1.0.0'\n const remoteVersion = semver.minVersion(range) ?? range; // Assume range is in a format that semver.minVersion can handle\n\n if (!semver.satisfies(localVersion, range)) {\n const msg = `Package \"${pkg}\" outdated. Remote Version: ${range} Local version: ${localRange}. 👈\\n Update package using command: \\n npm i ${pkg}@${range}\\n ...or to update all trackunit dependencies: \\n npx npm-check-updates \"/@trackunit/\" -u`;\n if (semver.major(localVersion) < semver.major(remoteVersion) && throwError) {\n throw new Error(msg);\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"⚠️ \" + msg + \"\\n\");\n return true;\n }\n }\n return true;\n};\n\n/**\n * Get the latest version of the package from the registry.\n *\n * @param pkg package to look for.\n * @returns { Promise<string> } returns version\n */\nexport const getLatestRemoteVersion = async (pkg: string) => {\n try {\n const manifest = await pacote.manifest(pkg);\n return manifest.version;\n } catch (error) {\n throw new Error(\n `Error fetching manifest for package ${pkg}. This package might need to be published, or it has been included as a dependency by mistake.`\n );\n }\n};\n\n/**\n * Check if the current version of the package is the same as the one in the manager.\n *\n * @param {string} managerNxVersion version of nx in the manager\n * @returns { boolean} true if its a valid version\n */\nexport async function checkNxVersion(managerNxVersion: string, throwError = true) {\n const currentNxVersion = execSync(\"nx --version\")\n .toString(\"utf-8\")\n .replace(/\\r?\\n|\\r/, \"\"); // regex removes any line breaks\n return versionCheck(\"nx\", currentNxVersion, managerNxVersion, throwError);\n}\n\n/**\n *\n */\nexport async function checkTrackunitPackages(dependencies: Record<string, string>, throwError = true) {\n for (const key in dependencies) {\n const remoteVersion: string | undefined = await getLatestRemoteVersion(key);\n if (remoteVersion) {\n const localDependencyVersion: string | undefined = dependencies[key];\n // If @trackunit dependencies are linked/added locally using \"file:\", skip the version check, used for E2E tests.\n if (localDependencyVersion && !localDependencyVersion.includes(\"file:\")) {\n versionCheck(key, localDependencyVersion, remoteVersion, throwError);\n }\n }\n }\n return true;\n}\n\nfunction getLibraries() {\n const packageJsonLocal: Record<string, string | Record<string, string>> = readJsonFile(\"package.json\");\n const trackunitDependencies = objectFromEntries(\n Object.entries(packageJsonLocal.dependencies || {}).filter(([key]) => key.startsWith(\"@trackunit/\"))\n );\n const trackunitDevDependencies = objectFromEntries(\n Object.entries(packageJsonLocal.devDependencies || {}).filter(([key]) => key.startsWith(\"@trackunit/\"))\n );\n return { trackunitDependencies, trackunitDevDependencies };\n}\n\n/**\n *\n */\nexport async function checkPackageVersion(throwError = true) {\n const { trackunitDependencies, trackunitDevDependencies } = getLibraries();\n // const managerNxVersion = version.managerNxVersion;\n // await checkNxVersion(managerNxVersion, throwError);\n await checkTrackunitPackages(trackunitDependencies, throwError);\n await checkTrackunitPackages(trackunitDevDependencies, throwError);\n return true;\n}\n"]}
@@ -1,4 +0,0 @@
1
- export declare const version: {
2
- managerNxVersion: string;
3
- managerNodeVersion: string;
4
- };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.version = void 0;
4
- // The major version of NX and Node specified here will be matched with corresponding versions in the iris app.
5
- exports.version = {
6
- managerNxVersion: "^19.8.3",
7
- managerNodeVersion: "^22.14.0",
8
- };
9
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/rspack/src/executors/utils/version.ts"],"names":[],"mappings":";;;AAAA,+GAA+G;AAClG,QAAA,OAAO,GAAG;IACrB,gBAAgB,EAAE,SAAS;IAC3B,kBAAkB,EAAE,UAAU;CAC/B,CAAC","sourcesContent":["// The major version of NX and Node specified here will be matched with corresponding versions in the iris app.\nexport const version = {\n managerNxVersion: \"^19.8.3\",\n managerNodeVersion: \"^22.14.0\",\n};\n"]}