MCPcopy Index your code
hub / github.com/epicweb-dev/advanced-react-patterns / updatePkgNames

Function updatePkgNames

epicshop/fix.js:54–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

fix.jsFile · 0.85

Calls 2

relativeToWorkshopRootFunction · 0.85
writeIfNeededFunction · 0.85

Tested by

no test coverage detected