wbfy 1.19.0 → 1.21.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.
@@ -1,7 +1,7 @@
1
- var ut=Object.create;var N=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames,ye=Object.getOwnPropertySymbols,gt=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var he=(e,n,t)=>n in e?N(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,F=(e,n)=>{for(var t in n||(n={}))Pe.call(n,t)&&he(e,t,n[t]);if(ye)for(var t of ye(n))yt.call(n,t)&&he(e,t,n[t]);return e};var ht=e=>N(e,"__esModule",{value:!0});var Pt=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of dt(n))!Pe.call(e,r)&&(t||r!=="default")&&N(e,r,{get:()=>n[r],enumerable:!(o=ft(n,r))||o.enumerable});return e},l=(e,n)=>Pt(ht(N(e!=null?ut(gt(e)):{},"default",!n&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var pt=l(require("path")),ct=l(require("glob")),mt=l(require("yargs"));var B=l(require("fs")),X=l(require("path"));var ve=require("minimal-promise-pool"),p=new ve.PromisePool;async function ke(e){if(!e.versionsText)return;let n=[];for(let o of e.versionsText.trim().split(`
2
- `)){let r=o.trim();if(r&&r.split(/\s+/)[0]!=="nodejs"){n.push(r);continue}let[,i]=r.split(/\s+/);await p.run(()=>B.default.promises.writeFile(X.default.resolve(e.dirPath,".node-version"),i))}e.containingPoetryLock&&(W("poetry 1.1.13",0,n),W("python 3.9.10",0,n)),e.depending.firebase&&W("java adoptopenjdk-11.0.14+9",0,n),e.containingPackageJson&&W("yarn 1.22.17",n.length,n);let t=X.default.resolve(e.dirPath,".tool-versions");n.length?await p.run(()=>B.default.promises.writeFile(t,n.join(`
1
+ var mt=Object.create;var N=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames,ge=Object.getOwnPropertySymbols,dt=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var ye=(e,n,t)=>n in e?N(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,F=(e,n)=>{for(var t in n||(n={}))he.call(n,t)&&ye(e,t,n[t]);if(ge)for(var t of ge(n))gt.call(n,t)&&ye(e,t,n[t]);return e};var yt=e=>N(e,"__esModule",{value:!0});var ht=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ut(n))!he.call(e,r)&&(t||r!=="default")&&N(e,r,{get:()=>n[r],enumerable:!(o=ft(n,r))||o.enumerable});return e},l=(e,n)=>ht(yt(N(e!=null?mt(dt(e)):{},"default",!n&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var lt=l(require("path")),pt=l(require("glob")),ct=l(require("yargs"));var W=l(require("fs")),X=l(require("path"));var ve=require("minimal-promise-pool"),c=new ve.PromisePool;async function Pe(e){if(!e.versionsText)return;let n=[];for(let o of e.versionsText.trim().split(`
2
+ `)){let r=o.trim();if(r&&r.split(/\s+/)[0]!=="nodejs"){n.push(r);continue}let[,i]=r.split(/\s+/);await c.run(()=>W.default.promises.writeFile(X.default.resolve(e.dirPath,".node-version"),i))}e.containingPoetryLock&&(I("poetry 1.1.13",0,n),I("python 3.9.10",0,n)),e.depending.firebase&&I("java adoptopenjdk-11.0.14+9",0,n),e.containingPackageJson&&I("yarn 1.22.17",n.length,n);let t=X.default.resolve(e.dirPath,".tool-versions");n.length?await c.run(()=>W.default.promises.writeFile(t,n.join(`
3
3
  `)+`
4
- `)):await p.run(()=>B.default.promises.rm(t,{force:!0}))}function W(e,n,t){let[o]=e.split(" "),r=t.findIndex(i=>i.split(/\s+/)[0]===o);r>=0?t[r]=e:t.splice(n,0,e)}var be=l(require("path"));var g={codeWith2IndentSize:["cjs","mjs","js","jsx","ts","tsx","json","json5","cpp","dart","htm","html","pu","puml","rb","vue","yaml","yml"].sort(),codeWith4IndentSize:["go","gradle","py"].sort(),codeWith8IndentSize:["sh"].sort(),markdownLike:["md"].sort(),eslint:["cjs","mjs","js","ts","tsx","jsx"].sort(),prettier:["cjs","mjs","js","jsx","ts","tsx","json","json5","css","htm","html","md","scss","vue","yaml","yml"].sort()};var we=l(require("fs/promises")),u={async generateFile(e,n){await we.default.writeFile(e,n),console.log(`Generated ${e}`)}};var vt=`root = true
4
+ `)):await c.run(()=>W.default.promises.rm(t,{force:!0}))}function I(e,n,t){let[o]=e.split(" "),r=t.findIndex(i=>i.split(/\s+/)[0]===o);r>=0?t[r]=e:t.splice(n,0,e)}var we=l(require("path"));var y={codeWith2IndentSize:["cjs","mjs","js","jsx","ts","tsx","json","json5","cpp","dart","htm","html","pu","puml","rb","vue","yaml","yml"].sort(),codeWith4IndentSize:["go","gradle","py"].sort(),codeWith8IndentSize:["sh"].sort(),markdownLike:["md"].sort(),eslint:["cjs","mjs","js","ts","tsx","jsx"].sort(),prettier:["cjs","mjs","js","jsx","ts","tsx","json","json5","css","htm","html","md","scss","vue","yaml","yml"].sort()};var ke=l(require("fs/promises")),u={async generateFile(e,n){await ke.default.writeFile(e,n),console.log(`Generated ${e}`)}};var vt=`root = true
5
5
 
6
6
  [*]
7
7
  charset = utf-8
@@ -9,33 +9,33 @@ end_of_line = lf
9
9
  insert_final_newline = true
10
10
  trim_trailing_whitespace = true
11
11
 
12
- ${z(g.codeWith2IndentSize)}
12
+ ${B(y.codeWith2IndentSize)}
13
13
  indent_size = 2
14
14
  indent_style = space
15
15
 
16
- ${z(g.codeWith4IndentSize)}
16
+ ${B(y.codeWith4IndentSize)}
17
17
  indent_size = 4
18
18
  indent_style = space
19
19
 
20
- ${z(g.codeWith8IndentSize)}
20
+ ${B(y.codeWith8IndentSize)}
21
21
  indent_size = 8
22
22
  indent_style = space
23
23
 
24
- ${z(g.markdownLike)}
24
+ ${B(y.markdownLike)}
25
25
  max_line_length = off
26
26
  trim_trailing_whitespace = false
27
27
 
28
28
  [{Makefile,*.mk}]
29
29
  indent_style = tab
30
- `;async function xe(e){let n=be.default.resolve(e.dirPath,".editorconfig");await p.run(()=>u.generateFile(n,vt))}function z(e){return e.length>1?`[*.{${e.join(",")}}]`:`[*.${e[0]}]`}var Z=l(require("path"));var C=l(require("fs")),y={header:"# Project-specific settings",separator:"# Generated by @willbooster/willboosterify",separatorPrefix:"# Generated by @willbooster",getExistingContent(e){return C.default.existsSync(e)?C.default.readFileSync(e).toString().replace(/# Project-specific settings[^\n]*\n/m,"").replace(/# Generated by[^\n]*\n/m,"").replace(/\r?\n\r?\n(\r?\n)+/gm,`
30
+ `;async function xe(e){let n=we.default.resolve(e.dirPath,".editorconfig");await c.run(()=>u.generateFile(n,vt))}function B(e){return e.length>1?`[*.{${e.join(",")}}]`:`[*.${e[0]}]`}var Z=l(require("path"));var $=l(require("fs")),h={header:"# Project-specific settings",separator:"# Generated by @willbooster/willboosterify",separatorPrefix:"# Generated by @willbooster",getExistingContent(e){return $.default.existsSync(e)?$.default.readFileSync(e).toString().replace(/# Project-specific settings[^\n]*\n/m,"").replace(/# Generated by[^\n]*\n/m,"").replace(/\r?\n\r?\n(\r?\n)+/gm,`
31
31
 
32
- `):null},getUserContent(e){if(C.default.existsSync(e)){let n=C.default.readFileSync(e,"utf-8"),t=n.indexOf(this.separatorPrefix);if(t>=0)return n.substr(0,n.indexOf(`
33
- `,t)+1)}return null},isBerryZeroInstallEnabled(e){return C.default.existsSync(e)?C.default.readFileSync(e,"utf-8").includes(`
34
- !.yarn/cache`):!1}};var kt=`${y.header}
32
+ `):null},getUserContent(e){if($.default.existsSync(e)){let n=$.default.readFileSync(e,"utf-8"),t=n.indexOf(this.separatorPrefix);if(t>=0)return n.substr(0,n.indexOf(`
33
+ `,t)+1)}return null},isBerryZeroInstallEnabled(e){return $.default.existsSync(e)?$.default.readFileSync(e,"utf-8").includes(`
34
+ !.yarn/cache`):!1}};var Pt=`${h.header}
35
35
 
36
36
 
37
- ${y.separator}
38
- `,wt=`
37
+ ${h.separator}
38
+ `,kt=`
39
39
  3rd-party/
40
40
  @types/
41
41
  __generated__/
@@ -48,24 +48,24 @@ test-fixtures/
48
48
  *.min.js
49
49
  .yarn/
50
50
  .pnp.js
51
- `;async function Se(e){let n=Z.default.resolve(e.dirPath,".eslintignore"),t=y.getUserContent(n)||kt,o=Z.default.resolve(e.dirPath,".gitignore"),r=y.getExistingContent(o)||"",i=t+wt+r;await p.run(()=>u.generateFile(n,i))}var Fe=l(require("fs")),Ce=l(require("path")),$e=l(require("deepmerge"));var je=l(require("deepmerge"));function M(e,n){return n}function U(e,n,t){let o=e.slice();return n.forEach((r,i)=>{typeof o[i]>"u"?o[i]=t.cloneUnlessOtherwiseSpecified(r,t):t.isMergeableObject(r)?o[i]=(0,je.default)(e[i],r,t):e.indexOf(r)===-1&&o.push(r)}),o}async function _e(e,n){let t=[];e.eslintBase&&t.push(e.eslintBase),e!==n&&t.push("../../.eslintrc.json");let o={root:!0,extends:t},r=Ce.default.resolve(e.dirPath,".eslintrc.json");try{let c=await Fe.default.promises.readFile(r,"utf-8"),a=JSON.parse(c);a.extends&&(a.extends=a.extends.filter(s=>!s.startsWith("@willbooster/")&&s!=="../../.eslintrc.json")),t.length||(a.extends=[]);let m=o.extends;o.extends=a.extends,a.extends=m,o=$e.default.all([o,a,o],{arrayMerge:U}),e.depending.blitz&&(o.extends=[...o.extends.filter(s=>s!=="blitz"),"blitz"])}catch{}let i=JSON.stringify(o);await p.run(()=>u.generateFile(r,i))}var Te=l(require("path"));var bt=`* text=auto
51
+ `;async function be(e){let n=Z.default.resolve(e.dirPath,".eslintignore"),t=h.getUserContent(n)||Pt,o=Z.default.resolve(e.dirPath,".gitignore"),r=h.getExistingContent(o)||"",i=t+kt+r;await c.run(()=>u.generateFile(n,i))}var Ce=l(require("fs")),Fe=l(require("path")),$e=l(require("deepmerge"));var Se=l(require("deepmerge"));function z(e,n){return n}function M(e,n,t){let o=e.slice();return n.forEach((r,i)=>{typeof o[i]>"u"?o[i]=t.cloneUnlessOtherwiseSpecified(r,t):t.isMergeableObject(r)?o[i]=(0,Se.default)(e[i],r,t):e.indexOf(r)===-1&&o.push(r)}),o}async function je(e,n){let t=[];e.eslintBase&&t.push(e.eslintBase),e!==n&&t.push("../../.eslintrc.json");let o={root:!0,extends:t},r=Fe.default.resolve(e.dirPath,".eslintrc.json");try{let p=await Ce.default.promises.readFile(r,"utf-8"),a=JSON.parse(p);a.extends&&(a.extends=a.extends.filter(s=>!s.startsWith("@willbooster/")&&s!=="../../.eslintrc.json")),t.length||(a.extends=[]);let m=o.extends;o.extends=a.extends,a.extends=m,o=$e.default.all([o,a,o],{arrayMerge:M}),e.depending.blitz&&(o.extends=[...o.extends.filter(s=>s!=="blitz"),"blitz"])}catch{}let i=JSON.stringify(o);await c.run(()=>u.generateFile(r,i))}var _e=l(require("path"));var wt=`* text=auto
52
52
 
53
53
  *.vcproj text eol=crlf
54
54
 
55
- ${g.codeWith2IndentSize.concat(g.codeWith4IndentSize).concat(g.markdownLike).map(e=>`*.${e} text eol=lf`).join(`
55
+ ${y.codeWith2IndentSize.concat(y.codeWith4IndentSize).concat(y.markdownLike).map(e=>`*.${e} text eol=lf`).join(`
56
56
  `)}
57
- `;async function Re(e){let n=Te.default.resolve(e.dirPath,".gitattributes");await p.run(()=>u.generateFile(n,bt))}var Q=l(require("path"));async function L(e,n){let{default:t}=await import("node-fetch");return t(e,n)}var xt=["windows","macos","linux","jetbrains","visualstudiocode","emacs","vim","yarn"],St=`${y.header}
57
+ `;async function Te(e){let n=_e.default.resolve(e.dirPath,".gitattributes");await c.run(()=>u.generateFile(n,wt))}var Q=l(require("path"));async function U(e,n){let{default:t}=await import("node-fetch");return t(e,n)}var xt=["windows","macos","linux","jetbrains","visualstudiocode","emacs","vim","yarn"],bt=`${h.header}
58
58
 
59
59
 
60
- ${y.separator}
61
- `,jt=`
60
+ ${h.separator}
61
+ `,St=`
62
62
  .devcontainer/
63
63
  dist/
64
64
  temp/
65
65
  Icon[\r]
66
66
  *.sqlite3
67
67
  *.sqlite3-journal
68
- `;async function Oe(e,n){let t=Q.default.resolve(e.dirPath,".gitignore"),o=(y.getUserContent(t)||St)+jt,r=[...xt];e.containingGemfile&&r.push("ruby"),e.containingGoMod&&(r.push("go"),o+=`${Q.default.basename(e.dirPath)}
68
+ `;async function Re(e,n){let t=Q.default.resolve(e.dirPath,".gitignore"),o=(h.getUserContent(t)||bt)+St,r=[...xt];e.containingGemfile&&r.push("ruby"),e.containingGoMod&&(r.push("go"),o+=`${Q.default.basename(e.dirPath)}
69
69
  `),e.containingPackageJson&&r.push("node"),e.containingPomXml&&(r.push("maven"),o+=`.idea/google-java-format.xml
70
70
  `),e.containingPubspecYaml&&(r.push("flutter","AndroidStudio","ruby"),o+=`.flutter-plugins-dependencies
71
71
  android/key.properties
@@ -77,8 +77,8 @@ 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=(await Promise.all(r.map(async a=>await(await L(`https://www.toptal.com/developers/gitignore/api/${a}`)).text()))).join("");y.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
- android/$1`));let c=o+i;await p.run(()=>u.generateFile(t,c))}var b=l(require("fs")),$=l(require("path"));var ee=l(require("child_process"));function P(e,n,t,o=0){do{let[r,i]=Ee(e,n,t);if(console.log(`$ ${r} at ${i.cwd}`),ee.default.spawnSync(r,i).status===0)break}while(--o>=0)}function te(e,n,t){let[o,r]=Ee(e,n,t);return r.stdio="pipe",ee.default.spawnSync(o,r).stdout.toString().trim()}function Ee(e,n,t){let o=F({},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 ne="npm test",G={preCommit:"yarn lint-staged",prePush:"yarn typecheck",prePushForLab:`
80
+ `);let i=(await Promise.all(r.map(async a=>await(await U(`https://www.toptal.com/developers/gitignore/api/${a}`)).text()))).join("");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
+ android/$1`));let p=o+i;await c.run(()=>u.generateFile(t,p))}var x=l(require("fs")),j=l(require("path"));var ee=l(require("child_process"));function v(e,n,t,o=0){do{let[r,i]=Oe(e,n,t);if(console.log(`$ ${r} at ${i.cwd}`),ee.default.spawnSync(r,i).status===0)break}while(--o>=0)}function te(e,n,t){let[o,r]=Oe(e,n,t);return r.stdio="pipe",ee.default.spawnSync(o,r).stdout.toString().trim()}function Oe(e,n,t){let o=F({},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 ne="npm test",L={preCommit:"yarn lint-staged",prePush:"yarn typecheck",prePushForLab:`
82
82
  if [ $(git branch --show-current) = "main" ]; then
83
83
  echo "************************************************"
84
84
  echo "*** Don't push main branch directly. Use PR! ***"
@@ -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 De(e){var s,f,h;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})]),P("yarn",["dlx","husky-init","--yarn2"],e.dirPath);let i=$.default.resolve(r,"pre-commit"),c=await b.default.promises.readFile(i,"utf-8");if(await p.run(()=>b.default.promises.rm($.default.resolve(e.dirPath,".huskyrc.json"),{force:!0})),await p.run(()=>b.default.promises.writeFile(i,c.replace(ne,G.preCommit))),e.containingTypeScript||e.containingTypeScriptInPackages){let D=(s=e.repository)!=null&&s.startsWith("github:WillBoosterLab/")?G.prePushForLab:G.prePush;await p.run(()=>b.default.promises.writeFile($.default.resolve(r,"pre-push"),c.replace(ne,D),{mode:493}))}let a=[];(f=e.versionsText)!=null&&f.includes("python ")&&a.push("asdf install python"),e.versionsText&&a.push("asdf install"),a.push(G.postMerge),(h=e.versionsText)!=null&&h.includes("poetry ")&&a.push("poetry install"),e.depending.blitz?a.push("yarn blitz codegen"):e.depending.prisma&&a.push("yarn prisma generate");let m=c.replace(ne,a.join(" && "));await p.run(()=>b.default.promises.writeFile($.default.resolve(r,"post-merge"),m,{mode:493}))}var ie=l(require("fs")),oe=l(require("path"));var Ft=`<?xml version="1.0" encoding="UTF-8"?>
89
+ yarn typecheck`.trim(),postMerge:"yarn"};async function De(e){var s,f,d;let n=j.default.resolve(e.dirPath,"package.json"),t=await x.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=j.default.resolve(e.dirPath,".husky");await Promise.all([x.default.promises.writeFile(n,JSON.stringify(o,void 0,2)),x.default.promises.rm(r,{force:!0,recursive:!0})]),v("yarn",["dlx","husky-init","--yarn2"],e.dirPath);let i=j.default.resolve(r,"pre-commit"),p=await x.default.promises.readFile(i,"utf-8");if(await c.run(()=>x.default.promises.rm(j.default.resolve(e.dirPath,".huskyrc.json"),{force:!0})),await c.run(()=>x.default.promises.writeFile(i,p.replace(ne,L.preCommit))),e.containingTypeScript||e.containingTypeScriptInPackages){let D=(s=e.repository)!=null&&s.startsWith("github:WillBoosterLab/")?L.prePushForLab:L.prePush;await c.run(()=>x.default.promises.writeFile(j.default.resolve(r,"pre-push"),p.replace(ne,D),{mode:493}))}let a=[];(f=e.versionsText)!=null&&f.includes("python ")&&a.push("asdf install python"),e.versionsText&&a.push("asdf install"),a.push(L.postMerge),(d=e.versionsText)!=null&&d.includes("poetry ")&&a.push("poetry install"),e.depending.blitz?a.push("yarn blitz codegen"):e.depending.prisma&&a.push("yarn prisma generate");let m=p.replace(ne,a.join(" && "));await c.run(()=>x.default.promises.writeFile(j.default.resolve(r,"post-merge"),m,{mode:493}))}var ie=l(require("fs")),oe=l(require("path"));var Ct=`<?xml version="1.0" encoding="UTF-8"?>
90
90
  <project version="4">
91
91
  <component name="ProjectTasksOptions">
92
92
  <TaskOptions isEnabled="true">
@@ -211,10 +211,10 @@ yarn typecheck`.trim(),postMerge:"yarn"};async function De(e){var s,f,h;let n=$.
211
211
  </TaskOptions>
212
212
  </component>
213
213
  </project>
214
- `;async function Je(e){let n=oe.default.resolve(e.dirPath,".idea");if(ie.default.existsSync(n)){let t=oe.default.resolve(n,"watcherTasks.xml");e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages||e.containingPackageJson&&!e.containingPubspecYaml&&!e.containingGemfile&&!e.containingGoMod&&!e.containingPomXml?await p.run(()=>u.generateFile(t,Ft)):await p.run(()=>ie.default.promises.rm(t,{force:!0}))}}var re=l(require("fs")),A=l(require("path"));var Y={getLintFixSuffix(e){return e.containingJsxOrTsx?' --rule "{ react-hooks/exhaustive-deps: 0 }"':""}};var Ie=`./{src,__tests__}/**/*.{${g.eslint.join(",")}}`,Ct=`files = micromatch.not(files, '${Ie}');`;async function se(e){let n=[];if(e.containingJavaScript||e.containingTypeScript){let i=`
215
- '${Ie}': [${JSON.stringify(`eslint --fix${Y.getLintFixSuffix(e)}`)}, 'prettier --write'],`;n.push(i)}let t=e.root?" && !file.includes('/packages/')":"";n.push(`
216
- './**/*.{${g.prettier.join(",")}}': files => {
217
- ${e.containingJavaScript||e.containingTypeScript?Ct:""}
214
+ `;async function Ee(e){let n=oe.default.resolve(e.dirPath,".idea");if(ie.default.existsSync(n)){let t=oe.default.resolve(n,"watcherTasks.xml");e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages||e.containingPackageJson&&!e.containingPubspecYaml&&!e.containingGemfile&&!e.containingGoMod&&!e.containingPomXml?await c.run(()=>u.generateFile(t,Ct)):await c.run(()=>ie.default.promises.rm(t,{force:!0}))}}var re=l(require("fs")),Y=l(require("path"));var G={getLintFixSuffix(e){return e.containingJsxOrTsx?' --rule "{ react-hooks/exhaustive-deps: 0 }"':""}};var Je=`./{src,__tests__}/**/*.{${y.eslint.join(",")}}`,Ft=`files = micromatch.not(files, '${Je}');`;async function se(e){let n=[];if(e.containingJavaScript||e.containingTypeScript){let i=`
215
+ '${Je}': [${JSON.stringify(`eslint --fix${G.getLintFixSuffix(e)}`)}, 'prettier --write'],`;n.push(i)}let t=e.root?" && !file.includes('/packages/')":"";n.push(`
216
+ './**/*.{${y.prettier.join(",")}}': files => {
217
+ ${e.containingJavaScript||e.containingTypeScript?Ft:""}
218
218
  const filteredFiles = files.filter(file => !file.includes('/test-fixtures/')${t});
219
219
  if (filteredFiles.length === 0) return [];
220
220
  const commands = [\`prettier --write \${filteredFiles.join(' ')}\`];
@@ -237,12 +237,12 @@ yarn typecheck`.trim(),postMerge:"yarn"};async function De(e){var s,f,h;let n=$.
237
237
 
238
238
  module.exports = {${n.join("")}
239
239
  };
240
- `,r=A.default.resolve(e.dirPath,".lintstagedrc.cjs");await p.run(()=>re.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.js"),{force:!0})),await p.run(()=>re.default.promises.rm(A.default.resolve(e.dirPath,".lintstagedrc.json"),{force:!0})),await p.run(()=>u.generateFile(r,o))}var x=l(require("fs")),R=l(require("path")),H=l(require("deepmerge"));var le={cleanup:"yarn format && yarn lint-fix",format:"sort-package-json && yarn prettify",lint:`eslint --color "./{src,__tests__}/**/*.{${g.eslint.join(",")}}"`,"lint-fix":"yarn lint --fix",prettify:`prettier --color --write "**/{.*/,}*.{${g.prettier.join(",")}}" "!**/test-fixtures/**"`,typecheck:"tsc --noEmit --Pretty"},$t=(0,H.default)(F({},le),{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 "**/{.*/,}*.{${g.prettier.join(",")}}" "!**/packages/**" "!**/test-fixtures/**"`,test:"yarn workspaces foreach --verbose run test",typecheck:"yarn workspaces foreach --parallel --verbose run typecheck"}),_t=(0,H.default)(F({},le),{lint:`eslint --color "./**/*.{${g.eslint.join(",")}}"`,typecheck:`tsc --noEmit --Pretty || echo 'Please try "yarn blitz codegen" if you face unknown type errors.'`}),ae=["eslint","eslint-config-prettier","eslint-plugin-import","eslint-plugin-sort-class-members","eslint-plugin-sort-destructure-keys"],Ne=[...ae,"@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",...ae],"@willbooster/eslint-config-js-react":["@willbooster/eslint-config-js-react",...ae,...We],"@willbooster/eslint-config-ts":["@willbooster/eslint-config-ts",...Ne],"@willbooster/eslint-config-ts-react":["@willbooster/eslint-config-ts-react",...Ne,...We],"../../.eslintrc.json":[]};async function ze(e,n,t){let o=R.default.resolve(e.dirPath,"package.json"),r=await x.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 s of Object.keys(i.scripts))i.scripts[s].includes("git clone")||(i.scripts[s]=i.scripts[s].replace(/yarn\s*&&\s*/,"").replace(/yarn\s*install\s*&&\s*/,""));i.scripts=(0,H.default)(i.scripts,e.containingSubPackageJsons?$t:e.depending.blitz?_t:le),i.scripts.prettify+=await Rt(e.dirPath);let c=[],a=["lint-staged","prettier","sort-package-json","@willbooster/prettier-config"],m=[];if(e.root&&(a.push("husky","pinst","@willbooster/renovate-config"),e.depending.semanticRelease&&a.push("conventional-changelog-conventionalcommits"),e.containingSubPackageJsons?i.workspaces=["packages/*"]:delete i.workspaces),(e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages)&&(a.push("eslint","micromatch"),e.containingTypeScriptInPackages&&a.push("@typescript-eslint/parser")),(e.containingTypeScript||e.containingTypeScriptInPackages)&&!e.depending.blitz&&a.push("typescript"),e.eslintBase&&a.push(...Be[e.eslintBase]),e.willBoosterConfigs&&(c=c.filter(s=>!s.includes("@willbooster/")),a=a.filter(s=>!s.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 s=["lib","test","test_driver"].filter(f=>x.default.existsSync(R.default.resolve(e.dirPath,f)));s.length>0&&(i.scripts["format-code"]=`flutter format $(find ${s.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 s=(await x.default.promises.readdir(e.dirPath)).filter(f=>{let h=R.default.resolve(e.dirPath,f);return x.default.lstatSync(h).isDirectory()?x.default.readdirSync(h).some(D=>D.endsWith(".py")):!1});s.length>0&&(i.scripts["format-code"]=`poetry run isort --profile black ${s.join(" ")} && poetry run black ${s.join(" ")}`,i.scripts.lint=`poetry run flake8 ${s.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&&(a=a.filter(s=>!s.includes("@typescript-eslint/")),a=a.filter(s=>s!=="eslint-plugin-react"&&s!=="eslint-import-resolver-typescript"&&s!=="eslint-plugin-import"&&s!=="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 x.default.promises.writeFile(o,JSON.stringify(i)),t||(c.length&&c.some(s=>{var f;return!((f=i.dependencies)!=null&&f[s])})&&P("yarn",["add",...new Set(c)],e.dirPath),a.length&&P("yarn",["add","-D",...new Set(a)],e.dirPath),m.length&&P("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 p.run(()=>x.default.promises.rm("lerna.json",{force:!0}))}async function Rt(e){let n=R.default.resolve(e,".prettierignore"),t=await x.default.promises.readFile(n,"utf-8"),o=t.indexOf(y.separatorPrefix);return o<0?"":t.substring(0,o).split(`
241
- `).map(c=>{let a=c.trim();return a.endsWith("/")?a.slice(0,-1):a}).filter(c=>c&&!c.startsWith("#")&&!c.includes("/")).map(c=>` "!**/${c}/**"`).join("")}var pe=l(require("path"));var Ot=`${y.header}
240
+ `,r=Y.default.resolve(e.dirPath,".lintstagedrc.cjs");await c.run(()=>re.default.promises.rm(Y.default.resolve(e.dirPath,".lintstagedrc.js"),{force:!0})),await c.run(()=>re.default.promises.rm(Y.default.resolve(e.dirPath,".lintstagedrc.json"),{force:!0})),await c.run(()=>u.generateFile(r,o))}var b=l(require("fs")),T=l(require("path")),A=l(require("deepmerge"));var le={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"},$t=(0,A.default)(F({},le),{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"}),jt=(0,A.default)(F({},le),{lint:`eslint --color "./**/*.{${y.eslint.join(",")}}"`,typecheck:`tsc --noEmit --Pretty || echo 'Please try "yarn blitz codegen" if you face unknown type errors.'`}),ae=["eslint","eslint-config-prettier","eslint-plugin-import","eslint-plugin-sort-class-members","eslint-plugin-sort-destructure-keys"],Ne=[...ae,"@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint-import-resolver-typescript"],Ie=["eslint-plugin-react","eslint-plugin-react-hooks"],We={"@willbooster/eslint-config-js":["@willbooster/eslint-config-js",...ae],"@willbooster/eslint-config-js-react":["@willbooster/eslint-config-js-react",...ae,...Ie],"@willbooster/eslint-config-ts":["@willbooster/eslint-config-ts",...Ne],"@willbooster/eslint-config-ts-react":["@willbooster/eslint-config-ts-react",...Ne,...Ie],"../../.eslintrc.json":[]};async function Be(e,n,t){let o=T.default.resolve(e.dirPath,"package.json"),r=await b.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 _t(i),i.name!=="@willbooster/prettier-config"&&(i.prettier="@willbooster/prettier-config");for(let s of Object.keys(i.scripts))i.scripts[s].includes("git clone")||(i.scripts[s]=i.scripts[s].replace(/yarn\s*&&\s*/,"").replace(/yarn\s*install\s*&&\s*/,""));i.scripts=(0,A.default)(i.scripts,e.containingSubPackageJsons?$t:e.depending.blitz?jt:le),i.scripts.prettify+=await Tt(e.dirPath);let p=[],a=["lint-staged","prettier","sort-package-json","@willbooster/prettier-config"],m=[];if(e.root&&(a.push("husky","pinst","@willbooster/renovate-config"),e.depending.semanticRelease&&a.push("conventional-changelog-conventionalcommits"),e.containingSubPackageJsons?i.workspaces=["packages/*"]:delete i.workspaces),(e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages)&&(a.push("eslint","micromatch"),e.containingTypeScriptInPackages&&a.push("@typescript-eslint/parser")),(e.containingTypeScript||e.containingTypeScriptInPackages)&&!e.depending.blitz&&a.push("typescript"),e.eslintBase&&a.push(...We[e.eslintBase]),e.willBoosterConfigs&&(p=p.filter(s=>!s.includes("@willbooster/")),a=a.filter(s=>!s.includes("@willbooster/"))),i.name||(i.name=T.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"]+=G.getLintFixSuffix(e),e.containingPubspecYaml){i.scripts.lint="flutter analyze",i.scripts["lint-fix"]="yarn lint";let s=["lib","test","test_driver"].filter(f=>b.default.existsSync(T.default.resolve(e.dirPath,f)));s.length>0&&(i.scripts["format-code"]=`flutter format $(find ${s.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 s=(await b.default.promises.readdir(e.dirPath)).filter(f=>{let d=T.default.resolve(e.dirPath,f);return b.default.lstatSync(d).isDirectory()?b.default.readdirSync(d).some(D=>D.endsWith(".py")):!1});s.length>0&&(i.scripts["format-code"]=`poetry run isort --profile black ${s.join(" ")} && poetry run black ${s.join(" ")}`,i.scripts.lint=`poetry run flake8 ${s.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&&(a=a.filter(s=>!s.includes("@typescript-eslint/")),a=a.filter(s=>s!=="eslint-plugin-react"&&s!=="eslint-import-resolver-typescript"&&s!=="eslint-plugin-import"&&s!=="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 b.default.promises.writeFile(o,JSON.stringify(i)),t||(p=p.filter(s=>{var f,d;return!((f=i.dependencies)!=null&&f[s])&&!((d=i.devDependencies)!=null&&d[s])}),p.length&&v("yarn",["add",...new Set(p)],e.dirPath),a=a.filter(s=>{var f,d;return!((f=i.dependencies)!=null&&f[s])&&!((d=i.devDependencies)!=null&&d[s])}),a.length&&v("yarn",["add","-D",...new Set(a)],e.dirPath),m.length&&v("poetry",["add",...new Set(m)],e.dirPath))}async function _t(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(We))for(let t of n)delete e.devDependencies[t];await c.run(()=>b.default.promises.rm("lerna.json",{force:!0}))}async function Tt(e){let n=T.default.resolve(e,".prettierignore"),t=await b.default.promises.readFile(n,"utf-8"),o=t.indexOf(h.separatorPrefix);return o<0?"":t.substring(0,o).split(`
241
+ `).map(p=>{let a=p.trim();return a.endsWith("/")?a.slice(0,-1):a}).filter(p=>p&&!p.startsWith("#")&&!p.includes("/")).map(p=>` "!**/${p}/**"`).join("")}var pe=l(require("path"));var Rt=`${h.header}
242
242
 
243
243
 
244
- ${y.separator}
245
- `,Et=`
244
+ ${h.separator}
245
+ `,Ot=`
246
246
  3rd-party/
247
247
  android/
248
248
  ios/
@@ -252,9 +252,9 @@ test-fixtures/
252
252
  *.min.js
253
253
  .yarn/
254
254
  .pnp.js
255
- `;async function Me(e){let n=pe.default.resolve(e.dirPath,".prettierignore"),t=y.getUserContent(n)||Ot,o=pe.default.resolve(e.dirPath,".gitignore"),r=y.getExistingContent(o)||"",i="";e.containingPubspecYaml&&(i=`
255
+ `;async function ze(e){let n=pe.default.resolve(e.dirPath,".prettierignore"),t=h.getUserContent(n)||Rt,o=pe.default.resolve(e.dirPath,".gitignore"),r=h.getExistingContent(o)||"",i="";e.containingPubspecYaml&&(i=`
256
256
  android/app/
257
257
  ios/Runner/Assets.xcassets/
258
258
  pubspec.yaml
259
- `);let c=t+Et+i+r;await p.run(()=>u.generateFile(n,c))}var Ue=l(require("fs")),Le=l(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 p.run(()=>u.generateFile(n,r))}catch{}}var q=l(require("fs")),K=l(require("path")),Ye=l(require("deepmerge")),Ae=l(require("lodash.clonedeep"));var Dt={extends:["@willbooster"]};async function He(e){let n=(0,Ae.default)(Dt),t=K.default.resolve(e.dirPath,".renovaterc.json");try{let r=await q.default.promises.readFile(t,"utf-8"),i=JSON.parse(r);n=Ye.default.all([n,i,n],{arrayMerge:M})}catch{}await p.run(()=>q.default.promises.rm(K.default.resolve(e.dirPath,".dependabot"),{force:!0})),await p.run(()=>q.default.promises.rm(K.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let o=JSON.stringify(n);await p.run(()=>u.generateFile(t,o))}var qe=l(require("fs")),ce=l(require("path")),Ke=l(require("js-yaml"));var Jt={titleOnly:!0};async function Ve(e){let n=ce.default.resolve(e.dirPath,".github");await qe.default.promises.mkdir(n,{recursive:!0});let t=ce.default.join(n,"semantic.yml"),o=Ke.default.dump(Jt);await p.run(()=>u.generateFile(t,o))}var Xe=l(require("fs")),I=l(require("path")),Ze=l(require("deepmerge")),Qe=l(require("lodash.clonedeep"));function J(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 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__/**/*","packages/*/src/**/*","packages/*/__tests__/**/*","./node_modules/@types","./@types"]},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__/**/*","../../node_modules/@types","../../@types","./@types"]};async function et(e,n){var i,c,a;if(n.depending.blitz)return;let t=(0,Qe.default)(e.root?It:Nt);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=I.default.relative(e.dirPath,n.dirPath);t.include.push(I.default.join(m,"node_modules/jest-playwright-preset/types"),I.default.join(m,"node_modules/expect-playwright"))}let o=I.default.resolve(e.dirPath,"tsconfig.json");try{let m=await Xe.default.promises.readFile(o,"utf-8"),s=JSON.parse(m);s.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete s.extends,(i=s.compilerOptions)==null||delete i.typeRoots,(c=t==null?void 0:t.compilerOptions)==null||delete c.target,(a=t==null?void 0:t.compilerOptions)==null||delete a.module,s.jsx&&delete t.jsx,e.depending.blitz||delete t.include,t=Ze.default.all([t,s,t],{arrayMerge:M})}catch{}J(t.compilerOptions);let r=JSON.stringify(t);await p.run(()=>u.generateFile(o,r))}var _=l(require("fs")),O=l(require("path")),tt=l(require("deepmerge")),ue=l(require("js-yaml")),nt=l(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"}}},zt={name:"Willboosterify",on:{schedule:[{cron:"0 20 * * *"}],workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}};async function it(e){let n=O.default.resolve(e.dirPath,".github","workflows");await _.default.promises.mkdir(n,{recursive:!0}),e.depending.semanticRelease&&await p.run(async()=>{let t=await me(e,n,"release");await _.default.promises.writeFile(O.default.join(n,"release.yml"),t)}),await p.run(async()=>{let t=await me(e,n,"test");await _.default.promises.writeFile(O.default.join(n,"test.yml"),t)}),await p.run(async()=>{let t=await me(e,n,"wbfy");await _.default.promises.writeFile(O.default.join(n,"wbfy.yml"),t)})}async function me(e,n,t){var c;let o=(0,nt.default)(t==="test"?Wt:t==="release"?Bt:zt);t==="release"&&(o.on.push.branches=e.release.branches);let r=o.jobs.test||o.jobs.release||o.jobs.wbfy;r.with||(r.with={}),r.secrets||(r.secrets={}),(c=e.repository)!=null&&c.startsWith("github:WillBoosterLab/")&&(r.uses=r.uses.replace("WillBooster/","WillBoosterLab/")),e.containingDockerfile&&(r.with.cpu_arch="X64"),(e.release.github||t==="wbfy")&&(e.publicRepo?r.secrets.GH_TOKEN="${{ secrets.PUBLIC_GH_BOT_PAT }}":r.secrets.GH_TOKEN="${{ secrets.GH_BOT_PAT }}"),e.release.npm&&t!=="wbfy"&&(r.secrets.NPM_TOKEN="${{ secrets.NPM_TOKEN }}");let i=O.default.join(n,`${t}.yml`);try{let a=await _.default.promises.readFile(i,"utf-8"),m=ue.default.load(a);o=tt.default.all([o,m,o],{arrayMerge:U})}catch{}return r=o.jobs.test||o.jobs.release||o.jobs.wbfy,delete r.with.non_self_hosted,Object.keys(r.with).length?J(r.with):delete r.with,Object.keys(r.secrets).length?J(r.secrets):delete r.secrets,t==="release"&&o.on.schedule&&delete o.on.push,t==="release"&&await p.run(()=>_.default.promises.rm("semantic-release.yml",{force:!0})),ue.default.dump(o,{styles:{"!!null":"empty"},noCompatMode:!0})}var T=l(require("fs")),E=l(require("path")),fe=l(require("js-yaml"));async function rt(e){let n=te("yarn",["--version"],e.dirPath),t=te("npm",["show","@yarnpkg/cli","version"],e.dirPath);n!==t&&P("yarn",["set","version",t],e.dirPath,1);let o=E.default.join(e.dirPath,".yarn","releases");await T.default.promises.mkdir(o,{recursive:!0});for(let s of await T.default.promises.readdir(o))s.startsWith("yarn-")&&!s.startsWith(`yarn-${t}.`)&&(await p.run(()=>T.default.promises.rm(E.default.join(o,s))),console.log("Removed",E.default.join(o,s)));let r=E.default.resolve(e.dirPath,".yarnrc");await p.run(()=>T.default.promises.rm(r,{force:!0}));let i=E.default.resolve(e.dirPath,".yarnrc.yml"),c=fe.default.load(await T.default.promises.readFile(i,"utf8"));c.defaultSemverRangePrefix="",e.requiringNodeModules&&(c.nodeLinker="node-modules",c.nmMode="hardlinks-global"),await T.default.promises.writeFile(i,fe.default.dump(c));let a=(c.plugins||[]).map(s=>s.spec),m=e.containingTypeScript||e.containingTypeScriptInPackages;ot(e,a,m,"@yarnpkg/plugin-typescript"),m&&!e.requiringNodeModules&&P("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),ot(e,a,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),P("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)}function ot(e,n,t,o){t!==n.includes(o)&&P("yarn",["plugin",t?"import":"remove",o],e.dirPath)}var v=l(require("fs")),V=l(require("fs/promises")),d=l(require("path")),j=l(require("glob")),at=l(require("js-yaml")),lt=l(require("simple-git"));async function de(e){var t;let n=d.default.resolve(e,"package.json");try{let o=v.default.existsSync(n),r={},i={},c={};if(o){let S=v.default.readFileSync(n,"utf-8");c=JSON.parse(S),r=c.dependencies??{},i=c.devDependencies??{}}let a=!0;try{let S=d.default.resolve(e,".yarnrc.yml"),w=at.default.load(await V.default.readFile(S,"utf8"));a=!w.nodeLinker||w.nodeLinker==="node-modules"}catch{}let m=[],s=[];try{let S=d.default.resolve(e,".releaserc.json"),w=JSON.parse(await V.default.readFile(S,"utf8"));m=(w==null?void 0:w.branches)||[],s=((t=w==null?void 0:w.plugins)==null?void 0:t.flat())||[]}catch{}let f=d.default.basename(d.default.resolve(e,".."))!=="packages"||!v.default.existsSync(d.default.resolve(e,"..","..","package.json")),h;f&&(h=await Ut(e,c));let D=d.default.resolve(e,".tool-versions"),ge;try{ge=await V.default.readFile(D,"utf-8")}catch{}let k={dirPath:e,root:f,publicRepo:(h==null?void 0:h.private)===!1,repository:h!=null&&h.full_name?`github:${h==null?void 0:h.full_name}`:void 0,willBoosterConfigs:n.includes(`${d.default.sep}willbooster-configs`),containingSubPackageJsons:j.default.sync("packages/**/package.json",{cwd:e}).length>0,containingDockerfile:v.default.existsSync(d.default.resolve(e,"Dockerfile"))||v.default.existsSync(d.default.resolve(e,"docker-compose.yml")),containingGemfile:v.default.existsSync(d.default.resolve(e,"Gemfile")),containingGoMod:v.default.existsSync(d.default.resolve(e,"go.mod")),containingPackageJson:v.default.existsSync(d.default.resolve(e,"package.json")),containingPoetryLock:v.default.existsSync(d.default.resolve(e,"poetry.lock")),containingPomXml:v.default.existsSync(d.default.resolve(e,"pom.xml")),containingPubspecYaml:v.default.existsSync(d.default.resolve(e,"pubspec.yaml")),containingTemplateYaml:v.default.existsSync(d.default.resolve(e,"template.yaml")),containingJavaScript:j.default.sync("@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:j.default.sync("@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:j.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:j.default.sync("packages/**/@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:j.default.sync("packages/**/@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:j.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:s.includes("@semantic-release/github"),npm:s.includes("@semantic-release/npm")},requiringNodeModules:a,versionsText:ge};if(k.eslintBase=Mt(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function Mt(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 Ut(e,n){var a,m,s;let t=((a=n.repository)==null?void 0:a.url)??n.repository;if(typeof t=="string"){let f=await st(t);if(f&&f.message!=="Not Found")return f}let i=(await(0,lt.default)(e).getRemotes(!0)).find(f=>f.name==="origin"),c=((m=i==null?void 0:i.refs)==null?void 0:m.fetch)??((s=i==null?void 0:i.refs)==null?void 0:s.push);if(typeof c=="string"){let f=await st(c);if(f)return f}}async function st(e){var s;let n=e.split(":").at(-1),t=n==null?void 0:n.split("/"),o=t==null?void 0:t.at(-2),r=(s=t==null?void 0:t.at(-1))==null?void 0:s.replace(/.git$/,"");if(!o||!r)return;let i=process.env.GH_TOKEN||process.env.GITHUB_TOKEN,c=i?{headers:{Authorization:`token ${i}`}}:void 0,m=await(await L(`https://api.github.com/repos/${o}/${r}`,c)).json();return F({full_name:`${o}/${r}`},m??{})}async function Lt(){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 de(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=>de(s)))).filter(s=>!!s),i=[t,...r],c=[t,...r.filter(s=>s.containingPackageJson)];if(e.verbose)for(let s of i)console.log(s);let a=i.map(s=>Oe(s,t));await rt(t),a.push(xe(t),Re(t),De(t),Je(t),se(t),He(t),Ge(t),Ve(t),ke(t),it(t)),await Promise.all(a),await p.promiseAll();let m=[];for(let s of c)m.push(Me(s),se(s)),(s.containingTypeScript||s.containingTypeScriptInPackages)&&m.push(et(s,t)),(s.containingJavaScript||s.containingJavaScriptInPackages||s.containingTypeScript||s.containingTypeScriptInPackages)&&(t.willBoosterConfigs||m.push(_e(s,t)),m.push(Se(s)));await Promise.all(m),await p.promiseAll();for(let s of c)await ze(s,t,e.skipDeps);P("yarn",["cleanup"],n),P("yarn",["install"],n)}}Lt().then();
259
+ `);let p=t+Ot+i+r;await c.run(()=>u.generateFile(n,p))}var Me=l(require("fs")),Ue=l(require("path"));async function Le(e){let n=Ue.default.resolve(e.dirPath,".releaserc.json");try{let t=JSON.parse(await Me.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(()=>u.generateFile(n,r))}catch{}}var H=l(require("fs")),q=l(require("path")),Ge=l(require("deepmerge")),Ye=l(require("lodash.clonedeep"));var Dt={extends:["@willbooster"]};async function Ae(e){let n=(0,Ye.default)(Dt),t=q.default.resolve(e.dirPath,".renovaterc.json");try{let r=await H.default.promises.readFile(t,"utf-8"),i=JSON.parse(r);n=Ge.default.all([n,i,n],{arrayMerge:z})}catch{}await c.run(()=>H.default.promises.rm(q.default.resolve(e.dirPath,".dependabot"),{force:!0})),await c.run(()=>H.default.promises.rm(q.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let o=JSON.stringify(n);await c.run(()=>u.generateFile(t,o))}var He=l(require("fs")),ce=l(require("path")),qe=l(require("js-yaml"));var Et={titleOnly:!0};async function Ke(e){let n=ce.default.resolve(e.dirPath,".github");await He.default.promises.mkdir(n,{recursive:!0});let t=ce.default.join(n,"semantic.yml"),o=qe.default.dump(Et,{lineWidth:-1});await c.run(()=>u.generateFile(t,o))}var Ve=l(require("fs")),J=l(require("path")),Xe=l(require("deepmerge")),Ze=l(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 Jt={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"]},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__/**/*","../../node_modules/@types","../../@types","./@types"]};async function Qe(e,n){var i,p,a;if(n.depending.blitz)return;let t=(0,Ze.default)(e.root?Jt:Nt);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 Ve.default.promises.readFile(o,"utf-8"),s=JSON.parse(m);s.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete s.extends,(i=s.compilerOptions)==null||delete i.typeRoots,(p=t==null?void 0:t.compilerOptions)==null||delete p.target,(a=t==null?void 0:t.compilerOptions)==null||delete a.module,s.jsx&&delete t.jsx,e.depending.blitz||delete t.include,t=Xe.default.all([t,s,t],{arrayMerge:z})}catch{}E(t.compilerOptions);let r=JSON.stringify(t);await c.run(()=>u.generateFile(o,r))}var R=l(require("fs")),K=l(require("path")),et=l(require("deepmerge")),me=l(require("js-yaml")),tt=l(require("lodash.clonedeep"));var It={name:"Test",on:{pull_request:{branches:["main","!renovate/**"]},push:{branches:["main","renovate/**"]}},jobs:{test:{uses:"WillBooster/reusable-workflows/.github/workflows/test.yml@main"}}},Wt={name:"Release",on:{push:{branches:[]}},jobs:{release:{uses:"WillBooster/reusable-workflows/.github/workflows/release.yml@main"}}},Bt={name:"Willboosterify",on:{schedule:[{cron:"0 20 * * *"}],workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}};async function nt(e){let n=K.default.resolve(e.dirPath,".github","workflows");await R.default.promises.mkdir(n,{recursive:!0});let t=(await R.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=K.default.basename(o,".yml");await c.run(()=>zt(e,n,r))}}async function zt(e,n,t){var p,a;let o={};t==="test"?o=It:t==="release"?o=Wt:t==="wbfy"&&(o=Bt),o=(0,tt.default)(o);let r=K.default.join(n,`${t}.yml`);try{let m=await R.default.promises.readFile(r,"utf-8"),s=me.default.load(m);o=et.default.all([o,s,o],{arrayMerge:M})}catch{}t==="release"&&(o.on.schedule?delete o.on.push:o.on.push.branches=e.release.branches);for(let m of Object.values(o.jobs)){if(!((a=(p=m.uses)==null?void 0:p.includes)!=null&&a.call(p,"/reusable-workflows/")))break;Mt(e,m,t)}t==="release"&&await c.run(()=>R.default.promises.rm("semantic-release.yml",{force:!0}));let i=me.default.dump(o,{lineWidth:-1,noCompatMode:!0,styles:{"!!null":"empty"}});await R.default.promises.writeFile(r,i)}function Mt(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 _=l(require("fs")),O=l(require("path")),fe=l(require("js-yaml"));async function ot(e){let n=te("yarn",["--version"],e.dirPath),t=te("npm",["show","@yarnpkg/cli","version"],e.dirPath);n!==t&&v("yarn",["set","version",t],e.dirPath,1);let o=O.default.join(e.dirPath,".yarn","releases");await _.default.promises.mkdir(o,{recursive:!0});for(let s of await _.default.promises.readdir(o))s.startsWith("yarn-")&&!s.startsWith(`yarn-${t}.`)&&(await c.run(()=>_.default.promises.rm(O.default.join(o,s))),console.log("Removed",O.default.join(o,s)));let r=O.default.resolve(e.dirPath,".yarnrc");await c.run(()=>_.default.promises.rm(r,{force:!0}));let i=O.default.resolve(e.dirPath,".yarnrc.yml"),p=fe.default.load(await _.default.promises.readFile(i,"utf8"));p.defaultSemverRangePrefix="",e.requiringNodeModules&&(p.nodeLinker="node-modules",p.nmMode="hardlinks-global"),await _.default.promises.writeFile(i,fe.default.dump(p));let a=(p.plugins||[]).map(s=>s.spec),m=e.containingTypeScript||e.containingTypeScriptInPackages;it(e,a,m,"@yarnpkg/plugin-typescript"),m&&!e.requiringNodeModules&&v("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),it(e,a,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),v("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)}function it(e,n,t,o){t!==n.includes(o)&&v("yarn",["plugin",t?"import":"remove",o],e.dirPath)}var P=l(require("fs")),V=l(require("fs/promises")),g=l(require("path")),C=l(require("glob")),st=l(require("js-yaml")),at=l(require("simple-git"));async function ue(e){var t;let n=g.default.resolve(e,"package.json");try{let o=P.default.existsSync(n),r={},i={},p={};if(o){let S=P.default.readFileSync(n,"utf-8");p=JSON.parse(S),r=p.dependencies??{},i=p.devDependencies??{}}let a=!0;try{let S=g.default.resolve(e,".yarnrc.yml"),w=st.default.load(await V.default.readFile(S,"utf8"));a=!w.nodeLinker||w.nodeLinker==="node-modules"}catch{}let m=[],s=[];try{let S=g.default.resolve(e,".releaserc.json"),w=JSON.parse(await V.default.readFile(S,"utf8"));m=(w==null?void 0:w.branches)||[],s=((t=w==null?void 0:w.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")),d;f&&(d=await Lt(e,p));let D=g.default.resolve(e,".tool-versions"),de;try{de=await V.default.readFile(D,"utf-8")}catch{}let k={dirPath:e,root:f,publicRepo:(d==null?void 0:d.private)===!1,repository:d!=null&&d.full_name?`github:${d==null?void 0:d.full_name}`:void 0,willBoosterConfigs:n.includes(`${g.default.sep}willbooster-configs`),containingSubPackageJsons:C.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:C.default.sync("@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:C.default.sync("@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:C.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:C.default.sync("packages/**/@(app|src|__tests__)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:C.default.sync("packages/**/@(app|src|__tests__)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:C.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:s.includes("@semantic-release/github"),npm:s.includes("@semantic-release/npm")},requiringNodeModules:a,versionsText:de};if(k.eslintBase=Ut(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function Ut(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 Lt(e,n){var a,m,s;let r=(await(0,at.default)(e).getRemotes(!0)).find(f=>f.name==="origin"),i=((a=r==null?void 0:r.refs)==null?void 0:a.fetch)??((m=r==null?void 0:r.refs)==null?void 0:m.push);if(typeof i=="string"){let f=await rt(i);if(f)return f}let p=((s=n.repository)==null?void 0:s.url)??n.repository;if(typeof p=="string"){let f=await rt(p);if(f&&f.message!=="Not Found")return f}}async function rt(e){var s;let n=e.split(":").at(-1),t=n==null?void 0:n.split("/"),o=t==null?void 0:t.at(-2),r=(s=t==null?void 0:t.at(-1))==null?void 0:s.replace(/.git$/,"");if(!o||!r)return;let i=process.env.GH_TOKEN||process.env.GITHUB_TOKEN,p=i?{headers:{Authorization:`token ${i}`}}:void 0,m=await(await U(`https://api.github.com/repos/${o}/${r}`,p)).json();return F({full_name:`${o}/${r}`},m??{})}async function Gt(){let e=await(0,ct.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 ue(n);if(t===null){console.error(`there is no valid package.json in ${n}`);continue}let o=t.containingSubPackageJsons?pt.default.sync("packages/*",{cwd:n}).map(s=>lt.default.resolve(n,s)):[],r=(await Promise.all(o.map(s=>ue(s)))).filter(s=>!!s),i=[t,...r],p=[t,...r.filter(s=>s.containingPackageJson)];if(e.verbose)for(let s of i)console.log(s);let a=i.map(s=>Re(s,t));await ot(t),a.push(xe(t),Te(t),De(t),Ee(t),se(t),Ae(t),Le(t),Ke(t),Pe(t),nt(t)),await Promise.all(a),await c.promiseAll();let m=[];for(let s of p)m.push(ze(s),se(s)),(s.containingTypeScript||s.containingTypeScriptInPackages)&&m.push(Qe(s,t)),(s.containingJavaScript||s.containingJavaScriptInPackages||s.containingTypeScript||s.containingTypeScriptInPackages)&&(t.willBoosterConfigs||m.push(je(s,t)),m.push(be(s)));await Promise.all(m),await c.promiseAll();for(let s of p)await Be(s,t,e.skipDeps);v("yarn",["cleanup"],n),v("yarn",["install"],n)}}Gt().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 const allNodePackageConfigs = [rootConfig, ...subPackageConfigs.filter((config) => config.containingPackageJson)];\n\n if (argv.verbose) {\n for (const config of allPackageConfigs) {\n console.log(config);\n }\n }\n\n const rootPromises = allPackageConfigs.map((config) => generateGitignore(config, rootConfig));\n // Install yarn berry at first\n await generateYarnrcYml(rootConfig);\n rootPromises.push(\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 Promise.all(rootPromises);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allNodePackageConfigs) {\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 for (const config of allNodePackageConfigs) {\n await generatePackageJson(config, rootConfig, argv.skipDeps);\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';\nimport { promisePool } from '../utils/promisePool';\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\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 await Promise.all(\n names.map(async (name) => {\n const response = await fetchOnNode(`https://www.toptal.com/developers/gitignore/api/${name}`);\n return await response.text();\n })\n )\n ).join('');\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 promisePool.run(() => 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 if (dependencies.length && dependencies.some((dep) => !jsonObj.dependencies?.[dep])) {\n spawnSync('yarn', ['add', ...new Set(dependencies)], config.dirPath);\n }\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 schedule: [\n {\n cron: '0 20 * * *',\n },\n ],\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 if (rootConfig.depending.semanticRelease) {\n await promisePool.run(async () => {\n const yml = await getWorkflowYaml(rootConfig, workflowsPath, 'release');\n await fs.promises.writeFile(path.join(workflowsPath, 'release.yml'), yml);\n });\n }\n await promisePool.run(async () => {\n const yml = await getWorkflowYaml(rootConfig, workflowsPath, 'test');\n await fs.promises.writeFile(path.join(workflowsPath, 'test.yml'), yml);\n });\n await promisePool.run(async () => {\n const yml = await getWorkflowYaml(rootConfig, workflowsPath, 'wbfy');\n await fs.promises.writeFile(path.join(workflowsPath, 'wbfy.yml'), yml);\n });\n}\n\nasync function getWorkflowYaml(\n config: PackageConfig,\n workflowsPath: string,\n kind: 'test' | 'release' | 'wbfy'\n): Promise<string> {\n let newSettings = cloneDeep(\n kind === 'test' ? testWorkflow : kind === 'release' ? releaseWorkflow : wbfyWorkflow\n ) as any;\n if (kind === 'release') {\n newSettings.on.push.branches = config.release.branches;\n }\n let job = newSettings.jobs.test || newSettings.jobs.release || newSettings.jobs.wbfy;\n job.with ||= {};\n job.secrets ||= {};\n 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 if (config.release.github || 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 !== 'wbfy') {\n job.secrets['NPM_TOKEN'] = '${{ secrets.NPM_TOKEN }}';\n }\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 job = newSettings.jobs.test || newSettings.jobs.release || newSettings.jobs.wbfy;\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 if (Object.keys(job.secrets).length) {\n sortKeys(job.secrets);\n } else {\n delete job.secrets;\n }\n if (kind === 'release' && newSettings.on.schedule) delete newSettings.on.push;\n if (kind === 'release') {\n await promisePool.run(() => fs.promises.rm('semantic-release.yml', { force: true }));\n }\n\n return yaml.dump(newSettings, {\n styles: {\n '!!null': 'empty',\n },\n noCompatMode: true,\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));\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 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 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\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,CAAK,GAElC,EAAO,UAAU,UACnB,EAAW,8BAA+B,EAAG,CAAK,EAEhD,EAAO,uBACT,EAAW,eAAgB,EAAM,OAAQ,CAAK,EAGhD,GAAM,GAAmB,UAAK,QAAQ,EAAO,QAAS,gBAAgB,EAC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AW,EAE7B,OAAW,KAAU,GACnB,KAAM,IAAoB,EAAQ,EAAY,EAAK,QAAQ,EAE7D,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 const allNodePackageConfigs = [rootConfig, ...subPackageConfigs.filter((config) => config.containingPackageJson)];\n\n if (argv.verbose) {\n for (const config of allPackageConfigs) {\n console.log(config);\n }\n }\n\n const rootPromises = allPackageConfigs.map((config) => generateGitignore(config, rootConfig));\n // Install yarn berry at first\n await generateYarnrcYml(rootConfig);\n rootPromises.push(\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 Promise.all(rootPromises);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allNodePackageConfigs) {\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 for (const config of allNodePackageConfigs) {\n await generatePackageJson(config, rootConfig, argv.skipDeps);\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';\nimport { promisePool } from '../utils/promisePool';\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\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 await Promise.all(\n names.map(async (name) => {\n const response = await fetchOnNode(`https://www.toptal.com/developers/gitignore/api/${name}`);\n return await response.text();\n })\n )\n ).join('');\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 promisePool.run(() => 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, { lineWidth: -1 });\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 schedule: [\n {\n cron: '0 20 * * *',\n },\n ],\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 }\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));\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,CAAK,GAElC,EAAO,UAAU,UACnB,EAAW,8BAA+B,EAAG,CAAK,EAEhD,EAAO,uBACT,EAAW,eAAgB,EAAM,OAAQ,CAAK,EAGhD,GAAM,GAAmB,UAAK,QAAQ,EAAO,QAAS,gBAAgB,EACtE,AAAI,EAAM,OACR,KAAM,GAAY,IAAI,IAAM,UAAG,SAAS,UAAU,EAAkB,EAAM,KAAK;AAAA,CAAI,EAAI;AAAA,CAAI,CAAC,EAE5F,KAAM,GAAY,IAAI,IAAM,UAAG,SAAS,GAAG,EAAkB,CAAE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C,EAAS,KAAK,GAAiB,EAAQ,CAAU,CAAC,EAGlD,GAAO,sBACP,EAAO,gCACP,EAAO,sBACP,EAAO,iCAEF,GAAW,oBACd,EAAS,KAAK,GAAiB,EAAQ,CAAU,CAAC,EAEpD,EAAS,KAAK,GAAqB,CAAM,CAAC,GAG9C,KAAM,SAAQ,IAAI,CAAQ,EAC1B,KAAM,GAAY,WAAW,EAE7B,OAAW,KAAU,GACnB,KAAM,IAAoB,EAAQ,EAAY,EAAK,QAAQ,EAE7D,EAAU,OAAQ,CAAC,SAAS,EAAG,CAAW,EAG1C,EAAU,OAAQ,CAAC,SAAS,EAAG,CAAW,CAC5C,CACF,CAEA,GAAK,EAAE,KAAK",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wbfy",
3
- "version": "1.19.0",
3
+ "version": "1.21.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",