wbfy 1.22.0 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,7 +77,7 @@ packaged.yaml
77
77
  android/app/src/main/assets/
78
78
  `),n.depending.storybook&&r.push("storybookjs"),n.depending.blitz&&(r.push("nextjs"),o+=`.blitz/
79
79
  .blitz**
80
- `);let i="";for(let s of r){if(!ee.has(s)){let m=`https://www.toptal.com/developers/gitignore/api/${s}`,u=await(await L(m)).text();if(u.includes("Attention Required!")){console.error(`Failed to fetch ${m}`);return}ee.set(s,u)}i+=ee.get(s)}h.isBerryZeroInstallEnabled(t)||(i=i.replace("!.yarn/cache","# !.yarn/cache").replace("# .pnp.*",".pnp.*")),(e.containingPomXml||e.containingPubspecYaml)&&(i=i.replace(/^# .idea\/artifacts$/gm,".idea/artifacts").replace(/^# .idea\/compiler.xml$/gm,".idea/compiler.xml").replace(/^# .idea\/jarRepositories.xml$/gm,".idea/jarRepositories.xml").replace(/^# .idea\/modules.xml$/gm,".idea/modules.xml").replace(/^# .idea\/*.iml$/gm,".idea/*.iml").replace(/^# .idea\/modules$/gm,".idea/modules").replace(/^# *.iml$/gm,"*.iml").replace(/^# *.ipr$/gm,"*.ipr"),e.containingPubspecYaml&&(i=i.replace(/^.idea\/modules.xml$/gm,"# .idea/modules.xml"))),i=i.replace(/^.idea\/?$/gm,"# .idea"),(n.depending.reactNative||e.depending.reactNative||e.containingPubspecYaml)&&(i=i.replace(/^(.idea\/.+)$/gm,`$1
80
+ `);let i="";for(let s of r){if(!ee.has(s)){let m=`https://www.toptal.com/developers/gitignore/api/${s}`,f=await(await L(m)).text();if(f.includes("Attention Required!")){console.error(`Failed to fetch ${m}`);return}ee.set(s,f)}i+=ee.get(s)}h.isBerryZeroInstallEnabled(t)||(i=i.replace("!.yarn/cache","# !.yarn/cache").replace("# .pnp.*",".pnp.*")),(e.containingPomXml||e.containingPubspecYaml)&&(i=i.replace(/^# .idea\/artifacts$/gm,".idea/artifacts").replace(/^# .idea\/compiler.xml$/gm,".idea/compiler.xml").replace(/^# .idea\/jarRepositories.xml$/gm,".idea/jarRepositories.xml").replace(/^# .idea\/modules.xml$/gm,".idea/modules.xml").replace(/^# .idea\/*.iml$/gm,".idea/*.iml").replace(/^# .idea\/modules$/gm,".idea/modules").replace(/^# *.iml$/gm,"*.iml").replace(/^# *.ipr$/gm,"*.ipr"),e.containingPubspecYaml&&(i=i.replace(/^.idea\/modules.xml$/gm,"# .idea/modules.xml"))),i=i.replace(/^.idea\/?$/gm,"# .idea"),(n.depending.reactNative||e.depending.reactNative||e.containingPubspecYaml)&&(i=i.replace(/^(.idea\/.+)$/gm,`$1
81
81
  android/$1`));let l=o+i;await d.generateFile(t,l)}var b=p(require("fs")),_=p(require("path"));var ne=p(require("child_process"));function v(e,n,t,o=0){do{let[r,i]=De(e,n,t);if(console.log(`$ ${r} at ${i.cwd}`),ne.default.spawnSync(r,i).status===0)break}while(--o>=0)}function ie(e,n,t){let[o,r]=De(e,n,t);return r.stdio="pipe",ne.default.spawnSync(o,r).stdout.toString().trim()}function De(e,n,t){let o=$({},process.env);o.PATH&&o.BERRY_BIN_FOLDER&&(o.PATH=o.PATH.replace(`${o.BERRY_BIN_FOLDER}:`,""));let r=`${e} ${n.join(" ")}`;return o.ASDF_DIR&&(r=`bash -l -c '. ${o.ASDF_DIR}/asdf.sh && ${r}'`),[r,{cwd:t,env:o,shell:!0,stdio:"inherit"}]}var oe="npm test",G={preCommit:"yarn lint-staged",prePush:"yarn typecheck",prePushForLab:`
82
82
  if [ $(git branch --show-current) = "main" ]; then
83
83
  echo "************************************************"
@@ -86,7 +86,7 @@ if [ $(git branch --show-current) = "main" ]; then
86
86
  exit 1
87
87
  fi
88
88
 
89
- yarn typecheck`.trim(),postMerge:"yarn"};async function Ee(e){var a,u,f;let n=_.default.resolve(e.dirPath,"package.json"),t=await b.default.promises.readFile(n,"utf-8"),o=JSON.parse(t);o.scripts||(o.scripts={}),delete o.scripts.postinstall,delete o.scripts.postpublish,delete o.scripts.prepare,delete o.scripts.prepublishOnly,delete o.scripts.prepack,delete o.scripts.postpack;let r=_.default.resolve(e.dirPath,".husky");await Promise.all([b.default.promises.writeFile(n,JSON.stringify(o,void 0,2)),b.default.promises.rm(r,{force:!0,recursive:!0})]),v("yarn",["dlx","husky-init","--yarn2"],e.dirPath);let i=_.default.resolve(r,"pre-commit"),l=await b.default.promises.readFile(i,"utf-8");if(await c.run(()=>b.default.promises.rm(_.default.resolve(e.dirPath,".huskyrc.json"),{force:!0})),await c.run(()=>b.default.promises.writeFile(i,l.replace(oe,G.preCommit))),e.containingTypeScript||e.containingTypeScriptInPackages){let w=(a=e.repository)!=null&&a.startsWith("github:WillBoosterLab/")?G.prePushForLab:G.prePush;await c.run(()=>b.default.promises.writeFile(_.default.resolve(r,"pre-push"),l.replace(oe,w),{mode:493}))}let s=[];(u=e.versionsText)!=null&&u.includes("python ")&&s.push("asdf install python"),e.versionsText&&s.push("asdf install"),s.push(G.postMerge),(f=e.versionsText)!=null&&f.includes("poetry ")&&s.push("poetry install"),e.depending.blitz?s.push("yarn blitz codegen"):e.depending.prisma&&s.push("yarn prisma generate");let m=l.replace(oe,s.join(" && "));await c.run(()=>b.default.promises.writeFile(_.default.resolve(r,"post-merge"),m,{mode:493}))}var re=p(require("fs")),se=p(require("path"));var Ft=`<?xml version="1.0" encoding="UTF-8"?>
89
+ yarn typecheck`.trim(),postMerge:"yarn"};async function Ee(e){var a,f,u;let n=_.default.resolve(e.dirPath,"package.json"),t=await b.default.promises.readFile(n,"utf-8"),o=JSON.parse(t);o.scripts||(o.scripts={}),delete o.scripts.postinstall,delete o.scripts.postpublish,delete o.scripts.prepare,delete o.scripts.prepublishOnly,delete o.scripts.prepack,delete o.scripts.postpack;let r=_.default.resolve(e.dirPath,".husky");await Promise.all([b.default.promises.writeFile(n,JSON.stringify(o,void 0,2)),b.default.promises.rm(r,{force:!0,recursive:!0})]),v("yarn",["dlx","husky-init","--yarn2"],e.dirPath);let i=_.default.resolve(r,"pre-commit"),l=await b.default.promises.readFile(i,"utf-8");if(await c.run(()=>b.default.promises.rm(_.default.resolve(e.dirPath,".huskyrc.json"),{force:!0})),await c.run(()=>b.default.promises.writeFile(i,l.replace(oe,G.preCommit))),e.containingTypeScript||e.containingTypeScriptInPackages){let w=(a=e.repository)!=null&&a.startsWith("github:WillBoosterLab/")?G.prePushForLab:G.prePush;await c.run(()=>b.default.promises.writeFile(_.default.resolve(r,"pre-push"),l.replace(oe,w),{mode:493}))}let s=[];(f=e.versionsText)!=null&&f.includes("python ")&&s.push("asdf install python"),e.versionsText&&s.push("asdf install"),s.push(G.postMerge),(u=e.versionsText)!=null&&u.includes("poetry ")&&s.push("poetry install"),e.depending.blitz?s.push("yarn blitz codegen"):e.depending.prisma&&s.push("yarn prisma generate");let m=l.replace(oe,s.join(" && "));await c.run(()=>b.default.promises.writeFile(_.default.resolve(r,"post-merge"),m,{mode:493}))}var re=p(require("fs")),se=p(require("path"));var Ft=`<?xml version="1.0" encoding="UTF-8"?>
90
90
  <project version="4">
91
91
  <component name="ProjectTasksOptions">
92
92
  <TaskOptions isEnabled="true">
