Testing changes during cli development
See original GitHub issueI’m submitting a feature request
- Library Version: 0.23.0
Please tell us about your environment:
-
Operating System: Linux (Ubuntu)
-
Node Version: 6.5.0
- NPM Version: 3.10.0
-
Browser: all
-
Language: all
Current behavior: When making changes to the cli, in order to test it, one must either
- Edit the node_modules/aurelia-cli folder in a test project, or
- edit the files in the global installation when making changes that affect e.g. the new command.
When trying to do an npm link
on the dev directory, npm will complain about esprima not being installed:
Error: Cannot find module 'esprima'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at /home/shoff/aurelia/aurelia/cli/lib/build/amodro-trace/lib/parse.js:5:62
at Array.map (native)
at define (/home/shoff/aurelia/aurelia/cli/lib/build/amodro-trace/lib/parse.js:5:36)
at Object.<anonymous> (/home/shoff/aurelia/aurelia/cli/lib/build/amodro-trace/lib/parse.js:10:1)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
Expected/desired behavior:
-
What is the expected behavior? Using
npm link
,npm install ./cli
ornode bin/aurelia-cli.js
, the cli should work as normal, but with the local changes. Installing esprima as a dependeny or devDependency solves this. For some reason, usingnpm i -g aurelia-cli
does not produce the same error, even although esprima cannot be found anywhere in the global installation. Adding the dependency might in fact save from future trouble as it becomes clear where it comes from. amodro-trace, which requires this module, has esprima in its dependencies. Therefore, I assume this would also be a good place for it in the cli. -
What is the motivation / use case for changing the behavior? Testing changes to the cli should be easy and not involve having to potentially even edit the global installation manually.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
@JeroenVinke I would like to address adding some form of documentation to this to avoid future ‘how do I test the cli?’ kind of questions. Even although now all it takes is an
npm link
, I feel like a line on it in the README or CONTRIBUTING would be appropriate.Worked like a charm and sorry for answering so late.