MCPcopy Create free account
hub / github.com/epicweb-dev/full-stack-foundations / updatePkgNames

Function updatePkgNames

epicshop/fix.js:57–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57async function updatePkgNames() {
58 for (const file of appsWithPkgJson) {
59 const pkgjsonPath = path.join(file, 'package.json')
60 const pkg = JSON.parse(await fs.promises.readFile(pkgjsonPath, 'utf8'))
61 pkg.name = relativeToWorkshopRoot(file).replace(/\\|\//g, '__sep__')
62 const written = await writeIfNeeded(
63 pkgjsonPath,
64 `${JSON.stringify(pkg, null, 2)}\n`,
65 )
66 if (written) {
67 console.log(`updated ${path.relative(process.cwd(), pkgjsonPath)}`)
68 }
69 }
70}
71
72async function updateTsconfig() {
73 const tsconfig = {

Callers 1

fix.jsFile · 0.85

Calls 2

relativeToWorkshopRootFunction · 0.85
writeIfNeededFunction · 0.85

Tested by

no test coverage detected