@trackunit/iris-app-sdk-vite 1.5.1-alpha-f60e0f7c192.0 → 1.5.3

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,104 @@
1
+ ## 1.5.3 (2026-09-30)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated iris-app to 2.8.3
6
+
7
+ ## 1.5.2 (2026-09-29)
8
+
9
+ ### 🧱 Updated Dependencies
10
+
11
+ - Updated iris-app-build-utilities to 2.5.2
12
+ - Updated iris-app-api to 2.7.2
13
+ - Updated iris-app to 2.8.2
14
+
15
+ ## 1.5.1 (2026-09-29)
16
+
17
+ ### 🧱 Updated Dependencies
18
+
19
+ - Updated iris-app-build-utilities to 2.5.1
20
+ - Updated iris-app-api to 2.7.1
21
+ - Updated iris-app to 2.8.1
22
+
23
+ ## 1.5.0 (2026-09-29)
24
+
25
+ ### 🧱 Updated Dependencies
26
+
27
+ - Updated iris-app-build-utilities to 2.5.0
28
+ - Updated iris-app-api to 2.7.0
29
+ - Updated iris-app to 2.8.0
30
+
31
+ ## 1.4.68 (2026-09-28)
32
+
33
+ ### 🧱 Updated Dependencies
34
+
35
+ - Updated iris-app-build-utilities to 2.4.66
36
+ - Updated iris-app-api to 2.6.13
37
+ - Updated iris-app to 2.7.10
38
+
39
+ ## 1.4.67 (2026-09-25)
40
+
41
+ ### 🧱 Updated Dependencies
42
+
43
+ - Updated iris-app-build-utilities to 2.4.65
44
+ - Updated iris-app to 2.7.9
45
+
46
+ ## 1.4.66 (2026-09-25)
47
+
48
+ ### 🧱 Updated Dependencies
49
+
50
+ - Updated iris-app-build-utilities to 2.4.64
51
+ - Updated iris-app-api to 2.6.12
52
+ - Updated iris-app to 2.7.8
53
+
54
+ ## 1.4.65 (2026-09-24)
55
+
56
+ ### 🧱 Updated Dependencies
57
+
58
+ - Updated iris-app-build-utilities to 2.4.63
59
+ - Updated iris-app-api to 2.6.11
60
+ - Updated iris-app to 2.7.7
61
+
62
+ ## 1.4.64 (2026-09-24)
63
+
64
+ ### 🧱 Updated Dependencies
65
+
66
+ - Updated iris-app-build-utilities to 2.4.62
67
+ - Updated iris-app-api to 2.6.10
68
+ - Updated iris-app to 2.7.6
69
+
70
+ ## 1.4.63 (2026-09-22)
71
+
72
+ ### 🧱 Updated Dependencies
73
+
74
+ - Updated iris-app-build-utilities to 2.4.61
75
+ - Updated iris-app-api to 2.6.9
76
+ - Updated iris-app to 2.7.5
77
+
78
+ ## 1.4.62 (2026-09-22)
79
+
80
+ ### 🧱 Updated Dependencies
81
+
82
+ - Updated iris-app-build-utilities to 2.4.60
83
+ - Updated iris-app-api to 2.6.8
84
+ - Updated iris-app to 2.7.4
85
+
86
+ ## 1.4.61 (2026-09-21)
87
+
88
+ ### 🧱 Updated Dependencies
89
+
90
+ - Updated iris-app-build-utilities to 2.4.59
91
+ - Updated iris-app-api to 2.6.7
92
+ - Updated iris-app to 2.7.3
93
+
94
+ ## 1.4.60 (2026-09-21)
95
+
96
+ ### 🧱 Updated Dependencies
97
+
98
+ - Updated iris-app-build-utilities to 2.4.58
99
+ - Updated iris-app-api to 2.6.6
100
+ - Updated iris-app to 2.7.2
101
+
1
102
  ## 1.4.59 (2026-09-17)
2
103
 
