@bfra.me/prettier-config 0.8.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,111 @@
1
+ import * as prettier from 'prettier'
2
+ import {Writable} from './prettier.config.js'
3
+
4
+ declare const $120ProofConfig: {
5
+ readonly printWidth: 120
6
+ readonly semi: boolean
7
+ readonly arrowParens: 'avoid'
8
+ readonly bracketSpacing: false
9
+ readonly endOfLine: 'auto'
10
+ readonly singleQuote: true
11
+ readonly overrides: prettier.Config['overrides']
12
+ readonly plugins: {
13
+ [x: number]: {
14
+ then: {}
15
+ catch: {}
16
+ finally: {}
17
+ [Symbol.toStringTag]: string
18
+ }
19
+ length: number
20
+ toString: {}
21
+ toLocaleString: {}
22
+ pop: {}
23
+ push: {}
24
+ concat: {}
25
+ join: {}
26
+ reverse: {}
27
+ shift: {}
28
+ slice: {}
29
+ sort: {}
30
+ splice: {}
31
+ unshift: {}
32
+ indexOf: {}
33
+ lastIndexOf: {}
34
+ every: {}
35
+ some: {}
36
+ forEach: {}
37
+ map: {}
38
+ filter: {}
39
+ reduce: {}
40
+ reduceRight: {}
41
+ find: {}
42
+ findIndex: {}
43
+ fill: {}
44
+ copyWithin: {}
45
+ entries: {}
46
+ keys: {}
47
+ values: {}
48
+ includes: {}
49
+ flatMap: {}
50
+ flat: {}
51
+ at: {}
52
+ findLast: {}
53
+ findLastIndex: {}
54
+ toReversed: {}
55
+ toSorted: {}
56
+ toSpliced: {}
57
+ with: {}
58
+ [Symbol.iterator]: {}
59
+ readonly [Symbol.unscopables]: {
60
+ [x: number]: boolean | undefined
61
+ length?: boolean
62
+ toString?: boolean
63
+ toLocaleString?: boolean
64
+ pop?: boolean
65
+ push?: boolean
66
+ concat?: boolean
67
+ join?: boolean
68
+ reverse?: boolean
69
+ shift?: boolean
70
+ slice?: boolean
71
+ sort?: boolean
72
+ splice?: boolean
73
+ unshift?: boolean
74
+ indexOf?: boolean
75
+ lastIndexOf?: boolean
76
+ every?: boolean
77
+ some?: boolean
78
+ forEach?: boolean
79
+ map?: boolean
80
+ filter?: boolean
81
+ reduce?: boolean
82
+ reduceRight?: boolean
83
+ find?: boolean
84
+ findIndex?: boolean
85
+ fill?: boolean
86
+ copyWithin?: boolean
87
+ entries?: boolean
88
+ keys?: boolean
89
+ values?: boolean
90
+ includes?: boolean
91
+ flatMap?: boolean
92
+ flat?: boolean
93
+ at?: boolean
94
+ findLast?: boolean
95
+ findLastIndex?: boolean
96
+ toReversed?: boolean
97
+ toSorted?: boolean
98
+ toSpliced?: boolean
99
+ with?: boolean
100
+ [Symbol.iterator]?: boolean
101
+ [Symbol.unscopables]?: boolean
102
+ }
103
+ }
104
+ }
105
+ /**
106
+ * Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
107
+ */
108
+ type $120ProofConfig = Writable<typeof $120ProofConfig>
109
+ declare const _default: $120ProofConfig
110
+
111
+ export {_default as default}
package/lib/120-proof.js CHANGED
@@ -1,11 +1,9 @@
1
- import defaultConfig from "./prettier.config.js";
2
- const $120ProofConfig = {
3
- ...defaultConfig,
1
+ import e from './prettier.config.js'
2
+ const r = {
3
+ ...e,
4
4
  printWidth: 120,
5
- semi: new URL(import.meta.url).searchParams.has("semi", "true") || defaultConfig.semi
6
- };
7
- var proof_default = $120ProofConfig;
8
- export {
9
- proof_default as default
10
- };
11
- //# sourceMappingURL=120-proof.js.map
5
+ semi: new URL(import.meta.url).searchParams.has('semi', 'true') || e.semi,
6
+ }
7
+ var i = r
8
+ export {i as default}
9
+ //# sourceMappingURL=120-proof.js.map
@@ -0,0 +1,8 @@
1
+ import {Plugin} from 'prettier'
2
+
3
+ declare function resolve(
4
+ resolver: (id: string) => string,
5
+ plugin: string,
6
+ ): Promise<string | Plugin<any>>
7
+
8
+ export {resolve}
package/lib/plugins.js CHANGED
@@ -1,20 +1,18 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import * as PluginPackageJson from "@bfra.me/prettier-plugins/package-json";
4
- const resolvedPlugins = {
5
- "@bfra.me/prettier-plugins/package-json": PluginPackageJson
6
- };
7
- const resolve = /* @__PURE__ */ __name((resolver, plugin) => {
1
+ var a = Object.defineProperty
2
+ var s = (r, e) => a(r, 'name', {value: e, configurable: !0})
3
+ import * as c from '@bfra.me/prettier-plugins/package-json'
4
+ const o = {'@bfra.me/prettier-plugins/package-json': c}
5
+ async function f(r, e) {
8
6
  try {
9
- if (resolvedPlugins[plugin]) {
10
- return resolvedPlugins[plugin];
7
+ if (!o[e]) {
8
+ const t = r(e)
9
+ o[e] = t
11
10
  }
12
- return resolver(plugin);
13
- } finally {
14
- return plugin;
11
+ return o[e] ?? e
12
+ } catch {
13
+ return e
15
14
  }
16
- }, "resolve");
17
- export {
18
- resolve
19
- };
20
- //# sourceMappingURL=plugins.js.map
15
+ }
16
+ s(f, 'resolve')
17
+ export {f as resolve}
18
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1,26 @@
1
+ import * as prettier from 'prettier'
2
+
3
+ type Writable<T> = {
4
+ -readonly [K in keyof T]: T[K] extends object
5
+ ? {
6
+ [J in keyof T[K]]: Writable<T[K][J]>
7
+ }
8
+ : T[K]
9
+ } & {}
10
+ declare const config: {
11
+ readonly arrowParens: 'avoid'
12
+ readonly bracketSpacing: false
13
+ readonly endOfLine: 'auto'
14
+ readonly printWidth: 100
15
+ readonly semi: boolean
16
+ readonly singleQuote: true
17
+ readonly overrides: prettier.Config['overrides']
18
+ readonly plugins: Promise<string | prettier.Plugin<any>>[]
19
+ }
20
+ /**
21
+ * Shared Prettier configuration for bfra.me projects.
22
+ */
23
+ type Config = Writable<typeof config>
24
+ declare const _default: Config
25
+
26
+ export {type Config, type Writable, _default as default}
@@ -1,83 +1,2 @@
1
- import { createRequire } from "node:module";
2
- import { resolve } from "./plugins.js";
3
- const require2 = createRequire(import.meta.url);
4
- const resolvePlugin = resolve.bind(null, require2.resolve);
5
- const { searchParams } = new URL(import.meta.url);
6
- const config = {
7
- arrowParens: "avoid",
8
- bracketSpacing: false,
9
- endOfLine: "auto",
10
- printWidth: 100,
11
- semi: searchParams.has("semi", "true"),
12
- singleQuote: true,
13
- overrides: [
14
- // Adapted from https://github.com/sxzz/prettier-config/blob/1e5cc3021e5816aceebe0b90af1d530239442ecf/index.js.
15
- // Require a pragma for paths typically not under version control or written by build tools.
16
- {
17
- files: [
18
- "**/node_modules/**",
19
- "**/dist/**",
20
- "**/coverage/**",
21
- "**/out/**",
22
- "**/temp/**",
23
- "**/.idea/**",
24
- "**/.next/**",
25
- "**/.nuxt/**",
26
- "**/.output/**",
27
- "**/.tsup/**",
28
- "**/.vercel/**",
29
- "**/.vitepress/cache/**",
30
- "**/.vite-inspect/**",
31
- "**/__snapshots__/**",
32
- "**/test/fixtures/**",
33
- "**/auto-import?(s).d.ts",
34
- "**/.changeset/*.md",
35
- "**/CHANGELOG*.md",
36
- "**/changelog*.md",
37
- "**/components.d.ts",
38
- "**/devcontainer-lock.json",
39
- "**/LICENSE*",
40
- "**/license*",
41
- "**/*.min.*",
42
- "**/package-lock.json",
43
- "**/pnpm-lock.yaml",
44
- "**/typed-router.d.ts",
45
- "**/yarn.lock"
46
- ],
47
- options: {
48
- requirePragma: true
49
- }
50
- },
51
- // VS Code configuration files:
52
- // Use 4 spaces for indentation to match the default VS Code settings.
53
- {
54
- files: [
55
- ".vscode/*.json",
56
- ".devcontainer/**/devcontainer*.json"
57
- ],
58
- options: {
59
- tabWidth: 4
60
- }
61
- },
62
- // Markdown:
63
- // - Disable single quotes for Markdown files.
64
- // - Disable `proseWrap` to avoid wrapping prose.
65
- {
66
- files: [
67
- "*.md"
68
- ],
69
- options: {
70
- proseWrap: "never",
71
- singleQuote: false
72
- }
73
- }
74
- ],
75
- plugins: [
76
- "@bfra.me/prettier-plugins/package-json"
77
- ].map(resolvePlugin)
78
- };
79
- var prettier_config_default = config;
80
- export {
81
- prettier_config_default as default
82
- };
1
+ import{createRequire as e}from"node:module";import{resolve as t}from"./plugins.js";const o=e(import.meta.url),s=t.bind(null,o.resolve),{searchParams:r}=new URL(import.meta.url),n={arrowParens:"avoid",bracketSpacing:!1,endOfLine:"auto",printWidth:100,semi:r.has("semi","true"),singleQuote:!0,overrides:[{files:["**/node_modules/**","**/dist/**","**/coverage/**","**/out/**","**/temp/**","**/.idea/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.tsup/**","**/.vercel/**","**/.vitepress/cache/**","**/.vite-inspect/**","**/__snapshots__/**","**/test/fixtures/**","**/auto-import?(s).d.ts","**/.changeset/*.md","**/CHANGELOG*.md","**/changelog*.md","**/components.d.ts","**/devcontainer-lock.json","**/LICENSE*","**/license*","**/*.min.*","**/package-lock.json","**/pnpm-lock.yaml","**/typed-router.d.ts","**/yarn.lock"],options:{requirePragma:!0}},{files:[".vscode/*.json",".devcontainer/**/devcontainer*.json"],options:{tabWidth:4}},{files:["*.md"],options:{proseWrap:"never",singleQuote:!1}}],plugins:["@bfra.me/prettier-plugins/package-json"].map(s)};var p=n;export{p as default};
83
2
  //# sourceMappingURL=prettier.config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bfra.me/prettier-config",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "Shared Prettier configuration for bfra.me",
5
5
  "keywords": [
6
6
  "bfra.me",
@@ -22,8 +22,14 @@
22
22
  "type": "module",
23
23
  "exports": {
24
24
  ".": {
25
- "types": "./lib/index.d.ts",
26
- "import": "./lib/index.js"
25
+ "types": "./lib/prettier.config.d.ts",
26
+ "source": "./src/prettier.config.ts",
27
+ "import": "./prettier.config.js"
28
+ },
29
+ "./*": {
30
+ "types": "./lib/*.d.ts",
31
+ "source": "./src/*.ts",
32
+ "import": "./lib/*.js"
27
33
  },
28
34
  "./100-proof": "./lib/prettier.config.js",
29
35
  "./120-proof": "./lib/120-proof.js",
@@ -32,25 +38,26 @@
32
38
  "./*/semi": "./lib/*.js?semi=true",
33
39
  "./package.json": "./package.json"
34
40
  },
35
- "main": "./lib/index.js",
36
- "types": "./lib/index.d.ts",
41
+ "main": "./prettier.config.js",
42
+ "types": "./lib/prettier.config.d.ts",
37
43
  "files": [
38
44
  "lib",
39
45
  "src",
46
+ "prettier.config.js",
40
47
  "!**/*.map"
41
48
  ],
42
49
  "dependencies": {
43
- "@bfra.me/prettier-plugins": "0.5.0"
50
+ "@bfra.me/prettier-plugins": "0.5.1"
44
51
  },
45
52
  "devDependencies": {
46
53
  "@types/fs-extra": "11.0.4",
47
- "execa": "9.5.0",
54
+ "execa": "9.5.1",
48
55
  "fast-glob": "3.3.2",
49
56
  "fs-extra": "11.2.0",
50
57
  "prettier": "3.3.3",
51
58
  "tsup": "8.3.5",
52
- "vitest": "2.1.3",
53
- "@bfra.me/prettier-config": "0.8.0",
59
+ "vitest": "2.1.4",
60
+ "@bfra.me/prettier-config": "0.9.1",
54
61
  "@bfra.me/tsconfig": "0.9.0"
55
62
  },
56
63
  "peerDependencies": {
@@ -62,6 +69,7 @@
62
69
  },
63
70
  "scripts": {
64
71
  "build": "tsup",
65
- "test": "vitest"
72
+ "postbuild": "prettier --config ./prettier.config.js --ignore-path .prettierignore --log-level warn --write .",
73
+ "test": "pnpm --filter-prod=\"{.}...\" --loglevel error run build && vitest"
66
74
  }
67
75
  }
@@ -0,0 +1,9 @@
1
+ import {createRequire}from'node:module';import Io from'prettier';import {parsers}from'prettier/plugins/babel';import*as Oo from'prettier/plugins/estree';import ss from'node:fs';var Ht=Object.create;var Y=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Yt=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var o=(r,e)=>Y(r,"name",{value:e,configurable:!0});var m=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zt=(r,e)=>{for(var t in e)Y(r,t,{get:e[t],enumerable:!0});},Jt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mt(e))!Wt.call(r,n)&&n!==t&&Y(r,n,{get:()=>e[n],enumerable:!(s=Bt(e,n))||s.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Ht(Yt(r)):{},Jt(Y(t,"default",{value:r,enumerable:!0}),r));var Ce=m((Po,Pe)=>{Pe.exports=o(function(e,t){var s,n;typeof t=="function"?n=t:s=t;var i=Object.keys(e);return (s||[]).concat(i.sort(n)).reduce(function(a,c){return i.indexOf(c)!==-1&&(a[c]=e[c]),a},Object.create(null))},"sortObjectByKeyNameList");});var j=m((Xo,Ge)=>{var os="2.0.0",as=Number.MAX_SAFE_INTEGER||9007199254740991,cs=16,ls=250,us=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ge.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cs,MAX_SAFE_BUILD_LENGTH:ls,MAX_SAFE_INTEGER:as,RELEASE_TYPES:us,SEMVER_SPEC_VERSION:os,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};});var G=m((_o,Fe)=>{var ps=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Fe.exports=ps;});var P=m((w,Ue)=>{var{MAX_SAFE_COMPONENT_LENGTH:pe,MAX_SAFE_BUILD_LENGTH:fs,MAX_LENGTH:hs}=j(),Es=G();w=Ue.exports={};var ms=w.re=[],ds=w.safeRe=[],l=w.src=[],u=w.t={},ys=0,fe="[a-zA-Z0-9-]",Rs=[["\\s",1],["\\d",hs],[fe,fs]],$s=o(r=>{for(let[e,t]of Rs)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},"makeSafeRegex"),d=o((r,e,t)=>{let s=$s(e),n=ys++;Es(r,n,e),u[r]=n,l[n]=e,ms[n]=new RegExp(e,t?"g":void 0),ds[n]=new RegExp(s,t?"g":void 0);},"createToken");d("NUMERICIDENTIFIER","0|[1-9]\\d*");d("NUMERICIDENTIFIERLOOSE","\\d+");d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fe}*`);d("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`);d("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`);d("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`);d("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`);d("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`);d("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`);d("BUILDIDENTIFIER",`${fe}+`);d("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`);d("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`);d("FULL",`^${l[u.FULLPLAIN]}$`);d("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`);d("LOOSE",`^${l[u.LOOSEPLAIN]}$`);d("GTLT","((?:<|>)?=?)");d("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);d("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`);d("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`);d("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`);d("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`);d("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`);d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pe}})(?:\\.(\\d{1,${pe}}))?(?:\\.(\\d{1,${pe}}))?`);d("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`);d("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`);d("COERCERTL",l[u.COERCE],!0);d("COERCERTLFULL",l[u.COERCEFULL],!0);d("LONETILDE","(?:~>?)");d("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0);w.tildeTrimReplace="$1~";d("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`);d("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`);d("LONECARET","(?:\\^)");d("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0);w.caretTrimReplace="$1^";d("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`);d("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`);d("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`);d("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`);d("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0);w.comparatorTrimReplace="$1$2$3";d("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`);d("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`);d("STAR","(<|>)?=?\\s*\\*");d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$");});var W=m((Bo,Ve)=>{var gs=Object.freeze({loose:!0}),Is=Object.freeze({}),vs=o(r=>r?typeof r!="object"?gs:r:Is,"parseOptions");Ve.exports=vs;});var he=m((Yo,He)=>{var Xe=/^[0-9]+$/,_e=o((r,e)=>{let t=Xe.test(r),s=Xe.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},"compareIdentifiers"),Os=o((r,e)=>_e(e,r),"rcompareIdentifiers");He.exports={compareIdentifiers:_e,rcompareIdentifiers:Os};});var I=m((zo,We)=>{var z=G(),{MAX_LENGTH:Be,MAX_SAFE_INTEGER:J}=j(),{safeRe:Me,t:Ye}=P(),Ns=W(),{compareIdentifiers:C}=he(),Ls=class T{static{o(this,"SemVer");}constructor(e,t){if(t=Ns(t),e instanceof T){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version;}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Be)throw new TypeError(`version is longer than ${Be} characters`);z("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?Me[Ye.LOOSE]:Me[Ye.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>J||this.major<0)throw new TypeError("Invalid major version");if(this.minor>J||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>J||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<J)return i}return n}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format();}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(z("SemVer.compare",this.version,this.options,e),!(e instanceof T)){if(typeof e=="string"&&e===this.version)return 0;e=new T(e,this.options);}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof T||(e=new T(e,this.options)),C(this.major,e.major)||C(this.minor,e.minor)||C(this.patch,e.patch)}comparePre(e){if(e instanceof T||(e=new T(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let s=this.prerelease[t],n=e.prerelease[t];if(z("prerelease compare",t,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return -1;if(s===n)continue;return C(s,n)}while(++t)}compareBuild(e){e instanceof T||(e=new T(e,this.options));let t=0;do{let s=this.build[t],n=e.build[t];if(z("build compare",t,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return -1;if(s===n)continue;return C(s,n)}while(++t)}inc(e,t,s){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,s),this.inc("pre",t,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,s),this.inc("pre",t,s);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(s)?1:0;if(!t&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[n];else {let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n);}}if(t){let i=[t,n];s===!1&&(i=[t]),C(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i;}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};We.exports=Ls;});var q=m((Ko,Je)=>{var ze=I(),Ss=o((r,e,t=!1)=>{if(r instanceof ze)return r;try{return new ze(r,e)}catch(s){if(!t)return null;throw s}},"parse");Je.exports=Ss;});var Qe=m((Zo,Ke)=>{var ks=q(),As=o((r,e)=>{let t=ks(r,e);return t?t.version:null},"valid");Ke.exports=As;});var er=m((ra,Ze)=>{var Ts=q(),ws=o((r,e)=>{let t=Ts(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");Ze.exports=ws;});var sr=m((sa,tr)=>{var rr=I(),qs=o((r,e,t,s,n)=>{typeof t=="string"&&(n=s,s=t,t=void 0);try{return new rr(r instanceof rr?r.version:r,t).inc(e,s,n).version}catch{return null}},"inc");tr.exports=qs;});var or=m((ia,ir)=>{var nr=q(),Ps=o((r,e)=>{let t=nr(r,null,!0),s=nr(e,null,!0),n=t.compare(s);if(n===0)return null;let i=n>0,a=i?t:s,c=i?s:t,p=!!a.prerelease.length;if(!!c.prerelease.length&&!p)return !c.patch&&!c.minor?"major":a.patch?"patch":a.minor?"minor":"major";let y=p?"pre":"";return t.major!==s.major?y+"major":t.minor!==s.minor?y+"minor":t.patch!==s.patch?y+"patch":"prerelease"},"diff");ir.exports=Ps;});var cr=m((aa,ar)=>{var Cs=I(),xs=o((r,e)=>new Cs(r,e).major,"major");ar.exports=xs;});var ur=m((la,lr)=>{var Ds=I(),bs=o((r,e)=>new Ds(r,e).minor,"minor");lr.exports=bs;});var fr=m((pa,pr)=>{var js=I(),Gs=o((r,e)=>new js(r,e).patch,"patch");pr.exports=Gs;});var Er=m((ha,hr)=>{var Fs=q(),Us=o((r,e)=>{let t=Fs(r,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");hr.exports=Us;});var S=m((ma,dr)=>{var mr=I(),Vs=o((r,e,t)=>new mr(r,t).compare(new mr(e,t)),"compare");dr.exports=Vs;});var Rr=m((ya,yr)=>{var Xs=S(),_s=o((r,e,t)=>Xs(e,r,t),"rcompare");yr.exports=_s;});var gr=m(($a,$r)=>{var Hs=S(),Bs=o((r,e)=>Hs(r,e,!0),"compareLoose");$r.exports=Bs;});var K=m((Ia,vr)=>{var Ir=I(),Ms=o((r,e,t)=>{let s=new Ir(r,t),n=new Ir(e,t);return s.compare(n)||s.compareBuild(n)},"compareBuild");vr.exports=Ms;});var Nr=m((Oa,Or)=>{var Ys=K(),Ws=o((r,e)=>r.sort((t,s)=>Ys(t,s,e)),"sort");Or.exports=Ws;});var Sr=m((La,Lr)=>{var zs=K(),Js=o((r,e)=>r.sort((t,s)=>zs(s,t,e)),"rsort");Lr.exports=Js;});var F=m((ka,kr)=>{var Ks=S(),Qs=o((r,e,t)=>Ks(r,e,t)>0,"gt");kr.exports=Qs;});var Q=m((Ta,Ar)=>{var Zs=S(),en=o((r,e,t)=>Zs(r,e,t)<0,"lt");Ar.exports=en;});var Ee=m((qa,Tr)=>{var rn=S(),tn=o((r,e,t)=>rn(r,e,t)===0,"eq");Tr.exports=tn;});var me=m((Ca,wr)=>{var sn=S(),nn=o((r,e,t)=>sn(r,e,t)!==0,"neq");wr.exports=nn;});var Z=m((Da,qr)=>{var on=S(),an=o((r,e,t)=>on(r,e,t)>=0,"gte");qr.exports=an;});var ee=m((ja,Pr)=>{var cn=S(),ln=o((r,e,t)=>cn(r,e,t)<=0,"lte");Pr.exports=ln;});var de=m((Fa,Cr)=>{var un=Ee(),pn=me(),fn=F(),hn=Z(),En=Q(),mn=ee(),dn=o((r,e,t,s)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return un(r,t,s);case"!=":return pn(r,t,s);case">":return fn(r,t,s);case">=":return hn(r,t,s);case"<":return En(r,t,s);case"<=":return mn(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Cr.exports=dn;});var Dr=m((Va,xr)=>{var yn=I(),Rn=q(),{safeRe:re,t:te}=P(),$n=o((r,e)=>{if(r instanceof yn)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?re[te.COERCEFULL]:re[te.COERCE]);else {let p=e.includePrerelease?re[te.COERCERTLFULL]:re[te.COERCERTL],E;for(;(E=p.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||E.index+E[0].length!==t.index+t[0].length)&&(t=E),p.lastIndex=E.index+E[1].length+E[2].length;p.lastIndex=-1;}if(t===null)return null;let s=t[2],n=t[3]||"0",i=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Rn(`${s}.${n}.${i}${a}${c}`,e)},"coerce");xr.exports=$n;});var jr=m((Ha,br)=>{var gn=class{static{o(this,"LRUCache");}constructor(){this.max=1e3,this.map=new Map;}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n);}this.map.set(e,t);}return this}};br.exports=gn;});var k=m((Ma,Vr)=>{var In=/\s+/g,vn=class se{static{o(this,"Range");}constructor(e,t){if(t=Nn(t),e instanceof se)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new se(e.raw,t);if(e instanceof ye)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(In," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!Fr(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&qn(n[0])){this.set=[n];break}}}this.formatted=void 0;}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let s=0;s<t.length;s++)s>0&&(this.formatted+=" "),this.formatted+=t[s].toString().trim();}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&Tn)|(this.options.loose&&wn))+":"+e,n=Gr.get(s);if(n)return n;let i=this.options.loose,a=i?L[O.HYPHENRANGELOOSE]:L[O.HYPHENRANGE];e=e.replace(a,Vn(this.options.includePrerelease)),g("hyphen replace",e),e=e.replace(L[O.COMPARATORTRIM],Sn),g("comparator trim",e),e=e.replace(L[O.TILDETRIM],kn),g("tilde trim",e),e=e.replace(L[O.CARETTRIM],An),g("caret trim",e);let c=e.split(" ").map(f=>Pn(f,this.options)).join(" ").split(/\s+/).map(f=>Un(f,this.options));i&&(c=c.filter(f=>(g("loose invalid filter",f,this.options),!!f.match(L[O.COMPARATORLOOSE])))),g("range list",c);let p=new Map,E=c.map(f=>new ye(f,this.options));for(let f of E){if(Fr(f))return [f];p.set(f.value,f);}p.size>1&&p.has("")&&p.delete("");let y=[...p.values()];return Gr.set(s,y),y}intersects(e,t){if(!(e instanceof se))throw new TypeError("a Range is required");return this.set.some(s=>Ur(s,t)&&e.set.some(n=>Ur(n,t)&&s.every(i=>n.every(a=>i.intersects(a,t)))))}test(e){if(!e)return !1;if(typeof e=="string")try{e=new Ln(e,this.options);}catch{return !1}for(let t=0;t<this.set.length;t++)if(Xn(this.set[t],e,this.options))return !0;return !1}};Vr.exports=vn;var On=jr(),Gr=new On,Nn=W(),ye=U(),g=G(),Ln=I(),{safeRe:L,t:O,comparatorTrimReplace:Sn,tildeTrimReplace:kn,caretTrimReplace:An}=P(),{FLAG_INCLUDE_PRERELEASE:Tn,FLAG_LOOSE:wn}=j(),Fr=o(r=>r.value==="<0.0.0-0","isNullSet"),qn=o(r=>r.value==="","isAny"),Ur=o((r,e)=>{let t=!0,s=r.slice(),n=s.pop();for(;t&&s.length;)t=s.every(i=>n.intersects(i,e)),n=s.pop();return t},"isSatisfiable"),Pn=o((r,e)=>(g("comp",r,e),r=Dn(r,e),g("caret",r),r=Cn(r,e),g("tildes",r),r=jn(r,e),g("xrange",r),r=Fn(r,e),g("stars",r),r),"parseComparator"),N=o(r=>!r||r.toLowerCase()==="x"||r==="*","isX"),Cn=o((r,e)=>r.trim().split(/\s+/).map(t=>xn(t,e)).join(" "),"replaceTildes"),xn=o((r,e)=>{let t=e.loose?L[O.TILDELOOSE]:L[O.TILDE];return r.replace(t,(s,n,i,a,c)=>{g("tilde",r,s,n,i,a,c);let p;return N(n)?p="":N(i)?p=`>=${n}.0.0 <${+n+1}.0.0-0`:N(a)?p=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:c?(g("replaceTilde pr",c),p=`>=${n}.${i}.${a}-${c} <${n}.${+i+1}.0-0`):p=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,g("tilde return",p),p})},"replaceTilde"),Dn=o((r,e)=>r.trim().split(/\s+/).map(t=>bn(t,e)).join(" "),"replaceCarets"),bn=o((r,e)=>{g("caret",r,e);let t=e.loose?L[O.CARETLOOSE]:L[O.CARET],s=e.includePrerelease?"-0":"";return r.replace(t,(n,i,a,c,p)=>{g("caret",r,n,i,a,c,p);let E;return N(i)?E="":N(a)?E=`>=${i}.0.0${s} <${+i+1}.0.0-0`:N(c)?i==="0"?E=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`:E=`>=${i}.${a}.0${s} <${+i+1}.0.0-0`:p?(g("replaceCaret pr",p),i==="0"?a==="0"?E=`>=${i}.${a}.${c}-${p} <${i}.${a}.${+c+1}-0`:E=`>=${i}.${a}.${c}-${p} <${i}.${+a+1}.0-0`:E=`>=${i}.${a}.${c}-${p} <${+i+1}.0.0-0`):(g("no pr"),i==="0"?a==="0"?E=`>=${i}.${a}.${c}${s} <${i}.${a}.${+c+1}-0`:E=`>=${i}.${a}.${c}${s} <${i}.${+a+1}.0-0`:E=`>=${i}.${a}.${c} <${+i+1}.0.0-0`),g("caret return",E),E})},"replaceCaret"),jn=o((r,e)=>(g("replaceXRanges",r,e),r.split(/\s+/).map(t=>Gn(t,e)).join(" ")),"replaceXRanges"),Gn=o((r,e)=>{r=r.trim();let t=e.loose?L[O.XRANGELOOSE]:L[O.XRANGE];return r.replace(t,(s,n,i,a,c,p)=>{g("xRange",r,s,n,i,a,c,p);let E=N(i),y=E||N(a),f=y||N(c),$=f;return n==="="&&$&&(n=""),p=e.includePrerelease?"-0":"",E?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&$?(y&&(a=0),c=0,n===">"?(n=">=",y?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):n==="<="&&(n="<",y?i=+i+1:a=+a+1),n==="<"&&(p="-0"),s=`${n+i}.${a}.${c}${p}`):y?s=`>=${i}.0.0${p} <${+i+1}.0.0-0`:f&&(s=`>=${i}.${a}.0${p} <${i}.${+a+1}.0-0`),g("xRange return",s),s})},"replaceXRange"),Fn=o((r,e)=>(g("replaceStars",r,e),r.trim().replace(L[O.STAR],"")),"replaceStars"),Un=o((r,e)=>(g("replaceGTE0",r,e),r.trim().replace(L[e.includePrerelease?O.GTE0PRE:O.GTE0],"")),"replaceGTE0"),Vn=o(r=>(e,t,s,n,i,a,c,p,E,y,f,$)=>(N(s)?t="":N(n)?t=`>=${s}.0.0${r?"-0":""}`:N(i)?t=`>=${s}.${n}.0${r?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,N(E)?p="":N(y)?p=`<${+E+1}.0.0-0`:N(f)?p=`<${E}.${+y+1}.0-0`:$?p=`<=${E}.${y}.${f}-${$}`:r?p=`<${E}.${y}.${+f+1}-0`:p=`<=${p}`,`${t} ${p}`.trim()),"hyphenReplace"),Xn=o((r,e,t)=>{for(let s=0;s<r.length;s++)if(!r[s].test(e))return !1;if(e.prerelease.length&&!t.includePrerelease){for(let s=0;s<r.length;s++)if(g(r[s].semver),r[s].semver!==ye.ANY&&r[s].semver.prerelease.length>0){let n=r[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return !0}return !1}return !0},"testSet");});var U=m((Wa,Yr)=>{var V=Symbol("SemVer ANY"),_n=class ge{static{o(this,"Comparator");}static get ANY(){return V}constructor(e,t){if(t=Xr(t),e instanceof ge){if(e.loose===!!t.loose)return e;e=e.value;}e=e.trim().split(/\s+/).join(" "),$e("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===V?this.value="":this.value=this.operator+this.semver.version,$e("comp",this);}parse(e){let t=this.options.loose?_r[Hr.COMPARATORLOOSE]:_r[Hr.COMPARATOR],s=e.match(t);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new Br(s[2],this.options.loose):this.semver=V;}toString(){return this.value}test(e){if($e("Comparator.test",e,this.options.loose),this.semver===V||e===V)return !0;if(typeof e=="string")try{e=new Br(e,this.options);}catch{return !1}return Re(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ge))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Mr(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Mr(this.value,t).test(e.semver):(t=Xr(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Re(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Re(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Yr.exports=_n;var Xr=W(),{safeRe:_r,t:Hr}=P(),Re=de(),$e=G(),Br=I(),Mr=k();});var X=m((Ja,Wr)=>{var Hn=k(),Bn=o((r,e,t)=>{try{e=new Hn(e,t);}catch{return !1}return e.test(r)},"satisfies");Wr.exports=Bn;});var Jr=m((Qa,zr)=>{var Mn=k(),Yn=o((r,e)=>new Mn(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" ")),"toComparators");zr.exports=Yn;});var Qr=m((ec,Kr)=>{var Wn=I(),zn=k(),Jn=o((r,e,t)=>{let s=null,n=null,i=null;try{i=new zn(e,t);}catch{return null}return r.forEach(a=>{i.test(a)&&(!s||n.compare(a)===-1)&&(s=a,n=new Wn(s,t));}),s},"maxSatisfying");Kr.exports=Jn;});var et=m((tc,Zr)=>{var Kn=I(),Qn=k(),Zn=o((r,e,t)=>{let s=null,n=null,i=null;try{i=new Qn(e,t);}catch{return null}return r.forEach(a=>{i.test(a)&&(!s||n.compare(a)===1)&&(s=a,n=new Kn(s,t));}),s},"minSatisfying");Zr.exports=Zn;});var st=m((nc,tt)=>{var Ie=I(),ei=k(),rt=F(),ri=o((r,e)=>{r=new ei(r,e);let t=new Ie("0.0.0");if(r.test(t)||(t=new Ie("0.0.0-0"),r.test(t)))return t;t=null;for(let s=0;s<r.set.length;++s){let n=r.set[s],i=null;n.forEach(a=>{let c=new Ie(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!i||rt(c,i))&&(i=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),i&&(!t||rt(t,i))&&(t=i);}return t&&r.test(t)?t:null},"minVersion");tt.exports=ri;});var it=m((oc,nt)=>{var ti=k(),si=o((r,e)=>{try{return new ti(r,e).range||"*"}catch{return null}},"validRange");nt.exports=si;});var ne=m((cc,lt)=>{var ni=I(),ct=U(),{ANY:ii}=ct,oi=k(),ai=X(),ot=F(),at=Q(),ci=ee(),li=Z(),ui=o((r,e,t,s)=>{r=new ni(r,s),e=new oi(e,s);let n,i,a,c,p;switch(t){case">":n=ot,i=ci,a=at,c=">",p=">=";break;case"<":n=at,i=li,a=ot,c="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ai(r,e,s))return !1;for(let E=0;E<e.set.length;++E){let y=e.set[E],f=null,$=null;if(y.forEach(h=>{h.semver===ii&&(h=new ct(">=0.0.0")),f=f||h,$=$||h,n(h.semver,f.semver,s)?f=h:a(h.semver,$.semver,s)&&($=h);}),f.operator===c||f.operator===p||(!$.operator||$.operator===c)&&i(r,$.semver))return !1;if($.operator===p&&a(r,$.semver))return !1}return !0},"outside");lt.exports=ui;});var pt=m((uc,ut)=>{var pi=ne(),fi=o((r,e,t)=>pi(r,e,">",t),"gtr");ut.exports=fi;});var ht=m((fc,ft)=>{var hi=ne(),Ei=o((r,e,t)=>hi(r,e,"<",t),"ltr");ft.exports=Ei;});var dt=m((Ec,mt)=>{var Et=k(),mi=o((r,e,t)=>(r=new Et(r,t),e=new Et(e,t),r.intersects(e,t)),"intersects");mt.exports=mi;});var Rt=m((dc,yt)=>{var di=X(),yi=S();yt.exports=(r,e,t)=>{let s=[],n=null,i=null,a=r.sort((y,f)=>yi(y,f,t));for(let y of a)di(y,e,t)?(i=y,n||(n=y)):(i&&s.push([n,i]),i=null,n=null);n&&s.push([n,null]);let c=[];for(let[y,f]of s)y===f?c.push(y):!f&&y===a[0]?c.push("*"):f?y===a[0]?c.push(`<=${f}`):c.push(`${y} - ${f}`):c.push(`>=${y}`);let p=c.join(" || "),E=typeof e.raw=="string"?e.raw:String(e);return p.length<E.length?p:e};});var Nt=m((yc,Ot)=>{var $t=k(),Oe=U(),{ANY:ve}=Oe,_=X(),Ne=S(),Ri=o((r,e,t={})=>{if(r===e)return !0;r=new $t(r,t),e=new $t(e,t);let s=!1;e:for(let n of r.set){for(let i of e.set){let a=gi(n,i,t);if(s=s||a!==null,a)continue e}if(s)return !1}return !0},"subset"),$i=[new Oe(">=0.0.0-0")],gt=[new Oe(">=0.0.0")],gi=o((r,e,t)=>{if(r===e)return !0;if(r.length===1&&r[0].semver===ve){if(e.length===1&&e[0].semver===ve)return !0;t.includePrerelease?r=$i:r=gt;}if(e.length===1&&e[0].semver===ve){if(t.includePrerelease)return !0;e=gt;}let s=new Set,n,i;for(let h of r)h.operator===">"||h.operator===">="?n=It(n,h,t):h.operator==="<"||h.operator==="<="?i=vt(i,h,t):s.add(h.semver);if(s.size>1)return null;let a;if(n&&i){if(a=Ne(n.semver,i.semver,t),a>0)return null;if(a===0&&(n.operator!==">="||i.operator!=="<="))return null}for(let h of s){if(n&&!_(h,String(n),t)||i&&!_(h,String(i),t))return null;for(let ce of e)if(!_(h,String(ce),t))return !1;return !0}let c,p,E,y,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1,$=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(y=y||h.operator===">"||h.operator===">=",E=E||h.operator==="<"||h.operator==="<=",n){if($&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===$.major&&h.semver.minor===$.minor&&h.semver.patch===$.patch&&($=!1),h.operator===">"||h.operator===">="){if(c=It(n,h,t),c===h&&c!==n)return !1}else if(n.operator===">="&&!_(n.semver,String(h),t))return !1}if(i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(p=vt(i,h,t),p===h&&p!==i)return !1}else if(i.operator==="<="&&!_(i.semver,String(h),t))return !1}if(!h.operator&&(i||n)&&a!==0)return !1}return !(n&&E&&!i&&a!==0||i&&y&&!n&&a!==0||$||f)},"simpleSubset"),It=o((r,e,t)=>{if(!r)return e;let s=Ne(r.semver,e.semver,t);return s>0?r:s<0||e.operator===">"&&r.operator===">="?e:r},"higherGT"),vt=o((r,e,t)=>{if(!r)return e;let s=Ne(r.semver,e.semver,t);return s<0?r:s>0||e.operator==="<"&&r.operator==="<="?e:r},"lowerLT");Ot.exports=Ri;});var At=m(($c,kt)=>{var Le=P(),Lt=j(),Ii=I(),St=he(),vi=q(),Oi=Qe(),Ni=er(),Li=sr(),Si=or(),ki=cr(),Ai=ur(),Ti=fr(),wi=Er(),qi=S(),Pi=Rr(),Ci=gr(),xi=K(),Di=Nr(),bi=Sr(),ji=F(),Gi=Q(),Fi=Ee(),Ui=me(),Vi=Z(),Xi=ee(),_i=de(),Hi=Dr(),Bi=U(),Mi=k(),Yi=X(),Wi=Jr(),zi=Qr(),Ji=et(),Ki=st(),Qi=it(),Zi=ne(),eo=pt(),ro=ht(),to=dt(),so=Rt(),no=Nt();kt.exports={parse:vi,valid:Oi,clean:Ni,inc:Li,diff:Si,major:ki,minor:Ai,patch:Ti,prerelease:wi,compare:qi,rcompare:Pi,compareLoose:Ci,compareBuild:xi,sort:Di,rsort:bi,gt:ji,lt:Gi,eq:Fi,neq:Ui,gte:Vi,lte:Xi,cmp:_i,coerce:Hi,Comparator:Bi,Range:Mi,satisfies:Yi,toComparators:Wi,maxSatisfying:zi,minSatisfying:Ji,minVersion:Ki,validRange:Qi,outside:Zi,gtr:eo,ltr:ro,intersects:to,simplifyRange:so,subset:no,SemVer:Ii,re:Le.re,src:Le.src,tokens:Le.t,SEMVER_SPEC_VERSION:Lt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Lt.RELEASE_TYPES,compareIdentifiers:St.compareIdentifiers,rcompareIdentifiers:St.rcompareIdentifiers};});var Te={};zt(Te,{default:()=>Lo,languages:()=>Ut,options:()=>Ft,parsers:()=>Vt,pluginPackageJson:()=>Xt});var M=qe(Ce());var Kt=/^(?:( )+|\t+)/,b="space",De="tab";function xe(r,e){let t=new Map,s=0,n,i;for(let a of r.split(/\n/g)){if(!a)continue;let c,p,E,y,f,$=a.match(Kt);if($===null)s=0,n="";else {if(c=$[0].length,p=$[1]?b:De,e&&p===b&&c===1)continue;p!==n&&(s=0),n=p,E=1,y=0;let h=c-s;if(s=c,h===0)E=0,y=1;else {let ce=h>0?h:-h;i=Qt(p,ce);}f=t.get(i),f=f===void 0?[1,0]:[f[0]+E,f[1]+y],t.set(i,f);}}return t}o(xe,"makeIndentsMap");function Qt(r,e){return (r===b?"s":"t")+String(e)}o(Qt,"encodeIndentsKey");function Zt(r){let t=r[0]==="s"?b:De,s=Number(r.slice(1));return {type:t,amount:s}}o(Zt,"decodeIndentsKey");function es(r){let e,t=0,s=0;for(let[n,[i,a]]of r)(i>t||i===t&&a>s)&&(t=i,s=a,e=n);return e}o(es,"getMostUsedKey");function rs(r,e){return (r===b?" ":" ").repeat(e)}o(rs,"makeIndentString");function le(r){if(typeof r!="string")throw new TypeError("Expected a string");let e=xe(r,!0);e.size===0&&(e=xe(r,!1));let t=es(e),s,n=0,i="";return t!==void 0&&({type:s,amount:n}=Zt(t),i=rs(s,n)),{amount:n,type:s,indent:i}}o(le,"detectIndent");function ts(r){if(typeof r!="string")throw new TypeError("Expected a string");let e=r.match(/(?:\r?\n)/g)||[];if(e.length===0)return;let t=e.filter(n=>n===`\r
2
+ `).length,s=e.length-t;return t>s?`\r
3
+ `:`
4
+ `}o(ts,"detectNewline");function be(r){return typeof r=="string"&&ts(r)||`
5
+ `}o(be,"detectNewlineGraceful");var ns=new URL("./index.json",import.meta.url),is=JSON.parse(ss.readFileSync(ns)),je=is;function ue(r){if(typeof r!="object"||r===null)return !1;let e=Object.getPrototypeOf(r);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}o(ue,"isPlainObject");var oe=qe(At());var Ae=Object.hasOwn||((r,e)=>Object.prototype.hasOwnProperty.call(r,e)),x=o(r=>(e,...t)=>r.reduce((s,n)=>n(s,...t),e),"pipe"),B=o(r=>e=>Array.isArray(e)?r(e):e,"onArray"),Dt=o(r=>e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?r(e):e,"onStringArray"),H=Dt(r=>[...new Set(r)]),io=Dt(r=>[...r].sort()),ie=x([H,io]),D=o(r=>(e,...t)=>ue(e)?r(e,...t):e,"onObject"),v=o((r,e)=>{let t=D(s=>(e&&(s=Object.fromEntries(Object.entries(s).map(([n,i])=>[n,t(i)]))),(0, M.default)(s,r)));return t},"sortObjectBy"),R=v(),Se=v(["type","url"]),ke=v(["name","email","url"]),oo=v(["lib","bin","man","doc","example","test"]),A=o((r,e)=>(t,...s)=>Ae(t,r)?{...t,[r]:e(t[r],...s)}:t,"overProperty"),Tt=v(je),wt=o(r=>{let[e]=r.split(">"),t=[...e.matchAll("@")];if(!t.length||t.length===1&&t[0].index===0)return {name:r};let s=t.pop().index;return {name:e.substring(0,s),range:e.substring(s+1)}},"parseNameAndVersionRange"),ao=v((r,e)=>{let{name:t,range:s}=wt(r),{name:n,range:i}=wt(e);return t!==n?t.localeCompare(n):s?i?oe.default.compare(oe.default.minVersion(s),oe.default.minVersion(i)):1:-1}),qt=o(r=>{let e=r.split("@");return r.startsWith("@")?e.length>2?e.slice(0,-1).join("@"):r:e.length>1?e.slice(0,-1).join("@"):r},"getPackageName"),co=o((r,e)=>{let t=qt(r),s=qt(e);return t<s?-1:t>s?1:0},"sortObjectByIdent"),lo=["files","excludedFiles","env","parser","parserOptions","settings","plugins","extends","rules","overrides","globals","processor","noInlineConfig","reportUnusedDisableDirectives"],bt=D(x([v(lo),A("env",R),A("globals",R),A("overrides",B(r=>r.map(bt))),A("parserOptions",R),A("rules",v((r,e)=>r.split("/").length-e.split("/").length||r.localeCompare(e))),A("settings",R)])),uo=v(["description","url","href"]),po=D(x([r=>(0, M.default)(r,[...Object.keys(r).filter(e=>e!=="overrides").sort(),"overrides"]),A("overrides",B(r=>r.map(x([R,A("options",R)]))))])),fo=v(["node","npm","yarn"]),ho=["peerDependencyRules","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","allowedDeprecatedVersions","allowNonAppliedPatches","updateConfig","auditConfig","requiredScripts","supportedArchitectures","overrides","patchedDependencies","packageExtensions"],Eo=D(x([v(ho,!0),A("overrides",ao)])),mo=new Set(["install","pack","prepare","publish","restart","shrinkwrap","start","stop","test","uninstall","version"]),Pt=o((r,e)=>Ae(e,"devDependencies")&&Ae(e.devDependencies,r),"hasDevDependency"),Ct=D((r,e)=>{let t=Object.keys(r),s=new Set,n=t.map(a=>{let c=a.replace(/^(?:pre|post)/,"");return mo.has(c)||t.includes(c)?(s.add(c),c):a});!Pt("npm-run-all",e)&&!Pt("npm-run-all2",e)&&n.sort();let i=n.flatMap(a=>s.has(a)?[`pre${a}`,a,`post${a}`]:[a]);return (0, M.default)(r,i)}),jt=[{key:"$schema"},{key:"name"},{key:"displayName"},{key:"version"},{key:"private"},{key:"description"},{key:"categories",over:H},{key:"keywords",over:H},{key:"homepage"},{key:"bugs",over:v(["url","email"])},{key:"repository",over:Se},{key:"funding",over:Se},{key:"license",over:Se},{key:"qna"},{key:"author",over:ke},{key:"maintainers",over:B(r=>r.map(ke))},{key:"contributors",over:B(r=>r.map(ke))},{key:"publisher"},{key:"sideEffects"},{key:"type"},{key:"imports"},{key:"exports"},{key:"main"},{key:"svelte"},{key:"umd:main"},{key:"jsdelivr"},{key:"unpkg"},{key:"module"},{key:"source"},{key:"jsnext:main"},{key:"browser"},{key:"react-native"},{key:"types"},{key:"typesVersions"},{key:"typings"},{key:"style"},{key:"example"},{key:"examplestyle"},{key:"assets"},{key:"bin",over:R},{key:"man"},{key:"directories",over:oo},{key:"files",over:H},{key:"workspaces"},{key:"binary",over:v(["module_name","module_path","remote_path","package_name","host"])},{key:"scripts",over:Ct},{key:"betterScripts",over:Ct},{key:"contributes",over:R},{key:"activationEvents",over:H},{key:"husky",over:A("hooks",Tt)},{key:"simple-git-hooks",over:Tt},{key:"pre-commit"},{key:"commitlint",over:R},{key:"lint-staged"},{key:"nano-staged"},{key:"config",over:R},{key:"nodemonConfig",over:R},{key:"browserify",over:R},{key:"babel",over:R},{key:"browserslist"},{key:"xo",over:R},{key:"prettier",over:po},{key:"eslintConfig",over:bt},{key:"eslintIgnore"},{key:"npmpkgjsonlint",over:R},{key:"npmPackageJsonLintConfig",over:R},{key:"npmpackagejsonlint",over:R},{key:"release",over:R},{key:"remarkConfig",over:R},{key:"stylelint"},{key:"ava",over:R},{key:"jest",over:R},{key:"jest-junit",over:R},{key:"jest-stare",over:R},{key:"mocha",over:R},{key:"nyc",over:R},{key:"c8",over:R},{key:"tap",over:R},{key:"oclif",over:v(void 0,!0)},{key:"resolutions",over:R},{key:"dependencies",over:R},{key:"devDependencies",over:R},{key:"dependenciesMeta",over:v(co,!0)},{key:"peerDependencies",over:R},{key:"peerDependenciesMeta",over:v(void 0,!0)},{key:"optionalDependencies",over:R},{key:"bundledDependencies",over:ie},{key:"bundleDependencies",over:ie},{key:"extensionPack",over:ie},{key:"extensionDependencies",over:ie},{key:"flat"},{key:"packageManager"},{key:"engines",over:R},{key:"engineStrict",over:R},{key:"volta",over:fo},{key:"languageName"},{key:"os"},{key:"cpu"},{key:"preferGlobal",over:R},{key:"publishConfig",over:R},{key:"icon"},{key:"badges",over:B(r=>r.map(uo))},{key:"galleryBanner",over:R},{key:"preview"},{key:"markdown"},{key:"pnpm",over:Eo}],xt=jt.map(({key:r})=>r),yo=x(jt.map(({key:r,over:e})=>e?A(r,e):void 0).filter(Boolean));function Ro(r,e){if(typeof r=="string"){let{indent:t,type:s}=le(r),n=r.slice(-1)===`
6
+ `?`
7
+ `:"",i=be(r);r=JSON.parse(r);let a=JSON.stringify(e(r),null,s==="tab"?" ":t)+n;return i===`\r
8
+ `&&(a=a.replace(/\n/g,i)),a}return e(r)}o(Ro,"editStringJSON");var $o=o(r=>r[0]==="_","isPrivateKey"),go=o((r,e)=>r.reduce((t,s)=>(t[e(s)?0:1].push(s),t),[[],[]]),"partition");function Gt(r,e={}){return Ro(r,D(t=>{let s=e.sortOrder||xt;if(Array.isArray(s)){let n=Object.keys(t),[i,a]=go(n,$o);s=[...s,...xt,...a.sort(),...i.sort()];}return yo((0, M.default)(t,s),t)}))}o(Gt,"sortPackageJson");var Ft={sortPackageJsonSortOrder:{category:"Format",type:"string",description:"Custom ordering array.",default:[{value:[]}],array:!0}},{languages:No}=Oo,Ut=No.filter(({name:r})=>r==="JSON.stringify"),ae=parsers["json-stringify"],Vt={"json-stringify":{...ae,async parse(r,e){let{filepath:t}=e;if(/package.*json$/u.test(t)){r=await Io.format(r,{filepath:t}),ae.preprocess&&(r=ae.preprocess(r,e));let s=e?.sortPackageJsonSortOrder;r=Gt(r,s&&s.length>0?{sortOrder:s}:{});}return ae.parse(r,e)}}},Xt={languages:Ut,options:Ft,parsers:Vt},Lo=Xt;var we={"@bfra.me/prettier-plugins/package-json":Te};async function _t(r,e){try{if(!we[e]){let t=r(e);we[e]=t;}return we[e]??e}catch{return e}}o(_t,"resolve");var ko=createRequire(import.meta.url),Ao=_t.bind(null,ko.resolve),{searchParams:To}=new URL(import.meta.url),wo={arrowParens:"avoid",bracketSpacing:!1,endOfLine:"auto",printWidth:100,semi:To.has("semi","true"),singleQuote:!0,overrides:[{files:["**/node_modules/**","**/dist/**","**/coverage/**","**/out/**","**/temp/**","**/.idea/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.tsup/**","**/.vercel/**","**/.vitepress/cache/**","**/.vite-inspect/**","**/__snapshots__/**","**/test/fixtures/**","**/auto-import?(s).d.ts","**/.changeset/*.md","**/CHANGELOG*.md","**/changelog*.md","**/components.d.ts","**/devcontainer-lock.json","**/LICENSE*","**/license*","**/*.min.*","**/package-lock.json","**/pnpm-lock.yaml","**/typed-router.d.ts","**/yarn.lock"],options:{requirePragma:!0}},{files:[".vscode/*.json",".devcontainer/**/devcontainer*.json"],options:{tabWidth:4}},{files:["*.md"],options:{proseWrap:"never",singleQuote:!1}}],plugins:["@bfra.me/prettier-plugins/package-json"].map(Ao)},Cc=wo;export{Cc as default};//# sourceMappingURL=prettier.config.js.map
9
+ //# sourceMappingURL=prettier.config.js.map
package/src/120-proof.ts CHANGED
@@ -1,17 +1,14 @@
1
- import defaultConfig, {type DefaultConfig} from './prettier.config.js'
2
-
3
- /**
4
- * Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
5
- */
6
- export interface $120ProofConfig extends DefaultConfig {
7
- /** @default 120 */
8
- printWidth: 120 | DefaultConfig['printWidth']
9
- }
1
+ import defaultConfig, {type Writable} from './prettier.config.js'
10
2
 
11
3
  const $120ProofConfig = {
12
4
  ...defaultConfig,
13
5
  printWidth: 120,
14
6
  semi: new URL(import.meta.url).searchParams.has('semi', 'true') || defaultConfig.semi,
15
- } as $120ProofConfig
7
+ } as const
8
+
9
+ /**
10
+ * Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
11
+ */
12
+ type $120ProofConfig = Writable<typeof $120ProofConfig>
16
13
 
17
- export default $120ProofConfig
14
+ export default $120ProofConfig as $120ProofConfig
package/src/plugins.ts CHANGED
@@ -1,17 +1,21 @@
1
1
  import type {Plugin} from 'prettier'
2
2
  import * as PluginPackageJson from '@bfra.me/prettier-plugins/package-json'
3
3
 
4
- const resolvedPlugins: Record<string, Plugin> = {
4
+ const resolvedPlugins: Record<string, string | Plugin<any>> = {
5
5
  '@bfra.me/prettier-plugins/package-json': PluginPackageJson,
6
6
  }
7
7
 
8
- export const resolve = (resolver: (id: string) => string, plugin: string): string | Plugin => {
8
+ export async function resolve(
9
+ resolver: (id: string) => string,
10
+ plugin: string,
11
+ ): Promise<string | Plugin<any>> {
9
12
  try {
10
- if (resolvedPlugins[plugin]) {
11
- return resolvedPlugins[plugin]
13
+ if (!resolvedPlugins[plugin]) {
14
+ const resolved = resolver(plugin)
15
+ resolvedPlugins[plugin] = resolved
12
16
  }
13
- return resolver(plugin)
14
- } finally {
17
+ return resolvedPlugins[plugin] ?? plugin
18
+ } catch {
15
19
  return plugin
16
20
  }
17
21
  }
@@ -1,31 +1,15 @@
1
1
  import {createRequire} from 'node:module'
2
- import type {Config} from 'prettier'
2
+ import type * as prettier from 'prettier'
3
3
  import {resolve} from './plugins.js'
4
4
 
5
+ export type Writable<T> = {
6
+ -readonly [K in keyof T]: T[K] extends object ? {[J in keyof T[K]]: Writable<T[K][J]>} : T[K]
7
+ } & {}
8
+
5
9
  const require = createRequire(import.meta.url)
6
10
  const resolvePlugin = resolve.bind(null, require.resolve)
7
11
  const {searchParams} = new URL(import.meta.url)
8
12
 
9
- type RequiredConfig = Required<Config>
10
-
11
- /**
12
- * Shared Prettier configuration for bfra.me projects.
13
- */
14
- export interface DefaultConfig extends Config {
15
- /** @default avoid */
16
- arrowParens: 'avoid' | RequiredConfig['arrowParens']
17
- /** @default false */
18
- bracketSpacing: false | boolean
19
- /** @default auto */
20
- endOfLine: 'auto' | RequiredConfig['endOfLine']
21
- /** @default 100 */
22
- printWidth: 100 | number
23
- /** @default false */
24
- semi: false | boolean
25
- /** @default true */
26
- singleQuote: true | boolean
27
- }
28
-
29
13
  const config = {
30
14
  arrowParens: 'avoid',
31
15
  bracketSpacing: false,
@@ -93,9 +77,14 @@ const config = {
93
77
  singleQuote: false,
94
78
  },
95
79
  },
96
- ],
80
+ ] as prettier.Config['overrides'],
97
81
 
98
82
  plugins: ['@bfra.me/prettier-plugins/package-json'].map(resolvePlugin),
99
- } as DefaultConfig
83
+ } as const
84
+
85
+ /**
86
+ * Shared Prettier configuration for bfra.me projects.
87
+ */
88
+ export type Config = Writable<typeof config>
100
89
 
