Only CSS and other non-script, non-JSON exports should be excluded from
typesVersions. The package.json export still needs to be included.
Also preserves field order when updating existing typesVersions.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add deduplication logic to only emit CSS once per output directory
- Only emit during write phase, not during generate
- Fix comment describing the path transformation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Instead of having a separate post-build step for CSS entry points,
the CSS bundling is now integrated directly into the Rollup build
as a plugin. This is cleaner and will enable better watch mode
support in the future.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
postcss-import naturally preserves @layer declarations during bundling,
eliminating the need for custom layer parsing and restoration logic.
This simplifies the implementation while also preserving source comments.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This adds support for CSS entry points in package exports. When a package
declares a CSS file in its exports field, the CLI will now automatically
bundle it during `backstage-cli package build` and rewrite the export
path from src/ to dist/ at publish time.
The CSS bundling uses lightningcss to resolve @import statements and
preserves @layer declarations that would otherwise be stripped during
bundling.
This allows packages like @backstage/ui to use the standard build command
instead of custom build scripts for CSS bundling.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Added integrationFor field to BackstagePackageJson type
- Created fixIntegrationFor validator that ensures:
- Field is only used on module packages
- Value is an array of strings
- All entries are valid package names
- Added validator to the publish fixers list
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Replace the default path-based CSS module hash with a content-based
hash derived from the CSS content. This prevents class name collisions
when multiple versions of packages are loaded simultaneously.
Uses 10 characters of hex-encoded MD5 hash for safe, readable class
name suffixes.
Signed-off-by: Johan Persson <johanopersson@gmail.com>
Change the info command's JSON output to use an array of objects for
dependency versions instead of comma-separated strings, making the
format more parseable and extensible.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Renas <renash@spotify.com>