Skip to content

feat: ship npm twin (@activeadmin-plugins/activeadmin_calendar)#2

Merged
Fivell merged 1 commit into
masterfrom
feat/npm-package
May 21, 2026
Merged

feat: ship npm twin (@activeadmin-plugins/activeadmin_calendar)#2
Fivell merged 1 commit into
masterfrom
feat/npm-package

Conversation

@Fivell
Copy link
Copy Markdown
Member

@Fivell Fivell commented May 21, 2026

Bundler-based asset pipelines (Vite, esbuild, cssbundling-rails, webpacker) cannot resolve assets from Ruby gem paths, so the CSS component of this gem has to be reachable as an npm package for those consumers.

Mirrors the layout already used by sibling AA plugins (e.g. @activeadmin-plugins/active_admin_sidebar): a thin package.json with style + main pointing at src/activeadmin_calendar.css, populated on publish by the prepublishOnly script which copies from app/assets/stylesheets/. src/ is gitignored — it only exists at publish time, so the gem and npm package share a single CSS source.

Propshaft / Sprockets consumers continue to auto-discover the CSS directly from app/assets/stylesheets/ — they don't need the npm package.

Consumers on a bundler can now write:

@import '@activeadmin-plugins/activeadmin_calendar';

instead of mirroring the CSS locally.

Bundler-based asset pipelines (Vite, esbuild, cssbundling-rails,
webpacker) cannot resolve assets from Ruby gem paths, so the CSS
component of this gem has to be reachable as an npm package for those
consumers.

Mirrors the layout already used by sibling AA plugins (e.g.
@activeadmin-plugins/active_admin_sidebar): a thin package.json with
`style` + `main` pointing at src/activeadmin_calendar.css, populated
on publish by the `prepublishOnly` script which copies from
app/assets/stylesheets/. src/ is gitignored — it only exists at
publish time, so the gem and npm package share a single CSS source.

Propshaft / Sprockets consumers continue to auto-discover the CSS
directly from app/assets/stylesheets/ — they don't need the npm
package.

Consumers on a bundler can now write:

  @import '@activeadmin-plugins/activeadmin_calendar';

instead of mirroring the CSS locally.
@Fivell Fivell merged commit b74d4ce into master May 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant