Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task for ejecting a theme doesn't complete all replacements #26

Closed
pascallaliberte opened this issue Dec 23, 2022 · 13 comments · Fixed by #492
Closed

Task for ejecting a theme doesn't complete all replacements #26

pascallaliberte opened this issue Dec 23, 2022 · 13 comments · Fixed by #492
Assignees

Comments

@pascallaliberte
Copy link
Member

Given the following setup:

  1. Create a fresh project by cloning bullet_train
  2. Eject to the foo theme: rake bullet_train:themes:light:eject[foo]

In the process of ejecting the theme, it looks like the process doesn't go all the way:

There are errors in the output:

e.g. some No such file or directory errors like:

cp: /Users/work/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.2.4/tailwind.mailer.light.config.js: No such file or directory

and

sed: can't read s/light/foo/g: No such file or directory
See full output

Ejecting from Light theme in `/Users/work/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.2.4`.
Ejecting Tailwind configuration into `./tailwind.foo.config.js`.
Ejecting Tailwind mailer configuration into `./tailwind.mailer.foo.config.js`.
cp: /Users/work/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.2.4/tailwind.mailer.light.config.js: No such file or directory
sed: can't read s/light/foo/g: No such file or directory
sed: can't read /Users/work/Desktop/bullet-train/theme-system-demo-01/tailwind.mailer.foo.config.js: No such file or directory
Ejecting stylesheets into `./app/assets/stylesheets/foo`.
sed: can't read s/light/foo/g: No such file or directory
Ejecting JavaScript into `./app/javascript/application.foo.js`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_days_ago.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_options.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_text.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_belongs_to.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_has_many.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_block.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_date_and_time.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_option.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_image.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_html.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_email.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_date.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_boolean.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_code.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_phone_number.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_attribute.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_password_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_emoji_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_phone_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_super_select.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_text_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_email_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_ckeditor.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_trix_editor.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_text_area.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits/_index.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits/_form.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_attempt.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_file.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_code.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_options.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_cloudinary_image.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_buttons.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_file_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_date_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_date_and_time_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_color_picker.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_alert.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/forms`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/forms/_errors.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_line.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_well.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_page.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/commentary`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/commentary/_box.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_box.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_block.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_base.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_progress_bar.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_decision_line.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_pricing.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_mailer.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_devise.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_head.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_account.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_thread_border.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_message.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_comment.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_card.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_cell.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/workflow`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/workflow/_box.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships/_photo.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships/_photos.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_top.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_logo.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_user.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_heading.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_subsection.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_close.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_item.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_open.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_mobile.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_sidebar.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_section.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_account.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_action.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_list.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_box.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_breadcrumb.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_notices.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_title.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/breadcrumbs`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/breadcrumbs/_actions.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/billing`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/billing/_pricing_table.html.erb`.
sed: can't read s/light/foo/g: No such file or directory
Cutting local `Procfile.dev` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Cutting local `package.json` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Cutting `test/system/resolver_system_test.rb` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Stubbing out a class that represents this theme in `./Users/work/Desktop/bullet-train/theme-system-demo-01/app/lib/bullet_train/themes/foo.rb`.
sed: can't read s/module Light/module Foo/g: No such file or directory
sed: can't read s/TailwindCss/Light/g: No such file or directory
sed: can't read s/light/foo/g: No such file or directory
Cutting local project over from `light` to `foo` in `app/helpers/application_helper.rb`.
sed: can't read s/:light/:foo/g: No such file or directory
You must restart `bin/dev` at this point, because of the changes to `Procfile.dev` and `package.json`.

Replacements aren't completed as a result

  • It's still using BulletTrain::Themes::Light in _devise.html.erb and _account.html.erb
  • module Light isn't changed in lib/bullet_train/themes/foo.rb
  • ["foo"] + super isn't added to directory_order in lib/bullet_train/themes/foo.rb
  • application.light is not replaced with application.foo in foo/layouts/_head.html.erb
  • tailwind.light not replaced with tailwind.foo in tailwind.mailer.foo.config.js
  • application.light still used in themes/foo/layouts/_head.html.erb
@gazayas
Copy link
Contributor

