@webority/tokens 0.129.0 → 0.130.1

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,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.129.0",
5
+ "version": "0.130.1",
6
6
  "brand": null,
7
7
  "platform": "phone",
8
8
  "width": null
@@ -2,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.129.0",
5
+ "version": "0.130.1",
6
6
  "brand": null,
7
7
  "platform": "web",
8
8
  "width": 390
@@ -2,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.129.0",
5
+ "version": "0.130.1",
6
6
  "brand": null,
7
7
  "platform": "web",
8
8
  "width": 1440
package/dist/cli.d.ts CHANGED
@@ -37,7 +37,8 @@ export interface BrandResult {
37
37
  * installed version up to <version> in order, then runs brand. With --app, the same run covers one app folder inside
38
38
  * the repo: the design map is read from the repo root, and the pins, install (pnpm or npm, by the folder's lockfile)
39
39
  * and tables are the app's. With --path (repeatable), applies the tables to those paths only, with no pin move,
40
- * install or brand run; webority-ui uses it on itself.
40
+ * install or brand run; webority-ui uses it on itself. --alias <pkg>=<library pkg> (repeatable) matches the wrapper
41
+ * package as its library. --report <path> is written by the command line only: it stores the result as JSON.
41
42
  */
42
43
  export interface UpgradeOptions {
43
44
  version: string;
@@ -45,6 +46,10 @@ export interface UpgradeOptions {
45
46
  /** An app folder inside the repo, relative to root. */
46
47
  app?: string;
47
48
  paths?: string[];
49
+ /** Wrapper package name to the library package its rules name: `{ "@acme/ui": "@webority/ui-react" }`. */
50
+ aliases?: Record<string, string>;
51
+ /** Path of a JSON file for the command line to write the UpgradeResult to; upgrade() ignores it. */
52
+ report?: string;
48
53
  /** Defaults to process.cwd(). */
49
54
  root?: string;
50
55
  }
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import{brand as e}from"./build.js";import{check as t}from"./check.js";import{upgrade as n}from"./upgrade/index.js";var r=`Usage: webority <command>
1
+ import{brand as e}from"./build.js";import{check as t}from"./check.js";import{upgrade as n}from"./upgrade/index.js";import{writeFileSync as r}from"node:fs";var i=`Usage: webority <command>
2
2
  brand [--brand <file>] [--library] [--out <dir>] [--web <scss>] [--phone <ts>] [--check]
3
- upgrade <version> [--dry-run] [--app <folder>] [--path <p>]...
4
- check`,i=[`brand`,`upgrade`,`check`],a=[`generated`,`design-map`,`repo-checks`],o={"--brand":`brand`,"--out":`out`,"--web":`web`,"--phone":`phone`},s=class extends Error{};function c(e){return console.error(e),console.error(r),2}function l(e){if(!(e instanceof Error))throw e;return console.error(e.message),1}function u(e,t,n){let r=[],i={},a=new Set;for(let o=0;o<e.length;o+=1){let c=e[o];if(t.includes(c)){let t=e[o+1];if(t===void 0||t.startsWith(`--`))throw new s(`${c} needs a value.`);i[c]=[...i[c]??[],t],o+=1}else if(n.includes(c))a.add(c);else if(c.startsWith(`--`))throw new s(`Unknown flag ${c}.`);else r.push(c)}return{positionals:r,values:i,flags:a}}function d(e,t){if(e===`brand`){let{positionals:e,values:n,flags:r}=u(t,Object.keys(o),[`--library`,`--check`]);if(e.length>0)throw new s(`brand takes no argument, got ${e[0]}.`);let i={};for(let[e,t]of Object.entries(o))n[e]!==void 0&&(i[t]=n[e].at(-1));return r.has(`--library`)&&(i.library=!0),r.has(`--check`)&&(i.check=!0),{kind:`brand`,options:i}}if(e===`upgrade`){let{positionals:e,values:n,flags:r}=u(t,[`--path`,`--app`],[`--dry-run`]);if(e.length===0)throw new s(`upgrade needs a <version>.`);if(e.length>1)throw new s(`Unexpected argument ${e[1]}.`);let i={version:e[0]};if(r.has(`--dry-run`)&&(i.dryRun=!0),n[`--app`]!==void 0){if(n[`--app`].length>1)throw new s(`--app takes one folder.`);if(n[`--path`]!==void 0)throw new s(`--app and --path cannot be combined.`);i.app=n[`--app`][0]}return n[`--path`]!==void 0&&(i.paths=n[`--path`]),{kind:`upgrade`,options:i}}if(t.length>0)throw new s(`check takes no arguments, got ${t[0]}.`);return{kind:`check`}}async function f(o,u={brand:e,upgrade:n,check:t}){if(o.includes(`--help`)||o.includes(`-h`))return console.log(r),0;if(o.length===0)return console.error(r),2;let[f,...p]=o;if(!i.includes(f))return c(`Unknown command ${f}. Commands: brand, upgrade, check.`);let m;try{m=d(f,p)}catch(e){if(e instanceof s)return c(e.message);throw e}if(m.kind===`brand`){let e;try{e=await u.brand(m.options)}catch(e){return l(e)}for(let t of e.written)console.log(`wrote ${t}`);if(!m.options.check)return 0;for(let t of e.stale)console.log(`stale ${t}`);return+(e.stale.length>0)}if(m.kind===`upgrade`){let e;try{e=await u.upgrade(m.options)}catch(e){return l(e)}for(let t of e.hits)console.log(`${t.file}:${t.line} ${t.from} -> ${t.to}`);for(let t of e.choose)console.log(`choose ${t.file}:${t.line} ${t.name}: ${t.hint}`);return+(e.choose.length>0)}let h;try{h=await u.check()}catch(e){return l(e)}for(let e of a)h.findings.some(t=>t.check===e)||console.log(`ok ${e}`);for(let e of h.findings){let t=e.file?`${e.file}: `:``;console.log(`FAIL ${e.check}: ${t}${e.message}`)}return+(h.findings.length>0)}export{e as brand,t as check,f as run,n as upgrade};
3
+ upgrade <version> [--dry-run] [--app <folder>] [--path <p>]... [--alias <pkg>=<library pkg>]... [--report <path>]
4
+ check`,a=[`brand`,`upgrade`,`check`],o=[`generated`,`design-map`,`repo-checks`],s={"--brand":`brand`,"--out":`out`,"--web":`web`,"--phone":`phone`},c=class extends Error{};function l(e){return console.error(e),console.error(i),2}function u(e){if(!(e instanceof Error))throw e;return console.error(e.message),1}function d(e,t,n){let r=[],i={},a=new Set;for(let o=0;o<e.length;o+=1){let s=e[o];if(t.includes(s)){let t=e[o+1];if(t===void 0||t.startsWith(`--`))throw new c(`${s} needs a value.`);i[s]=[...i[s]??[],t],o+=1}else if(n.includes(s))a.add(s);else if(s.startsWith(`--`))throw new c(`Unknown flag ${s}.`);else r.push(s)}return{positionals:r,values:i,flags:a}}function f(e,t){if(e===`brand`){let{positionals:e,values:n,flags:r}=d(t,Object.keys(s),[`--library`,`--check`]);if(e.length>0)throw new c(`brand takes no argument, got ${e[0]}.`);let i={};for(let[e,t]of Object.entries(s))n[e]!==void 0&&(i[t]=n[e].at(-1));return r.has(`--library`)&&(i.library=!0),r.has(`--check`)&&(i.check=!0),{kind:`brand`,options:i}}if(e===`upgrade`){let{positionals:e,values:n,flags:r}=d(t,[`--path`,`--app`,`--alias`,`--report`],[`--dry-run`]);if(e.length===0)throw new c(`upgrade needs a <version>.`);if(e.length>1)throw new c(`Unexpected argument ${e[1]}.`);let i={version:e[0]};if(r.has(`--dry-run`)&&(i.dryRun=!0),n[`--alias`]!==void 0){i.aliases={};for(let e of n[`--alias`]){let[t,n]=e.split(`=`);if(!t||!n||e.split(`=`).length!==2)throw new c(`--alias takes <pkg>=<library pkg>, got ${e}.`);i.aliases[t]=n}}if(n[`--report`]!==void 0){if(n[`--report`].length>1)throw new c(`--report takes one path.`);i.report=n[`--report`][0]}if(n[`--app`]!==void 0){if(n[`--app`].length>1)throw new c(`--app takes one folder.`);if(n[`--path`]!==void 0)throw new c(`--app and --path cannot be combined.`);i.app=n[`--app`][0]}return n[`--path`]!==void 0&&(i.paths=n[`--path`]),{kind:`upgrade`,options:i}}if(t.length>0)throw new c(`check takes no arguments, got ${t[0]}.`);return{kind:`check`}}async function p(s,d={brand:e,upgrade:n,check:t}){if(s.includes(`--help`)||s.includes(`-h`))return console.log(i),0;if(s.length===0)return console.error(i),2;let[p,...m]=s;if(!a.includes(p))return l(`Unknown command ${p}. Commands: brand, upgrade, check.`);let h;try{h=f(p,m)}catch(e){if(e instanceof c)return l(e.message);throw e}if(h.kind===`brand`){let e;try{e=await d.brand(h.options)}catch(e){return u(e)}for(let t of e.written)console.log(`wrote ${t}`);if(!h.options.check)return 0;for(let t of e.stale)console.log(`stale ${t}`);return+(e.stale.length>0)}if(h.kind===`upgrade`){let{report:e,...t}=h.options,n;try{n=await d.upgrade(t)}catch(e){return u(e)}for(let e of n.hits)console.log(`${e.file}:${e.line} ${e.from} -> ${e.to}`);for(let e of n.choose)console.log(`choose ${e.file}:${e.line} ${e.name}: ${e.hint}`);if(e!==void 0)try{r(e,`${JSON.stringify({hits:n.hits,choose:n.choose,changedFiles:n.changedFiles},null,4)}\n`,`utf8`)}catch(e){return u(e)}return+(n.choose.length>0)}let g;try{g=await d.check()}catch(e){return u(e)}for(let e of o)g.findings.some(t=>t.check===e)||console.log(`ok ${e}`);for(let e of g.findings){let t=e.file?`${e.file}: `:``;console.log(`FAIL ${e.check}: ${t}${e.message}`)}return+(g.findings.length>0)}export{e as brand,t as check,p as run,n as upgrade};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-meanings/1",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.129.0"
5
+ "version": "0.130.1"
6
6
  },
7
7
  "color": {
8
8
  "bg": {
@@ -1,5 +1,5 @@
1
- import{brand as e}from"../build.js";import{applyClasses as t}from"./classes.js";import{applyComponents as n}from"./components.js";import{applyCssTable as r,isCssTarget as i,ownDeclarations as a}from"./css.js";import{applyRazorAttributes as o}from"./razorAttributes.js";import{applyRazorTags as s}from"./razorTags.js";import{applyMarkup as c,applySource as l}from"./source.js";import{applyComponentProps as u,applyPropSplits as d,applyPropValues as f,applyProps as p,applyThemeReads as m}from"./themeReads.js";import{createRequire as h}from"node:module";import{existsSync as g,readFileSync as _,readdirSync as v,writeFileSync as y}from"node:fs";import{dirname as b,isAbsolute as x,join as S,relative as C,resolve as w,sep as T}from"node:path";import{fileURLToPath as E,pathToFileURL as D}from"node:url";import{spawnSync as O}from"node:child_process";var k=/^\d+\.\d+\.\d+$/,A=/^(?:workspace:|file:|link:)/,j=`WEBORITY_UPGRADE_FROM`;function M(e){if(typeof e!=`string`||!k.test(e))throw Error(`invalid version "${e}"`)}function N(e,t){M(e),M(t);let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]-r[e];return 0}function P(){let e=b(E(import.meta.url));for(;;){let t=S(e,`package.json`);if(g(t)&&JSON.parse(_(t,`utf8`)).name===`@webority/tokens`)return e;let n=b(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function F(e){let t=[];for(let n of v(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);k.test(r)&&t.push({version:r,table:JSON.parse(_(S(e,n),`utf8`))})}return t.sort((e,t)=>N(e.version,t.version))}function I(e,t){let n=O(`git`,[`ls-files`,`-z`,`--`,...t],{cwd:e,encoding:`utf8`,windowsHide:!0,maxBuffer:67108864});if(n.status!==0)throw Error(`not a git repository: ${e}`);let r=n.stdout.split(`\0`).filter(Boolean).map(e=>e.split(`\\`).join(`/`)).filter(t=>g(S(e,t)));return[...new Set(r)]}function L(e,t){let n=I(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function R(e){return e.split(`/`).includes(`node_modules`)}var z=new Set([`node_modules`,`vendor`,`vendors`,`external`]),B=/\.(?:min|bundle)\.(?:js|css)$/;function V(e){let t=e.split(`/`);return t.some(e=>z.has(e))||t.some((e,n)=>e===`lib`&&t[n-1]===`wwwroot`)?!0:B.test(e)}function H(e,t){return[...new Set([...e,...t])]}function U(e,t,n){return F(e).filter(e=>N(e.version,t)>0&&N(e.version,n)<=0).map(e=>e.table)}function W(e,h,g,v,b){v&&b(`dry run: nothing written`);let x=[],C=[],w=[],T=h.filter(e=>i(e)&&!V(e)),E=g.map(()=>new Set);if(g.some(e=>(e.css.ownable??[]).length>0))for(let t of T){let n=_(S(e,t),`utf8`);g.forEach((e,r)=>{for(let i of a(n,t,e))E[r].add(i)})}for(let i of T){let a=_(S(e,i),`utf8`),h=a,T=e=>{for(let t of e)x.push({file:i,line:t.line,from:t.from,to:t.to}),b(`${i}:${t.line} ${t.from} -> ${t.to}`)},D=e=>{C.push({file:i,line:e.line,name:e.name,hint:e.hint}),b(`choose ${i}:${e.line} ${e.name}: ${e.hint}`)},O=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?b(`skipped ${i}: ${t.message}`):D({line:t.line,name:t.path,hint:t.message})};for(let[e,a]of g.entries()){let g=r(h,i,a,E[e]);h=g.text,T(g.hits);for(let e of g.choose)D(e);for(let e of g.checkRole)b(`verify ${i}:${e.line} ${e.from} -> ${e.to}`);let _=m(h,i,a.themeReads);h=_.text,T(_.hits),O(_.findings);let v=[e=>p(e,i,a.props),e=>u(e,i,a.componentProps),e=>f(e,i,a.propValues),e=>d(e,i,a.propSplits),e=>o(e,i,a.razorAttributes),e=>n(e,i,a.components??[]),e=>s(e,i,a.razorTags??[]),e=>t(e,i,a.classes??[]),e=>c(e,i,a.markup),e=>l(e,i,a.source)];for(let e of v){let t=e(h);h=t.text,T(t.hits),O(t.findings)}}h!==a&&(w.push(i),v||y(S(e,i),h,`utf8`))}return{hits:x,choose:C,changedFiles:w}}function G(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function K(e,t,n,r,i){let a=[];for(let o of I(e,[`package.json`,`:(glob)**/package.json`])){if(R(o))continue;let s=_(S(e,o),`utf8`),c=JSON.parse(s),l=!1;for(let e of[`dependencies`,`devDependencies`]){let r=c[e];if(r)for(let e of n.npm){if(!Object.hasOwn(r,e))continue;let n=r[e];A.test(n)||n===t||(r[e]=t,l=!0,i(`pin ${o}: ${e} ${n} -> ${t}`))}}if(l&&(a.push(o),r)){let t=JSON.stringify(c,null,G(s));s.endsWith(`
1
+ import{brand as e}from"../build.js";import{applyClasses as t}from"./classes.js";import{applyComponents as n}from"./components.js";import{applyCssTable as r,isCssTarget as i,ownDeclarations as a}from"./css.js";import{applyRazorAttributes as o}from"./razorAttributes.js";import{applyRazorTags as s}from"./razorTags.js";import{applyRazorValueSplits as c}from"./razorValueSplits.js";import{applyMarkup as l,applySource as u}from"./source.js";import{applyComponentProps as d,applyPropSplits as f,applyPropValues as p,applyProps as m,applyThemeReads as h}from"./themeReads.js";import{applyValueSplits as g}from"./valueSplits.js";import{createRequire as _}from"node:module";import{existsSync as v,readFileSync as y,readdirSync as b,realpathSync as x,writeFileSync as S}from"node:fs";import{dirname as C,isAbsolute as w,join as T,relative as E,resolve as D,sep as O}from"node:path";import{fileURLToPath as k,pathToFileURL as A}from"node:url";import{spawnSync as j}from"node:child_process";var M=/^\d+\.\d+\.\d+$/,N=/^(?:workspace:|file:|link:)/,P=`WEBORITY_UPGRADE_FROM`;function F(e){if(typeof e!=`string`||!M.test(e))throw Error(`invalid version "${e}"`)}function I(e,t){F(e),F(t);let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]-r[e];return 0}function L(){let e=C(k(import.meta.url));for(;;){let t=T(e,`package.json`);if(v(t)&&JSON.parse(y(t,`utf8`)).name===`@webority/tokens`)return e;let n=C(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function R(e){let t=[];for(let n of b(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);M.test(r)&&t.push({version:r,table:JSON.parse(y(T(e,n),`utf8`))})}return t.sort((e,t)=>I(e.version,t.version))}function z(e,t){let n=j(`git`,[`ls-files`,`-z`,`--`,...t],{cwd:e,encoding:`utf8`,windowsHide:!0,maxBuffer:67108864});if(n.status!==0)throw Error(`not a git repository: ${e}`);let r=n.stdout.split(`\0`).filter(Boolean).map(e=>e.split(`\\`).join(`/`)).filter(t=>v(T(e,t)));return[...new Set(r)]}function B(e,t){let n=z(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function V(e){return e.split(`/`).includes(`node_modules`)}var H=new Set([`node_modules`,`vendor`,`vendors`,`external`]),U=/\.(?:min|bundle)\.(?:js|css)$/;function W(e){let t=e.split(`/`);return t.some(e=>H.has(e))||t.some((e,n)=>e===`lib`&&t[n-1]===`wwwroot`)?!0:U.test(e)}function G(e,t){return[...new Set([...e,...t])]}function K(e,t,n){return R(e).filter(e=>I(e.version,t)>0&&I(e.version,n)<=0).map(e=>e.table)}function q(e,t){let n=Object.entries(t);if(n.length===0)return e;let r=(e,t)=>e.flatMap(e=>[e,...n.filter(([,n])=>e[t]===n).map(([n])=>({...e,[t]:n}))]),i={...e};for(let t of[`props`,`componentProps`,`propValues`,`propSplits`,`valueSplits`,`components`])e[t]!==void 0&&(i[t]=r(e[t],`package`));return e.source!==void 0&&(i.source={...e.source,flags:r(e.source.flags,`importedFrom`)}),i}function J(e,_,v,b,x,C={}){b&&x(`dry run: nothing written`);let w=v.map(e=>q(e,C)),E=[],D=[],O=[],k=_.filter(e=>i(e)&&!W(e)),A=w.map(()=>new Set);if(w.some(e=>(e.css.ownable??[]).length>0))for(let t of k){let n=y(T(e,t),`utf8`);w.forEach((e,r)=>{for(let i of a(n,t,e))A[r].add(i)})}for(let i of k){let a=y(T(e,i),`utf8`),_=a,v=e=>{for(let t of e)E.push({file:i,line:t.line,from:t.from,to:t.to}),x(`${i}:${t.line} ${t.from} -> ${t.to}`)},C=e=>{D.push({file:i,line:e.line,name:e.name,hint:e.hint}),x(`choose ${i}:${e.line} ${e.name}: ${e.hint}`)},k=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?x(`skipped ${i}: ${t.message}`):C({line:t.line,name:t.path,hint:t.message})};for(let[e,a]of w.entries()){let y=r(_,i,a,A[e]);_=y.text,v(y.hits);for(let e of y.choose)C(e);for(let e of y.checkRole)x(`verify ${i}:${e.line} ${e.from} -> ${e.to}`);let b=h(_,i,a.themeReads);_=b.text,v(b.hits),k(b.findings);let S=[e=>m(e,i,a.props),e=>d(e,i,a.componentProps),e=>p(e,i,a.propValues),e=>g(e,i,a.valueSplits??[]),e=>f(e,i,a.propSplits),e=>o(e,i,a.razorAttributes),e=>n(e,i,a.components??[]),e=>s(e,i,a.razorTags??[]),e=>c(e,i,a.razorValueSplits??[]),e=>t(e,i,a.classes??[]),e=>l(e,i,a.markup),e=>u(e,i,a.source)];for(let e of S){let t=e(_);_=t.text,v(t.hits),k(t.findings)}}_!==a&&(O.push(i),b||S(T(e,i),_,`utf8`))}return{hits:E,choose:D,changedFiles:O}}function Y(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function X(e,t,n,r,i){let a=[];for(let o of z(e,[`package.json`,`:(glob)**/package.json`])){if(V(o))continue;let s=y(T(e,o),`utf8`),c=JSON.parse(s),l=!1;for(let e of[`dependencies`,`devDependencies`]){let r=c[e];if(r)for(let e of n.npm){if(!Object.hasOwn(r,e))continue;let n=r[e];N.test(n)||n===t||(r[e]=t,l=!0,i(`pin ${o}: ${e} ${n} -> ${t}`))}}if(l&&(a.push(o),r)){let t=JSON.stringify(c,null,Y(s));s.endsWith(`
2
2
  `)&&(t+=`
3
3
  `),s.includes(`\r
4
4
  `)&&(t=t.replace(/\n/g,`\r
5
- `)),y(S(e,o),t,`utf8`)}}return a}function q(e,t,n,r,i){let a=[];for(let o of I(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(R(o))continue;let s=_(S(e,o),`utf8`),c=!1,l=s.replace(/<PackageVersion\b[^>]*>/g,e=>{let r=/\sInclude="([^"]*)"/.exec(e)?.[1],a=/\sVersion="([^"]*)"/.exec(e)?.[1];return r===void 0||a===void 0||!n.nuget.includes(r)||a===t?e:(i(`pin ${o}: ${r} ${a} -> ${t}`),c=!0,e.replace(/(\sVersion=")[^"]*(")/,`$1${t}$2`))});c&&(a.push(o),r&&y(S(e,o),l,`utf8`))}return a}function J(e){let t;try{t=h(S(e,`package.json`)).resolve(`@webority/repo-checks/lockstep.json`)}catch{throw Error(`add @webority/repo-checks at the lockstep version and run again`)}return JSON.parse(_(t,`utf8`))}var Y=[{file:`pnpm-lock.yaml`,manager:`pnpm`,command:[`corepack`,`pnpm`,`install`]},{file:`package-lock.json`,manager:`npm`,command:[`npm`,`install`]}];function X(e){let t=Y.filter(t=>g(S(e,t.file)));if(t.length===0)throw Error(`no pnpm-lock.yaml or package-lock.json in ${e}`);if(t.length>1)throw Error(`${e} has both ${t[0].file} and ${t[1].file}; keep one lockfile`);return t[0]}function Z(e,t){let n=w(e,t),r=C(e,n);if(r===``||x(r)||r.split(T)[0]===`..`)throw Error(`--app ${t}: give a folder inside the repo root`);if(!g(S(n,`package.json`)))throw Error(`--app ${t}: no package.json in that folder`);return n}function Q(e,t,n){return O(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function $({appRoot:e,designRoot:t,app:n,version:r,from:i}){let a=h(S(e,`package.json`)).resolve(`@webority/tokens`);process.env[j]=i;try{return await(await import(D(a).href)).upgrade({root:t,app:n,version:r,dryRun:!1})}finally{delete process.env[j]}}async function ee({root:e,designRoot:t,version:n,dryRun:r,from:i,dir:a,log:o,brandFn:s}){let c=F(a);if(!r&&!c.some(e=>e.version===n))throw Error(`no rename table for ${n}`);let l=c.filter(e=>N(e.version,i)>0&&N(e.version,n)<=0).map(e=>e.table),u=W(e,L(e),l,r,o);return r||await s({root:t}),u}async function te({root:e,designRoot:t,app:n,version:r,dryRun:i,deps:a,log:o}){let s=S(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!g(s))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let c=JSON.parse(_(s,`utf8`)).version,l=J(e),u=i?null:X(e),d=[...K(e,r,l,!i,o),...q(e,r,l,!i,o)];if(i){o(`dry run: install skipped; tables are those of the installed ${c}`);let t=U(a.renamesDir??S(e,`node_modules`,`@webority`,`tokens`,`renames`),c,r),n=W(e,L(e),t,!0,o);return{...n,changedFiles:H(d,n.changedFiles)}}let f=a.run??Q,[p,...m]=u.command,{status:h}=await f(p,m,{cwd:e});if(h!==0)throw Error(`${u.manager} install failed with exit code ${h}`);let v=await(a.reenter??$)({appRoot:e,designRoot:t,app:n,version:r,dryRun:!1,from:c});return{...v,changedFiles:H(d,v.changedFiles)}}async function ne(t,n={}){let r=t.version;M(r);let i=t.root??process.cwd(),a=t.app===void 0?i:Z(i,t.app),o=t.dryRun??!1,s=n.log??console.log,c=()=>n.renamesDir??S(P(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=F(c()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return W(a,L(a,t.paths),e,o,s)}if(!g(S(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let l=process.env[j];return l?ee({root:a,designRoot:i,version:r,dryRun:o,from:l,dir:c(),log:s,brandFn:n.brand??e}):te({root:a,designRoot:i,app:t.app,version:r,dryRun:o,deps:n,log:s})}export{ne as upgrade};
5
+ `)),S(T(e,o),t,`utf8`)}}return a}function Z(e,t,n,r,i){let a=[];for(let o of z(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(V(o))continue;let s=y(T(e,o),`utf8`),c=!1,l=s.replace(/<PackageVersion\b[^>]*>/g,e=>{let r=/\sInclude="([^"]*)"/.exec(e)?.[1],a=/\sVersion="([^"]*)"/.exec(e)?.[1];if(r===void 0||a===void 0)return e;let s=/^\[([^\]]*)\]$/.exec(a),l=s?s[1]:a,u=s?`[${t}]`:t;return!n.nuget.includes(r)||l===t?e:(i(`pin ${o}: ${r} ${a} -> ${u}`),c=!0,e.replace(/(\sVersion=")[^"]*(")/,`$1${u}$2`))});c&&(a.push(o),r&&S(T(e,o),l,`utf8`))}return a}function Q(e){let t;try{t=_(T(e,`package.json`)).resolve(`@webority/repo-checks/lockstep.json`)}catch{throw Error(`add @webority/repo-checks at the lockstep version and run again`)}return JSON.parse(y(t,`utf8`))}var $=[{file:`pnpm-lock.yaml`,manager:`pnpm`,command:[`corepack`,`pnpm`,`install`]},{file:`package-lock.json`,manager:`npm`,command:[`npm`,`install`]}];function ee(e){let t=$.filter(t=>v(T(e,t.file)));if(t.length===0)throw Error(`no pnpm-lock.yaml or package-lock.json in ${e}`);if(t.length>1)throw Error(`${e} has both ${t[0].file} and ${t[1].file}; keep one lockfile`);return t[0]}function te(e,t){let n=D(e,t),r=E(e,n);if(r===``||w(r)||r.split(O)[0]===`..`)throw Error(`--app ${t}: give a folder inside the repo root`);if(!v(T(n,`package.json`)))throw Error(`--app ${t}: no package.json in that folder`);return n}function ne(e,t,n){return j(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function re({appRoot:e,designRoot:t,app:n,version:r,from:i,aliases:a}){let o=x.native(T(e,`node_modules`,`@webority`,`tokens`)),s=JSON.parse(y(T(o,`package.json`),`utf8`))?.exports?.[`.`],c=typeof s==`string`?s:s?.default;if(typeof c!=`string`)throw Error(`cannot find the installed @webority/tokens entry`);process.env[P]=i;try{return await(await import(A(T(o,c)).href)).upgrade({root:t,app:n,version:r,dryRun:!1,aliases:a})}finally{delete process.env[P]}}async function ie({root:e,designRoot:t,version:n,dryRun:r,from:i,dir:a,log:o,brandFn:s,aliases:c}){let l=R(a);if(!r&&!l.some(e=>e.version===n))throw Error(`no rename table for ${n}`);let u=l.filter(e=>I(e.version,i)>0&&I(e.version,n)<=0).map(e=>e.table),d=J(e,B(e),u,r,o,c);return r||await s({root:t}),d}async function ae({root:e,designRoot:t,app:n,version:r,dryRun:i,deps:a,log:o,aliases:s}){let c=T(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!v(c))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let l=JSON.parse(y(c,`utf8`)).version,u=Q(e),d=i?null:ee(e),f=[...X(e,r,u,!i,o),...Z(e,r,u,!i,o)];if(i){o(`dry run: install skipped; tables are those of the installed ${l}`);let t=K(a.renamesDir??T(e,`node_modules`,`@webority`,`tokens`,`renames`),l,r),n=J(e,B(e),t,!0,o,s);return{...n,changedFiles:G(f,n.changedFiles)}}let p=a.run??ne,[m,...h]=d.command,{status:g}=await p(m,h,{cwd:e});if(g!==0)throw Error(`${d.manager} install failed with exit code ${g}`);let _=await(a.reenter??re)({appRoot:e,designRoot:t,app:n,version:r,dryRun:!1,from:l,aliases:s});return{..._,changedFiles:G(f,_.changedFiles)}}async function oe(t,n={}){let r=t.version;F(r);let i=t.root??process.cwd(),a=t.app===void 0?i:te(i,t.app),o=t.dryRun??!1,s=t.aliases??{},c=n.log??console.log,l=()=>n.renamesDir??T(L(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=R(l()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return J(a,B(a,t.paths),e,o,c,s)}if(!v(T(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let u=process.env[P];return u?ie({root:a,designRoot:i,version:r,dryRun:o,from:u,dir:l(),log:c,brandFn:n.brand??e,aliases:s}):ae({root:a,designRoot:i,app:t.app,version:r,dryRun:o,deps:n,log:c,aliases:s})}export{oe as upgrade};
@@ -0,0 +1,2 @@
1
+ import{findQuoteEnd as e,tagOccurrences as t}from"./tagScan.js";import{applyEdits as n}from"./themeReads.js";var r=new Set([`.cshtml`,`.razor`]),i=/(\s*)([^\s=/>"']+)(\s*=\s*)?/y,a=e=>{let t=/\.[^./]*$/.exec(e);return t?t[0].toLowerCase():``},o=(e,t)=>e.slice(0,t).split(`
2
+ `).length;function s(t,n,r){let a=[],o=n;for(;;){i.lastIndex=o;let n=i.exec(t);if(n===null)break;let s=n.index+n[1].length,c={name:n[2],nameStart:s,nameEnd:s+n[2].length,wsStart:n.index,kind:`none`,attrEnd:s+n[2].length},l=n.index+n[0].length;if(n[3]!==void 0&&(t[l]===`"`||t[l]===`'`)){let n=e(t,l);if(n===-1)break;c.kind=`quoted`,c.value=t.slice(l+1,n),c.attrEnd=n+1}else n[3]!==void 0&&(c.kind=`bare`,c.attrEnd=l+/[^\s"'>]*/y.exec(t.slice(l))[0].length);if(c.attrEnd>r)break;a.push(c),o=c.attrEnd}return a}function c(e,i,c){if(c.length===0||!r.has(a(i)))return{text:e,hits:[],findings:[]};let l=[],u=[],d=[];for(let n of c)for(let r of n.tags)for(let{nameEnd:a,end:c}of t(e,r)){if(c===-1){d.push({file:i,line:o(e,a),path:`<${r}>`,message:`the tag could not be read (a quote in an attribute value does not pair up); set it by hand`});continue}let t=s(e,a,c),f=new Set(t.map(e=>e.name));for(let a of t){if(a.name!==n.attribute)continue;let t=o(e,a.nameStart),s=`<${r}> ${n.attribute}`,c=a.kind===`none`?`true`:a.kind===`quoted`?a.value.toLowerCase():void 0;if(c!==void 0&&!Object.hasOwn(n.values,c)&&n.keep?.includes(c))continue;if(c===void 0||!Object.hasOwn(n.values,c)){d.push({file:i,line:t,path:s,message:n.flag});continue}let p=Object.entries(n.values[c]).filter(([,e])=>e!==null),m=p.map(([e])=>e).filter(e=>e!==n.attribute&&f.has(e));if(m.length>0){d.push({file:i,line:t,path:s,message:`<${r}> already sets ${m.join(` and `)}; merge ${n.attribute} into it by hand`});continue}let h=p.map(([e,t])=>`${e}="${t}"`).join(` `),g=p.length===0?a.wsStart:a.nameStart;l.push({start:g,end:a.attrEnd,text:h}),u.push({line:t,from:e.slice(a.nameStart,a.attrEnd),to:h})}}return u.sort((e,t)=>e.line-t.line||(e.from<t.from?-1:+(e.from>t.from))),d.sort((e,t)=>e.line-t.line||(e.path<t.path?-1:+(e.path>t.path))),{text:n(e,l,i),hits:u,findings:d}}export{c as applyRazorValueSplits};
@@ -1,3 +1,3 @@
1
1
  import e from"node:path";var t=new Set([`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`]),n=new Set([`.cshtml`,`.razor`,`.html`]),r=`["'\`]`,i=`[A-Za-z_$][\\w$]*`,a=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),o=e=>[...e].sort((e,t)=>t.length-e.length).map(a).join(`|`),s=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
2
- `&&t.push(n+1);return t},c=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},l=(e,t)=>e<t?-1:+(e>t),u=(e,t,n)=>{if(t.length===0)return e;let i=new Map(t),a=RegExp(`(${r})(${o(i.keys())})\\1`,`g`),l=s(e);return e.replace(a,(e,t,r,a)=>{let o=i.get(r);return n.push({line:c(l,a),from:r,to:o}),`${t}${o}${t}`})},d=(e,t,n)=>{let r=e;for(let e of t){let t=e.receiver===void 0?void 0:RegExp(`^(?:${e.receiver})$`),o=RegExp(`(${i})(\\?\\.|\\.)${a(e.from)}(?![\\w$])`,`g`),l=s(r);r=r.replace(o,(r,i,a,o)=>t!==void 0&&!t.test(i)?r:(n.push({line:c(l,o),from:`${i}${a}${e.from}`,to:`${i}${a}${e.to}`}),`${i}${a}${e.to}`))}return r},f=(e,t)=>{let n=e.split(`
3
- `),r=[];for(let e of t){let t=new RegExp(e.pattern);for(let i=0;i<n.length;i++){let a=t.exec(n[i]);a!==null&&r.push({line:i+1,path:a[0],message:e.hint})}}return r};function p(n,r,i){if(i===void 0||!t.has(e.extname(r).toLowerCase()))return{text:n,hits:[],findings:[]};let a=[],o=d(u(n,i.literals,a),i.members,a),s=f(o,i.flags);return a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}function m(t,r,i){if(i===void 0||!n.has(e.extname(r).toLowerCase()))return{text:t,hits:[],findings:[]};let a=[],o=u(t,i.literals,a),s=f(o,i.flags);return a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}export{t as SOURCE_EXTENSIONS,m as applyMarkup,p as applySource};
2
+ `&&t.push(n+1);return t},c=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},l=(e,t)=>e<t?-1:+(e>t),u=(e,t,n)=>{if(t.length===0)return e;let i=new Map(t),a=RegExp(`(${r})(${o(i.keys())})\\1`,`g`),l=s(e);return e.replace(a,(e,t,r,a)=>{let o=i.get(r);return n.push({line:c(l,a),from:r,to:o}),`${t}${o}${t}`})},d=(e,t,n)=>{let r=e;for(let e of t){let t=e.receiver===void 0?void 0:RegExp(`^(?:${e.receiver})$`),o=RegExp(`(${i})(\\?\\.|\\.)${a(e.from)}(?![\\w$])`,`g`),l=s(r);r=r.replace(o,(r,i,a,o)=>t!==void 0&&!t.test(i)?r:(n.push({line:c(l,o),from:`${i}${a}${e.from}`,to:`${i}${a}${e.to}`}),`${i}${a}${e.to}`))}return r},f=(e,t)=>RegExp(`(?:\\bfrom\\s*|\\bimport\\s*\\(?\\s*|\\brequire\\(\\s*)["']${a(t)}["']`).test(e),p=(e,t)=>{let n=e.split(`
3
+ `),r=[],i=new Map;for(let a of t){if(a.importedFrom!==void 0&&(i.has(a.importedFrom)||i.set(a.importedFrom,f(e,a.importedFrom)),!i.get(a.importedFrom)))continue;let t=new RegExp(a.pattern);for(let e=0;e<n.length;e++){let i=t.exec(n[e]);i!==null&&r.push({line:e+1,path:i[0],message:a.hint})}}return r},m=e=>RegExp(`(?:\\b(?:import|export)\\s+(?:type\\s+)?(?:[\\w$]+\\s*,\\s*)?\\{([^}]*)\\}\\s*from\\s*|\\b(?:const|let|var)\\s*\\{([^}]*)\\}\\s*=\\s*require\\(\\s*)(["'])${a(e)}\\3`,`g`),h=(e,t)=>{let n=[],r=s(e);for(let i of t){let t=new Set(i.names);for(let a of e.matchAll(m(i.package))){let e=a[1]??a[2],o=a.index+a[0].indexOf(`{`)+1,s=0;for(let a of e.split(`,`)){let e=a.length-a.trimStart().length,l=a.trim().replace(/^type\s+/,``).split(/\s+as\s+|:/)[0].trim();t.has(l)&&n.push({line:c(r,o+s+e),path:l,message:i.hint}),s+=a.length+1}}}return n};function g(n,r,i){if(i===void 0||!t.has(e.extname(r).toLowerCase()))return{text:n,hits:[],findings:[]};let a=[],o=d(u(n,i.literals,a),i.members,a),s=p(o,i.flags);return s.push(...h(o,i.removedImports??[])),a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}function _(t,r,i){if(i===void 0||!n.has(e.extname(r).toLowerCase()))return{text:t,hits:[],findings:[]};let a=[],o=u(t,i.literals,a),s=p(o,i.flags);return a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}export{t as SOURCE_EXTENSIONS,_ as applyMarkup,g as applySource};
@@ -1,2 +1,2 @@
1
1
  import e from"node:path";import{parse as t}from"@babel/parser";var n=new Set([`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`ObjectMethod`,`ClassMethod`]),r=new Set([`MemberExpression`,`OptionalMemberExpression`]),i=new Set([`CallExpression`,`OptionalCallExpression`]),a=new Set([`useTheme`,`getTheme`]),o=new Set([`loc`,`start`,`end`,`extra`,`comments`,`leadingComments`,`trailingComments`,`innerComments`]),s=new Map([[`.js`,[`jsx`]],[`.jsx`,[`jsx`]],[`.mjs`,[`jsx`]],[`.cjs`,[`jsx`]],[`.ts`,[`typescript`]],[`.tsx`,[`typescript`,`jsx`]]]),c=/^[A-Za-z_$][\w$]*$/,l=new Set([`lightOverrides`,`darkOverrides`]),u=`move the brand into theme/brand.tokens.json, list the app under tokens.heads.phone, run webority brand, pass brand and settings`,d=e=>typeof e==`object`&&!!e&&typeof e.type==`string`,f=(e,t,n=[])=>{if(Array.isArray(e)){for(let r of e)f(r,t,n);return}if(!d(e))return;t(e,n);let r=[...n,e];for(let[n,i]of Object.entries(e))!o.has(n)&&typeof i==`object`&&i&&f(i,t,r)},p=(n,r)=>{let i=s.get(e.extname(r).toLowerCase());return i===void 0?null:t(n,{sourceType:`module`,plugins:i})},m=(e,t,n)=>({text:e,hits:[],findings:[{file:t,line:1,path:``,message:`skipped, it does not parse (${(n instanceof Error?n.message:String(n)).split(`
2
- `)[0]})`}]}),h=(e,t,n)=>{let r=[...t].sort((e,t)=>e.start-t.start||e.end-t.end),i=0;for(let e of r){if(e.start<i)throw Error(`two edits overlap in ${n}; fix it by hand`);i=e.end}let a=e;for(let e of r.reverse())a=a.slice(0,e.start)+e.text+a.slice(e.end);return a},g=e=>e.replace(/\.$/,``).split(`.`),_=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),v=(e,t)=>e<t?-1:+(e>t),y=(e,t)=>{let n=t.at(-1);return n!==void 0&&r.has(n.type)&&n.object===e},b=(e,t)=>d(e)&&i.has(e.type)&&e.callee.type===`Identifier`&&t.has(e.callee.name),x=e=>{for(let t=e.length-1;t>=0;t--)if(n.has(e[t].type))return e[t];return e.find(e=>e.type===`Program`)},S=(e,t)=>{let n=new Map;return f(e,(e,r)=>{if(e.type!==`VariableDeclarator`||e.id.type!==`Identifier`||!b(e.init,t))return;let i=x(r);n.has(i)||n.set(i,new Set),n.get(i)?.add(e.id.name)}),n},C=(e,t,r)=>t.some(t=>(n.has(t.type)||t.type===`Program`)&&r.get(t)?.has(e)===!0),w=(e,t,n,r)=>e.type===`Identifier`?e.name===`theme`&&r.size>0||C(e.name,t,n):b(e,r),T=e=>{if(e.computed!==!0&&e.property.type===`Identifier`)return e.property.name;if(e.computed===!0&&e.property.type===`StringLiteral`)return e.property.value};function E(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let i;try{i=p(e,t)}catch(n){return m(e,t,n)}if(i===null)return{text:e,hits:[],findings:[]};let o=new Set;f(i,e=>{if(e.type===`ImportDeclaration`&&e.source.value.startsWith(`@webority/`))for(let t of e.specifiers){if(t.type!==`ImportSpecifier`)continue;let e=t.imported.type===`StringLiteral`?t.imported.value:t.imported.name;a.has(e)&&o.add(t.local.name)}});let s=S(i,o),d=n.filter(e=>e.kind===`path`||e.kind===`prefix`||e.kind===`gone`).sort((e,t)=>g(t.from).length-g(e.from).length),b=n.filter(e=>e.kind===`kebab`),x=[],C=[],E=[],D=new Set,O=(e,n)=>{let r=`${e}:${n}`;D.has(r)||(D.add(r),E.push({file:t,line:e,path:n,message:u}))},k=(e,n)=>{let i=[],a=e;for(;r.has(a.type);)i.unshift(a),a=a.object;if(!w(a,n,s,o))return;let l=[];for(let e of i){let t=T(e);if(t===void 0)break;l.push(t)}let u=l.length;if(u===0)return;let f=[...l];for(let e of d){let n=g(e.from),r=e.kind===`prefix`&&e.from.endsWith(`.`);if(!(u<n.length||r&&u===n.length)&&n.every((e,t)=>l[t]===e)){if(e.kind===`gone`){E.push({file:t,line:i[n.length-1].property.loc.start.line,path:n.join(`.`),message:`no longer exists; ${e.hint}`});return}if(e.kind===`path`||e.kind===`prefix`){f=[...g(e.to),...l.slice(n.length)];break}}}for(let e of b){let t=e.under.split(`.`),n=t.length;if(f.length<=n||!t.every((e,t)=>f[t]===e))continue;let r=f[n];Object.hasOwn(e.names,r)&&(f[n]=e.names[r]);for(let e=n+1;e<f.length;e++)/[A-Z]/.test(f[e])&&(f[e]=f[e].replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase())}if(_(f,l))return;let p=f.map((e,t)=>{let n=i[t]?.optional===!0;return c.test(e)?`${n?`?.`:`.`}${e}`:`${n?`?.`:``}["${e}"]`}).join(``);x.push({start:a.end,end:i[u-1].end,text:p}),C.push({line:i[0].property.loc.start.line,from:l.join(`.`),to:f.join(`.`)})};return f(i,(e,t)=>{r.has(e.type)&&!y(e,t)&&k(e,t),e.type===`JSXAttribute`&&e.name.type===`JSXIdentifier`&&l.has(e.name.name)&&O(e.loc.start.line,e.name.name),e.type===`Identifier`&&e.name===`ThemeOverrides`&&O(e.loc.start.line,e.name)}),C.sort((e,t)=>e.line-t.line||v(e.from,t.from)),E.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,x,t),hits:C,findings:E}}var D=(e,t,n)=>{if(e.type===`JSXIdentifier`)return t.has(e.name);if(e.type===`JSXMemberExpression`){let t=e;for(;t.type===`JSXMemberExpression`;)t=t.object;return t.type===`JSXIdentifier`&&n.has(t.name)}return!1},O=e=>{if(e?.type===`StringLiteral`)return e;if(e?.type===`JSXExpressionContainer`&&e.expression.type===`StringLiteral`)return e.expression};function k(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[];for(let t of n){let n=new Set,o=new Set;f(r,e=>{if(e.type===`ImportDeclaration`&&e.source.value===t.package)for(let t of e.specifiers)t.type===`ImportNamespaceSpecifier`?o.add(t.local.name):n.add(t.local.name)});let s=new Set(t.props);f(r,r=>{if(r.type===`JSXOpeningElement`&&D(r.name,n,o))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||!s.has(n.name.name))continue;let r=O(n.value);if(r===void 0||r.value!==t.from)continue;let o=e[r.start];i.push({start:r.start,end:r.end,text:`${o}${t.to}${o}`}),a.push({line:r.loc.start.line,from:`${n.name.name}="${t.from}"`,to:`${n.name.name}="${t.to}"`})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),{text:h(e,i,t),hits:a,findings:[]}}function A(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[],o=[],s=new Set;for(let c of n){let n=N(r,c.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let l=P(r.name,n);if(c.components.includes(l))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==c.prop||s.has(n.start))continue;s.add(n.start);let u=n.loc.start.line,d=`${l}.${c.prop}`;if(c.flag){o.push({file:t,line:u,path:d,message:c.flag});continue}if(c.to&&c.to!==c.prop&&r.attributes.some(e=>j(e,c.to))){o.push({file:t,line:u,path:d,message:`${l} already sets ${c.to}; merge ${c.prop} into it by hand`});continue}let f=n.value===null?void 0:O(n.value)?.value??null,p=c.prop,m=f,h=i.length;c.to&&c.to!==c.prop&&(i.push({start:n.name.start,end:n.name.end,text:c.to}),p=c.to);let g=O(n.value);if(c.values&&g!==void 0&&Object.hasOwn(c.values,g.value)){let t=e[g.start];m=c.values[g.value],i.push({start:g.start,end:g.end,text:`${t}${m}${t}`})}i.length!==h&&a.push({line:u,from:M(c.prop,f),to:M(p,m)})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),o.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,i,t),hits:a,findings:o}}var j=(e,t)=>e.type===`JSXAttribute`&&e.name.type===`JSXIdentifier`&&e.name.name===t,M=(e,t)=>t===void 0?e:t===null?`${e}={...}`:`${e}="${t}"`,N=(e,t)=>{let n=new Map,r=new Set;return f(e,e=>{if(e.type===`ImportDeclaration`&&e.source.value===t)for(let t of e.specifiers)if(t.type===`ImportSpecifier`){let e=t.imported.type===`StringLiteral`?t.imported.value:t.imported.name;n.set(t.local.name,e)}else t.type===`ImportNamespaceSpecifier`&&r.add(t.local.name)}),{named:n,namespaces:r}},P=(e,t)=>{if(e.type===`JSXIdentifier`)return t.named.get(e.name);if(e.type===`JSXMemberExpression`&&e.object.type===`JSXIdentifier`&&t.namespaces.has(e.object.name))return e.property.name};function F(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[],o=[];for(let s of n){let n=N(r,s.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let c=P(r.name,n);if(s.components.includes(c))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==s.prop)continue;let r=n.value,l=n.loc.start.line,u=r?.type===`JSXExpressionContainer`?r.expression:void 0,d=r===null?!0:u?.type===`BooleanLiteral`?u.value:void 0,f;if(d!==void 0)f=`${s.prop}="${d?s.true:s.false}"`;else if(O(r)!==void 0)continue;else{o.push({file:t,line:l,path:`${c}.${s.prop}`,message:`${s.prop} takes a named value such as "${s.true}" or "${s.false}" now, not a boolean; set it by hand`});continue}i.push({start:n.start,end:n.end,text:f}),a.push({line:l,from:e.slice(n.start,n.end),to:f})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),o.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,i,t),hits:a,findings:o}}function I(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=t=>e.slice(t.start,t.end),a=new Set([`ObjectExpression`,`Identifier`,`MemberExpression`,`OptionalMemberExpression`]),o=new Set([`SequenceExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),s=e=>{if(e?.type===`LogicalExpression`&&e.operator===`&&`)return{test:e.left,consequent:e.right};let t=e?.alternate;if(e?.type===`ConditionalExpression`&&(t.type===`NullLiteral`||t.type===`Identifier`&&t.name===`undefined`||t.type===`BooleanLiteral`&&t.value===!1))return{test:e.test,consequent:e.consequent}},c=e=>o.has(e.test.type)?`(${i(e.test)})`:i(e.test),l=[],u=[],d=[];for(let e of n){let n=N(r,e.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let o=P(r.name,n);if(!e.components.includes(o))return;let f=r.attributes.some(t=>t.type===`JSXAttribute`&&t.name.type===`JSXIdentifier`&&t.name.name===e.into);for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==e.prop)continue;let r=n.value,p=n.loc.start.line;if(O(r)!==void 0)continue;let m=`${o}.${e.prop}`;if(f){d.push({file:t,line:p,path:m,message:`already sets ${e.into}; set ${e.prop} to "${e.on}" or "${e.off}" by hand`});continue}let h=r?.type===`JSXExpressionContainer`?r.expression:void 0,g=r===null?!0:h?.type===`BooleanLiteral`?h.value:void 0,_=s(h),v;if(g!==void 0)v=`${e.prop}="${g?e.on:e.off}"`;else if(a.has(h?.type))v=`${e.prop}="${e.on}" ${e.into}={${i(h)}}`;else if(_!==void 0&&_.consequent.type===`BooleanLiteral`&&_.consequent.value===!0)v=`${e.prop}={${c(_)} ? "${e.on}" : "${e.off}"}`;else if(_!==void 0&&a.has(_.consequent.type))v=`${e.prop}={${c(_)} ? "${e.on}" : "${e.off}"} ${e.into}={${i(_.consequent)}}`;else{d.push({file:t,line:p,path:m,message:`${e.prop} takes "${e.on}" or "${e.off}" now, and its settings object moves to ${e.into}; set both by hand`});continue}l.push({start:n.start,end:n.end,text:v}),u.push({line:p,from:i(n),to:v})}})}return u.sort((e,t)=>e.line-t.line||v(e.from,t.from)),d.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,l,t),hits:u,findings:d}}export{A as applyComponentProps,I as applyPropSplits,F as applyPropValues,k as applyProps,E as applyThemeReads};
2
+ `)[0]})`}]}),h=(e,t,n)=>{let r=[...t].sort((e,t)=>e.start-t.start||e.end-t.end),i=0;for(let e of r){if(e.start<i)throw Error(`two edits overlap in ${n}; fix it by hand`);i=e.end}let a=e;for(let e of r.reverse())a=a.slice(0,e.start)+e.text+a.slice(e.end);return a},g=e=>e.replace(/\.$/,``).split(`.`),_=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),v=(e,t)=>e<t?-1:+(e>t),y=(e,t)=>{let n=t.at(-1);return n!==void 0&&r.has(n.type)&&n.object===e},b=(e,t)=>d(e)&&i.has(e.type)&&e.callee.type===`Identifier`&&t.has(e.callee.name),x=e=>{for(let t=e.length-1;t>=0;t--)if(n.has(e[t].type))return e[t];return e.find(e=>e.type===`Program`)},S=(e,t)=>{let n=new Map;return f(e,(e,r)=>{if(e.type!==`VariableDeclarator`||e.id.type!==`Identifier`||!b(e.init,t))return;let i=x(r);n.has(i)||n.set(i,new Set),n.get(i)?.add(e.id.name)}),n},C=(e,t,r)=>t.some(t=>(n.has(t.type)||t.type===`Program`)&&r.get(t)?.has(e)===!0),w=(e,t,n,r)=>e.type===`Identifier`?e.name===`theme`&&r.size>0||C(e.name,t,n):b(e,r),T=e=>{if(e.computed!==!0&&e.property.type===`Identifier`)return e.property.name;if(e.computed===!0&&e.property.type===`StringLiteral`)return e.property.value};function E(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let i;try{i=p(e,t)}catch(n){return m(e,t,n)}if(i===null)return{text:e,hits:[],findings:[]};let o=new Set;f(i,e=>{if(e.type===`ImportDeclaration`&&e.source.value.startsWith(`@webority/`))for(let t of e.specifiers){if(t.type!==`ImportSpecifier`)continue;let e=t.imported.type===`StringLiteral`?t.imported.value:t.imported.name;a.has(e)&&o.add(t.local.name)}});let s=S(i,o),d=n.filter(e=>e.kind===`path`||e.kind===`prefix`||e.kind===`gone`).sort((e,t)=>g(t.from).length-g(e.from).length),b=n.filter(e=>e.kind===`kebab`),x=[],C=[],E=[],D=new Set,O=(e,n)=>{let r=`${e}:${n}`;D.has(r)||(D.add(r),E.push({file:t,line:e,path:n,message:u}))},k=(e,n)=>{let i=[],a=e;for(;r.has(a.type);)i.unshift(a),a=a.object;if(!w(a,n,s,o))return;let l=[];for(let e of i){let t=T(e);if(t===void 0)break;l.push(t)}let u=l.length;if(u===0)return;let f=[...l];for(let e of d){let n=g(e.from),r=e.kind===`prefix`&&e.from.endsWith(`.`);if(!(u<n.length||r&&u===n.length)&&n.every((e,t)=>l[t]===e)){if(e.kind===`gone`){E.push({file:t,line:i[n.length-1].property.loc.start.line,path:n.join(`.`),message:`no longer exists; ${e.hint}`});return}if(e.kind===`path`||e.kind===`prefix`){f=[...g(e.to),...l.slice(n.length)];break}}}for(let e of b){let t=e.under.split(`.`),n=t.length;if(f.length<=n||!t.every((e,t)=>f[t]===e))continue;let r=f[n];Object.hasOwn(e.names,r)&&(f[n]=e.names[r]);for(let e=n+1;e<f.length;e++)/[A-Z]/.test(f[e])&&(f[e]=f[e].replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase())}if(_(f,l))return;let p=f.map((e,t)=>{let n=i[t]?.optional===!0;return c.test(e)?`${n?`?.`:`.`}${e}`:`${n?`?.`:``}["${e}"]`}).join(``);x.push({start:a.end,end:i[u-1].end,text:p}),C.push({line:i[0].property.loc.start.line,from:l.join(`.`),to:f.join(`.`)})};return f(i,(e,t)=>{r.has(e.type)&&!y(e,t)&&k(e,t),e.type===`JSXAttribute`&&e.name.type===`JSXIdentifier`&&l.has(e.name.name)&&O(e.loc.start.line,e.name.name),e.type===`Identifier`&&e.name===`ThemeOverrides`&&O(e.loc.start.line,e.name)}),C.sort((e,t)=>e.line-t.line||v(e.from,t.from)),E.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,x,t),hits:C,findings:E}}var D=(e,t,n)=>{if(e.type===`JSXIdentifier`)return t.has(e.name);if(e.type===`JSXMemberExpression`){let t=e;for(;t.type===`JSXMemberExpression`;)t=t.object;return t.type===`JSXIdentifier`&&n.has(t.name)}return!1},O=e=>{if(e?.type===`StringLiteral`)return e;if(e?.type===`JSXExpressionContainer`&&e.expression.type===`StringLiteral`)return e.expression};function k(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[];for(let t of n){let n=new Set,o=new Set;f(r,e=>{if(e.type===`ImportDeclaration`&&e.source.value===t.package)for(let t of e.specifiers)t.type===`ImportNamespaceSpecifier`?o.add(t.local.name):n.add(t.local.name)});let s=new Set(t.props);f(r,r=>{if(r.type===`JSXOpeningElement`&&D(r.name,n,o))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||!s.has(n.name.name))continue;let r=O(n.value);if(r===void 0||r.value!==t.from)continue;let o=e[r.start];i.push({start:r.start,end:r.end,text:`${o}${t.to}${o}`}),a.push({line:r.loc.start.line,from:`${n.name.name}="${t.from}"`,to:`${n.name.name}="${t.to}"`})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),{text:h(e,i,t),hits:a,findings:[]}}function A(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[],o=[],s=new Set;for(let c of n){let n=N(r,c.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let l=P(r.name,n);if(c.components.includes(l))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==c.prop||s.has(n.start))continue;s.add(n.start);let u=n.loc.start.line,d=`${l}.${c.prop}`;if(c.flag&&c.to===void 0&&c.values===void 0){o.push({file:t,line:u,path:d,message:c.flag});continue}if(c.to&&c.to!==c.prop&&r.attributes.some(e=>j(e,c.to))){o.push({file:t,line:u,path:d,message:`${l} already sets ${c.to}; merge ${c.prop} into it by hand`});continue}let f=n.value===null?void 0:O(n.value)?.value??null,p=c.prop,m=f,h=i.length;c.to&&c.to!==c.prop&&(i.push({start:n.name.start,end:n.name.end,text:c.to}),p=c.to);let g=O(n.value);if(c.values&&g!==void 0&&Object.hasOwn(c.values,g.value)){let t=e[g.start];m=c.values[g.value],i.push({start:g.start,end:g.end,text:`${t}${m}${t}`})}c.flag&&g===void 0&&o.push({file:t,line:u,path:d,message:c.flag}),i.length!==h&&a.push({line:u,from:M(c.prop,f),to:M(p,m)})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),o.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,i,t),hits:a,findings:o}}var j=(e,t)=>e.type===`JSXAttribute`&&e.name.type===`JSXIdentifier`&&e.name.name===t,M=(e,t)=>t===void 0?e:t===null?`${e}={...}`:`${e}="${t}"`,N=(e,t)=>{let n=new Map,r=new Set;return f(e,e=>{if(e.type===`ImportDeclaration`&&e.source.value===t)for(let t of e.specifiers)if(t.type===`ImportSpecifier`){let e=t.imported.type===`StringLiteral`?t.imported.value:t.imported.name;n.set(t.local.name,e)}else t.type===`ImportNamespaceSpecifier`&&r.add(t.local.name)}),{named:n,namespaces:r}},P=(e,t)=>{if(e.type===`JSXIdentifier`)return t.named.get(e.name);if(e.type===`JSXMemberExpression`&&e.object.type===`JSXIdentifier`&&t.namespaces.has(e.object.name))return e.property.name};function F(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=[],a=[],o=[];for(let s of n){let n=N(r,s.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let c=P(r.name,n);if(s.components.includes(c))for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==s.prop)continue;let r=n.value,l=n.loc.start.line,u=r?.type===`JSXExpressionContainer`?r.expression:void 0,d=r===null?!0:u?.type===`BooleanLiteral`?u.value:void 0,f;if(d!==void 0)f=`${s.prop}="${d?s.true:s.false}"`;else if(O(r)!==void 0)continue;else{o.push({file:t,line:l,path:`${c}.${s.prop}`,message:`${s.prop} takes a named value such as "${s.true}" or "${s.false}" now, not a boolean; set it by hand`});continue}i.push({start:n.start,end:n.end,text:f}),a.push({line:l,from:e.slice(n.start,n.end),to:f})}})}return a.sort((e,t)=>e.line-t.line||v(e.from,t.from)),o.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,i,t),hits:a,findings:o}}function I(e,t,n){if(n.length===0)return{text:e,hits:[],findings:[]};let r;try{r=p(e,t)}catch(n){return m(e,t,n)}if(r===null)return{text:e,hits:[],findings:[]};let i=t=>e.slice(t.start,t.end),a=new Set([`ObjectExpression`,`Identifier`,`MemberExpression`,`OptionalMemberExpression`]),o=new Set([`SequenceExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),s=e=>{if(e?.type===`LogicalExpression`&&e.operator===`&&`)return{test:e.left,consequent:e.right};let t=e?.alternate;if(e?.type===`ConditionalExpression`&&(t.type===`NullLiteral`||t.type===`Identifier`&&t.name===`undefined`||t.type===`BooleanLiteral`&&t.value===!1))return{test:e.test,consequent:e.consequent}},c=e=>o.has(e.test.type)?`(${i(e.test)})`:i(e.test),l=[],u=[],d=[];for(let e of n){let n=N(r,e.package);f(r,r=>{if(r.type!==`JSXOpeningElement`)return;let o=P(r.name,n);if(!e.components.includes(o))return;let f=r.attributes.some(t=>t.type===`JSXAttribute`&&t.name.type===`JSXIdentifier`&&t.name.name===e.into);for(let n of r.attributes){if(n.type!==`JSXAttribute`||n.name.type!==`JSXIdentifier`||n.name.name!==e.prop)continue;let r=n.value,p=n.loc.start.line;if(O(r)!==void 0)continue;let m=`${o}.${e.prop}`;if(f){d.push({file:t,line:p,path:m,message:`already sets ${e.into}; set ${e.prop} to "${e.on}" or "${e.off}" by hand`});continue}let h=r?.type===`JSXExpressionContainer`?r.expression:void 0,g=r===null?!0:h?.type===`BooleanLiteral`?h.value:void 0,_=s(h),v;if(g!==void 0)v=`${e.prop}="${g?e.on:e.off}"`;else if(a.has(h?.type))v=`${e.prop}="${e.on}" ${e.into}={${i(h)}}`;else if(_!==void 0&&_.consequent.type===`BooleanLiteral`&&_.consequent.value===!0)v=`${e.prop}={${c(_)} ? "${e.on}" : "${e.off}"}`;else if(_!==void 0&&a.has(_.consequent.type))v=`${e.prop}={${c(_)} ? "${e.on}" : "${e.off}"} ${e.into}={${i(_.consequent)}}`;else{d.push({file:t,line:p,path:m,message:`${e.prop} takes "${e.on}" or "${e.off}" now, and its settings object moves to ${e.into}; set both by hand`});continue}l.push({start:n.start,end:n.end,text:v}),u.push({line:p,from:i(n),to:v})}})}return u.sort((e,t)=>e.line-t.line||v(e.from,t.from)),d.sort((e,t)=>e.line-t.line||v(e.path,t.path)),{text:h(e,l,t),hits:u,findings:d}}export{A as applyComponentProps,h as applyEdits,I as applyPropSplits,F as applyPropValues,k as applyProps,E as applyThemeReads,P as componentOf,N as importedComponents,p as parseSource,m as skipped,O as stringNode,f as visit};
@@ -0,0 +1,3 @@
1
+ import{applyEdits as e,componentOf as t,importedComponents as n,parseSource as r,skipped as i,stringNode as a,visit as o}from"./themeReads.js";var s=e=>e===null?`true`:e.type===`JSXExpressionContainer`&&e.expression.type===`BooleanLiteral`?String(e.expression.value):a(e)?.value,c=(e,t)=>typeof t==`string`?`${e}="${t}"`:`${e}={${t}}`,l=(e,t)=>{let n=e.lastIndexOf(`
2
+ `,t.start-1)+1,r=e.indexOf(`
3
+ `,t.end),i=r===-1?e.length:r;if(e.slice(n,t.start).trim()===``&&e.slice(t.end,i).trim()===``)return{start:n,end:i===e.length?i:i+1};let a=t.start;for(;a>0&&(e[a-1]===` `||e[a-1]===` `);)a--;return{start:a,end:t.end}};function u(a,u,d){if(d.length===0)return{text:a,hits:[],findings:[]};let f;try{f=r(a,u)}catch(e){return i(a,u,e)}if(f===null)return{text:a,hits:[],findings:[]};let p=[],m=[],h=[];for(let e of d){let r=n(f,e.package);o(f,n=>{if(n.type!==`JSXOpeningElement`)return;let i=t(n.name,r);if(!e.components.includes(i))return;let o=new Set(n.attributes.filter(e=>e.type===`JSXAttribute`&&e.name.type===`JSXIdentifier`).map(e=>e.name.name));for(let t of n.attributes){if(t.type!==`JSXAttribute`||t.name.type!==`JSXIdentifier`||t.name.name!==e.prop)continue;let n=t.loc.start.line,r=`${i}.${e.prop}`,d=s(t.value);if(d!==void 0&&!Object.hasOwn(e.values,d)&&e.keep?.includes(d))continue;if(d===void 0||!Object.hasOwn(e.values,d)){h.push({file:u,line:n,path:r,message:e.flag});continue}let f=Object.entries(e.values[d]).filter(([,e])=>e!==null),g=f.map(([e])=>e).filter(t=>t!==e.prop&&o.has(t));if(g.length>0){h.push({file:u,line:n,path:r,message:`${i} already sets ${g.join(` and `)}; merge ${e.prop} into it by hand`});continue}let _=f.map(([e,t])=>c(e,t)).join(` `),v=f.length===0?l(a,t):{start:t.start,end:t.end};p.push({start:v.start,end:v.end,text:_}),m.push({line:n,from:a.slice(t.start,t.end),to:_})}})}return m.sort((e,t)=>e.line-t.line||(e.from<t.from?-1:+(e.from>t.from))),h.sort((e,t)=>e.line-t.line||(e.path<t.path?-1:+(e.path>t.path))),{text:e(a,p,u),hits:m,findings:h}}export{u as applyValueSplits};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/tokens",
3
- "version": "0.129.0",
3
+ "version": "0.130.1",
4
4
  "description": "The Webority design tokens in one W3C Design Tokens source (palette, scale, meaning and component tiers, with light and dark, web and phone, and 390 and 1440 widths), and the webority command that brands a product, upgrades it between releases and checks it against the token source.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.108.0",
2
+ "version": "0.107.0",
3
3
  "css": {
4
4
  "rename": [],
5
5
  "reads": [],