Script to build and modify workspaces before publishing to NPM
Usage
Importing the module
import * as path from 'path';
import { NpmExtensions } from '@trayio/tray-npm';
const dependencyVersionUpdater = new NpmExtensions();
const rootWorkspacesPath = process.env.PROJECT_CWD || '';
const modulePath = process.env.INIT_CWD || '';
const rootPackageJsonPath = path.join(rootWorkspacesPath, 'package.json');
const modulePackageJsonPath = path.join(modulePath, 'package.json');
dependencyVersionUpdater.resolveDependencyVersions(
rootPackageJsonPath,
modulePackageJsonPath
)
NPM
npx npmx resolveDependencies