Repository navigation
Conversation
e4e9e02 to
7468b01
Compare
|
build/itest are red on this PR, same as everywhere else right now (#1233). Not merging until CI is green. Generated by Claude Code |
e4b2e03 to
1fdd71a
Compare
zaguzovmaksim0-hue
left a comment
There was a problem hiding this comment.
The premise of this fix is no longer true on current master, so I don't think deleting main is the best resolution now.
src/eoc.js currently wraps CLI execution in if (require.main === module), so requiring that file does not call program.parseAsync(process.argv). It also deliberately exports commandsDescription, canonicalLanguage, and select, and the test suite imports this module directly. In other words, the entry file is now safe to load and already has a small programmatic surface.
With this PR, require('eolang') still fails — Node just falls back to a missing index.js. Changing main from eoc to src/eoc.js would instead fix the reported package-level import while preserving the CLI under bin.
Please update the metadata to point main at the guarded real entry file (and ideally add a regression that requires the package root) rather than removing the field.
|
Agreed, changed it: |
package.jsonhad"main": "eoc", a file that does not exist, sorequire('eolang')failed.src/eoc.jsruns the command line only underrequire.main === moduleand exportscommandsDescription,canonicalLanguage,tcpPortandselect, somainnow points at it. The CLI underbinis not touched.The new
test/test_main.jsrequires the package root and checks two of the exports; it fails with the oldmain.Closes #1173