@webority/tokens 0.91.0 → 0.93.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.91.0",
5
+ "version": "0.93.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.91.0",
5
+ "version": "0.93.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.91.0",
5
+ "version": "0.93.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.91.0"
5
+ "version": "0.93.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`,`.ts`,`.tsx`,`.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]===`
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
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,5 +1,5 @@
1
- import{brand as e}from"../build.js";import{applyCssTable as t,isCssTarget as n}from"./css.js";import{applyRazorAttributes as r}from"./razorAttributes.js";import{applyPropSplits as i,applyPropValues as a,applyProps as o,applyThemeReads as s}from"./themeReads.js";import{createRequire as c}from"node:module";import{existsSync as l,readFileSync as u,readdirSync as d,writeFileSync as f}from"node:fs";import{dirname as p,join as m}from"node:path";import{fileURLToPath as h,pathToFileURL as g}from"node:url";import{spawnSync as _}from"node:child_process";var v=/^\d+\.\d+\.\d+$/,y=/^(?:workspace:|file:|link:)/,b=`WEBORITY_UPGRADE_FROM`;function x(e){if(typeof e!=`string`||!v.test(e))throw Error(`invalid version "${e}"`)}function S(e,t){x(e),x(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 C(){let e=p(h(import.meta.url));for(;;){let t=m(e,`package.json`);if(l(t)&&JSON.parse(u(t,`utf8`)).name===`@webority/tokens`)return e;let n=p(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function w(e){let t=[];for(let n of d(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);v.test(r)&&t.push({version:r,table:JSON.parse(u(m(e,n),`utf8`))})}return t.sort((e,t)=>S(e.version,t.version))}function T(e,t){let n=_(`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(`/`));return[...new Set(r)]}function E(e,t){let n=T(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function D(e){return e.split(`/`).includes(`node_modules`)}function O(e,t){return[...new Set([...e,...t])]}function k(e,t,n){return w(e).filter(e=>S(e.version,t)>0&&S(e.version,n)<=0).map(e=>e.table)}function A(e,c,l,d,p){d&&p(`dry run: nothing written`);let h=[],g=[],_=[];for(let v of c){if(!n(v))continue;let c=u(m(e,v),`utf8`),y=c,b=e=>{for(let t of e)h.push({file:v,line:t.line,from:t.from,to:t.to}),p(`${v}:${t.line} ${t.from} -> ${t.to}`)},x=e=>{g.push({file:v,line:e.line,name:e.name,hint:e.hint}),p(`choose ${v}:${e.line} ${e.name}: ${e.hint}`)},S=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?p(`skipped ${v}: ${t.message}`):x({line:t.line,name:t.path,hint:t.message})};for(let e of l){let n=t(y,v,e);y=n.text,b(n.hits);for(let e of n.choose)x(e);for(let e of n.checkRole)p(`verify ${v}:${e.line} ${e.from} -> ${e.to}`);let c=s(y,v,e.themeReads);y=c.text,b(c.hits),S(c.findings);let l=[t=>o(t,v,e.props),t=>a(t,v,e.propValues),t=>i(t,v,e.propSplits),t=>r(t,v,e.razorAttributes)];for(let e of l){let t=e(y);y=t.text,b(t.hits),S(t.findings)}}y!==c&&(_.push(v),d||f(m(e,v),y,`utf8`))}return{hits:h,choose:g,changedFiles:_}}function j(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function M(e,t,n,r,i){let a=[];for(let o of T(e,[`package.json`,`:(glob)**/package.json`])){if(D(o))continue;let s=u(m(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];y.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,j(s));s.endsWith(`
1
+ import{brand as e}from"../build.js";import{applyCssTable as t,isCssTarget as n}from"./css.js";import{applyRazorAttributes as r}from"./razorAttributes.js";import{applySource as i}from"./source.js";import{applyPropSplits as a,applyPropValues as o,applyProps as s,applyThemeReads as c}from"./themeReads.js";import{createRequire as l}from"node:module";import{existsSync as u,readFileSync as d,readdirSync as f,writeFileSync as p}from"node:fs";import{dirname as m,join as h}from"node:path";import{fileURLToPath as g,pathToFileURL as _}from"node:url";import{spawnSync as v}from"node:child_process";var y=/^\d+\.\d+\.\d+$/,b=/^(?:workspace:|file:|link:)/,x=`WEBORITY_UPGRADE_FROM`;function S(e){if(typeof e!=`string`||!y.test(e))throw Error(`invalid version "${e}"`)}function C(e,t){S(e),S(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 w(){let e=m(g(import.meta.url));for(;;){let t=h(e,`package.json`);if(u(t)&&JSON.parse(d(t,`utf8`)).name===`@webority/tokens`)return e;let n=m(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function T(e){let t=[];for(let n of f(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);y.test(r)&&t.push({version:r,table:JSON.parse(d(h(e,n),`utf8`))})}return t.sort((e,t)=>C(e.version,t.version))}function E(e,t){let n=v(`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(`/`));return[...new Set(r)]}function D(e,t){let n=E(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function O(e){return e.split(`/`).includes(`node_modules`)}function k(e,t){return[...new Set([...e,...t])]}function A(e,t,n){return T(e).filter(e=>C(e.version,t)>0&&C(e.version,n)<=0).map(e=>e.table)}function j(e,l,u,f,m){f&&m(`dry run: nothing written`);let g=[],_=[],v=[];for(let y of l){if(!n(y))continue;let l=d(h(e,y),`utf8`),b=l,x=e=>{for(let t of e)g.push({file:y,line:t.line,from:t.from,to:t.to}),m(`${y}:${t.line} ${t.from} -> ${t.to}`)},S=e=>{_.push({file:y,line:e.line,name:e.name,hint:e.hint}),m(`choose ${y}:${e.line} ${e.name}: ${e.hint}`)},C=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?m(`skipped ${y}: ${t.message}`):S({line:t.line,name:t.path,hint:t.message})};for(let e of u){let n=t(b,y,e);b=n.text,x(n.hits);for(let e of n.choose)S(e);for(let e of n.checkRole)m(`verify ${y}:${e.line} ${e.from} -> ${e.to}`);let l=c(b,y,e.themeReads);b=l.text,x(l.hits),C(l.findings);let u=[t=>s(t,y,e.props),t=>o(t,y,e.propValues),t=>a(t,y,e.propSplits),t=>r(t,y,e.razorAttributes),t=>i(t,y,e.source)];for(let e of u){let t=e(b);b=t.text,x(t.hits),C(t.findings)}}b!==l&&(v.push(y),f||p(h(e,y),b,`utf8`))}return{hits:g,choose:_,changedFiles:v}}function M(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function N(e,t,n,r,i){let a=[];for(let o of E(e,[`package.json`,`:(glob)**/package.json`])){if(O(o))continue;let s=d(h(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];b.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,M(s));s.endsWith(`
2
2
  `)&&(t+=`
3
3
  `),s.includes(`\r
4
4
  `)&&(t=t.replace(/\n/g,`\r
5
- `)),f(m(e,o),t,`utf8`)}}return a}function N(e,t,n,r,i){let a=[];for(let o of T(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(D(o))continue;let s=u(m(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&&f(m(e,o),l,`utf8`))}return a}function P(e){let t;try{t=c(m(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(u(t,`utf8`))}function F(e,t,n){return _(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function I({root:e,version:t,from:n}){let r=c(m(e,`package.json`)).resolve(`@webority/tokens`);process.env[b]=n;try{return await(await import(g(r).href)).upgrade({root:e,version:t,dryRun:!1})}finally{delete process.env[b]}}async function L({root:e,version:t,dryRun:n,from:r,dir:i,log:a,brandFn:o}){let s=w(i);if(!n&&!s.some(e=>e.version===t))throw Error(`no rename table for ${t}`);let c=s.filter(e=>S(e.version,r)>0&&S(e.version,t)<=0).map(e=>e.table),l=A(e,E(e),c,n,a);return n||await o({root:e}),l}async function R({root:e,version:t,dryRun:n,deps:r,log:i}){let a=m(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!l(a))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let o=JSON.parse(u(a,`utf8`)).version,s=P(e),c=[...M(e,t,s,!n,i),...N(e,t,s,!n,i)];if(n){i(`dry run: install skipped; tables are those of the installed ${o}`);let n=k(r.renamesDir??m(e,`node_modules`,`@webority`,`tokens`,`renames`),o,t),a=A(e,E(e),n,!0,i);return{...a,changedFiles:O(c,a.changedFiles)}}let{status:d}=await(r.run??F)(`corepack`,[`pnpm`,`install`],{cwd:e});if(d!==0)throw Error(`pnpm install failed with exit code ${d}`);let f=await(r.reenter??I)({root:e,version:t,dryRun:!1,from:o});return{...f,changedFiles:O(c,f.changedFiles)}}async function z(t,n={}){let r=t.version;x(r);let i=t.root??process.cwd(),a=t.dryRun??!1,o=n.log??console.log,s=()=>n.renamesDir??m(C(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=w(s()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return A(i,E(i,t.paths),e,a,o)}if(!l(m(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let c=process.env[b];return c?L({root:i,version:r,dryRun:a,from:c,dir:s(),log:o,brandFn:n.brand??e}):R({root:i,version:r,dryRun:a,deps:n,log:o})}export{z as upgrade};
5
+ `)),p(h(e,o),t,`utf8`)}}return a}function P(e,t,n,r,i){let a=[];for(let o of E(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(O(o))continue;let s=d(h(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&&p(h(e,o),l,`utf8`))}return a}function F(e){let t;try{t=l(h(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(d(t,`utf8`))}function I(e,t,n){return v(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function L({root:e,version:t,from:n}){let r=l(h(e,`package.json`)).resolve(`@webority/tokens`);process.env[x]=n;try{return await(await import(_(r).href)).upgrade({root:e,version:t,dryRun:!1})}finally{delete process.env[x]}}async function R({root:e,version:t,dryRun:n,from:r,dir:i,log:a,brandFn:o}){let s=T(i);if(!n&&!s.some(e=>e.version===t))throw Error(`no rename table for ${t}`);let c=s.filter(e=>C(e.version,r)>0&&C(e.version,t)<=0).map(e=>e.table),l=j(e,D(e),c,n,a);return n||await o({root:e}),l}async function z({root:e,version:t,dryRun:n,deps:r,log:i}){let a=h(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!u(a))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let o=JSON.parse(d(a,`utf8`)).version,s=F(e),c=[...N(e,t,s,!n,i),...P(e,t,s,!n,i)];if(n){i(`dry run: install skipped; tables are those of the installed ${o}`);let n=A(r.renamesDir??h(e,`node_modules`,`@webority`,`tokens`,`renames`),o,t),a=j(e,D(e),n,!0,i);return{...a,changedFiles:k(c,a.changedFiles)}}let{status:l}=await(r.run??I)(`corepack`,[`pnpm`,`install`],{cwd:e});if(l!==0)throw Error(`pnpm install failed with exit code ${l}`);let f=await(r.reenter??L)({root:e,version:t,dryRun:!1,from:o});return{...f,changedFiles:k(c,f.changedFiles)}}async function B(t,n={}){let r=t.version;S(r);let i=t.root??process.cwd(),a=t.dryRun??!1,o=n.log??console.log,s=()=>n.renamesDir??h(w(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=T(s()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return j(i,D(i,t.paths),e,a,o)}if(!u(h(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let c=process.env[x];return c?R({root:i,version:r,dryRun:a,from:c,dir:s(),log:o,brandFn:n.brand??e}):z({root:i,version:r,dryRun:a,deps:n,log:o})}export{B as upgrade};
@@ -0,0 +1,3 @@
1
+ import e from"node:path";var t=new Set([`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`]),n=`["'\`]`,r=`[A-Za-z_$][\\w$]*`,i=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=e=>[...e].sort((e,t)=>t.length-e.length).map(i).join(`|`),o=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
2
+ `&&t.push(n+1);return t},s=(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},c=(e,t)=>e<t?-1:+(e>t),l=(e,t,r)=>{if(t.length===0)return e;let i=new Map(t),c=RegExp(`(${n})(${a(i.keys())})\\1`,`g`),l=o(e);return e.replace(c,(e,t,n,a)=>{let o=i.get(n);return r.push({line:s(l,a),from:n,to:o}),`${t}${o}${t}`})},u=(e,t,n)=>{let a=e;for(let e of t){let t=e.receiver===void 0?void 0:RegExp(`^(?:${e.receiver})$`),c=RegExp(`(${r})(\\?\\.|\\.)${i(e.from)}(?![\\w$])`,`g`),l=o(a);a=a.replace(c,(r,i,a,o)=>t!==void 0&&!t.test(i)?r:(n.push({line:s(l,o),from:`${i}${a}${e.from}`,to:`${i}${a}${e.to}`}),`${i}${a}${e.to}`))}return a},d=(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 f(n,r,i){if(i===void 0||!t.has(e.extname(r).toLowerCase()))return{text:n,hits:[],findings:[]};let a=[],o=u(l(n,i.literals,a),i.members,a),s=d(o,i.flags);return a.sort((e,t)=>e.line-t.line||c(e.from,t.from)),s.sort((e,t)=>e.line-t.line||c(e.path,t.path)),{text:o,hits:a,findings:s}}export{t as SOURCE_EXTENSIONS,f as applySource};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/tokens",
3
- "version": "0.91.0",
3
+ "version": "0.93.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",
@@ -0,0 +1,75 @@
1
+ {
2
+ "version": "0.93.0",
3
+ "css": {
4
+ "rename": [],
5
+ "reads": [],
6
+ "choose": {},
7
+ "checkRole": []
8
+ },
9
+ "themeReads": [],
10
+ "props": [],
11
+ "propValues": [],
12
+ "propSplits": [],
13
+ "razorAttributes": [],
14
+ "source": {
15
+ "literals": [
16
+ ["X-Client-Kind", "Client-Kind"],
17
+ ["X-Client-Build", "Client-Build"],
18
+ ["X-App-Build", "App-Build"],
19
+ ["X-Account-Id", "Account-Id"],
20
+ ["X-Min-App-Version", "Min-App-Version"],
21
+ ["X-Design-Sample", "Design-Sample"],
22
+ ["x-client-kind", "client-kind"],
23
+ ["x-client-build", "client-build"],
24
+ ["x-app-build", "app-build"],
25
+ ["x-account-id", "account-id"],
26
+ ["x-min-app-version", "min-app-version"],
27
+ ["x-design-sample", "design-sample"]
28
+ ],
29
+ "members": [
30
+ {
31
+ "from": "detail",
32
+ "to": "diagnostic",
33
+ "receiver": "[A-Za-z_$][\\w$]*[Ee]rr(?:or)?[\\w$]*|err|e"
34
+ },
35
+ {
36
+ "from": "signOutReason",
37
+ "to": "code"
38
+ }
39
+ ],
40
+ "flags": [
41
+ {
42
+ "pattern": "\\bcorrelationIdHeader\\b",
43
+ "hint": "delete this option: every request now sends a W3C traceparent header instead"
44
+ },
45
+ {
46
+ "pattern": "\\bsignOutReasonHeader\\b",
47
+ "hint": "delete this option: the session end now comes from the 401 body code session_revoked or session_expired"
48
+ },
49
+ {
50
+ "pattern": "\\bSIGN_OUT_REASON_HEADER\\b|\\bSESSION_INVALID_HEADER\\b",
51
+ "hint": "removed: check the session-ended listener's detail.code (SESSION_REVOKED_CODE, SESSION_EXPIRED_CODE) instead"
52
+ },
53
+ {
54
+ "pattern": "\\bSESSION_TERMINATION_CODES\\b|\\bSessionTerminationCode\\b",
55
+ "hint": "removed: use SESSION_REVOKED_CODE and SESSION_EXPIRED_CODE"
56
+ },
57
+ {
58
+ "pattern": "\\bnewCorrelationId\\b",
59
+ "hint": "removed: use newTraceparent().header with TRACEPARENT_HEADER"
60
+ },
61
+ {
62
+ "pattern": "\\bretryAfterSeconds\\b",
63
+ "hint": "removed from error bodies: read the Retry-After response header"
64
+ },
65
+ {
66
+ "pattern": "client_update_required",
67
+ "hint": "the server no longer answers 426; the update prompt comes from the Min-App-Version header only"
68
+ },
69
+ {
70
+ "pattern": "\\bsignOutReason\\b",
71
+ "hint": "renamed to code on the session-ended detail; rename this binding"
72
+ }
73
+ ]
74
+ }
75
+ }
@@ -31,6 +31,16 @@ export interface RazorAttributeRule {
31
31
  values: Readonly<Record<"true" | "false", string>>;
32
32
  }
33
33
 
34
+ /** Source code a release changed: the renames apply to the source files the upgrade reads as JavaScript or TypeScript. */
35
+ export interface SourceRules {
36
+ /** Renames a whole string literal in single, double or backtick quotes, such as a header name. */
37
+ literals: [string, string][];
38
+ /** Renames a property access `from` to `to`. When `receiver` is given, only where the object identifier matches the regular expression `receiver` (case-sensitive, whole identifier). */
39
+ members: { from: string; to: string; receiver?: string }[];
40
+ /** Regular expressions a person must resolve: each matching line is reported as a choose entry with `hint`. */
41
+ flags: { pattern: string; hint: string }[];
42
+ }
43
+
34
44
  export interface RenameTable {
35
45
  version: string;
36
46
  css: { rename: [string, string][]; reads: [string, string][]; choose: Record<string, string>; checkRole: string[] };
@@ -39,4 +49,5 @@ export interface RenameTable {
39
49
  propValues: PropValueRule[];
40
50
  propSplits: PropSplitRule[];
41
51
  razorAttributes: RazorAttributeRule[];
52
+ source?: SourceRules;
42
53
  }