@kitschpatrol/repo-config 3.0.2 → 3.0.4

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/bin/cli.js CHANGED
@@ -44,8 +44,8 @@ ${s}`,i=`${s||""}${i}
44
44
  --print-config, -p <path> Print the effective configuration at a certain path.`;break}case"help":break;case"version":break;default:console.error(`Unknown command name in generateHelpText: ${n}`)}return r+=`
45
45
  --help, -h Print this help info.`,r+=`
46
46
  --version, -v Print the package version.
47
- `,r}function Pp(e){return Object.keys(e).reduce((t,r)=>{let n={};switch(r){case"init":{n={shortFlag:"i",type:"boolean"};break}case"check":{n={aliases:["lint",""],shortFlag:"l",type:"boolean"};break}case"fix":{n={shortFlag:"f",type:"boolean"};break}case"printConfig":{n={shortFlag:"p",type:"boolean"};break}case"help":{n={shortFlag:"h",type:"boolean"};break}case"version":{n={shortFlag:"v",type:"boolean"};break}default:console.error(`Unknown command name: ${r}`)}return t[r]=n,t},{})}async function os(e,t,r=[]){if(t.command!==void 0&&typeof t.command=="string"){let n;try{let i=Ap(t.command,[...t.options??[],...r],{env:{FORCE_COLOR:"true"},stdin:"inherit"});i.stdout?.pipe(e,{end:!1}),i.stderr?.pipe(e,{end:!1}),await i,n=i.exitCode??1}catch(i){n=typeof i.exitCode=="number"?i.exitCode:1}return n}return e.write(`Error: Invalid optionCommand: ${JSON.stringify(t,void 0,2)}`),1}function as(e,t,r){e.length===0&&!t.defaultArguments&&(r.write(`Error: This command must be used with a file argument
48
- `),process.exit(1))}async function ls(e,t,r,n){let i=ns({allowUnknownFlags:!1,booleanDefault:void 0,flags:Pp(n),help:_p(e,n),importMeta:import.meta}),{flags:s,input:o}=i,a=Object.keys(n).reduce((p,d)=>(s[d]&&(p[d]=n[d]),p),{}),l=Ip(t,r);l.pipe(process.stdout),Object.keys(a).length===0&&(n.check===void 0?l.write(`No default check behavior implemented. Run ${e} --help for valid commands.
47
+ `,r}function Pp(e){return Object.keys(e).reduce((t,r)=>{let n={};switch(r){case"init":{n={shortFlag:"i",type:"boolean"};break}case"check":{n={aliases:["lint",""],shortFlag:"l",type:"boolean"};break}case"fix":{n={shortFlag:"f",type:"boolean"};break}case"printConfig":{n={shortFlag:"p",type:"boolean"};break}case"help":{n={type:"boolean"};break}case"version":{n={type:"boolean"};break}default:console.error(`Unknown command name: ${r}`)}return t[r]=n,t},{})}async function os(e,t,r=[]){if(t.command!==void 0&&typeof t.command=="string"){let n;try{let i=Ap(t.command,[...t.options??[],...r],{env:{FORCE_COLOR:"true"},stdin:"inherit"});i.stdout?.pipe(e,{end:!1}),i.stderr?.pipe(e,{end:!1}),await i,n=i.exitCode??1}catch(i){n=typeof i.exitCode=="number"?i.exitCode:1}return n}return e.write(`Error: Invalid optionCommand: ${JSON.stringify(t,void 0,2)}`),1}function as(e,t,r){e.length===0&&!t.defaultArguments&&(r.write(`Error: This command must be used with a file argument
48
+ `),process.exit(1))}async function ls(e,t,r,n){let i=ns({allowUnknownFlags:!1,booleanDefault:void 0,flags:Pp(n),help:_p(e,n),importMeta:import.meta}),{flags:s,input:o}=i,a=Object.keys(n).reduce((p,d)=>(s[d]&&(p[d]=n[d]),p),{}),l=Ip(t,r);l.pipe(process.stdout),Object.keys(a).length===0&&(n.check===void 0?l.write(`This command requires options. Run ${e} --help for valid commands.
49
49
  `):a.check=n.check);let u=0;for(let[p,d]of Object.entries(a))if(typeof d.command=="function"){as(o,d,l);let y=o.length===0?d.defaultArguments??[]:o,w=d.options??[];u+=await d.command(l,y,w)}else if(typeof d.command=="string")as(o,d,l),u+=await os(l,d,o.length===0?d.defaultArguments:o);else switch(p){case"init":{let y=await Ce();if(y===void 0){l.write("Error: The `--init` flag must be used in a directory with a package.json file\n"),u+=1;break}let w=await Ce({cwd:xp(import.meta.url)});if(w===void 0){l.write(`Error: The script being called was not in a package, weird.
50
50
  `),u+=1;break}let b=vr.join(vr.dirname(w),"init/"),f=vr.dirname(y);l.write(`Copying initial configuration files from:
51
51
  "${b}" \u2192 "${f}"
package/init/.npmrc CHANGED
@@ -1,7 +1,6 @@
1
1
  publish-branch=main
2
2
 
3
- # required for pnpm
4
- # public-hoist-pattern[]=@types* TBD
3
+ # Required for using @kitschpatrol/shared-config with pnpm
5
4
  public-hoist-pattern[]=@kitschpatrol/repo-config
6
5
  public-hoist-pattern[]=@kitschpatrol/vscode-config
7
6
  public-hoist-pattern[]=*cspell*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/repo-config",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "type": "module",
5
5
  "description": "Initial repo configuration for @kitschpatrol/shared-config",
6
6
  "repository": {
@@ -30,8 +30,9 @@
30
30
  "init/*"
31
31
  ],
32
32
  "dependencies": {
33
- "execa": "^8.0.1",
34
- "package-up": "^5.0.0"
33
+ "@pinojs/json-colorizer": "^4.0.0",
34
+ "cosmiconfig": "^9.0.0",
35
+ "execa": "^8.0.1"
35
36
  },
36
37
  "publishConfig": {
37
38
  "access": "public"
package/readme.md CHANGED
@@ -19,7 +19,7 @@ It's critical that it is applied _before_ any other `@kitschpatrol/shared-config
19
19
  If you just need to set up your `.npmrc` in anticipation of installing another shared config, you can run the script via `dlx` to copy the `.npmrc` to your home folder:
20
20
 
21
21
  ```sh
22
- pnpm dlx @kitschpatrol/repo-config
22
+ pnpm dlx @kitschpatrol/repo-config --init
23
23
  ```
24
24
 
25
25
  ### Installation approach