gazayas commented Dec 24, 2022

I didn't notice this last time, will take deeper look

@gazayas gazayas self-assigned this Dec 24, 2022
@gazayas
Copy link
Contributor

gazayas commented Dec 24, 2022

@pascallaliberte What version of bullet_train-core are you using? All of the files that you mentioned are showing up just fine for me, and all of the strings are being changed to foo against the latest branch.

I was getting the No such file or directory and sed errors against v1.2.3, but those errors go away with the latest development branch.

Also, there is a mkdir: cannot create directory error when ejecting with the latest branch which I talk about here, but it shouldn't actually affect the files that are being copied over.

Checklist

  • _devise.html.erb and _account.html.erb views in app/views/themes/foo show up when the theme is Foo
  • The module name is being changed to module Foo, and directory_order returns ["foo"] + super
  • application.foo shows up in themes/foo/layouts/_head.html.erb like so: <%= javascript_include_tag 'application.foo', 'data-turbo-track': 'reload' %>
  • tailwind.foo shows up in tailwind.mailer.foo.config.js like so: const tailwindBase = require('./tailwind.foo.config')

@pascallaliberte
Copy link
Member Author

v1.2.4 off a fresh install.

Could it somehow be that I'm using rbenv? Or maybe a permissions issue in the filesystem?

@pascallaliberte
Copy link
Member Author

When I bundle install I sometimes am prompted for my password as though there’s a sudo requirement for some of the gems, maybe that’s pointing to a messed up gem permissions situation?

@gazayas
Copy link
Contributor

gazayas commented Dec 24, 2022

I'm not sure about the permissions, but I think because the latest development changes haven't been published yet, so pointing the gems to "local/bullet_train-core/#{gem_name}" should work.

If I find something out about permissions I'll post here.

@gazayas
Copy link
Contributor

gazayas commented Mar 22, 2023

Hey @pascallaliberte, are you still running into this issue? Just checking in to see if we can close this one.

@pascallaliberte
Copy link
Member Author

@gazayas Quick check and I'm still getting the same output.

See full output

$ rake bullet_train:themes:light:eject[foo]
Ejecting from Light theme in `/Users/work/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bullet_train-themes-light-1.2.21`.
Ejecting Tailwind configuration into `./tailwind.foo.config.js`.
Ejecting Tailwind mailer configuration into `./tailwind.mailer.foo.config.js`.
cp: /Users/work/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bullet_train-themes-light-1.2.21/tailwind.mailer.light.config.js: No such file or directory
sed: can't read s/light/foo/g: No such file or directory
sed: can't read /Users/work/Desktop/bullet-train/theme-system-demo-01/tailwind.mailer.foo.config.js: No such file or directory
Ejecting stylesheets into `./app/assets/stylesheets/foo`.
sed: can't read s/light/foo/g: No such file or directory
Ejecting JavaScript into `./app/javascript/application.foo.js`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_days_ago.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_options.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_text.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_belongs_to.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_number.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_has_many.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_block.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_date_and_time.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_option.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_image.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_html.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_email.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_date.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_boolean.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_code.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_phone_number.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_attribute.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_password_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_emoji_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_phone_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_super_select.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_text_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_email_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_ckeditor.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_trix_editor.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_number_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_text_area.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits/_index.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/limits/_form.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_attempt.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_file.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_code.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_options.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_cloudinary_image.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_buttons.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_file_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_date_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_date_and_time_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_color_picker.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes: File exists
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_team.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_alert.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/forms`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/forms/_errors.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_link_row.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_line.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_well.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_page.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/commentary`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/commentary/_box.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_box.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_block.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_base.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/attributes/_progress_bar.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_decision_line.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_pricing.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_mailer.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_devise.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_head.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/layouts/_account.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_thread_border.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_message.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_comment.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/conversations/_card.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_cell.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/workflow`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/workflow/_box.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships/_photo.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/memberships/_photos.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_top.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_logo.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_user.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_heading.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_subsection.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_close.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_item.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_open.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_mobile.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_sidebar.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_section.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/menu/_account.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_action.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_list.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/actions/_box.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_breadcrumb.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields`.
mkdir: /Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields: File exists
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/fields/_field.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_notices.html.erb`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/_title.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/breadcrumbs`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/breadcrumbs/_actions.html.erb`.
Creating `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/billing`.
Copying `/Users/work/Desktop/bullet-train/theme-system-demo-01/app/views/themes/foo/billing/_pricing_table.html.erb`.
sed: can't read s/light/foo/g: No such file or directory
Cutting local `Procfile.dev` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Cutting local `package.json` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Cutting `test/system/resolver_system_test.rb` over from `light` to `foo`.
sed: can't read s/light/foo/g: No such file or directory
Stubbing out a class that represents this theme in `./Users/work/Desktop/bullet-train/theme-system-demo-01/app/lib/bullet_train/themes/foo.rb`.
sed: can't read s/module Light/module Foo/g: No such file or directory
sed: can't read s/TailwindCss/Light/g: No such file or directory
sed: can't read s/light/foo/g: No such file or directory
Cutting local project over from `light` to `foo` in `app/helpers/application_helper.rb`.
sed: can't read s/:light/:foo/g: No such file or directory
You must restart `bin/dev` at this point, because of the changes to `Procfile.dev` and `package.json`.

I updated the repo to the latest main, ran bundle, yarn to install the latest and greatest, created a branch test-theme-eject, and ran rake bullet_train:themes:light:eject[foo]

I'll check these bits from the eject script to debug:

  • What version of sed am I using?
  • What's the theme_path that it's not able to find?

Will report back.

@pascallaliberte
Copy link
Member Author

@gazayas

I'm looking at my local version in /Users/work/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bullet_train-themes-light-1.2.21/

And indeed, for example, it's missing tailwind.mailer.light.config.js.

What about you?

When you run bundle show --paths bullet_train-themes-light does it return a directory that includes the right files? Is it returning the path of local/bullet_train-core?

@gazayas
Copy link
Contributor

gazayas commented Mar 27, 2023

@pascallaliberte Yeah, I just run it against the latest branches and tailwind.mailer.light.config.js is the only file that isn't showing up for me. It's in the GitHub repository though, so I'm confused as to why it's not in the .rbenv/ gems directory.

@julianrubisch
Copy link
Contributor

Just wanted to report - probably related - that after ejecting, themes/.../mailer/_layout.html.erb still contains

<%= stylesheet_link_tag 'application.mailer.light', media: 'all' %>

=> "light" should be replaced by the ejected theme's name, correct?

@gazayas
Copy link
Contributor

gazayas commented Apr 29, 2023

Good catch, you mean app/views/themes/#{custom_theme}/layouts/_mailer.html.erb, right? I'll push a fix here soon.

@julianrubisch
Copy link
Contributor

Yup, it resulted in a couple of folks not getting the welcome mail 🙈

@jagthedrummer
Copy link
Contributor

I just tested this and it looks like something is still weird.

I did:

rake bullet_train:themes:light:eject[foo]

And then right at the very top, after just a few lines of successful output I see a couple of lines that are complaining, and then a lot more happy lines.

Ejecting from Light theme in `/Users/jgreen/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bullet_train-themes-light-1.3.18`.
Ejecting Tailwind configuration into `./tailwind.foo.config.js`.
Ejecting Tailwind mailer configuration into `./tailwind.mailer.foo.config.js`.
cp: /Users/jgreen/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bullet_train-themes-light-1.3.18/tailwind.mailer.light.config.js: No such file or directory
sed: /Users/jgreen/projects/bullet-train-co/bullet_train/tailwind.mailer.foo.config.js: No such file or directory
...

Looks like tailwind.mailer.light.config.js is missing from the gem.

jagthedrummer added a commit that referenced this issue Aug 29, 2023
Fixes #26

Since we weren't including this file in the package it was causing
problems for people who were running with the released gems.

But the file would be available if you'd linked your core repos into the
starter repo.
jagthedrummer added a commit that referenced this issue Aug 29, 2023
Fixes #26

Since we weren't including this file in the package it was causing
problems for people who were running with the released gems.

But the file would be available if you'd linked your core repos into the
starter repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants