@ikas/storefront-next 4.0.22 → 4.0.24
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/build/api/getTheme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as s}from'./../ext/tslib/tslib.es6.js';import{corsMiddleware as t}from"./middleware.js";import"../packages/cmd/build/scripts/generators/api/index.js";import"../packages/cmd/build/scripts/generators/components/index.js";import"path";import"fs";import"../packages/cmd/build/scripts/generators/pages/index.js";import{ThemeJsonGenerator as r}from"../packages/cmd/build/scripts/generators/theme/index.js";import"../packages/cmd/build/scripts/generators/types/index.js";import"lodash/cloneDeep";var o=function(o,i){return e(void 0,void 0,void 0,(function(){var e,n;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,t(o,i)];case 1:return s.sent(),[4,r.getTheme()];case 2:return e=s.sent(),i.statusCode=200,i.setHeader("Content-Type","application/json"),i.json({theme:e||{}}),[3,4];case 3:return n=s.sent(),console.error(n),i.statusCode=500,i.send(n),[3,4];case 4:return[2]}}))}))},i={};export{i as config,o as getTheme};
|
|
1
|
+
import{__awaiter as e,__generator as s}from'./../ext/tslib/tslib.es6.js';import{corsMiddleware as t}from"./middleware.js";import"../packages/cmd/build/scripts/generators/api/index.js";import"../packages/cmd/build/scripts/generators/components/index.js";import"path";import"fs";import"../packages/cmd/build/scripts/generators/pages/index.js";import{ThemeJsonGenerator as r}from"../packages/cmd/build/scripts/generators/theme/index.js";import"../packages/cmd/build/scripts/generators/types/index.js";import"lodash/cloneDeep";import"lodash/uniq";var o=function(o,i){return e(void 0,void 0,void 0,(function(){var e,n;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,t(o,i)];case 1:return s.sent(),[4,r.getTheme()];case 2:return e=s.sent(),i.statusCode=200,i.setHeader("Content-Type","application/json"),i.json({theme:e||{}}),[3,4];case 3:return n=s.sent(),console.error(n),i.statusCode=500,i.send(n),[3,4];case 4:return[2]}}))}))},i={};export{i as config,o as getTheme};
|
package/build/api/updateTheme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from'./../ext/tslib/tslib.es6.js';import{corsMiddleware as t}from"./middleware.js";import{APIGenerator as s}from"../packages/cmd/build/scripts/generators/api/index.js";import{ComponentImportsGenerator as a}from"../packages/cmd/build/scripts/generators/components/index.js";import"path";import"fs";import{PageGenerator as n}from"../packages/cmd/build/scripts/generators/pages/index.js";import{ThemeJsonGenerator as o}from"../packages/cmd/build/scripts/generators/theme/index.js";import{CustomDataTypesGenerator as i}from"../packages/cmd/build/scripts/generators/types/index.js";import"lodash/cloneDeep";var p=function(p,m){return e(void 0,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,t(p,m)];case 1:return r.sent(),e=p.body,[4,o.generate(e)];case 2:return r.sent(),[4,a.generate(e)];case 3:return r.sent(),[4,n.generate()];case 4:return r.sent(),[4,s.generate()];case 5:return r.sent(),[4,i.generate(e)];case 6:return r.sent(),m.statusCode=200,m.setHeader("Content-Type","application/json"),m.end(),[2]}}))}))},m={api:{bodyParser:{sizeLimit:"50mb"}}};export{m as config,p as updateTheme};
|
|
1
|
+
import{__awaiter as e,__generator as r}from'./../ext/tslib/tslib.es6.js';import{corsMiddleware as t}from"./middleware.js";import{APIGenerator as s}from"../packages/cmd/build/scripts/generators/api/index.js";import{ComponentImportsGenerator as a}from"../packages/cmd/build/scripts/generators/components/index.js";import"path";import"fs";import{PageGenerator as n}from"../packages/cmd/build/scripts/generators/pages/index.js";import{ThemeJsonGenerator as o}from"../packages/cmd/build/scripts/generators/theme/index.js";import{CustomDataTypesGenerator as i}from"../packages/cmd/build/scripts/generators/types/index.js";import"lodash/cloneDeep";import"lodash/uniq";var p=function(p,m){return e(void 0,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,t(p,m)];case 1:return r.sent(),e=p.body,[4,o.generate(e)];case 2:return r.sent(),[4,a.generate(e)];case 3:return r.sent(),[4,n.generate()];case 4:return r.sent(),[4,s.generate()];case 5:return r.sent(),[4,i.generate(e)];case 6:return r.sent(),m.statusCode=200,m.setHeader("Content-Type","application/json"),m.end(),[2]}}))}))},m={api:{bodyParser:{sizeLimit:"50mb"}}};export{m as config,p as updateTheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import{IkasThemeJsonComponentPropType as a}from"@ikas/storefront-models";import s from"path";import{createFile as r,deleteDirContent as n}from"../../../utils/fs.js";import o from"lodash/uniq";var c=function(){function c(){}return c.generate=function(a,p){return e(this,void 0,void 0,(function(){var e,u,k,m,
|
|
1
|
+
import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.js";import{IkasThemeJsonComponentPropType as a}from"@ikas/storefront-models";import s from"path";import{createFile as r,deleteDirContent as n}from"../../../utils/fs.js";import o from"lodash/uniq";var c=function(){function c(){}return c.generate=function(a,p){return e(this,void 0,void 0,(function(){var e,u,I,k,m,T,L;return t(this,(function(t){switch(t.label){case 0:return[4,n(s.join(p||process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),a.customData.forEach((function(t){c.generateAllCustomDataTypes(t,e,a)})),u=0,I=0;do{u=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){c.generateAllCustomDataTypes(t,e,a)})),(I=e.internalCustomDatas.length)!==u&&(e.internalCustomDatas=e.internalCustomDatas.splice(u,I))}while(u!==I);return[4,i.generate(a,e)];case 3:return t.sent(),k=s.join(p||process.cwd(),"src","components","__generated__"),e.imports=o(e.imports),m="import {\r\n",e.imports.forEach((function(e){m+="\t".concat(e,",\r\n")})),T=(m+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,r(k,"types.ts",T)];case 4:return[2,t.sent()];case 5:return L=t.sent(),console.log(L),[2,!1];case 6:return[2]}}))}))},c.generateAllCustomDataTypes=function(e,t,s){var r=e.type===a.ENUM,n="export ".concat(r?"enum":"type"," ").concat(c.generateTypeName(e)).concat(r?"":" = ","{ \r\n"),o="};\r\n\r\n";e.type!==a.DYNAMIC_LIST&&e.type!==a.STATIC_LIST||!e.nestedData?e.type===a.ENUM&&e.enumOptions?(t.content+=n,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=o):(t.content+=n,e.nestedData&&e.nestedData.forEach((function(e){c.genenateCustomDataType(e,t,s),t.content+="\r\n"})),t.content+=o):c.generateAllCustomDataTypes(e.nestedData[0],t,s)},c.genenateCustomDataType=function(e,t,s){var r=c.getType(e,t,s);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(r).concat([a.DYNAMIC_LIST,a.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===a.ENUM?",":";")},c.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",t.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",t.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",t.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",t.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",t.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",t.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList",t.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",t.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",t.imports.push(r);break;case a.CATEGORY:r="IkasCategory",t.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",t.imports.push(r);break;case a.CUSTOM:var n=s.customData.find((function(t){return t.id===e.customDataId}));n&&(r=c.generateTypeName(n));break;case a.COMPONENT:r="IkasComponentRenderer",t.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",t.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",t.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",t.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",t.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",t.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",t.imports.push(r);break;case a.SLIDER:r="IkasSlider",t.imports.push(r);break;case a.ENUM:case a.OBJECT:r=c.generateTypeName(e),t.content.includes("export enum ".concat(r))||t.internalCustomDatas.push(e);break;case a.DYNAMIC_LIST:case a.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===a.OBJECT||e.nestedData[0].type===a.ENUM?(r=c.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(r))||t.internalCustomDatas.push(e.nestedData[0])):r=c.getType(e.nestedData[0],t,s))}return r},c.generateTypeName=function(e){if(e.typescriptName)return e.typescriptName;var t=e.name||"";return(t=(t=t.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(t="_"+t),e.type===a.ENUM&&(t+="Enum"),t},c}(),i=function(){function s(){}return s.generate=function(a,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return a.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(r.content+="export type ".concat(s.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){r.content+="\t".concat(e.name).concat(e.isRequired?"":"?",": ").concat(s.getType(e,a,r),";\n")})),r.content+="};\r\n\r\n")})),[2]}))}))},s.getType=function(e,t,s){var r="";switch(e.type){case a.TEXT:case a.RICH_TEXT:case a.COLOR:r="string";break;case a.BOOLEAN:r="boolean";break;case a.IMAGE:r="IkasImage",s.imports.push(r);break;case a.IMAGE_LIST:r="IkasImage[]",s.imports.push("IkasImage");break;case a.LINK:r="IkasNavigationLink",s.imports.push(r);break;case a.LIST_OF_LINK:r="IkasNavigationLink[]",s.imports.push("IkasNavigationLink");break;case a.PRODUCT_DETAIL:r="IkasProduct",s.imports.push(r);break;case a.PRODUCT_LIST:r="IkasProductList",s.imports.push("IkasProductList");break;case a.PRODUCT_ATTRIBUTE:r="IkasAttributeDetail",s.imports.push(r);break;case a.PRODUCT_ATTRIBUTE_LIST:r="IkasAttributeList[]",s.imports.push("IkasAttributeList");break;case a.BRAND:r="IkasBrand",s.imports.push(r);break;case a.BRAND_LIST:r="IkasBrandList",s.imports.push(r);break;case a.CATEGORY:r="IkasCategory",s.imports.push(r);break;case a.CATEGORY_LIST:r="IkasCategoryList",s.imports.push(r);break;case a.CUSTOM:var n=t.customData.find((function(t){return t.id===e.customDataId}));n&&(r=c.getType(n,s,t),n.type!==a.DYNAMIC_LIST&&n.type!==a.STATIC_LIST||(r+="[]"));break;case a.COMPONENT:r="IkasComponentRenderer",s.imports.push(r);break;case a.COMPONENT_LIST:r="IkasComponentRenderer[]",s.imports.push("IkasComponentRenderer");break;case a.BLOG:r="IkasBlog",s.imports.push(r);break;case a.BLOG_LIST:r="IkasBlogList",s.imports.push(r);break;case a.BLOG_CATEGORY:r="IkasBlogCategory",s.imports.push(r);break;case a.BLOG_CATEGORY_LIST:r="IkasBlogCategoryList",s.imports.push(r);break;case a.RAFFLE:r="IkasRaffle",s.imports.push(r);break;case a.RAFFLE_LIST:r="IkasRaffleList",s.imports.push(r);break;case a.SLIDER:r="IkasSlider",s.imports.push(r)}return r},s.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},s}();export{c as CustomDataTypesGenerator,i as PropTypeGenarator};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-next",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.24",
|
|
4
4
|
"description": "Next.js specific functions for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"next": "12.2.0",
|
|
20
|
-
"@ikas/storefront-config": "^4.0.
|
|
21
|
-
"@ikas/storefront-providers": "^4.0.
|
|
22
|
-
"@ikas/storefront-models": "^4.0.
|
|
23
|
-
"@ikas/storefront-api": "^4.0.
|
|
24
|
-
"@ikas/storefront-assets": "^4.0.
|
|
20
|
+
"@ikas/storefront-config": "^4.0.24",
|
|
21
|
+
"@ikas/storefront-providers": "^4.0.24",
|
|
22
|
+
"@ikas/storefront-models": "^4.0.24",
|
|
23
|
+
"@ikas/storefront-api": "^4.0.24",
|
|
24
|
+
"@ikas/storefront-assets": "^4.0.24",
|
|
25
25
|
"axios": "^0.21.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"archiver": "^5.3.0",
|
|
28
28
|
"cors": "^2.8.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@ikas/storefront-cmd": "^4.0.
|
|
32
|
-
"@ikas/storefront-config": "^4.0.
|
|
33
|
-
"@ikas/storefront-providers": "^4.0.
|
|
34
|
-
"@ikas/storefront-models": "^4.0.
|
|
35
|
-
"@ikas/storefront-api": "^4.0.
|
|
36
|
-
"@ikas/storefront-assets": "^4.0.
|
|
31
|
+
"@ikas/storefront-cmd": "^4.0.24",
|
|
32
|
+
"@ikas/storefront-config": "^4.0.24",
|
|
33
|
+
"@ikas/storefront-providers": "^4.0.24",
|
|
34
|
+
"@ikas/storefront-models": "^4.0.24",
|
|
35
|
+
"@ikas/storefront-api": "^4.0.24",
|
|
36
|
+
"@ikas/storefront-assets": "^4.0.24",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
38
38
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
39
39
|
"@rollup/plugin-json": "^4.1.0",
|