wbfy 1.43.1 → 1.44.0
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.
- package/dist/index.min.cjs +38 -34
- package/dist/index.min.cjs.map +3 -3
- package/package.json +14 -14
package/dist/index.min.cjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
"use strict";var
|
2
|
-
${a}`),s.stdout.toString().trim()}function
|
3
|
-
`)){let o
|
1
|
+
"use strict";var Rt=Object.create;var Ce=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty;var Et=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Tt(t))!Dt.call(e,r)&&r!==n&&Ce(e,r,{get:()=>t[r],enumerable:!(o=jt(t,r))||o.enumerable});return e};var l=(e,t,n)=>(n=e!=null?Rt(Ot(e)):{},Et(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e));var Ct=l(require("path")),Ft=l(require("glob")),$t=l(require("yargs"));var q=l(require("fs")),pe=l(require("path"));var ae=class{constructor(){this.isVerbose=!1}},C=new ae;var le=class{async function(t,n){C.isVerbose&&console.info(`--------- ${t} start ---------`),await n(),C.isVerbose&&console.info(`---------- ${t} end ----------`)}},f=new le;var Fe=require("minimal-promise-pool"),c=new Fe.PromisePool;var ce=l(require("child_process"));function w(e,t,n,o=0){do{let[r,i,s]=$e(e,t,n);if(console.log(`$ ${r} ${i.join(" ")} at ${s.cwd}`),ce.default.spawnSync(r,i,s).status===0)break}while(--o>=0)}function B(e,t,n){let[o,r,i]=$e(e,t,n);i.stdio="pipe";let s=ce.default.spawnSync(o,r,i),a=s.stderr.toString().trim();return a&&console.error(`${o} [${r.map(u=>`"${u}"`)}] caused the following error:
|
2
|
+
${a}`),s.stdout.toString().trim()}function $e(e,t,n){let o={...process.env};return o.PATH&&o.BERRY_BIN_FOLDER&&(o.PATH=o.PATH.replace(`${o.BERRY_BIN_FOLDER}:`,"")),o.ASDF_DIR&&(t=["-l","-c",`. ${o.ASDF_DIR}/asdf.sh && ${e} ${t.join(" ")}`],e="bash"),[e,t,{cwd:n,env:o,shell:!1,stdio:"inherit"}]}async function Re(e){return f.function("generateVersionConfigs",async()=>{await Jt(e)})}async function Jt(e){if(!e.versionsText)return;let t=[];for(let o of e.versionsText.trim().split(`
|
3
|
+
`)){let r=o.trim();if(r&&r.split(/\s+/)[0]!=="nodejs"){t.push(r);continue}let[,i]=r.split(/\s+/);await c.run(()=>q.default.promises.writeFile(pe.default.resolve(e.dirPath,".node-version"),i))}if(e.containingPoetryLock&&(Y("poetry 1.1.13",0,t),Y("python 3.9.13",0,t)),e.depending.firebase&&Y("java adoptopenjdk-17.0.2+8",0,t),e.containingPackageJson){let o=B("npm",["show","yarn","version"],e.dirPath);Y(`yarn ${o}`,t.length,t)}let n=pe.default.resolve(e.dirPath,".tool-versions");t.length?await c.run(()=>q.default.promises.writeFile(n,t.join(`
|
4
4
|
`)+`
|
5
|
-
`)):await c.run(()=>
|
5
|
+
`)):await c.run(()=>q.default.promises.rm(n,{force:!0})),await c.promiseAll(),w("asdf",["install"],e.dirPath)}function Y(e,t,n){let[o]=e.split(" "),r=n.findIndex(i=>i.split(/\s+/)[0]===o);r>=0?n[r]=e:n.splice(t,0,e)}var Te=l(require("path"));var P={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 je=l(require("fs/promises")),d={async generateFile(e,t){await je.default.writeFile(e,t),console.log(`Generated ${e}`)}};var Wt=`root = true
|
6
6
|
|
7
7
|
[*]
|
8
8
|
charset = utf-8
|
@@ -10,33 +10,33 @@ end_of_line = lf
|
|
10
10
|
insert_final_newline = true
|
11
11
|
trim_trailing_whitespace = true
|
12
12
|
|
13
|
-
${
|
13
|
+
${K(P.codeWith2IndentSize)}
|
14
14
|
indent_size = 2
|
15
15
|
indent_style = space
|
16
16
|
|
17
|
-
${
|
17
|
+
${K(P.codeWith4IndentSize)}
|
18
18
|
indent_size = 4
|
19
19
|
indent_style = space
|
20
20
|
|
21
|
-
${
|
21
|
+
${K(P.codeWith8IndentSize)}
|
22
22
|
indent_size = 8
|
23
23
|
indent_style = space
|
24
24
|
|
25
|
-
${
|
25
|
+
${K(P.markdownLike)}
|
26
26
|
max_line_length = off
|
27
27
|
trim_trailing_whitespace = false
|
28
28
|
|
29
29
|
[{Makefile,*.mk}]
|
30
30
|
indent_style = tab
|
31
|
-
`;async function
|
31
|
+
`;async function Oe(e){return f.function("generateEditorconfig",async()=>{let t=Te.default.resolve(e.dirPath,".editorconfig");await c.run(()=>d.generateFile(t,Wt))})}function K(e){return e.length>1?`[*.{${e.join(",")}}]`:`[*.${e[0]}]`}var me=l(require("path"));var H=l(require("fs")),h={header:"# Project-specific settings",separator:"# Generated by @willbooster/willboosterify",separatorPrefix:"# Generated by @willbooster",async getExistingContent(e){try{return(await H.default.promises.readFile(e,"utf-8")).replace(/# Project-specific settings[^\n]*\n/m,"").replace(/# Generated by[^\n]*\n/m,"").replace(/\r?\n\r?\n(\r?\n)+/gm,`
|
32
32
|
|
33
|
-
`)}catch{return null}},async getUserContent(e){try{let t=await
|
34
|
-
`,n)+1)}catch{}return null},async isBerryZeroInstallEnabled(e){try{return(await
|
35
|
-
!.yarn/cache`)}catch{return!1}}};var
|
33
|
+
`)}catch{return null}},async getUserContent(e){try{let t=await H.default.promises.readFile(e,"utf-8"),n=t.indexOf(this.separatorPrefix);if(n>=0)return t.substring(0,t.indexOf(`
|
34
|
+
`,n)+1)}catch{}return null},async isBerryZeroInstallEnabled(e){try{return(await H.default.promises.readFile(e,"utf-8")).includes(`
|
35
|
+
!.yarn/cache`)}catch{return!1}}};var Nt=`${h.header}
|
36
36
|
|
37
37
|
|
38
38
|
${h.separator}
|
39
|
-
`,
|
39
|
+
`,It=`
|
40
40
|
3rd-party/
|
41
41
|
@types/
|
42
42
|
__generated__/
|
@@ -49,39 +49,39 @@ test-fixtures/
|
|
49
49
|
*.min.js
|
50
50
|
.yarn/
|
51
51
|
.pnp.js
|
52
|
-
`;async function
|
52
|
+
`;async function De(e){return f.function("generateEslintignore",async()=>{let t=me.default.resolve(e.dirPath,".eslintignore"),n=await h.getUserContent(t)||Nt,o=me.default.resolve(e.dirPath,".gitignore"),r=await h.getExistingContent(o)||"",i=n+It+r;await c.run(()=>d.generateFile(t,i))})}var Je=l(require("fs")),We=l(require("path")),Ne=l(require("deepmerge"));var Ee=l(require("deepmerge"));function V(e,t){return t}function X(e,t,n){let o=e.slice();return t.forEach((r,i)=>{typeof o[i]>"u"?o[i]=n.cloneUnlessOtherwiseSpecified(r,n):n.isMergeableObject(r)?o[i]=(0,Ee.default)(e[i],r,n):e.indexOf(r)===-1&&o.push(r)}),o}async function Ie(e,t){return f.function("generateEslintrc",async()=>{let n=[];e.eslintBase&&n.push(e.eslintBase),e!==t&&n.push("../../.eslintrc.json");let o={root:!0,extends:n},r=We.default.resolve(e.dirPath,".eslintrc.json");try{let s=await Je.default.promises.readFile(r,"utf-8"),a=JSON.parse(s);a.extends&&(a.extends=a.extends.filter(m=>!m.startsWith("@willbooster/")&&m!=="../../.eslintrc.json")),n.length||(a.extends=[]);let u=o.extends;o.extends=a.extends,a.extends=u,o=Ne.default.all([o,a,o],{arrayMerge:X}),e.depending.blitz&&(o.extends=[...o.extends.filter(m=>m!=="blitz"),"blitz"])}catch{}let i=JSON.stringify(o);await c.run(()=>d.generateFile(r,i))})}var Be=l(require("path"));var Bt=`* text=auto
|
53
53
|
|
54
54
|
*.vcproj text eol=crlf
|
55
55
|
|
56
56
|
${P.codeWith2IndentSize.concat(P.codeWith4IndentSize).concat(P.markdownLike).map(e=>`*.${e} text eol=lf`).join(`
|
57
57
|
`)}
|
58
|
-
`;async function
|
58
|
+
`;async function Le(e){return f.function("generateGitattributes",async()=>{let t=Be.default.resolve(e.dirPath,".gitattributes");await c.run(()=>d.generateFile(t,Bt))})}var L=l(require("fs")),ze=l(require("os")),O=l(require("path"));async function Ue(e,t){let{default:n}=await import("node-fetch");return n(e,t)}var Lt=["windows","macos","linux","jetbrains","visualstudiocode","emacs","vim","yarn"],Ut=`${h.header}
|
59
59
|
|
60
60
|
|
61
61
|
${h.separator}
|
62
|
-
`,
|
62
|
+
`,zt=`
|
63
63
|
.devcontainer/
|
64
64
|
dist/
|
65
65
|
temp/
|
66
66
|
Icon[\r]
|
67
67
|
*.sqlite3
|
68
68
|
*.sqlite3-journal
|
69
|
-
`;async function
|
70
|
-
`),e.containingPackageJson&&
|
71
|
-
`),e.containingPubspecYaml&&(
|
69
|
+
`;async function Ae(e,t){return f.function("generateGitignore",async()=>{let n=O.default.resolve(e.dirPath,".gitignore"),o=(await h.getUserContent(n)||Ut)+zt,r=[...Lt];e.containingGemfile&&r.push("ruby"),e.containingGoMod&&(r.push("go"),o+=`${O.default.basename(e.dirPath)}
|
70
|
+
`),e.containingPackageJson&&r.push("node"),e.containingPomXml&&(r.push("maven"),o+=`.idea/google-java-format.xml
|
71
|
+
`),e.containingPubspecYaml&&(r.push("flutter","AndroidStudio","ruby"),o+=`.flutter-plugins-dependencies
|
72
72
|
android/key.properties
|
73
73
|
ios/.bundle
|
74
74
|
.idea/runConfigurations.xml
|
75
|
-
`),e.containingTemplateYaml&&(
|
75
|
+
`),e.containingTemplateYaml&&(o+=`.aws-sam/
|
76
76
|
packaged.yaml
|
77
|
-
`),e.containingPoetryLock&&
|
77
|
+
`),e.containingPoetryLock&&r.push("python"),(t.depending.firebase||e.depending.firebase)&&r.push("firebase"),(t.depending.reactNative||e.depending.reactNative)&&(r.push("reactnative"),o+=`google-services.json
|
78
78
|
android/app/src/main/assets/
|
79
|
-
`),t.depending.storybook&&
|
79
|
+
`),t.depending.storybook&&r.push("storybookjs"),t.depending.blitz&&(r.push("nextjs"),o+=`.blitz/
|
80
80
|
.blitz**
|
81
|
-
`);let i="";for(let a of
|
81
|
+
`);let i="";for(let a of r){let u=await Gt(a)??"";if(!u){let m=`https://www.toptal.com/developers/gitignore/api/${a}`,g=await(await Ue(m)).text();if(g.includes("Attention Required!")){console.error(`Failed to fetch ${m}`);return}u=g.trim(),await c.run(()=>At(a,u)),C.isVerbose&&console.info(`Fetched ${m}`)}i&&(i+=`
|
82
82
|
`),i+=u+`
|
83
83
|
`}await h.isBerryZeroInstallEnabled(n)||(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"),(t.depending.reactNative||e.depending.reactNative||e.containingPubspecYaml)&&(i=i.replace(/^(.idea\/.+)$/gm,`$1
|
84
|
-
android/$1`));let s=
|
84
|
+
android/$1`));let s=o+i;await c.run(()=>d.generateFile(n,s))})}var Z=O.default.join(ze.default.homedir(),".cache","wbfy","gitignore");async function At(e,t){await L.default.promises.mkdir(Z,{recursive:!0}),await L.default.promises.writeFile(O.default.join(Z,e),t)}async function Gt(e){try{let t=await L.default.promises.stat(O.default.join(Z,e));return Date.now()-t.mtimeMs>6*60*60*1e3?void 0:await L.default.promises.readFile(O.default.join(Z,e),"utf-8")}catch{}}var x=l(require("fs")),D=l(require("path"));var fe="npm test",Q={preCommit:"yarn lint-staged",prePush:"yarn typecheck",prePushForLab:`
|
85
85
|
if [ $(git branch --show-current) = "main" ] && [ $(git config user.email) != "exkazuu@gmail.com" ]; then
|
86
86
|
echo "************************************************"
|
87
87
|
echo "*** Don't push main branch directly. Use PR! ***"
|
@@ -89,7 +89,7 @@ if [ $(git branch --show-current) = "main" ] && [ $(git config user.email) != "e
|
|
89
89
|
exit 1
|
90
90
|
fi
|
91
91
|
|
92
|
-
yarn typecheck`.trim(),postMerge:"yarn"};async function Ge(e){return f.function("generateHuskyrc",async()=>{await Mt(e)})}async function Mt(e){var m,p;let t=D.default.resolve(e.dirPath,"package.json"),n=await x.default.promises.readFile(t,"utf-8"),
|
92
|
+
yarn typecheck`.trim(),postMerge:"yarn"};async function Ge(e){return f.function("generateHuskyrc",async()=>{await Mt(e)})}async function Mt(e){var m,p;let t=D.default.resolve(e.dirPath,"package.json"),n=await x.default.promises.readFile(t,"utf-8"),o=JSON.parse(n);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=D.default.resolve(e.dirPath,".husky");await Promise.all([x.default.promises.writeFile(t,JSON.stringify(o,void 0,2)),x.default.promises.rm(r,{force:!0,recursive:!0})]),w("yarn",["dlx","husky-init","--yarn2"],e.dirPath);let i=D.default.resolve(r,"pre-commit"),s=await x.default.promises.readFile(i,"utf-8");if(await c.run(()=>x.default.promises.rm(D.default.resolve(e.dirPath,".huskyrc.json"),{force:!0})),await c.run(()=>x.default.promises.writeFile(i,s.replace(fe,Q.preCommit))),e.containingTypeScript||e.containingTypeScriptInPackages){let g=(m=e.repository)!=null&&m.startsWith("github:WillBoosterLab/")?Q.prePushForLab:Q.prePush;await c.run(()=>x.default.promises.writeFile(D.default.resolve(r,"pre-push"),s.replace(fe,g),{mode:493}))}let a=[];(p=e.versionsText)!=null&&p.includes("python ")&&a.push("asdf install python"),e.versionsText&&a.push("asdf install"),a.push(Q.postMerge),e.containingPoetryLock&&a.push("poetry install"),(e.depending.blitz||e.depending.prisma)&&a.push("yarn gen-code");let u=s.replace(fe,a.join(" && "));await c.run(()=>x.default.promises.writeFile(D.default.resolve(r,"post-merge"),u,{mode:493}))}var ue=l(require("fs")),ge=l(require("path"));var Yt=`<?xml version="1.0" encoding="UTF-8"?>
|
93
93
|
<project version="4">
|
94
94
|
<component name="ProjectTasksOptions">
|
95
95
|
<TaskOptions isEnabled="true">
|
@@ -214,10 +214,10 @@ yarn typecheck`.trim(),postMerge:"yarn"};async function Ge(e){return f.function(
|
|
214
214
|
</TaskOptions>
|
215
215
|
</component>
|
216
216
|
</project>
|
217
|
-
`;async function Me(e){return f.function("generateIdeaSettings",async()=>{let t=
|
218
|
-
'${
|
217
|
+
`;async function Me(e){return f.function("generateIdeaSettings",async()=>{let t=ge.default.resolve(e.dirPath,".idea");if(ue.default.existsSync(t)){let n=ge.default.resolve(t,"watcherTasks.xml");e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages||e.containingPackageJson&&!e.containingPubspecYaml&&!e.containingGemfile&&!e.containingGoMod&&!e.containingPomXml?await c.run(()=>d.generateFile(n,Yt)):await c.run(()=>ue.default.promises.rm(n,{force:!0}))}})}var de=l(require("fs")),ne=l(require("path"));var ee={getLintFixSuffix(e){return e.containingJsxOrTsx?' --rule "{ react-hooks/exhaustive-deps: 0 }"':""}};var U={node:["src","__tests__","scripts"],blitz:["app","db","integrations","mailers","test"]};U.blitz=[...U.node,...U.blitz];function te(e){return e.depending.blitz?U.blitz:U.node}async function ye(e){return f.function("generateLintstagedrc",async()=>{await qt(e)})}async function qt(e){let t=[];if(e.containingJavaScript||e.containingTypeScript){let i=`
|
218
|
+
'${Ye(e)}': [${JSON.stringify(`eslint --fix${ee.getLintFixSuffix(e)}`)}, 'prettier --write'],`;t.push(i)}let n=e.root?" && !file.includes('/packages/')":"";t.push(`
|
219
219
|
'./**/*.{${P.prettier.join(",")}}': files => {
|
220
|
-
${e.containingJavaScript||e.containingTypeScript?
|
220
|
+
${e.containingJavaScript||e.containingTypeScript?Kt(e):""}
|
221
221
|
const filteredFiles = files.filter(file => !file.includes('/test-fixtures/')${n});
|
222
222
|
if (filteredFiles.length === 0) return [];
|
223
223
|
const commands = [\`prettier --write \${filteredFiles.join(' ')}\`];
|
@@ -236,16 +236,16 @@ yarn typecheck`.trim(),postMerge:"yarn"};async function Ge(e){return f.function(
|
|
236
236
|
'poetry run isort --profile black --filter-files',
|
237
237
|
'poetry run black',
|
238
238
|
'poetry run flake8'
|
239
|
-
],`);let
|
239
|
+
],`);let o=`${e.containingJavaScript||e.containingTypeScript?"const micromatch = require('micromatch');":""}
|
240
240
|
|
241
241
|
module.exports = {${t.join("")}
|
242
242
|
};
|
243
|
-
`,
|
244
|
-
`).map(s=>{let a=s.trim();return a.endsWith("/")?a.slice(0,-1):a}).filter(s=>s&&!s.startsWith("#")&&!s.includes("/")).map(s=>` "!**/${s}/**"`).join("")}var
|
243
|
+
`,r=ne.default.resolve(e.dirPath,".lintstagedrc.cjs");await c.run(()=>de.default.promises.rm(ne.default.resolve(e.dirPath,".lintstagedrc.js"),{force:!0})),await c.run(()=>de.default.promises.rm(ne.default.resolve(e.dirPath,".lintstagedrc.json"),{force:!0})),await c.run(()=>d.generateFile(r,o))}function Ye(e){return`./{${te(e).join(",")}}/**/*.{${P.eslint.join(",")}}`}function Kt(e){return`files = micromatch.not(files, '${Ye(e)}');`}var S=l(require("fs")),W=l(require("path")),we=l(require("deepmerge"));var he=["eslint","eslint-config-prettier","eslint-plugin-import","eslint-plugin-sort-class-members","eslint-plugin-sort-destructure-keys"],qe=[...he,"@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint-import-resolver-typescript"],Ke=["eslint-plugin-react","eslint-plugin-react-hooks"],He={"@willbooster/eslint-config-js":["@willbooster/eslint-config-js",...he],"@willbooster/eslint-config-js-react":["@willbooster/eslint-config-js-react",...he,...Ke],"@willbooster/eslint-config-ts":["@willbooster/eslint-config-ts",...qe],"@willbooster/eslint-config-ts-react":["@willbooster/eslint-config-ts-react",...qe,...Ke],"../../.eslintrc.json":[]};async function Ve(e,t,n){return f.function("generatePackageJson",async()=>{await Ht(e,n)})}async function Ht(e,t){var u,m;let n=W.default.resolve(e.dirPath,"package.json"),o=await S.default.promises.readFile(n,"utf-8"),r=JSON.parse(o);r.scripts=r.scripts||{},r.dependencies=r.dependencies||{},r.devDependencies=r.devDependencies||{},r.peerDependencies=r.peerDependencies||{},await Vt(r),r.name!=="@willbooster/prettier-config"&&(r.prettier="@willbooster/prettier-config");for(let p of Object.keys(r.scripts))r.scripts[p].includes("git clone")||(r.scripts[p]=r.scripts[p].replace(/yarn\s*&&\s*/,"").replace(/yarn\s*install\s*&&\s*/,""));r.scripts=(0,we.default)(r.scripts,Xt(e)),r.scripts.prettify+=await Zt(e.dirPath);let i=[],s=["lint-staged","prettier","sort-package-json","@willbooster/prettier-config"],a=[];if(e.root&&(s.push("husky","pinst","@willbooster/renovate-config"),e.depending.semanticRelease&&s.push("conventional-changelog-conventionalcommits"),e.containingSubPackageJsons?r.workspaces=["packages/*"]:delete r.workspaces),(e.containingJavaScript||e.containingJavaScriptInPackages||e.containingTypeScript||e.containingTypeScriptInPackages)&&(s.push("eslint","micromatch"),e.containingTypeScriptInPackages&&s.push("@typescript-eslint/parser")),(e.containingTypeScript||e.containingTypeScriptInPackages)&&!e.depending.blitz&&s.push("typescript"),e.eslintBase&&s.push(...He[e.eslintBase]),e.willBoosterConfigs&&(i=i.filter(p=>!p.includes("@willbooster/")),s=s.filter(p=>!p.includes("@willbooster/"))),r.name||(r.name=W.default.basename(e.dirPath)),e.containingSubPackageJsons&&(r.private=!0),r.license||(r.license="UNLICENSED"),!e.containingTypeScript&&!e.containingTypeScriptInPackages&&delete r.scripts.typecheck,e.depending.semanticRelease&&e.release.npm&&(r.resolutions||(r.resolutions={}),r.resolutions["npm/chalk"]="^4.1.2"),!e.containingSubPackageJsons){if(!e.containingJavaScript&&!e.containingTypeScript?(delete r.scripts.lint,delete r.scripts["lint-fix"],r.scripts.cleanup=r.scripts.cleanup.replace(" && yarn lint-fix","")):r.scripts["lint-fix"]+=ee.getLintFixSuffix(e),e.containingPubspecYaml){r.scripts.lint="flutter analyze",r.scripts["lint-fix"]="yarn lint";let p=["lib","test","test_driver"].filter(g=>S.default.existsSync(W.default.resolve(e.dirPath,g)));p.length>0&&(r.scripts["format-code"]=`flutter format $(find ${p.join(" ")} -name generated -prune -o -name '*.freezed.dart' -prune -o -name '*.g.dart' -prune -o -name '*.dart' -print)`,r.scripts.format+=" && yarn format-code")}if(e.containingPoetryLock){r.scripts.postinstall==="poetry install"&&delete r.scripts.postinstall;let p=(await S.default.promises.readdir(e.dirPath)).filter(g=>{let J=W.default.resolve(e.dirPath,g);return S.default.lstatSync(J).isDirectory()?S.default.readdirSync(J).some(M=>M.endsWith(".py")):!1});p.length>0&&(r.scripts["format-code"]=`poetry run isort --profile black ${p.join(" ")} && poetry run black ${p.join(" ")}`,r.scripts.lint=`poetry run flake8 ${p.join(" ")}`,r.scripts["lint-fix"]="yarn lint",r.scripts.format+=" && yarn format-code",a.push("black","isort","flake8"))}e.repository&&(r.repository=e.repository)}e.depending.blitz?(s=s.filter(p=>!p.includes("@typescript-eslint/")),s=s.filter(p=>p!=="eslint-plugin-react"&&p!=="eslint-import-resolver-typescript"&&p!=="eslint-plugin-import"&&p!=="eslint-plugin-react-hooks"),(u=r.scripts["gen-code"])!=null&&u.startsWith("blitz codegen")||(r.scripts["gen-code"]="blitz codegen")):e.depending.prisma&&((m=r.scripts["gen-code"])!=null&&m.startsWith("prisma generate")||(r.scripts["gen-code"]="prisma generate")),Object.keys(r.dependencies).length||delete r.dependencies,Object.keys(r.devDependencies).length||delete r.devDependencies,Object.keys(r.peerDependencies).length||delete r.peerDependencies,await S.default.promises.writeFile(n,JSON.stringify(r)),t||(i=i.filter(p=>{var g;return!((g=r.devDependencies)!=null&&g[p])}),i.length&&w("yarn",["add",...new Set(i)],e.dirPath),s=s.filter(p=>{var g;return!((g=r.dependencies)!=null&&g[p])}),s.length&&w("yarn",["add","-D",...new Set(s)],e.dirPath),a.length&&w("poetry",["add",...new Set(a)],e.dirPath))}async function Vt(e){e.author==="WillBooster LLC"&&(e.author="WillBooster Inc."),delete e.scripts["sort-package-json"],delete e.scripts["sort-all-package-json"],delete e.scripts["typecheck:codegen"],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 t of Object.values(He))for(let n of t)delete e.devDependencies[n];await c.run(()=>S.default.promises.rm("lerna.json",{force:!0}))}function Xt(e){let t={cleanup:"yarn format && yarn lint-fix",format:"sort-package-json && yarn prettify",lint:`eslint --color "./{${te(e)}}/**/*.{${P.eslint.join(",")}}"`,"lint-fix":"yarn lint --fix",prettify:`prettier --color --write "**/{.*/,}*.{${P.prettier.join(",")}}" "!**/test-fixtures/**"`,typecheck:"tsc --noEmit --Pretty"};return e.containingSubPackageJsons&&(t=(0,we.default)({...t},{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 "**/{.*/,}*.{${P.prettier.join(",")}}" "!**/packages/**" "!**/test-fixtures/**"`,test:"yarn workspaces foreach --verbose run test",typecheck:"yarn workspaces foreach --parallel --verbose run typecheck"})),e.depending.blitz&&(t.typecheck=`${t.typecheck} || yarn run typecheck/warn`,t["typecheck/warn"]=`echo 'Please try "yarn gen-code" if you face unknown type errors.' && exit 1`,t["typecheck:gen-code"]="yarn gen-code && tsc --noEmit --Pretty"),t}async function Zt(e){let t=W.default.resolve(e,".prettierignore"),n=await S.default.promises.readFile(t,"utf-8"),o=n.indexOf(h.separatorPrefix);return o<0?"":n.substring(0,o).split(`
|
244
|
+
`).map(s=>{let a=s.trim();return a.endsWith("/")?a.slice(0,-1):a}).filter(s=>s&&!s.startsWith("#")&&!s.includes("/")).map(s=>` "!**/${s}/**"`).join("")}var Pe=l(require("path"));var Qt=`${h.header}
|
245
245
|
|
246
246
|
|
247
247
|
${h.separator}
|
248
|
-
`,
|
248
|
+
`,en=`
|
249
249
|
3rd-party/
|
250
250
|
android/
|
251
251
|
ios/
|
@@ -255,9 +255,13 @@ test-fixtures/
|
|
255
255
|
*.min.js
|
256
256
|
.yarn/
|
257
257
|
.pnp.js
|
258
|
-
`;async function
|
258
|
+
`;async function Xe(e){return f.function("generatePrettierignore",async()=>{let t=Pe.default.resolve(e.dirPath,".prettierignore"),n=await h.getUserContent(t)||Qt,o=Pe.default.resolve(e.dirPath,".gitignore"),r=await h.getExistingContent(o)||"",i="";e.containingPubspecYaml&&(i=`
|
259
259
|
android/app/
|
260
260
|
ios/Runner/Assets.xcassets/
|
261
261
|
pubspec.yaml
|
262
|
-
`);let s=n+Qt+i+o;await c.run(()=>d.generateFile(t,s))})}var Pe=l(require("fs")),ve=l(require("path"));async function Xe(e){return f.function("generateReadme",async()=>{let t=ve.default.resolve(e.dirPath,"README.md"),n=await Pe.default.promises.readFile(t,"utf8");Pe.default.existsSync(ve.default.resolve(e.dirPath,".releaserc.json"))&&(n=n+""),await c.run(()=>d.generateFile(t,n))})}var Ze=l(require("fs")),Qe=l(require("path"));async function et(e){return f.function("generateReleaserc",async()=>{let t=Qe.default.resolve(e.dirPath,".releaserc.json");try{let n=JSON.parse(await Ze.default.promises.readFile(t,"utf8")),r=(n==null?void 0:n.plugins)||[];for(let i=0;i<r.length;i++){let s=Array.isArray(r[i])?r[i][0]:r[i];s==="@semantic-release/commit-analyzer"?r[i]=["@semantic-release/commit-analyzer",{preset:"conventionalcommits"}]:s==="@semantic-release/github"&&!e.publicRepo&&(r[i]=["@semantic-release/github",{successComment:!1}])}let o=JSON.stringify(n);await c.run(()=>d.generateFile(t,o))}catch{}})}var ne=l(require("fs")),re=l(require("path")),tt=l(require("deepmerge")),nt=l(require("lodash.clonedeep"));var en={extends:["@willbooster"]};async function rt(e){return f.function("generateRenovateJson",async()=>{let t=(0,nt.default)(en),n=re.default.resolve(e.dirPath,".renovaterc.json");try{let o=await ne.default.promises.readFile(n,"utf-8"),i=JSON.parse(o);t=tt.default.all([t,i,t],{arrayMerge:H})}catch{}await c.run(()=>ne.default.promises.rm(re.default.resolve(e.dirPath,".dependabot"),{force:!0})),await c.run(()=>ne.default.promises.rm(re.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let r=JSON.stringify(t);await c.run(()=>d.generateFile(n,r))})}var ot=l(require("fs")),G=l(require("path")),it=l(require("deepmerge")),st=l(require("lodash.clonedeep"));function z(e){let t=Object.entries(e).sort(([n],[r])=>n.localeCompare(r));for(let[n,r]of t)delete e[n],e[n]=r;return e}var tn={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react-jsx",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","scripts/**/*","packages/*/src/**/*","packages/*/__tests__/**/*","packages/*/scripts/**/*","./node_modules/@types","./@types"]},nn={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react-jsx",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","scripts/**/*","../../node_modules/@types","../../@types","./@types"]};async function at(e,t){return f.function("generateTsconfig",async()=>{var i,s,a;if(t.depending.blitz)return;let n=(0,st.default)(e.root?tn:nn);if(!e.containingJsxOrTsx&&!e.containingJsxOrTsxInPackages&&delete n.compilerOptions.jsx,e.root&&!e.containingSubPackageJsons&&(n.include=n.include.filter(u=>!u.startsWith("packages/*/"))),!e.root&&(e.depending.jestPlaywrightPreset||t.depending.jestPlaywrightPreset)){let u=G.default.relative(e.dirPath,t.dirPath);n.include.push(G.default.join(u,"node_modules/jest-playwright-preset/types"),G.default.join(u,"node_modules/expect-playwright"))}let r=G.default.resolve(e.dirPath,"tsconfig.json");try{let u=await ot.default.promises.readFile(r,"utf-8"),m=JSON.parse(u);m.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete m.extends,(i=m.compilerOptions)==null||delete i.typeRoots,(s=n==null?void 0:n.compilerOptions)==null||delete s.target,(a=n==null?void 0:n.compilerOptions)==null||delete a.module,m.jsx&&delete n.jsx,e.depending.blitz&&delete n.include,n=it.default.all([n,m,n],{arrayMerge:H})}catch{}z(n.compilerOptions);let o=JSON.stringify(n);await c.run(()=>d.generateFile(r,o))})}var $=l(require("fs")),F=l(require("path")),pt=l(require("deepmerge")),ke=l(require("js-yaml")),mt=l(require("lodash.clonedeep"));var rn={name:"Test",on:{pull_request:null,push:{branches:["main","wbfy","renovate/**"]}},jobs:{test:{uses:"WillBooster/reusable-workflows/.github/workflows/test.yml@main"}}},on={name:"Release",on:{push:{branches:[]}},jobs:{release:{uses:"WillBooster/reusable-workflows/.github/workflows/release.yml@main"}}},sn={name:"Willboosterify",on:{workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}},an={name:"Merge wbfy",on:{workflow_dispatch:null},jobs:{"wbfy-merge":{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy-merge.yml@main"}}},ln={name:"Lint PR title",on:{pull_request_target:{types:["opened","edited","synchronize"]}},jobs:{"semantic-pr":{uses:"WillBooster/reusable-workflows/.github/workflows/semantic-pr.yml@main"}}},cn={name:"Notify ready",on:{issues:{types:["labeled"]}},jobs:{"notify-ready":{uses:"WillBoosterLab/reusable-workflows/.github/workflows/notify-ready.yml@main",secrets:{DISCORD_WEBHOOK_URL:"${{ secrets.READY_DISCORD_WEBHOOK_URL }}"}}}},pn={name:"editComment",on:{pull_request:{types:["opened"]}},jobs:{"close-comment":{uses:"WillBoosterLab/reusable-workflows/.github/ workflows/close-comment.yml@main"}}};async function ft(e){return f.function("generateWorkflow",async()=>{var o;let t=F.default.resolve(e.dirPath,".github","workflows");await $.default.promises.mkdir(t,{recursive:!0});let n=F.default.resolve(e.dirPath,".github","semantic.yml");await c.run(()=>$.default.promises.rm(n,{force:!0,recursive:!0}));let r=(await $.default.promises.readdir(t,{withFileTypes:!0})).filter(i=>i.isFile()&&i.name.endsWith(".yml")).map(i=>i.name);e.depending.semanticRelease&&r.push("release.yml"),(e.publicRepo||((o=e.repository)==null?void 0:o.startsWith("github:WillBoosterLab/")))&&r.push("notify-ready.yml"),r.push("test.yml","wbfy.yml","wbfy-merge.yml","semantic-pr.yml","close-comment.yml");for(let i of r){let s=F.default.basename(i,".yml");await c.run(()=>mn(e,t,s))}})}async function mn(e,t,n){var i,s;let r={};n==="test"?r=rn:n==="release"?r=on:n==="wbfy"?r=sn:n==="wbfy-merge"?r=an:n==="semantic-pr"?r=ln:n==="notify-ready"?r=cn:n==="close-comment"&&(r=pn),r=(0,mt.default)(r);let o=F.default.join(t,`${n}.yml`);try{let a=await $.default.promises.readFile(o,"utf-8"),u=ke.default.load(a);r=pt.default.all([r,u,r],{arrayMerge:V})}catch{}for(let a of Object.values(r.jobs)){if(!((s=(i=a.uses)==null?void 0:i.includes)!=null&&s.call(i,"/reusable-workflows/")))return;fn(e,a,n)}if(n==="release"?r.on.schedule?delete r.on.push:r.on.push.branches=e.release.branches:n==="wbfy"?lt(r,20,24):n==="wbfy-merge"&<(r,0,4),await ct(r,o),n==="release")await $.default.promises.rm(F.default.join(t,"semantic-release.yml"),{force:!0});else if(n==="sync"){if(await $.default.promises.rm(F.default.join(t,"sync-init.yml"),{force:!0}),!r.jobs.sync)return;r.jobs["sync-force"]=r.jobs.sync;let a=r.jobs.sync.with.sync_params_without_dest;if(!a)return;r.jobs.sync.with.sync_params_without_dest=`--force ${a}`,r.name="Force to Sync",r.on={workflow_dispatch:null},delete r.jobs.sync,await ct(r,F.default.join(t,"sync-force.yml"))}}function fn(e,t,n){var r,o,i;if(t.with||(t.with={}),t.secrets||(t.secrets={}),(e.release.github&&n==="test"||n==="release"||n==="wbfy"||n==="wbfy-merge")&&(e.publicRepo?t.secrets.GH_TOKEN="${{ secrets.PUBLIC_GH_BOT_PAT }}":t.secrets.GH_TOKEN="${{ secrets.GH_BOT_PAT }}"),e.release.npm&&(n==="release"||n==="test")&&(t.secrets.NPM_TOKEN="${{ secrets.NPM_TOKEN }}"),n==="sync"){let s=(r=t.with)==null?void 0:r.sync_params_without_dest;s&&(t.with.sync_params_without_dest=s.replace("sync ",""))}if((o=e.repository)!=null&&o.startsWith("github:WillBooster/")?t.uses=t.uses.replace("WillBoosterLab/","WillBooster/"):(i=e.repository)!=null&&i.startsWith("github:WillBoosterLab/")&&(t.uses=t.uses.replace("WillBooster/","WillBoosterLab/")),delete t.with.non_self_hosted,e.containingDockerfile&&n.startsWith("deploy")&&(t.with.cpu_arch="X64"),n==="release"||n==="test"||n==="wbfy"||n==="wbfy-merge"||n.startsWith("deploy")?e.publicRepo&&(t.with.github_hosted_runner=!0):delete t.with.github_hosted_runner,Object.keys(t.with).length?z(t.with):delete t.with,Object.keys(t.secrets).length){let s=z(t.secrets);delete t.secrets,t.secrets=s}else delete t.secrets}function lt(e,t,n){var u,m;let[r,o]=(((m=(u=e.on.schedule)==null?void 0:u[0])==null?void 0:m.cron)??"").split(" ").map(Number);if(r!==0&&Number.isInteger(o)){let p=(o+9)%24;if(t<n?t<=p&&p<n:t<=p||p<n)return}let i=1+Math.floor(Math.random()*59),s=t+Math.floor(Math.random()*(n-t)),a=`${i} ${(s-9+24)%24} * * *`;e.on.schedule=[{cron:a}]}async function ct(e,t){let n=ke.default.dump(e,{lineWidth:-1,noCompatMode:!0,styles:{"!!null":"empty"}});await $.default.promises.writeFile(t,n)}var E=l(require("fs")),N=l(require("path")),be=l(require("js-yaml"));async function dt(e){return f.function("generateYarnrcYml",async()=>{let t=B("yarn",["--version"],e.dirPath),n=un("@yarnpkg/cli",e.dirPath);gt(t)<=gt(n)&&t!==n&&w("yarn",["set","version",n],e.dirPath,1);let r=N.default.join(e.dirPath,".yarn","releases");await E.default.promises.mkdir(r,{recursive:!0});for(let m of await E.default.promises.readdir(r))m.startsWith("yarn-")&&!m.startsWith(`yarn-${n}.`)&&(await c.run(()=>E.default.promises.rm(N.default.join(r,m))),console.log("Removed",N.default.join(r,m)));let o=N.default.resolve(e.dirPath,".yarnrc");await c.run(()=>E.default.promises.rm(o,{force:!0}));let i=N.default.resolve(e.dirPath,".yarnrc.yml"),s=be.default.load(await E.default.promises.readFile(i,"utf8"));s.defaultSemverRangePrefix="",e.requiringNodeModules&&(s.nodeLinker="node-modules",s.nmMode="hardlinks-global"),await E.default.promises.writeFile(i,be.default.dump(s,{lineWidth:-1}));let a=(s.plugins||[]).map(m=>m.spec),u=e.containingTypeScript||e.containingTypeScriptInPackages;ut(e,a,u,"@yarnpkg/plugin-typescript"),u&&!e.requiringNodeModules&&w("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),ut(e,a,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),w("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)})}function un(e,t){let n=B("npm",["show",e,"versions","--json"],t),r=JSON.parse(n);return r[r.length-1]}function ut(e,t,n,r){n!==t.includes(r)&&w("yarn",["plugin",n?"import":"remove",r],e.dirPath)}function gt(e){let[t]=e.split(".");return Number(t)}var yt=require("@octokit/core"),ht=process.env.GH_BOT_PAT||process.env.PUBLIC_GH_BOT_PAT||process.env.GH_TOKEN||process.env.GITHUB_TOKEN,oe=!!ht,R=new yt.Octokit({auth:ht}),xe=class{getOrgAndName(t){var s;let n=t.split(":").at(-1),r=n==null?void 0:n.split("/"),o=(r==null?void 0:r.at(-2))??"",i=((s=r==null?void 0:r.at(-1))==null?void 0:s.replace(/.git$/,""))??"";return[o,i]}},I=new xe;async function Pt(e){return f.function("setupLabels",async()=>{if(!oe)return;let[t,n]=I.getOrgAndName(e.repository??"");if(!(!t||!n)&&!(!e.publicRepo&&t==="WillBooster"))try{await wt(t,n,"ready","0E8A16"),await wt(t,n,"review requested","FBCA04")}catch(r){console.warn("Skip setupLabels due to:",(r==null?void 0:r.stack)??r)}})}async function wt(e,t,n,r){try{await R.request("POST /repos/{owner}/{repo}/labels",{owner:e,repo:t,name:n,color:r})}catch{await R.request("PATCH /repos/{owner}/{repo}/labels/{name}",{owner:e,repo:t,name:n,color:r})}}var vt=l(require("dotenv")),j=l(require("libsodium-wrappers"));async function kt(e){return f.function("setupSecrets",async()=>{if(!oe)return;let[t,n]=I.getOrgAndName(e.repository??"");if(!t||!n||t!=="WillBoosterLab")return;let r=vt.default.config().parsed||{};if(Object.keys(r).length!==0)try{let o=await R.request("GET /repos/{owner}/{repo}/actions/secrets/public-key",{owner:t,repo:n}),{key:i,key_id:s}=o.data;await j.default.ready;for(let[a,u]of Object.entries(r)){if(e.publicRepo&&a==="GH_BOT_PAT"||!e.publicRepo&&a==="PUBLIC_GH_BOT_PAT")continue;let m=j.default.from_base64(i,j.default.base64_variants.ORIGINAL),p=j.default.from_string(u),g=j.default.crypto_box_seal(p,m),J=j.default.to_base64(g,j.default.base64_variants.ORIGINAL);await R.request("PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}",{owner:t,repo:n,secret_name:a,encrypted_value:J,key_id:s})}}catch(o){console.warn("Skip setupSecrets due to:",(o==null?void 0:o.stack)??o)}})}var v=l(require("fs")),ie=l(require("fs/promises")),y=l(require("path")),T=l(require("glob")),xt=l(require("js-yaml")),St=require("simple-git");async function Se(e){var n;let t=y.default.resolve(e,"package.json");try{let r=v.default.existsSync(t),o={},i={},s={};if(r){let _=v.default.readFileSync(t,"utf-8");s=JSON.parse(_),o=s.dependencies??{},i=s.devDependencies??{}}let a=!0;try{let _=y.default.resolve(e,".yarnrc.yml"),b=xt.default.load(await ie.default.readFile(_,"utf8"));a=!b.nodeLinker||b.nodeLinker==="node-modules"}catch{}let u=[],m=[];try{let _=y.default.resolve(e,".releaserc.json"),b=JSON.parse(await ie.default.readFile(_,"utf8"));u=(b==null?void 0:b.branches)||[],m=((n=b==null?void 0:b.plugins)==null?void 0:n.flat())||[]}catch{}let p=y.default.basename(y.default.resolve(e,".."))!=="packages"||!v.default.existsSync(y.default.resolve(e,"..","..","package.json")),g;p&&(g=await dn(e,s));let J=y.default.resolve(e,".tool-versions"),M;try{M=await ie.default.readFile(J,"utf-8")}catch{}let k={dirPath:e,root:p,publicRepo:(g==null?void 0:g.private)===!1,repository:g!=null&&g.full_name?`github:${g==null?void 0:g.full_name}`:void 0,willBoosterConfigs:t.includes(`${y.default.sep}willbooster-configs`),containingSubPackageJsons:T.default.sync("packages/**/package.json",{cwd:e}).length>0,containingDockerfile:v.default.existsSync(y.default.resolve(e,"Dockerfile"))||v.default.existsSync(y.default.resolve(e,"docker-compose.yml")),containingGemfile:v.default.existsSync(y.default.resolve(e,"Gemfile")),containingGoMod:v.default.existsSync(y.default.resolve(e,"go.mod")),containingPackageJson:v.default.existsSync(y.default.resolve(e,"package.json")),containingPoetryLock:v.default.existsSync(y.default.resolve(e,"poetry.lock")),containingPomXml:v.default.existsSync(y.default.resolve(e,"pom.xml")),containingPubspecYaml:v.default.existsSync(y.default.resolve(e,"pubspec.yaml")),containingTemplateYaml:v.default.existsSync(y.default.resolve(e,"template.yaml")),containingJavaScript:T.default.sync("@(app|src|__tests__|scripts)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:T.default.sync("@(app|src|__tests__|scripts)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:T.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:T.default.sync("packages/**/@(app|src|__tests__|scripts)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:T.default.sync("packages/**/@(app|src|__tests__|scripts)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:T.default.sync("packages/**/@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,depending:{blitz:!!(o.blitz||i.blitz),firebase:!!i["firebase-tools"],jestPlaywrightPreset:!!i["jest-playwright-preset"],prisma:!!i.prisma,reactNative:!!o["react-native"],semanticRelease:!!i["semantic-release"],storybook:!!i["@storybook/react"]},release:{branches:u,github:m.includes("@semantic-release/github"),npm:m.includes("@semantic-release/npm")},requiringNodeModules:a,versionsText:M};if(k.eslintBase=gn(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function gn(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 dn(e,t){var a,u,m;let o=(await(0,St.simpleGit)(e).getRemotes(!0)).find(p=>p.name==="origin"),i=((a=o==null?void 0:o.refs)==null?void 0:a.fetch)??((u=o==null?void 0:o.refs)==null?void 0:u.push);if(typeof i=="string"){let p=await bt(i);if(p)return p}let s=((m=t.repository)==null?void 0:m.url)??t.repository;if(typeof s=="string"){let p=await bt(s);if(p&&p.message!=="Not Found")return p}}async function bt(e){let[t,n]=I.getOrgAndName(e);if(!t||!n)return;let r={full_name:`${t}/${n}`};try{let o=await R.request("GET /repos/{owner}/{repo}",{owner:t,repo:n});Object.assign(r,o.data)}catch{}return r}async function yn(){let e=await(0,Ft.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;C.isVerbose=e.verbose;for(let t of e._){if(typeof t=="number")continue;let n=await Se(t);if(n===null){console.error(`there is no valid package.json in ${t}`);continue}let r=n.containingSubPackageJsons?Ct.default.sync("packages/*",{cwd:t}).map(a=>_t.default.resolve(t,a)):[],o=(await Promise.all(r.map(a=>Se(a)))).filter(a=>!!a),i=[n,...o];if(C.isVerbose)for(let a of i)console.info(a);await $e(n),await dt(n),await Promise.all([Te(n),Be(n),Ge(n),Me(n),de(n),Xe(n),rt(n),et(n),ft(n),kt(n),Pt(n)]),await c.promiseAll();let s=[];for(let a of i)await ze(a,n),await c.promiseAll(),!(!a.root&&!a.containingPackageJson)&&(await Ve(a),await He(a,n,e.skipDeps),s.push(de(a)),(a.containingTypeScript||a.containingTypeScriptInPackages)&&s.push(at(a,n)),(a.containingJavaScript||a.containingJavaScriptInPackages||a.containingTypeScript||a.containingTypeScriptInPackages)&&(n.willBoosterConfigs||s.push(Ne(a,n)),s.push(Oe(a))));await Promise.all(s),await c.promiseAll(),w("yarn",["cleanup"],t),w("yarn",["install"],t)}}yn().then();
|
262
|
+
`);let s=n+en+i+r;await c.run(()=>d.generateFile(t,s))})}var ve=l(require("fs")),ke=l(require("path"));var z="[](https://github.com/semantic-release/semantic-release)";async function Ze(e){return f.function("generateReadme",async()=>{let t=ke.default.resolve(e.dirPath,"README.md"),n=await ve.default.promises.readFile(t,"utf8");if(ve.default.existsSync(ke.default.resolve(e.dirPath,".releaserc.json"))){if(n.includes(z)){let i=n.indexOf(z);n=n.substring(0,i)+n.substring(i+z.length)}let r=!1;for(let i=0;i<n.length;i++)if(n[i]===`
|
263
|
+
`){r=!0,n=`${n.slice(0,i+1)}${z}
|
264
|
+
${n.slice(i+1)}`;break}r||(n=`${n}
|
265
|
+
${z}
|
266
|
+
`)}await c.run(()=>d.generateFile(t,n))})}var Qe=l(require("fs")),et=l(require("path"));async function tt(e){return f.function("generateReleaserc",async()=>{let t=et.default.resolve(e.dirPath,".releaserc.json");try{let n=JSON.parse(await Qe.default.promises.readFile(t,"utf8")),o=(n==null?void 0:n.plugins)||[];for(let i=0;i<o.length;i++){let s=Array.isArray(o[i])?o[i][0]:o[i];s==="@semantic-release/commit-analyzer"?o[i]=["@semantic-release/commit-analyzer",{preset:"conventionalcommits"}]:s==="@semantic-release/github"&&!e.publicRepo&&(o[i]=["@semantic-release/github",{successComment:!1}])}let r=JSON.stringify(n);await c.run(()=>d.generateFile(t,r))}catch{}})}var re=l(require("fs")),oe=l(require("path")),nt=l(require("deepmerge")),rt=l(require("lodash.clonedeep"));var tn={extends:["@willbooster"]};async function ot(e){return f.function("generateRenovateJson",async()=>{let t=(0,rt.default)(tn),n=oe.default.resolve(e.dirPath,".renovaterc.json");try{let r=await re.default.promises.readFile(n,"utf-8"),i=JSON.parse(r);t=nt.default.all([t,i,t],{arrayMerge:V})}catch{}await c.run(()=>re.default.promises.rm(oe.default.resolve(e.dirPath,".dependabot"),{force:!0})),await c.run(()=>re.default.promises.rm(oe.default.resolve(e.dirPath,"renovate.json"),{force:!0}));let o=JSON.stringify(t);await c.run(()=>d.generateFile(n,o))})}var it=l(require("fs")),G=l(require("path")),st=l(require("deepmerge")),at=l(require("lodash.clonedeep"));function A(e){let t=Object.entries(e).sort(([n],[o])=>n.localeCompare(o));for(let[n,o]of t)delete e[n],e[n]=o;return e}var nn={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react-jsx",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","scripts/**/*","packages/*/src/**/*","packages/*/__tests__/**/*","packages/*/scripts/**/*","./node_modules/@types","./@types"]},rn={compilerOptions:{target:"esnext",module:"esnext",moduleResolution:"node",jsx:"react-jsx",alwaysStrict:!0,strict:!0,skipLibCheck:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,resolveJsonModule:!0,sourceMap:!0,importHelpers:!1,outDir:"dist"},include:["src/**/*","__tests__/**/*","scripts/**/*","../../node_modules/@types","../../@types","./@types"]};async function lt(e,t){return f.function("generateTsconfig",async()=>{var i,s,a;if(t.depending.blitz)return;let n=(0,at.default)(e.root?nn:rn);if(!e.containingJsxOrTsx&&!e.containingJsxOrTsxInPackages&&delete n.compilerOptions.jsx,e.root&&!e.containingSubPackageJsons&&(n.include=n.include.filter(u=>!u.startsWith("packages/*/"))),!e.root&&(e.depending.jestPlaywrightPreset||t.depending.jestPlaywrightPreset)){let u=G.default.relative(e.dirPath,t.dirPath);n.include.push(G.default.join(u,"node_modules/jest-playwright-preset/types"),G.default.join(u,"node_modules/expect-playwright"))}let o=G.default.resolve(e.dirPath,"tsconfig.json");try{let u=await it.default.promises.readFile(o,"utf-8"),m=JSON.parse(u);m.extends==="./node_modules/@willbooster/tsconfig/tsconfig.json"&&delete m.extends,(i=m.compilerOptions)==null||delete i.typeRoots,(s=n==null?void 0:n.compilerOptions)==null||delete s.target,(a=n==null?void 0:n.compilerOptions)==null||delete a.module,m.jsx&&delete n.jsx,e.depending.blitz&&delete n.include,n=st.default.all([n,m,n],{arrayMerge:V})}catch{}A(n.compilerOptions);let r=JSON.stringify(n);await c.run(()=>d.generateFile(o,r))})}var $=l(require("fs")),F=l(require("path")),mt=l(require("deepmerge")),be=l(require("js-yaml")),ft=l(require("lodash.clonedeep"));var on={name:"Test",on:{pull_request:null,push:{branches:["main","wbfy","renovate/**"]}},jobs:{test:{uses:"WillBooster/reusable-workflows/.github/workflows/test.yml@main"}}},sn={name:"Release",on:{push:{branches:[]}},jobs:{release:{uses:"WillBooster/reusable-workflows/.github/workflows/release.yml@main"}}},an={name:"Willboosterify",on:{workflow_dispatch:null},jobs:{wbfy:{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main"}}},ln={name:"Merge wbfy",on:{workflow_dispatch:null},jobs:{"wbfy-merge":{uses:"WillBooster/reusable-workflows/.github/workflows/wbfy-merge.yml@main"}}},cn={name:"Lint PR title",on:{pull_request_target:{types:["opened","edited","synchronize"]}},jobs:{"semantic-pr":{uses:"WillBooster/reusable-workflows/.github/workflows/semantic-pr.yml@main"}}},pn={name:"Notify ready",on:{issues:{types:["labeled"]}},jobs:{"notify-ready":{uses:"WillBoosterLab/reusable-workflows/.github/workflows/notify-ready.yml@main",secrets:{DISCORD_WEBHOOK_URL:"${{ secrets.READY_DISCORD_WEBHOOK_URL }}"}}}},mn={name:"editComment",on:{pull_request:{types:["opened"]}},jobs:{"close-comment":{uses:"WillBoosterLab/reusable-workflows/.github/ workflows/close-comment.yml@main"}}};async function ut(e){return f.function("generateWorkflow",async()=>{var r;let t=F.default.resolve(e.dirPath,".github","workflows");await $.default.promises.mkdir(t,{recursive:!0});let n=F.default.resolve(e.dirPath,".github","semantic.yml");await c.run(()=>$.default.promises.rm(n,{force:!0,recursive:!0}));let o=(await $.default.promises.readdir(t,{withFileTypes:!0})).filter(i=>i.isFile()&&i.name.endsWith(".yml")).map(i=>i.name);e.depending.semanticRelease&&o.push("release.yml"),(e.publicRepo||((r=e.repository)==null?void 0:r.startsWith("github:WillBoosterLab/")))&&o.push("notify-ready.yml"),o.push("test.yml","wbfy.yml","wbfy-merge.yml","semantic-pr.yml","close-comment.yml");for(let i of o){let s=F.default.basename(i,".yml");await c.run(()=>fn(e,t,s))}})}async function fn(e,t,n){var i,s;let o={};n==="test"?o=on:n==="release"?o=sn:n==="wbfy"?o=an:n==="wbfy-merge"?o=ln:n==="semantic-pr"?o=cn:n==="notify-ready"?o=pn:n==="close-comment"&&(o=mn),o=(0,ft.default)(o);let r=F.default.join(t,`${n}.yml`);try{let a=await $.default.promises.readFile(r,"utf-8"),u=be.default.load(a);o=mt.default.all([o,u,o],{arrayMerge:X})}catch{}for(let a of Object.values(o.jobs)){if(!((s=(i=a.uses)==null?void 0:i.includes)!=null&&s.call(i,"/reusable-workflows/")))return;un(e,a,n)}if(n==="release"?o.on.schedule?delete o.on.push:o.on.push.branches=e.release.branches:n==="wbfy"?ct(o,20,24):n==="wbfy-merge"&&ct(o,0,4),await pt(o,r),n==="release")await $.default.promises.rm(F.default.join(t,"semantic-release.yml"),{force:!0});else if(n==="sync"){if(await $.default.promises.rm(F.default.join(t,"sync-init.yml"),{force:!0}),!o.jobs.sync)return;o.jobs["sync-force"]=o.jobs.sync;let a=o.jobs.sync.with.sync_params_without_dest;if(!a)return;o.jobs.sync.with.sync_params_without_dest=`--force ${a}`,o.name="Force to Sync",o.on={workflow_dispatch:null},delete o.jobs.sync,await pt(o,F.default.join(t,"sync-force.yml"))}}function un(e,t,n){var o,r,i;if(t.with||(t.with={}),t.secrets||(t.secrets={}),(e.release.github&&n==="test"||n==="release"||n==="wbfy"||n==="wbfy-merge")&&(e.publicRepo?t.secrets.GH_TOKEN="${{ secrets.PUBLIC_GH_BOT_PAT }}":t.secrets.GH_TOKEN="${{ secrets.GH_BOT_PAT }}"),e.release.npm&&(n==="release"||n==="test")&&(t.secrets.NPM_TOKEN="${{ secrets.NPM_TOKEN }}"),n==="sync"){let s=(o=t.with)==null?void 0:o.sync_params_without_dest;s&&(t.with.sync_params_without_dest=s.replace("sync ",""))}if((r=e.repository)!=null&&r.startsWith("github:WillBooster/")?t.uses=t.uses.replace("WillBoosterLab/","WillBooster/"):(i=e.repository)!=null&&i.startsWith("github:WillBoosterLab/")&&(t.uses=t.uses.replace("WillBooster/","WillBoosterLab/")),delete t.with.non_self_hosted,e.containingDockerfile&&n.startsWith("deploy")&&(t.with.cpu_arch="X64"),n==="release"||n==="test"||n==="wbfy"||n==="wbfy-merge"||n.startsWith("deploy")?e.publicRepo&&(t.with.github_hosted_runner=!0):delete t.with.github_hosted_runner,Object.keys(t.with).length?A(t.with):delete t.with,Object.keys(t.secrets).length){let s=A(t.secrets);delete t.secrets,t.secrets=s}else delete t.secrets}function ct(e,t,n){var u,m;let[o,r]=(((m=(u=e.on.schedule)==null?void 0:u[0])==null?void 0:m.cron)??"").split(" ").map(Number);if(o!==0&&Number.isInteger(r)){let p=(r+9)%24;if(t<n?t<=p&&p<n:t<=p||p<n)return}let i=1+Math.floor(Math.random()*59),s=t+Math.floor(Math.random()*(n-t)),a=`${i} ${(s-9+24)%24} * * *`;e.on.schedule=[{cron:a}]}async function pt(e,t){let n=be.default.dump(e,{lineWidth:-1,noCompatMode:!0,styles:{"!!null":"empty"}});await $.default.promises.writeFile(t,n)}var E=l(require("fs")),N=l(require("path")),xe=l(require("js-yaml"));async function yt(e){return f.function("generateYarnrcYml",async()=>{let t=B("yarn",["--version"],e.dirPath),n=gn("@yarnpkg/cli",e.dirPath);dt(t)<=dt(n)&&t!==n&&w("yarn",["set","version",n],e.dirPath,1);let o=N.default.join(e.dirPath,".yarn","releases");await E.default.promises.mkdir(o,{recursive:!0});for(let m of await E.default.promises.readdir(o))m.startsWith("yarn-")&&!m.startsWith(`yarn-${n}.`)&&(await c.run(()=>E.default.promises.rm(N.default.join(o,m))),console.log("Removed",N.default.join(o,m)));let r=N.default.resolve(e.dirPath,".yarnrc");await c.run(()=>E.default.promises.rm(r,{force:!0}));let i=N.default.resolve(e.dirPath,".yarnrc.yml"),s=xe.default.load(await E.default.promises.readFile(i,"utf8"));s.defaultSemverRangePrefix="",e.requiringNodeModules&&(s.nodeLinker="node-modules",s.nmMode="hardlinks-global"),await E.default.promises.writeFile(i,xe.default.dump(s,{lineWidth:-1}));let a=(s.plugins||[]).map(m=>m.spec),u=e.containingTypeScript||e.containingTypeScriptInPackages;gt(e,a,u,"@yarnpkg/plugin-typescript"),u&&!e.requiringNodeModules&&w("yarn",["dlx","@yarnpkg/sdks","vscode"],e.dirPath),gt(e,a,e.containingSubPackageJsons,"@yarnpkg/plugin-workspace-tools"),w("yarn",["dlx","yarn-plugin-auto-install"],e.dirPath)})}function gn(e,t){let n=B("npm",["show",e,"versions","--json"],t),o=JSON.parse(n);return o[o.length-1]}function gt(e,t,n,o){n!==t.includes(o)&&w("yarn",["plugin",n?"import":"remove",o],e.dirPath)}function dt(e){let[t]=e.split(".");return Number(t)}var ht=require("@octokit/core"),wt=process.env.GH_BOT_PAT||process.env.PUBLIC_GH_BOT_PAT||process.env.GH_TOKEN||process.env.GITHUB_TOKEN,ie=!!wt,R=new ht.Octokit({auth:wt}),Se=class{getOrgAndName(t){var s;let n=t.split(":").at(-1),o=n==null?void 0:n.split("/"),r=(o==null?void 0:o.at(-2))??"",i=((s=o==null?void 0:o.at(-1))==null?void 0:s.replace(/.git$/,""))??"";return[r,i]}},I=new Se;async function vt(e){return f.function("setupLabels",async()=>{if(!ie)return;let[t,n]=I.getOrgAndName(e.repository??"");if(!(!t||!n)&&!(!e.publicRepo&&t==="WillBooster"))try{await Pt(t,n,"ready","0E8A16"),await Pt(t,n,"review requested","FBCA04")}catch(o){console.warn("Skip setupLabels due to:",(o==null?void 0:o.stack)??o)}})}async function Pt(e,t,n,o){try{await R.request("POST /repos/{owner}/{repo}/labels",{owner:e,repo:t,name:n,color:o})}catch{await R.request("PATCH /repos/{owner}/{repo}/labels/{name}",{owner:e,repo:t,name:n,color:o})}}var kt=l(require("dotenv")),j=l(require("libsodium-wrappers"));async function bt(e){return f.function("setupSecrets",async()=>{if(!ie)return;let[t,n]=I.getOrgAndName(e.repository??"");if(!t||!n||t!=="WillBoosterLab")return;let o=kt.default.config().parsed||{};if(Object.keys(o).length!==0)try{let r=await R.request("GET /repos/{owner}/{repo}/actions/secrets/public-key",{owner:t,repo:n}),{key:i,key_id:s}=r.data;await j.default.ready;for(let[a,u]of Object.entries(o)){if(e.publicRepo&&a==="GH_BOT_PAT"||!e.publicRepo&&a==="PUBLIC_GH_BOT_PAT")continue;let m=j.default.from_base64(i,j.default.base64_variants.ORIGINAL),p=j.default.from_string(u),g=j.default.crypto_box_seal(p,m),J=j.default.to_base64(g,j.default.base64_variants.ORIGINAL);await R.request("PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}",{owner:t,repo:n,secret_name:a,encrypted_value:J,key_id:s})}}catch(r){console.warn("Skip setupSecrets due to:",(r==null?void 0:r.stack)??r)}})}var v=l(require("fs")),se=l(require("fs/promises")),y=l(require("path")),T=l(require("glob")),St=l(require("js-yaml")),_t=require("simple-git");async function _e(e){var n;let t=y.default.resolve(e,"package.json");try{let o=v.default.existsSync(t),r={},i={},s={};if(o){let _=v.default.readFileSync(t,"utf-8");s=JSON.parse(_),r=s.dependencies??{},i=s.devDependencies??{}}let a=!0;try{let _=y.default.resolve(e,".yarnrc.yml"),b=St.default.load(await se.default.readFile(_,"utf8"));a=!b.nodeLinker||b.nodeLinker==="node-modules"}catch{}let u=[],m=[];try{let _=y.default.resolve(e,".releaserc.json"),b=JSON.parse(await se.default.readFile(_,"utf8"));u=(b==null?void 0:b.branches)||[],m=((n=b==null?void 0:b.plugins)==null?void 0:n.flat())||[]}catch{}let p=y.default.basename(y.default.resolve(e,".."))!=="packages"||!v.default.existsSync(y.default.resolve(e,"..","..","package.json")),g;p&&(g=await yn(e,s));let J=y.default.resolve(e,".tool-versions"),M;try{M=await se.default.readFile(J,"utf-8")}catch{}let k={dirPath:e,root:p,publicRepo:(g==null?void 0:g.private)===!1,repository:g!=null&&g.full_name?`github:${g==null?void 0:g.full_name}`:void 0,willBoosterConfigs:t.includes(`${y.default.sep}willbooster-configs`),containingSubPackageJsons:T.default.sync("packages/**/package.json",{cwd:e}).length>0,containingDockerfile:v.default.existsSync(y.default.resolve(e,"Dockerfile"))||v.default.existsSync(y.default.resolve(e,"docker-compose.yml")),containingGemfile:v.default.existsSync(y.default.resolve(e,"Gemfile")),containingGoMod:v.default.existsSync(y.default.resolve(e,"go.mod")),containingPackageJson:v.default.existsSync(y.default.resolve(e,"package.json")),containingPoetryLock:v.default.existsSync(y.default.resolve(e,"poetry.lock")),containingPomXml:v.default.existsSync(y.default.resolve(e,"pom.xml")),containingPubspecYaml:v.default.existsSync(y.default.resolve(e,"pubspec.yaml")),containingTemplateYaml:v.default.existsSync(y.default.resolve(e,"template.yaml")),containingJavaScript:T.default.sync("@(app|src|__tests__|scripts)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScript:T.default.sync("@(app|src|__tests__|scripts)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsx:T.default.sync("@(app|src|__tests__)/**/*.{t,j}sx",{cwd:e}).length>0,containingJavaScriptInPackages:T.default.sync("packages/**/@(app|src|__tests__|scripts)/**/*.js?(x)",{cwd:e}).length>0,containingTypeScriptInPackages:T.default.sync("packages/**/@(app|src|__tests__|scripts)/**/*.ts?(x)",{cwd:e}).length>0,containingJsxOrTsxInPackages:T.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:u,github:m.includes("@semantic-release/github"),npm:m.includes("@semantic-release/npm")},requiringNodeModules:a,versionsText:M};if(k.eslintBase=dn(k),k.containingGemfile||k.containingGoMod||k.containingPackageJson||k.containingPoetryLock||k.containingPomXml||k.containingPubspecYaml||k.containingTemplateYaml)return k}catch{}return null}function dn(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 yn(e,t){var a,u,m;let r=(await(0,_t.simpleGit)(e).getRemotes(!0)).find(p=>p.name==="origin"),i=((a=r==null?void 0:r.refs)==null?void 0:a.fetch)??((u=r==null?void 0:r.refs)==null?void 0:u.push);if(typeof i=="string"){let p=await xt(i);if(p)return p}let s=((m=t.repository)==null?void 0:m.url)??t.repository;if(typeof s=="string"){let p=await xt(s);if(p&&p.message!=="Not Found")return p}}async function xt(e){let[t,n]=I.getOrgAndName(e);if(!t||!n)return;let o={full_name:`${t}/${n}`};try{let r=await R.request("GET /repos/{owner}/{repo}",{owner:t,repo:n});Object.assign(o,r.data)}catch{}return o}async function hn(){let e=await(0,$t.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;C.isVerbose=e.verbose;for(let t of e._){if(typeof t=="number")continue;let n=await _e(t);if(n===null){console.error(`there is no valid package.json in ${t}`);continue}let o=n.containingSubPackageJsons?Ft.default.sync("packages/*",{cwd:t}).map(a=>Ct.default.resolve(t,a)):[],r=(await Promise.all(o.map(a=>_e(a)))).filter(a=>!!a),i=[n,...r];if(C.isVerbose)for(let a of i)console.info(a);await Re(n),await yt(n),await Promise.all([Oe(n),Le(n),Ge(n),Me(n),ye(n),Ze(n),ot(n),tt(n),ut(n),bt(n),vt(n)]),await c.promiseAll();let s=[];for(let a of i)await Ae(a,n),await c.promiseAll(),!(!a.root&&!a.containingPackageJson)&&(await Xe(a),await Ve(a,n,e.skipDeps),s.push(ye(a)),(a.containingTypeScript||a.containingTypeScriptInPackages)&&s.push(lt(a,n)),(a.containingJavaScript||a.containingJavaScriptInPackages||a.containingTypeScript||a.containingTypeScriptInPackages)&&(n.willBoosterConfigs||s.push(Ie(a,n)),s.push(De(a))));await Promise.all(s),await c.promiseAll(),w("yarn",["cleanup"],t),w("yarn",["install"],t)}}hn().then();
|
263
267
|
//# sourceMappingURL=index.min.cjs.map
|
package/dist/index.min.cjs.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../src/index.ts", "../src/generators/asdf.ts", "../src/options.ts", "../src/logger.ts", "../src/utils/promisePool.ts", "../src/utils/spawnUtil.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/generators/idea.ts", "../src/generators/lintstagedrc.ts", "../src/utils/eslintUtil.ts", "../src/utils/srcDirectories.ts", "../src/generators/packageJson.ts", "../src/generators/prettierignore.ts", "../src/generators/readme.ts", "../src/generators/releaserc.ts", "../src/generators/renovaterc.ts", "../src/generators/tsconfig.ts", "../src/utils/objectUtil.ts", "../src/generators/workflow.ts", "../src/generators/yarnrc.ts", "../src/utils/githubUtil.ts", "../src/github/label.ts", "../src/github/secret.ts", "../src/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 { generateReadme } from './generators/readme';\nimport { generateReleaserc } from './generators/releaserc';\nimport { generateRenovateJson } from './generators/renovaterc';\nimport { generateTsconfig } from './generators/tsconfig';\nimport { generateWorkflow } from './generators/workflow';\nimport { generateYarnrcYml } from './generators/yarnrc';\nimport { setupLabels } from './github/label';\nimport { setupSecrets } from './github/secret';\nimport { options } from './options';\nimport { getPackageConfig, PackageConfig } from './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 options.isVerbose = argv.verbose;\n\n for (const rootDirPath of argv._) {\n if (typeof rootDirPath === 'number') continue;\n\n const rootConfig = await getPackageConfig(rootDirPath);\n if (rootConfig === null) {\n console.error(`there is no valid package.json in ${rootDirPath}`);\n continue;\n }\n\n const subDirPaths = rootConfig.containingSubPackageJsons\n ? glob.sync('packages/*', { cwd: rootDirPath }).map((subDirPath) => path.resolve(rootDirPath, subDirPath))\n : [];\n const subPackageConfigs = (await Promise.all(subDirPaths.map((subDirPath) => getPackageConfig(subDirPath)))).filter(\n (config) => !!config\n ) as PackageConfig[];\n const allPackageConfigs = [rootConfig, ...subPackageConfigs];\n\n if (options.isVerbose) {\n for (const config of allPackageConfigs) {\n console.info(config);\n }\n }\n\n // Install tools via asdf at first\n await generateVersionConfigs(rootConfig);\n // Install yarn berry\n await generateYarnrcYml(rootConfig);\n await Promise.all([\n generateEditorconfig(rootConfig),\n generateGitattributes(rootConfig),\n generateHuskyrc(rootConfig),\n generateIdeaSettings(rootConfig),\n generateLintstagedrc(rootConfig),\n generateReadme(rootConfig),\n generateRenovateJson(rootConfig),\n generateReleaserc(rootConfig),\n generateWorkflow(rootConfig),\n setupSecrets(rootConfig),\n setupLabels(rootConfig),\n ]);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allPackageConfigs) {\n await generateGitignore(config, rootConfig);\n await promisePool.promiseAll();\n if (!config.root && !config.containingPackageJson) {\n continue;\n }\n await generatePrettierignore(config);\n await generatePackageJson(config, rootConfig, argv.skipDeps);\n\n promises.push(generateLintstagedrc(config));\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n promises.push(generateTsconfig(config, rootConfig));\n }\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n if (!rootConfig.willBoosterConfigs) {\n promises.push(generateEslintrc(config, rootConfig));\n }\n promises.push(generateEslintignore(config));\n }\n }\n await Promise.all(promises);\n await promisePool.promiseAll();\n\n spawnSync('yarn', ['cleanup'], rootDirPath);\n // 'yarn install' should be after `yarn cleanup` because yarn berry generates yarn.lock\n // corresponding to the contents of dependant sub-package in monorepo\n spawnSync('yarn', ['install'], rootDirPath);\n }\n}\n\nmain().then();\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateVersionConfigs(config: PackageConfig): Promise<void> {\n return logger.function('generateVersionConfigs', async () => {\n await core(config);\n });\n}\n\nasync function core(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.13', 0, lines);\n }\n if (config.depending.firebase) {\n updateLine('java adoptopenjdk-17.0.2+8', 0, lines);\n }\n if (config.containingPackageJson) {\n const version = spawnSyncWithStringResult('npm', ['show', 'yarn', 'version'], config.dirPath);\n updateLine(`yarn ${version}`, 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 await promisePool.promiseAll();\n spawnSync('asdf', ['install'], config.dirPath);\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", "class Options {\n isVerbose: boolean;\n\n constructor() {\n this.isVerbose = false;\n }\n}\n\nexport const options = new Options();\n", "import { options } from './options';\n\nclass Logger {\n async function(name: string, func: () => Promise<void>): Promise<void> {\n if (options.isVerbose) {\n console.info(`--------- ${name} start ---------`);\n }\n await func();\n if (options.isVerbose) {\n console.info(`---------- ${name} end ----------`);\n }\n }\n}\n\nexport const logger = new Logger();\n", "import { PromisePool } from 'minimal-promise-pool';\n\nexport const promisePool = new PromisePool();\n", "import child_process from 'child_process';\n\nexport function spawnSync(command: string, args: string[], cwd: string, retry = 0): void {\n do {\n const [newCmd, newArgs, options] = getSpawnSyncArgs(command, args, cwd);\n console.log(`$ ${newCmd} ${newArgs.join(' ')} at ${options.cwd}`);\n const ret = child_process.spawnSync(newCmd, newArgs, 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 [newCmd, newArgs, options] = getSpawnSyncArgs(command, args, cwd);\n options.stdio = 'pipe';\n const proc = child_process.spawnSync(newCmd, newArgs, options);\n const error = proc.stderr.toString().trim();\n if (error) {\n console.error(`${newCmd} [${newArgs.map((s) => `\"${s}\"`)}] caused the following error:\\n ${error}`);\n }\n return proc.stdout.toString().trim();\n}\n\nexport function getSpawnSyncArgs(command: string, args: string[], cwd: string): [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 if (env.ASDF_DIR) {\n args = ['-l', '-c', `. ${env.ASDF_DIR}/asdf.sh && ${command} ${args.join(' ')}`];\n command = 'bash';\n }\n return [\n command,\n args,\n {\n cwd,\n env,\n shell: false,\n stdio: 'inherit',\n },\n ];\n}\n", "import path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateEditorconfig', async () => {\n const filePath = path.resolve(config.dirPath, '.editorconfig');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generateEslintignore', async () => {\n const filePath = path.resolve(config.dirPath, '.eslintignore');\n const userContent = (await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = (await IgnoreFileUtil.getExistingContent(gitignoreFilePath)) || '';\n\n const newContent = userContent + commonContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\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 async getExistingContent(filePath: string): Promise<string | null> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n return content\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 } catch (_) {\n return null;\n }\n },\n async getUserContent(filePath: string): Promise<string | null> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n const index = content.indexOf(this.separatorPrefix);\n if (index >= 0) {\n return content.substring(0, content.indexOf('\\n', index) + 1);\n }\n } catch (_) {\n // do nothing\n }\n return null;\n },\n async isBerryZeroInstallEnabled(filePath: string): Promise<boolean> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n return content.includes('\\n!.yarn/cache');\n } catch (_) {\n return false;\n }\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateEslintrc(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateEslintrc', async () => {\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}\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateGitattributes', async () => {\n const filePath = path.resolve(config.dirPath, '.gitattributes');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\n}\n", "import fs from 'fs';\nimport os from 'os';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { options } from '../options';\nimport { PackageConfig } from '../packageConfig';\nimport { fetchOnNode } from '../utils/fetchOnNode';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generateGitignore', async () => {\n const filePath = path.resolve(config.dirPath, '.gitignore');\n let userContent = ((await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent) + commonContent;\n\n const names = [...defaultNames];\n if (config.containingGemfile) {\n names.push('ruby');\n }\n if (config.containingGoMod) {\n names.push('go');\n userContent += `${path.basename(config.dirPath)}\n`;\n }\n if (config.containingPackageJson) {\n names.push('node');\n }\n if (config.containingPomXml) {\n names.push('maven');\n userContent += `.idea/google-java-format.xml\n`;\n }\n if (config.containingPubspecYaml) {\n names.push('flutter', 'AndroidStudio', 'ruby');\n userContent += `.flutter-plugins-dependencies\nandroid/key.properties\nios/.bundle\n.idea/runConfigurations.xml\n`;\n }\n if (config.containingTemplateYaml) {\n userContent += `.aws-sam/\npackaged.yaml\n`;\n }\n // Because .venv should be ignored on root directory\n if (config.containingPoetryLock) {\n names.push('python');\n }\n if (rootConfig.depending.firebase || config.depending.firebase) {\n names.push('firebase');\n }\n if (rootConfig.depending.reactNative || config.depending.reactNative) {\n names.push('reactnative');\n userContent += `google-services.json\nandroid/app/src/main/assets/\n`;\n }\n if (rootConfig.depending.storybook) {\n names.push('storybookjs');\n }\n if (rootConfig.depending.blitz) {\n names.push('nextjs');\n userContent += `.blitz/\n.blitz**\n`;\n }\n\n let generated = '';\n for (const name of names) {\n let content = (await readCache(name)) ?? '';\n if (!content) {\n const url = `https://www.toptal.com/developers/gitignore/api/${name}`;\n const response = await fetchOnNode(url);\n const responseText = await response.text();\n if (responseText.includes('Attention Required!')) {\n console.error(`Failed to fetch ${url}`);\n return;\n }\n content = responseText.trim();\n await promisePool.run(() => writeCache(name, content));\n if (options.isVerbose) {\n console.info(`Fetched ${url}`);\n }\n }\n if (generated) generated += '\\n';\n generated += content + '\\n';\n }\n if (!(await 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}\n\nconst dirPath = path.join(os.homedir(), '.cache', 'wbfy', 'gitignore');\n\nasync function writeCache(name: string, content: string): Promise<void> {\n await fs.promises.mkdir(dirPath, { recursive: true });\n await fs.promises.writeFile(path.join(dirPath, name), content);\n}\n\nasync function readCache(name: string): Promise<string | undefined> {\n try {\n const stat = await fs.promises.stat(path.join(dirPath, name));\n if (Date.now() - stat.mtimeMs > 6 * 60 * 60 * 1000) {\n return;\n }\n return await fs.promises.readFile(path.join(dirPath, name), 'utf-8');\n } catch {\n // do nothing\n }\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 { logger } from '../logger';\nimport { PackageConfig } from '../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\" ] && [ $(git config user.email) != \"exkazuu@gmail.com\" ]; 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 return logger.function('generateHuskyrc', async () => {\n await core(config);\n });\n}\n\nasync function core(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.containingPoetryLock) {\n postMergeCommands.push('poetry install');\n }\n if (config.depending.blitz || config.depending.prisma) {\n postMergeCommands.push('yarn gen-code');\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 fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateIdeaSettings', async () => {\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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\nimport { getSrcDirs } from '../utils/srcDirectories';\n\nexport async function generateLintstagedrc(config: PackageConfig): Promise<void> {\n return logger.function('generateLintstagedrc', async () => {\n await core(config);\n });\n}\n\nasync function core(config: PackageConfig): Promise<void> {\n const lines: string[] = [];\n if (config.containingJavaScript || config.containingTypeScript) {\n const eslint = `\n '${getEslintKey(config)}': [${JSON.stringify(\n `eslint --fix${EslintUtil.getLintFixSuffix(config)}`\n )}, '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 ? getEslintFilterForPrettier(config) : ''}\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\nfunction getEslintKey(config: PackageConfig): string {\n const dirs = getSrcDirs(config);\n return `./{${dirs.join(',')}}/**/*.{${extensions.eslint.join(',')}}`;\n}\n\nfunction getEslintFilterForPrettier(config: PackageConfig): string {\n return `files = micromatch.not(files, '${getEslintKey(config)}');`;\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 { PackageConfig } from '../packageConfig';\n\nconst srcDirectories = {\n node: ['src', '__tests__', 'scripts'],\n blitz: ['app', 'db', 'integrations', 'mailers', 'test'],\n};\n\nsrcDirectories.blitz = [...srcDirectories.node, ...srcDirectories.blitz];\n\nexport function getSrcDirs(config: PackageConfig): string[] {\n return config.depending.blitz ? srcDirectories.blitz : srcDirectories.node;\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { extensions } from '../utils/extensions';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\nimport { getSrcDirs } from '../utils/srcDirectories';\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 return logger.function('generatePackageJson', async () => {\n await core(config, skipAddingDeps);\n });\n}\n\nasync function core(config: PackageConfig, skipAddingDeps: boolean): 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(jsonObj.scripts, generateScripts(config));\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 if (!jsonObj.scripts['gen-code']?.startsWith('blitz codegen')) {\n jsonObj.scripts['gen-code'] = 'blitz codegen';\n }\n } else if (config.depending.prisma) {\n if (!jsonObj.scripts['gen-code']?.startsWith('prisma generate')) {\n jsonObj.scripts['gen-code'] = 'prisma generate';\n }\n }\n if (!Object.keys(jsonObj.dependencies).length) {\n delete jsonObj.dependencies;\n }\n if (!Object.keys(jsonObj.devDependencies).length) {\n delete jsonObj.devDependencies;\n }\n if (!Object.keys(jsonObj.peerDependencies).length) {\n delete jsonObj.peerDependencies;\n }\n\n await fs.promises.writeFile(filePath, JSON.stringify(jsonObj));\n\n if (!skipAddingDeps) {\n dependencies = dependencies.filter((dep) => !jsonObj.devDependencies?.[dep]);\n if (dependencies.length) {\n spawnSync('yarn', ['add', ...new Set(dependencies)], config.dirPath);\n }\n devDependencies = devDependencies.filter((dep) => !jsonObj.dependencies?.[dep]);\n if (devDependencies.length) {\n spawnSync('yarn', ['add', '-D', ...new Set(devDependencies)], config.dirPath);\n }\n if (poetryDependencies.length) {\n spawnSync('poetry', ['add', ...new Set(poetryDependencies)], config.dirPath);\n }\n }\n}\n\nasync function removeDeprecatedStuff(jsonObj: any): Promise<void> {\n // TODO: remove the following migration code in future\n if (jsonObj.author === 'WillBooster LLC') {\n jsonObj.author = 'WillBooster Inc.';\n }\n delete jsonObj.scripts['sort-package-json'];\n delete jsonObj.scripts['sort-all-package-json'];\n delete jsonObj.scripts['typecheck:codegen'];\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\nfunction generateScripts(config: PackageConfig): Record<string, string> {\n let scripts = {\n cleanup: 'yarn format && yarn lint-fix',\n format: `sort-package-json && yarn prettify`,\n lint: `eslint --color \"./{${getSrcDirs(config)}}/**/*.{${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 if (config.containingSubPackageJsons) {\n scripts = merge(\n { ...scripts },\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 }\n if (config.depending.blitz) {\n scripts.typecheck = `${scripts.typecheck} || yarn run typecheck/warn`;\n (scripts as any)['typecheck/warn'] = `echo 'Please try \"yarn gen-code\" if you face unknown type errors.' && exit 1`;\n (scripts as any)['typecheck:gen-code'] = 'yarn gen-code && tsc --noEmit --Pretty';\n }\n return scripts;\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generatePrettierignore', async () => {\n const filePath = path.resolve(config.dirPath, '.prettierignore');\n const userContent = (await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = (await 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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateReadme(config: PackageConfig): Promise<void> {\n return logger.function('generateReadme', async () => {\n const filePath = path.resolve(config.dirPath, 'README.md');\n let newContent = await fs.promises.readFile(filePath, 'utf8');\n\n const useSemanticRelease = fs.existsSync(path.resolve(config.dirPath, '.releaserc.json'));\n if (useSemanticRelease) {\n // TODO: README\u3092\u30D1\u30FC\u30B9\u3057\u3066\u3001\n // [](https://github.com/semantic-release/semantic-release)\n // \u304C\u5B58\u5728\u3059\u308B\u304B\u3069\u3046\u304B\u3092\u78BA\u8A8D\u3059\u308B\u3002\n // \u5B58\u5728\u3057\u306A\u3051\u308C\u3070\u3001 newContent \u306E\u826F\u3044\u611F\u3058\u306E\u5834\u6240\u306B\u8FFD\u8A18\u3059\u308B\u3002\n // \u826F\u3044\u611F\u3058\u306E\u5834\u6240\u306B\u8FFD\u8A18\u3059\u308B\u3053\u3068\u304C\u5C11\u3057\u96E3\u3057\u305D\u3046\u3002\n newContent = newContent + '';\n }\n\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateReleaserc(rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateReleaserc', async () => {\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 const plugin = Array.isArray(plugins[i]) ? plugins[i][0] : plugins[i];\n if (plugin === '@semantic-release/commit-analyzer') {\n plugins[i] = [\n '@semantic-release/commit-analyzer',\n {\n preset: 'conventionalcommits',\n },\n ];\n } else if (plugin === '@semantic-release/github' && !rootConfig.publicRepo) {\n plugins[i] = ['@semantic-release/github', { successComment: false }];\n }\n }\n const newContent = JSON.stringify(settings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } catch (_) {\n // do nothing\n }\n });\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst jsonObj = {\n extends: ['@willbooster'],\n};\n\nexport async function generateRenovateJson(config: PackageConfig): Promise<void> {\n return logger.function('generateRenovateJson', async () => {\n let newSettings: any = cloneDeep(jsonObj);\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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst rootJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react-jsx',\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 'scripts/**/*',\n 'packages/*/src/**/*',\n 'packages/*/__tests__/**/*',\n 'packages/*/scripts/**/*',\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-jsx',\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__/**/*', 'scripts/**/*', '../../node_modules/@types', '../../@types', './@types'],\n};\n\nexport async function generateTsconfig(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateTsconfig', async () => {\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}\n", "export function sortKeys<T>(obj: any): T {\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 return obj;\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst testWorkflow = {\n name: 'Test',\n on: {\n pull_request: null,\n push: {\n branches: ['main', 'wbfy', 'renovate/**'],\n },\n },\n jobs: {\n test: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/test.yml@main',\n },\n },\n};\n\nconst releaseWorkflow = {\n name: 'Release',\n on: {\n push: {\n branches: [],\n },\n },\n jobs: {\n release: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/release.yml@main',\n },\n },\n};\n\nconst wbfyWorkflow = {\n name: 'Willboosterify',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n wbfy: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main',\n },\n },\n};\n\nconst wbfyMergeWorkflow = {\n name: 'Merge wbfy',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n 'wbfy-merge': {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy-merge.yml@main',\n },\n },\n};\n\nconst semanticPullRequestWorkflow = {\n name: 'Lint PR title',\n on: {\n pull_request_target: {\n types: ['opened', 'edited', 'synchronize'],\n },\n },\n jobs: {\n 'semantic-pr': {\n uses: 'WillBooster/reusable-workflows/.github/workflows/semantic-pr.yml@main',\n },\n },\n};\n\nconst notifyReadyWorkflow = {\n name: 'Notify ready',\n on: {\n issues: {\n types: ['labeled'],\n },\n },\n jobs: {\n 'notify-ready': {\n uses: 'WillBoosterLab/reusable-workflows/.github/workflows/notify-ready.yml@main',\n secrets: {\n DISCORD_WEBHOOK_URL: '${{ secrets.READY_DISCORD_WEBHOOK_URL }}',\n },\n },\n },\n};\n\nconst closeComment = {\n name: 'editComment',\n on: {\n pull_request: {\n types: ['opened'],\n },\n },\n jobs: {\n 'close-comment': {\n uses: 'WillBoosterLab/reusable-workflows/.github/ workflows/close-comment.yml@main',\n },\n },\n};\n\ntype KnownKind = 'test' | 'release' | 'sync' | 'wbfy' | 'wbfy-merge' | 'semantic-pr' | 'notify-ready' | 'close-comment';\n\nexport async function generateWorkflow(rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateWorkflow', async () => {\n const workflowsPath = path.resolve(rootConfig.dirPath, '.github', 'workflows');\n await fs.promises.mkdir(workflowsPath, { recursive: true });\n\n // Remove config of semantic pull request\n const semanticYmlPath = path.resolve(rootConfig.dirPath, '.github', 'semantic.yml');\n await promisePool.run(() => fs.promises.rm(semanticYmlPath, { force: true, 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 if (rootConfig.publicRepo || rootConfig.repository?.startsWith('github:WillBoosterLab/')) {\n fileNames.push('notify-ready.yml');\n }\n fileNames.push('test.yml', 'wbfy.yml', 'wbfy-merge.yml', 'semantic-pr.yml', 'close-comment.yml');\n\n for (const fileName of fileNames) {\n // \u5B9F\u969B\u306FKnownKind\u4EE5\u5916\u306E\u5024\u3082\u4EE3\u5165\u3055\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\n const kind = path.basename(fileName, '.yml') as KnownKind;\n await promisePool.run(() => writeWorkflowYaml(rootConfig, workflowsPath, kind));\n }\n });\n}\n\nasync function writeWorkflowYaml(config: PackageConfig, workflowsPath: string, kind: KnownKind): 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 } else if (kind === 'wbfy-merge') {\n newSettings = wbfyMergeWorkflow;\n } else if (kind === 'semantic-pr') {\n newSettings = semanticPullRequestWorkflow;\n } else if (kind === 'notify-ready') {\n newSettings = notifyReadyWorkflow;\n } else if (kind === 'close-comment') {\n newSettings = closeComment;\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 for (const job of Object.values(newSettings.jobs) as any[]) {\n // Ignore non-reusable workflows\n if (!job.uses?.includes?.('/reusable-workflows/')) return;\n\n normalizeJob(config, job, kind);\n }\n\n if (kind === 'release') {\n if (newSettings.on.schedule) {\n delete newSettings.on.push;\n } else {\n newSettings.on.push.branches = config.release.branches;\n }\n } else if (kind === 'wbfy') {\n setSchedule(newSettings, 20, 24);\n } else if (kind === 'wbfy-merge') {\n setSchedule(newSettings, 0, 4);\n }\n await writeYaml(newSettings, filePath);\n\n if (kind === 'release') {\n await fs.promises.rm(path.join(workflowsPath, 'semantic-release.yml'), { force: true });\n } else if (kind === 'sync') {\n await fs.promises.rm(path.join(workflowsPath, 'sync-init.yml'), { force: true });\n if (!newSettings.jobs.sync) return;\n\n newSettings.jobs['sync-force'] = newSettings.jobs.sync;\n const params = newSettings.jobs.sync.with.sync_params_without_dest;\n if (!params) return;\n\n newSettings.jobs.sync.with.sync_params_without_dest = `--force ${params}`;\n newSettings.name = 'Force to Sync';\n newSettings.on = { workflow_dispatch: null };\n delete newSettings.jobs.sync;\n await writeYaml(newSettings, path.join(workflowsPath, 'sync-force.yml'));\n }\n}\n\nfunction normalizeJob(config: PackageConfig, job: any, kind: KnownKind): void {\n job.with ||= {};\n job.secrets ||= {};\n\n if ((config.release.github && kind === 'test') || kind === 'release' || kind === 'wbfy' || kind === 'wbfy-merge') {\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 (kind === 'sync') {\n const params = job.with?.sync_params_without_dest;\n if (params) {\n job.with.sync_params_without_dest = params.replace('sync ', '');\n }\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 delete job.with['non_self_hosted'];\n if (config.containingDockerfile && kind.startsWith('deploy')) {\n job.with['cpu_arch'] = 'X64';\n }\n // Because github.event.repository.private is always true if job is scheduled\n if (kind === 'release' || kind === 'test' || kind === 'wbfy' || kind === 'wbfy-merge' || kind.startsWith('deploy')) {\n if (config.publicRepo) {\n job.with['github_hosted_runner'] = true;\n }\n } else {\n delete job.with['github_hosted_runner'];\n }\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 const newSecrets = sortKeys(job.secrets);\n delete job.secrets;\n job.secrets = newSecrets;\n } else {\n delete job.secrets;\n }\n}\n\nfunction setSchedule(newSettings: any, inclusiveMinHourJst: number, exclusiveMaxHourJst: number): void {\n const [minuteUtc, hourUtc] = ((newSettings.on.schedule?.[0]?.cron as string) ?? '').split(' ').map(Number);\n if (minuteUtc !== 0 && Number.isInteger(hourUtc)) {\n const hourJst = (hourUtc + 9) % 24;\n const inRange =\n inclusiveMinHourJst < exclusiveMaxHourJst\n ? inclusiveMinHourJst <= hourJst && hourJst < exclusiveMaxHourJst\n : inclusiveMinHourJst <= hourJst || hourJst < exclusiveMaxHourJst;\n if (inRange) return;\n }\n\n const minJst = 1 + Math.floor(Math.random() * 59);\n const hourJst = inclusiveMinHourJst + Math.floor(Math.random() * (exclusiveMaxHourJst - inclusiveMinHourJst));\n const cron = `${minJst} ${(hourJst - 9 + 24) % 24} * * *`;\n newSettings.on.schedule = [{ cron }];\n}\n\nasync function writeYaml(newSettings: any, filePath: string): Promise<void> {\n const yamlText = yaml.dump(newSettings, {\n lineWidth: -1,\n noCompatMode: true,\n styles: {\n '!!null': 'empty',\n },\n });\n await fs.promises.writeFile(filePath, yamlText);\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateYarnrcYml(config: PackageConfig): Promise<void> {\n return logger.function('generateYarnrcYml', async () => {\n const currentVersion = spawnSyncWithStringResult('yarn', ['--version'], config.dirPath);\n const latestVersion = getLatestVersion('@yarnpkg/cli', config.dirPath);\n if (getMajorNumber(currentVersion) <= getMajorNumber(latestVersion) && currentVersion !== latestVersion) {\n spawnSync('yarn', ['set', 'version', latestVersion], config.dirPath, 1);\n }\n\n const releasesPath = path.join(config.dirPath, '.yarn', 'releases');\n await fs.promises.mkdir(releasesPath, { recursive: true });\n for (const file of await fs.promises.readdir(releasesPath)) {\n if (file.startsWith('yarn-') && !file.startsWith(`yarn-${latestVersion}.`)) {\n await promisePool.run(() => fs.promises.rm(path.join(releasesPath, file)));\n console.log('Removed', path.join(releasesPath, file));\n }\n }\n\n const yarnrcPath = path.resolve(config.dirPath, '.yarnrc');\n await promisePool.run(() => fs.promises.rm(yarnrcPath, { force: true }));\n\n const yarnrcYmlPath = path.resolve(config.dirPath, '.yarnrc.yml');\n const settings = yaml.load(await fs.promises.readFile(yarnrcYmlPath, 'utf8')) as any;\n settings.defaultSemverRangePrefix = '';\n if (config.requiringNodeModules) {\n settings.nodeLinker = 'node-modules';\n settings.nmMode = 'hardlinks-global';\n }\n await fs.promises.writeFile(yarnrcYmlPath, yaml.dump(settings, { lineWidth: -1 }));\n\n const plugins = (settings.plugins || []).map((p: any) => p.spec as string);\n const requireTypeScript = config.containingTypeScript || config.containingTypeScriptInPackages;\n importOrRemovePlugin(config, plugins, requireTypeScript, '@yarnpkg/plugin-typescript');\n if (requireTypeScript && !config.requiringNodeModules) {\n spawnSync('yarn', ['dlx', '@yarnpkg/sdks', 'vscode'], config.dirPath);\n }\n importOrRemovePlugin(config, plugins, config.containingSubPackageJsons, '@yarnpkg/plugin-workspace-tools');\n spawnSync('yarn', ['dlx', 'yarn-plugin-auto-install'], config.dirPath);\n });\n}\n\nexport function getLatestVersion(packageName: string, dirPath: string): string {\n const versionsJson = spawnSyncWithStringResult('npm', ['show', packageName, 'versions', '--json'], dirPath);\n const versions = JSON.parse(versionsJson) as string[];\n return versions[versions.length - 1];\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\nfunction getMajorNumber(version: string): number {\n const [major] = version.split('.');\n return Number(major);\n}\n", "import { Octokit } from '@octokit/core';\n\nconst token =\n process.env.GH_BOT_PAT || process.env.PUBLIC_GH_BOT_PAT || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\nexport const hasGitHubToken = !!token;\nexport const octokit = new Octokit({\n auth: token,\n});\n\nclass GitHubUtil {\n getOrgAndName(urlOrFullName: string): [string, string] {\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 return [org, name];\n }\n}\n\nexport const gitHubUtil = new GitHubUtil();\n", "import { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { gitHubUtil, hasGitHubToken, octokit } from '../utils/githubUtil';\n\nexport async function setupLabels(config: PackageConfig): Promise<void> {\n return logger.function('setupLabels', async () => {\n if (!hasGitHubToken) return;\n\n const [owner, repo] = gitHubUtil.getOrgAndName(config.repository ?? '');\n if (!owner || !repo) return;\n if (!config.publicRepo && owner === 'WillBooster') return;\n\n try {\n await setupLabel(owner, repo, 'ready', '0E8A16');\n await setupLabel(owner, repo, 'review requested', 'FBCA04');\n } catch (e) {\n console.warn('Skip setupLabels due to:', (e as Error)?.stack ?? e);\n }\n });\n}\n\nasync function setupLabel(owner: string, repo: string, name: string, color: string): Promise<void> {\n try {\n await octokit.request('POST /repos/{owner}/{repo}/labels', {\n owner,\n repo,\n name,\n color,\n });\n } catch (e) {\n await octokit.request('PATCH /repos/{owner}/{repo}/labels/{name}', {\n owner,\n repo,\n name,\n color,\n });\n }\n}\n", "import dotenv from 'dotenv';\nimport sodium from 'libsodium-wrappers';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { gitHubUtil, hasGitHubToken, octokit } from '../utils/githubUtil';\n\nexport async function setupSecrets(config: PackageConfig): Promise<void> {\n return logger.function('setupSecrets', async () => {\n if (!hasGitHubToken) return;\n\n const [owner, repo] = gitHubUtil.getOrgAndName(config.repository ?? '');\n if (!owner || !repo || owner !== 'WillBoosterLab') return;\n\n const parsed = dotenv.config().parsed || {};\n if (Object.keys(parsed).length === 0) return;\n\n try {\n const response = await octokit.request('GET /repos/{owner}/{repo}/actions/secrets/public-key', {\n owner,\n repo,\n });\n const { key, key_id: keyId } = response.data;\n\n await sodium.ready;\n\n for (const [name, secret] of Object.entries(parsed)) {\n if (config.publicRepo && name === 'GH_BOT_PAT') continue;\n if (!config.publicRepo && name === 'PUBLIC_GH_BOT_PAT') continue;\n\n // Convert Secret & Base64 key to Uint8Array.\n const rawKey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL);\n const rawSec = sodium.from_string(secret);\n\n // Encrypt the secret using LibSodium\n const encBytes = sodium.crypto_box_seal(rawSec, rawKey);\n\n // Convert encrypted Uint8Array to Base64\n const encBase64 = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL);\n\n await octokit.request('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', {\n owner,\n repo,\n secret_name: name,\n encrypted_value: encBase64,\n key_id: keyId,\n });\n }\n } catch (e) {\n console.warn('Skip setupSecrets due to:', (e as Error)?.stack ?? e);\n }\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 { gitHubUtil, octokit } from './utils/githubUtil';\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__|scripts)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScript: glob.sync('@(app|src|__tests__|scripts)/**/*.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__|scripts)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__|scripts)/**/*.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 [org, name] = gitHubUtil.getOrgAndName(urlOrFullName);\n if (!org || !name) return;\n\n const ret = { full_name: `${org}/${name}` };\n try {\n const response = await octokit.request('GET /repos/{owner}/{repo}', {\n owner: org,\n repo: name,\n });\n Object.assign(ret, response.data);\n } catch (e) {\n // do nothing\n }\n return ret;\n}\n"],
|
5
|
-
"mappings": "ueAAA,IAAAA,GAAiB,mBAEjBC,GAAiB,mBACjBC,GAAkB,oBCHlB,IAAAC,EAAe,iBACfC,GAAiB,mBCDjB,IAAMC,GAAN,KAAc,CAGZ,aAAc,CACZ,KAAK,UAAY,EACnB,CACF,EAEaC,EAAU,IAAID,GCN3B,IAAME,GAAN,KAAa,CACX,MAAM,SAASC,EAAcC,EAA0C,CACjEC,EAAQ,WACV,QAAQ,KAAK,aAAaF,mBAAsB,EAElD,MAAMC,EAAK,EACPC,EA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CAAC,EACnC,QAAWhB,KAAUC,EACnB,MAAMgB,GAAkBjB,EAAQP,CAAU,EAC1C,MAAMsB,EAAY,WAAW,EACzB,GAACf,EAAO,MAAQ,CAACA,EAAO,yBAG5B,MAAMkB,GAAuBlB,CAAM,EACnC,MAAMmB,GAAoBnB,EAAQP,EAAYJ,EAAK,QAAQ,EAE3D2B,EAAS,KAAKR,GAAqBR,CAAM,CAAC,GACtCA,EAAO,sBAAwBA,EAAO,iCACxCgB,EAAS,KAAKI,GAAiBpB,EAAQP,CAAU,CAAC,GAGlDO,EAAO,sBACPA,EAAO,gCACPA,EAAO,sBACPA,EAAO,kCAEFP,EAAW,oBACduB,EAAS,KAAKK,GAAiBrB,EAAQP,CAAU,CAAC,EAEpDuB,EAAS,KAAKM,GAAqBtB,CAAM,CAAC,IAG9C,MAAM,QAAQ,IAAIgB,CAAQ,EAC1B,MAAMD,EAAY,WAAW,EAE7BQ,EAAU,OAAQ,CAAC,SAAS,EAAG/B,CAAW,EAG1C+B,EAAU,OAAQ,CAAC,SAAS,EAAG/B,CAAW,CAC5C,CACF,CAEAJ,GAAK,EAAE,KAAK",
|
6
|
-
"names": ["import_path", "import_glob", "import_yargs", "import_fs", "import_path", "Options", "options", "Logger", "name", "func", "options", "logger", "import_minimal_promise_pool", "promisePool", "import_child_process", "spawnSync", "command", "args", "cwd", "retry", "newCmd", "newArgs", "options", "getSpawnSyncArgs", "child_process", "spawnSyncWithStringResult", "proc", "error", "s", "env", "generateVersionConfigs", "config", "logger", "core", "lines", "versionText", "line", "version", "promisePool", "fs", "path", "updateLine", "spawnSyncWithStringResult", "toolVersionsPath", "spawnSync", "insertionIndex", "prefix", "index", "l", "import_path", "extensions", "import_promises", "FsUtil", "filePath", "content", "fsp", "newContent", "generateExtensions", "extensions", "generateEditorconfig", "config", "logger", "filePath", "path", "promisePool", "FsUtil", "import_path", "import_fs", "IgnoreFileUtil", "filePath", "fs", "content", "index", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generateEslintignore", "config", "logger", "filePath", "path", "userContent", "gitignoreFilePath", "gitignoreContent", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_deepmerge", "overwriteMerge", "destinationArray", "sourceArray", "combineMerge", "target", "source", "options", "destination", "item", "index", "merge", "generateEslintrc", "config", "rootConfig", "logger", "bases", "newSettings", "filePath", "path", "oldContent", "fs", "oldSettings", "ext", "newExtends", "merge", "combineMerge", "e", "newContent", "promisePool", "FsUtil", "import_path", "newContent", "extensions", "ext", "generateGitattributes", "config", "logger", "filePath", "path", "promisePool", "FsUtil", "import_fs", "import_os", "import_path", "fetchOnNode", "url", "init", "nodeFetch", "defaultNames", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generateGitignore", "config", "rootConfig", "logger", "filePath", "path", "userContent", "names", "generated", "name", "content", "readCache", "url", "responseText", "fetchOnNode", "promisePool", "writeCache", "options", "newContent", "FsUtil", "dirPath", "os", "fs", "stat", "import_fs", "import_path", "DEFAULT_COMMAND", "settings", "generateHuskyrc", "config", "logger", "core", "_a", "_b", "packageJsonPath", "path", "jsonText", "fs", "packageJson", "dirPath", "spawnSync", "preCommitFilePath", "content", "promisePool", "prePush", "postMergeCommands", "postMergeCommand", "import_fs", "import_path", "newContent", "generateIdeaSettings", "config", "logger", "dirPath", "path", "fs", "filePath", "promisePool", "FsUtil", "import_fs", "import_path", "EslintUtil", "config", "srcDirectories", "getSrcDirs", "config", "generateLintstagedrc", "config", "logger", "core", "lines", "eslint", "getEslintKey", "EslintUtil", "packagesFilter", "extensions", "getEslintFilterForPrettier", "newContent", "filePath", "path", "promisePool", "fs", "FsUtil", "getSrcDirs", "import_fs", "import_path", "import_deepmerge", "jsCommonDeps", "tsCommonDeps", "reactCommonDeps", "devDeps", "generatePackageJson", "config", "rootConfig", "skipAddingDeps", "logger", "core", "_a", "_b", "filePath", "path", "jsonText", "fs", "jsonObj", "removeDeprecatedStuff", "scriptKey", "merge", "generateScripts", "generatePrettierSuffix", "dependencies", "devDependencies", "poetryDependencies", "dep", "EslintUtil", "dirs", "dir", "dirNames", "dirName", "dirPath", "fileName", "d", "spawnSync", "deps", "promisePool", "scripts", "getSrcDirs", "extensions", "existingContent", "index", "IgnoreFileUtil", "line", "newLine", "l", "import_path", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generatePrettierignore", "config", "logger", "filePath", "path", "userContent", "gitignoreFilePath", "gitignoreContent", "additionalContent", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "generateReadme", "config", "logger", "filePath", "path", "newContent", "fs", "promisePool", "FsUtil", "import_fs", "import_path", "generateReleaserc", "rootConfig", "logger", "filePath", "path", "settings", "fs", "plugins", "plugin", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_lodash", "jsonObj", "generateRenovateJson", "config", "logger", "newSettings", "cloneDeep", "filePath", "path", "oldContent", "fs", "oldSettings", "merge", "overwriteMerge", "promisePool", "newContent", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_lodash", "sortKeys", "obj", "keyAndValues", "key1", "key2", "key", "value", "rootJsonObj", "subJsonObj", "generateTsconfig", "config", "rootConfig", "logger", "_a", "_b", "_c", "newSettings", "cloneDeep", "dirPath", "relativeDirPath", "path", "filePath", "existingContent", "fs", "oldSettings", "merge", "overwriteMerge", "sortKeys", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_js_yaml", "import_lodash", "testWorkflow", "releaseWorkflow", "wbfyWorkflow", "wbfyMergeWorkflow", "semanticPullRequestWorkflow", "notifyReadyWorkflow", "closeComment", "generateWorkflow", "rootConfig", "logger", "_a", "workflowsPath", "path", "fs", "semanticYmlPath", "promisePool", "fileNames", "dirent", "fileName", "kind", "writeWorkflowYaml", "config", "_b", "newSettings", "cloneDeep", "filePath", "oldContent", "oldSettings", "yaml", "merge", "combineMerge", "job", "normalizeJob", "setSchedule", "writeYaml", "params", "_c", "sortKeys", "newSecrets", "inclusiveMinHourJst", "exclusiveMaxHourJst", "minuteUtc", "hourUtc", "hourJst", "minJst", "cron", "yamlText", "import_fs", "import_path", "import_js_yaml", "generateYarnrcYml", "config", "logger", "currentVersion", "spawnSyncWithStringResult", "latestVersion", "getLatestVersion", "getMajorNumber", "spawnSync", "releasesPath", "path", "fs", "file", "promisePool", "yarnrcPath", "yarnrcYmlPath", "settings", "yaml", "plugins", "p", "requireTypeScript", "importOrRemovePlugin", "packageName", "dirPath", "versionsJson", "versions", "requirePlugin", "plugin", "version", "major", "import_core", "token", "hasGitHubToken", "octokit", "GitHubUtil", "urlOrFullName", "_a", "urlWithoutProtocol", "names", "org", "name", "gitHubUtil", "setupLabels", "config", "logger", "hasGitHubToken", "owner", "repo", "gitHubUtil", "setupLabel", "e", "name", "color", "octokit", "import_dotenv", "import_libsodium_wrappers", "setupSecrets", "config", "logger", "hasGitHubToken", "owner", "repo", "gitHubUtil", "parsed", "dotenv", "response", "octokit", "key", "keyId", "sodium", "name", "secret", "rawKey", "rawSec", "encBytes", "encBase64", "e", "import_fs", "import_promises", "import_path", "import_glob", "import_js_yaml", "import_simple_git", "getPackageConfig", "dirPath", "_a", "packageJsonPath", "path", "containingPackageJson", "fs", "dependencies", "devDependencies", "packageJson", "packageJsonText", "requiringNodeModules", "yarnrcYmlPath", "doc", "yaml", "fsp", "releaseBranches", "releasePlugins", "releasercJsonPath", "json", "isRoot", "repoInfo", "getRepoInfo", "toolVersionsPath", "versionsText", "config", "glob", "getEslintExtensionBase", "_b", "_c", "origin", "r", "remoteUrl", "fetchRepoInfo", "url", "urlOrFullName", "org", "name", "gitHubUtil", "ret", "response", "octokit", "main", "argv", "yargs", "options", "rootDirPath", "rootConfig", "getPackageConfig", "subDirPaths", "glob", "subDirPath", "path", "subPackageConfigs", "config", "allPackageConfigs", "generateVersionConfigs", "generateYarnrcYml", "generateEditorconfig", "generateGitattributes", "generateHuskyrc", "generateIdeaSettings", "generateLintstagedrc", "generateReadme", "generateRenovateJson", "generateReleaserc", "generateWorkflow", "setupSecrets", "setupLabels", "promisePool", "promises", "generateGitignore", "generatePrettierignore", "generatePackageJson", "generateTsconfig", "generateEslintrc", "generateEslintignore", "spawnSync"]
|
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 { generateReadme } from './generators/readme';\nimport { generateReleaserc } from './generators/releaserc';\nimport { generateRenovateJson } from './generators/renovaterc';\nimport { generateTsconfig } from './generators/tsconfig';\nimport { generateWorkflow } from './generators/workflow';\nimport { generateYarnrcYml } from './generators/yarnrc';\nimport { setupLabels } from './github/label';\nimport { setupSecrets } from './github/secret';\nimport { options } from './options';\nimport { getPackageConfig, PackageConfig } from './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 options.isVerbose = argv.verbose;\n\n for (const rootDirPath of argv._) {\n if (typeof rootDirPath === 'number') continue;\n\n const rootConfig = await getPackageConfig(rootDirPath);\n if (rootConfig === null) {\n console.error(`there is no valid package.json in ${rootDirPath}`);\n continue;\n }\n\n const subDirPaths = rootConfig.containingSubPackageJsons\n ? glob.sync('packages/*', { cwd: rootDirPath }).map((subDirPath) => path.resolve(rootDirPath, subDirPath))\n : [];\n const subPackageConfigs = (await Promise.all(subDirPaths.map((subDirPath) => getPackageConfig(subDirPath)))).filter(\n (config) => !!config\n ) as PackageConfig[];\n const allPackageConfigs = [rootConfig, ...subPackageConfigs];\n\n if (options.isVerbose) {\n for (const config of allPackageConfigs) {\n console.info(config);\n }\n }\n\n // Install tools via asdf at first\n await generateVersionConfigs(rootConfig);\n // Install yarn berry\n await generateYarnrcYml(rootConfig);\n await Promise.all([\n generateEditorconfig(rootConfig),\n generateGitattributes(rootConfig),\n generateHuskyrc(rootConfig),\n generateIdeaSettings(rootConfig),\n generateLintstagedrc(rootConfig),\n generateReadme(rootConfig),\n generateRenovateJson(rootConfig),\n generateReleaserc(rootConfig),\n generateWorkflow(rootConfig),\n setupSecrets(rootConfig),\n setupLabels(rootConfig),\n ]);\n await promisePool.promiseAll();\n\n const promises: Promise<void>[] = [];\n for (const config of allPackageConfigs) {\n await generateGitignore(config, rootConfig);\n await promisePool.promiseAll();\n if (!config.root && !config.containingPackageJson) {\n continue;\n }\n await generatePrettierignore(config);\n await generatePackageJson(config, rootConfig, argv.skipDeps);\n\n promises.push(generateLintstagedrc(config));\n if (config.containingTypeScript || config.containingTypeScriptInPackages) {\n promises.push(generateTsconfig(config, rootConfig));\n }\n if (\n config.containingJavaScript ||\n config.containingJavaScriptInPackages ||\n config.containingTypeScript ||\n config.containingTypeScriptInPackages\n ) {\n if (!rootConfig.willBoosterConfigs) {\n promises.push(generateEslintrc(config, rootConfig));\n }\n promises.push(generateEslintignore(config));\n }\n }\n await Promise.all(promises);\n await promisePool.promiseAll();\n\n spawnSync('yarn', ['cleanup'], rootDirPath);\n // 'yarn install' should be after `yarn cleanup` because yarn berry generates yarn.lock\n // corresponding to the contents of dependant sub-package in monorepo\n spawnSync('yarn', ['install'], rootDirPath);\n }\n}\n\nmain().then();\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateVersionConfigs(config: PackageConfig): Promise<void> {\n return logger.function('generateVersionConfigs', async () => {\n await core(config);\n });\n}\n\nasync function core(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.13', 0, lines);\n }\n if (config.depending.firebase) {\n updateLine('java adoptopenjdk-17.0.2+8', 0, lines);\n }\n if (config.containingPackageJson) {\n const version = spawnSyncWithStringResult('npm', ['show', 'yarn', 'version'], config.dirPath);\n updateLine(`yarn ${version}`, 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 await promisePool.promiseAll();\n spawnSync('asdf', ['install'], config.dirPath);\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", "class Options {\n isVerbose: boolean;\n\n constructor() {\n this.isVerbose = false;\n }\n}\n\nexport const options = new Options();\n", "import { options } from './options';\n\nclass Logger {\n async function(name: string, func: () => Promise<void>): Promise<void> {\n if (options.isVerbose) {\n console.info(`--------- ${name} start ---------`);\n }\n await func();\n if (options.isVerbose) {\n console.info(`---------- ${name} end ----------`);\n }\n }\n}\n\nexport const logger = new Logger();\n", "import { PromisePool } from 'minimal-promise-pool';\n\nexport const promisePool = new PromisePool();\n", "import child_process from 'child_process';\n\nexport function spawnSync(command: string, args: string[], cwd: string, retry = 0): void {\n do {\n const [newCmd, newArgs, options] = getSpawnSyncArgs(command, args, cwd);\n console.log(`$ ${newCmd} ${newArgs.join(' ')} at ${options.cwd}`);\n const ret = child_process.spawnSync(newCmd, newArgs, 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 [newCmd, newArgs, options] = getSpawnSyncArgs(command, args, cwd);\n options.stdio = 'pipe';\n const proc = child_process.spawnSync(newCmd, newArgs, options);\n const error = proc.stderr.toString().trim();\n if (error) {\n console.error(`${newCmd} [${newArgs.map((s) => `\"${s}\"`)}] caused the following error:\\n ${error}`);\n }\n return proc.stdout.toString().trim();\n}\n\nexport function getSpawnSyncArgs(command: string, args: string[], cwd: string): [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 if (env.ASDF_DIR) {\n args = ['-l', '-c', `. ${env.ASDF_DIR}/asdf.sh && ${command} ${args.join(' ')}`];\n command = 'bash';\n }\n return [\n command,\n args,\n {\n cwd,\n env,\n shell: false,\n stdio: 'inherit',\n },\n ];\n}\n", "import path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateEditorconfig', async () => {\n const filePath = path.resolve(config.dirPath, '.editorconfig');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generateEslintignore', async () => {\n const filePath = path.resolve(config.dirPath, '.eslintignore');\n const userContent = (await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = (await IgnoreFileUtil.getExistingContent(gitignoreFilePath)) || '';\n\n const newContent = userContent + commonContent + gitignoreContent;\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\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 async getExistingContent(filePath: string): Promise<string | null> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n return content\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 } catch (_) {\n return null;\n }\n },\n async getUserContent(filePath: string): Promise<string | null> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n const index = content.indexOf(this.separatorPrefix);\n if (index >= 0) {\n return content.substring(0, content.indexOf('\\n', index) + 1);\n }\n } catch (_) {\n // do nothing\n }\n return null;\n },\n async isBerryZeroInstallEnabled(filePath: string): Promise<boolean> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n return content.includes('\\n!.yarn/cache');\n } catch (_) {\n return false;\n }\n },\n};\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateEslintrc(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateEslintrc', async () => {\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}\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateGitattributes', async () => {\n const filePath = path.resolve(config.dirPath, '.gitattributes');\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\n}\n", "import fs from 'fs';\nimport os from 'os';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { options } from '../options';\nimport { PackageConfig } from '../packageConfig';\nimport { fetchOnNode } from '../utils/fetchOnNode';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generateGitignore', async () => {\n const filePath = path.resolve(config.dirPath, '.gitignore');\n let userContent = ((await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent) + commonContent;\n\n const names = [...defaultNames];\n if (config.containingGemfile) {\n names.push('ruby');\n }\n if (config.containingGoMod) {\n names.push('go');\n userContent += `${path.basename(config.dirPath)}\n`;\n }\n if (config.containingPackageJson) {\n names.push('node');\n }\n if (config.containingPomXml) {\n names.push('maven');\n userContent += `.idea/google-java-format.xml\n`;\n }\n if (config.containingPubspecYaml) {\n names.push('flutter', 'AndroidStudio', 'ruby');\n userContent += `.flutter-plugins-dependencies\nandroid/key.properties\nios/.bundle\n.idea/runConfigurations.xml\n`;\n }\n if (config.containingTemplateYaml) {\n userContent += `.aws-sam/\npackaged.yaml\n`;\n }\n // Because .venv should be ignored on root directory\n if (config.containingPoetryLock) {\n names.push('python');\n }\n if (rootConfig.depending.firebase || config.depending.firebase) {\n names.push('firebase');\n }\n if (rootConfig.depending.reactNative || config.depending.reactNative) {\n names.push('reactnative');\n userContent += `google-services.json\nandroid/app/src/main/assets/\n`;\n }\n if (rootConfig.depending.storybook) {\n names.push('storybookjs');\n }\n if (rootConfig.depending.blitz) {\n names.push('nextjs');\n userContent += `.blitz/\n.blitz**\n`;\n }\n\n let generated = '';\n for (const name of names) {\n let content = (await readCache(name)) ?? '';\n if (!content) {\n const url = `https://www.toptal.com/developers/gitignore/api/${name}`;\n const response = await fetchOnNode(url);\n const responseText = await response.text();\n if (responseText.includes('Attention Required!')) {\n console.error(`Failed to fetch ${url}`);\n return;\n }\n content = responseText.trim();\n await promisePool.run(() => writeCache(name, content));\n if (options.isVerbose) {\n console.info(`Fetched ${url}`);\n }\n }\n if (generated) generated += '\\n';\n generated += content + '\\n';\n }\n if (!(await 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}\n\nconst dirPath = path.join(os.homedir(), '.cache', 'wbfy', 'gitignore');\n\nasync function writeCache(name: string, content: string): Promise<void> {\n await fs.promises.mkdir(dirPath, { recursive: true });\n await fs.promises.writeFile(path.join(dirPath, name), content);\n}\n\nasync function readCache(name: string): Promise<string | undefined> {\n try {\n const stat = await fs.promises.stat(path.join(dirPath, name));\n if (Date.now() - stat.mtimeMs > 6 * 60 * 60 * 1000) {\n return;\n }\n return await fs.promises.readFile(path.join(dirPath, name), 'utf-8');\n } catch {\n // do nothing\n }\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 { logger } from '../logger';\nimport { PackageConfig } from '../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\" ] && [ $(git config user.email) != \"exkazuu@gmail.com\" ]; 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 return logger.function('generateHuskyrc', async () => {\n await core(config);\n });\n}\n\nasync function core(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 // Python\u304C\u306A\u3044\u3068\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3067\u304D\u306A\u3044\u51E6\u7406\u7CFB\u304C\u5B58\u5728\u3059\u308B\u305F\u3081\u3001\u5F37\u5236\u7684\u306B\u6700\u521D\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u3002\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.containingPoetryLock) {\n postMergeCommands.push('poetry install');\n }\n if (config.depending.blitz || config.depending.prisma) {\n postMergeCommands.push('yarn gen-code');\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 fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\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 return logger.function('generateIdeaSettings', async () => {\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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { extensions } from '../utils/extensions';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\nimport { getSrcDirs } from '../utils/srcDirectories';\n\nexport async function generateLintstagedrc(config: PackageConfig): Promise<void> {\n return logger.function('generateLintstagedrc', async () => {\n await core(config);\n });\n}\n\nasync function core(config: PackageConfig): Promise<void> {\n const lines: string[] = [];\n if (config.containingJavaScript || config.containingTypeScript) {\n const eslint = `\n '${getEslintKey(config)}': [${JSON.stringify(\n `eslint --fix${EslintUtil.getLintFixSuffix(config)}`\n )}, '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 ? getEslintFilterForPrettier(config) : ''}\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\nfunction getEslintKey(config: PackageConfig): string {\n const dirs = getSrcDirs(config);\n return `./{${dirs.join(',')}}/**/*.{${extensions.eslint.join(',')}}`;\n}\n\nfunction getEslintFilterForPrettier(config: PackageConfig): string {\n return `files = micromatch.not(files, '${getEslintKey(config)}');`;\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 { PackageConfig } from '../packageConfig';\n\nconst srcDirectories = {\n node: ['src', '__tests__', 'scripts'],\n blitz: ['app', 'db', 'integrations', 'mailers', 'test'],\n};\n\nsrcDirectories.blitz = [...srcDirectories.node, ...srcDirectories.blitz];\n\nexport function getSrcDirs(config: PackageConfig): string[] {\n return config.depending.blitz ? srcDirectories.blitz : srcDirectories.node;\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { EslintUtil } from '../utils/eslintUtil';\nimport { extensions } from '../utils/extensions';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync } from '../utils/spawnUtil';\nimport { getSrcDirs } from '../utils/srcDirectories';\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 return logger.function('generatePackageJson', async () => {\n await core(config, skipAddingDeps);\n });\n}\n\nasync function core(config: PackageConfig, skipAddingDeps: boolean): 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(jsonObj.scripts, generateScripts(config));\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 if (!jsonObj.scripts['gen-code']?.startsWith('blitz codegen')) {\n jsonObj.scripts['gen-code'] = 'blitz codegen';\n }\n } else if (config.depending.prisma) {\n if (!jsonObj.scripts['gen-code']?.startsWith('prisma generate')) {\n jsonObj.scripts['gen-code'] = 'prisma generate';\n }\n }\n if (!Object.keys(jsonObj.dependencies).length) {\n delete jsonObj.dependencies;\n }\n if (!Object.keys(jsonObj.devDependencies).length) {\n delete jsonObj.devDependencies;\n }\n if (!Object.keys(jsonObj.peerDependencies).length) {\n delete jsonObj.peerDependencies;\n }\n\n await fs.promises.writeFile(filePath, JSON.stringify(jsonObj));\n\n if (!skipAddingDeps) {\n dependencies = dependencies.filter((dep) => !jsonObj.devDependencies?.[dep]);\n if (dependencies.length) {\n spawnSync('yarn', ['add', ...new Set(dependencies)], config.dirPath);\n }\n devDependencies = devDependencies.filter((dep) => !jsonObj.dependencies?.[dep]);\n if (devDependencies.length) {\n spawnSync('yarn', ['add', '-D', ...new Set(devDependencies)], config.dirPath);\n }\n if (poetryDependencies.length) {\n spawnSync('poetry', ['add', ...new Set(poetryDependencies)], config.dirPath);\n }\n }\n}\n\nasync function removeDeprecatedStuff(jsonObj: any): Promise<void> {\n // TODO: remove the following migration code in future\n if (jsonObj.author === 'WillBooster LLC') {\n jsonObj.author = 'WillBooster Inc.';\n }\n delete jsonObj.scripts['sort-package-json'];\n delete jsonObj.scripts['sort-all-package-json'];\n delete jsonObj.scripts['typecheck:codegen'];\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\nfunction generateScripts(config: PackageConfig): Record<string, string> {\n let scripts = {\n cleanup: 'yarn format && yarn lint-fix',\n format: `sort-package-json && yarn prettify`,\n lint: `eslint --color \"./{${getSrcDirs(config)}}/**/*.{${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 if (config.containingSubPackageJsons) {\n scripts = merge(\n { ...scripts },\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 }\n if (config.depending.blitz) {\n scripts.typecheck = `${scripts.typecheck} || yarn run typecheck/warn`;\n (scripts as any)['typecheck/warn'] = `echo 'Please try \"yarn gen-code\" if you face unknown type errors.' && exit 1`;\n (scripts as any)['typecheck:gen-code'] = 'yarn gen-code && tsc --noEmit --Pretty';\n }\n return scripts;\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { IgnoreFileUtil } from '../utils/ignoreFileUtil';\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 return logger.function('generatePrettierignore', async () => {\n const filePath = path.resolve(config.dirPath, '.prettierignore');\n const userContent = (await IgnoreFileUtil.getUserContent(filePath)) || defaultUserContent;\n\n const gitignoreFilePath = path.resolve(config.dirPath, '.gitignore');\n const gitignoreContent = (await 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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst badgeUrl =\n '[](https://github.com/semantic-release/semantic-release)';\n\nexport async function generateReadme(config: PackageConfig): Promise<void> {\n return logger.function('generateReadme', async () => {\n const filePath = path.resolve(config.dirPath, 'README.md');\n let newContent = await fs.promises.readFile(filePath, 'utf8');\n\n const useSemanticRelease = fs.existsSync(path.resolve(config.dirPath, '.releaserc.json'));\n if (useSemanticRelease) {\n if (newContent.includes(badgeUrl)) {\n // \u65E2\u306Bbadge\u304C\u3042\u308B\u5834\u5408\u306F\u524A\u9664\n const badgePos = newContent.indexOf(badgeUrl);\n newContent = newContent.substring(0, badgePos) + newContent.substring(badgePos + badgeUrl.length);\n }\n let inserted = false;\n for (let i = 0; i < newContent.length; i++) {\n if (newContent[i] === '\\n') {\n inserted = true;\n newContent = `${newContent.slice(0, i + 1)}${badgeUrl}\\n${newContent.slice(i + 1)}`;\n break;\n }\n }\n if (!inserted) newContent = `${newContent}\\n${badgeUrl}\\n`;\n }\n\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n });\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { promisePool } from '../utils/promisePool';\n\nexport async function generateReleaserc(rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateReleaserc', async () => {\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 const plugin = Array.isArray(plugins[i]) ? plugins[i][0] : plugins[i];\n if (plugin === '@semantic-release/commit-analyzer') {\n plugins[i] = [\n '@semantic-release/commit-analyzer',\n {\n preset: 'conventionalcommits',\n },\n ];\n } else if (plugin === '@semantic-release/github' && !rootConfig.publicRepo) {\n plugins[i] = ['@semantic-release/github', { successComment: false }];\n }\n }\n const newContent = JSON.stringify(settings);\n await promisePool.run(() => FsUtil.generateFile(filePath, newContent));\n } catch (_) {\n // do nothing\n }\n });\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst jsonObj = {\n extends: ['@willbooster'],\n};\n\nexport async function generateRenovateJson(config: PackageConfig): Promise<void> {\n return logger.function('generateRenovateJson', async () => {\n let newSettings: any = cloneDeep(jsonObj);\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}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport merge from 'deepmerge';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { FsUtil } from '../utils/fsUtil';\nimport { overwriteMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst rootJsonObj = {\n compilerOptions: {\n target: 'esnext',\n module: 'esnext',\n moduleResolution: 'node',\n jsx: 'react-jsx',\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 'scripts/**/*',\n 'packages/*/src/**/*',\n 'packages/*/__tests__/**/*',\n 'packages/*/scripts/**/*',\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-jsx',\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__/**/*', 'scripts/**/*', '../../node_modules/@types', '../../@types', './@types'],\n};\n\nexport async function generateTsconfig(config: PackageConfig, rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateTsconfig', async () => {\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}\n", "export function sortKeys<T>(obj: any): T {\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 return obj;\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 { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { combineMerge } from '../utils/mergeUtil';\nimport { sortKeys } from '../utils/objectUtil';\nimport { promisePool } from '../utils/promisePool';\n\nconst testWorkflow = {\n name: 'Test',\n on: {\n pull_request: null,\n push: {\n branches: ['main', 'wbfy', 'renovate/**'],\n },\n },\n jobs: {\n test: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/test.yml@main',\n },\n },\n};\n\nconst releaseWorkflow = {\n name: 'Release',\n on: {\n push: {\n branches: [],\n },\n },\n jobs: {\n release: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/release.yml@main',\n },\n },\n};\n\nconst wbfyWorkflow = {\n name: 'Willboosterify',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n wbfy: {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy.yml@main',\n },\n },\n};\n\nconst wbfyMergeWorkflow = {\n name: 'Merge wbfy',\n on: {\n workflow_dispatch: null,\n },\n jobs: {\n 'wbfy-merge': {\n uses: 'WillBooster/reusable-workflows/.github/workflows/wbfy-merge.yml@main',\n },\n },\n};\n\nconst semanticPullRequestWorkflow = {\n name: 'Lint PR title',\n on: {\n pull_request_target: {\n types: ['opened', 'edited', 'synchronize'],\n },\n },\n jobs: {\n 'semantic-pr': {\n uses: 'WillBooster/reusable-workflows/.github/workflows/semantic-pr.yml@main',\n },\n },\n};\n\nconst notifyReadyWorkflow = {\n name: 'Notify ready',\n on: {\n issues: {\n types: ['labeled'],\n },\n },\n jobs: {\n 'notify-ready': {\n uses: 'WillBoosterLab/reusable-workflows/.github/workflows/notify-ready.yml@main',\n secrets: {\n DISCORD_WEBHOOK_URL: '${{ secrets.READY_DISCORD_WEBHOOK_URL }}',\n },\n },\n },\n};\n\nconst closeComment = {\n name: 'editComment',\n on: {\n pull_request: {\n types: ['opened'],\n },\n },\n jobs: {\n 'close-comment': {\n uses: 'WillBoosterLab/reusable-workflows/.github/ workflows/close-comment.yml@main',\n },\n },\n};\n\ntype KnownKind = 'test' | 'release' | 'sync' | 'wbfy' | 'wbfy-merge' | 'semantic-pr' | 'notify-ready' | 'close-comment';\n\nexport async function generateWorkflow(rootConfig: PackageConfig): Promise<void> {\n return logger.function('generateWorkflow', async () => {\n const workflowsPath = path.resolve(rootConfig.dirPath, '.github', 'workflows');\n await fs.promises.mkdir(workflowsPath, { recursive: true });\n\n // Remove config of semantic pull request\n const semanticYmlPath = path.resolve(rootConfig.dirPath, '.github', 'semantic.yml');\n await promisePool.run(() => fs.promises.rm(semanticYmlPath, { force: true, 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 if (rootConfig.publicRepo || rootConfig.repository?.startsWith('github:WillBoosterLab/')) {\n fileNames.push('notify-ready.yml');\n }\n fileNames.push('test.yml', 'wbfy.yml', 'wbfy-merge.yml', 'semantic-pr.yml', 'close-comment.yml');\n\n for (const fileName of fileNames) {\n // \u5B9F\u969B\u306FKnownKind\u4EE5\u5916\u306E\u5024\u3082\u4EE3\u5165\u3055\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\n const kind = path.basename(fileName, '.yml') as KnownKind;\n await promisePool.run(() => writeWorkflowYaml(rootConfig, workflowsPath, kind));\n }\n });\n}\n\nasync function writeWorkflowYaml(config: PackageConfig, workflowsPath: string, kind: KnownKind): 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 } else if (kind === 'wbfy-merge') {\n newSettings = wbfyMergeWorkflow;\n } else if (kind === 'semantic-pr') {\n newSettings = semanticPullRequestWorkflow;\n } else if (kind === 'notify-ready') {\n newSettings = notifyReadyWorkflow;\n } else if (kind === 'close-comment') {\n newSettings = closeComment;\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 for (const job of Object.values(newSettings.jobs) as any[]) {\n // Ignore non-reusable workflows\n if (!job.uses?.includes?.('/reusable-workflows/')) return;\n\n normalizeJob(config, job, kind);\n }\n\n if (kind === 'release') {\n if (newSettings.on.schedule) {\n delete newSettings.on.push;\n } else {\n newSettings.on.push.branches = config.release.branches;\n }\n } else if (kind === 'wbfy') {\n setSchedule(newSettings, 20, 24);\n } else if (kind === 'wbfy-merge') {\n setSchedule(newSettings, 0, 4);\n }\n await writeYaml(newSettings, filePath);\n\n if (kind === 'release') {\n await fs.promises.rm(path.join(workflowsPath, 'semantic-release.yml'), { force: true });\n } else if (kind === 'sync') {\n await fs.promises.rm(path.join(workflowsPath, 'sync-init.yml'), { force: true });\n if (!newSettings.jobs.sync) return;\n\n newSettings.jobs['sync-force'] = newSettings.jobs.sync;\n const params = newSettings.jobs.sync.with.sync_params_without_dest;\n if (!params) return;\n\n newSettings.jobs.sync.with.sync_params_without_dest = `--force ${params}`;\n newSettings.name = 'Force to Sync';\n newSettings.on = { workflow_dispatch: null };\n delete newSettings.jobs.sync;\n await writeYaml(newSettings, path.join(workflowsPath, 'sync-force.yml'));\n }\n}\n\nfunction normalizeJob(config: PackageConfig, job: any, kind: KnownKind): void {\n job.with ||= {};\n job.secrets ||= {};\n\n if ((config.release.github && kind === 'test') || kind === 'release' || kind === 'wbfy' || kind === 'wbfy-merge') {\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 (kind === 'sync') {\n const params = job.with?.sync_params_without_dest;\n if (params) {\n job.with.sync_params_without_dest = params.replace('sync ', '');\n }\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 delete job.with['non_self_hosted'];\n if (config.containingDockerfile && kind.startsWith('deploy')) {\n job.with['cpu_arch'] = 'X64';\n }\n // Because github.event.repository.private is always true if job is scheduled\n if (kind === 'release' || kind === 'test' || kind === 'wbfy' || kind === 'wbfy-merge' || kind.startsWith('deploy')) {\n if (config.publicRepo) {\n job.with['github_hosted_runner'] = true;\n }\n } else {\n delete job.with['github_hosted_runner'];\n }\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 const newSecrets = sortKeys(job.secrets);\n delete job.secrets;\n job.secrets = newSecrets;\n } else {\n delete job.secrets;\n }\n}\n\nfunction setSchedule(newSettings: any, inclusiveMinHourJst: number, exclusiveMaxHourJst: number): void {\n const [minuteUtc, hourUtc] = ((newSettings.on.schedule?.[0]?.cron as string) ?? '').split(' ').map(Number);\n if (minuteUtc !== 0 && Number.isInteger(hourUtc)) {\n const hourJst = (hourUtc + 9) % 24;\n const inRange =\n inclusiveMinHourJst < exclusiveMaxHourJst\n ? inclusiveMinHourJst <= hourJst && hourJst < exclusiveMaxHourJst\n : inclusiveMinHourJst <= hourJst || hourJst < exclusiveMaxHourJst;\n if (inRange) return;\n }\n\n const minJst = 1 + Math.floor(Math.random() * 59);\n const hourJst = inclusiveMinHourJst + Math.floor(Math.random() * (exclusiveMaxHourJst - inclusiveMinHourJst));\n const cron = `${minJst} ${(hourJst - 9 + 24) % 24} * * *`;\n newSettings.on.schedule = [{ cron }];\n}\n\nasync function writeYaml(newSettings: any, filePath: string): Promise<void> {\n const yamlText = yaml.dump(newSettings, {\n lineWidth: -1,\n noCompatMode: true,\n styles: {\n '!!null': 'empty',\n },\n });\n await fs.promises.writeFile(filePath, yamlText);\n}\n", "import fs from 'fs';\nimport path from 'path';\n\nimport yaml from 'js-yaml';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { promisePool } from '../utils/promisePool';\nimport { spawnSync, spawnSyncWithStringResult } from '../utils/spawnUtil';\n\nexport async function generateYarnrcYml(config: PackageConfig): Promise<void> {\n return logger.function('generateYarnrcYml', async () => {\n const currentVersion = spawnSyncWithStringResult('yarn', ['--version'], config.dirPath);\n const latestVersion = getLatestVersion('@yarnpkg/cli', config.dirPath);\n if (getMajorNumber(currentVersion) <= getMajorNumber(latestVersion) && currentVersion !== latestVersion) {\n spawnSync('yarn', ['set', 'version', latestVersion], config.dirPath, 1);\n }\n\n const releasesPath = path.join(config.dirPath, '.yarn', 'releases');\n await fs.promises.mkdir(releasesPath, { recursive: true });\n for (const file of await fs.promises.readdir(releasesPath)) {\n if (file.startsWith('yarn-') && !file.startsWith(`yarn-${latestVersion}.`)) {\n await promisePool.run(() => fs.promises.rm(path.join(releasesPath, file)));\n console.log('Removed', path.join(releasesPath, file));\n }\n }\n\n const yarnrcPath = path.resolve(config.dirPath, '.yarnrc');\n await promisePool.run(() => fs.promises.rm(yarnrcPath, { force: true }));\n\n const yarnrcYmlPath = path.resolve(config.dirPath, '.yarnrc.yml');\n const settings = yaml.load(await fs.promises.readFile(yarnrcYmlPath, 'utf8')) as any;\n settings.defaultSemverRangePrefix = '';\n if (config.requiringNodeModules) {\n settings.nodeLinker = 'node-modules';\n settings.nmMode = 'hardlinks-global';\n }\n await fs.promises.writeFile(yarnrcYmlPath, yaml.dump(settings, { lineWidth: -1 }));\n\n const plugins = (settings.plugins || []).map((p: any) => p.spec as string);\n const requireTypeScript = config.containingTypeScript || config.containingTypeScriptInPackages;\n importOrRemovePlugin(config, plugins, requireTypeScript, '@yarnpkg/plugin-typescript');\n if (requireTypeScript && !config.requiringNodeModules) {\n spawnSync('yarn', ['dlx', '@yarnpkg/sdks', 'vscode'], config.dirPath);\n }\n importOrRemovePlugin(config, plugins, config.containingSubPackageJsons, '@yarnpkg/plugin-workspace-tools');\n spawnSync('yarn', ['dlx', 'yarn-plugin-auto-install'], config.dirPath);\n });\n}\n\nexport function getLatestVersion(packageName: string, dirPath: string): string {\n const versionsJson = spawnSyncWithStringResult('npm', ['show', packageName, 'versions', '--json'], dirPath);\n const versions = JSON.parse(versionsJson) as string[];\n return versions[versions.length - 1];\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\nfunction getMajorNumber(version: string): number {\n const [major] = version.split('.');\n return Number(major);\n}\n", "import { Octokit } from '@octokit/core';\n\nconst token =\n process.env.GH_BOT_PAT || process.env.PUBLIC_GH_BOT_PAT || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\nexport const hasGitHubToken = !!token;\nexport const octokit = new Octokit({\n auth: token,\n});\n\nclass GitHubUtil {\n getOrgAndName(urlOrFullName: string): [string, string] {\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 return [org, name];\n }\n}\n\nexport const gitHubUtil = new GitHubUtil();\n", "import { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { gitHubUtil, hasGitHubToken, octokit } from '../utils/githubUtil';\n\nexport async function setupLabels(config: PackageConfig): Promise<void> {\n return logger.function('setupLabels', async () => {\n if (!hasGitHubToken) return;\n\n const [owner, repo] = gitHubUtil.getOrgAndName(config.repository ?? '');\n if (!owner || !repo) return;\n if (!config.publicRepo && owner === 'WillBooster') return;\n\n try {\n await setupLabel(owner, repo, 'ready', '0E8A16');\n await setupLabel(owner, repo, 'review requested', 'FBCA04');\n } catch (e) {\n console.warn('Skip setupLabels due to:', (e as Error)?.stack ?? e);\n }\n });\n}\n\nasync function setupLabel(owner: string, repo: string, name: string, color: string): Promise<void> {\n try {\n await octokit.request('POST /repos/{owner}/{repo}/labels', {\n owner,\n repo,\n name,\n color,\n });\n } catch (e) {\n await octokit.request('PATCH /repos/{owner}/{repo}/labels/{name}', {\n owner,\n repo,\n name,\n color,\n });\n }\n}\n", "import dotenv from 'dotenv';\nimport sodium from 'libsodium-wrappers';\n\nimport { logger } from '../logger';\nimport { PackageConfig } from '../packageConfig';\nimport { gitHubUtil, hasGitHubToken, octokit } from '../utils/githubUtil';\n\nexport async function setupSecrets(config: PackageConfig): Promise<void> {\n return logger.function('setupSecrets', async () => {\n if (!hasGitHubToken) return;\n\n const [owner, repo] = gitHubUtil.getOrgAndName(config.repository ?? '');\n if (!owner || !repo || owner !== 'WillBoosterLab') return;\n\n const parsed = dotenv.config().parsed || {};\n if (Object.keys(parsed).length === 0) return;\n\n try {\n const response = await octokit.request('GET /repos/{owner}/{repo}/actions/secrets/public-key', {\n owner,\n repo,\n });\n const { key, key_id: keyId } = response.data;\n\n await sodium.ready;\n\n for (const [name, secret] of Object.entries(parsed)) {\n if (config.publicRepo && name === 'GH_BOT_PAT') continue;\n if (!config.publicRepo && name === 'PUBLIC_GH_BOT_PAT') continue;\n\n // Convert Secret & Base64 key to Uint8Array.\n const rawKey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL);\n const rawSec = sodium.from_string(secret);\n\n // Encrypt the secret using LibSodium\n const encBytes = sodium.crypto_box_seal(rawSec, rawKey);\n\n // Convert encrypted Uint8Array to Base64\n const encBase64 = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL);\n\n await octokit.request('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', {\n owner,\n repo,\n secret_name: name,\n encrypted_value: encBase64,\n key_id: keyId,\n });\n }\n } catch (e) {\n console.warn('Skip setupSecrets due to:', (e as Error)?.stack ?? e);\n }\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 { gitHubUtil, octokit } from './utils/githubUtil';\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__|scripts)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScript: glob.sync('@(app|src|__tests__|scripts)/**/*.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__|scripts)/**/*.js?(x)', { cwd: dirPath }).length > 0,\n containingTypeScriptInPackages:\n glob.sync('packages/**/@(app|src|__tests__|scripts)/**/*.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 [org, name] = gitHubUtil.getOrgAndName(urlOrFullName);\n if (!org || !name) return;\n\n const ret = { full_name: `${org}/${name}` };\n try {\n const response = await octokit.request('GET /repos/{owner}/{repo}', {\n owner: org,\n repo: name,\n });\n Object.assign(ret, response.data);\n } catch (e) {\n // do nothing\n }\n return ret;\n}\n"],
|
5
|
+
"mappings": "ueAAA,IAAAA,GAAiB,mBAEjBC,GAAiB,mBACjBC,GAAkB,oBCHlB,IAAAC,EAAe,iBACfC,GAAiB,mBCDjB,IAAMC,GAAN,KAAc,CAGZ,aAAc,CACZ,KAAK,UAAY,EACnB,CACF,EAEaC,EAAU,IAAID,GCN3B,IAAME,GAAN,KAAa,CACX,MAAM,SAASC,EAAcC,EAA0C,CACjEC,EAAQ,WACV,QAAQ,KAAK,aAAaF,mBAAsB,EAElD,MAAMC,EAAK,EACPC,EAAQ,WACV,QAAQ,KAAK,cAAcF,kBAAqB,CAEpD,CACF,EAEaG,EAAS,IAAIJ,GCd1B,IAAAK,GAA4B,gCAEfC,EAAc,IAAI,eCF/B,IAAAC,GAA0B,4BAEnB,SAASC,EAAUC,EAAiBC,EAAgBC,EAAaC,EAAQ,EAAS,CACvF,EAAG,CACD,GAAM,CAACC,EAA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EAC/Be,GAAqBf,CAAU,EAC/BgB,GAAehB,CAAU,EACzBiB,GAAqBjB,CAAU,EAC/BkB,GAAkBlB,CAAU,EAC5BmB,GAAiBnB,CAAU,EAC3BoB,GAAapB,CAAU,EACvBqB,GAAYrB,CAAU,CACxB,CAAC,EACD,MAAMsB,EAAY,WAAW,EAE7B,IAAMC,EAA4B,CAAC,EACnC,QAAWhB,KAAUC,EACnB,MAAMgB,GAAkBjB,EAAQP,CAAU,EAC1C,MAAMsB,EAAY,WAAW,EACzB,GAACf,EAAO,MAAQ,CAACA,EAAO,yBAG5B,MAAMkB,GAAuBlB,CAAM,EACnC,MAAMmB,GAAoBnB,EAAQP,EAAYJ,EAAK,QAAQ,EAE3D2B,EAAS,KAAKR,GAAqBR,CAAM,CAAC,GACtCA,EAAO,sBAAwBA,EAAO,iCACxCgB,EAAS,KAAKI,GAAiBpB,EAAQP,CAAU,CAAC,GAGlDO,EAAO,sBACPA,EAAO,gCACPA,EAAO,sBACPA,EAAO,kCAEFP,EAAW,oBACduB,EAAS,KAAKK,GAAiBrB,EAAQP,CAAU,CAAC,EAEpDuB,EAAS,KAAKM,GAAqBtB,CAAM,CAAC,IAG9C,MAAM,QAAQ,IAAIgB,CAAQ,EAC1B,MAAMD,EAAY,WAAW,EAE7BQ,EAAU,OAAQ,CAAC,SAAS,EAAG/B,CAAW,EAG1C+B,EAAU,OAAQ,CAAC,SAAS,EAAG/B,CAAW,CAC5C,CACF,CAEAJ,GAAK,EAAE,KAAK",
|
6
|
+
"names": ["import_path", "import_glob", "import_yargs", "import_fs", "import_path", "Options", "options", "Logger", "name", "func", "options", "logger", "import_minimal_promise_pool", "promisePool", "import_child_process", "spawnSync", "command", "args", "cwd", "retry", "newCmd", "newArgs", "options", "getSpawnSyncArgs", "child_process", "spawnSyncWithStringResult", "proc", "error", "s", "env", "generateVersionConfigs", "config", "logger", "core", "lines", "versionText", "line", "version", "promisePool", "fs", "path", "updateLine", "spawnSyncWithStringResult", "toolVersionsPath", "spawnSync", "insertionIndex", "prefix", "index", "l", "import_path", "extensions", "import_promises", "FsUtil", "filePath", "content", "fsp", "newContent", "generateExtensions", "extensions", "generateEditorconfig", "config", "logger", "filePath", "path", "promisePool", "FsUtil", "import_path", "import_fs", "IgnoreFileUtil", "filePath", "fs", "content", "index", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generateEslintignore", "config", "logger", "filePath", "path", "userContent", "gitignoreFilePath", "gitignoreContent", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_deepmerge", "overwriteMerge", "destinationArray", "sourceArray", "combineMerge", "target", "source", "options", "destination", "item", "index", "merge", "generateEslintrc", "config", "rootConfig", "logger", "bases", "newSettings", "filePath", "path", "oldContent", "fs", "oldSettings", "ext", "newExtends", "merge", "combineMerge", "e", "newContent", "promisePool", "FsUtil", "import_path", "newContent", "extensions", "ext", "generateGitattributes", "config", "logger", "filePath", "path", "promisePool", "FsUtil", "import_fs", "import_os", "import_path", "fetchOnNode", "url", "init", "nodeFetch", "defaultNames", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generateGitignore", "config", "rootConfig", "logger", "filePath", "path", "userContent", "names", "generated", "name", "content", "readCache", "url", "responseText", "fetchOnNode", "promisePool", "writeCache", "options", "newContent", "FsUtil", "dirPath", "os", "fs", "stat", "import_fs", "import_path", "DEFAULT_COMMAND", "settings", "generateHuskyrc", "config", "logger", "core", "_a", "_b", "packageJsonPath", "path", "jsonText", "fs", "packageJson", "dirPath", "spawnSync", "preCommitFilePath", "content", "promisePool", "prePush", "postMergeCommands", "postMergeCommand", "import_fs", "import_path", "newContent", "generateIdeaSettings", "config", "logger", "dirPath", "path", "fs", "filePath", "promisePool", "FsUtil", "import_fs", "import_path", "EslintUtil", "config", "srcDirectories", "getSrcDirs", "config", "generateLintstagedrc", "config", "logger", "core", "lines", "eslint", "getEslintKey", "EslintUtil", "packagesFilter", "extensions", "getEslintFilterForPrettier", "newContent", "filePath", "path", "promisePool", "fs", "FsUtil", "getSrcDirs", "import_fs", "import_path", "import_deepmerge", "jsCommonDeps", "tsCommonDeps", "reactCommonDeps", "devDeps", "generatePackageJson", "config", "rootConfig", "skipAddingDeps", "logger", "core", "_a", "_b", "filePath", "path", "jsonText", "fs", "jsonObj", "removeDeprecatedStuff", "scriptKey", "merge", "generateScripts", "generatePrettierSuffix", "dependencies", "devDependencies", "poetryDependencies", "dep", "EslintUtil", "dirs", "dir", "dirNames", "dirName", "dirPath", "fileName", "d", "spawnSync", "deps", "promisePool", "scripts", "getSrcDirs", "extensions", "existingContent", "index", "IgnoreFileUtil", "line", "newLine", "l", "import_path", "defaultUserContent", "IgnoreFileUtil", "commonContent", "generatePrettierignore", "config", "logger", "filePath", "path", "userContent", "gitignoreFilePath", "gitignoreContent", "additionalContent", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "badgeUrl", "generateReadme", "config", "logger", "filePath", "path", "newContent", "fs", "badgePos", "inserted", "promisePool", "FsUtil", "import_fs", "import_path", "generateReleaserc", "rootConfig", "logger", "filePath", "path", "settings", "fs", "plugins", "plugin", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_lodash", "jsonObj", "generateRenovateJson", "config", "logger", "newSettings", "cloneDeep", "filePath", "path", "oldContent", "fs", "oldSettings", "merge", "overwriteMerge", "promisePool", "newContent", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_lodash", "sortKeys", "obj", "keyAndValues", "key1", "key2", "key", "value", "rootJsonObj", "subJsonObj", "generateTsconfig", "config", "rootConfig", "logger", "_a", "_b", "_c", "newSettings", "cloneDeep", "dirPath", "relativeDirPath", "path", "filePath", "existingContent", "fs", "oldSettings", "merge", "overwriteMerge", "sortKeys", "newContent", "promisePool", "FsUtil", "import_fs", "import_path", "import_deepmerge", "import_js_yaml", "import_lodash", "testWorkflow", "releaseWorkflow", "wbfyWorkflow", "wbfyMergeWorkflow", "semanticPullRequestWorkflow", "notifyReadyWorkflow", "closeComment", "generateWorkflow", "rootConfig", "logger", "_a", "workflowsPath", "path", "fs", "semanticYmlPath", "promisePool", "fileNames", "dirent", "fileName", "kind", "writeWorkflowYaml", "config", "_b", "newSettings", "cloneDeep", "filePath", "oldContent", "oldSettings", "yaml", "merge", "combineMerge", "job", "normalizeJob", "setSchedule", "writeYaml", "params", "_c", "sortKeys", "newSecrets", "inclusiveMinHourJst", "exclusiveMaxHourJst", "minuteUtc", "hourUtc", "hourJst", "minJst", "cron", "yamlText", "import_fs", "import_path", "import_js_yaml", "generateYarnrcYml", "config", "logger", "currentVersion", "spawnSyncWithStringResult", "latestVersion", "getLatestVersion", "getMajorNumber", "spawnSync", "releasesPath", "path", "fs", "file", "promisePool", "yarnrcPath", "yarnrcYmlPath", "settings", "yaml", "plugins", "p", "requireTypeScript", "importOrRemovePlugin", "packageName", "dirPath", "versionsJson", "versions", "requirePlugin", "plugin", "version", "major", "import_core", "token", "hasGitHubToken", "octokit", "GitHubUtil", "urlOrFullName", "_a", "urlWithoutProtocol", "names", "org", "name", "gitHubUtil", "setupLabels", "config", "logger", "hasGitHubToken", "owner", "repo", "gitHubUtil", "setupLabel", "e", "name", "color", "octokit", "import_dotenv", "import_libsodium_wrappers", "setupSecrets", "config", "logger", "hasGitHubToken", "owner", "repo", "gitHubUtil", "parsed", "dotenv", "response", "octokit", "key", "keyId", "sodium", "name", "secret", "rawKey", "rawSec", "encBytes", "encBase64", "e", "import_fs", "import_promises", "import_path", "import_glob", "import_js_yaml", "import_simple_git", "getPackageConfig", "dirPath", "_a", "packageJsonPath", "path", "containingPackageJson", "fs", "dependencies", "devDependencies", "packageJson", "packageJsonText", "requiringNodeModules", "yarnrcYmlPath", "doc", "yaml", "fsp", "releaseBranches", "releasePlugins", "releasercJsonPath", "json", "isRoot", "repoInfo", "getRepoInfo", "toolVersionsPath", "versionsText", "config", "glob", "getEslintExtensionBase", "_b", "_c", "origin", "r", "remoteUrl", "fetchRepoInfo", "url", "urlOrFullName", "org", "name", "gitHubUtil", "ret", "response", "octokit", "main", "argv", "yargs", "options", "rootDirPath", "rootConfig", "getPackageConfig", "subDirPaths", "glob", "subDirPath", "path", "subPackageConfigs", "config", "allPackageConfigs", "generateVersionConfigs", "generateYarnrcYml", "generateEditorconfig", "generateGitattributes", "generateHuskyrc", "generateIdeaSettings", "generateLintstagedrc", "generateReadme", "generateRenovateJson", "generateReleaserc", "generateWorkflow", "setupSecrets", "setupLabels", "promisePool", "promises", "generateGitignore", "generatePrettierignore", "generatePackageJson", "generateTsconfig", "generateEslintrc", "generateEslintignore", "spawnSync"]
|
7
7
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wbfy",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.44.0",
|
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",
|
@@ -41,45 +41,45 @@
|
|
41
41
|
"lodash.clonedeep": "4.5.0",
|
42
42
|
"minimal-promise-pool": "1.1.5",
|
43
43
|
"node-fetch": "3.2.10",
|
44
|
-
"simple-git": "3.
|
44
|
+
"simple-git": "3.13.0",
|
45
45
|
"yargs": "17.5.1"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
48
|
"@types/eslint": "8.4.6",
|
49
49
|
"@types/glob": "7.2.0",
|
50
|
-
"@types/jest": "28.1.
|
50
|
+
"@types/jest": "28.1.8",
|
51
51
|
"@types/js-yaml": "4.0.5",
|
52
52
|
"@types/libsodium-wrappers": "0.7.9",
|
53
53
|
"@types/lodash.clonedeep": "4.5.7",
|
54
54
|
"@types/micromatch": "4.0.2",
|
55
|
-
"@types/node": "16.11.
|
55
|
+
"@types/node": "16.11.56",
|
56
56
|
"@types/node-fetch": "3.0.3",
|
57
57
|
"@types/yargs": "17.0.11",
|
58
|
-
"@typescript-eslint/eslint-plugin": "5.
|
59
|
-
"@typescript-eslint/parser": "5.
|
60
|
-
"@willbooster/eslint-config-ts": "9.
|
61
|
-
"@willbooster/prettier-config": "9.0
|
62
|
-
"@willbooster/renovate-config": "9.
|
58
|
+
"@typescript-eslint/eslint-plugin": "5.35.1",
|
59
|
+
"@typescript-eslint/parser": "5.35.1",
|
60
|
+
"@willbooster/eslint-config-ts": "9.2.1",
|
61
|
+
"@willbooster/prettier-config": "9.1.0",
|
62
|
+
"@willbooster/renovate-config": "9.4.0",
|
63
63
|
"conventional-changelog-conventionalcommits": "5.0.0",
|
64
64
|
"esbuild": "0.15.5",
|
65
65
|
"esbuild-register": "3.3.3",
|
66
|
-
"eslint": "8.
|
66
|
+
"eslint": "8.23.0",
|
67
67
|
"eslint-config-prettier": "8.5.0",
|
68
68
|
"eslint-import-resolver-typescript": "3.5.0",
|
69
69
|
"eslint-plugin-import": "2.26.0",
|
70
70
|
"eslint-plugin-sort-class-members": "1.14.1",
|
71
71
|
"eslint-plugin-sort-destructure-keys": "1.4.0",
|
72
72
|
"husky": "8.0.1",
|
73
|
-
"jest": "
|
73
|
+
"jest": "29.0.1",
|
74
74
|
"lint-staged": "13.0.3",
|
75
75
|
"micromatch": "4.0.5",
|
76
76
|
"pinst": "3.0.0",
|
77
77
|
"prettier": "2.7.1",
|
78
|
-
"semantic-release": "19.0.
|
78
|
+
"semantic-release": "19.0.5",
|
79
79
|
"sort-package-json": "1.57.0",
|
80
|
-
"typescript": "4.
|
80
|
+
"typescript": "4.8.2"
|
81
81
|
},
|
82
|
-
"packageManager": "yarn@4.0.0-rc.
|
82
|
+
"packageManager": "yarn@4.0.0-rc.15",
|
83
83
|
"engines": {
|
84
84
|
"node": ">=16.6.0"
|
85
85
|
}
|