101
- export default config
90
+ export default config as Config
package/lib/index.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import { Config } from 'prettier';
2
-
3
- type RequiredConfig = Required<Config>;
4
- /**
5
- * Shared Prettier configuration for bfra.me projects.
6
- */
7
- interface DefaultConfig extends Config {
8
- /** @default avoid */
9
- arrowParens: 'avoid' | RequiredConfig['arrowParens'];
10
- /** @default false */
11
- bracketSpacing: false | boolean;
12
- /** @default auto */
13
- endOfLine: 'auto' | RequiredConfig['endOfLine'];
14
- /** @default 100 */
15
- printWidth: 100 | number;
16
- /** @default false */
17
- semi: false | boolean;
18
- /** @default true */
19
- singleQuote: true | boolean;
20
- }
21
- declare const config: DefaultConfig;
22
-
23
- /**
24
- * Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
25
- */
26
- interface $120ProofConfig extends DefaultConfig {
27
- /** @default 120 */
28
- printWidth: 120 | DefaultConfig['printWidth'];
29
- }
30
- declare const $120ProofConfig: $120ProofConfig;
31
-
32
- export { $120ProofConfig, type DefaultConfig, config as default };
package/lib/index.js DELETED
@@ -1,8 +0,0 @@
1
- import defaultConfig from "./prettier.config.js";
2
- export * from "./120-proof.js";
3
- export * from "./prettier.config.js";
4
- var src_default = defaultConfig;
5
- export {
6
- src_default as default
7
- };
8
- //# sourceMappingURL=index.js.map
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- import defaultConfig from './prettier.config.js'
2
- export * from './120-proof.js'
3
- export * from './prettier.config.js'
4
-
5
- export default defaultConfig