Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $.verbose = true
import { join } from 'node:path'
import { readFileSync, writeFileSync } from 'node:fs'

const root = path.resolve(__dirname)
const root = import.meta.dirname

const fastifyViteVersion = getVersion('fastify-vite')
const fastifyVueVersion = getVersion('fastify-vue')
Expand All @@ -31,7 +31,7 @@ if (process.argv.includes('--prep-for-release')) {
await prepForRelease()
}

async function prepForRelease () {
async function prepForRelease() {
const starterRoot = join(root, 'starters')
cd(starterRoot)
// Remove optionalDependencies from @fastify/vite's package.json
Expand All @@ -51,10 +51,12 @@ async function prepForRelease () {
}
writeFileSync(join(starterRoot, starter, 'package.json'), JSON.stringify(pkgJSON, null, 2))
}
cd(root)
await $`pnpm i`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to get the optionalDependencies out of pnpm-lock.yaml

process.exit()
}

async function prepForDev () {
async function prepForDev() {
const starterRoot = join(root, 'starters')
cd(starterRoot)
// Add optionalDependencies to @fastify/vite's package.json
Expand Down Expand Up @@ -82,7 +84,7 @@ async function prepForDev () {
process.exit()
}

async function runAllTests () {
async function runAllTests() {
cd(join(root, 'packages/fastify-vite'))

await $`npx vitest run`
Expand Down Expand Up @@ -111,7 +113,7 @@ async function runAllTests () {
process.exit()
}

function getVersion (pkg) {
function getVersion(pkg) {
const pkgJSON = JSON.parse(
readFileSync(join(root, 'packages', pkg, 'package.json'))
)
Expand Down
Loading