From ee3c2ff557b6e7c13f5db82f47de2d2632120f21 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Mon, 7 Aug 2023 17:08:04 +0200 Subject: [PATCH] Fix the type error in release.ts --- devEnv/scripts/prerelease.ts | 6 +++--- devEnv/scripts/release.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/devEnv/scripts/prerelease.ts b/devEnv/scripts/prerelease.ts index 2f0e1c6..0b8f8b8 100644 --- a/devEnv/scripts/prerelease.ts +++ b/devEnv/scripts/prerelease.ts @@ -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', ) diff --git a/devEnv/scripts/release.ts b/devEnv/scripts/release.ts index d71f238..2ff9bbd 100644 --- a/devEnv/scripts/release.ts +++ b/devEnv/scripts/release.ts @@ -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', )