@trackunit/iris-app-sdk-vite 1.6.1 → 1.6.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,17 @@
1
+ ## 1.6.3 (2026-10-01)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated iris-app to 2.10.0
6
+
7
+ ## 1.6.2 (2026-10-01)
8
+
9
+ ### 🧱 Updated Dependencies
10
+
11
+ - Updated iris-app-build-utilities to 2.6.2
12
+ - Updated iris-app-api to 2.8.2
13
+ - Updated iris-app to 2.9.2
14
+
1
15
  ## 1.6.1 (2026-10-01)
2
16
 
3
17
  ### 🧱 Updated Dependencies
package/README.md CHANGED
@@ -8,7 +8,7 @@ For more info and a full guide on Iris App SDK Development, please visit our [De
8
8
 
9
9
  ## Installation
10
10
 
11
- This package is included as part of the Iris App SDK. Run through the getting started guide here: [Getting Started](https://developers.trackunit.com/docs/getting-started)
11
+ This package is included as part of the Iris App SDK. Run through the getting started guide here: [Getting Started](https://developers.trackunit.com/docs/apps-and-extensions/overview/getting-started)
12
12
 
13
13
  ## Usage
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-sdk-vite",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "executors": "./executors.json",
@@ -10,20 +10,20 @@
10
10
  "dependencies": {
11
11
  "rxjs": "7.8.1",
12
12
  "win-ca": "^3.5.1",
13
- "@trackunit/iris-app-build-utilities": "2.6.1",
14
- "@trackunit/iris-app-api": "2.8.1",
13
+ "@trackunit/iris-app-build-utilities": "2.6.2",
14
+ "@trackunit/iris-app-api": "2.8.2",
15
15
  "tslib": "^2.6.2",
16
16
  "typescript": "6.0.2",
17
17
  "vite": "8.2.2",
18
18
  "vite-tsconfig-paths": "^6.1.1",
19
- "@module-federation/vite": "1.21.5",
19
+ "@module-federation/vite": "1.22.1",
20
20
  "vite-plugin-checker": "^0.12.0",
21
21
  "vite-plugin-css-injected-by-js": "5.0.2",
22
22
  "rollup-plugin-visualizer": "5.12.0",
23
23
  "@tailwindcss/postcss": "^4.1.18",
24
- "@vitejs/plugin-react-swc": "^4.3.2",
24
+ "@vitejs/plugin-react-swc": "^4.3.3",
25
25
  "@nx/devkit": "23.1.0",
26
- "@trackunit/iris-app": "2.9.1",
26
+ "@trackunit/iris-app": "2.10.0",
27
27
  "cross-keychain": "^1.1.0",
28
28
  "jwt-decode": "^3.1.2"
29
29
  },
@@ -16,6 +16,7 @@ const loadCssInjectedByJsPlugin_1 = require("./loadCssInjectedByJsPlugin");
16
16
  const manifestCache_1 = require("./manifestCache");
17
17
  const manifestLoader_1 = require("./manifestLoader");
18
18
  const resolveSdkVersion_1 = require("./resolveSdkVersion");
19
+ const tailwindSourcesPlugin_1 = require("./tailwindSourcesPlugin");
19
20
  // Only import enableTsConfigPath statically - other utilities are dynamically imported
20
21
  // AFTER tsconfig paths are registered to avoid oxc analysis warnings
21
22
  // MIME types for serving extension assets during development
@@ -677,6 +678,7 @@ async function getTrackunitIrisAppVitePlugins(options) {
677
678
  // are hot-swapped without a full page reload. Safe with Module Federation
678
679
  // because Iris apps bundle their own React (iframe isolation).
679
680
  (0, plugin_react_swc_1.default)({}),
681
+ (0, tailwindSourcesPlugin_1.createTailwindSourcesPlugin)({ rootDir: workspaceRoot }),
680
682
  hasExposes && disableHostAutoInitPlugin,
681
683
  federationPlugin,
682
684
  !options.skipTypeChecking &&
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTailwindSourcesPlugin = exports.appendTailwindSources = exports.resolveTrackunitPackageDirectories = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const iris_app_build_utilities_1 = require("@trackunit/iris-app-build-utilities");
6
+ const node_fs_1 = require("node:fs");
7
+ const path = tslib_1.__importStar(require("node:path"));
8
+ const TAILWIND_ENTRY_PATTERN = /@import\s+["']tailwindcss[/"']/;
9
+ const CSS_MODULE_ID_PATTERN = /\.css(?:\?|$)/;
10
+ const readTrackunitDependencyNames = (directory, { includeDev }) => {
11
+ try {
12
+ const manifest = JSON.parse((0, node_fs_1.readFileSync)(path.join(directory, "package.json"), "utf8"));
13
+ return Object.keys({ ...manifest.dependencies, ...(includeDev ? manifest.devDependencies : {}) }).filter(name => name.startsWith("@trackunit/"));
14
+ }
15
+ catch {
16
+ return [];
17
+ }
18
+ };
19
+ /**
20
+ * Finds a package like node resolution does: the nearest `node_modules` above `fromDir`.
21
+ * Returns the real path, so symlinked (pnpm-style) installs point at the actual package.
22
+ */
23
+ const findPackageDirectory = (packageName, fromDir) => {
24
+ const candidate = path.join(fromDir, "node_modules", packageName);
25
+ if ((0, node_fs_1.existsSync)(path.join(candidate, "package.json"))) {
26
+ return (0, node_fs_1.realpathSync)(candidate);
27
+ }
28
+ const parentDir = path.dirname(fromDir);
29
+ return parentDir === fromDir ? undefined : findPackageDirectory(packageName, parentDir);
30
+ };
31
+ /**
32
+ * Collects every `@trackunit/*` package reachable from `rootDir/package.json`, including the ones
33
+ * that are only installed as a dependency of another package.
34
+ */
35
+ const resolveTrackunitPackageDirectories = ({ rootDir, }) => {
36
+ const queue = readTrackunitDependencyNames(rootDir, { includeDev: true }).map(name => ({ name, fromDir: rootDir }));
37
+ const directories = new Set();
38
+ const unresolved = new Set();
39
+ // Dependencies found below are appended to `queue`, so this same loop visits them too.
40
+ for (const { name, fromDir } of queue) {
41
+ const directory = findPackageDirectory(name, fromDir);
42
+ if (directory === undefined) {
43
+ unresolved.add(name);
44
+ }
45
+ else if (!directories.has(directory)) {
46
+ directories.add(directory);
47
+ queue.push(...readTrackunitDependencyNames(directory, { includeDev: false }).map(dep => ({
48
+ name: dep,
49
+ fromDir: directory,
50
+ })));
51
+ }
52
+ }
53
+ return { directories: [...directories].toSorted(), unresolved: [...unresolved].toSorted() };
54
+ };
55
+ exports.resolveTrackunitPackageDirectories = resolveTrackunitPackageDirectories;
56
+ /**
57
+ * Appends a Tailwind `@source` directive per directory to a stylesheet that imports `tailwindcss`.
58
+ * Any other stylesheet is returned unchanged.
59
+ */
60
+ const appendTailwindSources = (css, directories) => {
61
+ if (directories.length === 0 || !TAILWIND_ENTRY_PATTERN.test(css)) {
62
+ return css;
63
+ }
64
+ const directives = directories.map(directory => `@source "${directory.replaceAll("\\", "/")}/**/*.{ts,tsx,js,jsx,css}";`);
65
+ return `${css}\n${directives.join("\n")}\n`;
66
+ };
67
+ exports.appendTailwindSources = appendTailwindSources;
68
+ /**
69
+ * Makes Tailwind scan every installed `@trackunit/*` package, not only the ones in the top-level
70
+ * `node_modules/@trackunit/`. Tailwind cannot glob into a nested `node_modules`, so a package that is only
71
+ * a dependency of another package would otherwise lose its classes.
72
+ */
73
+ const createTailwindSourcesPlugin = ({ rootDir }) => {
74
+ const { directories, unresolved } = (0, exports.resolveTrackunitPackageDirectories)({ rootDir });
75
+ if (unresolved.length > 0) {
76
+ (0, iris_app_build_utilities_1.logWarning)(`Could not find these @trackunit packages in node_modules, so their Tailwind classes may be missing: ${unresolved.join(", ")}`);
77
+ }
78
+ return {
79
+ name: "trackunit-tailwind-sources",
80
+ // Must run before Vite's own CSS pipeline, which is what hands the stylesheet to Tailwind.
81
+ enforce: "pre",
82
+ transform(code, id) {
83
+ const withSources = CSS_MODULE_ID_PATTERN.test(id) ? (0, exports.appendTailwindSources)(code, directories) : code;
84
+ return withSources === code ? null : { code: withSources, map: null };
85
+ },
86
+ };
87
+ };
88
+ exports.createTailwindSourcesPlugin = createTailwindSourcesPlugin;
89
+ //# sourceMappingURL=tailwindSourcesPlugin.js.map