diff --git a/Gemfile.lock b/Gemfile.lock index d8ae036e..b8056d98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) diff --git a/README.md b/README.md index b6584d8d..25129973 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ``` @@ -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). diff --git a/dsfr-view-components.gemspec b/dsfr-view-components.gemspec index 45d81185..588360af 100644 --- a/dsfr-view-components.gemspec +++ b/dsfr-view-components.gemspec @@ -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 = ["antoine.girard@beta.gouv.fr", "stephane.maniaci@beta.gouv.fr", "adrien.di_pasquale@beta.gouv.fr"] + spec.email = [ + "antoine.girard@beta.gouv.fr", + "stephane.maniaci@beta.gouv.fr", + "adrien.di_pasquale@beta.gouv.fr" + ] 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" @@ -29,6 +33,7 @@ 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" @@ -36,7 +41,7 @@ Gem::Specification.new do |spec| 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" diff --git a/lib/dsfr/components/version.rb b/lib/dsfr/components/version.rb index 7480637d..320f054a 100644 --- a/lib/dsfr/components/version.rb +++ b/lib/dsfr/components/version.rb @@ -1,5 +1,5 @@ module Dsfr module Components - VERSION = '2.0.1'.freeze + VERSION = '2.1.0'.freeze end end diff --git a/spec/dummy/Procfile.dev b/spec/dummy/Procfile.dev deleted file mode 100644 index 7eaba233..00000000 --- a/spec/dummy/Procfile.dev +++ /dev/null @@ -1,2 +0,0 @@ -web: env RUBY_DEBUG_OPEN=true bin/rails server -css: bun run build:css --watch diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/application.css @@ -0,0 +1 @@ +{} diff --git a/spec/dummy/app/assets/stylesheets/application.sass.scss b/spec/dummy/app/assets/stylesheets/application.sass.scss deleted file mode 100644 index 94906978..00000000 --- a/spec/dummy/app/assets/stylesheets/application.sass.scss +++ /dev/null @@ -1,2 +0,0 @@ -// Entry point for your Sass build -@import "@gouvfr/dsfr/dist/dsfr.min"; diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb index 8f8469cd..67db558f 100644 --- a/spec/dummy/app/views/layouts/application.html.erb +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -8,6 +8,11 @@ <%# %> <%= 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' %> diff --git a/spec/dummy/bun.lockb b/spec/dummy/bun.lockb deleted file mode 100755 index 78d93eaa..00000000 Binary files a/spec/dummy/bun.lockb and /dev/null differ diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index f69f6066..aed46014 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -5,6 +5,8 @@ require "action_view/railtie" Bundler.require(*Rails.groups) + +require "dsfr/assets" require "dsfr/components" module Dummy diff --git a/spec/dummy/package-lock.json b/spec/dummy/package-lock.json deleted file mode 100644 index 87f294c1..00000000 --- a/spec/dummy/package-lock.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "dummy", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "dependencies": { - "@gouvfr/dsfr": "^1.7.2", - "prismjs": "^1.27.0" - } - }, - "node_modules/@gouvfr/dsfr": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@gouvfr/dsfr/-/dsfr-1.7.2.tgz", - "integrity": "sha512-hPNtz+gHcc8m7ZPANxSOFMz4Ap+M9FHOudqoMR/+Kjl5FCOqwA6u/aoYnMJ8KqedS1k5XThFMp7jiktr53qXYw==", - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/prismjs": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", - "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", - "engines": { - "node": ">=6" - } - } - }, - "dependencies": { - "@gouvfr/dsfr": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@gouvfr/dsfr/-/dsfr-1.7.2.tgz", - "integrity": "sha512-hPNtz+gHcc8m7ZPANxSOFMz4Ap+M9FHOudqoMR/+Kjl5FCOqwA6u/aoYnMJ8KqedS1k5XThFMp7jiktr53qXYw==" - }, - "prismjs": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", - "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==" - } - } -} diff --git a/spec/dummy/package.json b/spec/dummy/package.json deleted file mode 100644 index a8ea6209..00000000 --- a/spec/dummy/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "@gouvfr/dsfr": "^1.7.2", - "prismjs": "^1.27.0", - "sass": "^1.83.0" - }, - "scripts": { - "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" - } -} \ No newline at end of file