MCPcopy Create free account
hub / github.com/epicweb-dev/react-suspense / updatePkgNames

Function updatePkgNames

epicshop/fix.js:51–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

fix.jsFile · 0.85

Calls 2

relativeToWorkshopRootFunction · 0.85
writeIfNeededFunction · 0.85

Tested by

no test coverage detected