Skip to content

Commit ac51a32

Browse files
authored
Add src/ directory to TypeScript starters (#264)
1 parent 8502a38 commit ac51a32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+166
-736
lines changed

package.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $.verbose = true
44
import { join } from 'node:path'
55
import { readFileSync, writeFileSync } from 'node:fs'
66

7-
const root = path.resolve(__dirname)
7+
const root = import.meta.dirname
88

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

34-
async function prepForRelease () {
34+
async function prepForRelease() {
3535
const starterRoot = join(root, 'starters')
3636
cd(starterRoot)
3737
// Remove optionalDependencies from @fastify/vite's package.json
@@ -51,10 +51,12 @@ async function prepForRelease () {
5151
}
5252
writeFileSync(join(starterRoot, starter, 'package.json'), JSON.stringify(pkgJSON, null, 2))
5353
}
54+
cd(root)
55+
await $`pnpm i`
5456
process.exit()
5557
}
5658

57-
async function prepForDev () {
59+
async function prepForDev() {
5860
const starterRoot = join(root, 'starters')
5961
cd(starterRoot)
6062
// Add optionalDependencies to @fastify/vite's package.json
@@ -82,7 +84,7 @@ async function prepForDev () {
8284
process.exit()
8385
}
8486

85-
async function runAllTests () {
87+
async function runAllTests() {
8688
cd(join(root, 'packages/fastify-vite'))
8789

8890
await $`npx vitest run`
@@ -111,7 +113,7 @@ async function runAllTests () {
111113
process.exit()
112114
}
113115

114-
function getVersion (pkg) {
116+
function getVersion(pkg) {
115117
const pkgJSON = JSON.parse(
116118
readFileSync(join(root, 'packages', pkg, 'package.json'))
117119
)

0 commit comments

Comments
 (0)