3
104
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-sdk-vite",
3
- "version": "1.5.1-alpha-f60e0f7c192.0",
3
+ "version": "1.5.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "executors": "./executors.json",
@@ -10,8 +10,8 @@
10
10
  "dependencies": {
11
11
  "rxjs": "7.8.1",
12
12
  "win-ca": "^3.5.1",
13
- "@trackunit/iris-app-build-utilities": "2.5.1-alpha-f60e0f7c192.0",
14
- "@trackunit/iris-app-api": "2.7.1-alpha-f60e0f7c192.0",
13
+ "@trackunit/iris-app-build-utilities": "2.5.2",
14
+ "@trackunit/iris-app-api": "2.7.2",
15
15
  "tslib": "^2.6.2",
16
16
  "vite": "8.2.2",
17
17
  "vite-tsconfig-paths": "^6.1.1",
@@ -22,7 +22,7 @@
22
22
  "@tailwindcss/postcss": "^4.1.18",
23
23
  "@vitejs/plugin-react-swc": "^4.3.2",
24
24
  "@nx/devkit": "23.1.0",
25
- "@trackunit/iris-app": "2.8.1-alpha-f60e0f7c192.0",
25
+ "@trackunit/iris-app": "2.8.3",
26
26
  "cross-keychain": "^1.1.0",
27
27
  "jwt-decode": "^3.1.2"
28
28
  },
@@ -50,7 +50,8 @@ async function* buildExecutor(options, context) {
50
50
  IrisAppManifest.sdkVersion = sdkVersion;
51
51
  }
52
52
  // Advisory: warn when past the content-inset cutoff without `p-content-space`.
