@webority/tokens 0.120.1 → 0.121.0

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.120.1",
5
+ "version": "0.121.0",
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.120.1",
5
+ "version": "0.121.0",
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.120.1",
5
+ "version": "0.121.0",
6
6
  "brand": null,
7
7
  "platform": "web",
8
8
  "width": 1440
@@ -2,7 +2,7 @@
2
2
  "format": "webority-meanings/1",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.120.1"
5
+ "version": "0.121.0"
6
6
  },
7
7
  "color": {
8
8
  "bg": {
@@ -1,2 +1,2 @@
1
- var e=new Set([`.css`,`.scss`,`.sass`,`.less`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`,`.cshtml`,`.razor`,`.html`,`.vue`,`.json`]),t=new Set([`node_modules`,`dist`,`bin`,`obj`,`.git`,`.next`,`coverage`]);function n(e,t,n){for(let r=0;r+1<e.length;r++)if(e[r]===t&&e[r+1]===n)return!0;return!1}function r(r){let i=r.replace(/\\/g,`/`).split(`/`);if(i.some(e=>t.has(e))||n(i,`wwwroot`,`lib`))return!1;let a=i[i.length-1].match(/\.[^.]+$/),o=a?a[0].toLowerCase():``;return o===`.css`&&n(i,`wwwroot`,`css`)?!1:e.has(o)}function i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function a(e){return[...e].sort((e,t)=>t.length-e.length).map(i).join(`|`)}function o(e,t,n){if(!r(t))return{text:e,hits:[],choose:[],checkRole:[]};let{rename:i,reads:o,choose:s,checkRole:c}=n.css,l=new Map;for(let[e,t]of o)l.set(e,t);for(let[e,t]of i)l.set(e,t);let u=new Set(o.map(([e])=>e)),d=new Set([...i.map(([e])=>e),...Object.keys(s)]),f=[];if(u.size>0&&f.push(`(?<=var\\(\\s*)(${a(u)})(?![\\w-])`),d.size>0&&f.push(`(?<![\\w-])(${a(d)})(?![\\w-])`),f.length===0)return{text:e,hits:[],choose:[],checkRole:[]};let p=new RegExp(f.join(`|`),`g`),m=new Set(c),h=[],g=[],_=[],v=1,y=0;return{text:e.replace(p,(t,...n)=>{let r=n[n.length-2];for(;y<r;y++)e[y]===`
2
- `&&v++;if(Object.hasOwn(s,t))return g.push({line:v,name:t,hint:s[t]}),t;let i=l.get(t);return h.push({line:v,from:t,to:i}),m.has(i)&&_.push({line:v,from:t,to:i}),i}),hits:h,choose:g,checkRole:_}}export{e as CSS_TARGET_EXTENSIONS,o as applyCssTable,r as isCssTarget};
1
+ var e=new Set([`.css`,`.scss`,`.sass`,`.less`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`,`.cshtml`,`.razor`,`.html`,`.vue`,`.json`]),t=new Set([`node_modules`,`dist`,`bin`,`obj`,`.git`,`.next`,`coverage`]);function n(e,t,n){for(let r=0;r+1<e.length;r++)if(e[r]===t&&e[r+1]===n)return!0;return!1}function r(r){let i=r.replace(/\\/g,`/`).split(`/`);if(i.some(e=>t.has(e))||n(i,`wwwroot`,`lib`))return!1;let a=i[i.length-1].match(/\.[^.]+$/),o=a?a[0].toLowerCase():``;return o===`.css`&&n(i,`wwwroot`,`css`)?!1:e.has(o)}var i=/^\s*:/;function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){return[...e].sort((e,t)=>t.length-e.length).map(a).join(`|`)}function s(e,t,n){let i=n.css.ownable??[];if(i.length===0||!r(t))return new Set;let a=RegExp(`(?<![\\w-])(${o(i)})\\s*:`,`g`);return new Set(Array.from(e.matchAll(a),e=>e[1]))}function c(e,t,n,a=new Set){if(!r(t))return{text:e,hits:[],choose:[],checkRole:[]};let{rename:s,reads:c,choose:l,checkRole:u}=n.css,d=new Map;for(let[e,t]of c)d.set(e,t);for(let[e,t]of s)d.set(e,t);let f=new Set(c.map(([e])=>e)),p=new Set([...s.map(([e])=>e),...Object.keys(l)]),m=[];if(f.size>0&&m.push(`(?<=var\\(\\s*)(${o(f)})(?![\\w-])`),p.size>0&&m.push(`(?<![\\w-])(${o(p)})(?![\\w-])`),m.length===0)return{text:e,hits:[],choose:[],checkRole:[]};let h=new RegExp(m.join(`|`),`g`),g=new Set(u),_=new Set(n.css.ownable??[]),v=[],y=[],b=[],x=1,S=0;return{text:e.replace(h,(t,...n)=>{let r=n[n.length-2];for(;S<r;S++)e[S]===`
2
+ `&&x++;if(Object.hasOwn(l,t))return y.push({line:x,name:t,hint:l[t]}),t;let o=d.get(t);return _.has(t)&&a.has(t)?(i.test(e.slice(r+t.length))&&y.push({line:x,name:t,hint:`The product declares its own ${t}, so it and its reads were left as written. If it overrides the library token, rename it to ${o} by hand.`}),t):(v.push({line:x,from:t,to:o}),g.has(o)&&b.push({line:x,from:t,to:o}),o)}),hits:v,choose:y,checkRole:b}}export{e as CSS_TARGET_EXTENSIONS,c as applyCssTable,r as isCssTarget,s as ownDeclarations};
@@ -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}from"./css.js";import{applyRazorAttributes as a}from"./razorAttributes.js";import{applyRazorTags as o}from"./razorTags.js";import{applyMarkup as s,applySource as c}from"./source.js";import{applyComponentProps as l,applyPropSplits as u,applyPropValues as d,applyProps as f,applyThemeReads as p}from"./themeReads.js";import{createRequire as m}from"node:module";import{existsSync as h,readFileSync as g,readdirSync as _,writeFileSync as v}from"node:fs";import{dirname as y,join as b}from"node:path";import{fileURLToPath as x,pathToFileURL as S}from"node:url";import{spawnSync as C}from"node:child_process";var w=/^\d+\.\d+\.\d+$/,T=/^(?:workspace:|file:|link:)/,E=`WEBORITY_UPGRADE_FROM`;function D(e){if(typeof e!=`string`||!w.test(e))throw Error(`invalid version "${e}"`)}function O(e,t){D(e),D(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 k(){let e=y(x(import.meta.url));for(;;){let t=b(e,`package.json`);if(h(t)&&JSON.parse(g(t,`utf8`)).name===`@webority/tokens`)return e;let n=y(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function A(e){let t=[];for(let n of _(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);w.test(r)&&t.push({version:r,table:JSON.parse(g(b(e,n),`utf8`))})}return t.sort((e,t)=>O(e.version,t.version))}function j(e,t){let n=C(`git`,[`ls-files`,`-z`,`--`,...t],{cwd:e,encoding:`utf8`,windowsHide:!0,maxBuffer:64*1024*1024});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=>h(b(e,t)));return[...new Set(r)]}function M(e,t){let n=j(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function N(e){return e.split(`/`).includes(`node_modules`)}var P=new Set([`node_modules`,`vendor`,`vendors`,`external`]),F=/\.(?:min|bundle)\.(?:js|css)$/;function I(e){let t=e.split(`/`);return t.some(e=>P.has(e))||t.some((e,n)=>e===`lib`&&t[n-1]===`wwwroot`)?!0:F.test(e)}function L(e,t){return[...new Set([...e,...t])]}function R(e,t,n){return A(e).filter(e=>O(e.version,t)>0&&O(e.version,n)<=0).map(e=>e.table)}function z(e,m,h,_,y){_&&y(`dry run: nothing written`);let x=[],S=[],C=[];for(let w of m){if(!i(w)||I(w))continue;let m=g(b(e,w),`utf8`),T=m,E=e=>{for(let t of e)x.push({file:w,line:t.line,from:t.from,to:t.to}),y(`${w}:${t.line} ${t.from} -> ${t.to}`)},D=e=>{S.push({file:w,line:e.line,name:e.name,hint:e.hint}),y(`choose ${w}:${e.line} ${e.name}: ${e.hint}`)},O=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?y(`skipped ${w}: ${t.message}`):D({line:t.line,name:t.path,hint:t.message})};for(let e of h){let i=r(T,w,e);T=i.text,E(i.hits);for(let e of i.choose)D(e);for(let e of i.checkRole)y(`verify ${w}:${e.line} ${e.from} -> ${e.to}`);let m=p(T,w,e.themeReads);T=m.text,E(m.hits),O(m.findings);let h=[t=>f(t,w,e.props),t=>l(t,w,e.componentProps),t=>d(t,w,e.propValues),t=>u(t,w,e.propSplits),t=>a(t,w,e.razorAttributes),t=>n(t,w,e.components??[]),t=>o(t,w,e.razorTags??[]),n=>t(n,w,e.classes??[]),t=>s(t,w,e.markup),t=>c(t,w,e.source)];for(let e of h){let t=e(T);T=t.text,E(t.hits),O(t.findings)}}T!==m&&(C.push(w),_||v(b(e,w),T,`utf8`))}return{hits:x,choose:S,changedFiles:C}}function B(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function V(e,t,n,r,i){let a=[];for(let o of j(e,[`package.json`,`:(glob)**/package.json`])){if(N(o))continue;let s=g(b(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];T.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,B(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{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,join as x}from"node:path";import{fileURLToPath as S,pathToFileURL as C}from"node:url";import{spawnSync as w}from"node:child_process";var T=/^\d+\.\d+\.\d+$/,E=/^(?:workspace:|file:|link:)/,D=`WEBORITY_UPGRADE_FROM`;function O(e){if(typeof e!=`string`||!T.test(e))throw Error(`invalid version "${e}"`)}function k(e,t){O(e),O(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 A(){let e=b(S(import.meta.url));for(;;){let t=x(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 j(e){let t=[];for(let n of v(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);T.test(r)&&t.push({version:r,table:JSON.parse(_(x(e,n),`utf8`))})}return t.sort((e,t)=>k(e.version,t.version))}function M(e,t){let n=w(`git`,[`ls-files`,`-z`,`--`,...t],{cwd:e,encoding:`utf8`,windowsHide:!0,maxBuffer:64*1024*1024});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(x(e,t)));return[...new Set(r)]}function N(e,t){let n=M(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function P(e){return e.split(`/`).includes(`node_modules`)}var F=new Set([`node_modules`,`vendor`,`vendors`,`external`]),I=/\.(?:min|bundle)\.(?:js|css)$/;function L(e){let t=e.split(`/`);return t.some(e=>F.has(e))||t.some((e,n)=>e===`lib`&&t[n-1]===`wwwroot`)?!0:I.test(e)}function R(e,t){return[...new Set([...e,...t])]}function z(e,t,n){return j(e).filter(e=>k(e.version,t)>0&&k(e.version,n)<=0).map(e=>e.table)}function B(e,h,g,v,b){v&&b(`dry run: nothing written`);let S=[],C=[],w=[],T=h.filter(e=>i(e)&&!L(e)),E=g.map(()=>new Set);if(g.some(e=>(e.css.ownable??[]).length>0))for(let t of T){let n=_(x(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=_(x(e,i),`utf8`),h=a,T=e=>{for(let t of e)S.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(x(e,i),h,`utf8`))}return{hits:S,choose:C,changedFiles:w}}function V(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function H(e,t,n,r,i){let a=[];for(let o of M(e,[`package.json`,`:(glob)**/package.json`])){if(P(o))continue;let s=_(x(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];E.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,V(s));s.endsWith(`
2
2
  `)&&(t+=`
3
3
  `),s.includes(`\r
4
4
  `)&&(t=t.replace(/\n/g,`\r
5
- `)),v(b(e,o),t,`utf8`)}}return a}function H(e,t,n,r,i){let a=[];for(let o of j(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(N(o))continue;let s=g(b(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&&v(b(e,o),l,`utf8`))}return a}function U(e){let t;try{t=m(b(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(g(t,`utf8`))}function W(e,t,n){return C(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function G({root:e,version:t,from:n}){let r=m(b(e,`package.json`)).resolve(`@webority/tokens`);process.env[E]=n;try{return await(await import(S(r).href)).upgrade({root:e,version:t,dryRun:!1})}finally{delete process.env[E]}}async function K({root:e,version:t,dryRun:n,from:r,dir:i,log:a,brandFn:o}){let s=A(i);if(!n&&!s.some(e=>e.version===t))throw Error(`no rename table for ${t}`);let c=s.filter(e=>O(e.version,r)>0&&O(e.version,t)<=0).map(e=>e.table),l=z(e,M(e),c,n,a);return n||await o({root:e}),l}async function q({root:e,version:t,dryRun:n,deps:r,log:i}){let a=b(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!h(a))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let o=JSON.parse(g(a,`utf8`)).version,s=U(e),c=[...V(e,t,s,!n,i),...H(e,t,s,!n,i)];if(n){i(`dry run: install skipped; tables are those of the installed ${o}`);let n=R(r.renamesDir??b(e,`node_modules`,`@webority`,`tokens`,`renames`),o,t),a=z(e,M(e),n,!0,i);return{...a,changedFiles:L(c,a.changedFiles)}}let{status:l}=await(r.run??W)(`corepack`,[`pnpm`,`install`],{cwd:e});if(l!==0)throw Error(`pnpm install failed with exit code ${l}`);let u=await(r.reenter??G)({root:e,version:t,dryRun:!1,from:o});return{...u,changedFiles:L(c,u.changedFiles)}}async function J(t,n={}){let r=t.version;D(r);let i=t.root??process.cwd(),a=t.dryRun??!1,o=n.log??console.log,s=()=>n.renamesDir??b(k(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=A(s()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return z(i,M(i,t.paths),e,a,o)}if(!h(b(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let c=process.env[E];return c?K({root:i,version:r,dryRun:a,from:c,dir:s(),log:o,brandFn:n.brand??e}):q({root:i,version:r,dryRun:a,deps:n,log:o})}export{J as upgrade};
5
+ `)),y(x(e,o),t,`utf8`)}}return a}function U(e,t,n,r,i){let a=[];for(let o of M(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(P(o))continue;let s=_(x(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(x(e,o),l,`utf8`))}return a}function W(e){let t;try{t=h(x(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`))}function G(e,t,n){return w(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function K({root:e,version:t,from:n}){let r=h(x(e,`package.json`)).resolve(`@webority/tokens`);process.env[D]=n;try{return await(await import(C(r).href)).upgrade({root:e,version:t,dryRun:!1})}finally{delete process.env[D]}}async function q({root:e,version:t,dryRun:n,from:r,dir:i,log:a,brandFn:o}){let s=j(i);if(!n&&!s.some(e=>e.version===t))throw Error(`no rename table for ${t}`);let c=s.filter(e=>k(e.version,r)>0&&k(e.version,t)<=0).map(e=>e.table),l=B(e,N(e),c,n,a);return n||await o({root:e}),l}async function J({root:e,version:t,dryRun:n,deps:r,log:i}){let a=x(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!g(a))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let o=JSON.parse(_(a,`utf8`)).version,s=W(e),c=[...H(e,t,s,!n,i),...U(e,t,s,!n,i)];if(n){i(`dry run: install skipped; tables are those of the installed ${o}`);let n=z(r.renamesDir??x(e,`node_modules`,`@webority`,`tokens`,`renames`),o,t),a=B(e,N(e),n,!0,i);return{...a,changedFiles:R(c,a.changedFiles)}}let{status:l}=await(r.run??G)(`corepack`,[`pnpm`,`install`],{cwd:e});if(l!==0)throw Error(`pnpm install failed with exit code ${l}`);let u=await(r.reenter??K)({root:e,version:t,dryRun:!1,from:o});return{...u,changedFiles:R(c,u.changedFiles)}}async function Y(t,n={}){let r=t.version;O(r);let i=t.root??process.cwd(),a=t.dryRun??!1,o=n.log??console.log,s=()=>n.renamesDir??x(A(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=j(s()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return B(i,N(i,t.paths),e,a,o)}if(!g(x(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let c=process.env[D];return c?q({root:i,version:r,dryRun:a,from:c,dir:s(),log:o,brandFn:n.brand??e}):J({root:i,version:r,dryRun:a,deps:n,log:o})}export{Y as upgrade};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/tokens",
3
- "version": "0.120.1",
3
+ "version": "0.121.0",
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",
@@ -95,7 +95,21 @@
95
95
  "--color-info-20": "No meaning holds this step: use --color-info-soft for a fill or --color-info-border for an edge.",
96
96
  "--color-info-50": "No meaning holds this step: use --color-info-soft for a fill or --color-info-border for an edge."
97
97
  },
98
- "checkRole": ["--wui-shadow-popover", "--wui-shadow-modal"]
98
+ "checkRole": ["--wui-shadow-popover", "--wui-shadow-modal"],
99
+ "ownable": [
100
+ "--color-accent",
101
+ "--color-accent-soft",
102
+ "--shadow-overlay",
103
+ "--shadow-overlay-lg",
104
+ "--shadow-sm",
105
+ "--shadow-md",
106
+ "--shadow-lg",
107
+ "--radius-sm",
108
+ "--radius",
109
+ "--radius-lg",
110
+ "--radius-xl",
111
+ "--font-sans"
112
+ ]
99
113
  },
100
114
  "themeReads": [
101
115
  {
@@ -93,7 +93,14 @@ export interface MarkupRules {
93
93
 
94
94
  export interface RenameTable {
95
95
  version: string;
96
- css: { rename: [string, string][]; reads: [string, string][]; choose: Record<string, string>; checkRole: string[] };
96
+ css: {
97
+ rename: [string, string][];
98
+ reads: [string, string][];
99
+ choose: Record<string, string>;
100
+ checkRole: string[];
101
+ /** Renamed names generic enough that a product may declare its own (`--radius`): when a product declares one in any file, the upgrade leaves it and its reads as written and reports each declaration as a choose entry. */
102
+ ownable?: string[];
103
+ };
97
104
  themeReads: RetiredThemeRead[];
98
105
  props: { package: string; props: string[]; from: string; to: string }[];
99
106
  componentProps: ComponentPropRule[];