solidusio / solidus

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
https://solidus.io
Other
4.97k stars 1.29k forks source link

Sandbox does not work in v4.3 and main #5598

Closed mamhoff closed 6 months ago

mamhoff commented 8 months ago

In both Solidus 4.3 and in the main branch, the sandbox generates, but cannot be used. I fails with the following error:


ActionView::Template::Error (couldn't find file 'solidus_admin/tailwind.css' with type 'text/css'
Checked in these paths: 
  /home/anselm/code/solidus/sandbox/app/assets/builds
  /home/anselm/code/solidus/sandbox/app/assets/config
  /home/anselm/code/solidus/sandbox/app/assets/images
  /home/anselm/code/solidus/sandbox/app/assets/javascripts
  /home/anselm/code/solidus/sandbox/app/assets/stylesheets
  /home/anselm/code/solidus/sandbox/vendor/assets/images

[...] 

Solidus Version:

branches v4.3 and main

To Reproduce

git pull
git checkout v4.3 # or main
bin/sandbox
cd sandbox
rails s
# navigate to localhost:3000 and see it fail

Current behavior

Above failure

Expected behavior

I expect the sandbox to work.

Desktop (please complete the following information):

Additional context

I would have loved to provide a fix for a flaky spec with the new admin, but I can't.

tvdeyen commented 8 months ago

You need to run

bin/dev

but even with this the solidus_admin/tailwind.css does not get build in the admin/app/assets/builds folder.

@elia what are the steps to set up a working sandbox locally with solidus_admin. And how do the compiled assets end up in the engine folder in the released gem? Do we have a build step somewhere?

tvdeyen commented 8 months ago

I can confirm that solidus_admin/tailwind.css is in the built gem, but it is missing in the git checkout. What makes sense, but still I cannot see a task that builds the file during release.

tvdeyen commented 8 months ago

Workaround:

  1. CD into admin
  2. Run bundle exec rake tailwindcss:build
  3. CD into sandbox
  4. start bin/dev

@elia ideally we would have a top level rake task for this or check in the tailwind.css file into the repo, because it wont change often. Then rebuild it via GH actions on push or something (as we do in Alchemy to build our admin bundles)

elia commented 7 months ago

you can reduce the number of commands to:

bin/rake -C admin tailwindcss:build
bin/dev

We could also touch or build the css file as part of the sandbox script, just to avoid that nasty error, but bin/dev would still be the preferred way.

All of that should be better documented once we finalize #5595, sorry about the inconvenience.

mamhoff commented 7 months ago

I think this should be automated, and part of the solidus installer (at least). Also, I think this affects all extensions in the ecosystem, as none that I looked at over the past couple of days (and I looked at a few) currently build. Even the ones that should build fail with errors related to SolidusAdmin.

tvdeyen commented 7 months ago

@mamhoff @elia now that #5600 has been merged most extensions should build again, right?

tvdeyen commented 7 months ago

@elia what do you think about committing the built tailwind css file into the admin repo (and update it on PR merge)? That file won't change much (at least once the admin has been built out). And even in until then it makes to have it updated regularly (not just on gem release). Thoughts?