53
- (0, iris_app_build_utilities_1.checkContentInsetAdoption)(sdkVersion, projectRootDir);
53
+ // Scoped to extension types the host inset actually covered (GLU-2353).
54
+ (0, iris_app_build_utilities_1.checkContentInsetAdoption)(sdkVersion, projectRootDir, IrisAppManifest.extensions, context.root);
54
55
  const defaultConfig = await (0, defaultViteConfig_1.getDefaultViteConfig)("production", context.root, projectRootDir, IrisAppManifest, context, {
55
56
  skipTypeChecking,
56
57
  });
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/vite/src/executors/build/executor.ts"],"names":[],"mappings":";;AAqCA,gCAoHC;;AAxJD,kDAAoD;AACpD,kFAI6C;AAC7C,2BAAwC;AACxC,+BAAqC;AACrC,+BAAkC;AAClC,2DAAqC;AACrC,kBAAgB;AAChB,kEAAkE;AAClE,4DAA4E;AAC5E,kEAA+D;AAQ/D,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,IA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,QAAQ,CAAC,GAAG,EAAE;QACf,KAAK,IAAA,oCAAmB,GAAE,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,IAAA,wBAAa,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/internal\";\nimport {\n checkContentInsetAdoption,\n checkPackageVersion,\n enableTsConfigPath,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { existsSync, rmSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\nimport \"win-ca\";\nimport { getDefaultViteConfig } from \"../utils/defaultViteConfig\";\nimport { closeManifestLoader, loadManifest } from \"../utils/manifestLoader\";\nimport { resolveSdkVersion } from \"../utils/resolveSdkVersion\";\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 with Vite.\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* buildExecutor(\n options: BuildExecutorSchema,\n context: ExecutorContext\n): AsyncGenerator<NodeBuildEvent> {\n await checkPackageVersion(false);\n const skipTypeChecking = options.skipTypeChecking ?? false;\n\n // eslint-disable-next-line @trackunit/no-typescript-assertion, @typescript-eslint/no-non-null-assertion\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n\n // The app's own `vite.config.ts` is pulled in with a CommonJS `require` below,\n // which needs the TypeScript require hooks and the workspace's path aliases.\n enableTsConfigPath({ projectRootDir, workspaceRoot: context.root });\n\n // `loadManifest` lives in the shared loader module so specs can intercept the\n // import via `vi.mock(\"../utils/manifestLoader\", ...)`. Previously the\n // manifest was imported in-line via `await import(manifestPath)`, which Node's\n // resolver could not satisfy against the synthetic `/workspace/...` paths used\n // by the spec - the import threw before the spec's beforeEach `vi.mock(...)`\n // had any chance to intercept it.\n const IrisAppManifest = await loadManifest(context.root, projectRootDir);\n\n // Stamp the *installed* `@trackunit/iris-app` version (not the declared\n // range) so the host can decide content-inset behaviour from the published\n // manifest. Fail-soft: absent version keeps the legacy-inset default.\n const sdkVersion = resolveSdkVersion(projectRootDir);\n if (sdkVersion !== undefined) {\n IrisAppManifest.sdkVersion = sdkVersion;\n }\n // Advisory: warn when past the content-inset cutoff without `p-content-space`.\n checkContentInsetAdoption(sdkVersion, projectRootDir);\n\n const defaultConfig = await getDefaultViteConfig(\n \"production\",\n context.root,\n projectRootDir,\n IrisAppManifest,\n context,\n {\n skipTypeChecking,\n }\n );\n\n // Load optional custom config\n let finalConfig = defaultConfig;\n if (options.viteConfig || existsSync(join(projectRootDir, \"vite.config.ts\"))) {\n const customConfigFile = await import(options.viteConfig ?? join(projectRootDir, \"vite.config.ts\"));\n let customConfig = customConfigFile.default(defaultConfig);\n const isPromise = customConfig instanceof Promise;\n if (isPromise) {\n customConfig = await customConfig;\n }\n finalConfig = customConfig;\n }\n\n // Set output path\n finalConfig.build = {\n ...finalConfig.build,\n outDir: resolve(context.root, options.outputPath),\n emptyOutDir: true,\n };\n\n // Delete existing output\n deleteOutputDir(context.root, options.outputPath);\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using Vite config\", JSON.stringify(finalConfig.plugins, null, 2));\n }\n\n const observable = new Observable<NodeBuildEvent>(subscriber => {\n void (async () => {\n try {\n const { build } = await import(\"vite\");\n\n const buildResult = await build({ ...finalConfig, configFile: false });\n\n // Log build stats if available\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Build completed:\", buildResult);\n }\n\n subscriber.next({\n success: true,\n outfile: resolve(context.root, options.outputPath),\n });\n subscriber.complete();\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Vite build error:\", error);\n subscriber.next({\n success: false,\n outfile: resolve(context.root, options.outputPath),\n });\n subscriber.complete();\n }\n })();\n }).pipe(\n op.tap(({ success, outfile }) => {\n if (success) {\n // eslint-disable-next-line no-console\n console.info(`\\n ✅ Iris App build completed: ${outfile}\\n`);\n } else {\n // eslint-disable-next-line no-console\n console.error(`\\n ❌ Iris App build failed\\n`);\n }\n }),\n // The loader holds a Vite server open; without this the process never exits.\n op.finalize(() => {\n void closeManifestLoader();\n })\n );\n\n return yield* eachValueFrom(observable);\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/vite/src/executors/build/executor.ts"],"names":[],"mappings":";;AAqCA,gCAqHC;;AAzJD,kDAAoD;AACpD,kFAI6C;AAC7C,2BAAwC;AACxC,+BAAqC;AACrC,+BAAkC;AAClC,2DAAqC;AACrC,kBAAgB;AAChB,kEAAkE;AAClE,4DAA4E;AAC5E,kEAA+D;AAQ/D,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,CAAC,aAAa,CAC1C,OAA4B,EAC5B,OAAwB;IAExB,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IAC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kB,EAAE,WAAW,CAAC,CAAC;gBAC/C,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACd,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;iBACnD,CAAC,CAAC;gBACH,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;gBAC1C,UAAU,CAAC,IAAI,CAAC;oBACd,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;iBACnD,CAAC,CAAC;gBACH,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,CAAC,CAAC,IAAI,CACL,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC9B,IAAI,OAAO,EAAE,CAAC;YACZ,sCAAsC;YACtC,OAAO,CAAC,IAAI,CAAC,mCAAmC,OAAO,IAAI,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC;IACF,6EAA6E;IAC7E,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE;QACf,KAAK,IAAA,oCAAmB,GAAE,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,IAAA,wBAAa,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/internal\";\nimport {\n checkContentInsetAdoption,\n checkPackageVersion,\n enableTsConfigPath,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { existsSync, rmSync } from \"fs\";\nimport { join, resolve } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\nimport \"win-ca\";\nimport { getDefaultViteConfig } from \"../utils/defaultViteConfig\";\nimport { closeManifestLoader, loadManifest } from \"../utils/manifestLoader\";\nimport { resolveSdkVersion } from \"../utils/resolveSdkVersion\";\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 with Vite.\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* buildExecutor(\n options: BuildExecutorSchema,\n context: ExecutorContext\n): AsyncGenerator<NodeBuildEvent> {\n await checkPackageVersion(false);\n const skipTypeChecking = options.skipTypeChecking ?? false;\n\n // eslint-disable-next-line @trackunit/no-typescript-assertion, @typescript-eslint/no-non-null-assertion\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n\n // The app's own `vite.config.ts` is pulled in with a CommonJS `require` below,\n // which needs the TypeScript require hooks and the workspace's path aliases.\n enableTsConfigPath({ projectRootDir, workspaceRoot: context.root });\n\n // `loadManifest` lives in the shared loader module so specs can intercept the\n // import via `vi.mock(\"../utils/manifestLoader\", ...)`. Previously the\n // manifest was imported in-line via `await import(manifestPath)`, which Node's\n // resolver could not satisfy against the synthetic `/workspace/...` paths used\n // by the spec - the import threw before the spec's beforeEach `vi.mock(...)`\n // had any chance to intercept it.\n const IrisAppManifest = await loadManifest(context.root, projectRootDir);\n\n // Stamp the *installed* `@trackunit/iris-app` version (not the declared\n // range) so the host can decide content-inset behaviour from the published\n // manifest. Fail-soft: absent version keeps the legacy-inset default.\n const sdkVersion = resolveSdkVersion(projectRootDir);\n if (sdkVersion !== undefined) {\n IrisAppManifest.sdkVersion = sdkVersion;\n }\n // Advisory: warn when past the content-inset cutoff without `p-content-space`.\n // Scoped to extension types the host inset actually covered (GLU-2353).\n checkContentInsetAdoption(sdkVersion, projectRootDir, IrisAppManifest.extensions, context.root);\n\n const defaultConfig = await getDefaultViteConfig(\n \"production\",\n context.root,\n projectRootDir,\n IrisAppManifest,\n context,\n {\n skipTypeChecking,\n }\n );\n\n // Load optional custom config\n let finalConfig = defaultConfig;\n if (options.viteConfig || existsSync(join(projectRootDir, \"vite.config.ts\"))) {\n const customConfigFile = await import(options.viteConfig ?? join(projectRootDir, \"vite.config.ts\"));\n let customConfig = customConfigFile.default(defaultConfig);\n const isPromise = customConfig instanceof Promise;\n if (isPromise) {\n customConfig = await customConfig;\n }\n finalConfig = customConfig;\n }\n\n // Set output path\n finalConfig.build = {\n ...finalConfig.build,\n outDir: resolve(context.root, options.outputPath),\n emptyOutDir: true,\n };\n\n // Delete existing output\n deleteOutputDir(context.root, options.outputPath);\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using Vite config\", JSON.stringify(finalConfig.plugins, null, 2));\n }\n\n const observable = new Observable<NodeBuildEvent>(subscriber => {\n void (async () => {\n try {\n const { build } = await import(\"vite\");\n\n const buildResult = await build({ ...finalConfig, configFile: false });\n\n // Log build stats if available\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Build completed:\", buildResult);\n }\n\n subscriber.next({\n success: true,\n outfile: resolve(context.root, options.outputPath),\n });\n subscriber.complete();\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Vite build error:\", error);\n subscriber.next({\n success: false,\n outfile: resolve(context.root, options.outputPath),\n });\n subscriber.complete();\n }\n })();\n }).pipe(\n op.tap(({ success, outfile }) => {\n if (success) {\n // eslint-disable-next-line no-console\n console.info(`\\n ✅ Iris App build completed: ${outfile}\\n`);\n } else {\n // eslint-disable-next-line no-console\n console.error(`\\n ❌ Iris App build failed\\n`);\n }\n }),\n // The loader holds a Vite server open; without this the process never exits.\n op.finalize(() => {\n void closeManifestLoader();\n })\n );\n\n return yield* eachValueFrom(observable);\n}\n"]}
@@ -45,7 +45,8 @@ async function* serveExecutor(options, context) {
45
45
  irisAppManifest.sdkVersion = sdkVersion;
46
46
  }
47
47
  // Advisory: warn when past the content-inset cutoff without `p-content-space`.
48
- (0, iris_app_build_utilities_1.checkContentInsetAdoption)(sdkVersion, projectRootDir);
48
+ // Scoped to extension types the host inset actually covered (GLU-2353).
49
+ (0, iris_app_build_utilities_1.checkContentInsetAdoption)(sdkVersion, projectRootDir, irisAppManifest.extensions, context.root);
49
50
  const checkCustomFieldsResult = await (0, checkCustomFields_1.checkCustomFields)(irisAppManifest, settings);
50
51
  if (checkCustomFieldsResult === "out-of-sync") {
51
52
  throw new Error("Custom fields are out of sync with the latest approved manifest, which can cause the app to behave in unexpected ways. Please submit and get this version approved before you continue developing the app.");
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/vite/src/executors/serve/executor.ts"],"names":[],"mappings":";;AA6BA,gCAyJC;;AArLD,kDAAoD;AACpD,kDAAkD;AAElD,kFAK6C;AAC7C,2BAAgC;AAChC,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AACrC,kBAAgB;AAChB,kEAA+D;AAC/D,kEAAkE;AAClE,4DAA4E;AAC5E,kEAA+D;AAI/D;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,CAAC,aAAa,CAC1C,OAA4B,EAC5B,OAAwB;IAExB,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAA,sBAAW,GAAE,CAAC;IAC/B,MAAM,gBAAgB,G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AK,CAAC,CAAC;oBAC3C,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,EAAE,CAAC;YAEL,OAAO,GAAG,EAAE;gBACV,6DAA6D;YAC/D,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CACL,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,0CAA0C,OAAO,kBAAkB,eAAe,CAAC,oBAAoB,IAAI,CAC5G,CAAC;QACJ,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YAChC,OAAO;YACP,OAAO;SACR,CAAC,CAAC,EACH,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE;YACf,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC3B,KAAK,IAAA,oCAAmB,GAAE,CAAC;QAC7B,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,KAAK,CAAC,CAAC,IAAA,wBAAa,EAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAA,oCAAmB,GAAE,CAAC;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/internal\";\nimport { getSettings } from \"@trackunit/iris-app\";\nimport { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n checkContentInsetAdoption,\n checkPackageVersion,\n enableTsConfigPath,\n spawnServersideExtensions,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { existsSync } from \"fs\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\nimport \"win-ca\";\nimport { checkCustomFields } from \"../utils/checkCustomFields\";\nimport { getDefaultViteConfig } from \"../utils/defaultViteConfig\";\nimport { closeManifestLoader, loadManifest } from \"../utils/manifestLoader\";\nimport { resolveSdkVersion } from \"../utils/resolveSdkVersion\";\nimport { ServeExecutorSchema } from \"./schema\";\ntype ServeResult = { baseUrl: string; success: boolean };\n\n/**\n * Serve executor for serving Iris Apps with Vite.\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 {ServeResult} the serve result\n */\nexport default async function* serveExecutor(\n options: ServeExecutorSchema,\n context: ExecutorContext\n): AsyncGenerator<ServeResult> {\n await checkPackageVersion(false);\n const settings = getSettings();\n const skipTypeChecking = options.skipTypeChecking ?? false;\n\n // eslint-disable-next-line @trackunit/no-typescript-assertion, @typescript-eslint/no-non-null-assertion\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n\n // The app's own `vite.config.ts` is pulled in with a CommonJS `require` below,\n // which needs the TypeScript require hooks and the workspace's path aliases.\n enableTsConfigPath({ projectRootDir, workspaceRoot: context.root });\n\n // `loadManifest` lives in the shared loader module so specs can intercept the\n // import via `vi.mock(\"../utils/manifestLoader\", ...)`. Previously the\n // manifest was imported in-line via `await import(manifestPath)`, which Node's\n // resolver could not satisfy against the synthetic `/workspace/...` paths used\n // by the spec - the import threw before the spec's beforeEach `vi.mock(...)`\n // had any chance to intercept it.\n const irisAppManifest: IrisAppManifest = await loadManifest(context.root, projectRootDir);\n\n // Stamp the installed SDK version so serve's published /manifest.json matches\n // production builds (plugin also refreshes on emit after disk reloads).\n const sdkVersion = resolveSdkVersion(projectRootDir);\n if (sdkVersion !== undefined) {\n irisAppManifest.sdkVersion = sdkVersion;\n }\n // Advisory: warn when past the content-inset cutoff without `p-content-space`.\n checkContentInsetAdoption(sdkVersion, projectRootDir);\n\n const checkCustomFieldsResult = await checkCustomFields(irisAppManifest, settings);\n if (checkCustomFieldsResult === \"out-of-sync\") {\n throw new Error(\n \"Custom fields are out of sync with the latest approved manifest, which can cause the app to behave in unexpected ways. Please submit and get this version approved before you continue developing the app.\"\n );\n }\n if (checkCustomFieldsResult === \"not-submitted\") {\n throw new Error(\n \"Custom fields are not submitted, which can cause the app to behave in unexpected ways. Please submit and get this version approved before you continue developing the app.\"\n );\n }\n if (checkCustomFieldsResult === \"unverified\") {\n // The check could not be completed (network/auth/server failure). This is\n // non-fatal for local development: warn loudly and continue serving rather\n // than crashing. The underlying reason was already logged by checkCustomFields.\n // eslint-disable-next-line no-console\n console.warn(\n \"\\n ⚠️ Custom-field in-sync check was skipped — the latest approved manifest could not be verified \" +\n \"(see the warning above). The dev server will start, but your custom fields were NOT validated against the approved manifest. \" +\n \"If your local custom field definitions are out of sync, the app may behave in unexpected ways.\\n\"\n );\n }\n\n const serversideResult = await spawnServersideExtensions(irisAppManifest, context.root);\n\n try {\n // Get default config (internally imports @trackunit/iris-app-vite-plugin)\n const defaultConfig = await getDefaultViteConfig(\n \"development\",\n context.root,\n projectRootDir,\n irisAppManifest,\n context,\n {\n serversidePortMap: serversideResult.portMap,\n skipTypeChecking,\n // Surface a persistent rebuild reminder when the in-sync check was skipped.\n degraded: checkCustomFieldsResult === \"unverified\",\n }\n );\n\n // Load optional custom config\n let finalConfig = defaultConfig;\n if (options.viteConfig || existsSync(join(projectRootDir, \"vite.config.ts\"))) {\n const customConfigFile = await import(options.viteConfig ?? join(projectRootDir, \"vite.config.ts\"));\n let customConfig = customConfigFile.default(defaultConfig);\n const isPromise = customConfig instanceof Promise;\n if (isPromise) {\n customConfig = await customConfig;\n }\n finalConfig = customConfig;\n }\n\n // Apply port override if specified\n if (options.port !== undefined) {\n finalConfig.server = { ...finalConfig.server, port: options.port };\n }\n if (options.host) {\n finalConfig.server = { ...finalConfig.server, host: options.host };\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using Vite config\", JSON.stringify(finalConfig.plugins, null, 2));\n }\n\n // Create and start Vite dev server\n const observable = new Observable<{ baseUrl: string; success: boolean }>(subscriber => {\n void (async () => {\n try {\n // Dynamic import vite to avoid issues\n const { createServer } = await import(\"vite\");\n\n const server = await createServer({ ...finalConfig, configFile: false });\n await server.listen();\n\n const address = server.httpServer?.address();\n const port = typeof address === \"object\" && address !== null ? address.port : (options.port ?? 22220);\n const host = options.host ?? \"localhost\";\n const baseUrl = `http://${host}:${port}`;\n\n subscriber.next({\n baseUrl,\n success: true,\n });\n\n // Keep alive - server continues running until interrupted\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Vite server error:\", error);\n subscriber.error(error);\n }\n })();\n\n return () => {\n // Cleanup on unsubscribe - handled by Vite's signal handling\n };\n }).pipe(\n op.tap(({ baseUrl }) => {\n // eslint-disable-next-line no-console\n console.info(\n `\\n 🚀 Iris App dev server running at: ${baseUrl} for iris app: ${irisAppManifest.moduleFederationName}\\n`\n );\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n })),\n op.finalize(() => {\n serversideResult.cleanup();\n void closeManifestLoader();\n })\n );\n\n return yield* eachValueFrom(observable);\n } catch (error) {\n serversideResult.cleanup();\n await closeManifestLoader();\n throw error;\n }\n}\n"]}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/vite/src/executors/serve/executor.ts"],"names":[],"mappings":";;AA6BA,gCA0JC;;AAtLD,kDAAoD;AACpD,kDAAkD;AAElD,kFAK6C;AAC7C,2BAAgC;AAChC,+BAA4B;AAC5B,+BAAkC;AAClC,2DAAqC;AACrC,kBAAgB;AAChB,kEAA+D;AAC/D,kEAAkE;AAClE,4DAA4E;AAC5E,kEAA+D;AAI/D;;;;;;GAMG;AACY,KAAK,SAAS,CAAC,CAAC,aAAa,CAC1C,OAA4B,EAC5B,OAAwB;IAExB,MAAM,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAA,sBAAW,GAA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gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,sCAAsC;oBACtC,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;oBAC3C,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,EAAE,CAAC;YAEL,OAAO,GAAG,EAAE;gBACV,6DAA6D;YAC/D,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CACL,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,0CAA0C,OAAO,kBAAkB,eAAe,CAAC,oBAAoB,IAAI,CAC5G,CAAC;QACJ,CAAC,CAAC,EACF,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YAChC,OAAO;YACP,OAAO;SACR,CAAC,CAAC,EACH,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE;YACf,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC3B,KAAK,IAAA,oCAAmB,GAAE,CAAC;QAC7B,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,KAAK,CAAC,CAAC,IAAA,wBAAa,EAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAA,oCAAmB,GAAE,CAAC;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { ExecutorContext } from \"@nx/devkit\";\nimport { eachValueFrom } from \"@nx/devkit/internal\";\nimport { getSettings } from \"@trackunit/iris-app\";\nimport { IrisAppManifest } from \"@trackunit/iris-app-api\";\nimport {\n checkContentInsetAdoption,\n checkPackageVersion,\n enableTsConfigPath,\n spawnServersideExtensions,\n} from \"@trackunit/iris-app-build-utilities\";\nimport { existsSync } from \"fs\";\nimport { join } from \"path\";\nimport { Observable } from \"rxjs\";\nimport * as op from \"rxjs/operators\";\nimport \"win-ca\";\nimport { checkCustomFields } from \"../utils/checkCustomFields\";\nimport { getDefaultViteConfig } from \"../utils/defaultViteConfig\";\nimport { closeManifestLoader, loadManifest } from \"../utils/manifestLoader\";\nimport { resolveSdkVersion } from \"../utils/resolveSdkVersion\";\nimport { ServeExecutorSchema } from \"./schema\";\ntype ServeResult = { baseUrl: string; success: boolean };\n\n/**\n * Serve executor for serving Iris Apps with Vite.\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 {ServeResult} the serve result\n */\nexport default async function* serveExecutor(\n options: ServeExecutorSchema,\n context: ExecutorContext\n): AsyncGenerator<ServeResult> {\n await checkPackageVersion(false);\n const settings = getSettings();\n const skipTypeChecking = options.skipTypeChecking ?? false;\n\n // eslint-disable-next-line @trackunit/no-typescript-assertion, @typescript-eslint/no-non-null-assertion\n const projectRoot = context.projectsConfigurations.projects[context.projectName!]!.root;\n const projectRootDir = join(context.root, projectRoot);\n\n // The app's own `vite.config.ts` is pulled in with a CommonJS `require` below,\n // which needs the TypeScript require hooks and the workspace's path aliases.\n enableTsConfigPath({ projectRootDir, workspaceRoot: context.root });\n\n // `loadManifest` lives in the shared loader module so specs can intercept the\n // import via `vi.mock(\"../utils/manifestLoader\", ...)`. Previously the\n // manifest was imported in-line via `await import(manifestPath)`, which Node's\n // resolver could not satisfy against the synthetic `/workspace/...` paths used\n // by the spec - the import threw before the spec's beforeEach `vi.mock(...)`\n // had any chance to intercept it.\n const irisAppManifest: IrisAppManifest = await loadManifest(context.root, projectRootDir);\n\n // Stamp the installed SDK version so serve's published /manifest.json matches\n // production builds (plugin also refreshes on emit after disk reloads).\n const sdkVersion = resolveSdkVersion(projectRootDir);\n if (sdkVersion !== undefined) {\n irisAppManifest.sdkVersion = sdkVersion;\n }\n // Advisory: warn when past the content-inset cutoff without `p-content-space`.\n // Scoped to extension types the host inset actually covered (GLU-2353).\n checkContentInsetAdoption(sdkVersion, projectRootDir, irisAppManifest.extensions, context.root);\n\n const checkCustomFieldsResult = await checkCustomFields(irisAppManifest, settings);\n if (checkCustomFieldsResult === \"out-of-sync\") {\n throw new Error(\n \"Custom fields are out of sync with the latest approved manifest, which can cause the app to behave in unexpected ways. Please submit and get this version approved before you continue developing the app.\"\n );\n }\n if (checkCustomFieldsResult === \"not-submitted\") {\n throw new Error(\n \"Custom fields are not submitted, which can cause the app to behave in unexpected ways. Please submit and get this version approved before you continue developing the app.\"\n );\n }\n if (checkCustomFieldsResult === \"unverified\") {\n // The check could not be completed (network/auth/server failure). This is\n // non-fatal for local development: warn loudly and continue serving rather\n // than crashing. The underlying reason was already logged by checkCustomFields.\n // eslint-disable-next-line no-console\n console.warn(\n \"\\n ⚠️ Custom-field in-sync check was skipped — the latest approved manifest could not be verified \" +\n \"(see the warning above). The dev server will start, but your custom fields were NOT validated against the approved manifest. \" +\n \"If your local custom field definitions are out of sync, the app may behave in unexpected ways.\\n\"\n );\n }\n\n const serversideResult = await spawnServersideExtensions(irisAppManifest, context.root);\n\n try {\n // Get default config (internally imports @trackunit/iris-app-vite-plugin)\n const defaultConfig = await getDefaultViteConfig(\n \"development\",\n context.root,\n projectRootDir,\n irisAppManifest,\n context,\n {\n serversidePortMap: serversideResult.portMap,\n skipTypeChecking,\n // Surface a persistent rebuild reminder when the in-sync check was skipped.\n degraded: checkCustomFieldsResult === \"unverified\",\n }\n );\n\n // Load optional custom config\n let finalConfig = defaultConfig;\n if (options.viteConfig || existsSync(join(projectRootDir, \"vite.config.ts\"))) {\n const customConfigFile = await import(options.viteConfig ?? join(projectRootDir, \"vite.config.ts\"));\n let customConfig = customConfigFile.default(defaultConfig);\n const isPromise = customConfig instanceof Promise;\n if (isPromise) {\n customConfig = await customConfig;\n }\n finalConfig = customConfig;\n }\n\n // Apply port override if specified\n if (options.port !== undefined) {\n finalConfig.server = { ...finalConfig.server, port: options.port };\n }\n if (options.host) {\n finalConfig.server = { ...finalConfig.server, host: options.host };\n }\n\n if (context.isVerbose) {\n // eslint-disable-next-line no-console\n console.log(\"Using Vite config\", JSON.stringify(finalConfig.plugins, null, 2));\n }\n\n // Create and start Vite dev server\n const observable = new Observable<{ baseUrl: string; success: boolean }>(subscriber => {\n void (async () => {\n try {\n // Dynamic import vite to avoid issues\n const { createServer } = await import(\"vite\");\n\n const server = await createServer({ ...finalConfig, configFile: false });\n await server.listen();\n\n const address = server.httpServer?.address();\n const port = typeof address === \"object\" && address !== null ? address.port : (options.port ?? 22220);\n const host = options.host ?? \"localhost\";\n const baseUrl = `http://${host}:${port}`;\n\n subscriber.next({\n baseUrl,\n success: true,\n });\n\n // Keep alive - server continues running until interrupted\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Vite server error:\", error);\n subscriber.error(error);\n }\n })();\n\n return () => {\n // Cleanup on unsubscribe - handled by Vite's signal handling\n };\n }).pipe(\n op.tap(({ baseUrl }) => {\n // eslint-disable-next-line no-console\n console.info(\n `\\n 🚀 Iris App dev server running at: ${baseUrl} for iris app: ${irisAppManifest.moduleFederationName}\\n`\n );\n }),\n op.map(({ baseUrl, success }) => ({\n baseUrl,\n success,\n })),\n op.finalize(() => {\n serversideResult.cleanup();\n void closeManifestLoader();\n })\n );\n\n return yield* eachValueFrom(observable);\n } catch (error) {\n serversideResult.cleanup();\n await closeManifestLoader();\n throw error;\n }\n}\n"]}