Open rajsite opened 2 years ago
With npm 8, a dsp package is now very difficult to use in a monorepo. When the Adobe DSP addon attempts to run npm install in the dsp folder the npm cli now behaves well and has that command run at the root of the repo. Unfortunately that means the Adobe DSP tool cannot find the styledictionary instance that was installed.
The DSP extension should be trying to find the styledictionary relying on node module resolution instead of assuming the file is located in a node_modules folder next the the package, ie:
function resolvePackagePath(packageName) {
return path.dirname(require.resolve(`${packageName}/package.json`));
}
resolvePackagePath('style-dictionary');
When the design system package is used inside an npm 7 monorepo the vscode extension is not aware of that and runs npm install from within the directory instead of the monorepo root.
In addition it updates the package.json in the design system package folder of the monrepo but that leaves the monorepo root package-lock.json outdated.
What I expect is the package.json for the design system package to be updated the correct version of style-dictionary and for the the actual npm install command to happen at the monorepo root.
Alternatively I would like to have a configuration setting to opt-out of automatic npm installs and instead show a notification that packages at a specific version are needed.