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

chore: add npm dev script #5031

Merged
merged 1 commit into from
Feb 5, 2024
Merged

chore: add npm dev script #5031

merged 1 commit into from
Feb 5, 2024

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Feb 2, 2024

To aid in debugging and development of the Typescript parts of the CLI, this adds an npm script entrypoint to the CLI.

This doesn't run the complete CLI but may be useful for isolating and debugging Typescript CLI issues.

This is not a user-facing change.

Usage:

npm run dev test to run the equivalent of snyk test from Typescript source.

npm run dev -- -d to pass the debug -d flag to the Typescript main entrypoint (and not npm run).

@cmars cmars requested a review from a team as a code owner February 2, 2024 22:06
@@ -43,7 +43,8 @@
"test:unit": "jest --runInBand --testPathPattern '/test(/jest)?/unit/'",
"test:acceptance": "jest --runInBand --testPathPattern '/test(/jest)?/acceptance/'",
"test:tap": "tap -Rspec --timeout=300 test/tap/*.test.* ",
"test:smoke": "./scripts/run-smoke-tests-locally.sh"
"test:smoke": "./scripts/run-smoke-tests-locally.sh",
"dev": "ts-node ./src/cli/index.ts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion: In order to facilitate the usage of the Makefile, how about adding this to the Makefile? For example like this:

make run // runs the Extensible CLI
make run-ts // runs only the TS/Legacy CLI

Copy link
Collaborator

Choose a reason for hiding this comment

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

The final goal could be to not be required to use npm calls anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added. Both targets check for an ARGS variable, which is used to specify the CLI arguments through make.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My preference would be to keep the npm script, but also wrap it with make. The npm script is easier to use with a debug launch profile in VSCode, and it inherits the right $PATH.

Makefile Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
To aid in debugging and development of the Typescript parts of the CLI, adding
an npm script entrypoint to the CLI.

This doesn't run the complete CLI but is useful for isolating and debugging
Typescript CLI issues.

Added Makefile targets for running the full extensible CLI and TS entrypoint.
@cmars cmars merged commit 3716b5d into master Feb 5, 2024
16 checks passed
@cmars cmars deleted the chore/npm-dev-command branch February 5, 2024 20:44
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