Fix the type error in release.ts
This commit is contained in:
parent
3434e166a5
commit
ee3c2ff557
2 changed files with 6 additions and 6 deletions
|
@ -52,8 +52,8 @@ function getNewVersionName(packageName: string, commitHash: string) {
|
||||||
// are almost always different from the rest of the packages.
|
// are almost always different from the rest of the packages.
|
||||||
const pathToPackageJson =
|
const pathToPackageJson =
|
||||||
packageName === '@theatre/r3f'
|
packageName === '@theatre/r3f'
|
||||||
? path.resolve(__dirname, '..', 'packages', 'r3f', 'package.json')
|
? path.resolve(__dirname, '../..', 'packages', 'r3f', 'package.json')
|
||||||
: path.resolve(__dirname, '../', './package.json')
|
: path.resolve(__dirname, '../../', './package.json')
|
||||||
|
|
||||||
const jsonData = JSON.parse(
|
const jsonData = JSON.parse(
|
||||||
fs.readFileSync(pathToPackageJson, {encoding: 'utf-8'}),
|
fs.readFileSync(pathToPackageJson, {encoding: 'utf-8'}),
|
||||||
|
@ -78,7 +78,7 @@ async function writeVersionsToPackageJSONs(
|
||||||
for (const workspaceData of workspacesListObjects) {
|
for (const workspaceData of workspacesListObjects) {
|
||||||
const pathToPackage = path.resolve(
|
const pathToPackage = path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../',
|
'../..',
|
||||||
workspaceData.location,
|
workspaceData.location,
|
||||||
'./package.json',
|
'./package.json',
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*/
|
*/
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import {readFileSync, writeFileSync} from 'fs'
|
import {readFileSync, writeFileSync} from 'fs'
|
||||||
import {$} from '@cspotcode/zx'
|
import {$, argv} from '@cspotcode/zx'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This script publishes all packages to npm.
|
* This script publishes all packages to npm.
|
||||||
|
@ -89,7 +89,7 @@ async function release() {
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousVersion = require('../package.json').version
|
const previousVersion = require('../../package.json').version
|
||||||
|
|
||||||
if (version === previousVersion) {
|
if (version === previousVersion) {
|
||||||
console.error(`Version ${version} is already assigned to root/package.json`)
|
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) {
|
for (const packagePathRelativeFromRoot of packagesWhoseVersionsShouldBump) {
|
||||||
const pathToPackage = path.resolve(
|
const pathToPackage = path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../',
|
'../..',
|
||||||
packagePathRelativeFromRoot,
|
packagePathRelativeFromRoot,
|
||||||
'./package.json',
|
'./package.json',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue