MCPcopy
hub / github.com/epicweb-dev/react-performance / updatePkgNames

Function updatePkgNames

epicshop/fix.js:52–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

fix.jsFile · 0.85

Calls 2

relativeToWorkshopRootFunction · 0.85
writeIfNeededFunction · 0.85

Tested by

no test coverage detected