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

-o dist/my-parser.js errors if dist/ doesn't exist #440

Closed
jcbhmr opened this issue Sep 15, 2023 · 0 comments
Closed

-o dist/my-parser.js errors if dist/ doesn't exist #440

jcbhmr opened this issue Sep 15, 2023 · 0 comments

Comments

@jcbhmr
Copy link

jcbhmr commented Sep 15, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch peggy@3.0.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/peggy/bin/peggy-cli.js b/node_modules/peggy/bin/peggy-cli.js
index b3130a0..0107699 100644
--- a/node_modules/peggy/bin/peggy-cli.js
+++ b/node_modules/peggy/bin/peggy-cli.js
@@ -439,6 +439,7 @@ class PeggyCLI extends Command {
       return Promise.resolve(hasTest ? this.std.out : null);
     }
     return new Promise((resolve, reject) => {
+      fs.mkdirSync(path.dirname(this.outputFile), { recursive: true });
       const outputStream = fs.createWriteStream(this.outputFile);
       outputStream.on("error", reject);
       outputStream.on("open", () => resolve(outputStream));

This issue body was partially generated by patch-package.

@hildjj hildjj mentioned this issue Jan 28, 2024
21 tasks
hildjj added a commit to hildjj/peggy that referenced this issue Feb 10, 2024
@hildjj hildjj closed this as completed in 3aeb0da Feb 11, 2024
hildjj added a commit to hildjj/peggy that referenced this issue Feb 13, 2024
* main: (107 commits)
  Version update.  Check npmignore.  Audit CHANGELOG.md.
  4.0.0
  Update dependencies final time before release.
  Fix indentation in one part of examples/javascript.pegjs.  Fixes peggyjs#445.
  Code review issues
  Add developer docs.  Fixes peggyjs#466.
  Add directories when they don't exist, rather than throwing an error.  Fixes peggyjs#440.
  Update changelog.  Include peggyjs#463 as well.
  Fix peggyjs#379.  Move reportInfiniteRecursion to prepare phase, ensure that it doesn't keep going when it finds an error.
  Typo: 'rutimes'
  Mark IE as explicitly unsupported
  Switch to flat eslint config.  Lint minified output for web compat.
  Code review nits
  Add tests, fix up fromMem to not need gross hack.
  Adds support for running tests against es module output.  Fixes peggyjs#399.
  Slight wording tweak.  Double-checked that peggyjs#415 is fixed.
  Fixes peggyjs#434
  Update bundles as well
  Fixes peggyjs#450
  Update dependencies, including new lint rules.  Move to simpler tsconfig so that eslint can easily find the correct file.  Fix small lint issues with new rules.
  ...
hildjj added a commit that referenced this issue Feb 13, 2024
* main: (107 commits)
  Version update.  Check npmignore.  Audit CHANGELOG.md.
  4.0.0
  Update dependencies final time before release.
  Fix indentation in one part of examples/javascript.pegjs.  Fixes #445.
  Code review issues
  Add developer docs.  Fixes #466.
  Add directories when they don't exist, rather than throwing an error.  Fixes #440.
  Update changelog.  Include #463 as well.
  Fix #379.  Move reportInfiniteRecursion to prepare phase, ensure that it doesn't keep going when it finds an error.
  Typo: 'rutimes'
  Mark IE as explicitly unsupported
  Switch to flat eslint config.  Lint minified output for web compat.
  Code review nits
  Add tests, fix up fromMem to not need gross hack.
  Adds support for running tests against es module output.  Fixes #399.
  Slight wording tweak.  Double-checked that #415 is fixed.
  Fixes #434
  Update bundles as well
  Fixes #450
  Update dependencies, including new lint rules.  Move to simpler tsconfig so that eslint can easily find the correct file.  Fix small lint issues with new rules.
  ...
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

No branches or pull requests

1 participant