From d83debcafcb104759e20d365a4680c741c643409 Mon Sep 17 00:00:00 2001 From: Jeongkyu Shin Date: Thu, 6 Aug 2026 00:45:55 +0900 Subject: [PATCH] fix(build): do not treat a dependency stylesheet as one of this package's A bare specifier resolves to a path inside the package root, so the check that was meant to leave dependency stylesheets alone never fired. Nothing here imports one today, which is why it went unnoticed; the sibling package hit it immediately with katex. The specifier form now decides, so only relative and absolute paths are re-linked. --- CHANGELOG.md | 14 +++++++++++++- package.json | 2 +- vite.config.ts | 13 +++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b48999..bc4d995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ Versioning follows the policy in [CONTRIBUTING.md](CONTRIBUTING.md#versioning). ## [Unreleased] +## [0.1.0-alpha.5] + +### Fixed + +- The build no longer mistakes a dependency stylesheet for one of its own. A + bare specifier such as `katex/dist/katex.min.css` resolves to a path inside + the package root, so the check meant to leave dependencies alone never fired + and the build would stop on a stylesheet it was never meant to re-link. This + package has no such import yet; `@lablup/ui-ai` hit it while taking the same + fix. + ## [0.1.0-alpha.4] ### Added @@ -72,7 +83,8 @@ mid-migration. validation, and a clean external React install fixture. - Apache-2.0 license and the initial public boundary rules. -[Unreleased]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.4...HEAD +[Unreleased]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.5...HEAD +[0.1.0-alpha.5]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.4...v0.1.0-alpha.5 [0.1.0-alpha.4]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.3...v0.1.0-alpha.4 [0.1.0-alpha.3]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.2...v0.1.0-alpha.3 [0.1.0-alpha.2]: https://github.com/lablup/ui-common/compare/v0.1.0-alpha.1...v0.1.0-alpha.2 diff --git a/package.json b/package.json index a221e49..31ff531 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lablup/ui-common", - "version": "0.1.0-alpha.4", + "version": "0.1.0-alpha.5", "description": "Shared, product-neutral UI components and design tokens for Lablup products", "license": "Apache-2.0", "author": "Lablup Inc.", diff --git a/vite.config.ts b/vite.config.ts index 7d4c448..c49accb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -105,9 +105,18 @@ function linkComponentStyles(): Plugin { for (const imported of this.getModuleInfo(id)?.importedIds ?? []) { if (!imported.endsWith(".css")) continue; - const key = sourceKey(imported); // A stylesheet from a dependency stays a bare specifier that the - // consumer resolves; only this package's own files are re-linked. + // consumer resolves, and is already present in the output as one. + // Only this package's own files are re-linked. Deciding that on + // the specifier form rather than on where the path lands is what + // this package needs before it grows such an import: resolving a + // bare specifier against the root produces a path inside it, so + // the "outside the package" test never fires and the build stops + // on a stylesheet it was never meant to touch. `@lablup/ui-ai` + // found this the hard way with `katex/dist/katex.min.css`. + if (!imported.startsWith(".") && !isAbsolute(imported)) continue; + + const key = sourceKey(imported); if (key.startsWith("..")) continue; const emitted = emittedBySource.get(key);