diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad3b47..96d43e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ **Enhancements:** - Support for Rails 6 - Refactoring to use `Utils` in `InstallGenerator` and prevent code duplication +- Stop isolating `Komponent` namespace to allow using routes from main application in components ([#141](https://github.com/komposable/komponent/pull/141)) + NB: If you already generated a styleguide in your app, you need to replace `styleguide_path` by `komponent.styleguide_path` in `styleguide/components/sidebar` **Bug fixes:** - Fixed empty `h1` in generated `_examples.html.*` file diff --git a/README.md b/README.md index bb1b078..9881451 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ This command will: * add a new `komponent.js` pack to your packs folder * mount the engine in your routes -Then, for each component, you can describe it and render examples for each state in the `_example.html.slim` file from the component folder. The engine will then render it on the component page. +Then, for each component, you can describe it and render examples for each state in the `_examples.html.slim` file from the component folder. The engine will then render it on the component page. If you have existing components, you can generate all their example files at once with: diff --git a/config/routes.rb b/config/routes.rb index 7293246..cfa10cc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true Komponent::Engine.routes.draw do - resources :styleguide, only: %i[index show] + resources :styleguide, only: %i[index show], module: :komponent end diff --git a/lib/generators/komponent/templates/styleguide/components/sidebar/_komponent_sidebar.html.erb b/lib/generators/komponent/templates/styleguide/components/sidebar/_komponent_sidebar.html.erb index 195ade3..f6198a5 100644 --- a/lib/generators/komponent/templates/styleguide/components/sidebar/_komponent_sidebar.html.erb +++ b/lib/generators/komponent/templates/styleguide/components/sidebar/_komponent_sidebar.html.erb @@ -3,7 +3,7 @@ diff --git a/lib/komponent/engine.rb b/lib/komponent/engine.rb index 477160c..41c40da 100644 --- a/lib/komponent/engine.rb +++ b/lib/komponent/engine.rb @@ -9,7 +9,7 @@ module Komponent class Engine < Rails::Engine - isolate_namespace Komponent + engine_name "komponent" rake_tasks do load 'komponent/rails/tasks/komponent.rake'