Comments (7)
How to reproduce the bug
$ rails new demo-app --webpack
$ cd demo-app
$ echo "gem 'komponent'" >> Gemfile
$ bundle
$ rails generate komponent:install
$ rails generate component container
$ rails generate component button
After what I got this inside frontend/components/index.js
:
import "components/button/button";
import "components/container/container";
Ok, now I convert double to single quotes inside this file, then I generate a new component rails generate component form
.
And frontend/components/index.js
now contain:
import "components/form/form";
My two previous components are absent from index.js
now.
from komponent.
Thanks for the instructions, it will help!
from komponent.
I think to start it's not really a problem to continue adding new component with double quotes. The main think is to not remove previous added components :)
from komponent.
Okay, let's merge this fix for now, and we may improve this later.
from komponent.
Maybe the error is due to sort_lines_alphabetically!(path)
and not import_to_packs
.
from komponent.
I think you're right. Can you try modifying the regex from this line?
We would need /^import ["'](.*)["'];$/
to support simple quotes.
from komponent.
I added a failing test case here: #101
and pushed this commit 086be84 to fix the issue.
But I'm not sure what behavior we want... Should we rewrite the whole index file with single or double quotes? How do we check what is the expected syntax for the current project?
from komponent.
Related Issues (20)
- Cut a new version? HOT 2
- Nested yields HOT 1
- Rails 6 - undefined method `view_renderer=' HOT 9
- Support Webpacker 4 HOT 1
- Render a component without a partial HOT 1
- Set load path from gem instead of using install generator HOT 3
- Komponent's view_renderer is leaking to Rails HOT 7
- Zeitwerk compatibility HOT 12
- komponent:install doesn't work with Rails 6 HOT 2
- bin/rails stats doesn't run anymore
- Styleguide generator improvements HOT 1
- Use ActiveModel::Validations on components HOT 4
- 2.3 release HOT 1
- undefined local variable or method `component_name' HOT 1
- Ruby 2.7 compatibility
- Files from frontend/components/komponent listed in styleguide sidebar HOT 2
- Add option to create pcss files upon component generation HOT 1
- Question - What is the proper way to organize subdomain-specific components ?
- Future of Komponent HOT 2
- [Draft] How to migrate to ViewComponent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from komponent.