-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add optional fallback of a macroCorePath environment variable #1418
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coverage reportTotal coverage
Show files with reduced coverage 🔻Reduced coverage
Report generated by 🧪jest coverage report action from 99bc3ba |
mulahasanovic
previously approved these changes
Dec 11, 2025
mulahasanovic
previously approved these changes
Dec 12, 2025
allanbowe
approved these changes
Dec 16, 2025
|
🎉 This PR is included in version 4.12.16 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
@sasjs/clihas some dependencies on@sasjs/core.When
@sasjs/cliis used in pipeline testing of an updated@sasjs/corepackage it is preferable to use the updated@sasjs/corein place of the cli'snode_modules/@sasjs/core.In a clean environment, with no installed npm packages, an invocation of
npx @sasjs/cliwith thebuildargument results in failure as no installation of@sasjs/coreis returned by thegetNodeModulesPath()function (npx caches the@sasjs/coredependency locally but that temporarynode_modulespath is not being considered).Intent
@sasjs/clisearches for the@sasjs/corefolder, first read an environment variable that points at the root directory of a chosen local @sasjs/core package. This permits over-riding the @sasjs/core installed as the cli's node_modules dependency.If no such environment variable is found, or if it is blank, rely instead on node's
require.resolve()routine to determine the required package's node_modules path.preandpostnpm scripts.Implementation
src/utils/setConstants.tshas the job of declaringsasjsConstants.macroCorePathas the path to use.macroCorePathis now first set from the value of an environment variable (also namedmacroCorePath). In the even that it is blank a secondary call togetNodeModulePath('@sasjs/core')should return a non-blank value unless the@sasjs/coredependency has accidentally been removed from the package.json.A blank value for
sasjsConstants.macroCorePathis still a possibility and is acceptable for some functionality within@sasjs/cli.However, for a
sasjscommand that requests abuild, this path is required and processing only continues inbuild.tsif the value is populated, otherwise an informational error message is thrown and the process halts at an early build stage..npmrccontaining theignore-scripts=truedirective configuresnpmto skip automatic processing of associated scripts with apreorpostprefix when running a given script name (i.e. givennpm install, no script namedpreinstallorpostinstallwill also be executed in the same submission)Checks
npm run lint:fix).npm test).Reviewer checks