How do I work on Lezer?

Just opened my first PR! (Draft): Make error message for conflict contain suggestions of a couple resolution paths by NullVoxPopuli · Pull Request #13 · lezer-parser/generator · GitHub

Though, I need help, because I noticed that

  • no CONTRIBUTING.md
  • no development/contributing section in README.md
  • no .github/ci.yml file

I assumed npm based on the package.json#scripts, but that didn’t get me very far. When I tried to run a variety of different test command incantations, I got this error:

Error: Cannot find module '<repo>/dist/index.js' imported from <repo>/test/test-cases.ts
    at finalizeResolution (<repo>/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366:11)
    at moduleResolve (<repo>/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:801:10)
    at Object.defaultResolve (<repo>/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
    at <repo>/node_modules/ts-node/src/esm.ts:218:35
    at entrypointFallback (<repo>/node_modules/ts-node/src/esm.ts:168:34)
    at <repo>/node_modules/ts-node/src/esm.ts:217:14
    at addShortCircuitFlag (<repo>/node_modules/ts-node/src/esm.ts:409:21)
    at resolve (<repo>/node_modules/ts-node/src/esm.ts:197:12)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36)}

Which told me that the build didn’t work, even though I ran it (or thought I did).

What I had done is run npm run build:test-helper – but that was incorrect!

I had to run npm run build:main and then npm run test

Would be willing to have CONTRIBUTING.md and .github/ci.yml files added to all your repositories? I can PR them

Which package are you trying to work on? And did you npm install it before trying to run the tests?

the linked one, generator.

Yes, I npm installed first. I also got tests running and pushed up a test