@recursica/adapter-tester 2.0.3 → 2.2.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.
- package/README.md +12 -0
- package/dist/cli.cjs +2 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +266 -259
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,12 @@ npm run adapter-tester:automated # runs the `adapter-tester` CLI
|
|
|
86
86
|
|
|
87
87
|
Pass `--dry-run` to print the resolved config and generated files without booting anything — useful for checking what a config resolves to.
|
|
88
88
|
|
|
89
|
+
Any other args are forwarded to `playwright test`, so you can scope a run to specific stories instead of running the full suite every time:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm run adapter-tester:automated -- --grep "Toast"
|
|
93
|
+
```
|
|
94
|
+
|
|
89
95
|
### What happens during execution?
|
|
90
96
|
|
|
91
97
|
1. **Automatic Storybook Bootup**: `adapter-tester` boots both sides of the comparison — this project's own Storybook, and the source-of-truth Storybook (a throwaway Mantine harness by default) — reusing them if already running.
|
|
@@ -151,4 +157,10 @@ npm run adapter-tester # Interactive Dev Mode
|
|
|
151
157
|
npm run adapter-tester:automated # headless Playwright suite
|
|
152
158
|
```
|
|
153
159
|
|
|
160
|
+
Any extra args after `adapter-tester:automated` are passed straight through to `playwright test`, so you can scope a run instead of executing the full suite:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm run adapter-tester:automated -- --grep "Toast"
|
|
164
|
+
```
|
|
165
|
+
|
|
154
166
|
Add `adapter-tester.config.json` only to override defaults (see [Configuring `adapter-tester.config.json`](#configuring-adapter-testerconfigjson) above), e.g. to raise the diff threshold or relax specific stories. Add `.adapter-tester/` to your `.gitignore` — it's regenerated on every run.
|
package/dist/cli.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
depsCount: ${$},
|
|
18
18
|
deps: ${_}}`};const b={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(h){const[$,_]=s(h);l(h,$),u(h,_)}};function s({schema:h}){const $={},_={};for(const P in h){if(P==="__proto__")continue;const v=Array.isArray(h[P])?$:_;v[P]=h[P]}return[$,_]}function l(h,$=h.schema){const{gen:_,data:P,it:v}=h;if(Object.keys($).length===0)return;const y=_.let("missing");for(const g in $){const w=$[g];if(w.length===0)continue;const a=(0,c.propertyInData)(_,P,g,v.opts.ownProperties);h.setParams({property:g,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(a,()=>{for(const i of w)(0,c.checkReportMissingProp)(h,i)}):(_.if((0,t._)`${a} && (${(0,c.checkMissingProp)(h,w,y)})`),(0,c.reportMissingProp)(h,y),_.else())}}e.validatePropertyDeps=l;function u(h,$=h.schema){const{gen:_,data:P,keyword:v,it:y}=h,g=_.name("valid");for(const w in $)(0,m.alwaysValidSchema)(y,$[w])||(_.if((0,c.propertyInData)(_,P,w,y.opts.ownProperties),()=>{const a=h.subschema({keyword:v,schemaProp:w},g);h.mergeValidEvaluated(a,g)},()=>_.var(g,!0)),h.ok(g))}e.validateSchemaDeps=u,e.default=b})(Dt)),Dt}var nt={},Br;function _s(){if(Br)return nt;Br=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:b})=>(0,e._)`{propertyName: ${b.propertyName}}`},code(b){const{gen:s,schema:l,data:u,it:h}=b;if((0,t.alwaysValidSchema)(h,l))return;const $=s.name("valid");s.forIn("key",u,_=>{b.setParams({propertyName:_}),b.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{b.error(!0),h.allErrors||s.break()})}),b.ok($)}};return nt.default=c,nt}var st={},Yr;function Pn(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=le(),t=H(),m=$e(),c=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:u,schema:h,parentSchema:$,data:_,errsCount:P,it:v}=l;if(!P)throw new Error("ajv implementation error");const{allErrors:y,opts:g}=v;if(v.props=!0,g.removeAdditional!=="all"&&(0,c.alwaysValidSchema)(v,h))return;const w=(0,e.allSchemaProperties)($.properties),a=(0,e.allSchemaProperties)($.patternProperties);i(),l.ok((0,t._)`${P} === ${m.default.errors}`);function i(){u.forIn("key",_,f=>{!w.length&&!a.length?p(f):u.if(r(f),()=>p(f))})}function r(f){let S;if(w.length>8){const T=(0,c.schemaRefOrVal)(v,$.properties,"properties");S=(0,e.isOwnProperty)(u,T,f)}else w.length?S=(0,t.or)(...w.map(T=>(0,t._)`${f} === ${T}`)):S=t.nil;return a.length&&(S=(0,t.or)(S,...a.map(T=>(0,t._)`${(0,e.usePattern)(l,T)}.test(${f})`))),(0,t.not)(S)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function p(f){if(g.removeAdditional==="all"||g.removeAdditional&&h===!1){o(f);return}if(h===!1){l.setParams({additionalProperty:f}),l.error(),y||u.break();return}if(typeof h=="object"&&!(0,c.alwaysValidSchema)(v,h)){const S=u.name("valid");g.removeAdditional==="failing"?(n(f,S,!1),u.if((0,t.not)(S),()=>{l.reset(),o(f)})):(n(f,S),y||u.if((0,t.not)(S),()=>u.break()))}}function n(f,S,T){const j={keyword:"additionalProperties",dataProp:f,dataPropType:c.Type.Str};T===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(j,S)}}};return st.default=s,st}var at={},Zr;function vs(){if(Zr)return at;Zr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=wt(),t=le(),m=Y(),c=Pn(),b={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:u,parentSchema:h,data:$,it:_}=s;_.opts.removeAdditional==="all"&&h.additionalProperties===void 0&&c.default.code(new e.KeywordCxt(_,c.default,"additionalProperties"));const P=(0,t.allSchemaProperties)(u);for(const a of P)_.definedProperties.add(a);_.opts.unevaluated&&P.length&&_.props!==!0&&(_.props=m.mergeEvaluated.props(l,(0,m.toHash)(P),_.props));const v=P.filter(a=>!(0,m.alwaysValidSchema)(_,u[a]));if(v.length===0)return;const y=l.name("valid");for(const a of v)g(a)?w(a):(l.if((0,t.propertyInData)(l,$,a,_.opts.ownProperties)),w(a),_.allErrors||l.else().var(y,!0),l.endIf()),s.it.definedProperties.add(a),s.ok(y);function g(a){return _.opts.useDefaults&&!_.compositeRule&&u[a].default!==void 0}function w(a){s.subschema({keyword:"properties",schemaProp:a,dataProp:a},y)}}};return at.default=b,at}var ot={},Qr;function $s(){if(Qr)return ot;Qr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=le(),t=H(),m=Y(),c=Y(),b={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:u,data:h,parentSchema:$,it:_}=s,{opts:P}=_,v=(0,e.allSchemaProperties)(u),y=v.filter(p=>(0,m.alwaysValidSchema)(_,u[p]));if(v.length===0||y.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const g=P.strictSchema&&!P.allowMatchingProperties&&$.properties,w=l.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,c.evaluatedPropsToName)(l,_.props));const{props:a}=_;i();function i(){for(const p of v)g&&r(p),_.allErrors?o(p):(l.var(w,!0),o(p),l.if(w))}function r(p){for(const n in g)new RegExp(p).test(n)&&(0,m.checkStrictMode)(_,`property ${n} matches pattern ${p} (use allowMatchingProperties)`)}function o(p){l.forIn("key",h,n=>{l.if((0,t._)`${(0,e.usePattern)(s,p)}.test(${n})`,()=>{const f=y.includes(p);f||s.subschema({keyword:"patternProperties",schemaProp:p,dataProp:n,dataPropType:c.Type.Str},w),_.opts.unevaluated&&a!==!0?l.assign((0,t._)`${a}[${n}]`,!0):!f&&!_.allErrors&&l.if((0,t.not)(w),()=>l.break())})})}}};return ot.default=b,ot}var it={},Xr;function ws(){if(Xr)return it;Xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(m){const{gen:c,schema:b,it:s}=m;if((0,e.alwaysValidSchema)(s,b)){m.fail();return}const l=c.name("valid");m.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),m.failResult(l,()=>m.reset(),()=>m.error())},error:{message:"must NOT be valid"}};return it.default=t,it}var ut={},xr;function bs(){if(xr)return ut;xr=1,Object.defineProperty(ut,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ut.default=t,ut}var ct={},en;function Ss(){if(en)return ct;en=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:b})=>(0,e._)`{passingSchemas: ${b.passing}}`},code(b){const{gen:s,schema:l,parentSchema:u,it:h}=b;if(!Array.isArray(l))throw new Error("ajv implementation error");if(h.opts.discriminator&&u.discriminator)return;const $=l,_=s.let("valid",!1),P=s.let("passing",null),v=s.name("_valid");b.setParams({passing:P}),s.block(y),b.result(_,()=>b.reset(),()=>b.error(!0));function y(){$.forEach((g,w)=>{let a;(0,t.alwaysValidSchema)(h,g)?s.var(v,!0):a=b.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(P,(0,e._)`[${P}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(P,w),a&&b.mergeEvaluated(a,e.Name)})})}}};return ct.default=c,ct}var dt={},tn;function Es(){if(tn)return dt;tn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(m){const{gen:c,schema:b,it:s}=m;if(!Array.isArray(b))throw new Error("ajv implementation error");const l=c.name("valid");b.forEach((u,h)=>{if((0,e.alwaysValidSchema)(s,u))return;const $=m.subschema({keyword:"allOf",schemaProp:h},l);m.ok(l),m.mergeEvaluated($)})}};return dt.default=t,dt}var lt={},rn;function Ps(){if(rn)return lt;rn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:u,it:h}=s;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(h,'"if" without "then" and "else" is ignored');const $=b(h,"then"),_=b(h,"else");if(!$&&!_)return;const P=l.let("valid",!0),v=l.name("_valid");if(y(),s.reset(),$&&_){const w=l.let("ifClause");s.setParams({ifClause:w}),l.if(v,g("then",w),g("else",w))}else $?l.if(v,g("then")):l.if((0,e.not)(v),g("else"));s.pass(P,()=>s.error(!0));function y(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function g(w,a){return()=>{const i=s.subschema({keyword:w},v);l.assign(P,v),s.mergeValidEvaluated(i,P),a?l.assign(a,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function b(s,l){const u=s.schema[l];return u!==void 0&&!(0,t.alwaysValidSchema)(s,u)}return lt.default=c,lt}var ft={},nn;function Ns(){if(nn)return ft;nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:m,parentSchema:c,it:b}){c.if===void 0&&(0,e.checkStrictMode)(b,`"${m}" without "if" is ignored`)}};return ft.default=t,ft}var sn;function Rs(){if(sn)return xe;sn=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=Sn(),t=ms(),m=En(),c=ps(),b=ys(),s=gs(),l=_s(),u=Pn(),h=vs(),$=$s(),_=ws(),P=bs(),v=Ss(),y=Es(),g=Ps(),w=Ns();function a(i=!1){const r=[_.default,P.default,v.default,y.default,g.default,w.default,l.default,u.default,s.default,h.default,$.default];return i?r.push(t.default,c.default):r.push(e.default,m.default),r.push(b.default),r}return xe.default=a,xe}var ht={},mt={},an;function ks(){if(an)return mt;an=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=H(),m={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:c})=>(0,e.str)`must match format "${c}"`,params:({schemaCode:c})=>(0,e._)`{format: ${c}}`},code(c,b){const{gen:s,data:l,$data:u,schema:h,schemaCode:$,it:_}=c,{opts:P,errSchemaPath:v,schemaEnv:y,self:g}=_;if(!P.validateFormats)return;u?w():a();function w(){const i=s.scopeValue("formats",{ref:g.formats,code:P.code.formats}),r=s.const("fDef",(0,e._)`${i}[${$}]`),o=s.let("fType"),p=s.let("format");s.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>s.assign(o,(0,e._)`${r}.type || "string"`).assign(p,(0,e._)`${r}.validate`),()=>s.assign(o,(0,e._)`"string"`).assign(p,r)),c.fail$data((0,e.or)(n(),f()));function n(){return P.strictSchema===!1?e.nil:(0,e._)`${$} && !${p}`}function f(){const S=y.$async?(0,e._)`(${r}.async ? await ${p}(${l}) : ${p}(${l}))`:(0,e._)`${p}(${l})`,T=(0,e._)`(typeof ${p} == "function" ? ${S} : ${p}.test(${l}))`;return(0,e._)`${p} && ${p} !== true && ${o} === ${b} && !${T}`}}function a(){const i=g.formats[h];if(!i){n();return}if(i===!0)return;const[r,o,p]=f(i);r===b&&c.pass(S());function n(){if(P.strictSchema===!1){g.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${h}" ignored in schema at path "${v}"`}}function f(T){const j=T instanceof RegExp?(0,e.regexpCode)(T):P.code.formats?(0,e._)`${P.code.formats}${(0,e.getProperty)(h)}`:void 0,D=s.scopeValue("formats",{key:h,ref:T,code:j});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,e._)`${D}.validate`]:["string",T,D]}function S(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${p}(${l})`}return typeof o=="function"?(0,e._)`${p}(${l})`:(0,e._)`${p}.test(${l})`}}}};return mt.default=m,mt}var on;function Os(){if(on)return ht;on=1,Object.defineProperty(ht,"__esModule",{value:!0});const t=[ks().default];return ht.default=t,ht}var Se={},un;function Ts(){return un||(un=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.contentVocabulary=Se.metadataVocabulary=void 0,Se.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Se.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Se}var cn;function js(){if(cn)return Me;cn=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=ts(),t=hs(),m=Rs(),c=Os(),b=Ts(),s=[e.default,t.default,(0,m.default)(),c.default,b.metadataVocabulary,b.contentVocabulary];return Me.default=s,Me}var pt={},je={},dn;function Is(){if(dn)return je;dn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(je.DiscrError=e={})),je}var ln;function qs(){if(ln)return pt;ln=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Is(),m=Ht(),c=bt(),b=Y(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:h}})=>u===t.DiscrError.Tag?`tag "${h}" must be string`:`value of tag "${h}" must be in oneOf`,params:({params:{discrError:u,tag:h,tagName:$}})=>(0,e._)`{error: ${u}, tag: ${$}, tagValue: ${h}}`},code(u){const{gen:h,data:$,schema:_,parentSchema:P,it:v}=u,{oneOf:y}=P;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const g=_.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=h.let("valid",!1),a=h.const("tag",(0,e._)`${$}${(0,e.getProperty)(g)}`);h.if((0,e._)`typeof ${a} == "string"`,()=>i(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:a,tagName:g})),u.ok(w);function i(){const p=o();h.if(!1);for(const n in p)h.elseIf((0,e._)`${a} === ${n}`),h.assign(w,r(p[n]));h.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:a,tagName:g}),h.endIf()}function r(p){const n=h.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:p},n);return u.mergeEvaluated(f,e.Name),n}function o(){var p;const n={},f=T(P);let S=!0;for(let z=0;z<y.length;z++){let V=y[z];if(V!=null&&V.$ref&&!(0,b.schemaHasRulesButRef)(V,v.self.RULES)){const J=V.$ref;if(V=m.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,J),V instanceof m.SchemaEnv&&(V=V.schema),V===void 0)throw new c.default(v.opts.uriResolver,v.baseId,J)}const U=(p=V==null?void 0:V.properties)===null||p===void 0?void 0:p[g];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);S=S&&(f||T(V)),j(U,z)}if(!S)throw new Error(`discriminator: "${g}" must be required`);return n;function T({required:z}){return Array.isArray(z)&&z.includes(g)}function j(z,V){if(z.const)D(z.const,V);else if(z.enum)for(const U of z.enum)D(U,V);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function D(z,V){if(typeof z!="string"||z in n)throw new Error(`discriminator: "${g}" values must be unique strings`);n[z]=V}}}};return pt.default=l,pt}const Cs="http://json-schema.org/draft-07/schema#",Ds="http://json-schema.org/draft-07/schema#",As="Core schema meta-schema",Ms={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},zs=["object","boolean"],Vs={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Fs={$schema:Cs,$id:Ds,title:As,definitions:Ms,type:zs,properties:Vs,default:!0};var fn;function Nn(){return fn||(fn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const m=Xn(),c=js(),b=qs(),s=Fs,l=["/properties"],u="http://json-schema.org/draft-07/schema";class h extends m.default{_addVocabularies(){super._addVocabularies(),c.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(b.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(g,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=h,e.exports=t=h,e.exports.Ajv=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var $=wt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var _=H();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var P=Gt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return P.default}});var v=bt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Ie,Ie.exports)),Ie.exports}var Us=Nn(),yt={exports:{}},At={},hn;function Ls(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,D){return{validate:j,compare:D}}e.fullFormats={date:t(s,l),time:t(h,$),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-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:i,int32:{type:"number",validate:p},int64:{type:"number",validate:n},float:{type:"number",validate:f},double:{type:"number",validate:f},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function m(j){return j%4===0&&(j%100!==0||j%400===0)}const c=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,b=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const D=c.exec(j);if(!D)return!1;const z=+D[1],V=+D[2],U=+D[3];return V>=1&&V<=12&&U>=1&&U<=(V===2&&m(z)?29:b[V])}function l(j,D){if(j&&D)return j>D?1:j<D?-1:0}const u=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function h(j,D){const z=u.exec(j);if(!z)return!1;const V=+z[1],U=+z[2],J=+z[3],x=z[5];return(V<=23&&U<=59&&J<=59||V===23&&U===59&&J===60)&&(!D||x!=="")}function $(j,D){if(!(j&&D))return;const z=u.exec(j),V=u.exec(D);if(z&&V)return j=z[1]+z[2]+z[3]+(z[4]||""),D=V[1]+V[2]+V[3]+(V[4]||""),j>D?1:j<D?-1:0}const _=/t|\s/i;function P(j){const D=j.split(_);return D.length===2&&s(D[0])&&h(D[1],!0)}function v(j,D){if(!(j&&D))return;const[z,V]=j.split(_),[U,J]=D.split(_),x=l(z,U);if(x!==void 0)return x||$(V,J)}const y=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w(j){return y.test(j)&&g.test(j)}const a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(j){return a.lastIndex=0,a.test(j)}const r=-2147483648,o=2**31-1;function p(j){return Number.isInteger(j)&&j<=o&&j>=r}function n(j){return Number.isInteger(j)}function f(){return!0}const S=/[^\\]\\Z/;function T(j){if(S.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(At)),At}var Mt={},mn;function Ks(){return mn||(mn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Nn(),m=H(),c=m.operators,b={formatMaximum:{okStr:"<=",ok:c.LTE,fail:c.GT},formatMinimum:{okStr:">=",ok:c.GTE,fail:c.LT},formatExclusiveMaximum:{okStr:"<",ok:c.LT,fail:c.GTE},formatExclusiveMinimum:{okStr:">",ok:c.GT,fail:c.LTE}},s={message:({keyword:u,schemaCode:h})=>m.str`should be ${b[u].okStr} ${h}`,params:({keyword:u,schemaCode:h})=>m._`{comparison: ${b[u].okStr}, limit: ${h}}`};e.formatLimitDefinition={keyword:Object.keys(b),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:h,data:$,schemaCode:_,keyword:P,it:v}=u,{opts:y,self:g}=v;if(!y.validateFormats)return;const w=new t.KeywordCxt(v,g.RULES.all.format.definition,"format");w.$data?a():i();function a(){const o=h.scopeValue("formats",{ref:g.formats,code:y.code.formats}),p=h.const("fmt",m._`${o}[${w.schemaCode}]`);u.fail$data(m.or(m._`typeof ${p} != "object"`,m._`${p} instanceof RegExp`,m._`typeof ${p}.compare != "function"`,r(p)))}function i(){const o=w.schema,p=g.formats[o];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${P}": format "${o}" does not define "compare" function`);const n=h.scopeValue("formats",{key:o,ref:p,code:y.code.formats?m._`${y.code.formats}${m.getProperty(o)}`:void 0});u.fail$data(r(n))}function r(o){return m._`${o}.compare(${$}, ${_}) ${b[P].fail} 0`}},dependencies:["format"]};const l=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=l})(Mt)),Mt}var pn;function Gs(){return pn||(pn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const m=Ls(),c=Ks(),b=H(),s=new b.Name("fullFormats"),l=new b.Name("fastFormats"),u=($,_={keywords:!0})=>{if(Array.isArray(_))return h($,_,m.fullFormats,s),$;const[P,v]=_.mode==="fast"?[m.fastFormats,l]:[m.fullFormats,s],y=_.formats||m.formatNames;return h($,y,P,v),_.keywords&&c.default($),$};u.get=($,_="full")=>{const v=(_==="fast"?m.fastFormats:m.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function h($,_,P,v){var y,g;(y=(g=$.opts.code).formats)!==null&&y!==void 0||(g.formats=b._`require("ajv-formats/dist/formats").${v}`);for(const w of _)$.addFormat(w,P[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(yt,yt.exports)),yt.exports}var Hs=Gs();const Js=An(Hs),Ws="http://json-schema.org/draft-07/schema#",Bs="https://github.com/borderux/recursica/tree/main/packages/adapter-tester/src/adapter-tester.schema.json",Ys="adapter-tester.config.json",Zs="Configuration for @recursica/adapter-tester. All fields are optional — an adapter repo with a normal `storybook` npm script needs no config file at all.",Qs="object",Xs=!1,xs={$schema:{type:"string",description:'Optional pointer to this schema for editor autocomplete, e.g. "./node_modules/@recursica/adapter-tester/src/adapter-tester.schema.json".'},name:{type:"string",description:`Label for this project's own target. Defaults to the unscoped name in this project's package.json (e.g. "@recursica/mui-adapter" -> "mui-adapter").`},storybook:{type:"object",additionalProperties:!1,description:"This project's own Storybook target.",properties:{port:{type:"integer",minimum:1,maximum:65535,description:"Port the target's Storybook is served on. Auto-detected from this project's own `scripts.storybook` (a `-p <port>`/`--port <port>` flag) when omitted, falling back to Storybook's own default of 6006."},command:{type:"string",description:"Command that boots the target's Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}},sourceOfTruth:{description:'The comparison target. Defaults to `{ "type": "mantine-harness" }`.',oneOf:[{type:"object",additionalProperties:!1,description:"Default mode: boots a throwaway harness that installs the published @recursica/mantine-adapter from npm — no monorepo checkout required.",properties:{type:{const:"mantine-harness"},port:{type:"integer",minimum:1,maximum:65535,description:"Port the throwaway harness's Storybook is served on. Defaults to 6011."},mantineAdapterVersion:{type:"string",description:"npm version/tag of @recursica/mantine-adapter to install in the harness. Defaults to `latest`."},storybookTemplateVersion:{type:"string",description:"npm version/tag of @recursica/storybook-template to install in the harness. Defaults to `latest`."}}},{type:"object",additionalProperties:!1,description:"Non-standard mode: points at an already-addressable Storybook — e.g. a sibling workspace package's own Storybook inside this monorepo.",required:["type","port"],properties:{type:{const:"url"},name:{type:"string",description:'Label for the source-of-truth target. Defaults to "Mantine".'},port:{type:"integer",minimum:1,maximum:65535,description:"Port the source-of-truth Storybook is served on."},command:{type:"string",description:"Command that boots the source-of-truth Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}}]},diffThresholdPixels:{type:"number",minimum:0,description:"Global visual diff threshold, in mismatched pixels, before a story is considered a failure. Defaults to 3500. AI agents must not modify this field — see AGENT.md."},relaxedThresholdStoryIds:{type:"array",items:{type:"string"},description:"Story id prefixes that use `relaxedThresholdPixels` instead of the global `diffThresholdPixels`."},relaxedThresholdPixels:{type:"number",minimum:0,description:"Diff threshold applied to stories matching `relaxedThresholdStoryIds`."},excludeTitlePrefixes:{type:"array",items:{type:"string"},description:"Storybook title prefixes to exclude from comparison, in addition to the built-in denylist (`Theme/*`, `Tokens/*`, `Introduction`)."}},ea={$schema:Ws,$id:Bs,title:Ys,description:Zs,type:Qs,additionalProperties:Xs,properties:xs},ta=Js,Rn=new Us.Ajv({allErrors:!0,strict:!0});ta(Rn);const yn=Rn.compile(ea);function ra(e,t){if(yn(e))return;const m=(yn.errors??[]).map(c=>{var s;const b=(s=c.params)!=null&&s.additionalProperty?` '${c.params.additionalProperty}'`:"";return` - ${c.instancePath||"root"} ${c.message}${b}`}).join(`
|
|
19
19
|
`);throw new Error(`Invalid ${t}:
|
|
20
|
-
${m}`)}const na="adapter-tester.config.json",gn="npm run storybook",sa=6006,aa=6011,_n="Mantine",oa=3500;function kn(e){const t=se.join(e,"package.json");if(!ge.existsSync(t))throw new Error(`No package.json found in ${e} — run adapter-tester from the root of the project being tested.`);return JSON.parse(ge.readFileSync(t,"utf8"))}function ia(e){var b;const m=(b=kn(e).scripts)==null?void 0:b.storybook,c=m==null?void 0:m.match(/(?:-p|--port)[ =](\d+)/);return c?Number(c[1]):sa}function ua(e){const m=kn(e).name;return m?m.split("/").pop():"Adapter"}function ca(e){const t=se.join(e,na);if(!ge.existsSync(t))return{};const m=JSON.parse(ge.readFileSync(t,"utf8"));return ra(m,t),m}function da(e){var v,y,g;const t=ca(e),m=t.name??ua(e),c=((v=t.storybook)==null?void 0:v.port)??ia(e),b=((y=t.storybook)==null?void 0:y.command)??gn,s=se.resolve(e,((g=t.storybook)==null?void 0:g.cwd)??"."),l=t.sourceOfTruth??{type:"mantine-harness"};let u,h,$;l.type==="url"?(u=l.name??_n,h=l.port,$={command:l.command??gn,port:l.port,cwd:se.resolve(e,l.cwd??"."),reuseExistingServer:!process.env.CI,timeout:120*1e3}):(u=_n,h=l.port??aa,$=qn.mantineSourceOfTruthWebServer({dir:se.join(e,".adapter-tester/mantine-harness"),port:h,mantineAdapterVersion:l.mantineAdapterVersion,storybookTemplateVersion:l.storybookTemplateVersion}));const _={targets:[{name:u,url:`http://localhost:${h}`,sourceOfTruth:!0},{name:m,url:`http://localhost:${c}`}],diffThresholdPixels:t.diffThresholdPixels??oa,relaxedThresholdStoryIds:t.relaxedThresholdStoryIds,relaxedThresholdPixels:t.relaxedThresholdPixels,excludeTitlePrefixes:t.excludeTitlePrefixes},P=[$,{command:b,port:c,cwd:s,reuseExistingServer:!process.env.CI,timeout:120*1e3}];return{engineConfig:_,webServers:P}}const la=se.dirname(Kt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("cli.cjs",document.baseURI).href)),fa=Kt.pathToFileURL(se.join(la,"testing.js")).href,Vt=process.cwd(),{engineConfig:Ft,webServers:Ut}=da(Vt);process.argv.includes("--dry-run")&&(console.log(JSON.stringify({engineConfig:Ft,webServers:Ut},null,2)),process.exit(0));process.argv.includes("--serve")?Dn(Ft,Ut):
|
|
20
|
+
${m}`)}const na="adapter-tester.config.json",gn="npm run storybook",sa=6006,aa=6011,_n="Mantine",oa=3500;function kn(e){const t=se.join(e,"package.json");if(!ge.existsSync(t))throw new Error(`No package.json found in ${e} — run adapter-tester from the root of the project being tested.`);return JSON.parse(ge.readFileSync(t,"utf8"))}function ia(e){var b;const m=(b=kn(e).scripts)==null?void 0:b.storybook,c=m==null?void 0:m.match(/(?:-p|--port)[ =](\d+)/);return c?Number(c[1]):sa}function ua(e){const m=kn(e).name;return m?m.split("/").pop():"Adapter"}function ca(e){const t=se.join(e,na);if(!ge.existsSync(t))return{};const m=JSON.parse(ge.readFileSync(t,"utf8"));return ra(m,t),m}function da(e){var v,y,g;const t=ca(e),m=t.name??ua(e),c=((v=t.storybook)==null?void 0:v.port)??ia(e),b=((y=t.storybook)==null?void 0:y.command)??gn,s=se.resolve(e,((g=t.storybook)==null?void 0:g.cwd)??"."),l=t.sourceOfTruth??{type:"mantine-harness"};let u,h,$;l.type==="url"?(u=l.name??_n,h=l.port,$={command:l.command??gn,port:l.port,cwd:se.resolve(e,l.cwd??"."),reuseExistingServer:!process.env.CI,timeout:120*1e3}):(u=_n,h=l.port??aa,$=qn.mantineSourceOfTruthWebServer({dir:se.join(e,".adapter-tester/mantine-harness"),port:h,mantineAdapterVersion:l.mantineAdapterVersion,storybookTemplateVersion:l.storybookTemplateVersion}));const _={targets:[{name:u,url:`http://localhost:${h}`,sourceOfTruth:!0},{name:m,url:`http://localhost:${c}`}],diffThresholdPixels:t.diffThresholdPixels??oa,relaxedThresholdStoryIds:t.relaxedThresholdStoryIds,relaxedThresholdPixels:t.relaxedThresholdPixels,excludeTitlePrefixes:t.excludeTitlePrefixes},P=[$,{command:b,port:c,cwd:s,reuseExistingServer:!process.env.CI,timeout:120*1e3}];return{engineConfig:_,webServers:P}}const la=se.dirname(Kt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("cli.cjs",document.baseURI).href)),fa=Kt.pathToFileURL(se.join(la,"testing.js")).href,Vt=process.cwd(),{engineConfig:Ft,webServers:Ut}=da(Vt);process.argv.includes("--dry-run")&&(console.log(JSON.stringify({engineConfig:Ft,webServers:Ut},null,2)),process.exit(0));const ha=new Set(["--dry-run","--serve"]),ma=process.argv.slice(2).filter(e=>!ha.has(e));process.argv.includes("--serve")?Dn(Ft,Ut):pa(Ut,Ft);function pa(e,t){const m=se.join(Vt,".adapter-tester/run");ge.mkdirSync(m,{recursive:!0}),ge.writeFileSync(se.join(m,"playwright.config.js"),`// Generated by \`adapter-tester\` — do not edit, regenerated on every run.
|
|
21
21
|
import { defineConfig, devices } from "@playwright/test";
|
|
22
22
|
|
|
23
23
|
export default defineConfig({
|
|
@@ -35,5 +35,5 @@ export default defineConfig({
|
|
|
35
35
|
import { runVisualRegression } from ${JSON.stringify(fa)};
|
|
36
36
|
|
|
37
37
|
await runVisualRegression(${JSON.stringify(t,null,2)});
|
|
38
|
-
`);const c=Lt.spawnSync("npx",["playwright","test","--config",se.join(m,"playwright.config.js")],{stdio:"inherit",cwd:Vt,shell:process.platform==="win32"});process.exit(c.status??1)}
|
|
38
|
+
`);const c=Lt.spawnSync("npx",["playwright","test","--config",se.join(m,"playwright.config.js"),...ma],{stdio:"inherit",cwd:Vt,shell:process.platform==="win32"});process.exit(c.status??1)}
|
|
39
39
|
//# sourceMappingURL=cli.cjs.map
|