@batijs/core 0.0.79-beta.2 → 0.0.79-beta.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.
@@ -2,14 +2,16 @@ declare const features: readonly ["framework:solid", "framework:react", "framewo
2
2
  type BeforeColon<T extends string> = T extends `${infer A}:${string}` ? A : never;
3
3
  type Namespaces = BeforeColon<(typeof features)[number]>;
4
4
 
5
+ declare enum RulesMessage {
6
+ AUTH_R_SERVER = 0
7
+ }
8
+
5
9
  type Features = (typeof features)[number];
6
10
  type FeaturesOrNamespaces = Features | Namespaces;
7
- type Rule = (fts: Set<FeaturesOrNamespaces>) => null | undefined | false | string | ErrorWrapper;
8
- type ErrorFormatter = (str: string, index: number) => string;
9
- type ErrorWrapper = (wrapper?: ErrorFormatter) => string;
11
+ type Rule = (fts: Set<FeaturesOrNamespaces>) => null | undefined | false | string | RulesMessage;
10
12
 
11
13
  declare const _default: Rule[];
12
14
 
13
- declare function conflicts(fts: FeaturesOrNamespaces[], formatter: ErrorFormatter): string[];
15
+ declare function conflicts(fts: FeaturesOrNamespaces[], errors: Record<RulesMessage, string>): string[];
14
16
 
15
- export { conflicts, _default as rules };
17
+ export { RulesMessage, conflicts, _default as rules };
package/dist/conflicts.js CHANGED
@@ -1 +1 @@
1
- function u(a,e,r){let s=Array.from(p(r));return o=>o.has(e)&&!s.every(t=>o.has(t))&&a}function p(a){let e=new Set;for(let r of a)r.includes(":")&&e.add(r.split(":")[0]),e.add(r);return e}function n(a,...e){return r=>{let s="";return a.forEach((o,t)=>{s+=o+(r?.(e[t],t)??"")}),s}}var i=[u(n`A ${"Server"} is mandatory when using ${"Auth"}. Check https://vite-plugin-ssr.com/integration#server-side-tools for details and https://batijs.github.io for available servers`,"auth",["server"])];function y(a,e){let r=p(a),s=[];for(let o of i){let t=o(r);typeof t=="string"?s.push(t):typeof t=="function"&&s.push(t(e))}return s}export{y as conflicts,i as rules};
1
+ function m(t,e,s){let a=Array.from(p(s));return u=>u.has(e)&&!a.every(r=>u.has(r))&&t}function p(t){let e=new Set;for(let s of t)s.includes(":")&&e.add(s.split(":")[0]),e.add(s);return e}var o=(e=>(e[e.AUTH_R_SERVER=0]="AUTH_R_SERVER",e))(o||{});var n=[m(0,"auth",["server"])];function g(t,e){let s=p(t),a=[];for(let u of n){let r=u(s);typeof r=="string"?a.push(r):typeof r=="number"&&a.push(e[r])}return a}export{o as RulesMessage,g as conflicts,n as rules};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/core",
3
- "version": "0.0.79-beta.2",
3
+ "version": "0.0.79-beta.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",