@spiffcommerce/theme-bridge 1.27.1-alpha.0 → 1.27.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +2 -2
package/dist/plugin.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./configurationTypes-Bt8NVGKp.cjs"),m=require("fs"),y=require("path"),S="1.27.1-alpha.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./configurationTypes-Bt8NVGKp.cjs"),m=require("fs"),y=require("path"),S="1.27.1-alpha.2",b={version:S};function v(r,s,n){return s.type==="chunk"?(console.log(`chunk ${r} isEntry: ${s.isEntry}, isDynamicEntry: ${s.isDynamicEntry}, isImplicitEntry: ${s.isImplicitEntry}`),!s.isEntry&&!n?null:{type:l.ThemeFileType.Javascript,mimeType:"text/javascript",preload:!s.isEntry,filename:r}):r.endsWith(".css")?{type:l.ThemeFileType.CSS,mimeType:"text/css",filename:r}:null}function E(r){const{autoGenerateTargetFiles:s=!0,configurationSchema:n,pageSettings:e,includePreloadChunks:i=!1,targetFiles:t}=r??{};return{name:"spiff-theme-plugin",version:b.version,config(a,o){a.base!==void 0&&a.base!==""&&console.warn('You have specified a `base` in your vite configuration other than "". This value will now be overwritten.'),a.base=""},writeBundle(a,o){if(n&&e){const c=T(n,e);if(c.hasErrors)throw new Error(`Theme pages validation failed: ${JSON.stringify(c)}`)}const u=s?Object.keys(o).map(c=>t?.some(d=>d.filename===c)?null:v(c,o[c],i)).filter(c=>c!==null):[];t&&u.push(...t);const p={launchData:{targetFiles:u},configurationSchema:n,pageSettings:e};m.writeFileSync(y.join(a.dir,"spiffTheme.json"),JSON.stringify(p,void 0,4))}}}function T(r,s){const n=new Map(r.customSchemas?.map(t=>[t.name,t])??[]),e={pages:s.items.map(t=>({sections:t.sections.map(()=>({}))})),hasErrors:!1},i=new Map(s.items.map(t=>[t.key,t]));s.reorderablePageSettings&&(s.reorderablePageSettings.start?i.get(s.reorderablePageSettings.start)||(e.errors=f(e.errors,"reorderablePageSettings.start references page which does not exist"),e.hasErrors=!0):(e.errors=f(e.errors,"reorderablePageSettings.start is not set"),e.hasErrors=!0),s.reorderablePageSettings.end?i.get(s.reorderablePageSettings.end)||(e.errors=f(e.errors,"reorderablePageSettings.end references page which does not exist"),e.hasErrors=!0):(e.errors=f(e.errors,"reorderablePageSettings.end is not set"),e.hasErrors=!0));for(let t=0;t<s.items.length;t++){const a=s.items[t];a.key||(e.pages[t].pageErrors=f(e.pages[t].pageErrors,"missing key"),e.hasErrors=!0);for(let o=0;o<a.sections.length;o++){const u=a.sections[o];for(const p of u.fields){const c=w(r.fields,p,n);typeof c=="string"&&(e.pages[t].sections[o].errors=f(e.pages[t].sections[o].errors,c),e.hasErrors=!0)}}}return e}function f(r,s){return[...r??[],s]}function w(r,s,n){const e=s.split(".");let i;const t=[];for(const a of e)if(t.push(a),i){const o=$(i,a,n);if(typeof o=="string")return`error at path ${t.join(".")}: ${o}`;i=o}else{const o=h(r,a);if(!o)return`unknown root field ${a}`;i=o}return i||"provided path was empty"}function $(r,s,n){if(r.type===l.FieldType.Heading)return`heading field ${r.title} is not a type which has nested properties`;if(r.type!==l.FieldType.Object)return`field ${r.key}, of type ${r.type}, is not a type which has nested properties`;let e=[];if(r.schema){const t=g(r.schema,n);if(typeof t=="string")return`object field ${r.key} has schema errors: ${t}`}else{if(r.schema!==void 0)return`object field ${r.key} references schema via empty string`;e=r.fields}const i=h(e,s);return i||`object field ${r.key} has no property ${s}`}function h(r,s){return r.find(n=>n.type!==l.FieldType.Heading&&n.key===s)}function g(r,s){const n=s.get(r);if(!n)return`unknown schema ${r}`;let e=[];if(n.type===l.CustomSchemaType.Union)for(const i of n.schemas){const t=g(i,s);if(typeof t=="string")return t;e=[...e,...t]}else{if(n.extends)for(const i of n.extends){const t=g(i,s);if(typeof t=="string")return t;e=[...e,...t]}e=[...e,...n.fields]}return e}exports.spiffThemePlugin=E;
|
|
2
2
|
//# sourceMappingURL=plugin.cjs.map
|
package/dist/plugin.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/theme-bridge",
|
|
3
|
-
"version": "1.27.1-alpha.
|
|
3
|
+
"version": "1.27.1-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "SpiffCommerce",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@spiffcommerce/core": "^44.
|
|
36
|
+
"@spiffcommerce/core": "^44.13.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@repo/core": "*"
|