Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
pull_request:
branches: [master, main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
gem:
name: gem (ruby ${{ matrix.ruby }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Build gem
run: gem build select2-foundation.gemspec

- name: Install built gem (with runtime deps)
run: |
gem install select2-foundation-*.gem
gem list select2-foundation

- name: Run gem test suite against test/styleguide06
run: bundle exec rake test

npm:
name: npm (node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["18", "20", "22"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install npm dependencies
run: npm install --no-audit --no-fund

- name: Build SCSS
run: npm run build

- name: Verify dist output
run: |
test -s dist/select2-foundation-theme.css || { echo "dev CSS not produced"; exit 1; }
test -s dist/select2-foundation-theme.min.css || { echo "prod CSS not produced"; exit 1; }
echo "dev: $(wc -c < dist/select2-foundation-theme.css) bytes"
echo "prod: $(wc -c < dist/select2-foundation-theme.min.css) bytes"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
log/*.log
pkg/
node_modules/
package-lock.json
*.gem
test/styleguide*/db/*.sqlite3
test/styleguide*/db/*.sqlite3-journal
test/styleguide*/log/*.log
Expand Down
11 changes: 9 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ source 'https://rubygems.org'
# development dependencies will be added by default to the :development group.
gemspec

# To use a debugger
# gem 'byebug', group: [:development, :test]
# Dependencies needed to run `rake test` against the test/styleguide06
# sample Rails app. The test app is a pure asset-pipeline host, so we only
# need the railties needed for action_controller + sprockets.
group :development, :test do
gem 'rails', '~> 7.1.0'
gem 'sprockets-rails'
gem 'sassc-rails'
gem 'jquery-rails'
end
40 changes: 0 additions & 40 deletions Gruntfile.js

This file was deleted.

35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Select2-Foundation

select2 (v4) Theme for Zurb Foundation (v6)
[![CI](https://github.com/mpasternak/select2-foundation/actions/workflows/ci.yml/badge.svg)](https://github.com/mpasternak/select2-foundation/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./MIT-LICENSE)

select2 (v4) Theme for Zurb Foundation (v6.9)

[Examples](https://select2-foundation.herokuapp.com/ "select2-foundation examples")

Expand All @@ -13,13 +16,20 @@ In order to apply select2-foundation theme to your project, add the following fi
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-foundation-theme.css">

### npm (from git)

`select2-foundation` is not published on npm. Pull it directly from this repository:

npm install foundation-sites select2 \
"select2-foundation@github:zflat/select2-foundation"

### Bower
<pre><code>"dependencies": {
"foundation-sites" : "^6.0.0",
"select2" : "latest",
"select2-foundation" : "https://github.com/egemensarica/select2-foundation.git#v6"
"foundation-sites" : "^6.9.0",
"select2" : "^4.0.13",
"select2-foundation" : "https://github.com/zflat/select2-foundation.git"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good update, thanks!

}</code></pre>

### Rails (ruby gem)

Installation is similar to installing foundation-rails.
Expand Down Expand Up @@ -67,15 +77,22 @@ Navigate to the root path to view the demo page.

Install build tools:

* npm
* grunt-cli
* npm (Node 18+)

Run grunt tasks. See grunt help for available tasks.
Then:

grunt sass
npm install
npm run build # builds both expanded and compressed CSS
npm run watch # watch mode (expanded only)

## Changelog

### 0.2.0
* Target Foundation 6.9 (`foundation-sites ^6.9.0`, `foundation-rails ~> 6.9`)
* Replace grunt build with `sass` (dart-sass) via npm scripts
* Drop direct `sass` gem dependency
* GitHub Actions CI for gem install and npm build

### 0.1.1
* Release to ruby gems

Expand Down
4 changes: 1 addition & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/styleguide/Rakefile", __FILE__)
APP_RAKEFILE = File.expand_path("../test/styleguide06/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

load 'rails/tasks/statistics.rake'

Bundler::GemHelper.install_tasks

require 'rake/testtask'
Expand Down
16 changes: 8 additions & 8 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "select2-foundation",
"version": "0.0.2",
"version": "0.2.0",
"description": "Select2 Foundation Theme",
"main": [
"./dist/select2-foundation-theme.css"
],
"author": {
"name": "William Wedler"
},
"license": "MIT",
"dependencies": {
"foundation-sites" : "^6.0.0",
"select2" : "latest"
},
"devDependencies": {
"grunt": "~0.4.5"
"foundation-sites": "^6.9.0",
"select2": "^4.0.13"
},
"keywords": [
"Select2 Foundation",
"select2",
"Foundation"
],
"ignore": [
"ignore": [
".gitignore",
".gitkeep",
".github",
"Gemfile",
"Gemfile.lock",
"README.md",
"Rakefile",
"select2-foundation.gemspec",
Expand All @@ -33,5 +33,5 @@
"lib/select2-foundation/",
"lib/tasks",
"lib/select2-foundation.rb"
]
]
}
Loading