By using npm link
, you can make use of your locally compiled Node Modules. This is especially useful for testing changes in the Lightning Flow Scanner core module without needing to publish a new version. Here are the steps to do this:
- Clone the Core Module: Ensure you have cloned the
lightning-flow-scanner-core
repository locally. - Link the Core Module: Navigate to the core module's directory and run the following command:
npm link
- Link to Project: Navigate to the VS Code extension or SFDX plugin directory and run:
Once linked, your local version will be updated in the VS Code extension or SFDX plugin every time you run a new build.
npm link lightning-flow-scanner-core
- Compile the Project: Run the following command to verify compilation:
Alternatively, you can use:
npm run watch
npm run prepack
- Launch Application: After compiling, launch the application to test your changes.
-
Compile the Project: Run the following command to verify compilation:
npm run prepack
-
Open Example Project: Open the terminal and run the following command in the directory of an example flow project (or any other project that is supposed to be scanned):
NODE_OPTIONS=--inspect-brk /Users/rubenhalman/Projects/lightning-flow-scanner-sfdx/bin/run flow:scan
-
Attach Debugger: Go back to your local SFDX project in VS Code, set your desired breakpoints, and attach the debugger to the remote process.
Once you have tested your changes, you can publish the new package version by running:
npm publish