fix(cli): various fixes for adding custom modes and extensions (#3683)
Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
52da92fed4
commit
dc73b18748
11 files changed
+61
-246
No files matched your search
@@ -48,7 +48,7 @@ async function linkPackage(packageDir, options, addToConfig, keyword) {
|
||||
const newLine = `path.resolve(__dirname, '${packageNodeModules}'),`;
|
||||
const modifiedFileContent = fileContent.replace(
|
||||
/(modules:\s*\[)([\s\S]*?)(\])/,
|
||||
`$1$2 ${newLine}$3`
|
||||
`$1$2 ${newLine.replace(/\\/g, '/')}$3`
|
||||
);
|
||||
|
||||
await fs.promises.writeFile(webpackConfigPath, modifiedFileContent);
|
||||
|
||||
@@ -4,10 +4,14 @@ import path from 'path';
|
||||
async function editPackageJson(options) {
|
||||
const { name, version, description, author, license, targetDir } = options;
|
||||
|
||||
const ohifVersion = fs.readFileSync('./version.txt', 'utf8');
|
||||
|
||||
// read package.json from targetDir
|
||||
const dependenciesPath = path.join(targetDir, 'dependencies.json');
|
||||
const rawData = fs.readFileSync(dependenciesPath, 'utf8');
|
||||
const packageJson = JSON.parse(rawData);
|
||||
|
||||
const dataWithOHIFVersion = rawData.replace(/\{LATEST_OHIF_VERSION\}/g, ohifVersion);
|
||||
const packageJson = JSON.parse(dataWithOHIFVersion);
|
||||
|
||||
// edit package.json
|
||||
const mergedObj = Object.assign(
|
||||
|
||||
Reference in new issue
Block a user