fix(cli): various fixes for adding custom modes and extensions (#3683)

Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
Joe BoccanfusoandAlireza authored and GitHub committed 2023-09-29 10:35:30 -04:00
1 parent 52da92fed4
commit dc73b18748
11 files changed
+61 -246

No files matched your search

+1 -1
View File
@@ -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(
@@ -44,6 +44,7 @@
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.13.0",
"@babel/plugin-proposal-private-property-in-object":"7.21.11",
"babel-eslint": "9.x",
"babel-loader": "^8.2.4",
"babel-plugin-inline-react-svg": "^2.0.2",
@@ -17,10 +17,11 @@
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
},
"peerDependencies": {
"@ohif/core": "^3.0.0"
"@ohif/core": "^{LATEST_OHIF_VERSION}"
},
"dependencies": {
"@babel/runtime": "^7.20.13"
"@babel/runtime": "^7.20.13",
"@ohif/mode-longitudinal": "^{LATEST_OHIF_VERSION}"
},
"devDependencies": {
"@babel/core": "^7.21.4",