lib/: Ruby engine, extensions, and DSL underActiveAdmin::TomSelect.app/assets/: Legacy Sprockets JS/CSS entry points for ActiveAdmin.src/: ESM sources for the npm package (searchable_select.js/.scss).vendor/assets/javascripts/: Importmap-friendly JS build.spec/: RSpec suite with Combustion Rails app underspec/internal; feature specs inspec/features/**.docs/: Setup and integration guides.
bundle && bundle exec rspec: Install gems and run the test suite.appraisal install && appraisal rspec: Run the Rails/ActiveAdmin matrix (seeAppraisals).bundle exec rubocop --force-exclusion: Lint Ruby code per.rubocop.yml.npm ci && npm run prepublishOnly: Build npm artifacts fromapp/assetsintosrc/.npx playwright install chromium: One-time browser install for JS feature specs.rake build/rake release: Build/release the gem via Bundler tasks.- Example (headed browser):
HEADLESS=false bundle exec rspec.
- Ruby: 2-space indent, TargetRuby 3.0, max line length 100; follow RuboCop rules.
- Names: Ruby files in
lib/activeadmin/tom_select/use snake_case; modules underActiveAdmin::TomSelect. - JS: ESM modules in
src/; keep imports explicit. Avoid global jQuery except for ActiveAdmin integration.
- Framework: RSpec. Feature/system specs use Capybara with Playwright; unit/integration via Combustion.
- Layout: Place UI/Select2 specs under
spec/features/**and tagtype: :feature, js: true. - Run:
bundle exec rspeclocally; useappraisal rspecto validate matrices before PRs. - Browser: Install once with
npx playwright install chromium. UseHEADLESS=falseto visualize.
- Commits: Imperative, concise messages (e.g., "Fix Select2 init on esbuild"). Group related changes.
- PRs: Provide clear description, rationale, linked issues; add screenshots/GIFs for UI changes. Update
README.md/docs/andCHANGELOG.mdfor behavior changes. - Quality gate: Ensure
rspecandrubocoppass; for npm-facing changes, runnpm run prepublishOnlyto verifysrc/packaging.
- Bundlers (esbuild/webpack):
import 'jquery'andimport 'select2', then callselect2($)and ensurewindow.$ = window.jQuery = $before importing this package. - Importmap: Use
vendor/assets/javascripts/activeadmin-searchable_select.js.