jQuery-Widget.js icon indicating copy to clipboard operation
jQuery-Widget.js copied to clipboard

Make yarn-run-dev not move queries.json to build folder

Open simonvbrae opened this issue 1 year ago • 6 comments

This is a draft PR, I am still making changes.

Calling yarn run dev would result in the queries.json file being moved to build/ after generation resulting in missing data sources and queries in the development server. This PR changes lets that move happen outside of webpack so it doesn't happen when running yarn run dev, only when running yarn run build.

simonvbrae avatar Sep 19 '24 14:09 simonvbrae

Thanks @simonvbrae, looks good!

Can you confirm build and serving works correctly in these cases? (because the CI currently only checks one of these)

  • yarn run dev (yarn run dev-prod should be the same)
  • yarn run build
  • node bin/generate.js

If yes, I'll merge this right away!

I have tested all of the options, it's ready for merge!

simonvbrae avatar Nov 13 '24 20:11 simonvbrae

@simonvbrae It looks like the CI doesn't pass. Can you check why?

rubensworks avatar Nov 22 '24 13:11 rubensworks

@simonvbrae It looks like the CI doesn't pass. Can you check why?

The error is Error: ENOENT: no such file or directory, rename '/home/runner/work/jQuery-Widget.js/jQuery-Widget.js/queries.json' -> '/home/runner/work/jQuery-Widget.js/jQuery-Widget.js/build/queries.json'

This could be caused by this line we discussed above, the failing CI runs may be expecting queries.json to be present in CWD. I've changed it back, which should fix the CI.

simonvbrae avatar Nov 22 '24 18:11 simonvbrae

Still seems to be failing after your change :/

rubensworks avatar Nov 24 '24 06:11 rubensworks

The issue seems to be caused by an absent build folder, my current commit creates the folder, which fixes the CI.

But the absent build folder raises a few questions:

  • Where is the build output if the build folder doesn't exist? This is especially strange considering that all the webpack entries have this exact build folder (that doesn't exist) as their output path.
  • So why is the call to webpack() successful when all of it's entries have an output.path that doesn't exist?

I didn't find anything in the documentation suggesting that webpack creates this directory and, in practise, it doesn't seem to create it because the error of build folder not existing happens after the call to webpack().

I'm not sure as to whether everything is correct within the CI but I am committing what makes the CI pass for now.

simonvbrae avatar Nov 29 '24 18:11 simonvbrae

@simonvbrae Is this one ready for review?

rubensworks avatar Jan 06 '25 07:01 rubensworks