11/* eslint-disable no-console */
2- const { execSync } = require ( 'node:child_process' ) ;
3- const fs = require ( 'node:fs' ) ;
4- const path = require ( 'node:path' ) ;
2+ import { execSync } from 'node:child_process' ;
3+ import { writeFileSync } from 'node:fs' ;
4+ import { dirname , join } from 'node:path' ;
5+ import { fileURLToPath } from 'node:url' ;
56
6- const PKG_JSON_PATH = path . join ( __dirname , '..' , '..' , 'package.json' ) ;
7+ const PKG_JSON_PATH = join ( dirname ( fileURLToPath ( import . meta . url ) ) , '..' , '..' , 'package.json' ) ;
78
89// eslint-disable-next-line import/no-dynamic-require
910const pkgJson = require ( PKG_JSON_PATH ) ;
@@ -15,7 +16,7 @@ const nextVersion = addBetaSuffixToVersion(VERSION);
1516console . log ( `before-deploy: Setting version to ${ nextVersion } ` ) ;
1617pkgJson . version = nextVersion ;
1718
18- fs . writeFileSync ( PKG_JSON_PATH , `${ JSON . stringify ( pkgJson , null , 2 ) } \n` ) ;
19+ writeFileSync ( PKG_JSON_PATH , `${ JSON . stringify ( pkgJson , null , 2 ) } \n` ) ;
1920
2021function addBetaSuffixToVersion ( version ) {
2122 const versionString = execSync ( `npm show ${ PACKAGE_NAME } versions --json` , { encoding : 'utf8' } ) ;
0 commit comments