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

Update generated package.jsons #308

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Conversation

lishaduck
Copy link
Contributor

@lishaduck lishaduck commented Nov 10, 2024

Trying to make the generated package.jsons more accurate.

Extracted from #303.

@lishaduck

This comment was marked as resolved.

@@ -305,6 +305,7 @@ ElmjutsuDumMyM0DuL3.elm
const licenseArgs = options.forTests ? '--name "Test User" --year 2020' : '';
try {
childProcess.execSync(
// TODO(@lishaduck): Evaluate calling the API instead.
Copy link
Contributor Author

@lishaduck lishaduck Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pros:

  • Direct call (perf)
  • Clearer dependency chain (sorta con, see below)
  • Works even if npx isn't on path
  • Fewer Windows gotchas

Cons:

  • Would show up as unmaintained on socket, etc (which is true, it is)
  • Depends on deprecated packages (which is true, we do)
  • Bloats node_modules for 99% of users

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also inline the functionality of the package: support only the common ones and let the user opt-out if they want a different one.

lib/new-package.js Show resolved Hide resolved
lib/new-package.js Show resolved Hide resolved
lib/new-package.js Show resolved Hide resolved
lib/new-package.js Outdated Show resolved Hide resolved
lib/new-package.js Show resolved Hide resolved
lib/new-package.js Show resolved Hide resolved
lib/new-package.js Show resolved Hide resolved
@lishaduck lishaduck force-pushed the update-pkg-json branch 2 times, most recently from b1a4c57 to ab5556e Compare November 11, 2024 02:01
@lishaduck
Copy link
Contributor Author

I've noticed this there's a test that's been flaking ("Running using other configuration (without errors)"):

-- UNEXPECTED ERROR ------------------------------------------------------------

I ran into an unexpected error. Please open an issue at the following link:
  https://github.com/jfmengels/node-elm-review/issues/new

Please include this error message and as much detail as you can provide. Running
with --debug might give additional information. If you can, please provide a
setup that makes it easy to reproduce the error. That will make it much easier
to fix the issue.

Below is the error that was encountered.
--------------------------------------------------------------------------------
<local-path>/test/project-with-errors/elm-stuff/generated-code/jfmengels/elm-review/cli/<version>/review-applications/bd2a2bb6c965dac5241ce8c4d0615d83.js:10328
    		$temp$offset = offset + 
    						                    

SyntaxError: Unexpected end of input

  at loadCompiledElmApp (<local-path>/lib/load-compiled-app.js:28:18)
  at initWithoutWorker (<local-path>/lib/app-wrapper.js:144:21)
  "
  at Object.test (test/review.test.js:37:1)

@lishaduck lishaduck marked this pull request as ready for review November 11, 2024 02:17
@jfmengels
Copy link
Owner

I've noticed this there's a test that's been flaking ("Running using other configuration (without errors)"):

Yes, I've noticed the same thing. I had a look, thinking it could be us not waiting for the compilation to be finalized, but the code looks fine. I still think it's the writing of the file (or the loading of it, but that's weirder) that is getting cut off early somehow, but I haven't figured out how yet. 🤔

It sounds pretty recent though. I don't think we saw this one before, but I could be wrong.

@jfmengels jfmengels merged commit 0cad168 into jfmengels:main Nov 11, 2024
3 checks passed
@jfmengels
Copy link
Owner

Thank you for the changes!

@lishaduck lishaduck deleted the update-pkg-json branch November 11, 2024 13:33
@lishaduck
Copy link
Contributor Author

lishaduck commented Nov 11, 2024

It sounds pretty recent though. I don't think we saw this one before, but I could be wrong.

Well, it's really started flaking. Will look into it.
For reference, here's the first failure from it: https://github.com/jfmengels/node-elm-review/actions/runs/11769034390/job/32779541170

Commit-wise, there was a different flake on #306 (it's older than my work here, I think I remember seeing it a while ago), and then fs-extra (#303) seems to have started this flake.

Am gonna try to see if I reproduce it before #303.

@lishaduck
Copy link
Contributor Author

Was able to repro with 38453c1, so sadly not #303.

@lishaduck
Copy link
Contributor Author

lishaduck commented Nov 11, 2024

Huh. I can't repro on #304 for the life of me,1 so I guess it's gotta be #306 (or, I suppose, #305), which makes no sense.

Footnotes

  1. I've run tests 10+ 9 times on the commit, to no avail.

@lishaduck
Copy link
Contributor Author

@jfmengels, any ideas?

@lishaduck lishaduck mentioned this pull request Nov 12, 2024
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 this pull request may close these issues.

2 participants