@@ -237,7 +237,7 @@ yarn typecheck`.trim(),postMerge:"yarn"};async function Ee(e){var a,u,f;let n=_.
237
237
 
238
238
  module.exports = {${n.join("")}
239
239
  };
240
- `,r=A.default.resolve(e.dirPath,".lintstagedrc.cjs");await c.run(()=>ae.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.js"),{force:!0})),await c.run(()=>ae.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.json"),{force:!0})),await c.run(()=>d.generateFile(r,o))}var S=p(require("fs")),R=p(require("path")),q=p(require("deepmerge"));var ce={cleanup:"yarn format && yarn lint-fix",format:"sort-package-json && yarn prettify",lint:`eslint --color "./{src,__tests__}/**/*.{${y.eslint.join(",")}}"`,"lint-fix":"yarn lint --fix",prettify:`prettier --color --write "**/{.*/,}*.{${y.prettier.join(",")}}" "!**/test-fixtures/**"`,typecheck:"tsc --noEmit --Pretty"},jt=(0,q.default)($({},ce),{format:"sort-package-json && yarn prettify && yarn workspaces foreach --parallel --verbose run format",lint:"yarn workspaces foreach --parallel --verbose run lint","lint-fix":"yarn workspaces foreach --parallel --verbose run lint-fix",prettify:`prettier --color --write "**/{.*/,}*.{${y.prettier.join(",")}}" "!**/packages/**" "!**/test-fixtures/**"`,test:"yarn workspaces foreach --verbose run test",typecheck:"yarn workspaces foreach --parallel --verbose run typecheck"}),_t=(0,q.default)($({},ce),{lint:`eslint --color "./**/*.{${y.eslint.join(",")}}"`,typecheck:`tsc --noEmit --Pretty || echo 'Please try "yarn blitz codegen" if you face unknown type errors.'`}),pe=["eslint","eslint-config-prettier","eslint-plugin-import","eslint-plugin-sort-class-members","eslint-plugin-sort-destructure-keys"],Ie=[...pe,"@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint-import-resolver-typescript"],We=["eslint-plugin-react","eslint-plugin-react-hooks"],Be={"@willbooster/eslint-config-js":["@willbooster/eslint-config-js",...pe],"@willbooster/eslint-config-js-react":["@willbooster/eslint-config-js-react",...pe,...We],"@willbooster/eslint-config-ts":["@willbooster/eslint-config-ts",...Ie],"@willbooster/eslint-config-ts-react":["@willbooster/eslint-config-ts-react",...Ie,...We],"../../.eslintrc.json":[]};async function Me(e,n,t){let o=R.default.resolve(e.dirPath,"package.json"),r=await S.default.promises.readFile(o,"utf-8"),i=JSON.parse(r);i.scripts=i.scripts||{},i.dependencies=i.dependencies||{},i.devDependencies=i.devDependencies||{},i.peerDependencies=i.peerDependencies||{},await Tt(i),i.name!=="@willbooster/prettier-config"&&(i.prettier="@willbooster/prettier-config");for(let a of Object.keys(i.scripts))i.scripts[a].includes("git clone")||(i.scripts[a]=i.scripts[a].replace(/yarn\s*&&\s*/,"").replace(/yarn\s*install\s*&&\s*/,""));i.scripts=(0,q.default)(i.scripts,e.containingSubPackageJsons?jt:e.depending.blitz?_t:ce),i.scripts.prettify+=await Rt(e.dirPath);let l=[],s=["lint-staged","prettier","sort-package-json","@willbooster/prettier-config"],m=[];if(e.root&&(s.push("husky","pinst","@willbooster/renovate-config"),e.depending.semanticRelease&&s.push("conventional-changelog-conventionalcommits"),e.containingSubPackageJsons?i.workspaces=["packages/*"]:delete i.workspaces),(e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages)&&(s.push("eslint","micromatch"),e.containingTypeScriptInPackages&&s.push("@typescript-eslint/parser")),(e.containingTypeScript||e.containingTypeScriptInPackages)&&!e.depending.blitz&&s.push("typescript"),e.eslintBase&&s.push(...Be[e.eslintBase]),e.willBoosterConfigs&&(l=l.filter(a=>!a.includes("@willbooster/")),s=s.filter(a=>!a.includes("@willbooster/"))),i.name||(i.name=R.default.basename(e.dirPath)),e.containingSubPackageJsons&&(i.private=!0),i.license||(i.license="UNLICENSED"),!e.containingTypeScript&&!e.containingTypeScriptInPackages&&delete i.scripts.typecheck,e.depending.semanticRelease&&e.release.npm&&(i.resolutions||(i.resolutions={}),i.resolutions["npm/chalk"]="^4.1.2"),!e.containingSubPackageJsons){if(!e.containingJavaScript&&!e.containingTypeScript?(delete i.scripts.lint,delete i.scripts["lint-fix"],i.scripts.cleanup=i.scripts.cleanup.replace(" && yarn lint-fix","")):i.scripts["lint-fix"]+=Y.getLintFixSuffix(e),e.containingPubspecYaml){i.scripts.lint="flutter analyze",i.scripts["lint-fix"]="yarn lint";let a=["lib","test","test_driver"].filter(u=>S.default.existsSync(R.default.resolve(e.dirPath,u)));a.length>0&&(i.scripts["format-code"]=`flutter format $(find ${a.join(" ")} -name generated -prune -o -name '*.freezed.dart' -prune -o -name '*.g.dart' -prune -o -name '*.dart' -print)`,i.scripts.format+=" && yarn format-code")}if(e.containingPoetryLock){i.scripts.postinstall==="poetry install"&&delete i.scripts.postinstall;let a=(await S.default.promises.readdir(e.dirPath)).filter(u=>{let f=R.default.resolve(e.dirPath,u);return S.default.lstatSync(f).isDirectory()?S.default.readdirSync(f).some(w=>w.endsWith(".py")):!1});a.length>0&&(i.scripts["format-code"]=`poetry run isort --profile black ${a.join(" ")} && poetry run black ${a.join(" ")}`,i.scripts.lint=`poetry run flake8 ${a.join(" ")}`,i.scripts["lint-fix"]="yarn lint",i.scripts.format+=" && yarn format-code",m.push("black","isort","flake8"))}e.repository&&(i.repository=e.repository)}e.depending.blitz&&(s=s.filter(a=>!a.includes("@typescript-eslint/")),s=s.filter(a=>a!=="eslint-plugin-react"&&a!=="eslint-import-resolver-typescript"&&a!=="eslint-plugin-import"&&a!=="eslint-plugin-react-hooks")),Object.keys(i.dependencies).length||delete i.dependencies,Object.keys(i.devDependencies).length||delete i.devDependencies,Object.keys(i.peerDependencies).length||delete i.peerDependencies,await S.default.promises.writeFile(o,JSON.stringify(i)),t||(l=l.filter(a=>{var u,f;return!((u=i.dependencies)!=null&&u[a])&&!((f=i.devDependencies)!=null&&f[a])}),l.length&&v("yarn",["add",...new Set(l)],e.dirPath),s=s.filter(a=>{var u,f;return!((u=i.dependencies)!=null&&u[a])&&!((f=i.devDependencies)!=null&&f[a])}),s.length&&v("yarn",["add","-D",...new Set(s)],e.dirPath),m.length&&v("poetry",["add",...new Set(m)],e.dirPath))}async function Tt(e){e.author==="WillBooster LLC"&&(e.author="WillBooster Inc."),delete e.scripts["sort-package-json"],delete e.scripts["sort-all-package-json"],delete e.dependencies.tslib,delete e.devDependencies["@willbooster/eslint-config"],delete e.devDependencies["@willbooster/eslint-config-react"],delete e.devDependencies["@willbooster/tsconfig"],delete e.devDependencies["eslint-import-resolver-node"],delete e.devDependencies["eslint-plugin-prettier"],delete e.devDependencies.lerna,delete e.devDependencies.pinst,delete e.scripts["flutter-format"],delete e.scripts["format-flutter"],delete e.scripts["python-format"],delete e.scripts["format-python"],delete e.scripts.prettier;for(let n of Object.values(Be))for(let t of n)delete e.devDependencies[t];await c.run(()=>S.default.promises.rm("lerna.json",{force:!0}))}async function Rt(e){let n=R.default.resolve(e,".prettierignore"),t=await S.default.promises.readFile(n,"utf-8"),o=t.indexOf(h.separatorPrefix);return o<0?"":t.substring(0,o).split(`
240
+ `,r=A.default.resolve(e.dirPath,".lintstagedrc.cjs");await c.run(()=>ae.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.js"),{force:!0})),await c.run(()=>ae.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.json"),{force:!0})),await c.run(()=>d.generateFile(r,o))}var S=p(require("fs")),R=p(require("path")),q=p(require("deepmerge"));var ce={cleanup:"yarn format && yarn lint-fix",format:"sort-package-json && yarn prettify",lint:`eslint --color "./{src,__tests__}/**/*.{${y.eslint.join(",")}}"`,"lint-fix":"yarn lint --fix",prettify:`prettier --color --write "**/{.*/,}*.{${y.prettier.join(",")}}" "!**/test-fixtures/**"`,typecheck:"tsc --noEmit --Pretty"},jt=(0,q.default)($({},ce),{format:"sort-package-json && yarn prettify && yarn workspaces foreach --parallel --verbose run format",lint:"yarn workspaces foreach --parallel --verbose run lint","lint-fix":"yarn workspaces foreach --parallel --verbose run lint-fix",prettify:`prettier --color --write "**/{.*/,}*.{${y.prettier.join(",")}}" "!**/packages/**" "!**/test-fixtures/**"`,test:"yarn workspaces foreach --verbose run test",typecheck:"yarn workspaces foreach --parallel --verbose run typecheck"}),_t=(0,q.default)($({},ce),{lint:`eslint --color "./**/*.{${y.eslint.join(",")}}"`,typecheck:`tsc --noEmit --Pretty || echo 'Please try "yarn blitz codegen" if you face unknown type errors.'`}),pe=["eslint","eslint-config-prettier","eslint-plugin-import","eslint-plugin-sort-class-members","eslint-plugin-sort-destructure-keys"],Ie=[...pe,"@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint-import-resolver-typescript"],We=["eslint-plugin-react","eslint-plugin-react-hooks"],Be={"@willbooster/eslint-config-js":["@willbooster/eslint-config-js",...pe],"@willbooster/eslint-config-js-react":["@willbooster/eslint-config-js-react",...pe,...We],"@willbooster/eslint-config-ts":["@willbooster/eslint-config-ts",...Ie],"@willbooster/eslint-config-ts-react":["@willbooster/eslint-config-ts-react",...Ie,...We],"../../.eslintrc.json":[]};async function Me(e,n,t){let o=R.default.resolve(e.dirPath,"package.json"),r=await S.default.promises.readFile(o,"utf-8"),i=JSON.parse(r);i.scripts=i.scripts||{},i.dependencies=i.dependencies||{},i.devDependencies=i.devDependencies||{},i.peerDependencies=i.peerDependencies||{},await Tt(i),i.name!=="@willbooster/prettier-config"&&(i.prettier="@willbooster/prettier-config");for(let a of Object.keys(i.scripts))i.scripts[a].includes("git clone")||(i.scripts[a]=i.scripts[a].replace(/yarn\s*&&\s*/,"").replace(/yarn\s*install\s*&&\s*/,""));i.scripts=(0,q.default)(i.scripts,e.containingSubPackageJsons?jt:e.depending.blitz?_t:ce),i.scripts.prettify+=await Rt(e.dirPath);let l=[],s=["lint-staged","prettier","sort-package-json","@willbooster/prettier-config"],m=[];if(e.root&&(s.push("husky","pinst","@willbooster/renovate-config"),e.depending.semanticRelease&&s.push("conventional-changelog-conventionalcommits"),e.containingSubPackageJsons?i.workspaces=["packages/*"]:delete i.workspaces),(e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages)&&(s.push("eslint","micromatch"),e.containingTypeScriptInPackages&&s.push("@typescript-eslint/parser")),(e.containingTypeScript||e.containingTypeScriptInPackages)&&!e.depending.blitz&&s.push("typescript"),e.eslintBase&&s.push(...Be[e.eslintBase]),e.willBoosterConfigs&&(l=l.filter(a=>!a.includes("@willbooster/")),s=s.filter(a=>!a.includes("@willbooster/"))),i.name||(i.name=R.default.basename(e.dirPath)),e.containingSubPackageJsons&&(i.private=!0),i.license||(i.license="UNLICENSED"),!e.containingTypeScript&&!e.containingTypeScriptInPackages&&delete i.scripts.typecheck,e.depending.semanticRelease&&e.release.npm&&(i.resolutions||(i.resolutions={}),i.resolutions["npm/chalk"]="^4.1.2"),!e.containingSubPackageJsons){if(!e.containingJavaScript&&!e.containingTypeScript?(delete i.scripts.lint,delete i.scripts["lint-fix"],i.scripts.cleanup=i.scripts.cleanup.replace(" && yarn lint-fix","")):i.scripts["lint-fix"]+=Y.getLintFixSuffix(e),e.containingPubspecYaml){i.scripts.lint="flutter analyze",i.scripts["lint-fix"]="yarn lint";let a=["lib","test","test_driver"].filter(f=>S.default.existsSync(R.default.resolve(e.dirPath,f)));a.length>0&&(i.scripts["format-code"]=`flutter format $(find ${a.join(" ")} -name generated -prune -o -name '*.freezed.dart' -prune -o -name '*.g.dart' -prune -o -name '*.dart' -print)`,i.scripts.format+=" && yarn format-code")}if(e.containingPoetryLock){i.scripts.postinstall==="poetry install"&&delete i.scripts.postinstall;let a=(await S.default.promises.readdir(e.dirPath)).filter(f=>{let u=R.default.resolve(e.dirPath,f);return S.default.lstatSync(u).isDirectory()?S.default.readdirSync(u).some(w=>w.endsWith(".py")):!1});a.length>0&&(i.scripts["format-code"]=`poetry run isort --profile black ${a.join(" ")} && poetry run black ${a.join(" ")}`,i.scripts.lint=`poetry run flake8 ${a.join(" ")}`,i.scripts["lint-fix"]="yarn lint",i.scripts.format+=" && yarn format-code",m.push("black","isort","flake8"))}e.repository&&(i.repository=e.repository)}e.depending.blitz&&(s=s.filter(a=>!a.includes("@typescript-eslint/")),s=s.filter(a=>a!=="eslint-plugin-react"&&a!=="eslint-import-resolver-typescript"&&a!=="eslint-plugin-import"&&a!=="eslint-plugin-react-hooks")),Object.keys(i.dependencies).length||delete i.dependencies,Object.keys(i.devDependencies).length||delete i.devDependencies,Object.keys(i.peerDependencies).length||delete i.peerDependencies,await S.default.promises.writeFile(o,JSON.stringify(i)),t||(l=l.filter(a=>{var f;return!((f=i.devDependencies)!=null&&f[a])}),l.length&&v("yarn",["add",...new Set(l)],e.dirPath),s=s.filter(a=>{var f;return!((f=i.dependencies)!=null&&f[a])}),s.length&&v("yarn",["add","-D",...new Set(s)],e.dirPath),m.length&&v("poetry",["add",...new Set(m)],e.dirPath))}async function Tt(e){e.author==="WillBooster LLC"&&(e.author="WillBooster Inc."),delete e.scripts["sort-package-json"],delete e.scripts["sort-all-package-json"],delete e.dependencies.tslib,delete e.devDependencies["@willbooster/eslint-config"],delete e.devDependencies["@willbooster/eslint-config-react"],delete e.devDependencies["@willbooster/tsconfig"],delete e.devDependencies["eslint-import-resolver-node"],delete e.devDependencies["eslint-plugin-prettier"],delete e.devDependencies.lerna,delete e.devDependencies.pinst,delete e.scripts["flutter-format"],delete e.scripts["format-flutter"],delete e.scripts["python-format"],delete e.scripts["format-python"],delete e.scripts.prettier;for(let n of Object.values(Be))for(let t of n)delete e.devDependencies[t];await c.run(()=>S.default.promises.rm("lerna.json",{force:!0}))}async function Rt(e){let n=R.default.resolve(e,".prettierignore"),t=await S.default.promises.readFile(n,"utf-8"),o=t.indexOf(h.separatorPrefix);return o<0?"":t.substring(0,o).split(`
241
241
  `).map(l=>{let s=l.trim();return s.endsWith("/")?s.slice(0,-1):s}).filter(l=>l&&!l.startsWith("#")&&!l.includes("/")).map(l=>` "!**/${l}/**"`).join("")}var me=p(require("path"));var Ot=`${h.header}
242
242
 
243
243
 
@@ -256,5 +256,5 @@ test-fixtures/
256
256
  android/app/
257
257
  ios/Runner/Assets.xcassets/
258
258
  pubspec.yaml
259
- `);let l=t+Dt+i+r;await c.run(()=>d.generateFile(n,l))}var Ue=p(require("fs")),Le=p(require("path"));async function Ge(e){let n=Le.default.resolve(e.dirPath,".releaserc.json");try{let t=JSON.parse(await Ue.default.promises.readFile(n,"utf8")),o=(t==null?void 0:t.plugins)||[];for(let i=0;i<o.length;i++)(o[i]==="@semantic-release/commit-analyzer"||o[i][0]==="@semantic-release/commit-analyzer")&&(o[i]=["@semantic-release/commit-analyzer",{preset:"conventionalcommits"}]);let r=JSON.stringify(t);await c.run(()=>d.generateFile(n,r))}catch{}}var H=p(require("fs")),K=p(require("path")),Ye=p(require("deepmerge")),Ae=p(require("lodash.clonedeep"));var Et={extends:["@willbooster"]};async function qe(e){let n=(0,Ae.default)(Et),t=K.default.resolve(e.dirPath,".renovaterc.json");try{let r=await H.default.promises.readFile(t,"utf-8"),i=JSON.parse(r);n=Ye.default.all([n,i,n],{arrayMerge:z})}catch{}await c.run(()=>H.default.promises.rm(K.default.resolve(e.dirPath,".dependabot"),{force:!0})),await c.run(()=>H.default.promises.rm(K.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let o=JSON.stringify(n);await c.run(()=>d.generateFile(t,o))}var He=p(require("fs")),fe=p(require("path")),Ke=p(require("js-yaml"));var Jt={titleOnly:!0};async function Ve(e){let n=fe.default.resolve(e.dirPath,".github");await He.default.promises.mkdir(n,{recursive:!0});let t=fe.default.join(n,"semantic.yml"),o=Ke.default.dump(Jt);await c.run(()=>d.generateFile(t,o))}var Xe=p(require("fs")),J=p(require("path")),Ze=p(require("deepmerge")),Qe=p(require("lodash.clonedeep"));function E(e){let n=Object.entries(e).sort(([t],[o])=>t.localeCompare(o));for(let[t,o]of n)delete e[t],e[t]=o}var Nt={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","packages/*/src/**/*","packages/*/__tests__/**/*","./node_modules/@types","./@types"]},It={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","../../node_modules/@types","../../@types","./@types"]};async function et(e,n){var i,l,s;if(n.depending.blitz)return;let t=(0,Qe.default)(e.root?Nt:It);if(!e.containingJsxOrTsx&&!e.containingJsxOrTsxInPackages&&delete t.compilerOptions.jsx,e.root&&!e.containingSubPackageJsons&&(t.include=t.include.filter(m=>!m.startsWith("packages/*/"))),!e.root&&(e.depending.jestPlaywrightPreset||n.depending.jestPlaywrightPreset)){let m=J.default.relative(e.dirPath,n.dirPath);t.include.push(J.default.join(m,"node_modules/jest-playwright-preset/types"),J.default.join(m,"node_modules/expect-playwright"))}let o=J.default.resolve(e.dirPath,"tsconfig.json");try{let m=await Xe.default.promises.readFile(o,"utf-8"),a=JSON.parse(m);a.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete a.extends,(i=a.compilerOptions)==null||delete i.typeRoots,(l=t==null?void 0:t.compilerOptions)==null||delete l.target,(s=t==null?void 0:t.compilerOptions)==null||delete s.module,a.jsx&&delete t.jsx,e.depending.blitz||delete t.include,t=Ze.default.all([t,a,t],{arrayMerge:z})}catch{}E(t.compilerOptions);let r=JSON.stringify(t);await c.run(()=>d.generateFile(o,r))}var O=p(require("fs")),V=p(require("path")),tt=p(require("deepmerge")),ue=p(require("js-yaml")),nt=p(require("lodash.clonedeep"));var Wt={name:"Test",on:{pull_request:{branches:["main","!renovate/**"]},push:{branches:["main","renovate/**"]}},jobs:{test:{uses:"WillBooster/reusable-workflows/.github/workflows/test.yml@main"}}},Bt={name:"Release",on:{push:{branches:[]}},jobs:{release:{uses:"WillBooster/reusable-workflows/.github/workflows/release.yml@main"}}},Mt={name:"Willboosterify",on:{workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}};async function it(e){let n=V.default.resolve(e.dirPath,".github","workflows");await O.default.promises.mkdir(n,{recursive:!0});let t=(await O.default.promises.readdir(n,{withFileTypes:!0})).filter(o=>o.isFile()&&o.name.endsWith(".yml")).map(o=>o.name);e.depending.semanticRelease&&t.push("release.yml"),t.push("test.yml","wbfy.yml");for(let o of t){let r=V.default.basename(o,".yml");await c.run(()=>zt(e,n,r))}}async function zt(e,n,t){var l,s,m,a,u;let o={};t==="test"?o=Wt:t==="release"?o=Bt:t==="wbfy"&&(o=Mt),o=(0,nt.default)(o);let r=V.default.join(n,`${t}.yml`);try{let f=await O.default.promises.readFile(r,"utf-8"),w=ue.default.load(f);o=tt.default.all([o,w,o],{arrayMerge:U})}catch{}if(t==="release")o.on.schedule?delete o.on.push:o.on.push.branches=e.release.branches;else if(t==="wbfy"){let f=(m=(s=(l=o.on.schedule)==null?void 0:l[0])==null?void 0:s.cron)==null?void 0:m[0];if(!f||f==="0"){let w=1+Math.floor(Math.random()*59),N=(3+Math.floor(Math.random()*6)+9)%24,k=`${w} ${N} * * *`;o.on.schedule=[{cron:k}]}}for(let f of Object.values(o.jobs)){if(!((u=(a=f.uses)==null?void 0:a.includes)!=null&&u.call(a,"/reusable-workflows/")))break;Ut(e,f,t)}t==="release"&&await c.run(()=>O.default.promises.rm("semantic-release.yml",{force:!0}));let i=ue.default.dump(o,{lineWidth:-1,noCompatMode:!0,styles:{"!!null":"empty"}});await O.default.promises.writeFile(r,i)}function Ut(e,n,t){var o,r;n.with||(n.with={}),n.secrets||(n.secrets={}),(e.release.github&&t==="test"||t==="release"||t==="wbfy")&&(e.publicRepo?n.secrets.GH_TOKEN="${{ secrets.PUBLIC_GH_BOT_PAT }}":n.secrets.GH_TOKEN="${{ secrets.GH_BOT_PAT }}"),e.release.npm&&(t==="release"||t==="test")&&(n.secrets.NPM_TOKEN="${{ secrets.NPM_TOKEN }}"),(o=e.repository)!=null&&o.startsWith("github:WillBooster/")?n.uses=n.uses.replace("WillBoosterLab/","WillBooster/"):(r=e.repository)!=null&&r.startsWith("github:WillBoosterLab/")&&(n.uses=n.uses.replace("WillBooster/","WillBoosterLab/")),e.containingDockerfile&&(n.with.cpu_arch="X64"),delete n.with.non_self_hosted,Object.keys(n.with).length?E(n.with):delete n.with,Object.keys(n.secrets).length?E(n.secrets):delete n.secrets}var T=p(require("fs")),D=p(require("path")),de=p(require("js-yaml"));async function rt(e){let n=ie("yarn",["--version"],e.dirPath),t=ie("npm",["show","@yarnpkg/cli","version"],e.dirPath);n!==t&&v("yarn",["set","version",t],e.dirPath,1);let o=D.default.join(e.dirPath,".yarn","releases");await T.default.promises.mkdir(o,{recursive:!0});for(let a of await T.default.promises.readdir(o))a.startsWith("yarn-")&&!a.startsWith(`yarn-${t}.`)&&(await c.run(()=>T.default.promises.rm(D.default.join(o,a))),console.log("Removed",D.default.join(o,a)));let r=D.default.resolve(e.dirPath,".yarnrc");await c.run(()=>T.default.promises.rm(r,{force:!0}));let i=D.default.resolve(e.dirPath,".yarnrc.yml"),l=de.default.load(await T.default.promises.readFile(i,"utf8"));l.defaultSemverRangePrefix="",e.requiringNodeModules&&(l.nodeLinker="node-modules",l.nmMode="hardlinks-global"),await T.default.promises.writeFile(i,de.default.dump(l,{lineWidth:-1}));let s=(l.plugins||[]).map(a=>a.spec),m=e.containingTypeScript||e.containingTypeScriptInPackages;ot(e,s,m,"@yarnpkg/plugin-typescript"),m&&!e.requiringNodeModules&&v("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),ot(e,s,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),v("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)}function ot(e,n,t,o){t!==n.includes(o)&&v("yarn",["plugin",t?"import":"remove",o],e.dirPath)}var P=p(require("fs")),X=p(require("fs/promises")),g=p(require("path")),F=p(require("glob")),at=p(require("js-yaml")),lt=p(require("simple-git"));async function ge(e){var t;let n=g.default.resolve(e,"package.json");try{let o=P.default.existsSync(n),r={},i={},l={};if(o){let C=P.default.readFileSync(n,"utf-8");l=JSON.parse(C),r=l.dependencies??{},i=l.devDependencies??{}}let s=!0;try{let C=g.default.resolve(e,".yarnrc.yml"),x=at.default.load(await X.default.readFile(C,"utf8"));s=!x.nodeLinker||x.nodeLinker==="node-modules"}catch{}let m=[],a=[];try{let C=g.default.resolve(e,".releaserc.json"),x=JSON.parse(await X.default.readFile(C,"utf8"));m=(x==null?void 0:x.branches)||[],a=((t=x==null?void 0:x.plugins)==null?void 0:t.flat())||[]}catch{}let u=g.default.basename(g.default.resolve(e,".."))!=="packages"||!P.default.existsSync(g.default.resolve(e,"..","..","package.json")),f;u&&(f=await Gt(e,l));let w=g.default.resolve(e,".tool-versions"),N;try{N=await X.default.readFile(w,"utf-8")}catch{}let k={dirPath:e,root:u,publicRepo:(f==null?void 0:f.private)===!1,repository:f!=null&&f.full_name?`github:${f==null?void 0:f.full_name}`:void 0,willBoosterConfigs:n.includes(`${g.default.sep}willbooster-configs`),containingSubPackageJsons:F.default.sync("packages/**/package.json",{cwd:e}).length>0,containingDockerfile:P.default.existsSync(g.default.resolve(e,"Dockerfile"))||P.default.existsSync(g.default.resolve(e,"docker-compose.yml")),containingGemfile:P.default.existsSync(g.default.resolve(e,"Gemfile")),containingGoMod:P.default.existsSync(g.default.resolve(e,"go.mod")),containingPackageJson:P.default.existsSync(g.default.resolve(e,"package.json")),containingPoetryLock:P.default.existsSync(g.default.resolve(e,"poetry.lock")),containingPomXml:P.default.existsSync(g.default.resolve(e,"pom.xml")),containingPubspecYaml:P.default.existsSync(g.default.resolve(e,"pubspec.yaml")),containingTemplateYaml:P.default.existsSync(g.default.resolve(e,"template.yaml")),containingJavaScript:F.default.sync("@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:F.default.sync("@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:F.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,depending:{blitz:!!(r.blitz||i.blitz),firebase:!!i["firebase-tools"],jestPlaywrightPreset:!!i["jest-playwright-preset"],prisma:!!i.prisma,reactNative:!!r["react-native"],semanticRelease:!!i["semantic-release"],storybook:!!i["@storybook/react"]},release:{branches:m,github:a.includes("@semantic-release/github"),npm:a.includes("@semantic-release/npm")},requiringNodeModules:s,versionsText:N};if(k.eslintBase=Lt(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function Lt(e){if(e.containingTypeScript)return e.containingJsxOrTsx?"@willbooster/eslint-config-ts-react":"@willbooster/eslint-config-ts";if(e.containingJsxOrTsx)return"@willbooster/eslint-config-js-react";if(e.containingJavaScript)return"@willbooster/eslint-config-js"}async function Gt(e,n){var s,m,a;let r=(await(0,lt.default)(e).getRemotes(!0)).find(u=>u.name==="origin"),i=((s=r==null?void 0:r.refs)==null?void 0:s.fetch)??((m=r==null?void 0:r.refs)==null?void 0:m.push);if(typeof i=="string"){let u=await st(i);if(u)return u}let l=((a=n.repository)==null?void 0:a.url)??n.repository;if(typeof l=="string"){let u=await st(l);if(u&&u.message!=="Not Found")return u}}async function st(e){var a;let n=e.split(":").at(-1),t=n==null?void 0:n.split("/"),o=t==null?void 0:t.at(-2),r=(a=t==null?void 0:t.at(-1))==null?void 0:a.replace(/.git$/,"");if(!o||!r)return;let i=process.env.GH_TOKEN||process.env.GITHUB_TOKEN,l=i?{headers:{Authorization:`token ${i}`}}:void 0,m=await(await L(`https://api.github.com/repos/${o}/${r}`,l)).json();return $({full_name:`${o}/${r}`},m??{})}async function Yt(){let e=await(0,mt.default)(process.argv.slice(2)).command("wbfy <paths...>","Generate/update project files for WillBooster").demandCommand(1).alias("d","skipDeps").boolean("skipDeps").default("skipDeps",!1).describe("skipDeps","Skip dependency installation").alias("v","verbose").boolean("verbose").default("verbose",!1).argv;for(let n of e._){if(typeof n=="number")continue;let t=await ge(n);if(t===null){console.error(`there is no valid package.json in ${n}`);continue}let o=t.containingSubPackageJsons?ct.default.sync("packages/*",{cwd:n}).map(s=>pt.default.resolve(n,s)):[],r=(await Promise.all(o.map(s=>ge(s)))).filter(s=>!!s),i=[t,...r];if(e.verbose)for(let s of i)console.log(s);await rt(t),await Promise.all([be(t),Re(t),Ee(t),Je(t),le(t),qe(t),Ge(t),Ve(t),ke(t),it(t)]),await c.promiseAll();let l=[];for(let s of i){let m=Oe(s,t);if(!s.root&&!s.containingPackageJson){await m;continue}await Promise.all([m,Me(s,t,e.skipDeps)]),l.push(ze(s),le(s)),(s.containingTypeScript||s.containingTypeScriptInPackages)&&l.push(et(s,t)),(s.containingJavaScript||s.containingJavaScriptInPackages||s.containingTypeScript||s.containingTypeScriptInPackages)&&(t.willBoosterConfigs||l.push(_e(s,t)),l.push(Se(s)))}await Promise.all(l),await c.promiseAll(),v("yarn",["cleanup"],n),v("yarn",["install"],n)}}Yt().then();
259
+ `);let l=t+Dt+i+r;await c.run(()=>d.generateFile(n,l))}var Ue=p(require("fs")),Le=p(require("path"));async function Ge(e){let n=Le.default.resolve(e.dirPath,".releaserc.json");try{let t=JSON.parse(await Ue.default.promises.readFile(n,"utf8")),o=(t==null?void 0:t.plugins)||[];for(let i=0;i<o.length;i++)(o[i]==="@semantic-release/commit-analyzer"||o[i][0]==="@semantic-release/commit-analyzer")&&(o[i]=["@semantic-release/commit-analyzer",{preset:"conventionalcommits"}]);let r=JSON.stringify(t);await c.run(()=>d.generateFile(n,r))}catch{}}var H=p(require("fs")),K=p(require("path")),Ye=p(require("deepmerge")),Ae=p(require("lodash.clonedeep"));var Et={extends:["@willbooster"]};async function qe(e){let n=(0,Ae.default)(Et),t=K.default.resolve(e.dirPath,".renovaterc.json");try{let r=await H.default.promises.readFile(t,"utf-8"),i=JSON.parse(r);n=Ye.default.all([n,i,n],{arrayMerge:z})}catch{}await c.run(()=>H.default.promises.rm(K.default.resolve(e.dirPath,".dependabot"),{force:!0})),await c.run(()=>H.default.promises.rm(K.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let o=JSON.stringify(n);await c.run(()=>d.generateFile(t,o))}var He=p(require("fs")),fe=p(require("path")),Ke=p(require("js-yaml"));var Jt={titleOnly:!0};async function Ve(e){let n=fe.default.resolve(e.dirPath,".github");await He.default.promises.mkdir(n,{recursive:!0});let t=fe.default.join(n,"semantic.yml"),o=Ke.default.dump(Jt);await c.run(()=>d.generateFile(t,o))}var Xe=p(require("fs")),J=p(require("path")),Ze=p(require("deepmerge")),Qe=p(require("lodash.clonedeep"));function E(e){let n=Object.entries(e).sort(([t],[o])=>t.localeCompare(o));for(let[t,o]of n)delete e[t],e[t]=o}var Nt={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","packages/*/src/**/*","packages/*/__tests__/**/*","./node_modules/@types","./@types"]},It={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","../../node_modules/@types","../../@types","./@types"]};async function et(e,n){var i,l,s;if(n.depending.blitz)return;let t=(0,Qe.default)(e.root?Nt:It);if(!e.containingJsxOrTsx&&!e.containingJsxOrTsxInPackages&&delete t.compilerOptions.jsx,e.root&&!e.containingSubPackageJsons&&(t.include=t.include.filter(m=>!m.startsWith("packages/*/"))),!e.root&&(e.depending.jestPlaywrightPreset||n.depending.jestPlaywrightPreset)){let m=J.default.relative(e.dirPath,n.dirPath);t.include.push(J.default.join(m,"node_modules/jest-playwright-preset/types"),J.default.join(m,"node_modules/expect-playwright"))}let o=J.default.resolve(e.dirPath,"tsconfig.json");try{let m=await Xe.default.promises.readFile(o,"utf-8"),a=JSON.parse(m);a.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete a.extends,(i=a.compilerOptions)==null||delete i.typeRoots,(l=t==null?void 0:t.compilerOptions)==null||delete l.target,(s=t==null?void 0:t.compilerOptions)==null||delete s.module,a.jsx&&delete t.jsx,e.depending.blitz||delete t.include,t=Ze.default.all([t,a,t],{arrayMerge:z})}catch{}E(t.compilerOptions);let r=JSON.stringify(t);await c.run(()=>d.generateFile(o,r))}var O=p(require("fs")),V=p(require("path")),tt=p(require("deepmerge")),ue=p(require("js-yaml")),nt=p(require("lodash.clonedeep"));var Wt={name:"Test",on:{pull_request:{branches:["main","!renovate/**"]},push:{branches:["main","renovate/**"]}},jobs:{test:{uses:"WillBooster/reusable-workflows/.github/workflows/test.yml@main"}}},Bt={name:"Release",on:{push:{branches:[]}},jobs:{release:{uses:"WillBooster/reusable-workflows/.github/workflows/release.yml@main"}}},Mt={name:"Willboosterify",on:{workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}};async function it(e){let n=V.default.resolve(e.dirPath,".github","workflows");await O.default.promises.mkdir(n,{recursive:!0});let t=(await O.default.promises.readdir(n,{withFileTypes:!0})).filter(o=>o.isFile()&&o.name.endsWith(".yml")).map(o=>o.name);e.depending.semanticRelease&&t.push("release.yml"),t.push("test.yml","wbfy.yml");for(let o of t){let r=V.default.basename(o,".yml");await c.run(()=>zt(e,n,r))}}async function zt(e,n,t){var l,s,m,a,f;let o={};t==="test"?o=Wt:t==="release"?o=Bt:t==="wbfy"&&(o=Mt),o=(0,nt.default)(o);let r=V.default.join(n,`${t}.yml`);try{let u=await O.default.promises.readFile(r,"utf-8"),w=ue.default.load(u);o=tt.default.all([o,w,o],{arrayMerge:U})}catch{}if(t==="release")o.on.schedule?delete o.on.push:o.on.push.branches=e.release.branches;else if(t==="wbfy"){let u=(m=(s=(l=o.on.schedule)==null?void 0:l[0])==null?void 0:s.cron)==null?void 0:m[0];if(!u||u==="0"){let w=1+Math.floor(Math.random()*59),N=(3+Math.floor(Math.random()*6)+9)%24,k=`${w} ${N} * * *`;o.on.schedule=[{cron:k}]}}for(let u of Object.values(o.jobs)){if(!((f=(a=u.uses)==null?void 0:a.includes)!=null&&f.call(a,"/reusable-workflows/")))break;Ut(e,u,t)}t==="release"&&await c.run(()=>O.default.promises.rm("semantic-release.yml",{force:!0}));let i=ue.default.dump(o,{lineWidth:-1,noCompatMode:!0,styles:{"!!null":"empty"}});await O.default.promises.writeFile(r,i)}function Ut(e,n,t){var o,r;n.with||(n.with={}),n.secrets||(n.secrets={}),(e.release.github&&t==="test"||t==="release"||t==="wbfy")&&(e.publicRepo?n.secrets.GH_TOKEN="${{ secrets.PUBLIC_GH_BOT_PAT }}":n.secrets.GH_TOKEN="${{ secrets.GH_BOT_PAT }}"),e.release.npm&&(t==="release"||t==="test")&&(n.secrets.NPM_TOKEN="${{ secrets.NPM_TOKEN }}"),(o=e.repository)!=null&&o.startsWith("github:WillBooster/")?n.uses=n.uses.replace("WillBoosterLab/","WillBooster/"):(r=e.repository)!=null&&r.startsWith("github:WillBoosterLab/")&&(n.uses=n.uses.replace("WillBooster/","WillBoosterLab/")),e.containingDockerfile&&(n.with.cpu_arch="X64"),delete n.with.non_self_hosted,Object.keys(n.with).length?E(n.with):delete n.with,Object.keys(n.secrets).length?E(n.secrets):delete n.secrets}var T=p(require("fs")),D=p(require("path")),de=p(require("js-yaml"));async function rt(e){let n=ie("yarn",["--version"],e.dirPath),t=ie("npm",["show","@yarnpkg/cli","version"],e.dirPath);n!==t&&v("yarn",["set","version",t],e.dirPath,1);let o=D.default.join(e.dirPath,".yarn","releases");await T.default.promises.mkdir(o,{recursive:!0});for(let a of await T.default.promises.readdir(o))a.startsWith("yarn-")&&!a.startsWith(`yarn-${t}.`)&&(await c.run(()=>T.default.promises.rm(D.default.join(o,a))),console.log("Removed",D.default.join(o,a)));let r=D.default.resolve(e.dirPath,".yarnrc");await c.run(()=>T.default.promises.rm(r,{force:!0}));let i=D.default.resolve(e.dirPath,".yarnrc.yml"),l=de.default.load(await T.default.promises.readFile(i,"utf8"));l.defaultSemverRangePrefix="",e.requiringNodeModules&&(l.nodeLinker="node-modules",l.nmMode="hardlinks-global"),await T.default.promises.writeFile(i,de.default.dump(l,{lineWidth:-1}));let s=(l.plugins||[]).map(a=>a.spec),m=e.containingTypeScript||e.containingTypeScriptInPackages;ot(e,s,m,"@yarnpkg/plugin-typescript"),m&&!e.requiringNodeModules&&v("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),ot(e,s,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),v("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)}function ot(e,n,t,o){t!==n.includes(o)&&v("yarn",["plugin",t?"import":"remove",o],e.dirPath)}var P=p(require("fs")),X=p(require("fs/promises")),g=p(require("path")),F=p(require("glob")),at=p(require("js-yaml")),lt=p(require("simple-git"));async function ge(e){var t;let n=g.default.resolve(e,"package.json");try{let o=P.default.existsSync(n),r={},i={},l={};if(o){let C=P.default.readFileSync(n,"utf-8");l=JSON.parse(C),r=l.dependencies??{},i=l.devDependencies??{}}let s=!0;try{let C=g.default.resolve(e,".yarnrc.yml"),x=at.default.load(await X.default.readFile(C,"utf8"));s=!x.nodeLinker||x.nodeLinker==="node-modules"}catch{}let m=[],a=[];try{let C=g.default.resolve(e,".releaserc.json"),x=JSON.parse(await X.default.readFile(C,"utf8"));m=(x==null?void 0:x.branches)||[],a=((t=x==null?void 0:x.plugins)==null?void 0:t.flat())||[]}catch{}let f=g.default.basename(g.default.resolve(e,".."))!=="packages"||!P.default.existsSync(g.default.resolve(e,"..","..","package.json")),u;f&&(u=await Gt(e,l));let w=g.default.resolve(e,".tool-versions"),N;try{N=await X.default.readFile(w,"utf-8")}catch{}let k={dirPath:e,root:f,publicRepo:(u==null?void 0:u.private)===!1,repository:u!=null&&u.full_name?`github:${u==null?void 0:u.full_name}`:void 0,willBoosterConfigs:n.includes(`${g.default.sep}willbooster-configs`),containingSubPackageJsons:F.default.sync("packages/**/package.json",{cwd:e}).length>0,containingDockerfile:P.default.existsSync(g.default.resolve(e,"Dockerfile"))||P.default.existsSync(g.default.resolve(e,"docker-compose.yml")),containingGemfile:P.default.existsSync(g.default.resolve(e,"Gemfile")),containingGoMod:P.default.existsSync(g.default.resolve(e,"go.mod")),containingPackageJson:P.default.existsSync(g.default.resolve(e,"package.json")),containingPoetryLock:P.default.existsSync(g.default.resolve(e,"poetry.lock")),containingPomXml:P.default.existsSync(g.default.resolve(e,"pom.xml")),containingPubspecYaml:P.default.existsSync(g.default.resolve(e,"pubspec.yaml")),containingTemplateYaml:P.default.existsSync(g.default.resolve(e,"template.yaml")),containingJavaScript:F.default.sync("@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:F.default.sync("@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:F.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:F.default.sync("packages/**/@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,depending:{blitz:!!(r.blitz||i.blitz),firebase:!!i["firebase-tools"],jestPlaywrightPreset:!!i["jest-playwright-preset"],prisma:!!i.prisma,reactNative:!!r["react-native"],semanticRelease:!!i["semantic-release"],storybook:!!i["@storybook/react"]},release:{branches:m,github:a.includes("@semantic-release/github"),npm:a.includes("@semantic-release/npm")},requiringNodeModules:s,versionsText:N};if(k.eslintBase=Lt(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function Lt(e){if(e.containingTypeScript)return e.containingJsxOrTsx?"@willbooster/eslint-config-ts-react":"@willbooster/eslint-config-ts";if(e.containingJsxOrTsx)return"@willbooster/eslint-config-js-react";if(e.containingJavaScript)return"@willbooster/eslint-config-js"}async function Gt(e,n){var s,m,a;let r=(await(0,lt.default)(e).getRemotes(!0)).find(f=>f.name==="origin"),i=((s=r==null?void 0:r.refs)==null?void 0:s.fetch)??((m=r==null?void 0:r.refs)==null?void 0:m.push);if(typeof i=="string"){let f=await st(i);if(f)return f}let l=((a=n.repository)==null?void 0:a.url)??n.repository;if(typeof l=="string"){let f=await st(l);if(f&&f.message!=="Not Found")return f}}async function st(e){var a;let n=e.split(":").at(-1),t=n==null?void 0:n.split("/"),o=t==null?void 0:t.at(-2),r=(a=t==null?void 0:t.at(-1))==null?void 0:a.replace(/.git$/,"");if(!o||!r)return;let i=process.env.GH_TOKEN||process.env.GITHUB_TOKEN,l=i?{headers:{Authorization:`token ${i}`}}:void 0,m=await(await L(`https://api.github.com/repos/${o}/${r}`,l)).json();return $({full_name:`${o}/${r}`},m??{})}async function Yt(){let e=await(0,mt.default)(process.argv.slice(2)).command("wbfy <paths...>","Generate/update project files for WillBooster").demandCommand(1).alias("d","skipDeps").boolean("skipDeps").default("skipDeps",!1).describe("skipDeps","Skip dependency installation").alias("v","verbose").boolean("verbose").default("verbose",!1).argv;for(let n of e._){if(typeof n=="number")continue;let t=await ge(n);if(t===null){console.error(`there is no valid package.json in ${n}`);continue}let o=t.containingSubPackageJsons?ct.default.sync("packages/*",{cwd:n}).map(s=>pt.default.resolve(n,s)):[],r=(await Promise.all(o.map(s=>ge(s)))).filter(s=>!!s),i=[t,...r];if(e.verbose)for(let s of i)console.log(s);await rt(t),await Promise.all([be(t),Re(t),Ee(t),Je(t),le(t),qe(t),Ge(t),Ve(t),ke(t),it(t)]),await c.promiseAll();let l=[];for(let s of i){let m=Oe(s,t);if(!s.root&&!s.containingPackageJson){await m;continue}await Promise.all([m,Me(s,t,e.skipDeps)]),l.push(ze(s),le(s)),(s.containingTypeScript||s.containingTypeScriptInPackages)&&l.push(et(s,t)),(s.containingJavaScript||s.containingJavaScriptInPackages||s.containingTypeScript||s.containingTypeScriptInPackages)&&(t.willBoosterConfigs||l.push(_e(s,t)),l.push(Se(s)))}await Promise.all(l),await c.promiseAll(),v("yarn",["cleanup"],n),v("yarn",["install"],n)}}Yt().then();
260
260
  //# sourceMappingURL=index.min.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/generators/asdf.ts", "../src/utils/promisePool.ts", "../src/generators/editorconfig.ts", "../src/utils/extensions.ts", "../src/utils/fsUtil.ts", "../src/generators/eslintignore.ts", "../src/utils/ignoreFileUtil.ts", "../src/generators/eslintrc.ts", "../src/utils/mergeUtil.ts", "../src/generators/gitattributes.ts", "../src/generators/gitignore.ts", "../src/utils/fetchOnNode.ts", "../src/generators/huskyrc.ts", "../src/utils/spawnUtil.ts", "../src/generators/idea.ts", "../src/generators/lintstagedrc.ts", "../src/utils/eslintUtil.ts", "../src/generators/packageJson.ts", "../src/generators/prettierignore.ts", "../src/generators/releaserc.ts", "../src/generators/renovaterc.ts", "../src/generators/semanticRelease.ts", "../src/generators/tsconfig.ts", "../src/utils/objectUtil.ts", "../src/generators/workflow.ts", "../src/generators/yarnrc.ts", "../src/utils/packageConfig.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport glob from 'glob';\nimport yargs from 'yargs';\n\nimport { generateVersionConfigs } from './generators/asdf';\nimport { generateEditorconfig } from './generators/editorconfig';\nimport { generateEslintignore } from './generators/eslintignore';\nimport { generateEslintrc } from './generators/eslintrc';\nimport { generateGitattributes } from './generators/gitattributes';\nimport { generateGitignore } from './generators/gitignore';\nimport { generateHuskyrc } from './generators/huskyrc';\nimport { generateIdeaSettings } from './generators/idea';\nimport { generateLintstagedrc } from './generators/lintstagedrc';\nimport { generatePackageJson } from './generators/packageJson';\nimport { generatePrettierignore } from './generators/prettierignore';\nimport { generateReleaserc } from './generators/releaserc';\nimport { generateRenovateJson } from './generators/renovaterc';\nimport { generateSemanticYml } from './generators/semanticRelease';\nimport { generateTsconfig } from './generators/tsconfig';\nimport { generateWorkflow } from './generators/workflow';\nimport { generateYarnrcYml } from './generators/yarnrc';\nimport { getPackageConfig, PackageConfig } from './utils/packageConfig';\nimport { promisePool } from './utils/promisePool';\nimport { spawnSync } from './utils/spawnUtil';\n\nasync function main(): Promise<void> {\n const argv = await yargs(process.argv.slice(2))\n .command('wbfy <paths...>', 'Generate/update project files for WillBooster')\n .demandCommand(1)\n .alias('d', 'skipDeps')\n .boolean('skipDeps')\n .default('skipDeps', false)\n .describe('skipDeps', 'Skip dependency installation')\n .alias('v', 'verbose')\n .boolean('verbose')\n .default('verbose', false).argv;\n\n for (const rootDirPath of argv._) {\n if (typeof rootDirPath === 'number') continue;\n\n const rootConfig = await getPackageConfig(rootDirPath);\n if (rootConfig === null) {\n console.error(`there is no valid package.json in ${rootDirPath}`);\n continue;\n }\n\n const subDirPaths = rootConfig.containingSubPackageJsons\n ? glob.sync('packages/*', { cwd: rootDirPath }).map((subDirPath) => path.resolve(rootDirPath, subDirPath))\n : [];\n const subPackageConfigs = (await Promise.all(subDirPaths.map((subDirPath) => getPackageConfig(subDirPath)))).filter(\n (config) => !!config\n ) as PackageConfig[];\n const allPackageConfigs = [rootConfig, ...subPackageConfigs];\n\n if (argv.verbose) {\n for (const config of allPackageConfigs) {\n console.log(config);\n }\n }\n\n // Install yarn berry at first\n await generateYarnrcYml(rootConfig);\n await Promise.all([\n generateEditorconfig(rootConfig),\n generateGitattributes(rootConfig),\n generateHuskyrc(rootConfig),\n generateIdeaSettings(rootConfig),\n generateLintstagedrc(rootConfig),\n generateRenovateJson(rootConfig),\n generateReleaserc(rootConfig),\n generateSemanticYml(rootConfig),\n generateVersionConfigs(rootConfig),\n generateWorkflow(rootConfig),\n ]);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allPackageConfigs) {\n const gitignorePromise = generateGitignore(config, rootConfig);\n if (!config.root && !config.containingPackageJson) {\n await gitignorePromise;\n continue;\n }\n await Promise.all([gitignorePromise, generatePackageJson(config, rootConfig, argv.skipDeps)]);\n\n promises.push(generatePrettierignore(config), generateLintstagedrc(config));\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n promises.push(generateTsconfig(config, rootConfig));\n }\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n if (!rootConfig.willBoosterConfigs) {\n promises.push(generateEslintrc(config, rootConfig));\n }\n promises.push(generateEslintignore(config));\n }\n }\n await Promise.all(promises);\n await promisePool.promiseAll();\n\n spawnSync('yarn', ['cleanup'], rootDirPath);\n // 'yarn install' should be after `yarn cleanup` because yarn berry generates yarn.lock\n // corresponding to the contents of dependant sub-package in monorepo\n spawnSync('yarn', ['install'], rootDirPath);\n }\n}\n\nmain().then();\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateVersionConfigs(config: PackageConfig): Promise<void> {\n if (!config.versionsText) return;\n\n const lines: string[] = [];\n for (const versionText of config.versionsText.trim().split('\\n')) {\n const line = versionText.trim();\n if (line && line.split(/\\s+/)[0] !== 'nodejs') {\n lines.push(line);\n continue;\n }\n\n const [, version] = line.split(/\\s+/);\n await promisePool.run(() => fs.promises.writeFile(path.resolve(config.dirPath, '.node-version'), version));\n }\n if (config.containingPoetryLock) {\n updateLine('poetry 1.1.13', 0, lines);\n updateLine('python 3.9.10', 0, lines);\n }\n if (config.depending.firebase) {\n updateLine('java adoptopenjdk-11.0.14+9', 0, lines);\n }\n if (config.containingPackageJson) {\n updateLine('yarn 1.22.17', lines.length, lines);\n }\n\n const toolVersionsPath = path.resolve(config.dirPath, '.tool-versions');\n if (lines.length) {\n await promisePool.run(() => fs.promises.writeFile(toolVersionsPath, lines.join('\\n') + '\\n'));\n } else {\n await promisePool.run(() => fs.promises.rm(toolVersionsPath, { force: true }));\n }\n}\n\nfunction updateLine(line: string, insertionIndex: number, lines: string[]): void {\n const [prefix] = line.split(' ');\n const index = lines.findIndex((l) => l.split(/\\s+/)[0] === prefix);\n if (index >= 0) {\n lines[index] = line;\n } else {\n lines.splice(insertionIndex, 0, line);\n }\n}\n", "import { PromisePool } from 'minimal-promise-pool';\n\nexport const promisePool = new PromisePool();\n", "import path from 'path';\n\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n${generateExtensions(Extensions.codeWith2IndentSize)}\nindent_size = 2\nindent_style = space\n\n${generateExtensions(Extensions.codeWith4IndentSize)}\nindent_size = 4\nindent_style = space\n\n${generateExtensions(Extensions.codeWith8IndentSize)}\nindent_size = 8\nindent_style = space\n\n${generateExtensions(Extensions.markdownLike)}\nmax_line_length = off\ntrim_trailing_whitespace = false\n\n[{Makefile,*.mk}]\nindent_style = tab\n`;\n\nexport async function generateEditorconfig(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.editorconfig');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n\nfunction generateExtensions(extensions: string[]): string {\n return extensions.length > 1 ? `[*.{${extensions.join(',')}}]` : `[*.${extensions[0]}]`;\n}\n", "export const Extensions = {\n codeWith2IndentSize: [\n 'cjs',\n 'mjs',\n 'js',\n 'jsx',\n 'ts',\n 'tsx',\n 'json',\n 'json5',\n 'cpp',\n 'dart',\n 'htm',\n 'html',\n 'pu',\n 'puml',\n 'rb',\n 'vue',\n 'yaml',\n 'yml',\n ].sort(),\n codeWith4IndentSize: ['go', 'gradle', 'py'].sort(),\n codeWith8IndentSize: ['sh'].sort(),\n markdownLike: ['md'].sort(),\n eslint: ['cjs', 'mjs', 'js', 'ts', 'tsx', 'jsx'].sort(),\n prettier: [\n 'cjs',\n 'mjs',\n 'js',\n 'jsx',\n 'ts',\n 'tsx',\n 'json',\n 'json5',\n 'css',\n 'htm',\n 'html',\n 'md',\n 'scss',\n 'vue',\n 'yaml',\n 'yml',\n ].sort(),\n};\n", "import fsp from 'fs/promises';\n\nexport const FsUtil = {\n async generateFile(filePath: string, content: string): Promise<void> {\n await fsp.writeFile(filePath, content);\n console.log(`Generated ${filePath}`);\n },\n};\n", "import path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n3rd-party/\n@types/\n__generated__/\nandroid/\nios/\nno-format/\ntest-fixtures/\n*.config.js\n*.d.ts\n*.min.js\n.yarn/\n.pnp.js\n`;\n\nexport async function generateEslintignore(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.eslintignore');\n const userContent = IgnoreFileUtil.getUserContent(filePath) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = IgnoreFileUtil.getExistingContent(gitignoreFilePath) || '';\n\n const newContent = userContent + commonContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\n\nexport const IgnoreFileUtil = {\n header: '# Project-specific settings',\n separator: '# Generated by @willbooster/willboosterify',\n separatorPrefix: '# Generated by @willbooster',\n getExistingContent(filePath: string): string | null {\n if (fs.existsSync(filePath)) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(/# Project-specific settings[^\\n]*\\n/m, '')\n .replace(/# Generated by[^\\n]*\\n/m, '')\n .replace(/\\r?\\n\\r?\\n(\\r?\\n)+/gm, '\\n\\n');\n }\n return null;\n },\n getUserContent(filePath: string): string | null {\n if (fs.existsSync(filePath)) {\n const existingContent = fs.readFileSync(filePath, 'utf-8');\n const index = existingContent.indexOf(this.separatorPrefix);\n if (index >= 0) {\n return existingContent.substr(0, existingContent.indexOf('\\n', index) + 1);\n }\n }\n return null;\n },\n isBerryZeroInstallEnabled(filePath: string): boolean {\n if (fs.existsSync(filePath)) {\n const existingContent = fs.readFileSync(filePath, 'utf-8');\n return existingContent.includes('\\n!.yarn/cache');\n }\n return false;\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateEslintrc(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n const bases = [];\n if (config.eslintBase) {\n bases.push(config.eslintBase);\n }\n if (config !== rootConfig) {\n bases.push('../../.eslintrc.json');\n }\n let newSettings: any = { root: true, extends: bases };\n\n const filePath = path.resolve(config.dirPath, '.eslintrc.json');\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(oldContent);\n if (oldSettings.extends) {\n oldSettings.extends = oldSettings.extends.filter(\n (ext: string) => !ext.startsWith('@willbooster/') && ext !== '../../.eslintrc.json'\n );\n }\n if (!bases.length) {\n oldSettings.extends = [];\n }\n const newExtends = newSettings.extends;\n newSettings.extends = oldSettings.extends;\n oldSettings.extends = newExtends;\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: combineMerge });\n if (config.depending.blitz) {\n newSettings.extends = [...newSettings.extends.filter((e: string) => e !== 'blitz'), 'blitz'];\n }\n } catch (e) {\n // do nothing\n }\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import merge from 'deepmerge';\n\nexport function overwriteMerge(destinationArray: any[], sourceArray: any[]): any[] {\n return sourceArray;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function combineMerge(target: any[], source: any[], options: any): any[] {\n const destination = target.slice();\n\n source.forEach((item, index) => {\n if (typeof destination[index] === 'undefined') {\n destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);\n } else if (options.isMergeableObject(item)) {\n destination[index] = merge(target[index], item, options);\n } else if (target.indexOf(item) === -1) {\n destination.push(item);\n }\n });\n return destination;\n}\n", "import path from 'path';\n\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `* text=auto\n\n*.vcproj text eol=crlf\n\n${Extensions.codeWith2IndentSize\n .concat(Extensions.codeWith4IndentSize)\n .concat(Extensions.markdownLike)\n .map((ext) => `*.${ext} text eol=lf`)\n .join('\\n')}\n`;\n\nexport async function generateGitattributes(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.gitattributes');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import path from 'path';\n\nimport { fetchOnNode } from '../utils/fetchOnNode';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\n\nconst defaultNames = ['windows', 'macos', 'linux', 'jetbrains', 'visualstudiocode', 'emacs', 'vim', 'yarn'];\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n.devcontainer/\ndist/\ntemp/\nIcon[\\r]\n*.sqlite3\n*.sqlite3-journal\n`;\n\nconst gitignoreCache = new Map<string, string>();\n\nexport async function generateGitignore(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.gitignore');\n let userContent = (IgnoreFileUtil.getUserContent(filePath) || defaultUserContent) + commonContent;\n\n const names = [...defaultNames];\n if (config.containingGemfile) {\n names.push('ruby');\n }\n if (config.containingGoMod) {\n names.push('go');\n userContent += `${path.basename(config.dirPath)}\n`;\n }\n if (config.containingPackageJson) {\n names.push('node');\n }\n if (config.containingPomXml) {\n names.push('maven');\n userContent += `.idea/google-java-format.xml\n`;\n }\n if (config.containingPubspecYaml) {\n names.push('flutter', 'AndroidStudio', 'ruby');\n userContent += `.flutter-plugins-dependencies\nandroid/key.properties\nios/.bundle\n.idea/runConfigurations.xml\n`;\n }\n if (config.containingTemplateYaml) {\n userContent += `.aws-sam/\npackaged.yaml\n`;\n }\n // Because .venv should be ignored on root directory\n if (config.containingPoetryLock) {\n names.push('python');\n }\n if (rootConfig.depending.firebase || config.depending.firebase) {\n names.push('firebase');\n }\n if (rootConfig.depending.reactNative || config.depending.reactNative) {\n names.push('reactnative');\n userContent += `google-services.json\nandroid/app/src/main/assets/\n`;\n }\n if (rootConfig.depending.storybook) {\n names.push('storybookjs');\n }\n if (rootConfig.depending.blitz) {\n names.push('nextjs');\n userContent += `.blitz/\n.blitz**\n`;\n }\n\n let generated = '';\n for (const name of names) {\n if (!gitignoreCache.has(name)) {\n const url = `https://www.toptal.com/developers/gitignore/api/${name}`;\n const response = await fetchOnNode(url);\n const responseText = await response.text();\n if (responseText.includes('Attention Required!')) {\n console.error(`Failed to fetch ${url}`);\n return;\n }\n gitignoreCache.set(name, responseText);\n }\n generated += gitignoreCache.get(name);\n }\n if (!IgnoreFileUtil.isBerryZeroInstallEnabled(filePath)) {\n generated = generated.replace('!.yarn/cache', '# !.yarn/cache').replace('# .pnp.*', '.pnp.*');\n }\n if (config.containingPomXml || config.containingPubspecYaml) {\n generated = generated\n .replace(/^# .idea\\/artifacts$/gm, '.idea/artifacts')\n .replace(/^# .idea\\/compiler.xml$/gm, '.idea/compiler.xml')\n .replace(/^# .idea\\/jarRepositories.xml$/gm, '.idea/jarRepositories.xml')\n .replace(/^# .idea\\/modules.xml$/gm, '.idea/modules.xml')\n .replace(/^# .idea\\/*.iml$/gm, '.idea/*.iml')\n .replace(/^# .idea\\/modules$/gm, '.idea/modules')\n .replace(/^# *.iml$/gm, '*.iml')\n .replace(/^# *.ipr$/gm, '*.ipr');\n if (config.containingPubspecYaml) {\n generated = generated.replace(/^.idea\\/modules.xml$/gm, '# .idea/modules.xml');\n }\n }\n generated = generated.replace(/^.idea\\/?$/gm, '# .idea');\n if (rootConfig.depending.reactNative || config.depending.reactNative || config.containingPubspecYaml) {\n generated = generated.replace(/^(.idea\\/.+)$/gm, '$1\\nandroid/$1');\n }\n const newContent = userContent + generated;\n await FsUtil.generateFile(filePath, newContent);\n}\n", "import type { RequestInfo, RequestInit, Response } from 'node-fetch';\n\nexport async function fetchOnNode(url: RequestInfo, init?: RequestInit | undefined): Promise<Response> {\n const { default: nodeFetch } = await import('node-fetch');\n return nodeFetch(url, init);\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\n\nconst DEFAULT_COMMAND = 'npm test';\n\nconst settings = {\n preCommit: 'yarn lint-staged',\n prePush: `yarn typecheck`,\n prePushForLab: `\nif [ $(git branch --show-current) = \"main\" ]; then\n echo \"************************************************\"\n echo \"*** Don't push main branch directly. Use PR! ***\"\n echo \"************************************************\"\n exit 1\nfi\n\nyarn typecheck`.trim(),\n postMerge: 'yarn',\n};\n\nexport async function generateHuskyrc(config: PackageConfig): Promise<void> {\n const packageJsonPath = path.resolve(config.dirPath, 'package.json');\n const jsonText = await fs.promises.readFile(packageJsonPath, 'utf-8');\n const packageJson = JSON.parse(jsonText);\n packageJson.scripts ||= {};\n delete packageJson.scripts['postinstall'];\n delete packageJson.scripts['postpublish'];\n delete packageJson.scripts['prepare'];\n delete packageJson.scripts['prepublishOnly'];\n delete packageJson.scripts['prepack'];\n delete packageJson.scripts['postpack'];\n\n const dirPath = path.resolve(config.dirPath, '.husky');\n await Promise.all([\n fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson, undefined, 2)),\n fs.promises.rm(dirPath, { force: true, recursive: true }),\n ]);\n spawnSync('yarn', ['dlx', 'husky-init', '--yarn2'], config.dirPath);\n\n const preCommitFilePath = path.resolve(dirPath, 'pre-commit');\n const content = await fs.promises.readFile(preCommitFilePath, 'utf-8');\n\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.huskyrc.json'), { force: true }));\n await promisePool.run(() =>\n fs.promises.writeFile(preCommitFilePath, content.replace(DEFAULT_COMMAND, settings.preCommit))\n );\n\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n const prePush = config.repository?.startsWith('github:WillBoosterLab/') ? settings.prePushForLab : settings.prePush;\n await promisePool.run(() =>\n fs.promises.writeFile(path.resolve(dirPath, 'pre-push'), content.replace(DEFAULT_COMMAND, prePush), {\n mode: 0o755,\n })\n );\n }\n\n const postMergeCommands: string[] = [];\n if (config.versionsText?.includes('python ')) {\n postMergeCommands.push('asdf install python');\n }\n if (config.versionsText) {\n postMergeCommands.push('asdf install');\n }\n postMergeCommands.push(settings.postMerge);\n if (config.versionsText?.includes('poetry ')) {\n postMergeCommands.push('poetry install');\n }\n if (config.depending.blitz) {\n postMergeCommands.push('yarn blitz codegen');\n } else if (config.depending.prisma) {\n postMergeCommands.push('yarn prisma generate');\n }\n const postMergeCommand = content.replace(DEFAULT_COMMAND, postMergeCommands.join(' && '));\n await promisePool.run(() =>\n fs.promises.writeFile(path.resolve(dirPath, 'post-merge'), postMergeCommand, {\n mode: 0o755,\n })\n );\n}\n", "import child_process from 'child_process';\n\nexport function spawnSync(command: string, args: string[], cwd: string, retry = 0): void {\n do {\n const [commandAndArgs, options] = getSpawnSyncArgs(command, args, cwd);\n console.log(`$ ${commandAndArgs} at ${options.cwd}`);\n const ret = child_process.spawnSync(commandAndArgs, options);\n if (ret.status === 0) break;\n } while (--retry >= 0);\n}\n\nexport function spawnSyncWithStringResult(command: string, args: string[], cwd: string): string {\n const [commandAndArgs, options] = getSpawnSyncArgs(command, args, cwd);\n options.stdio = 'pipe';\n const proc = child_process.spawnSync(commandAndArgs, options);\n return proc.stdout.toString().trim();\n}\n\nexport function getSpawnSyncArgs(command: string, args: string[], cwd: string): [string, any] {\n const env = { ...process.env };\n // Remove berry from PATH\n if (env.PATH && env.BERRY_BIN_FOLDER) {\n env.PATH = env.PATH.replace(`${env.BERRY_BIN_FOLDER}:`, '');\n }\n\n let commandAndArgs = `${command} ${args.join(' ')}`;\n if (env.ASDF_DIR) {\n commandAndArgs = `bash -l -c '. ${env.ASDF_DIR}/asdf.sh && ${commandAndArgs}'`;\n }\n return [\n commandAndArgs,\n {\n cwd,\n env,\n shell: true,\n stdio: 'inherit',\n },\n ];\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectTasksOptions\">\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"ts\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.ts)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"tsx\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.tsx)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"js\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.js)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"json\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.json)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"md\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.md)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"html\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.html)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n </component>\n</project>\n`;\n\nexport async function generateIdeaSettings(config: PackageConfig): Promise<void> {\n const dirPath = path.resolve(config.dirPath, '.idea');\n if (fs.existsSync(dirPath)) {\n const filePath = path.resolve(dirPath, 'watcherTasks.xml');\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages ||\n (config.containingPackageJson &&\n !config.containingPubspecYaml &&\n !config.containingGemfile &&\n !config.containingGoMod &&\n !config.containingPomXml)\n ) {\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } else {\n await promisePool.run(() => fs.promises.rm(filePath, { force: true }));\n }\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst eslintKey = `./{src,__tests__}/**/*.{${Extensions.eslint.join(',')}}`;\nconst eslintFilterForPrettier = `files = micromatch.not(files, '${eslintKey}');`;\n\nexport async function generateLintstagedrc(config: PackageConfig): Promise<void> {\n const lines: string[] = [];\n if (config.containingJavaScript || config.containingTypeScript) {\n const eslint = `\n '${eslintKey}': [${JSON.stringify(`eslint --fix${EslintUtil.getLintFixSuffix(config)}`)}, 'prettier --write'],`;\n lines.push(eslint);\n }\n const packagesFilter = config.root ? \" && !file.includes('/packages/')\" : '';\n lines.push(`\n './**/*.{${Extensions.prettier.join(',')}}': files => {\n ${config.containingJavaScript || config.containingTypeScript ? eslintFilterForPrettier : ''}\n const filteredFiles = files.filter(file => !file.includes('/test-fixtures/')${packagesFilter});\n if (filteredFiles.length === 0) return [];\n const commands = [\\`prettier --write \\${filteredFiles.join(' ')}\\`];\n if (filteredFiles.some(file => file.endsWith('package.json'))) {\n commands.push('yarn sort-package-json');\n }\n return commands;\n },`);\n if (config.containingPubspecYaml) {\n lines.push(`\n './{lib,test,test_driver}/**/*.dart': files => {\n const filteredFiles = files.filter(file => !file.includes('generated'))\n .filter(file => !file.endsWith('.freezed.dart') && !file.endsWith('.g.dart'));\n if (filteredFiles.length === 0) return [];\n return [\\`flutter format \\${filteredFiles.join(' ')}\\`];\n },`);\n }\n if (config.containingPoetryLock) {\n lines.push(`\n './**/*.py': [\n 'poetry run isort --profile black --filter-files',\n 'poetry run black',\n 'poetry run flake8'\n ],`);\n }\n\n const newContent = `${\n config.containingJavaScript || config.containingTypeScript ? \"const micromatch = require('micromatch');\" : ''\n }\n\nmodule.exports = {${lines.join('')}\n};\n`;\n\n const filePath = path.resolve(config.dirPath, '.lintstagedrc.cjs');\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.lintstagedrc.js'), { force: true }));\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.lintstagedrc.json'), { force: true }));\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import { PackageConfig } from './packageConfig';\n\nexport const EslintUtil = {\n getLintFixSuffix(config: PackageConfig): string {\n return config.containingJsxOrTsx ? ' --rule \"{ react-hooks/exhaustive-deps: 0 }\"' : '';\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { Extensions } from '../utils/extensions';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\n\nconst scriptsWithoutWorkspace = {\n cleanup: 'yarn format && yarn lint-fix',\n format: `sort-package-json && yarn prettify`,\n lint: `eslint --color \"./{src,__tests__}/**/*.{${Extensions.eslint.join(',')}}\"`,\n 'lint-fix': 'yarn lint --fix',\n prettify: `prettier --color --write \"**/{.*/,}*.{${Extensions.prettier.join(',')}}\" \"!**/test-fixtures/**\"`,\n typecheck: 'tsc --noEmit --Pretty',\n};\n\nconst scriptsWithWorkspace = merge(\n { ...scriptsWithoutWorkspace },\n {\n format: `sort-package-json && yarn prettify && yarn workspaces foreach --parallel --verbose run format`,\n lint: `yarn workspaces foreach --parallel --verbose run lint`,\n 'lint-fix': 'yarn workspaces foreach --parallel --verbose run lint-fix',\n prettify: `prettier --color --write \"**/{.*/,}*.{${Extensions.prettier.join(\n ','\n )}}\" \"!**/packages/**\" \"!**/test-fixtures/**\"`,\n test: 'yarn workspaces foreach --verbose run test',\n typecheck: 'yarn workspaces foreach --parallel --verbose run typecheck',\n }\n);\n\nconst scriptsForBlitz = merge(\n { ...scriptsWithoutWorkspace },\n {\n lint: `eslint --color \"./**/*.{${Extensions.eslint.join(',')}}\"`,\n typecheck: `tsc --noEmit --Pretty || echo 'Please try \"yarn blitz codegen\" if you face unknown type errors.'`,\n }\n);\n\nconst jsCommonDeps = [\n 'eslint',\n 'eslint-config-prettier',\n 'eslint-plugin-import',\n 'eslint-plugin-sort-class-members',\n 'eslint-plugin-sort-destructure-keys',\n];\n\nconst tsCommonDeps = [\n ...jsCommonDeps,\n '@typescript-eslint/eslint-plugin',\n '@typescript-eslint/parser',\n 'eslint-import-resolver-typescript',\n];\n\nconst reactCommonDeps = ['eslint-plugin-react', 'eslint-plugin-react-hooks'];\n\nconst devDeps: { [prop: string]: string[] } = {\n '@willbooster/eslint-config-js': ['@willbooster/eslint-config-js', ...jsCommonDeps],\n '@willbooster/eslint-config-js-react': ['@willbooster/eslint-config-js-react', ...jsCommonDeps, ...reactCommonDeps],\n '@willbooster/eslint-config-ts': ['@willbooster/eslint-config-ts', ...tsCommonDeps],\n '@willbooster/eslint-config-ts-react': ['@willbooster/eslint-config-ts-react', ...tsCommonDeps, ...reactCommonDeps],\n '../../.eslintrc.json': [],\n};\n\nexport async function generatePackageJson(\n config: PackageConfig,\n rootConfig: PackageConfig,\n skipAddingDeps: boolean\n): Promise<void> {\n const filePath = path.resolve(config.dirPath, 'package.json');\n const jsonText = await fs.promises.readFile(filePath, 'utf-8');\n const jsonObj = JSON.parse(jsonText);\n jsonObj.scripts = jsonObj.scripts || {};\n jsonObj.dependencies = jsonObj.dependencies || {};\n jsonObj.devDependencies = jsonObj.devDependencies || {};\n jsonObj.peerDependencies = jsonObj.peerDependencies || {};\n\n await removeDeprecatedStuff(jsonObj);\n\n if (jsonObj.name !== '@willbooster/prettier-config') {\n jsonObj.prettier = '@willbooster/prettier-config';\n }\n\n for (const scriptKey of Object.keys(jsonObj.scripts)) {\n // Fresh repo still requires 'yarn install'\n if (!jsonObj.scripts[scriptKey].includes('git clone')) {\n jsonObj.scripts[scriptKey] = jsonObj.scripts[scriptKey]\n .replace(/yarn\\s*&&\\s*/, '')\n .replace(/yarn\\s*install\\s*&&\\s*/, '');\n }\n }\n\n jsonObj.scripts = merge(\n jsonObj.scripts,\n config.containingSubPackageJsons\n ? scriptsWithWorkspace\n : config.depending.blitz\n ? scriptsForBlitz\n : scriptsWithoutWorkspace\n );\n jsonObj.scripts.prettify += await generatePrettierSuffix(config.dirPath);\n\n let dependencies: string[] = [];\n let devDependencies = ['lint-staged', 'prettier', 'sort-package-json', '@willbooster/prettier-config'];\n const poetryDependencies: string[] = [];\n\n if (config.root) {\n // To install the latest pinst\n devDependencies.push('husky', 'pinst', '@willbooster/renovate-config');\n if (config.depending.semanticRelease) {\n devDependencies.push('conventional-changelog-conventionalcommits');\n }\n if (config.containingSubPackageJsons) {\n jsonObj.workspaces = ['packages/*'];\n } else {\n delete jsonObj.workspaces;\n }\n }\n\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n devDependencies.push('eslint', 'micromatch');\n // TODO: not needed anymore?\n if (config.containingTypeScriptInPackages) {\n devDependencies.push('@typescript-eslint/parser');\n }\n }\n\n if ((config.containingTypeScript || config.containingTypeScriptInPackages) && !config.depending.blitz) {\n devDependencies.push('typescript');\n }\n\n if (config.eslintBase) {\n devDependencies.push(...devDeps[config.eslintBase]);\n }\n\n if (config.willBoosterConfigs) {\n dependencies = dependencies.filter((dep) => !dep.includes('@willbooster/'));\n devDependencies = devDependencies.filter((dep) => !dep.includes('@willbooster/'));\n }\n\n if (!jsonObj.name) {\n jsonObj.name = path.basename(config.dirPath);\n }\n\n if (config.containingSubPackageJsons) {\n jsonObj.private = true;\n }\n\n if (!jsonObj.license) {\n jsonObj.license = 'UNLICENSED';\n }\n\n if (!config.containingTypeScript && !config.containingTypeScriptInPackages) {\n delete jsonObj.scripts.typecheck;\n }\n\n // https://github.com/semantic-release/semantic-release/issues/2323#issuecomment-1032341621\n if (config.depending.semanticRelease && config.release.npm) {\n jsonObj.resolutions ||= {};\n jsonObj.resolutions['npm/chalk'] = '^4.1.2';\n }\n\n if (!config.containingSubPackageJsons) {\n if (!config.containingJavaScript && !config.containingTypeScript) {\n delete jsonObj.scripts.lint;\n delete jsonObj.scripts['lint-fix'];\n jsonObj.scripts.cleanup = jsonObj.scripts.cleanup.replace(' && yarn lint-fix', '');\n } else {\n jsonObj.scripts['lint-fix'] += EslintUtil.getLintFixSuffix(config);\n }\n\n if (config.containingPubspecYaml) {\n jsonObj.scripts.lint = 'flutter analyze';\n jsonObj.scripts['lint-fix'] = 'yarn lint';\n const dirs = ['lib', 'test', 'test_driver'].filter((dir) => fs.existsSync(path.resolve(config.dirPath, dir)));\n if (dirs.length > 0) {\n jsonObj.scripts['format-code'] = `flutter format $(find ${dirs.join(\n ' '\n )} -name generated -prune -o -name '*.freezed.dart' -prune -o -name '*.g.dart' -prune -o -name '*.dart' -print)`;\n jsonObj.scripts.format += ` && yarn format-code`;\n }\n }\n\n if (config.containingPoetryLock) {\n if (jsonObj.scripts.postinstall === 'poetry install') {\n delete jsonObj.scripts.postinstall;\n }\n const dirNames = (await fs.promises.readdir(config.dirPath)).filter((dirName) => {\n const dirPath = path.resolve(config.dirPath, dirName);\n if (!fs.lstatSync(dirPath).isDirectory()) return false;\n return fs.readdirSync(dirPath).some((fileName) => fileName.endsWith('.py'));\n });\n if (dirNames.length > 0) {\n jsonObj.scripts['format-code'] = `poetry run isort --profile black ${dirNames.join(\n ' '\n )} && poetry run black ${dirNames.join(' ')}`;\n jsonObj.scripts.lint = `poetry run flake8 ${dirNames.join(' ')}`;\n jsonObj.scripts['lint-fix'] = 'yarn lint';\n jsonObj.scripts.format += ` && yarn format-code`;\n poetryDependencies.push('black', 'isort', 'flake8');\n }\n }\n\n if (config.repository) {\n jsonObj.repository = config.repository;\n }\n }\n\n if (config.depending.blitz) {\n // These cause an error of eslint-plugin-import loading\n devDependencies = devDependencies.filter((dep) => !dep.includes('@typescript-eslint/'));\n // This causes eslint errors\n devDependencies = devDependencies.filter(\n (d) =>\n d !== 'eslint-plugin-react' &&\n d !== 'eslint-import-resolver-typescript' &&\n d !== 'eslint-plugin-import' &&\n d !== 'eslint-plugin-react-hooks'\n );\n }\n if (!Object.keys(jsonObj.dependencies).length) {\n delete jsonObj.dependencies;\n }\n if (!Object.keys(jsonObj.devDependencies).length) {\n delete jsonObj.devDependencies;\n }\n if (!Object.keys(jsonObj.peerDependencies).length) {\n delete jsonObj.peerDependencies;\n }\n\n await fs.promises.writeFile(filePath, JSON.stringify(jsonObj));\n\n if (!skipAddingDeps) {\n dependencies = dependencies.filter((dep) => !jsonObj.dependencies?.[dep] && !jsonObj.devDependencies?.[dep]);\n if (dependencies.length) {\n spawnSync('yarn', ['add', ...new Set(dependencies)], config.dirPath);\n }\n devDependencies = devDependencies.filter((dep) => !jsonObj.dependencies?.[dep] && !jsonObj.devDependencies?.[dep]);\n if (devDependencies.length) {\n spawnSync('yarn', ['add', '-D', ...new Set(devDependencies)], config.dirPath);\n }\n if (poetryDependencies.length) {\n spawnSync('poetry', ['add', ...new Set(poetryDependencies)], config.dirPath);\n }\n }\n}\n\nasync function removeDeprecatedStuff(jsonObj: any): Promise<void> {\n // TODO: remove the following migration code in future\n if (jsonObj.author === 'WillBooster LLC') {\n jsonObj.author = 'WillBooster Inc.';\n }\n delete jsonObj.scripts['sort-package-json'];\n delete jsonObj.scripts['sort-all-package-json'];\n delete jsonObj.dependencies['tslib'];\n delete jsonObj.devDependencies['@willbooster/eslint-config'];\n delete jsonObj.devDependencies['@willbooster/eslint-config-react'];\n delete jsonObj.devDependencies['@willbooster/tsconfig'];\n delete jsonObj.devDependencies['eslint-import-resolver-node'];\n delete jsonObj.devDependencies['eslint-plugin-prettier'];\n delete jsonObj.devDependencies['lerna'];\n // To install the latest pinst\n delete jsonObj.devDependencies['pinst'];\n delete jsonObj.scripts['flutter-format'];\n delete jsonObj.scripts['format-flutter'];\n delete jsonObj.scripts['python-format'];\n delete jsonObj.scripts['format-python'];\n delete jsonObj.scripts['prettier'];\n for (const deps of Object.values(devDeps)) {\n for (const dep of deps) {\n delete jsonObj.devDependencies[dep];\n }\n }\n await promisePool.run(() => fs.promises.rm('lerna.json', { force: true }));\n}\n\nasync function generatePrettierSuffix(dirPath: string): Promise<string> {\n const filePath = path.resolve(dirPath, '.prettierignore');\n const existingContent = await fs.promises.readFile(filePath, 'utf-8');\n const index = existingContent.indexOf(IgnoreFileUtil.separatorPrefix);\n if (index < 0) return '';\n\n const originalContent = existingContent.substring(0, index);\n const lines = originalContent\n .split('\\n')\n .map((line) => {\n const newLine = line.trim();\n return newLine.endsWith('/') ? newLine.slice(0, -1) : newLine;\n })\n .filter((l) => l && !l.startsWith('#') && !l.includes('/'));\n\n return lines.map((line) => ` \"!**/${line}/**\"`).join('');\n}\n", "import path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n3rd-party/\nandroid/\nios/\nno-format/\ntest-fixtures/\n*.d.ts\n*.min.js\n.yarn/\n.pnp.js\n`;\n\nexport async function generatePrettierignore(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.prettierignore');\n const userContent = IgnoreFileUtil.getUserContent(filePath) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = IgnoreFileUtil.getExistingContent(gitignoreFilePath) || '';\n\n let additionalContent = '';\n if (config.containingPubspecYaml) {\n additionalContent = `\nandroid/app/\nios/Runner/Assets.xcassets/\npubspec.yaml\n`;\n }\n\n const newContent = userContent + commonContent + additionalContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateReleaserc(rootConfig: PackageConfig): Promise<void> {\n const filePath = path.resolve(rootConfig.dirPath, '.releaserc.json');\n try {\n const settings = JSON.parse(await fs.promises.readFile(filePath, 'utf8'));\n const plugins = settings?.plugins || [];\n for (let i = 0; i < plugins.length; i++) {\n if (plugins[i] === '@semantic-release/commit-analyzer' || plugins[i][0] === '@semantic-release/commit-analyzer') {\n plugins[i] = [\n '@semantic-release/commit-analyzer',\n {\n preset: 'conventionalcommits',\n },\n ];\n }\n }\n const newContent = JSON.stringify(settings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } catch (_) {\n // do nothing\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst jsonObj = {\n extends: ['@willbooster'],\n};\n\nexport async function generateRenovateJson(config: PackageConfig): Promise<void> {\n let newSettings: any = cloneDeep(jsonObj);\n\n const filePath = path.resolve(config.dirPath, '.renovaterc.json');\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(oldContent) as any;\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: overwriteMerge });\n } catch (e) {\n // do nothing\n }\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.dependabot'), { force: true }));\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, 'renovate.json'), { force: true }));\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newSettings = {\n titleOnly: true,\n};\n\nexport async function generateSemanticYml(rootConfig: PackageConfig): Promise<void> {\n const githubPath = path.resolve(rootConfig.dirPath, '.github');\n await fs.promises.mkdir(githubPath, { recursive: true });\n const filePath = path.join(githubPath, 'semantic.yml');\n const newContent = yaml.dump(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst rootJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react',\n alwaysStrict: true,\n strict: true,\n skipLibCheck: true,\n allowSyntheticDefaultImports: true,\n esModuleInterop: true,\n resolveJsonModule: true,\n sourceMap: true,\n importHelpers: false,\n outDir: 'dist',\n },\n include: [\n 'src/**/*',\n '__tests__/**/*',\n 'packages/*/src/**/*',\n 'packages/*/__tests__/**/*',\n './node_modules/@types',\n './@types',\n ],\n};\n\nconst subJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react',\n alwaysStrict: true,\n strict: true,\n skipLibCheck: true,\n allowSyntheticDefaultImports: true,\n esModuleInterop: true,\n resolveJsonModule: true,\n sourceMap: true,\n importHelpers: false,\n outDir: 'dist',\n },\n include: ['src/**/*', '__tests__/**/*', '../../node_modules/@types', '../../@types', './@types'],\n};\n\nexport async function generateTsconfig(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n if (rootConfig.depending.blitz) return;\n\n let newSettings: any = cloneDeep(config.root ? rootJsonObj : subJsonObj);\n if (!config.containingJsxOrTsx && !config.containingJsxOrTsxInPackages) {\n delete newSettings.compilerOptions.jsx;\n }\n if (config.root && !config.containingSubPackageJsons) {\n newSettings.include = newSettings.include.filter((dirPath: string) => !dirPath.startsWith('packages/*/'));\n }\n if (!config.root && (config.depending.jestPlaywrightPreset || rootConfig.depending.jestPlaywrightPreset)) {\n const relativeDirPath = path.relative(config.dirPath, rootConfig.dirPath);\n newSettings.include.push(\n ...[\n path.join(relativeDirPath, 'node_modules/jest-playwright-preset/types'),\n path.join(relativeDirPath, 'node_modules/expect-playwright'),\n ]\n );\n }\n\n const filePath = path.resolve(config.dirPath, 'tsconfig.json');\n try {\n const existingContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(existingContent);\n if (oldSettings.extends === './node_modules/@willbooster/tsconfig/tsconfig.json') {\n delete oldSettings.extends;\n }\n delete oldSettings.compilerOptions?.typeRoots;\n delete newSettings?.compilerOptions?.target;\n delete newSettings?.compilerOptions?.module;\n if (oldSettings.jsx) {\n delete newSettings.jsx;\n }\n if (!config.depending.blitz) {\n delete newSettings.include;\n }\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: overwriteMerge });\n } catch (e) {\n // do nothing\n }\n sortKeys(newSettings.compilerOptions);\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "export function sortKeys(obj: any): void {\n const keyAndValues = Object.entries(obj).sort(([key1], [key2]) => key1.localeCompare(key2));\n for (const [key, value] of keyAndValues) {\n delete obj[key];\n obj[key] = value;\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport yaml from 'js-yaml';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { combineMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst testWorkflow = {\n name: 'Test',\n on: {\n pull_request: {\n branches: ['main', '!renovate/**'],\n },\n push: {\n branches: ['main', 'renovate/**'],\n },\n },\n jobs: {\n test: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/test.yml@main',\n },\n },\n};\n\nconst releaseWorkflow = {\n name: 'Release',\n on: {\n push: {\n branches: [],\n },\n },\n jobs: {\n release: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/release.yml@main',\n },\n },\n};\n\nconst wbfyWorkflow = {\n name: 'Willboosterify',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n wbfy: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main',\n },\n },\n};\n\nexport async function generateWorkflow(rootConfig: PackageConfig): Promise<void> {\n const workflowsPath = path.resolve(rootConfig.dirPath, '.github', 'workflows');\n await fs.promises.mkdir(workflowsPath, { recursive: true });\n\n const fileNames = (await fs.promises.readdir(workflowsPath, { withFileTypes: true }))\n .filter((dirent) => dirent.isFile() && dirent.name.endsWith('.yml'))\n .map((dirent) => dirent.name);\n if (rootConfig.depending.semanticRelease) {\n fileNames.push('release.yml');\n }\n fileNames.push('test.yml', 'wbfy.yml');\n\n for (const fileName of fileNames) {\n const kind = path.basename(fileName, '.yml');\n await promisePool.run(() => writeWorkflowYaml(rootConfig, workflowsPath, kind));\n }\n}\n\nasync function writeWorkflowYaml(\n config: PackageConfig,\n workflowsPath: string,\n kind: 'test' | 'release' | 'wbfy' | string\n): Promise<void> {\n let newSettings: any = {};\n if (kind === 'test') {\n newSettings = testWorkflow;\n } else if (kind === 'release') {\n newSettings = releaseWorkflow;\n } else if (kind === 'wbfy') {\n newSettings = wbfyWorkflow;\n }\n newSettings = cloneDeep(newSettings);\n\n const filePath = path.join(workflowsPath, `${kind}.yml`);\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = yaml.load(oldContent);\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: combineMerge });\n } catch (e) {\n // do nothing\n }\n\n if (kind === 'release') {\n if (newSettings.on.schedule) {\n delete newSettings.on.push;\n } else {\n newSettings.on.push.branches = config.release.branches;\n }\n } else if (kind === 'wbfy') {\n const firstCharOfCron = newSettings.on.schedule?.[0]?.cron?.[0];\n if (!firstCharOfCron || firstCharOfCron === '0') {\n const min = 1 + Math.floor(Math.random() * 59);\n const hour = (3 + Math.floor(Math.random() * 6) + 9) % 24;\n const cron = `${min} ${hour} * * *`;\n newSettings.on.schedule = [{ cron }];\n }\n }\n\n for (const job of Object.values(newSettings.jobs) as any[]) {\n if (!job.uses?.includes?.('/reusable-workflows/')) break;\n\n normalizeJob(config, job, kind);\n }\n\n if (kind === 'release') {\n await promisePool.run(() => fs.promises.rm('semantic-release.yml', { force: true }));\n }\n const ymlText = yaml.dump(newSettings, {\n lineWidth: -1,\n noCompatMode: true,\n styles: {\n '!!null': 'empty',\n },\n });\n await fs.promises.writeFile(filePath, ymlText);\n}\n\nfunction normalizeJob(config: PackageConfig, job: any, kind: string): void {\n job.with ||= {};\n job.secrets ||= {};\n if ((config.release.github && kind === 'test') || kind === 'release' || kind === 'wbfy') {\n if (config.publicRepo) {\n job.secrets['GH_TOKEN'] = '${{ secrets.PUBLIC_GH_BOT_PAT }}';\n } else {\n job.secrets['GH_TOKEN'] = '${{ secrets.GH_BOT_PAT }}';\n }\n }\n if (config.release.npm && (kind === 'release' || kind === 'test')) {\n job.secrets['NPM_TOKEN'] = '${{ secrets.NPM_TOKEN }}';\n }\n\n if (config.repository?.startsWith('github:WillBooster/')) {\n job.uses = job.uses.replace('WillBoosterLab/', 'WillBooster/');\n } else if (config.repository?.startsWith('github:WillBoosterLab/')) {\n job.uses = job.uses.replace('WillBooster/', 'WillBoosterLab/');\n }\n\n if (config.containingDockerfile) {\n job.with['cpu_arch'] = 'X64';\n }\n delete job.with['non_self_hosted'];\n if (Object.keys(job.with).length) {\n sortKeys(job.with);\n } else {\n delete job.with;\n }\n\n if (Object.keys(job.secrets).length) {\n sortKeys(job.secrets);\n } else {\n delete job.secrets;\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateYarnrcYml(config: PackageConfig): Promise<void> {\n const currentVersion = spawnSyncWithStringResult('yarn', ['--version'], config.dirPath);\n const latestVersion = spawnSyncWithStringResult('npm', ['show', '@yarnpkg/cli', 'version'], config.dirPath);\n if (currentVersion !== latestVersion) {\n spawnSync('yarn', ['set', 'version', latestVersion], config.dirPath, 1);\n }\n\n const releasesPath = path.join(config.dirPath, '.yarn', 'releases');\n await fs.promises.mkdir(releasesPath, { recursive: true });\n for (const file of await fs.promises.readdir(releasesPath)) {\n if (file.startsWith('yarn-') && !file.startsWith(`yarn-${latestVersion}.`)) {\n await promisePool.run(() => fs.promises.rm(path.join(releasesPath, file)));\n console.log('Removed', path.join(releasesPath, file));\n }\n }\n\n const yarnrcPath = path.resolve(config.dirPath, '.yarnrc');\n await promisePool.run(() => fs.promises.rm(yarnrcPath, { force: true }));\n\n const yarnrcYmlPath = path.resolve(config.dirPath, '.yarnrc.yml');\n const settings = yaml.load(await fs.promises.readFile(yarnrcYmlPath, 'utf8')) as any;\n settings.defaultSemverRangePrefix = '';\n if (config.requiringNodeModules) {\n settings.nodeLinker = 'node-modules';\n settings.nmMode = 'hardlinks-global';\n }\n await fs.promises.writeFile(yarnrcYmlPath, yaml.dump(settings, { lineWidth: -1 }));\n\n const plugins = (settings.plugins || []).map((p: any) => p.spec as string);\n const requireTypeScript = config.containingTypeScript || config.containingTypeScriptInPackages;\n importOrRemovePlugin(config, plugins, requireTypeScript, '@yarnpkg/plugin-typescript');\n if (requireTypeScript && !config.requiringNodeModules) {\n spawnSync('yarn', ['dlx', '@yarnpkg/sdks', 'vscode'], config.dirPath);\n }\n importOrRemovePlugin(config, plugins, config.containingSubPackageJsons, '@yarnpkg/plugin-workspace-tools');\n spawnSync('yarn', ['dlx', 'yarn-plugin-auto-install'], config.dirPath);\n}\n\nfunction importOrRemovePlugin(config: PackageConfig, plugins: string[], requirePlugin: boolean, plugin: string): void {\n if (requirePlugin !== plugins.includes(plugin)) {\n spawnSync('yarn', ['plugin', requirePlugin ? 'import' : 'remove', plugin], config.dirPath);\n }\n}\n", "import fs from 'fs';\nimport fsp from 'fs/promises';\nimport path from 'path';\n\nimport glob from 'glob';\nimport yaml from 'js-yaml';\nimport simpleGit from 'simple-git';\n\nimport { fetchOnNode } from './fetchOnNode';\n\nexport interface PackageConfig {\n dirPath: string;\n root: boolean;\n publicRepo: boolean;\n repository?: string;\n willBoosterConfigs: boolean;\n containingSubPackageJsons: boolean;\n containingDockerfile: boolean;\n containingGemfile: boolean;\n containingGoMod: boolean;\n containingPackageJson: boolean;\n containingPoetryLock: boolean;\n containingPomXml: boolean;\n containingPubspecYaml: boolean;\n containingTemplateYaml: boolean;\n\n containingJavaScript: boolean;\n containingTypeScript: boolean;\n containingJsxOrTsx: boolean;\n containingJavaScriptInPackages: boolean;\n containingTypeScriptInPackages: boolean;\n containingJsxOrTsxInPackages: boolean;\n depending: {\n blitz: boolean;\n firebase: boolean;\n jestPlaywrightPreset: boolean;\n prisma: boolean;\n reactNative: boolean;\n semanticRelease: boolean;\n storybook: boolean;\n };\n release: {\n branches: string[];\n github: boolean;\n npm: boolean;\n };\n eslintBase?: string;\n requiringNodeModules: boolean;\n versionsText?: string;\n}\n\nexport async function getPackageConfig(dirPath: string): Promise<PackageConfig | null> {\n const packageJsonPath = path.resolve(dirPath, 'package.json');\n try {\n const containingPackageJson = fs.existsSync(packageJsonPath);\n let dependencies: { [key: string]: string } = {};\n let devDependencies: { [key: string]: string } = {};\n let packageJson: any = {};\n if (containingPackageJson) {\n const packageJsonText = fs.readFileSync(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(packageJsonText);\n dependencies = packageJson.dependencies ?? {};\n devDependencies = packageJson.devDependencies ?? {};\n }\n\n let requiringNodeModules = true;\n try {\n const yarnrcYmlPath = path.resolve(dirPath, '.yarnrc.yml');\n const doc = yaml.load(await fsp.readFile(yarnrcYmlPath, 'utf8')) as any;\n requiringNodeModules = !doc.nodeLinker || doc.nodeLinker === 'node-modules';\n } catch (_) {\n // do nothing\n }\n\n let releaseBranches: string[] = [];\n let releasePlugins: string[] = [];\n try {\n const releasercJsonPath = path.resolve(dirPath, '.releaserc.json');\n const json = JSON.parse(await fsp.readFile(releasercJsonPath, 'utf8'));\n releaseBranches = json?.branches || [];\n releasePlugins = json?.plugins?.flat() || [];\n } catch (_) {\n // do nothing\n }\n\n const isRoot =\n path.basename(path.resolve(dirPath, '..')) !== 'packages' ||\n !fs.existsSync(path.resolve(dirPath, '..', '..', 'package.json'));\n\n let repoInfo: Record<string, any> | undefined;\n if (isRoot) {\n repoInfo = await getRepoInfo(dirPath, packageJson);\n }\n\n const toolVersionsPath = path.resolve(dirPath, '.tool-versions');\n let versionsText: string | undefined;\n try {\n versionsText = await fsp.readFile(toolVersionsPath, 'utf-8');\n } catch (_) {\n // do nothing\n }\n\n const config: PackageConfig = {\n dirPath,\n root: isRoot,\n publicRepo: repoInfo?.private === false,\n repository: repoInfo?.full_name ? `github:${repoInfo?.full_name}` : undefined,\n willBoosterConfigs: packageJsonPath.includes(`${path.sep}willbooster-configs`),\n containingSubPackageJsons: glob.sync('packages/**/package.json', { cwd: dirPath }).length > 0,\n containingDockerfile:\n fs.existsSync(path.resolve(dirPath, 'Dockerfile')) ||\n fs.existsSync(path.resolve(dirPath, 'docker-compose.yml')),\n containingGemfile: fs.existsSync(path.resolve(dirPath, 'Gemfile')),\n containingGoMod: fs.existsSync(path.resolve(dirPath, 'go.mod')),\n containingPackageJson: fs.existsSync(path.resolve(dirPath, 'package.json')),\n containingPoetryLock: fs.existsSync(path.resolve(dirPath, 'poetry.lock')),\n containingPomXml: fs.existsSync(path.resolve(dirPath, 'pom.xml')),\n containingPubspecYaml: fs.existsSync(path.resolve(dirPath, 'pubspec.yaml')),\n containingTemplateYaml: fs.existsSync(path.resolve(dirPath, 'template.yaml')),\n containingJavaScript: glob.sync('@(app|src|__tests__)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScript: glob.sync('@(app|src|__tests__)/**/*.ts?(x)', { cwd: dirPath }).length > 0,\n containingJsxOrTsx: glob.sync('@(app|src|__tests__)/**/*.{t,j}sx', { cwd: dirPath }).length > 0,\n containingJavaScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.ts?(x)', { cwd: dirPath }).length > 0,\n containingJsxOrTsxInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.{t,j}sx', { cwd: dirPath }).length > 0,\n depending: {\n blitz: !!(dependencies['blitz'] || devDependencies['blitz']),\n firebase: !!devDependencies['firebase-tools'],\n jestPlaywrightPreset: !!devDependencies['jest-playwright-preset'],\n prisma: !!devDependencies['prisma'],\n reactNative: !!dependencies['react-native'],\n semanticRelease: !!devDependencies['semantic-release'],\n storybook: !!devDependencies['@storybook/react'],\n },\n release: {\n branches: releaseBranches,\n github: releasePlugins.includes('@semantic-release/github'),\n npm: releasePlugins.includes('@semantic-release/npm'),\n },\n requiringNodeModules,\n versionsText,\n };\n config.eslintBase = getEslintExtensionBase(config);\n if (\n config.containingGemfile ||\n config.containingGoMod ||\n config.containingPackageJson ||\n config.containingPoetryLock ||\n config.containingPomXml ||\n config.containingPubspecYaml ||\n config.containingTemplateYaml\n ) {\n return config;\n }\n } catch (e) {\n // do nothing\n }\n return null;\n}\n\nfunction getEslintExtensionBase(config: PackageConfig): string | undefined {\n if (config.containingTypeScript) {\n if (config.containingJsxOrTsx) {\n return '@willbooster/eslint-config-ts-react';\n } else {\n return '@willbooster/eslint-config-ts';\n }\n } else {\n if (config.containingJsxOrTsx) {\n return '@willbooster/eslint-config-js-react';\n } else if (config.containingJavaScript) {\n return '@willbooster/eslint-config-js';\n }\n }\n return undefined;\n}\n\nasync function getRepoInfo(dirPath: string, packageJson: any): Promise<Record<string, any> | undefined> {\n const git = simpleGit(dirPath);\n const remotes = await git.getRemotes(true);\n const origin = remotes.find((r) => r.name === 'origin');\n const remoteUrl = origin?.refs?.fetch ?? origin?.refs?.push;\n if (typeof remoteUrl === 'string') {\n const json = await fetchRepoInfo(remoteUrl);\n if (json) return json;\n }\n\n const url = packageJson.repository?.url ?? packageJson.repository;\n if (typeof url === 'string') {\n const json = await fetchRepoInfo(url);\n if (json && json.message !== 'Not Found') return json;\n }\n}\n\nasync function fetchRepoInfo(urlOrFullName: string): Promise<Record<string, any> | undefined> {\n const urlWithoutProtocol = urlOrFullName.split(':').at(-1);\n const names = urlWithoutProtocol?.split('/');\n const org = names?.at(-2);\n const name = names?.at(-1)?.replace(/.git$/, '');\n if (!org || !name) return;\n\n const token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n const opts = token\n ? {\n headers: {\n Authorization: `token ${token}`,\n },\n }\n : undefined;\n const res = await fetchOnNode(`https://api.github.com/repos/${org}/${name}`, opts);\n const json = (await res.json()) as any;\n return { full_name: `${org}/${name}`, ...(json ?? {}) };\n}\n"],
5
- "mappings": "0zBAAA,OAAiB,mBAEjB,GAAiB,mBACjB,GAAkB,oBCHlB,MAAe,iBACf,EAAiB,mBCDjB,OAA4B,gCAEf,EAAc,GAAI,gBDI/B,kBAA6C,EAAsC,CACjF,GAAI,CAAC,EAAO,aAAc,OAE1B,GAAM,GAAkB,CAAC,EACzB,OAAW,KAAe,GAAO,aAAa,KAAK,EAAE,MAAM;AAAA,CAAI,EAAG,CAChE,GAAM,GAAO,EAAY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AAU,CAAC,EAGlD,GAAO,sBACP,EAAO,gCACP,EAAO,sBACP,EAAO,iCAEF,GAAW,oBACd,EAAS,KAAK,GAAiB,EAAQ,CAAU,CAAC,EAEpD,EAAS,KAAK,GAAqB,CAAM,CAAC,EAE9C,CACA,KAAM,SAAQ,IAAI,CAAQ,EAC1B,KAAM,GAAY,WAAW,EAE7B,EAAU,OAAQ,CAAC,SAAS,EAAG,CAAW,EAG1C,EAAU,OAAQ,CAAC,SAAS,EAAG,CAAW,CAC5C,CACF,CAEA,GAAK,EAAE,KAAK",
4
+ "sourcesContent": ["import path from 'path';\n\nimport glob from 'glob';\nimport yargs from 'yargs';\n\nimport { generateVersionConfigs } from './generators/asdf';\nimport { generateEditorconfig } from './generators/editorconfig';\nimport { generateEslintignore } from './generators/eslintignore';\nimport { generateEslintrc } from './generators/eslintrc';\nimport { generateGitattributes } from './generators/gitattributes';\nimport { generateGitignore } from './generators/gitignore';\nimport { generateHuskyrc } from './generators/huskyrc';\nimport { generateIdeaSettings } from './generators/idea';\nimport { generateLintstagedrc } from './generators/lintstagedrc';\nimport { generatePackageJson } from './generators/packageJson';\nimport { generatePrettierignore } from './generators/prettierignore';\nimport { generateReleaserc } from './generators/releaserc';\nimport { generateRenovateJson } from './generators/renovaterc';\nimport { generateSemanticYml } from './generators/semanticRelease';\nimport { generateTsconfig } from './generators/tsconfig';\nimport { generateWorkflow } from './generators/workflow';\nimport { generateYarnrcYml } from './generators/yarnrc';\nimport { getPackageConfig, PackageConfig } from './utils/packageConfig';\nimport { promisePool } from './utils/promisePool';\nimport { spawnSync } from './utils/spawnUtil';\n\nasync function main(): Promise<void> {\n const argv = await yargs(process.argv.slice(2))\n .command('wbfy <paths...>', 'Generate/update project files for WillBooster')\n .demandCommand(1)\n .alias('d', 'skipDeps')\n .boolean('skipDeps')\n .default('skipDeps', false)\n .describe('skipDeps', 'Skip dependency installation')\n .alias('v', 'verbose')\n .boolean('verbose')\n .default('verbose', false).argv;\n\n for (const rootDirPath of argv._) {\n if (typeof rootDirPath === 'number') continue;\n\n const rootConfig = await getPackageConfig(rootDirPath);\n if (rootConfig === null) {\n console.error(`there is no valid package.json in ${rootDirPath}`);\n continue;\n }\n\n const subDirPaths = rootConfig.containingSubPackageJsons\n ? glob.sync('packages/*', { cwd: rootDirPath }).map((subDirPath) => path.resolve(rootDirPath, subDirPath))\n : [];\n const subPackageConfigs = (await Promise.all(subDirPaths.map((subDirPath) => getPackageConfig(subDirPath)))).filter(\n (config) => !!config\n ) as PackageConfig[];\n const allPackageConfigs = [rootConfig, ...subPackageConfigs];\n\n if (argv.verbose) {\n for (const config of allPackageConfigs) {\n console.log(config);\n }\n }\n\n // Install yarn berry at first\n await generateYarnrcYml(rootConfig);\n await Promise.all([\n generateEditorconfig(rootConfig),\n generateGitattributes(rootConfig),\n generateHuskyrc(rootConfig),\n generateIdeaSettings(rootConfig),\n generateLintstagedrc(rootConfig),\n generateRenovateJson(rootConfig),\n generateReleaserc(rootConfig),\n generateSemanticYml(rootConfig),\n generateVersionConfigs(rootConfig),\n generateWorkflow(rootConfig),\n ]);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allPackageConfigs) {\n const gitignorePromise = generateGitignore(config, rootConfig);\n if (!config.root && !config.containingPackageJson) {\n await gitignorePromise;\n continue;\n }\n await Promise.all([gitignorePromise, generatePackageJson(config, rootConfig, argv.skipDeps)]);\n\n promises.push(generatePrettierignore(config), generateLintstagedrc(config));\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n promises.push(generateTsconfig(config, rootConfig));\n }\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n if (!rootConfig.willBoosterConfigs) {\n promises.push(generateEslintrc(config, rootConfig));\n }\n promises.push(generateEslintignore(config));\n }\n }\n await Promise.all(promises);\n await promisePool.promiseAll();\n\n spawnSync('yarn', ['cleanup'], rootDirPath);\n // 'yarn install' should be after `yarn cleanup` because yarn berry generates yarn.lock\n // corresponding to the contents of dependant sub-package in monorepo\n spawnSync('yarn', ['install'], rootDirPath);\n }\n}\n\nmain().then();\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateVersionConfigs(config: PackageConfig): Promise<void> {\n if (!config.versionsText) return;\n\n const lines: string[] = [];\n for (const versionText of config.versionsText.trim().split('\\n')) {\n const line = versionText.trim();\n if (line && line.split(/\\s+/)[0] !== 'nodejs') {\n lines.push(line);\n continue;\n }\n\n const [, version] = line.split(/\\s+/);\n await promisePool.run(() => fs.promises.writeFile(path.resolve(config.dirPath, '.node-version'), version));\n }\n if (config.containingPoetryLock) {\n updateLine('poetry 1.1.13', 0, lines);\n updateLine('python 3.9.10', 0, lines);\n }\n if (config.depending.firebase) {\n updateLine('java adoptopenjdk-11.0.14+9', 0, lines);\n }\n if (config.containingPackageJson) {\n updateLine('yarn 1.22.17', lines.length, lines);\n }\n\n const toolVersionsPath = path.resolve(config.dirPath, '.tool-versions');\n if (lines.length) {\n await promisePool.run(() => fs.promises.writeFile(toolVersionsPath, lines.join('\\n') + '\\n'));\n } else {\n await promisePool.run(() => fs.promises.rm(toolVersionsPath, { force: true }));\n }\n}\n\nfunction updateLine(line: string, insertionIndex: number, lines: string[]): void {\n const [prefix] = line.split(' ');\n const index = lines.findIndex((l) => l.split(/\\s+/)[0] === prefix);\n if (index >= 0) {\n lines[index] = line;\n } else {\n lines.splice(insertionIndex, 0, line);\n }\n}\n", "import { PromisePool } from 'minimal-promise-pool';\n\nexport const promisePool = new PromisePool();\n", "import path from 'path';\n\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n${generateExtensions(Extensions.codeWith2IndentSize)}\nindent_size = 2\nindent_style = space\n\n${generateExtensions(Extensions.codeWith4IndentSize)}\nindent_size = 4\nindent_style = space\n\n${generateExtensions(Extensions.codeWith8IndentSize)}\nindent_size = 8\nindent_style = space\n\n${generateExtensions(Extensions.markdownLike)}\nmax_line_length = off\ntrim_trailing_whitespace = false\n\n[{Makefile,*.mk}]\nindent_style = tab\n`;\n\nexport async function generateEditorconfig(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.editorconfig');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n\nfunction generateExtensions(extensions: string[]): string {\n return extensions.length > 1 ? `[*.{${extensions.join(',')}}]` : `[*.${extensions[0]}]`;\n}\n", "export const Extensions = {\n codeWith2IndentSize: [\n 'cjs',\n 'mjs',\n 'js',\n 'jsx',\n 'ts',\n 'tsx',\n 'json',\n 'json5',\n 'cpp',\n 'dart',\n 'htm',\n 'html',\n 'pu',\n 'puml',\n 'rb',\n 'vue',\n 'yaml',\n 'yml',\n ].sort(),\n codeWith4IndentSize: ['go', 'gradle', 'py'].sort(),\n codeWith8IndentSize: ['sh'].sort(),\n markdownLike: ['md'].sort(),\n eslint: ['cjs', 'mjs', 'js', 'ts', 'tsx', 'jsx'].sort(),\n prettier: [\n 'cjs',\n 'mjs',\n 'js',\n 'jsx',\n 'ts',\n 'tsx',\n 'json',\n 'json5',\n 'css',\n 'htm',\n 'html',\n 'md',\n 'scss',\n 'vue',\n 'yaml',\n 'yml',\n ].sort(),\n};\n", "import fsp from 'fs/promises';\n\nexport const FsUtil = {\n async generateFile(filePath: string, content: string): Promise<void> {\n await fsp.writeFile(filePath, content);\n console.log(`Generated ${filePath}`);\n },\n};\n", "import path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n3rd-party/\n@types/\n__generated__/\nandroid/\nios/\nno-format/\ntest-fixtures/\n*.config.js\n*.d.ts\n*.min.js\n.yarn/\n.pnp.js\n`;\n\nexport async function generateEslintignore(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.eslintignore');\n const userContent = IgnoreFileUtil.getUserContent(filePath) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = IgnoreFileUtil.getExistingContent(gitignoreFilePath) || '';\n\n const newContent = userContent + commonContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\n\nexport const IgnoreFileUtil = {\n header: '# Project-specific settings',\n separator: '# Generated by @willbooster/willboosterify',\n separatorPrefix: '# Generated by @willbooster',\n getExistingContent(filePath: string): string | null {\n if (fs.existsSync(filePath)) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(/# Project-specific settings[^\\n]*\\n/m, '')\n .replace(/# Generated by[^\\n]*\\n/m, '')\n .replace(/\\r?\\n\\r?\\n(\\r?\\n)+/gm, '\\n\\n');\n }\n return null;\n },\n getUserContent(filePath: string): string | null {\n if (fs.existsSync(filePath)) {\n const existingContent = fs.readFileSync(filePath, 'utf-8');\n const index = existingContent.indexOf(this.separatorPrefix);\n if (index >= 0) {\n return existingContent.substr(0, existingContent.indexOf('\\n', index) + 1);\n }\n }\n return null;\n },\n isBerryZeroInstallEnabled(filePath: string): boolean {\n if (fs.existsSync(filePath)) {\n const existingContent = fs.readFileSync(filePath, 'utf-8');\n return existingContent.includes('\\n!.yarn/cache');\n }\n return false;\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateEslintrc(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n const bases = [];\n if (config.eslintBase) {\n bases.push(config.eslintBase);\n }\n if (config !== rootConfig) {\n bases.push('../../.eslintrc.json');\n }\n let newSettings: any = { root: true, extends: bases };\n\n const filePath = path.resolve(config.dirPath, '.eslintrc.json');\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(oldContent);\n if (oldSettings.extends) {\n oldSettings.extends = oldSettings.extends.filter(\n (ext: string) => !ext.startsWith('@willbooster/') && ext !== '../../.eslintrc.json'\n );\n }\n if (!bases.length) {\n oldSettings.extends = [];\n }\n const newExtends = newSettings.extends;\n newSettings.extends = oldSettings.extends;\n oldSettings.extends = newExtends;\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: combineMerge });\n if (config.depending.blitz) {\n newSettings.extends = [...newSettings.extends.filter((e: string) => e !== 'blitz'), 'blitz'];\n }\n } catch (e) {\n // do nothing\n }\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import merge from 'deepmerge';\n\nexport function overwriteMerge(destinationArray: any[], sourceArray: any[]): any[] {\n return sourceArray;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function combineMerge(target: any[], source: any[], options: any): any[] {\n const destination = target.slice();\n\n source.forEach((item, index) => {\n if (typeof destination[index] === 'undefined') {\n destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);\n } else if (options.isMergeableObject(item)) {\n destination[index] = merge(target[index], item, options);\n } else if (target.indexOf(item) === -1) {\n destination.push(item);\n }\n });\n return destination;\n}\n", "import path from 'path';\n\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `* text=auto\n\n*.vcproj text eol=crlf\n\n${Extensions.codeWith2IndentSize\n .concat(Extensions.codeWith4IndentSize)\n .concat(Extensions.markdownLike)\n .map((ext) => `*.${ext} text eol=lf`)\n .join('\\n')}\n`;\n\nexport async function generateGitattributes(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.gitattributes');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import path from 'path';\n\nimport { fetchOnNode } from '../utils/fetchOnNode';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\n\nconst defaultNames = ['windows', 'macos', 'linux', 'jetbrains', 'visualstudiocode', 'emacs', 'vim', 'yarn'];\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n.devcontainer/\ndist/\ntemp/\nIcon[\\r]\n*.sqlite3\n*.sqlite3-journal\n`;\n\nconst gitignoreCache = new Map<string, string>();\n\nexport async function generateGitignore(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.gitignore');\n let userContent = (IgnoreFileUtil.getUserContent(filePath) || defaultUserContent) + commonContent;\n\n const names = [...defaultNames];\n if (config.containingGemfile) {\n names.push('ruby');\n }\n if (config.containingGoMod) {\n names.push('go');\n userContent += `${path.basename(config.dirPath)}\n`;\n }\n if (config.containingPackageJson) {\n names.push('node');\n }\n if (config.containingPomXml) {\n names.push('maven');\n userContent += `.idea/google-java-format.xml\n`;\n }\n if (config.containingPubspecYaml) {\n names.push('flutter', 'AndroidStudio', 'ruby');\n userContent += `.flutter-plugins-dependencies\nandroid/key.properties\nios/.bundle\n.idea/runConfigurations.xml\n`;\n }\n if (config.containingTemplateYaml) {\n userContent += `.aws-sam/\npackaged.yaml\n`;\n }\n // Because .venv should be ignored on root directory\n if (config.containingPoetryLock) {\n names.push('python');\n }\n if (rootConfig.depending.firebase || config.depending.firebase) {\n names.push('firebase');\n }\n if (rootConfig.depending.reactNative || config.depending.reactNative) {\n names.push('reactnative');\n userContent += `google-services.json\nandroid/app/src/main/assets/\n`;\n }\n if (rootConfig.depending.storybook) {\n names.push('storybookjs');\n }\n if (rootConfig.depending.blitz) {\n names.push('nextjs');\n userContent += `.blitz/\n.blitz**\n`;\n }\n\n let generated = '';\n for (const name of names) {\n if (!gitignoreCache.has(name)) {\n const url = `https://www.toptal.com/developers/gitignore/api/${name}`;\n const response = await fetchOnNode(url);\n const responseText = await response.text();\n if (responseText.includes('Attention Required!')) {\n console.error(`Failed to fetch ${url}`);\n return;\n }\n gitignoreCache.set(name, responseText);\n }\n generated += gitignoreCache.get(name);\n }\n if (!IgnoreFileUtil.isBerryZeroInstallEnabled(filePath)) {\n generated = generated.replace('!.yarn/cache', '# !.yarn/cache').replace('# .pnp.*', '.pnp.*');\n }\n if (config.containingPomXml || config.containingPubspecYaml) {\n generated = generated\n .replace(/^# .idea\\/artifacts$/gm, '.idea/artifacts')\n .replace(/^# .idea\\/compiler.xml$/gm, '.idea/compiler.xml')\n .replace(/^# .idea\\/jarRepositories.xml$/gm, '.idea/jarRepositories.xml')\n .replace(/^# .idea\\/modules.xml$/gm, '.idea/modules.xml')\n .replace(/^# .idea\\/*.iml$/gm, '.idea/*.iml')\n .replace(/^# .idea\\/modules$/gm, '.idea/modules')\n .replace(/^# *.iml$/gm, '*.iml')\n .replace(/^# *.ipr$/gm, '*.ipr');\n if (config.containingPubspecYaml) {\n generated = generated.replace(/^.idea\\/modules.xml$/gm, '# .idea/modules.xml');\n }\n }\n generated = generated.replace(/^.idea\\/?$/gm, '# .idea');\n if (rootConfig.depending.reactNative || config.depending.reactNative || config.containingPubspecYaml) {\n generated = generated.replace(/^(.idea\\/.+)$/gm, '$1\\nandroid/$1');\n }\n const newContent = userContent + generated;\n await FsUtil.generateFile(filePath, newContent);\n}\n", "import type { RequestInfo, RequestInit, Response } from 'node-fetch';\n\nexport async function fetchOnNode(url: RequestInfo, init?: RequestInit | undefined): Promise<Response> {\n const { default: nodeFetch } = await import('node-fetch');\n return nodeFetch(url, init);\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\n\nconst DEFAULT_COMMAND = 'npm test';\n\nconst settings = {\n preCommit: 'yarn lint-staged',\n prePush: `yarn typecheck`,\n prePushForLab: `\nif [ $(git branch --show-current) = \"main\" ]; then\n echo \"************************************************\"\n echo \"*** Don't push main branch directly. Use PR! ***\"\n echo \"************************************************\"\n exit 1\nfi\n\nyarn typecheck`.trim(),\n postMerge: 'yarn',\n};\n\nexport async function generateHuskyrc(config: PackageConfig): Promise<void> {\n const packageJsonPath = path.resolve(config.dirPath, 'package.json');\n const jsonText = await fs.promises.readFile(packageJsonPath, 'utf-8');\n const packageJson = JSON.parse(jsonText);\n packageJson.scripts ||= {};\n delete packageJson.scripts['postinstall'];\n delete packageJson.scripts['postpublish'];\n delete packageJson.scripts['prepare'];\n delete packageJson.scripts['prepublishOnly'];\n delete packageJson.scripts['prepack'];\n delete packageJson.scripts['postpack'];\n\n const dirPath = path.resolve(config.dirPath, '.husky');\n await Promise.all([\n fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson, undefined, 2)),\n fs.promises.rm(dirPath, { force: true, recursive: true }),\n ]);\n spawnSync('yarn', ['dlx', 'husky-init', '--yarn2'], config.dirPath);\n\n const preCommitFilePath = path.resolve(dirPath, 'pre-commit');\n const content = await fs.promises.readFile(preCommitFilePath, 'utf-8');\n\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.huskyrc.json'), { force: true }));\n await promisePool.run(() =>\n fs.promises.writeFile(preCommitFilePath, content.replace(DEFAULT_COMMAND, settings.preCommit))\n );\n\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n const prePush = config.repository?.startsWith('github:WillBoosterLab/') ? settings.prePushForLab : settings.prePush;\n await promisePool.run(() =>\n fs.promises.writeFile(path.resolve(dirPath, 'pre-push'), content.replace(DEFAULT_COMMAND, prePush), {\n mode: 0o755,\n })\n );\n }\n\n const postMergeCommands: string[] = [];\n if (config.versionsText?.includes('python ')) {\n postMergeCommands.push('asdf install python');\n }\n if (config.versionsText) {\n postMergeCommands.push('asdf install');\n }\n postMergeCommands.push(settings.postMerge);\n if (config.versionsText?.includes('poetry ')) {\n postMergeCommands.push('poetry install');\n }\n if (config.depending.blitz) {\n postMergeCommands.push('yarn blitz codegen');\n } else if (config.depending.prisma) {\n postMergeCommands.push('yarn prisma generate');\n }\n const postMergeCommand = content.replace(DEFAULT_COMMAND, postMergeCommands.join(' && '));\n await promisePool.run(() =>\n fs.promises.writeFile(path.resolve(dirPath, 'post-merge'), postMergeCommand, {\n mode: 0o755,\n })\n );\n}\n", "import child_process from 'child_process';\n\nexport function spawnSync(command: string, args: string[], cwd: string, retry = 0): void {\n do {\n const [commandAndArgs, options] = getSpawnSyncArgs(command, args, cwd);\n console.log(`$ ${commandAndArgs} at ${options.cwd}`);\n const ret = child_process.spawnSync(commandAndArgs, options);\n if (ret.status === 0) break;\n } while (--retry >= 0);\n}\n\nexport function spawnSyncWithStringResult(command: string, args: string[], cwd: string): string {\n const [commandAndArgs, options] = getSpawnSyncArgs(command, args, cwd);\n options.stdio = 'pipe';\n const proc = child_process.spawnSync(commandAndArgs, options);\n return proc.stdout.toString().trim();\n}\n\nexport function getSpawnSyncArgs(command: string, args: string[], cwd: string): [string, any] {\n const env = { ...process.env };\n // Remove berry from PATH\n if (env.PATH && env.BERRY_BIN_FOLDER) {\n env.PATH = env.PATH.replace(`${env.BERRY_BIN_FOLDER}:`, '');\n }\n\n let commandAndArgs = `${command} ${args.join(' ')}`;\n if (env.ASDF_DIR) {\n commandAndArgs = `bash -l -c '. ${env.ASDF_DIR}/asdf.sh && ${commandAndArgs}'`;\n }\n return [\n commandAndArgs,\n {\n cwd,\n env,\n shell: true,\n stdio: 'inherit',\n },\n ];\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newContent = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectTasksOptions\">\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"ts\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.ts)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"tsx\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.tsx)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"js\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.js)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"json\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.json)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"md\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.md)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n <TaskOptions isEnabled=\"true\">\n <option name=\"arguments\" value=\"prettier --write $FilePathRelativeToProjectRoot$\" />\n <option name=\"checkSyntaxErrors\" value=\"false\" />\n <option name=\"description\" />\n <option name=\"exitCodeBehavior\" value=\"ERROR\" />\n <option name=\"fileExtension\" value=\"html\" />\n <option name=\"immediateSync\" value=\"false\" />\n <option name=\"name\" value=\"Prettier (.html)\" />\n <option name=\"output\" value=\"$FilePathRelativeToProjectRoot$\" />\n <option name=\"outputFilters\">\n <array />\n </option>\n <option name=\"outputFromStdout\" value=\"false\" />\n <option name=\"program\" value=\"yarn\" />\n <option name=\"runOnExternalChanges\" value=\"false\" />\n <option name=\"scopeName\" value=\"Project Files\" />\n <option name=\"trackOnlyRoot\" value=\"false\" />\n <option name=\"workingDir\" value=\"$ProjectFileDir$\" />\n <envs />\n </TaskOptions>\n </component>\n</project>\n`;\n\nexport async function generateIdeaSettings(config: PackageConfig): Promise<void> {\n const dirPath = path.resolve(config.dirPath, '.idea');\n if (fs.existsSync(dirPath)) {\n const filePath = path.resolve(dirPath, 'watcherTasks.xml');\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages ||\n (config.containingPackageJson &&\n !config.containingPubspecYaml &&\n !config.containingGemfile &&\n !config.containingGoMod &&\n !config.containingPomXml)\n ) {\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } else {\n await promisePool.run(() => fs.promises.rm(filePath, { force: true }));\n }\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { Extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst eslintKey = `./{src,__tests__}/**/*.{${Extensions.eslint.join(',')}}`;\nconst eslintFilterForPrettier = `files = micromatch.not(files, '${eslintKey}');`;\n\nexport async function generateLintstagedrc(config: PackageConfig): Promise<void> {\n const lines: string[] = [];\n if (config.containingJavaScript || config.containingTypeScript) {\n const eslint = `\n '${eslintKey}': [${JSON.stringify(`eslint --fix${EslintUtil.getLintFixSuffix(config)}`)}, 'prettier --write'],`;\n lines.push(eslint);\n }\n const packagesFilter = config.root ? \" && !file.includes('/packages/')\" : '';\n lines.push(`\n './**/*.{${Extensions.prettier.join(',')}}': files => {\n ${config.containingJavaScript || config.containingTypeScript ? eslintFilterForPrettier : ''}\n const filteredFiles = files.filter(file => !file.includes('/test-fixtures/')${packagesFilter});\n if (filteredFiles.length === 0) return [];\n const commands = [\\`prettier --write \\${filteredFiles.join(' ')}\\`];\n if (filteredFiles.some(file => file.endsWith('package.json'))) {\n commands.push('yarn sort-package-json');\n }\n return commands;\n },`);\n if (config.containingPubspecYaml) {\n lines.push(`\n './{lib,test,test_driver}/**/*.dart': files => {\n const filteredFiles = files.filter(file => !file.includes('generated'))\n .filter(file => !file.endsWith('.freezed.dart') && !file.endsWith('.g.dart'));\n if (filteredFiles.length === 0) return [];\n return [\\`flutter format \\${filteredFiles.join(' ')}\\`];\n },`);\n }\n if (config.containingPoetryLock) {\n lines.push(`\n './**/*.py': [\n 'poetry run isort --profile black --filter-files',\n 'poetry run black',\n 'poetry run flake8'\n ],`);\n }\n\n const newContent = `${\n config.containingJavaScript || config.containingTypeScript ? \"const micromatch = require('micromatch');\" : ''\n }\n\nmodule.exports = {${lines.join('')}\n};\n`;\n\n const filePath = path.resolve(config.dirPath, '.lintstagedrc.cjs');\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.lintstagedrc.js'), { force: true }));\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.lintstagedrc.json'), { force: true }));\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import { PackageConfig } from './packageConfig';\n\nexport const EslintUtil = {\n getLintFixSuffix(config: PackageConfig): string {\n return config.containingJsxOrTsx ? ' --rule \"{ react-hooks/exhaustive-deps: 0 }\"' : '';\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { Extensions } from '../utils/extensions';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\n\nconst scriptsWithoutWorkspace = {\n cleanup: 'yarn format && yarn lint-fix',\n format: `sort-package-json && yarn prettify`,\n lint: `eslint --color \"./{src,__tests__}/**/*.{${Extensions.eslint.join(',')}}\"`,\n 'lint-fix': 'yarn lint --fix',\n prettify: `prettier --color --write \"**/{.*/,}*.{${Extensions.prettier.join(',')}}\" \"!**/test-fixtures/**\"`,\n typecheck: 'tsc --noEmit --Pretty',\n};\n\nconst scriptsWithWorkspace = merge(\n { ...scriptsWithoutWorkspace },\n {\n format: `sort-package-json && yarn prettify && yarn workspaces foreach --parallel --verbose run format`,\n lint: `yarn workspaces foreach --parallel --verbose run lint`,\n 'lint-fix': 'yarn workspaces foreach --parallel --verbose run lint-fix',\n prettify: `prettier --color --write \"**/{.*/,}*.{${Extensions.prettier.join(\n ','\n )}}\" \"!**/packages/**\" \"!**/test-fixtures/**\"`,\n test: 'yarn workspaces foreach --verbose run test',\n typecheck: 'yarn workspaces foreach --parallel --verbose run typecheck',\n }\n);\n\nconst scriptsForBlitz = merge(\n { ...scriptsWithoutWorkspace },\n {\n lint: `eslint --color \"./**/*.{${Extensions.eslint.join(',')}}\"`,\n typecheck: `tsc --noEmit --Pretty || echo 'Please try \"yarn blitz codegen\" if you face unknown type errors.'`,\n }\n);\n\nconst jsCommonDeps = [\n 'eslint',\n 'eslint-config-prettier',\n 'eslint-plugin-import',\n 'eslint-plugin-sort-class-members',\n 'eslint-plugin-sort-destructure-keys',\n];\n\nconst tsCommonDeps = [\n ...jsCommonDeps,\n '@typescript-eslint/eslint-plugin',\n '@typescript-eslint/parser',\n 'eslint-import-resolver-typescript',\n];\n\nconst reactCommonDeps = ['eslint-plugin-react', 'eslint-plugin-react-hooks'];\n\nconst devDeps: { [prop: string]: string[] } = {\n '@willbooster/eslint-config-js': ['@willbooster/eslint-config-js', ...jsCommonDeps],\n '@willbooster/eslint-config-js-react': ['@willbooster/eslint-config-js-react', ...jsCommonDeps, ...reactCommonDeps],\n '@willbooster/eslint-config-ts': ['@willbooster/eslint-config-ts', ...tsCommonDeps],\n '@willbooster/eslint-config-ts-react': ['@willbooster/eslint-config-ts-react', ...tsCommonDeps, ...reactCommonDeps],\n '../../.eslintrc.json': [],\n};\n\nexport async function generatePackageJson(\n config: PackageConfig,\n rootConfig: PackageConfig,\n skipAddingDeps: boolean\n): Promise<void> {\n const filePath = path.resolve(config.dirPath, 'package.json');\n const jsonText = await fs.promises.readFile(filePath, 'utf-8');\n const jsonObj = JSON.parse(jsonText);\n jsonObj.scripts = jsonObj.scripts || {};\n jsonObj.dependencies = jsonObj.dependencies || {};\n jsonObj.devDependencies = jsonObj.devDependencies || {};\n jsonObj.peerDependencies = jsonObj.peerDependencies || {};\n\n await removeDeprecatedStuff(jsonObj);\n\n if (jsonObj.name !== '@willbooster/prettier-config') {\n jsonObj.prettier = '@willbooster/prettier-config';\n }\n\n for (const scriptKey of Object.keys(jsonObj.scripts)) {\n // Fresh repo still requires 'yarn install'\n if (!jsonObj.scripts[scriptKey].includes('git clone')) {\n jsonObj.scripts[scriptKey] = jsonObj.scripts[scriptKey]\n .replace(/yarn\\s*&&\\s*/, '')\n .replace(/yarn\\s*install\\s*&&\\s*/, '');\n }\n }\n\n jsonObj.scripts = merge(\n jsonObj.scripts,\n config.containingSubPackageJsons\n ? scriptsWithWorkspace\n : config.depending.blitz\n ? scriptsForBlitz\n : scriptsWithoutWorkspace\n );\n jsonObj.scripts.prettify += await generatePrettierSuffix(config.dirPath);\n\n let dependencies: string[] = [];\n let devDependencies = ['lint-staged', 'prettier', 'sort-package-json', '@willbooster/prettier-config'];\n const poetryDependencies: string[] = [];\n\n if (config.root) {\n // To install the latest pinst\n devDependencies.push('husky', 'pinst', '@willbooster/renovate-config');\n if (config.depending.semanticRelease) {\n devDependencies.push('conventional-changelog-conventionalcommits');\n }\n if (config.containingSubPackageJsons) {\n jsonObj.workspaces = ['packages/*'];\n } else {\n delete jsonObj.workspaces;\n }\n }\n\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n devDependencies.push('eslint', 'micromatch');\n // TODO: not needed anymore?\n if (config.containingTypeScriptInPackages) {\n devDependencies.push('@typescript-eslint/parser');\n }\n }\n\n if ((config.containingTypeScript || config.containingTypeScriptInPackages) && !config.depending.blitz) {\n devDependencies.push('typescript');\n }\n\n if (config.eslintBase) {\n devDependencies.push(...devDeps[config.eslintBase]);\n }\n\n if (config.willBoosterConfigs) {\n dependencies = dependencies.filter((dep) => !dep.includes('@willbooster/'));\n devDependencies = devDependencies.filter((dep) => !dep.includes('@willbooster/'));\n }\n\n if (!jsonObj.name) {\n jsonObj.name = path.basename(config.dirPath);\n }\n\n if (config.containingSubPackageJsons) {\n jsonObj.private = true;\n }\n\n if (!jsonObj.license) {\n jsonObj.license = 'UNLICENSED';\n }\n\n if (!config.containingTypeScript && !config.containingTypeScriptInPackages) {\n delete jsonObj.scripts.typecheck;\n }\n\n // https://github.com/semantic-release/semantic-release/issues/2323#issuecomment-1032341621\n if (config.depending.semanticRelease && config.release.npm) {\n jsonObj.resolutions ||= {};\n jsonObj.resolutions['npm/chalk'] = '^4.1.2';\n }\n\n if (!config.containingSubPackageJsons) {\n if (!config.containingJavaScript && !config.containingTypeScript) {\n delete jsonObj.scripts.lint;\n delete jsonObj.scripts['lint-fix'];\n jsonObj.scripts.cleanup = jsonObj.scripts.cleanup.replace(' && yarn lint-fix', '');\n } else {\n jsonObj.scripts['lint-fix'] += EslintUtil.getLintFixSuffix(config);\n }\n\n if (config.containingPubspecYaml) {\n jsonObj.scripts.lint = 'flutter analyze';\n jsonObj.scripts['lint-fix'] = 'yarn lint';\n const dirs = ['lib', 'test', 'test_driver'].filter((dir) => fs.existsSync(path.resolve(config.dirPath, dir)));\n if (dirs.length > 0) {\n jsonObj.scripts['format-code'] = `flutter format $(find ${dirs.join(\n ' '\n )} -name generated -prune -o -name '*.freezed.dart' -prune -o -name '*.g.dart' -prune -o -name '*.dart' -print)`;\n jsonObj.scripts.format += ` && yarn format-code`;\n }\n }\n\n if (config.containingPoetryLock) {\n if (jsonObj.scripts.postinstall === 'poetry install') {\n delete jsonObj.scripts.postinstall;\n }\n const dirNames = (await fs.promises.readdir(config.dirPath)).filter((dirName) => {\n const dirPath = path.resolve(config.dirPath, dirName);\n if (!fs.lstatSync(dirPath).isDirectory()) return false;\n return fs.readdirSync(dirPath).some((fileName) => fileName.endsWith('.py'));\n });\n if (dirNames.length > 0) {\n jsonObj.scripts['format-code'] = `poetry run isort --profile black ${dirNames.join(\n ' '\n )} && poetry run black ${dirNames.join(' ')}`;\n jsonObj.scripts.lint = `poetry run flake8 ${dirNames.join(' ')}`;\n jsonObj.scripts['lint-fix'] = 'yarn lint';\n jsonObj.scripts.format += ` && yarn format-code`;\n poetryDependencies.push('black', 'isort', 'flake8');\n }\n }\n\n if (config.repository) {\n jsonObj.repository = config.repository;\n }\n }\n\n if (config.depending.blitz) {\n // These cause an error of eslint-plugin-import loading\n devDependencies = devDependencies.filter((dep) => !dep.includes('@typescript-eslint/'));\n // This causes eslint errors\n devDependencies = devDependencies.filter(\n (d) =>\n d !== 'eslint-plugin-react' &&\n d !== 'eslint-import-resolver-typescript' &&\n d !== 'eslint-plugin-import' &&\n d !== 'eslint-plugin-react-hooks'\n );\n }\n if (!Object.keys(jsonObj.dependencies).length) {\n delete jsonObj.dependencies;\n }\n if (!Object.keys(jsonObj.devDependencies).length) {\n delete jsonObj.devDependencies;\n }\n if (!Object.keys(jsonObj.peerDependencies).length) {\n delete jsonObj.peerDependencies;\n }\n\n await fs.promises.writeFile(filePath, JSON.stringify(jsonObj));\n\n if (!skipAddingDeps) {\n dependencies = dependencies.filter((dep) => !jsonObj.devDependencies?.[dep]);\n if (dependencies.length) {\n spawnSync('yarn', ['add', ...new Set(dependencies)], config.dirPath);\n }\n devDependencies = devDependencies.filter((dep) => !jsonObj.dependencies?.[dep]);\n if (devDependencies.length) {\n spawnSync('yarn', ['add', '-D', ...new Set(devDependencies)], config.dirPath);\n }\n if (poetryDependencies.length) {\n spawnSync('poetry', ['add', ...new Set(poetryDependencies)], config.dirPath);\n }\n }\n}\n\nasync function removeDeprecatedStuff(jsonObj: any): Promise<void> {\n // TODO: remove the following migration code in future\n if (jsonObj.author === 'WillBooster LLC') {\n jsonObj.author = 'WillBooster Inc.';\n }\n delete jsonObj.scripts['sort-package-json'];\n delete jsonObj.scripts['sort-all-package-json'];\n delete jsonObj.dependencies['tslib'];\n delete jsonObj.devDependencies['@willbooster/eslint-config'];\n delete jsonObj.devDependencies['@willbooster/eslint-config-react'];\n delete jsonObj.devDependencies['@willbooster/tsconfig'];\n delete jsonObj.devDependencies['eslint-import-resolver-node'];\n delete jsonObj.devDependencies['eslint-plugin-prettier'];\n delete jsonObj.devDependencies['lerna'];\n // To install the latest pinst\n delete jsonObj.devDependencies['pinst'];\n delete jsonObj.scripts['flutter-format'];\n delete jsonObj.scripts['format-flutter'];\n delete jsonObj.scripts['python-format'];\n delete jsonObj.scripts['format-python'];\n delete jsonObj.scripts['prettier'];\n for (const deps of Object.values(devDeps)) {\n for (const dep of deps) {\n delete jsonObj.devDependencies[dep];\n }\n }\n await promisePool.run(() => fs.promises.rm('lerna.json', { force: true }));\n}\n\nasync function generatePrettierSuffix(dirPath: string): Promise<string> {\n const filePath = path.resolve(dirPath, '.prettierignore');\n const existingContent = await fs.promises.readFile(filePath, 'utf-8');\n const index = existingContent.indexOf(IgnoreFileUtil.separatorPrefix);\n if (index < 0) return '';\n\n const originalContent = existingContent.substring(0, index);\n const lines = originalContent\n .split('\\n')\n .map((line) => {\n const newLine = line.trim();\n return newLine.endsWith('/') ? newLine.slice(0, -1) : newLine;\n })\n .filter((l) => l && !l.startsWith('#') && !l.includes('/'));\n\n return lines.map((line) => ` \"!**/${line}/**\"`).join('');\n}\n", "import path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst defaultUserContent = `${IgnoreFileUtil.header}\n\n\n${IgnoreFileUtil.separator}\n`;\n\nconst commonContent = `\n3rd-party/\nandroid/\nios/\nno-format/\ntest-fixtures/\n*.d.ts\n*.min.js\n.yarn/\n.pnp.js\n`;\n\nexport async function generatePrettierignore(config: PackageConfig): Promise<void> {\n const filePath = path.resolve(config.dirPath, '.prettierignore');\n const userContent = IgnoreFileUtil.getUserContent(filePath) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = IgnoreFileUtil.getExistingContent(gitignoreFilePath) || '';\n\n let additionalContent = '';\n if (config.containingPubspecYaml) {\n additionalContent = `\nandroid/app/\nios/Runner/Assets.xcassets/\npubspec.yaml\n`;\n }\n\n const newContent = userContent + commonContent + additionalContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateReleaserc(rootConfig: PackageConfig): Promise<void> {\n const filePath = path.resolve(rootConfig.dirPath, '.releaserc.json');\n try {\n const settings = JSON.parse(await fs.promises.readFile(filePath, 'utf8'));\n const plugins = settings?.plugins || [];\n for (let i = 0; i < plugins.length; i++) {\n if (plugins[i] === '@semantic-release/commit-analyzer' || plugins[i][0] === '@semantic-release/commit-analyzer') {\n plugins[i] = [\n '@semantic-release/commit-analyzer',\n {\n preset: 'conventionalcommits',\n },\n ];\n }\n }\n const newContent = JSON.stringify(settings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } catch (_) {\n // do nothing\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst jsonObj = {\n extends: ['@willbooster'],\n};\n\nexport async function generateRenovateJson(config: PackageConfig): Promise<void> {\n let newSettings: any = cloneDeep(jsonObj);\n\n const filePath = path.resolve(config.dirPath, '.renovaterc.json');\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(oldContent) as any;\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: overwriteMerge });\n } catch (e) {\n // do nothing\n }\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, '.dependabot'), { force: true }));\n await promisePool.run(() => fs.promises.rm(path.resolve(config.dirPath, 'renovate.json'), { force: true }));\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst newSettings = {\n titleOnly: true,\n};\n\nexport async function generateSemanticYml(rootConfig: PackageConfig): Promise<void> {\n const githubPath = path.resolve(rootConfig.dirPath, '.github');\n await fs.promises.mkdir(githubPath, { recursive: true });\n const filePath = path.join(githubPath, 'semantic.yml');\n const newContent = yaml.dump(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst rootJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react',\n alwaysStrict: true,\n strict: true,\n skipLibCheck: true,\n allowSyntheticDefaultImports: true,\n esModuleInterop: true,\n resolveJsonModule: true,\n sourceMap: true,\n importHelpers: false,\n outDir: 'dist',\n },\n include: [\n 'src/**/*',\n '__tests__/**/*',\n 'packages/*/src/**/*',\n 'packages/*/__tests__/**/*',\n './node_modules/@types',\n './@types',\n ],\n};\n\nconst subJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react',\n alwaysStrict: true,\n strict: true,\n skipLibCheck: true,\n allowSyntheticDefaultImports: true,\n esModuleInterop: true,\n resolveJsonModule: true,\n sourceMap: true,\n importHelpers: false,\n outDir: 'dist',\n },\n include: ['src/**/*', '__tests__/**/*', '../../node_modules/@types', '../../@types', './@types'],\n};\n\nexport async function generateTsconfig(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n if (rootConfig.depending.blitz) return;\n\n let newSettings: any = cloneDeep(config.root ? rootJsonObj : subJsonObj);\n if (!config.containingJsxOrTsx && !config.containingJsxOrTsxInPackages) {\n delete newSettings.compilerOptions.jsx;\n }\n if (config.root && !config.containingSubPackageJsons) {\n newSettings.include = newSettings.include.filter((dirPath: string) => !dirPath.startsWith('packages/*/'));\n }\n if (!config.root && (config.depending.jestPlaywrightPreset || rootConfig.depending.jestPlaywrightPreset)) {\n const relativeDirPath = path.relative(config.dirPath, rootConfig.dirPath);\n newSettings.include.push(\n ...[\n path.join(relativeDirPath, 'node_modules/jest-playwright-preset/types'),\n path.join(relativeDirPath, 'node_modules/expect-playwright'),\n ]\n );\n }\n\n const filePath = path.resolve(config.dirPath, 'tsconfig.json');\n try {\n const existingContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = JSON.parse(existingContent);\n if (oldSettings.extends === './node_modules/@willbooster/tsconfig/tsconfig.json') {\n delete oldSettings.extends;\n }\n delete oldSettings.compilerOptions?.typeRoots;\n delete newSettings?.compilerOptions?.target;\n delete newSettings?.compilerOptions?.module;\n if (oldSettings.jsx) {\n delete newSettings.jsx;\n }\n if (!config.depending.blitz) {\n delete newSettings.include;\n }\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: overwriteMerge });\n } catch (e) {\n // do nothing\n }\n sortKeys(newSettings.compilerOptions);\n const newContent = JSON.stringify(newSettings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n}\n", "export function sortKeys(obj: any): void {\n const keyAndValues = Object.entries(obj).sort(([key1], [key2]) => key1.localeCompare(key2));\n for (const [key, value] of keyAndValues) {\n delete obj[key];\n obj[key] = value;\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport yaml from 'js-yaml';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { combineMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\n\nconst testWorkflow = {\n name: 'Test',\n on: {\n pull_request: {\n branches: ['main', '!renovate/**'],\n },\n push: {\n branches: ['main', 'renovate/**'],\n },\n },\n jobs: {\n test: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/test.yml@main',\n },\n },\n};\n\nconst releaseWorkflow = {\n name: 'Release',\n on: {\n push: {\n branches: [],\n },\n },\n jobs: {\n release: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/release.yml@main',\n },\n },\n};\n\nconst wbfyWorkflow = {\n name: 'Willboosterify',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n wbfy: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main',\n },\n },\n};\n\nexport async function generateWorkflow(rootConfig: PackageConfig): Promise<void> {\n const workflowsPath = path.resolve(rootConfig.dirPath, '.github', 'workflows');\n await fs.promises.mkdir(workflowsPath, { recursive: true });\n\n const fileNames = (await fs.promises.readdir(workflowsPath, { withFileTypes: true }))\n .filter((dirent) => dirent.isFile() && dirent.name.endsWith('.yml'))\n .map((dirent) => dirent.name);\n if (rootConfig.depending.semanticRelease) {\n fileNames.push('release.yml');\n }\n fileNames.push('test.yml', 'wbfy.yml');\n\n for (const fileName of fileNames) {\n const kind = path.basename(fileName, '.yml');\n await promisePool.run(() => writeWorkflowYaml(rootConfig, workflowsPath, kind));\n }\n}\n\nasync function writeWorkflowYaml(\n config: PackageConfig,\n workflowsPath: string,\n kind: 'test' | 'release' | 'wbfy' | string\n): Promise<void> {\n let newSettings: any = {};\n if (kind === 'test') {\n newSettings = testWorkflow;\n } else if (kind === 'release') {\n newSettings = releaseWorkflow;\n } else if (kind === 'wbfy') {\n newSettings = wbfyWorkflow;\n }\n newSettings = cloneDeep(newSettings);\n\n const filePath = path.join(workflowsPath, `${kind}.yml`);\n try {\n const oldContent = await fs.promises.readFile(filePath, 'utf-8');\n const oldSettings = yaml.load(oldContent);\n newSettings = merge.all([newSettings, oldSettings, newSettings], { arrayMerge: combineMerge });\n } catch (e) {\n // do nothing\n }\n\n if (kind === 'release') {\n if (newSettings.on.schedule) {\n delete newSettings.on.push;\n } else {\n newSettings.on.push.branches = config.release.branches;\n }\n } else if (kind === 'wbfy') {\n const firstCharOfCron = newSettings.on.schedule?.[0]?.cron?.[0];\n if (!firstCharOfCron || firstCharOfCron === '0') {\n const min = 1 + Math.floor(Math.random() * 59);\n const hour = (3 + Math.floor(Math.random() * 6) + 9) % 24;\n const cron = `${min} ${hour} * * *`;\n newSettings.on.schedule = [{ cron }];\n }\n }\n\n for (const job of Object.values(newSettings.jobs) as any[]) {\n if (!job.uses?.includes?.('/reusable-workflows/')) break;\n\n normalizeJob(config, job, kind);\n }\n\n if (kind === 'release') {\n await promisePool.run(() => fs.promises.rm('semantic-release.yml', { force: true }));\n }\n const ymlText = yaml.dump(newSettings, {\n lineWidth: -1,\n noCompatMode: true,\n styles: {\n '!!null': 'empty',\n },\n });\n await fs.promises.writeFile(filePath, ymlText);\n}\n\nfunction normalizeJob(config: PackageConfig, job: any, kind: string): void {\n job.with ||= {};\n job.secrets ||= {};\n if ((config.release.github && kind === 'test') || kind === 'release' || kind === 'wbfy') {\n if (config.publicRepo) {\n job.secrets['GH_TOKEN'] = '${{ secrets.PUBLIC_GH_BOT_PAT }}';\n } else {\n job.secrets['GH_TOKEN'] = '${{ secrets.GH_BOT_PAT }}';\n }\n }\n if (config.release.npm && (kind === 'release' || kind === 'test')) {\n job.secrets['NPM_TOKEN'] = '${{ secrets.NPM_TOKEN }}';\n }\n\n if (config.repository?.startsWith('github:WillBooster/')) {\n job.uses = job.uses.replace('WillBoosterLab/', 'WillBooster/');\n } else if (config.repository?.startsWith('github:WillBoosterLab/')) {\n job.uses = job.uses.replace('WillBooster/', 'WillBoosterLab/');\n }\n\n if (config.containingDockerfile) {\n job.with['cpu_arch'] = 'X64';\n }\n delete job.with['non_self_hosted'];\n if (Object.keys(job.with).length) {\n sortKeys(job.with);\n } else {\n delete job.with;\n }\n\n if (Object.keys(job.secrets).length) {\n sortKeys(job.secrets);\n } else {\n delete job.secrets;\n }\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { PackageConfig } from '../utils/packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateYarnrcYml(config: PackageConfig): Promise<void> {\n const currentVersion = spawnSyncWithStringResult('yarn', ['--version'], config.dirPath);\n const latestVersion = spawnSyncWithStringResult('npm', ['show', '@yarnpkg/cli', 'version'], config.dirPath);\n if (currentVersion !== latestVersion) {\n spawnSync('yarn', ['set', 'version', latestVersion], config.dirPath, 1);\n }\n\n const releasesPath = path.join(config.dirPath, '.yarn', 'releases');\n await fs.promises.mkdir(releasesPath, { recursive: true });\n for (const file of await fs.promises.readdir(releasesPath)) {\n if (file.startsWith('yarn-') && !file.startsWith(`yarn-${latestVersion}.`)) {\n await promisePool.run(() => fs.promises.rm(path.join(releasesPath, file)));\n console.log('Removed', path.join(releasesPath, file));\n }\n }\n\n const yarnrcPath = path.resolve(config.dirPath, '.yarnrc');\n await promisePool.run(() => fs.promises.rm(yarnrcPath, { force: true }));\n\n const yarnrcYmlPath = path.resolve(config.dirPath, '.yarnrc.yml');\n const settings = yaml.load(await fs.promises.readFile(yarnrcYmlPath, 'utf8')) as any;\n settings.defaultSemverRangePrefix = '';\n if (config.requiringNodeModules) {\n settings.nodeLinker = 'node-modules';\n settings.nmMode = 'hardlinks-global';\n }\n await fs.promises.writeFile(yarnrcYmlPath, yaml.dump(settings, { lineWidth: -1 }));\n\n const plugins = (settings.plugins || []).map((p: any) => p.spec as string);\n const requireTypeScript = config.containingTypeScript || config.containingTypeScriptInPackages;\n importOrRemovePlugin(config, plugins, requireTypeScript, '@yarnpkg/plugin-typescript');\n if (requireTypeScript && !config.requiringNodeModules) {\n spawnSync('yarn', ['dlx', '@yarnpkg/sdks', 'vscode'], config.dirPath);\n }\n importOrRemovePlugin(config, plugins, config.containingSubPackageJsons, '@yarnpkg/plugin-workspace-tools');\n spawnSync('yarn', ['dlx', 'yarn-plugin-auto-install'], config.dirPath);\n}\n\nfunction importOrRemovePlugin(config: PackageConfig, plugins: string[], requirePlugin: boolean, plugin: string): void {\n if (requirePlugin !== plugins.includes(plugin)) {\n spawnSync('yarn', ['plugin', requirePlugin ? 'import' : 'remove', plugin], config.dirPath);\n }\n}\n", "import fs from 'fs';\nimport fsp from 'fs/promises';\nimport path from 'path';\n\nimport glob from 'glob';\nimport yaml from 'js-yaml';\nimport simpleGit from 'simple-git';\n\nimport { fetchOnNode } from './fetchOnNode';\n\nexport interface PackageConfig {\n dirPath: string;\n root: boolean;\n publicRepo: boolean;\n repository?: string;\n willBoosterConfigs: boolean;\n containingSubPackageJsons: boolean;\n containingDockerfile: boolean;\n containingGemfile: boolean;\n containingGoMod: boolean;\n containingPackageJson: boolean;\n containingPoetryLock: boolean;\n containingPomXml: boolean;\n containingPubspecYaml: boolean;\n containingTemplateYaml: boolean;\n\n containingJavaScript: boolean;\n containingTypeScript: boolean;\n containingJsxOrTsx: boolean;\n containingJavaScriptInPackages: boolean;\n containingTypeScriptInPackages: boolean;\n containingJsxOrTsxInPackages: boolean;\n depending: {\n blitz: boolean;\n firebase: boolean;\n jestPlaywrightPreset: boolean;\n prisma: boolean;\n reactNative: boolean;\n semanticRelease: boolean;\n storybook: boolean;\n };\n release: {\n branches: string[];\n github: boolean;\n npm: boolean;\n };\n eslintBase?: string;\n requiringNodeModules: boolean;\n versionsText?: string;\n}\n\nexport async function getPackageConfig(dirPath: string): Promise<PackageConfig | null> {\n const packageJsonPath = path.resolve(dirPath, 'package.json');\n try {\n const containingPackageJson = fs.existsSync(packageJsonPath);\n let dependencies: { [key: string]: string } = {};\n let devDependencies: { [key: string]: string } = {};\n let packageJson: any = {};\n if (containingPackageJson) {\n const packageJsonText = fs.readFileSync(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(packageJsonText);\n dependencies = packageJson.dependencies ?? {};\n devDependencies = packageJson.devDependencies ?? {};\n }\n\n let requiringNodeModules = true;\n try {\n const yarnrcYmlPath = path.resolve(dirPath, '.yarnrc.yml');\n const doc = yaml.load(await fsp.readFile(yarnrcYmlPath, 'utf8')) as any;\n requiringNodeModules = !doc.nodeLinker || doc.nodeLinker === 'node-modules';\n } catch (_) {\n // do nothing\n }\n\n let releaseBranches: string[] = [];\n let releasePlugins: string[] = [];\n try {\n const releasercJsonPath = path.resolve(dirPath, '.releaserc.json');\n const json = JSON.parse(await fsp.readFile(releasercJsonPath, 'utf8'));\n releaseBranches = json?.branches || [];\n releasePlugins = json?.plugins?.flat() || [];\n } catch (_) {\n // do nothing\n }\n\n const isRoot =\n path.basename(path.resolve(dirPath, '..')) !== 'packages' ||\n !fs.existsSync(path.resolve(dirPath, '..', '..', 'package.json'));\n\n let repoInfo: Record<string, any> | undefined;\n if (isRoot) {\n repoInfo = await getRepoInfo(dirPath, packageJson);\n }\n\n const toolVersionsPath = path.resolve(dirPath, '.tool-versions');\n let versionsText: string | undefined;\n try {\n versionsText = await fsp.readFile(toolVersionsPath, 'utf-8');\n } catch (_) {\n // do nothing\n }\n\n const config: PackageConfig = {\n dirPath,\n root: isRoot,\n publicRepo: repoInfo?.private === false,\n repository: repoInfo?.full_name ? `github:${repoInfo?.full_name}` : undefined,\n willBoosterConfigs: packageJsonPath.includes(`${path.sep}willbooster-configs`),\n containingSubPackageJsons: glob.sync('packages/**/package.json', { cwd: dirPath }).length > 0,\n containingDockerfile:\n fs.existsSync(path.resolve(dirPath, 'Dockerfile')) ||\n fs.existsSync(path.resolve(dirPath, 'docker-compose.yml')),\n containingGemfile: fs.existsSync(path.resolve(dirPath, 'Gemfile')),\n containingGoMod: fs.existsSync(path.resolve(dirPath, 'go.mod')),\n containingPackageJson: fs.existsSync(path.resolve(dirPath, 'package.json')),\n containingPoetryLock: fs.existsSync(path.resolve(dirPath, 'poetry.lock')),\n containingPomXml: fs.existsSync(path.resolve(dirPath, 'pom.xml')),\n containingPubspecYaml: fs.existsSync(path.resolve(dirPath, 'pubspec.yaml')),\n containingTemplateYaml: fs.existsSync(path.resolve(dirPath, 'template.yaml')),\n containingJavaScript: glob.sync('@(app|src|__tests__)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScript: glob.sync('@(app|src|__tests__)/**/*.ts?(x)', { cwd: dirPath }).length > 0,\n containingJsxOrTsx: glob.sync('@(app|src|__tests__)/**/*.{t,j}sx', { cwd: dirPath }).length > 0,\n containingJavaScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.ts?(x)', { cwd: dirPath }).length > 0,\n containingJsxOrTsxInPackages:\n glob.sync('packages/**/@(app|src|__tests__)/**/*.{t,j}sx', { cwd: dirPath }).length > 0,\n depending: {\n blitz: !!(dependencies['blitz'] || devDependencies['blitz']),\n firebase: !!devDependencies['firebase-tools'],\n jestPlaywrightPreset: !!devDependencies['jest-playwright-preset'],\n prisma: !!devDependencies['prisma'],\n reactNative: !!dependencies['react-native'],\n semanticRelease: !!devDependencies['semantic-release'],\n storybook: !!devDependencies['@storybook/react'],\n },\n release: {\n branches: releaseBranches,\n github: releasePlugins.includes('@semantic-release/github'),\n npm: releasePlugins.includes('@semantic-release/npm'),\n },\n requiringNodeModules,\n versionsText,\n };\n config.eslintBase = getEslintExtensionBase(config);\n if (\n config.containingGemfile ||\n config.containingGoMod ||\n config.containingPackageJson ||\n config.containingPoetryLock ||\n config.containingPomXml ||\n config.containingPubspecYaml ||\n config.containingTemplateYaml\n ) {\n return config;\n }\n } catch (e) {\n // do nothing\n }\n return null;\n}\n\nfunction getEslintExtensionBase(config: PackageConfig): string | undefined {\n if (config.containingTypeScript) {\n if (config.containingJsxOrTsx) {\n return '@willbooster/eslint-config-ts-react';\n } else {\n return '@willbooster/eslint-config-ts';\n }\n } else {\n if (config.containingJsxOrTsx) {\n return '@willbooster/eslint-config-js-react';\n } else if (config.containingJavaScript) {\n return '@willbooster/eslint-config-js';\n }\n }\n return undefined;\n}\n\nasync function getRepoInfo(dirPath: string, packageJson: any): Promise<Record<string, any> | undefined> {\n const git = simpleGit(dirPath);\n const remotes = await git.getRemotes(true);\n const origin = remotes.find((r) => r.name === 'origin');\n const remoteUrl = origin?.refs?.fetch ?? origin?.refs?.push;\n if (typeof remoteUrl === 'string') {\n const json = await fetchRepoInfo(remoteUrl);\n if (json) return json;\n }\n\n const url = packageJson.repository?.url ?? packageJson.repository;\n if (typeof url === 'string') {\n const json = await fetchRepoInfo(url);\n if (json && json.message !== 'Not Found') return json;\n }\n}\n\nasync function fetchRepoInfo(urlOrFullName: string): Promise<Record<string, any> | undefined> {\n const urlWithoutProtocol = urlOrFullName.split(':').at(-1);\n const names = urlWithoutProtocol?.split('/');\n const org = names?.at(-2);\n const name = names?.at(-1)?.replace(/.git$/, '');\n if (!org || !name) return;\n\n const token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n const opts = token\n ? {\n headers: {\n Authorization: `token ${token}`,\n },\n }\n : undefined;\n const res = await fetchOnNode(`https://api.github.com/repos/${org}/${name}`, opts);\n const json = (await res.json()) as any;\n return { full_name: `${org}/${name}`, ...(json ?? {}) };\n}\n"],
5
+ "mappings": "0zBAAA,OAAiB,mBAEjB,GAAiB,mBACjB,GAAkB,oBCHlB,MAAe,iBACf,EAAiB,mBCDjB,OAA4B,gCAEf,EAAc,GAAI,gBDI/B,kBAA6C,EAAsC,CACjF,GAAI,CAAC,EAAO,aAAc,OAE1B,GAAM,GAAkB,CAAC,EACzB,OAAW,KAAe,GAAO,aAAa,KAAK,EAAE,MAAM;AAAA,CAAI,EAAG,CAChE,GAAM,GAAO,EAAY,KAAK,EAC9B,GAAI,GAAQ,EAAK,MAAM,KAAK,EAAE,KAAO,SAAU,CAC7C,EAAM,KAAK,CAAI,EACf,QACF,CAEA,GAAM,CAAC,CAAE,GAAW,EAAK,MAAM,KAAK,EACpC,KAAM,GAAY,IAAI,IAAM,UAAG,SAAS,UAAU,UAAK,QAAQ,EAAO,QAAS,eAAe,EAAG,CAAO,CAAC,CAC3G,CACA,AAAI,EAAO,sBACT,GAAW,gBAAiB,EAAG,CAAK,EACpC,EAAW,gBAAiB,EAAG,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@@
1
1
  {
2
2
  "name": "wbfy",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "A tool for applying WillBooster's conventional configures to npm packages",
5
5
  "repository": "github:WillBooster/wbfy",
6
6
  "license": "Apache-2.0",