@razorwind/eslint 0.0.11 → 0.0.12
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.cjs +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -10
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./runtime-BsIMYTOg.cjs");let t=require("@razorwind/core/plugin"),n=require("@razorwind/core/utils"),r=require("node:fs/promises"),i=require("node:path"),a=require("@razorwind/tailwindcss/eslint"),o=require("@razorwind/tailwindcss/generate"),s=require("@razorwind/tamagui"),c=require("@razorwind/tamagui/eslint");const l=[`light`,`default`,`base`],u=/^\{([^}]+)\}$/,d=/\{([^}]+)\}/,f={color:`color`,shadow:`shadow`,typography:`typography`,fontFamily:`fontFamily`,fontWeight:`fontWeight`,duration:`duration`,cubicBezier:`easing`},p={color:`color`,space:`space`,size:`size`,radius:`radius`,zIndex:`zIndex`,fontSize:`fontSize`,fontWeight:`fontWeight`,shadow:`shadow`,insetShadow:`shadow`,dropShadow:`shadow`,textShadow:`shadow`,boxShadow:`shadow`},m={button:[`button`],"icon-button":[`iconbutton`],link:[`link`,`anchor`,`textlink`],checkbox:[`checkbox`],code:[`code`,`inlinecode`,`codeblock`],heading:[`heading`],image:[`image`,`img`],radio:[`radio`,`radiogroup`],range:[`slider`,`range`],select:[`select`,`nativeselect`],"text-input":[`input`,`textinput`,`textfield`],textarea:[`textarea`],text:[`text`,`typography`],"visually-hidden":[`visuallyhidden`,`sronly`,`screenreaderonly`],icon:[`icon`],primitive:[`box`,`stack`,`hstack`,`vstack`,`xstack`,`ystack`,`inline`,`flex`,`grid`,`center`]};function h(e){return e.replaceAll(/([\p{Ll}\d])(\p{Lu})/gu,`$1 $2`).replaceAll(/(\p{Lu})(\p{Lu}\p{Ll})/gu,`$1 $2`).split(/[^\p{L}\d]+/u).filter(Boolean).join(`-`).toLowerCase()}function g(e){return e.split(/[^a-z0-9]+/i).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function _(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,``)}function v(e,t){let n=e.split(`.`).map(e=>e.toLowerCase()),r=(...e)=>e.some(e=>n.includes(e)),i=(e,t)=>n.some((r,i)=>r===e&&n[i+1]===t),a=t?f[t]:void 0;if(a)return a;if(r(`font-size`,`fontsize`)||i(`font`,`size`)||i(`text`,`size`))return`fontSize`;if(r(`font-weight`,`fontweight`)||i(`font`,`weight`))return`fontWeight`;if(r(`font-family`,`fontfamily`)||i(`font`,`family`))return`fontFamily`;if(r(`line-height`,`lineheight`,`leading`)||i(`line`,`height`))return`lineHeight`;if(r(`letter-spacing`,`letterspacing`,`tracking`)||i(`letter`,`spacing`))return`letterSpacing`;if(r(`border-width`,`borderwidth`,`stroke-width`,`strokewidth`,`outline-width`)||r(`border`,`stroke`,`outline`)&&r(`width`))return`borderWidth`;if(r(`duration`,`durations`,`delay`))return`duration`;if(r(`easing`,`ease`,`timing`,`cubic-bezier`))return`easing`;if(r(`opacity`,`opacities`))return`opacity`;let o=(0,s.resolveTokenCategory)(e,t);return o?p[o]:void 0}function y(e){let t=/* @__PURE__ */ new Map,r=(e,i,a)=>{if(!(0,n.isObject)(e))return;let o=e.$deprecated,s=o===!0||typeof o==`string`&&o.length>0?o:o===!1?void 0:a;if((0,n.isTokenLeaf)(e)){s&&!t.has(i.join(`.`))&&t.set(i.join(`.`),s);return}for(let[t,n]of Object.entries(e))t.startsWith(`$`)||r(n,[...i,t],s)};for(let t of(0,n.resolveTokenSets)(e))r(t.tokens,[],void 0);return t}function b(e){if(e===void 0)return-1;let t=l.indexOf(e.toLowerCase());return t<0?l.length:t}function x(e,t){let r=(0,n.flattenTokens)(e),i=y(e),a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map;for(let e of r){o.set(`${e.theme??``}:${e.path}`,e);let t=a.get(e.path);(!t||b(e.theme)<b(t.theme))&&a.set(e.path,e)}let s=(e,t=0)=>{let n=typeof e.value==`string`?u.exec(e.value)?.[1]:void 0;if(!n||t>10)return e;let r=o.get(`${e.theme??``}:${n}`)??a.get(n);return r?s(r,t+1):e};return[...a.values()].map(e=>{let r=s(e),o=e.type??r.type,c=(0,n.formatTokenValue)(r.value,o),l=i.get(e.path),u=typeof l==`string`?d.exec(l)?.[1]:void 0,f=v(e.path,o),p={path:e.path,cssVar:`--${h([t??``,...e.path.split(`.`)].join(` `))}`};return o&&(p.type=o),f&&(p.category=f),c&&!/^[[{]/.test(c)&&!c.includes(`var(`)&&(p.value=c),r!==e&&(p.alias=!0),l&&(p.deprecated=l),u&&a.has(u)&&(p.replacement=u),p}).sort((e,t)=>e.path.localeCompare(t.path,void 0,{numeric:!0}))}function S(e){let t=Object.values(e??{}),n=e=>[...new Set([e.title,e.name].map(g).filter(Boolean))];return t.map(e=>{let
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./runtime-BsIMYTOg.cjs");let t=require("@razorwind/core/plugin"),n=require("@razorwind/core/utils"),r=require("node:fs/promises"),i=require("node:path"),a=require("@razorwind/tailwindcss/eslint"),o=require("@razorwind/tailwindcss/generate"),s=require("@razorwind/tamagui"),c=require("@razorwind/tamagui/eslint");const l=[`light`,`default`,`base`],u=/^\{([^}]+)\}$/,d=/\{([^}]+)\}/,f={color:`color`,shadow:`shadow`,typography:`typography`,fontFamily:`fontFamily`,fontWeight:`fontWeight`,duration:`duration`,cubicBezier:`easing`},p={color:`color`,space:`space`,size:`size`,radius:`radius`,zIndex:`zIndex`,fontSize:`fontSize`,fontWeight:`fontWeight`,shadow:`shadow`,insetShadow:`shadow`,dropShadow:`shadow`,textShadow:`shadow`,boxShadow:`shadow`},m={button:[`button`],"icon-button":[`iconbutton`],link:[`link`,`anchor`,`textlink`],checkbox:[`checkbox`],code:[`code`,`inlinecode`,`codeblock`],heading:[`heading`],image:[`image`,`img`],radio:[`radio`,`radiogroup`],range:[`slider`,`range`],select:[`select`,`nativeselect`],"text-input":[`input`,`textinput`,`textfield`],textarea:[`textarea`],text:[`text`,`typography`],"visually-hidden":[`visuallyhidden`,`sronly`,`screenreaderonly`],icon:[`icon`],primitive:[`box`,`stack`,`hstack`,`vstack`,`xstack`,`ystack`,`inline`,`flex`,`grid`,`center`]};function h(e){return e.replaceAll(/([\p{Ll}\d])(\p{Lu})/gu,`$1 $2`).replaceAll(/(\p{Lu})(\p{Lu}\p{Ll})/gu,`$1 $2`).split(/[^\p{L}\d]+/u).filter(Boolean).join(`-`).toLowerCase()}function g(e){return e.split(/[^a-z0-9]+/i).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function _(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,``)}function v(e,t){let n=e.split(`.`).map(e=>e.toLowerCase()),r=(...e)=>e.some(e=>n.includes(e)),i=(e,t)=>n.some((r,i)=>r===e&&n[i+1]===t),a=t?f[t]:void 0;if(a)return a;if(r(`font-size`,`fontsize`)||i(`font`,`size`)||i(`text`,`size`))return`fontSize`;if(r(`font-weight`,`fontweight`)||i(`font`,`weight`))return`fontWeight`;if(r(`font-family`,`fontfamily`)||i(`font`,`family`))return`fontFamily`;if(r(`line-height`,`lineheight`,`leading`)||i(`line`,`height`))return`lineHeight`;if(r(`letter-spacing`,`letterspacing`,`tracking`)||i(`letter`,`spacing`))return`letterSpacing`;if(r(`border-width`,`borderwidth`,`stroke-width`,`strokewidth`,`outline-width`)||r(`border`,`stroke`,`outline`)&&r(`width`))return`borderWidth`;if(r(`duration`,`durations`,`delay`))return`duration`;if(r(`easing`,`ease`,`timing`,`cubic-bezier`))return`easing`;if(r(`opacity`,`opacities`))return`opacity`;let o=(0,s.resolveTokenCategory)(e,t);return o?p[o]:void 0}function y(e){let t=/* @__PURE__ */ new Map,r=(e,i,a)=>{if(!(0,n.isObject)(e))return;let o=e.$deprecated,s=o===!0||typeof o==`string`&&o.length>0?o:o===!1?void 0:a;if((0,n.isTokenLeaf)(e)){s&&!t.has(i.join(`.`))&&t.set(i.join(`.`),s);return}for(let[t,n]of Object.entries(e))t.startsWith(`$`)||r(n,[...i,t],s)};for(let t of(0,n.resolveTokenSets)(e))r(t.tokens,[],void 0);return t}function b(e){if(e===void 0)return-1;let t=l.indexOf(e.toLowerCase());return t<0?l.length:t}function x(e,t){let r=(0,n.flattenTokens)(e),i=y(e),a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map;for(let e of r){o.set(`${e.theme??``}:${e.path}`,e);let t=a.get(e.path);(!t||b(e.theme)<b(t.theme))&&a.set(e.path,e)}let s=(e,t=0)=>{let n=typeof e.value==`string`?u.exec(e.value)?.[1]:void 0;if(!n||t>10)return e;let r=o.get(`${e.theme??``}:${n}`)??a.get(n);return r?s(r,t+1):e};return[...a.values()].map(e=>{let r=s(e),o=e.type??r.type,c=(0,n.formatTokenValue)(r.value,o),l=i.get(e.path),u=typeof l==`string`?d.exec(l)?.[1]:void 0,f=v(e.path,o),p={path:e.path,cssVar:`--${h([t??``,...e.path.split(`.`)].join(` `))}`};return o&&(p.type=o),f&&(p.category=f),c&&!/^[[{]/.test(c)&&!c.includes(`var(`)&&(p.value=c),r!==e&&(p.alias=!0),l&&(p.deprecated=l),u&&a.has(u)&&(p.replacement=u),p}).sort((e,t)=>e.path.localeCompare(t.path,void 0,{numeric:!0}))}function S(e){let t=Object.values(e??{}),n=e=>e.replace(/^@[^/]+\//,``),r=e=>[...new Set([e.title,e.name].map(e=>g(n(e))).filter(Boolean))];return t.map(e=>{let i=/* @__PURE__ */ new Set([_(n(e.name)),_(n(e.title))]),a=Object.keys(m).filter(e=>m[e].some(e=>i.has(e))),o=e.tags?.some(e=>e.toLowerCase()===`deprecated`),s=(e.related??[]).flatMap(e=>{let n=t.find(t=>t.name===e);return n?[r(n)[0]]:[]}),c={name:e.name,jsx:r(e),roles:a};return o&&(c.deprecated=!0,s.length>0&&(c.replacements=s)),c}).sort((e,t)=>e.name.localeCompare(t.name))}function C(e){return[...new Set(Object.values(e??{}).flatMap(e=>[e.name,...e.aliases??[]].map(e=>g(e).replace(/Icon$/,``)).filter(Boolean).map(e=>`${e}Icon`)))].sort()}function w(e){return Object.values(e??{}).map(e=>({family:e.family??e.title??e.name,...e.role?{role:e.role}:{}}))}function T(e){return!!e&&(0,n.resolveTokenSets)(e).length>0}function E(e,t={}){let r=e.name??`design-system`,i=t.prefix??`design-system`,a=t.cssVarPrefix===!1?void 0:t.cssVarPrefix??(0,n.cssVarPrefixFromName)(e.name),o=T(e.tokens)?x(e.tokens,a):[],s={name:r,version:`0.0.0`,prefix:i,...a?{cssVarPrefix:a}:{},themes:T(e.tokens)?(0,n.resolveTokenSets)(e.tokens).map(e=>e.id).filter(e=>e!=="default"):[],tokens:o,components:S(e.components),icons:C(e.icons),fonts:w(e.fonts)},c=t.tailwind===!1?void 0:D(e,i);c&&(s.tailwind=c);let l=t.tamagui?O(e,i,t):void 0;return l&&(s.tamagui=l),s}function D(e,t){let n=(0,a.buildGuardrailTheme)(T(e.tokens)?(0,o.flattenThemeTokens)(e.tokens):[],{fonts:e.fonts,name:e.name,prefix:t});return Object.keys(n.namespaces).length>0?n:void 0}function O(e,t,n){let r=typeof n.tamagui==`object`?n.tamagui:{},i=(0,c.buildGuardrailTheme)((0,s.collectTamaguiVocabulary)(e,T(e.tokens)?(0,s.flattenTokens)(e.tokens,{includeTypes:r.includeTypes}):[]),{name:e.name,prefix:t,shorthands:r.shorthands});return Object.keys(i.tokens).length>0?i:void 0}function k(e,t={}){let n=t.runtimeImport??`@razorwind/eslint/runtime`;return`// Generated by @razorwind/eslint. Do not edit by hand: re-run
|
|
2
2
|
// Razorwind generate when design tokens change.
|
|
3
3
|
//
|
|
4
4
|
// import designSystem from "./<path-to-this-file>";
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/manifest.ts","../src/index.ts"],"mappings":";;;;cAiDa;;;;;;iBA2EG,UAAU;;iBAWV,WAAW;;;;;iBAgBX,gBACd,cACA,gBACC;;;;;iBAoHa,sBACd,QAAQ,SAAS,eAAe,SAChC,wBACC;;iBAsEa,0BACd,YAAY,uBACX;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/manifest.ts","../src/index.ts"],"mappings":";;;;cAiDa;;;;;;iBA2EG,UAAU;;iBAWV,WAAW;;;;;iBAgBX,gBACd,cACA,gBACC;;;;;iBAoHa,sBACd,QAAQ,SAAS,eAAe,SAChC,wBACC;;iBAsEa,0BACd,YAAY,uBACX;;iBA+Ca,qBAAqB,OAAO;;;;;;iBA6B5B,cACd,MAAM,QACN,UAAS,sBACR;;;;;;;iBCvWa,mBACd,UAAU,sBACV,UAAS,KAAK;;;;;iBAgCA,sBAAsB;EACpC;EACA,UAAU;;;;;;iBA6EU,qBACpB,MAAM,QACN,UAAS,qBACT,eACC,QAAQ,wBAAwB,QAAQ"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./runtime-gmz9xNDY.mjs";import{definePlugin as t}from"@razorwind/core/plugin";import{createDocument as n,cssVarPrefixFromName as r,flattenTokens as i,formatTokenValue as a,isObject as o,isTokenLeaf as s,resolveTokenSets as c}from"@razorwind/core/utils";import{stat as l}from"node:fs/promises";import{dirname as u,join as d,resolve as f}from"node:path";import{buildGuardrailTheme as p}from"@razorwind/tailwindcss/eslint";import{flattenThemeTokens as m}from"@razorwind/tailwindcss/generate";import{collectTamaguiVocabulary as h,flattenTokens as g,resolveTokenCategory as _}from"@razorwind/tamagui";import{buildGuardrailTheme as v}from"@razorwind/tamagui/eslint";const y=`design-system`,b=[`light`,`default`,`base`],x=/^\{([^}]+)\}$/,S=/\{([^}]+)\}/,C={color:`color`,shadow:`shadow`,typography:`typography`,fontFamily:`fontFamily`,fontWeight:`fontWeight`,duration:`duration`,cubicBezier:`easing`},w={color:`color`,space:`space`,size:`size`,radius:`radius`,zIndex:`zIndex`,fontSize:`fontSize`,fontWeight:`fontWeight`,shadow:`shadow`,insetShadow:`shadow`,dropShadow:`shadow`,textShadow:`shadow`,boxShadow:`shadow`},T={button:[`button`],"icon-button":[`iconbutton`],link:[`link`,`anchor`,`textlink`],checkbox:[`checkbox`],code:[`code`,`inlinecode`,`codeblock`],heading:[`heading`],image:[`image`,`img`],radio:[`radio`,`radiogroup`],range:[`slider`,`range`],select:[`select`,`nativeselect`],"text-input":[`input`,`textinput`,`textfield`],textarea:[`textarea`],text:[`text`,`typography`],"visually-hidden":[`visuallyhidden`,`sronly`,`screenreaderonly`],icon:[`icon`],primitive:[`box`,`stack`,`hstack`,`vstack`,`xstack`,`ystack`,`inline`,`flex`,`grid`,`center`]};function E(e){return e.replaceAll(/([\p{Ll}\d])(\p{Lu})/gu,`$1 $2`).replaceAll(/(\p{Lu})(\p{Lu}\p{Ll})/gu,`$1 $2`).split(/[^\p{L}\d]+/u).filter(Boolean).join(`-`).toLowerCase()}function D(e){return e.split(/[^a-z0-9]+/i).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,``)}function k(e,t){let n=e.split(`.`).map(e=>e.toLowerCase()),r=(...e)=>e.some(e=>n.includes(e)),i=(e,t)=>n.some((r,i)=>r===e&&n[i+1]===t),a=t?C[t]:void 0;if(a)return a;if(r(`font-size`,`fontsize`)||i(`font`,`size`)||i(`text`,`size`))return`fontSize`;if(r(`font-weight`,`fontweight`)||i(`font`,`weight`))return`fontWeight`;if(r(`font-family`,`fontfamily`)||i(`font`,`family`))return`fontFamily`;if(r(`line-height`,`lineheight`,`leading`)||i(`line`,`height`))return`lineHeight`;if(r(`letter-spacing`,`letterspacing`,`tracking`)||i(`letter`,`spacing`))return`letterSpacing`;if(r(`border-width`,`borderwidth`,`stroke-width`,`strokewidth`,`outline-width`)||r(`border`,`stroke`,`outline`)&&r(`width`))return`borderWidth`;if(r(`duration`,`durations`,`delay`))return`duration`;if(r(`easing`,`ease`,`timing`,`cubic-bezier`))return`easing`;if(r(`opacity`,`opacities`))return`opacity`;let o=_(e,t);return o?w[o]:void 0}function A(e){let t=/* @__PURE__ */ new Map,n=(e,r,i)=>{if(!o(e))return;let a=e.$deprecated,c=a===!0||typeof a==`string`&&a.length>0?a:a===!1?void 0:i;if(s(e)){c&&!t.has(r.join(`.`))&&t.set(r.join(`.`),c);return}for(let[t,i]of Object.entries(e))t.startsWith(`$`)||n(i,[...r,t],c)};for(let t of c(e))n(t.tokens,[],void 0);return t}function j(e){if(e===void 0)return-1;let t=b.indexOf(e.toLowerCase());return t<0?b.length:t}function M(e,t){let n=i(e),r=A(e),o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map;for(let e of n){s.set(`${e.theme??``}:${e.path}`,e);let t=o.get(e.path);(!t||j(e.theme)<j(t.theme))&&o.set(e.path,e)}let c=(e,t=0)=>{let n=typeof e.value==`string`?x.exec(e.value)?.[1]:void 0;if(!n||t>10)return e;let r=s.get(`${e.theme??``}:${n}`)??o.get(n);return r?c(r,t+1):e};return[...o.values()].map(e=>{let n=c(e),i=e.type??n.type,s=a(n.value,i),l=r.get(e.path),u=typeof l==`string`?S.exec(l)?.[1]:void 0,d=k(e.path,i),f={path:e.path,cssVar:`--${E([t??``,...e.path.split(`.`)].join(` `))}`};return i&&(f.type=i),d&&(f.category=d),s&&!/^[[{]/.test(s)&&!s.includes(`var(`)&&(f.value=s),n!==e&&(f.alias=!0),l&&(f.deprecated=l),u&&o.has(u)&&(f.replacement=u),f}).sort((e,t)=>e.path.localeCompare(t.path,void 0,{numeric:!0}))}function N(e){let t=Object.values(e??{}),n=e=>[...new Set([e.title,e.name].map(D).filter(Boolean))];return t.map(e=>{let
|
|
1
|
+
import{t as e}from"./runtime-gmz9xNDY.mjs";import{definePlugin as t}from"@razorwind/core/plugin";import{createDocument as n,cssVarPrefixFromName as r,flattenTokens as i,formatTokenValue as a,isObject as o,isTokenLeaf as s,resolveTokenSets as c}from"@razorwind/core/utils";import{stat as l}from"node:fs/promises";import{dirname as u,join as d,resolve as f}from"node:path";import{buildGuardrailTheme as p}from"@razorwind/tailwindcss/eslint";import{flattenThemeTokens as m}from"@razorwind/tailwindcss/generate";import{collectTamaguiVocabulary as h,flattenTokens as g,resolveTokenCategory as _}from"@razorwind/tamagui";import{buildGuardrailTheme as v}from"@razorwind/tamagui/eslint";const y=`design-system`,b=[`light`,`default`,`base`],x=/^\{([^}]+)\}$/,S=/\{([^}]+)\}/,C={color:`color`,shadow:`shadow`,typography:`typography`,fontFamily:`fontFamily`,fontWeight:`fontWeight`,duration:`duration`,cubicBezier:`easing`},w={color:`color`,space:`space`,size:`size`,radius:`radius`,zIndex:`zIndex`,fontSize:`fontSize`,fontWeight:`fontWeight`,shadow:`shadow`,insetShadow:`shadow`,dropShadow:`shadow`,textShadow:`shadow`,boxShadow:`shadow`},T={button:[`button`],"icon-button":[`iconbutton`],link:[`link`,`anchor`,`textlink`],checkbox:[`checkbox`],code:[`code`,`inlinecode`,`codeblock`],heading:[`heading`],image:[`image`,`img`],radio:[`radio`,`radiogroup`],range:[`slider`,`range`],select:[`select`,`nativeselect`],"text-input":[`input`,`textinput`,`textfield`],textarea:[`textarea`],text:[`text`,`typography`],"visually-hidden":[`visuallyhidden`,`sronly`,`screenreaderonly`],icon:[`icon`],primitive:[`box`,`stack`,`hstack`,`vstack`,`xstack`,`ystack`,`inline`,`flex`,`grid`,`center`]};function E(e){return e.replaceAll(/([\p{Ll}\d])(\p{Lu})/gu,`$1 $2`).replaceAll(/(\p{Lu})(\p{Lu}\p{Ll})/gu,`$1 $2`).split(/[^\p{L}\d]+/u).filter(Boolean).join(`-`).toLowerCase()}function D(e){return e.split(/[^a-z0-9]+/i).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,``)}function k(e,t){let n=e.split(`.`).map(e=>e.toLowerCase()),r=(...e)=>e.some(e=>n.includes(e)),i=(e,t)=>n.some((r,i)=>r===e&&n[i+1]===t),a=t?C[t]:void 0;if(a)return a;if(r(`font-size`,`fontsize`)||i(`font`,`size`)||i(`text`,`size`))return`fontSize`;if(r(`font-weight`,`fontweight`)||i(`font`,`weight`))return`fontWeight`;if(r(`font-family`,`fontfamily`)||i(`font`,`family`))return`fontFamily`;if(r(`line-height`,`lineheight`,`leading`)||i(`line`,`height`))return`lineHeight`;if(r(`letter-spacing`,`letterspacing`,`tracking`)||i(`letter`,`spacing`))return`letterSpacing`;if(r(`border-width`,`borderwidth`,`stroke-width`,`strokewidth`,`outline-width`)||r(`border`,`stroke`,`outline`)&&r(`width`))return`borderWidth`;if(r(`duration`,`durations`,`delay`))return`duration`;if(r(`easing`,`ease`,`timing`,`cubic-bezier`))return`easing`;if(r(`opacity`,`opacities`))return`opacity`;let o=_(e,t);return o?w[o]:void 0}function A(e){let t=/* @__PURE__ */ new Map,n=(e,r,i)=>{if(!o(e))return;let a=e.$deprecated,c=a===!0||typeof a==`string`&&a.length>0?a:a===!1?void 0:i;if(s(e)){c&&!t.has(r.join(`.`))&&t.set(r.join(`.`),c);return}for(let[t,i]of Object.entries(e))t.startsWith(`$`)||n(i,[...r,t],c)};for(let t of c(e))n(t.tokens,[],void 0);return t}function j(e){if(e===void 0)return-1;let t=b.indexOf(e.toLowerCase());return t<0?b.length:t}function M(e,t){let n=i(e),r=A(e),o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map;for(let e of n){s.set(`${e.theme??``}:${e.path}`,e);let t=o.get(e.path);(!t||j(e.theme)<j(t.theme))&&o.set(e.path,e)}let c=(e,t=0)=>{let n=typeof e.value==`string`?x.exec(e.value)?.[1]:void 0;if(!n||t>10)return e;let r=s.get(`${e.theme??``}:${n}`)??o.get(n);return r?c(r,t+1):e};return[...o.values()].map(e=>{let n=c(e),i=e.type??n.type,s=a(n.value,i),l=r.get(e.path),u=typeof l==`string`?S.exec(l)?.[1]:void 0,d=k(e.path,i),f={path:e.path,cssVar:`--${E([t??``,...e.path.split(`.`)].join(` `))}`};return i&&(f.type=i),d&&(f.category=d),s&&!/^[[{]/.test(s)&&!s.includes(`var(`)&&(f.value=s),n!==e&&(f.alias=!0),l&&(f.deprecated=l),u&&o.has(u)&&(f.replacement=u),f}).sort((e,t)=>e.path.localeCompare(t.path,void 0,{numeric:!0}))}function N(e){let t=Object.values(e??{}),n=e=>e.replace(/^@[^/]+\//,``),r=e=>[...new Set([e.title,e.name].map(e=>D(n(e))).filter(Boolean))];return t.map(e=>{let i=/* @__PURE__ */ new Set([O(n(e.name)),O(n(e.title))]),a=Object.keys(T).filter(e=>T[e].some(e=>i.has(e))),o=e.tags?.some(e=>e.toLowerCase()===`deprecated`),s=(e.related??[]).flatMap(e=>{let n=t.find(t=>t.name===e);return n?[r(n)[0]]:[]}),c={name:e.name,jsx:r(e),roles:a};return o&&(c.deprecated=!0,s.length>0&&(c.replacements=s)),c}).sort((e,t)=>e.name.localeCompare(t.name))}function P(e){return[...new Set(Object.values(e??{}).flatMap(e=>[e.name,...e.aliases??[]].map(e=>D(e).replace(/Icon$/,``)).filter(Boolean).map(e=>`${e}Icon`)))].sort()}function F(e){return Object.values(e??{}).map(e=>({family:e.family??e.title??e.name,...e.role?{role:e.role}:{}}))}function I(e){return!!e&&c(e).length>0}function L(e,t={}){let n=e.name??`design-system`,i=t.prefix??`design-system`,a=t.cssVarPrefix===!1?void 0:t.cssVarPrefix??r(e.name),o=I(e.tokens)?M(e.tokens,a):[],s={name:n,version:`0.0.0`,prefix:i,...a?{cssVarPrefix:a}:{},themes:I(e.tokens)?c(e.tokens).map(e=>e.id).filter(e=>e!=="default"):[],tokens:o,components:N(e.components),icons:P(e.icons),fonts:F(e.fonts)},l=t.tailwind===!1?void 0:R(e,i);l&&(s.tailwind=l);let u=t.tamagui?z(e,i,t):void 0;return u&&(s.tamagui=u),s}function R(e,t){let n=p(I(e.tokens)?m(e.tokens):[],{fonts:e.fonts,name:e.name,prefix:t});return Object.keys(n.namespaces).length>0?n:void 0}function z(e,t,n){let r=typeof n.tamagui==`object`?n.tamagui:{},i=v(h(e,I(e.tokens)?g(e.tokens,{includeTypes:r.includeTypes}):[]),{name:e.name,prefix:t,shorthands:r.shorthands});return Object.keys(i.tokens).length>0?i:void 0}function B(e,t={}){let n=t.runtimeImport??`@razorwind/eslint/runtime`;return`// Generated by @razorwind/eslint. Do not edit by hand: re-run
|
|
2
2
|
// Razorwind generate when design tokens change.
|
|
3
3
|
//
|
|
4
4
|
// import designSystem from "./<path-to-this-file>";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["buildTailwindTheme","buildTamaguiTheme","flattenTamaguiTokens","createDesignSystemPlugin","flattenTokens$1","buildGuardrailTheme$1","DEFAULT_PREFIX","PRIMARY_THEME_IDS","DTCG_ALIAS","DTCG_REFERENCE","TYPE_CATEGORIES","TAMAGUI_CATEGORIES","ROLE_NAMES","kebabCase","value","pascalCase","part","compact","resolveCategory","segments","path","segment","has","names","name","pair","first","index","second","byType","type","category","resolveTokenCategory","collectDeprecations","deprecated","walk","isObject","node","own","current","inherited","isTokenLeaf","key","child","set","resolveTokenSets","tokens","themeRank","theme","collectManifestTokens","rows","flattenTokens","deprecations","primary","byTheme","row","resolve","alias","depth","target","resolved","formatTokenValue","replacement","token","cssVarPrefix","a","b","collectManifestComponents","all","components","jsxNames","component","words","roles","role","tag","replacements","related","item","entry","collectManifestIcons","icons","icon","collectManifestFonts","fonts","font","hasTokens","buildManifest","spec","prefix","options","cssVarPrefixFromName","manifest","id","tailwind","buildTailwind","tamagui","buildTamagui","buildGuardrailTheme","flattenThemeTokens","collectTamaguiVocabulary","renderEslintPlugin","runtimeImport","renderEslintInstallMd","rules","rule","defaultSeverity","eslintPath","generateEslintPlugin","stat","cwd","error","join","installPath","dirname","meta","createDocument","src_default","definePlugin","config"],"sources":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["buildTailwindTheme","buildTamaguiTheme","flattenTamaguiTokens","createDesignSystemPlugin","flattenTokens$1","buildGuardrailTheme$1","DEFAULT_PREFIX","PRIMARY_THEME_IDS","DTCG_ALIAS","DTCG_REFERENCE","TYPE_CATEGORIES","TAMAGUI_CATEGORIES","ROLE_NAMES","kebabCase","value","pascalCase","part","compact","resolveCategory","segments","path","segment","has","names","name","pair","first","index","second","byType","type","category","resolveTokenCategory","collectDeprecations","deprecated","walk","isObject","node","own","current","inherited","isTokenLeaf","key","child","set","resolveTokenSets","tokens","themeRank","theme","collectManifestTokens","rows","flattenTokens","deprecations","primary","byTheme","row","resolve","alias","depth","target","resolved","formatTokenValue","replacement","token","cssVarPrefix","a","b","collectManifestComponents","all","components","unscopedName","jsxNames","component","words","roles","role","tag","replacements","related","item","entry","collectManifestIcons","icons","icon","collectManifestFonts","fonts","font","hasTokens","buildManifest","spec","prefix","options","cssVarPrefixFromName","manifest","id","tailwind","buildTailwind","tamagui","buildTamagui","buildGuardrailTheme","flattenThemeTokens","collectTamaguiVocabulary","renderEslintPlugin","runtimeImport","renderEslintInstallMd","rules","rule","defaultSeverity","eslintPath","generateEslintPlugin","stat","cwd","error","join","installPath","dirname","meta","createDocument","src_default","definePlugin","config"],"sources":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/eslint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind ESLint plugin generator to create eslint rules that can be used as design system guidelines.",
|
|
6
6
|
"repository": {
|
|
@@ -79,19 +79,18 @@
|
|
|
79
79
|
"types": "./dist/index.d.cts",
|
|
80
80
|
"typings": "dist/index.d.mts",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@power-plant/core": "
|
|
83
|
-
"@power-plant/dtcg-schema": "
|
|
84
|
-
"@razorwind/core": "
|
|
85
|
-
"@razorwind/tailwindcss": "
|
|
86
|
-
"@razorwind/tamagui": "
|
|
82
|
+
"@power-plant/core": "catalog:",
|
|
83
|
+
"@power-plant/dtcg-schema": "catalog:",
|
|
84
|
+
"@razorwind/core": "workspace:*",
|
|
85
|
+
"@razorwind/tailwindcss": "workspace:*",
|
|
86
|
+
"@razorwind/tamagui": "workspace:*"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": { "eslint": ">=9.0.0" },
|
|
89
89
|
"peerDependenciesMeta": { "eslint": { "optional": true } },
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@powerlines/plugin-tsdown": "
|
|
92
|
-
"@types/node": "
|
|
91
|
+
"@powerlines/plugin-tsdown": "catalog:",
|
|
92
|
+
"@types/node": "catalog:",
|
|
93
93
|
"typescript": "^6.0.3"
|
|
94
94
|
},
|
|
95
|
-
"publishConfig": { "access": "public" }
|
|
96
|
-
"gitHead": "9d4e4b72eaf0b91c50891bad43ae6ec5d231952a"
|
|
95
|
+
"publishConfig": { "access": "public" }
|
|
97
96
|
}
|