Refactor/styles separate css#135
Open
SharonStrats wants to merge 12 commits intofeature/add-dev-envfrom
Open
Conversation
This reverts commit 29ffe34.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Source Pane to move UI styling out of inline JS into dedicated CSS, and introduces a Webpack-based build/dev setup so the package can ship compiled artifacts (with CSS handling) under lib/.
Changes:
- Refactor
src/sourcePane.jsto ES module syntax, import CSS, and replace inline styling with CSS classes insrc/styles/sourcePane.css. - Add Webpack configs (prod + dev) plus Babel config to build
lib/source-pane(.min).jsand support local dev viawebpack-dev-server. - Update Jest setup with module mappers/mocks for CSS and
solid-ui, and adjust tests/helpers for the new module format.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/sourcePane.js |
Switch to ESM, import CSS, and replace inline visibility/color styling with class toggles. |
src/styles/sourcePane.css |
New stylesheet for Source Pane layout and state/visibility styling. |
webpack.module.rules.mjs |
Centralize loader rules for JS/TS, CSS, CSS modules, and TTL assets. |
webpack.config.mjs |
Production build to lib/ (UMD) with minified variant and styles copied to lib/styles. |
webpack.dev.config.mjs |
Dev-server configuration for local development with HTML template and polyfills. |
babel.config.mjs |
Babel preset config and TTL inline-import plugin configuration. |
package.json |
Publish/build changes: output in lib/, build scripts, CSS sideEffects, dev server script, new devDependencies. |
jest.config.mjs |
Update Jest module mapping for $rdf, solid-ui, and CSS imports. |
test/sourcePane.test.js |
Adjust import pattern to handle default export interop and reorganize result variable scope. |
test/helpers/setup.js |
Replace solid-logic store usage with an rdflib graph+Fetcher for tests. |
test/helpers/solidUiMock.js |
Add a minimal solid-ui mock (icons/widgets/ns) for DOM tests. |
test/helpers/styleMock.js |
Add CSS import mock for Jest. |
test/helpers/rdfMock.js |
Add $rdf mapper target for Jest (re-export rdflib). |
dev/index.js |
Add a local dev entry that loads a target URI and renders the pane. |
dev/index.html |
Add HTML template for the dev server. |
dev/dev-global.css |
Add local-only global CSS for dev UX. |
dev/context.js |
Add a dev context helper using solid-logic store/singleton. |
README.md |
Document AI-assisted refactor note. |
.gitignore |
Ignore lib/ build output. |
Comments suppressed due to low confidence (1)
test/sourcePane.test.js:12
resultis now shared across the siblingtext/turtle fileandtext/plain filedescribes. This can cause state leakage between suites (especially if additional tests are added later). Prefer scopingresultinside eachdescribe(or reinitializing it in eachbeforeEach) so each suite has its own isolated DOM.
describe("test button compact", () => {
let result
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: SolidOS/solidos#244
Tested in solid-panes using local source-pane.