Skip to content

Commit

Permalink
Merge pull request #199 from betagouv/feat/use-dsfr-assets
Browse files Browse the repository at this point in the history
npm: use the dsfr-assets gem instead of Node
  • Loading branch information
freesteph authored Jan 21, 2025
2 parents 35590e8 + d0e2a2b commit ac2bb37
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 62 deletions.
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
PATH
remote: .
specs:
dsfr-view-components (2.0.1)
dsfr-view-components (2.1.0)
dsfr-assets (~> 1.13)
html-attributes-utils (~> 1)
pagy (~> 6)
view_component (~> 3)
Expand Down Expand Up @@ -111,6 +112,7 @@ GEM
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
dsfr-assets (1.13.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Pour utiliser cette gem dans votre application Rails, il faut ajouter cette lign
require "dsfr/components"
```

**NOTE:** depuis la version 2.1, la gem dépend de [`dsfr-assets`](https://github.com/betagouv/dsfr-assets) qui embarque les assets du DSFR pour vous. Pour laisser au temps aux équipes de vérifier cette intégration, l'inclusion des assets est optionnelle mais peut se faire en suivant [les instructions dans le README de dsfr-assets](https://github.com/betagouv/dsfr-assets?tab=readme-ov-file#installation).

## Composants disponibles

Cette gem a pour but de supporter tous les composants proposés par le Design Système de l'État hormis ceux concernant les formulaires. Ceux-ci seront fournis dans une gem indépendante dans le futur.
Expand Down Expand Up @@ -75,12 +77,11 @@ Utilisez le générateur pour créer un nouveau composant :
bin/rails g dsfr_component FancyButton --params title:String count:Integer
```


Lancer la dummy app pour itérer sur les composants :

```sh
cd spec/dummy
bundle install && npm install
bundle install
bundle exec rails server
```

Expand All @@ -90,7 +91,6 @@ Déployer une nouvelle version de la gem :
VERSION=1.3.2 make deploy_gem
```


## Licence

Le code source et la gem sont ouverts sous la licence [MIT](https://opensource.org/licenses/MIT).
9 changes: 7 additions & 2 deletions dsfr-view-components.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ Gem::Specification.new do |spec|
spec.name = "dsfr-view-components"
spec.version = Dsfr::Components::VERSION
spec.authors = ["BetaGouv developers"]
spec.email = ["[email protected]", "[email protected]", "[email protected]"]
spec.email = [
"[email protected]",
"[email protected]",
"[email protected]"
]
spec.homepage = "https://github.com/betagouv/dsfr-view-components"
spec.summary = "Composants ViewComponent pour le Système de Design de l'État (DSFR)"
spec.description = "Cette librairie de composants vise à simplifier l’usage du DSFR (Système de Design de l'État) dans les applications web utilisant Ruby On Rails"
Expand All @@ -29,14 +33,15 @@ Gem::Specification.new do |spec|
spec.add_dependency "html-attributes-utils", "~> 1"
spec.add_dependency "pagy", "~> 6"
spec.add_dependency "view_component", "~> 3"
spec.add_dependency "dsfr-assets", "~> 1.13"

spec.add_development_dependency "deep_merge"
spec.add_development_dependency "guard"
spec.add_development_dependency "guard-rspec"
spec.add_development_dependency "pry-byebug"
spec.add_development_dependency "rspec-html-matchers", "~> 0.9"
spec.add_development_dependency "rubocop"
spec.add_development_dependency("simplecov", "~> 0.20")
spec.add_development_dependency "simplecov", "~> 0.20"
spec.add_development_dependency "sqlite3"
spec.add_development_dependency "yard"

Expand Down
2 changes: 1 addition & 1 deletion lib/dsfr/components/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Dsfr
module Components
VERSION = '2.0.1'.freeze
VERSION = '2.1.0'.freeze
end
end
2 changes: 0 additions & 2 deletions spec/dummy/Procfile.dev

This file was deleted.

1 change: 1 addition & 0 deletions spec/dummy/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 0 additions & 2 deletions spec/dummy/app/assets/stylesheets/application.sass.scss

This file was deleted.

5 changes: 5 additions & 0 deletions spec/dummy/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

<%# <meta name="theme-color" content="#000091"> %>
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "dsfr.min", "application-turbo-track": "reload" %>

<%= javascript_include_tag "dsfr.module.min.js", type: 'module' %>
<%= javascript_include_tag "dsfr.nomodule.min.js", nomodule: true %>

<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>

Expand Down
Binary file removed spec/dummy/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
require "action_view/railtie"

Bundler.require(*Rails.groups)

require "dsfr/assets"
require "dsfr/components"

module Dummy
Expand Down
41 changes: 0 additions & 41 deletions spec/dummy/package-lock.json

This file was deleted.

10 changes: 0 additions & 10 deletions spec/dummy/package.json

This file was deleted.

0 comments on commit ac2bb37

Please sign in to comment.