feat: add generic flat bundles, replace bricks-branded bundle - #61
Conversation
Replace the single slashed.bricks.css flat bundle with a generic
*.flat.css sibling for each tier (essential, optimal,
optimal-components, optimal-utilities, full).
- bundle.config.json: five new flat:true entries; bricks entry removed
- package.json: ./bricks export removed; new ./flat and ./<tier>/flat
exports added (./optimal/flat is the same file set as the old bricks
bundle)
- scripts/bundle.js: stripLayerWrappers comment genericised
- dist/: stale slashed.bricks.* files removed; new
*.flat.{css,min.css,min.css.map} siblings emitted
📝 WalkthroughWalkthroughThe PR extends the bundle system with flattened CSS variants. Five new flat bundle configurations are added to ChangesFlat Bundle Outputs and Public Exports
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Around line 12-21: Add back a compatibility export for the removed subpath by
adding an exports entry for "./bricks" that points to the existing optimal flat
bundle; specifically add "./bricks": "./dist/slashed.optimal.flat.css" alongside
the current "./optimal/flat" -> "./dist/slashed.optimal.flat.css" mapping in
package.json exports so imports of "slashed/bricks" continue to resolve (you can
mark it deprecated in your release notes if desired).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c4417ca2-217e-4c6e-a491-9a995a15b0da
⛔ Files ignored due to path filters (27)
dist/slashed.bricks.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.essential.flat.cssis excluded by!**/dist/**dist/slashed.essential.flat.min.cssis excluded by!**/dist/**dist/slashed.essential.flat.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.essential.min.cssis excluded by!**/dist/**dist/slashed.essential.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.full.flat.cssis excluded by!**/dist/**dist/slashed.full.flat.min.cssis excluded by!**/dist/**dist/slashed.full.flat.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.full.min.cssis excluded by!**/dist/**dist/slashed.full.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal-components.flat.cssis excluded by!**/dist/**dist/slashed.optimal-components.flat.min.cssis excluded by!**/dist/**dist/slashed.optimal-components.flat.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal-components.min.cssis excluded by!**/dist/**dist/slashed.optimal-components.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal-utilities.flat.cssis excluded by!**/dist/**dist/slashed.optimal-utilities.flat.min.cssis excluded by!**/dist/**dist/slashed.optimal-utilities.flat.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal-utilities.min.cssis excluded by!**/dist/**dist/slashed.optimal-utilities.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal.flat.cssis excluded by!**/dist/**dist/slashed.optimal.flat.min.cssis excluded by!**/dist/**dist/slashed.optimal.flat.min.css.mapis excluded by!**/dist/**,!**/*.mapdist/slashed.optimal.min.cssis excluded by!**/dist/**dist/slashed.optimal.min.css.mapis excluded by!**/dist/**,!**/*.mappackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
bundle.config.jsonpackage.jsonscripts/bundle.js
| "./essential/flat": "./dist/slashed.essential.flat.css", | ||
| "./optimal": "./dist/slashed.optimal.css", | ||
| "./bricks": "./dist/slashed.bricks.css", | ||
| "./optimal/flat": "./dist/slashed.optimal.flat.css", | ||
| "./optimal-components": "./dist/slashed.optimal-components.css", | ||
| "./optimal-components/flat": "./dist/slashed.optimal-components.flat.css", | ||
| "./optimal-utilities": "./dist/slashed.optimal-utilities.css", | ||
| "./optimal-utilities/flat": "./dist/slashed.optimal-utilities.flat.css", | ||
| "./full": "./dist/slashed.full.css", | ||
| "./full/flat": "./dist/slashed.full.flat.css", | ||
| "./flat": "./dist/slashed.full.flat.css", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify export keys and check for existing references to the removed subpath.
python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
print("has ./bricks export:", "./bricks" in exports)
print("flat exports:", [k for k in exports if "flat" in k])
PY
# Internal references that may already rely on old path naming
rg -nP "slashed/bricks|['\"]\\./bricks['\"]|slashed\\.bricks\\.css" -g '!dist/**'Repository: codeslash-dev/SLASHED
Length of output: 227
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show relevant part of package.json around the exports map
python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
# Print keys in sorted order with their values (compact)
for k in sorted(exports.keys()):
if "bricks" in k or k.startswith("./") and ("flat" in k or k in ["./bricks","./optimal/flat","./flat"]):
print(k, "=>", exports[k])
PY
echo "---- package.json grep for bricks ----"
rg -n "bricks" package.json || true
echo "---- repo grep for bricks (excluding dist) ----"
rg -nP "slashed/bricks|['\"]\\./bricks['\"]|slashed\\.bricks\\.css" -g '!dist/**' || trueRepository: codeslash-dev/SLASHED
Length of output: 481
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
keys=list(exports.keys())
for i,k in enumerate(keys):
if k in ("./bricks","./core/*","./optional/*","./optimal/flat","./flat"):
print(i,k,"=>",exports[k])
PY
python - <<'PY'
# Print a small excerpt of the exports keys in order (best-effort)
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
keys=list(exports.keys())
for k in keys[:40]:
print(k,"=>",exports[k])
PYRepository: codeslash-dev/SLASHED
Length of output: 863
Preserve ./bricks as a compatibility export (or ship an intentional major breaking change).
Dropping the ./bricks subpath from package.json will break existing consumers importing slashed/bricks at resolution time. Add a deprecated alias pointing to the existing ./optimal/flat bundle (./dist/slashed.optimal.flat.css).
Suggested compatibility patch
"./full": "./dist/slashed.full.css",
"./full/flat": "./dist/slashed.full.flat.css",
"./flat": "./dist/slashed.full.flat.css",
+ "./bricks": "./dist/slashed.optimal.flat.css",
"./core/*": "./core/*",
"./optional/*": "./optional/*"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` around lines 12 - 21, Add back a compatibility export for the
removed subpath by adding an exports entry for "./bricks" that points to the
existing optimal flat bundle; specifically add "./bricks":
"./dist/slashed.optimal.flat.css" alongside the current "./optimal/flat" ->
"./dist/slashed.optimal.flat.css" mapping in package.json exports so imports of
"slashed/bricks" continue to resolve (you can mark it deprecated in your release
notes if desired).
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Adds generic
*.flat.cssbundles for every tier, replacing the single bricks-branded flat bundle.Bundles produced in
dist/slashed.essential.cssslashed.essential.flat.cssslashed.optimal.cssslashed.optimal.flat.cssslashed.optimal-components.cssslashed.optimal-components.flat.cssslashed.optimal-utilities.cssslashed.optimal-utilities.flat.cssslashed.full.cssslashed.full.flat.cssEach ships with
.min.css+.min.css.map. Same minifier config (lightningcss, no down-levelling).Consumer-facing API
What changed
bundle.config.json— five newflat: trueentries; bricks entry removed.package.json—./bricksexport removed; new./flatand./<tier>/flatexports added.scripts/bundle.js— comment instripLayerWrappersgenericised (no longer references Bricks Builder by name).dist/— staleslashed.bricks.*files removed; new*.flat.{css,min.css,min.css.map}siblings emitted.package-lock.json— incidental: lockfileversionfield synced to0.2.10(was drifting at0.2.5).Tested
node scripts/bundle.jsproduces all 10 layered + flat bundles cleanly.slashed.full.flat.csshas 0 top-level@layerdeclarations vs 17 inslashed.full.css— strip works as intended.Versioning
Lands as 0.2.11 under
.release-it.json's hardcoded"increment": "patch"+"ignoreRecommendedBump": true. Replaces #60.Summary by CodeRabbit
New Features
Chores
./bricksexport subpath.