@@ -4,7 +4,7 @@ $.verbose = true
4
4
import { join } from 'node:path'
5
5
import { readFileSync , writeFileSync } from 'node:fs'
6
6
7
- const root = path . resolve ( __dirname )
7
+ const root = import . meta . dirname
8
8
9
9
const fastifyViteVersion = getVersion ( 'fastify-vite' )
10
10
const fastifyVueVersion = getVersion ( 'fastify-vue' )
@@ -31,7 +31,7 @@ if (process.argv.includes('--prep-for-release')) {
31
31
await prepForRelease ( )
32
32
}
33
33
34
- async function prepForRelease ( ) {
34
+ async function prepForRelease ( ) {
35
35
const starterRoot = join ( root , 'starters' )
36
36
cd ( starterRoot )
37
37
// Remove optionalDependencies from @fastify /vite's package.json
@@ -51,10 +51,12 @@ async function prepForRelease () {
51
51
}
52
52
writeFileSync ( join ( starterRoot , starter , 'package.json' ) , JSON . stringify ( pkgJSON , null , 2 ) )
53
53
}
54
+ cd ( root )
55
+ await $ `pnpm i`
54
56
process . exit ( )
55
57
}
56
58
57
- async function prepForDev ( ) {
59
+ async function prepForDev ( ) {
58
60
const starterRoot = join ( root , 'starters' )
59
61
cd ( starterRoot )
60
62
// Add optionalDependencies to @fastify /vite's package.json
@@ -82,7 +84,7 @@ async function prepForDev () {
82
84
process . exit ( )
83
85
}
84
86
85
- async function runAllTests ( ) {
87
+ async function runAllTests ( ) {
86
88
cd ( join ( root , 'packages/fastify-vite' ) )
87
89
88
90
await $ `npx vitest run`
@@ -111,7 +113,7 @@ async function runAllTests () {
111
113
process . exit ( )
112
114
}
113
115
114
- function getVersion ( pkg ) {
116
+ function getVersion ( pkg ) {
115
117
const pkgJSON = JSON . parse (
116
118
readFileSync ( join ( root , 'packages' , pkg , 'package.json' ) )
117
119
)
0 commit comments