Fix the type error in release.ts

This commit is contained in:
Aria Minaei 2023-08-07 17:08:04 +02:00
parent 3434e166a5
commit ee3c2ff557
2 changed files with 6 additions and 6 deletions

View file

@ -52,8 +52,8 @@ function getNewVersionName(packageName: string, commitHash: string) {
// are almost always different from the rest of the packages.
const pathToPackageJson =
packageName === '@theatre/r3f'
? path.resolve(__dirname, '..', 'packages', 'r3f', 'package.json')
: path.resolve(__dirname, '../', './package.json')
? path.resolve(__dirname, '../..', 'packages', 'r3f', 'package.json')
: path.resolve(__dirname, '../../', './package.json')
const jsonData = JSON.parse(
fs.readFileSync(pathToPackageJson, {encoding: 'utf-8'}),
@ -78,7 +78,7 @@ async function writeVersionsToPackageJSONs(
for (const workspaceData of workspacesListObjects) {
const pathToPackage = path.resolve(
__dirname,
'../',
'../..',
workspaceData.location,
'./package.json',
)

View file

@ -8,7 +8,7 @@
*/
import * as path from 'path'
import {readFileSync, writeFileSync} from 'fs'
import {$} from '@cspotcode/zx'
import {$, argv} from '@cspotcode/zx'
/**
* This script publishes all packages to npm.
@ -89,7 +89,7 @@ async function release() {
process.exit(1)
}
const previousVersion = require('../package.json').version
const previousVersion = require('../../package.json').version
if (version === previousVersion) {
console.error(`Version ${version} is already assigned to root/package.json`)
@ -196,7 +196,7 @@ async function writeVersionsToPackageJSONs(monorepoVersion: string) {
for (const packagePathRelativeFromRoot of packagesWhoseVersionsShouldBump) {
const pathToPackage = path.resolve(
__dirname,
'../',
'../..',
packagePathRelativeFromRoot,
'./package.json',
)