@ikas/storefront 2.0.0-alpha.19 → 2.0.0-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.
Files changed (180) hide show
  1. package/build/__generated__/global-types.d.ts +2 -10
  2. package/build/__generated__/global-types.js +1 -1
  3. package/build/_virtual/index.js_commonjs-proxy2.js +1 -1
  4. package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
  5. package/build/analytics/facebookPixel.js +1 -1
  6. package/build/analytics/googleTagManager.js +1 -1
  7. package/build/analytics/head/index.js +1 -1
  8. package/build/analytics/ikas.js +1 -1
  9. package/build/api/apollo.js +1 -1
  10. package/build/api/blog/__generated__/getBlog.d.ts +16 -14
  11. package/build/api/blog/__generated__/listBlog.d.ts +16 -14
  12. package/build/api/blog/__generated__/listBlogCategory.d.ts +16 -14
  13. package/build/api/blog/__generated__/listBlogMetaData.d.ts +16 -14
  14. package/build/api/brand/__generated__/listProductBrand.d.ts +3 -3
  15. package/build/api/cart/__generated__/getCart.d.ts +4 -2
  16. package/build/api/cart/__generated__/saveItemToCart.d.ts +4 -2
  17. package/build/api/category/__generated__/listCategory.d.ts +3 -3
  18. package/build/api/checkout/__generated__/getCheckoutById.d.ts +4 -2
  19. package/build/api/checkout/__generated__/getOrder.d.ts +11 -5
  20. package/build/api/checkout/__generated__/listCheckoutSettings.d.ts +1 -1
  21. package/build/api/checkout/index.js +1 -1
  22. package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +11 -5
  23. package/build/api/customer/__generated__/customerLogin.d.ts +5 -12
  24. package/build/api/customer/__generated__/getCustomerOrders.d.ts +11 -5
  25. package/build/api/customer/__generated__/getMyCustomer.d.ts +5 -4
  26. package/build/api/customer/__generated__/registerCustomer.d.ts +5 -12
  27. package/build/api/customer/__generated__/saveMyCustomer.d.ts +5 -12
  28. package/build/api/customer/index.d.ts +0 -5
  29. package/build/api/customer/index.js +1 -1
  30. package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +16 -14
  31. package/build/api/product-option-set/index.js +1 -1
  32. package/build/api/raffle/__generated__/getRafflesByCustomerId.d.ts +0 -3
  33. package/build/api/raffle/__generated__/listRaffle.d.ts +16 -14
  34. package/build/api/raffle/__generated__/saveRaffleParticipant.d.ts +2 -2
  35. package/build/api/raffle/index.d.ts +1 -1
  36. package/build/api/raffle/index.js +1 -1
  37. package/build/api/variant-type/__generated__/listVariantType.d.ts +7 -3
  38. package/build/components/checkout/components/address-form/index.js +1 -1
  39. package/build/components/checkout/components/address-form/model.d.ts +0 -8
  40. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  41. package/build/components/checkout/components/cart-summary/index.js +1 -1
  42. package/build/components/checkout/components/step-container/index.js +1 -1
  43. package/build/components/checkout/index.js +1 -1
  44. package/build/components/checkout/model.d.ts +0 -2
  45. package/build/components/checkout/model.js +1 -1
  46. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  47. package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.js +1 -1
  48. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  49. package/build/components/checkout/steps/step-success/index.js +1 -1
  50. package/build/components/index.d.ts +1 -1
  51. package/build/components/page/ThemeComponent.js +1 -1
  52. package/build/components/page/head.js +1 -1
  53. package/build/components/page/index.js +1 -1
  54. package/build/components/page-editor/ThemeComponentEditor.d.ts +3 -0
  55. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  56. package/build/components/page-editor/index.d.ts +1 -3
  57. package/build/components/page-editor/index.js +1 -1
  58. package/build/components/page-editor/loader/index.d.ts +1 -5
  59. package/build/components/page-editor/loader/index.js +1 -1
  60. package/build/components/page-editor/loader/style.module.scss.js +1 -1
  61. package/build/components/page-editor/model.d.ts +4 -5
  62. package/build/components/page-editor/model.js +1 -1
  63. package/build/ext/@apollo/client/cache/inmemory/entityStore.js +1 -1
  64. package/build/ext/@apollo/client/cache/inmemory/inMemoryCache.js +1 -1
  65. package/build/ext/@apollo/client/cache/inmemory/policies.js +1 -1
  66. package/build/ext/@apollo/client/cache/inmemory/readFromStore.js +1 -1
  67. package/build/ext/@apollo/client/cache/inmemory/writeToStore.js +1 -1
  68. package/build/ext/@apollo/client/core/ApolloClient.js +1 -1
  69. package/build/ext/@apollo/client/core/LocalState.js +1 -1
  70. package/build/ext/@apollo/client/core/ObservableQuery.js +1 -1
  71. package/build/ext/@apollo/client/core/QueryManager.js +1 -1
  72. package/build/ext/@apollo/client/errors/index.js +1 -1
  73. package/build/ext/@apollo/client/link/context/index.js +1 -1
  74. package/build/ext/@apollo/client/link/core/ApolloLink.js +1 -1
  75. package/build/ext/@apollo/client/link/error/index.js +1 -1
  76. package/build/ext/@apollo/client/link/http/HttpLink.js +1 -1
  77. package/build/ext/@apollo/client/link/http/createHttpLink.js +1 -1
  78. package/build/ext/@apollo/client/link/http/selectHttpOptionsAndBody.js +1 -1
  79. package/build/ext/@apollo/client/link/utils/createOperation.js +1 -1
  80. package/build/ext/@apollo/client/utilities/common/mergeDeep.js +1 -1
  81. package/build/ext/@apollo/client/utilities/graphql/fragments.js +1 -1
  82. package/build/ext/@apollo/client/utilities/graphql/transform.js +1 -1
  83. package/build/ext/@apollo/client/utilities/observables/Concast.js +1 -1
  84. package/build/ext/ts-invariant/lib/invariant.esm.js +1 -1
  85. package/build/ext/tslib/tslib.es6.js +1 -1
  86. package/build/ikas.js +2 -67
  87. package/build/index.d.ts +0 -1
  88. package/build/index.js +1 -1
  89. package/build/models/data/blog/index.js +1 -1
  90. package/build/models/data/brand/index.js +1 -1
  91. package/build/models/data/category/index.js +1 -1
  92. package/build/models/data/checkout/index.js +1 -1
  93. package/build/models/data/checkout-settings/index.d.ts +1 -1
  94. package/build/models/data/checkout-settings/index.js +1 -1
  95. package/build/models/data/customer/address/index.d.ts +1 -4
  96. package/build/models/data/customer/address/index.js +1 -1
  97. package/build/models/data/image/index.js +1 -1
  98. package/build/models/data/index.d.ts +0 -1
  99. package/build/models/data/order/address/index.d.ts +1 -2
  100. package/build/models/data/order/address/index.js +1 -1
  101. package/build/models/data/order/index.js +1 -1
  102. package/build/models/data/order/line-item/variant/index.js +1 -1
  103. package/build/models/data/product/index.js +1 -1
  104. package/build/models/data/product-filter/index.js +1 -1
  105. package/build/models/data/product-option-set/index.d.ts +0 -4
  106. package/build/models/data/product-option-set/index.js +1 -1
  107. package/build/models/data/raffle/index.d.ts +1 -2
  108. package/build/models/data/raffle/index.js +1 -1
  109. package/build/models/theme/component/index.d.ts +0 -9
  110. package/build/models/theme/component/index.js +1 -1
  111. package/build/models/theme/component/prop/index.d.ts +0 -21
  112. package/build/models/theme/component/prop/index.js +1 -1
  113. package/build/models/theme/custom-data/index.d.ts +1 -20
  114. package/build/models/theme/custom-data/index.js +1 -1
  115. package/build/models/theme/settings/index.d.ts +2 -4
  116. package/build/models/theme/settings/index.js +1 -1
  117. package/build/models/theme/settings/prop/color/index.d.ts +7 -0
  118. package/build/models/theme/settings/prop/color/index.js +1 -0
  119. package/build/models/theme/settings/{favicon → prop/favicon}/index.d.ts +0 -0
  120. package/build/models/theme/settings/{favicon → prop/favicon}/index.js +0 -0
  121. package/build/models/ui/product-detail/index.js +1 -1
  122. package/build/models/ui/product-list/index.d.ts +1 -1
  123. package/build/models/ui/product-list/index.js +1 -1
  124. package/build/models/ui/validator/form/account-info.js +1 -1
  125. package/build/models/ui/validator/form/address.js +1 -1
  126. package/build/models/ui/validator/form/register.js +1 -1
  127. package/build/pages/checkout.js +1 -1
  128. package/build/pages/editor.d.ts +3 -4
  129. package/build/pages/editor.js +1 -1
  130. package/build/providers/page-data-get.js +1 -1
  131. package/build/providers/page-data-init.d.ts +1 -3
  132. package/build/providers/page-data-init.js +1 -1
  133. package/build/providers/page-data-next.d.ts +1 -2
  134. package/build/providers/page-data-next.js +1 -1
  135. package/build/providers/prop-value/custom.d.ts +0 -1
  136. package/build/providers/prop-value/custom.js +1 -1
  137. package/build/scripts/generators/api/index.d.ts +3 -3
  138. package/build/scripts/generators/api/info.d.ts +4 -4
  139. package/build/scripts/generators/components/index.d.ts +4 -4
  140. package/build/scripts/generators/config/content.d.ts +3 -4
  141. package/build/scripts/generators/config/index.d.ts +6 -6
  142. package/build/scripts/generators/pages/index.d.ts +4 -4
  143. package/build/scripts/generators/store/index.d.ts +2 -2
  144. package/build/scripts/generators/theme/index.d.ts +4 -4
  145. package/build/store/cart.d.ts +7 -6
  146. package/build/store/cart.js +1 -1
  147. package/build/store/customer.d.ts +0 -19
  148. package/build/store/customer.js +1 -1
  149. package/build/storefront/index.d.ts +3 -5
  150. package/build/storefront/index.js +1 -1
  151. package/build/utils/fs.d.ts +2 -2
  152. package/package.json +7 -8
  153. package/build/api/customer/__generated__/customerSocialLogin.d.ts +0 -161
  154. package/build/ext/@apollo/client/ext/tslib/tslib.es6.js +0 -15
  155. package/build/ext/ts-invariant/ext/tslib/tslib.es6.js +0 -15
  156. package/build/models/data/language/index.d.ts +0 -6
  157. package/build/models/data/slider/index.d.ts +0 -5
  158. package/build/models/data/slider/index.js +0 -1
  159. package/build/models/theme/settings/color/index.d.ts +0 -14
  160. package/build/models/theme/settings/color/index.js +0 -1
  161. package/build/models/theme/settings/font-family/index.d.ts +0 -5
  162. package/build/models/theme/settings/font-family/index.js +0 -1
  163. package/build/providers/prop-value/slider.d.ts +0 -11
  164. package/build/providers/prop-value/slider.js +0 -1
  165. package/build/scripts/generators/api/index.js +0 -1
  166. package/build/scripts/generators/api/info.js +0 -1
  167. package/build/scripts/generators/components/index.js +0 -1
  168. package/build/scripts/generators/config/content.js +0 -1
  169. package/build/scripts/generators/config/index.js +0 -1
  170. package/build/scripts/generators/index.d.ts +0 -7
  171. package/build/scripts/generators/pages/index.js +0 -1
  172. package/build/scripts/generators/pages/info.js +0 -1
  173. package/build/scripts/generators/store/content.js +0 -1
  174. package/build/scripts/generators/store/index.js +0 -1
  175. package/build/scripts/generators/theme/index.js +0 -1
  176. package/build/scripts/generators/types/index.d.ts +0 -15
  177. package/build/scripts/generators/types/index.js +0 -1
  178. package/build/utils/fs.js +0 -1
  179. package/build/utils/google-fonts.d.ts +0 -2
  180. package/build/utils/google-fonts.js +0 -1
@@ -1 +1 @@
1
- var t=function(){function t(){}return t.init=function(n,r,o){t.store=n,t.config=r,t.apiUrlOverride=o||null,"local"===process.env.NEXT_PUBLIC_ENV&&(this.storefrontId=r.storefrontId)},t.initWithJson=function(n,r){try{Object.entries(n).forEach((function(n){var r=n[0],o=n[1];t[r]=o})),t.router=r}catch(t){console.log(t)}},t.getCurrentLocale=function(){var n;return(null===(n=t.routings.find((function(n){return n.id===t.storefrontRoutingId})))||void 0===n?void 0:n.locale)||"en"},t.getJson=function(){return{domain:t.domain,storefrontId:t.storefrontId||null,storefrontRoutingId:t.storefrontRoutingId||null,storefrontThemeId:t.storefrontThemeId||null,salesChannelId:t.salesChannelId||null,priceListId:t.priceListId||null,stockLocationIds:t.stockLocationIds||null,routings:JSON.parse(JSON.stringify(t.routings))||null,paymentGateways:JSON.parse(JSON.stringify(t.paymentGateways))||null,gtmId:t.gtmId||null,fbpId:t.fbpId||null,favicon:JSON.parse(JSON.stringify(t.favicon)),stockPreference:t.stockPreference||null,storefrontJSScripts:t.storefrontJSScripts||[],translations:this.translations,customerReviewSettings:t.customerReviewSettings,productBackInStockSettings:t.productBackInStockSettings?JSON.parse(JSON.stringify(t.productBackInStockSettings)):null}},t.config={},t.apiUrlOverride=null,t.routings=[],t.paymentGateways=[],t.translations={},t.storefrontJSScripts=[],t.isEditor=!1,t}();export{t as IkasStorefrontConfig};
1
+ var t=function(){function t(){}return t.init=function(n,o,r){t.store=n,t.config=o,t.apiUrlOverride=r||null,"local"===process.env.NEXT_PUBLIC_ENV&&(this.storefrontId=o.storefrontId)},t.initWithJson=function(n){try{Object.entries(n).forEach((function(n){var o=n[0],r=n[1];t[o]=r}))}catch(t){console.log(t)}},t.getCurrentLocale=function(){var n;return(null===(n=t.routings.find((function(n){return n.id===t.storefrontRoutingId})))||void 0===n?void 0:n.locale)||"en"},t.getJson=function(){return{domain:t.domain,storefrontId:t.storefrontId||null,storefrontRoutingId:t.storefrontRoutingId||null,storefrontThemeId:t.storefrontThemeId||null,salesChannelId:t.salesChannelId||null,priceListId:t.priceListId||null,stockLocationIds:t.stockLocationIds||null,routings:JSON.parse(JSON.stringify(t.routings))||null,paymentGateways:JSON.parse(JSON.stringify(t.paymentGateways))||null,gtmId:t.gtmId||null,fbpId:t.fbpId||null,favicon:JSON.parse(JSON.stringify(t.favicon)),stockPreference:t.stockPreference||null,storefrontJSScripts:t.storefrontJSScripts||[],translations:this.translations,customerReviewSettings:t.customerReviewSettings,productBackInStockSettings:t.productBackInStockSettings?JSON.parse(JSON.stringify(t.productBackInStockSettings)):null}},t.config={},t.apiUrlOverride=null,t.routings=[],t.paymentGateways=[],t.translations={},t.storefrontJSScripts=[],t.isEditor=!1,t}();export{t as IkasStorefrontConfig};
@@ -16,7 +16,7 @@ export declare function getFilePathParts(path: string): {
16
16
  *
17
17
  * @returns true for successfull operation, false otherwise
18
18
  */
19
- export declare function deleteDirContent(dirPath: string, ignoreFiles?: string[]): Promise<boolean>;
19
+ export declare function deleteDirContent(dirPath: string, ignoreFiles?: string[]): boolean;
20
20
  /**
21
21
  * Creates the given file and directories for the filePath
22
22
  * @param basePath Base directory path for the file
@@ -25,4 +25,4 @@ export declare function deleteDirContent(dirPath: string, ignoreFiles?: string[]
25
25
  *
26
26
  * @returns true for successfull operation, false otherwise
27
27
  */
28
- export declare function createFile(basePath: string, fileSubPath: string, fileStr: string): Promise<boolean>;
28
+ export declare function createFile(basePath: string, fileSubPath: string, fileStr: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "2.0.0-alpha.19",
3
+ "version": "2.0.0-alpha.2",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.js",
6
6
  "author": "Umut Ozan Yıldırım",
@@ -23,7 +23,7 @@
23
23
  "peerDependencies": {
24
24
  "mobx": "^6.1.3",
25
25
  "mobx-react-lite": "^3.1.5",
26
- "next": "12.0.7",
26
+ "next": "12.0.4",
27
27
  "react": "17.0.2",
28
28
  "react-dom": "17.0.2"
29
29
  },
@@ -34,6 +34,7 @@
34
34
  "axios": "^0.21.0",
35
35
  "command-line-args": "^5.2.0",
36
36
  "cors": "^2.8.5",
37
+ "fs-extra": "^10.0.0",
37
38
  "graphql": "^15.3.0",
38
39
  "graphql-tag": "^2.10.3",
39
40
  "html-react-parser": "^1.4.0",
@@ -53,6 +54,7 @@
53
54
  "@types/archiver": "^5.1.0",
54
55
  "@types/command-line-args": "^5.2.0",
55
56
  "@types/cors": "^2.8.9",
57
+ "@types/fs-extra": "^9.0.13",
56
58
  "@types/jest": "^26.0.14",
57
59
  "@types/lodash": "^4.14.168",
58
60
  "@types/node": "^14.14.6",
@@ -74,7 +76,7 @@
74
76
  "jest": "^26.4.2",
75
77
  "mobx": "^6.1.3",
76
78
  "mobx-react-lite": "^3.1.5",
77
- "next": "12.0.7",
79
+ "next": "11.1.2",
78
80
  "postcss": "^8.4.4",
79
81
  "prettier": "^2.2.1",
80
82
  "react": "17.0.2",
@@ -88,15 +90,12 @@
88
90
  "rollup-plugin-rename-node-modules": "^1.2.0",
89
91
  "rollup-plugin-terser": "^7.0.2",
90
92
  "rollup-plugin-typescript": "^1.0.1",
91
- "rollup-plugin-typescript2": "^0.31.1",
93
+ "rollup-plugin-typescript2": "^0.29.0",
92
94
  "sass": "^1.44.0",
93
- "rollup-watch": "^4.3.1",
94
95
  "ts-essentials": "^7.0.1",
95
96
  "ts-jest": "^26.4.0",
96
- "ts-loader": "^8.0.4",
97
- "tslib": "^2.3.1",
98
97
  "ttypescript": "^1.5.12",
99
- "typescript": "^4.5.4",
98
+ "typescript": "^4.1.3",
100
99
  "typescript-transform-paths": "^2.2.2",
101
100
  "typings": "^2.1.1"
102
101
  },
@@ -1,161 +0,0 @@
1
- import { CustomerAccountStatusEnum, CustomerEmailSubscriptionStatusesEnum } from "./../../../__generated__/global-types";
2
- export interface customerSocialLogin_customerSocialLogin_customer_addresses_city {
3
- __typename: "CustomerAddressCity";
4
- /**
5
- * The two-letter country code corresponding to the customer's country.
6
- */
7
- code: string | null;
8
- id: string | null;
9
- /**
10
- * The customer's normalized city name.
11
- */
12
- name: string;
13
- }
14
- export interface customerSocialLogin_customerSocialLogin_customer_addresses_country {
15
- __typename: "CustomerAddressCountry";
16
- /**
17
- * The two-letter country code corresponding to the customer's country.
18
- */
19
- code: string | null;
20
- id: string | null;
21
- /**
22
- * The customer's normalized country name.
23
- */
24
- name: string;
25
- /**
26
- * The two-letter country code corresponding to the customer's country.
27
- */
28
- iso2: string | null;
29
- /**
30
- * The two-letter country code corresponding to the customer's country.
31
- */
32
- iso3: string | null;
33
- }
34
- export interface customerSocialLogin_customerSocialLogin_customer_addresses_district {
35
- __typename: "CustomerAddressDistrict";
36
- id: string | null;
37
- /**
38
- * The customer's normalized district name.
39
- */
40
- name: string | null;
41
- /**
42
- * The two-letter district code corresponding to the customer's district.
43
- */
44
- code: string | null;
45
- }
46
- export interface customerSocialLogin_customerSocialLogin_customer_addresses_state {
47
- __typename: "CustomerAddressState";
48
- name: string | null;
49
- id: string | null;
50
- code: string | null;
51
- }
52
- export interface customerSocialLogin_customerSocialLogin_customer_addresses {
53
- __typename: "CustomerAddress";
54
- /**
55
- * The customer's mailing address.
56
- */
57
- addressLine1: string;
58
- /**
59
- * An additional field for the customer's mailing address.
60
- */
61
- addressLine2: string | null;
62
- /**
63
- * The customer's identity numbers.
64
- */
65
- identityNumber: string | null;
66
- /**
67
- * The customer's city.
68
- */
69
- city: customerSocialLogin_customerSocialLogin_customer_addresses_city;
70
- /**
71
- * The customer's company.
72
- */
73
- company: string | null;
74
- /**
75
- * The customer's country.
76
- */
77
- country: customerSocialLogin_customerSocialLogin_customer_addresses_country;
78
- /**
79
- * The customer's district in city.
80
- */
81
- district: customerSocialLogin_customerSocialLogin_customer_addresses_district | null;
82
- id: string;
83
- /**
84
- * The customer's first name.
85
- */
86
- firstName: string;
87
- /**
88
- * Whether this address is the default address for the customer. Returns `true` for each default address.
89
- */
90
- isDefault: boolean | null;
91
- /**
92
- * The customer's last name.
93
- */
94
- lastName: string;
95
- /**
96
- * The customer's postal code, also known as zip, postcode, etc.
97
- */
98
- postalCode: string | null;
99
- state: customerSocialLogin_customerSocialLogin_customer_addresses_state | null;
100
- /**
101
- * Tax number that the customer will use for orders
102
- */
103
- taxNumber: string | null;
104
- /**
105
- * If customer is corporate, customer can use that field to fill their Tax Office name.
106
- */
107
- taxOffice: string | null;
108
- title: string;
109
- }
110
- export interface customerSocialLogin_customerSocialLogin_customer {
111
- __typename: "Customer";
112
- id: string;
113
- /**
114
- * Email verification status. **isEmailVerified** returns `true` if the email is verified.
115
- */
116
- isEmailVerified: boolean | null;
117
- /**
118
- * Phone verification status. **isPhoneVerified** returns `true` if the email is verified.
119
- */
120
- isPhoneVerified: boolean | null;
121
- /**
122
- * The customer's last name.
123
- */
124
- lastName: string | null;
125
- /**
126
- * A list of the ten most recently updated addresses for the customer.
127
- */
128
- addresses: customerSocialLogin_customerSocialLogin_customer_addresses[] | null;
129
- /**
130
- * The customer's phone number
131
- */
132
- phone: string | null;
133
- /**
134
- * CustomerAccountStatusEnum
135
- */
136
- accountStatus: CustomerAccountStatusEnum | null;
137
- /**
138
- * The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.
139
- */
140
- email: string | null;
141
- /**
142
- * The customer's first name.
143
- */
144
- firstName: string;
145
- /**
146
- * CustomerEmailSubscriptionStatusesEnum
147
- */
148
- subscriptionStatus: CustomerEmailSubscriptionStatusesEnum | null;
149
- }
150
- export interface customerSocialLogin_customerSocialLogin {
151
- __typename: "CustomerLoginResponse";
152
- token: string;
153
- tokenExpiry: number;
154
- customer: customerSocialLogin_customerSocialLogin_customer | null;
155
- }
156
- export interface customerSocialLogin {
157
- customerSocialLogin: customerSocialLogin_customerSocialLogin;
158
- }
159
- export interface customerSocialLoginVariables {
160
- code: string;
161
- }
@@ -1,15 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])},t(n,r)};function n(n,r){function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var r=function(){return r=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},r.apply(this,arguments)};function e(t,n){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(t);o<e.length;o++)n.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(r[e[o]]=t[e[o]])}return r}function o(t,n,r,e){return new(r||(r=Promise))((function(o,a){function c(t){try{l(e.next(t))}catch(t){a(t)}}function u(t){try{l(e.throw(t))}catch(t){a(t)}}function l(t){var n;t.done?o(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(c,u)}l((e=e.apply(t,n||[])).next())}))}function a(t,n){var r,e,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,e&&(o=2&a[0]?e.return:a[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,a[1])).done)return o;switch(e=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,e=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(t,c)}catch(t){a=[6,t],e=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function c(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;var e=Array(t),o=0;for(n=0;n<r;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,o++)e[o]=a[c];return e}export{r as __assign,o as __awaiter,n as __extends,a as __generator,e as __rest,c as __spreadArrays};
@@ -1,15 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- var t=function(o,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])},t(o,r)};function o(o,r){function n(){this.constructor=o}t(o,r),o.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}export{o as __extends};
@@ -1,6 +0,0 @@
1
- export declare class IkasLanguage {
2
- id: string;
3
- locale: string;
4
- name: string;
5
- constructor(data: Partial<IkasLanguage>);
6
- }
@@ -1,5 +0,0 @@
1
- export declare class IkasSlider {
2
- value: number;
3
- unit: string | null;
4
- constructor(data?: Partial<IkasSlider>);
5
- }
@@ -1 +0,0 @@
1
- import{makeAutoObservable as i}from"mobx";var t=function(t){void 0===t&&(t={}),this.value=t.value||0,this.unit=t.unit||null,i(this)};export{t as IkasSlider};
@@ -1,14 +0,0 @@
1
- export declare class IkasThemeColor {
2
- id: string;
3
- displayName: string;
4
- key: string;
5
- color: string;
6
- translations: {
7
- [locale: string]: ColorTranslation;
8
- };
9
- constructor(data: Partial<IkasThemeColor>);
10
- }
11
- export declare class ColorTranslation {
12
- displayName: string | null;
13
- constructor(data?: Partial<ColorTranslation>);
14
- }
@@ -1 +0,0 @@
1
- import{makeAutoObservable as s}from"mobx";import i from'../../../../ext/uuid/dist/esm-browser/v4.js';var t=function(t){this.translations={},this.id=t.id||i(),this.displayName=t.displayName||"",this.key=t.key||"",this.color=t.color||"",this.translations=t.translations||{},s(this)};export{t as IkasThemeColor};
@@ -1,5 +0,0 @@
1
- export declare class IkasThemeFontFamily {
2
- name: string | null;
3
- variants: string[] | null;
4
- constructor(data?: Partial<IkasThemeFontFamily>);
5
- }
@@ -1 +0,0 @@
1
- import{makeAutoObservable as i}from"mobx";var n=function(n){void 0===n&&(n={}),this.name=n.name||null,this.variants=n.variants||null,i(this)};export{n as IkasThemeFontFamily};
@@ -1,11 +0,0 @@
1
- import { IkasSlider } from "src";
2
- import IkasPropValueProvider from ".";
3
- export declare class IkasSliderPropValueProvider implements IkasPropValueProvider<IkasSliderPropValueData> {
4
- private sliderData;
5
- constructor(sliderData: IkasSliderPropValueData);
6
- getValue(): Promise<IkasSlider>;
7
- }
8
- export declare type IkasSliderPropValueData = {
9
- value: number;
10
- unit: string | null;
11
- };
@@ -1 +0,0 @@
1
- import{__awaiter as t,__generator as i}from'../../ext/tslib/tslib.es6.js';import{IkasSlider as e}from"../../models/data/slider/index.js";var n=function(){function n(t){this.sliderData=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new e({value:this.sliderData.value,unit:this.sliderData.unit})]}))}))},n}();export{n as IkasSliderPropValueProvider};
@@ -1 +0,0 @@
1
- import{__awaiter as e,__generator as r}from'../../../ext/tslib/tslib.es6.js';import t from"path";import{deleteDirContent as n,createFile as s}from"../../../utils/fs.js";import{API_INFO as o}from"./info.js";var i=function(){function i(){}return i.generate=function(){return e(this,void 0,void 0,(function(){var e,s,a,c,u,l;return r(this,(function(r){switch(r.label){case 0:return e=t.join(process.cwd(),"src","pages","api"),[4,n(e)];case 1:r.sent(),s=!0,a=0,c=o,r.label=2;case 2:return a<c.length?(u=c[a],(l=s)?[4,i.generateAPI(u)]:[3,4]):[3,6];case 3:l=r.sent(),r.label=4;case 4:s=l,r.label=5;case 5:return a++,[3,2];case 6:return[2,s]}}))}))},i.generateAPI=function(e){return s(t.join(process.cwd(),"src","pages","api"),e.fileName,e.content)},i}();export{i as APIGenerator};
@@ -1 +0,0 @@
1
- var e='import { IkasLocalThemeAPI } from "@ikas/storefront-utils";\n\nexport default IkasLocalThemeAPI.GetComponentDirs.getComponentDirs;\nexport const config = IkasLocalThemeAPI.GetComponentDirs.config;\n',o='import { IkasLocalThemeAPI } from "@ikas/storefront-utils";\n\nexport default IkasLocalThemeAPI.GetTheme.getTheme;\nexport const config = IkasLocalThemeAPI.GetTheme.config;\n',t='import { IkasLocalThemeAPI } from "@ikas/storefront-utils";\n\nexport default IkasLocalThemeAPI.UpdateTheme.updateTheme;\nexport const config = IkasLocalThemeAPI.UpdateTheme.config;\n',n='import { IkasLocalThemeAPI } from "@ikas/storefront-utils";\n\nexport default IkasLocalThemeAPI.UploadTheme.uploadTheme;\nexport const config = IkasLocalThemeAPI.UploadTheme.config;\n',a=[{content:e,fileName:"getComponentDirs.ts"},{content:o,fileName:"getTheme.ts"},{content:t,fileName:"updateTheme.ts"},{content:n,fileName:"uploadTheme.ts"}];export{a as API_INFO,e as GET_COMPONENT_DIRS_API_CONTENT,o as GET_THEME_API_CONTENT,t as UPDATE_THEME_API_CONTENT,n as UPLOAD_THEME_API_CONTENT};
@@ -1 +0,0 @@
1
- import{__awaiter as n,__generator as t}from'../../../ext/tslib/tslib.es6.js';import o from"path";import{deleteDirContent as e,createFile as r}from"../../../utils/fs.js";var c=function(){function c(){}return c.generate=function(r){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,e(o.join(process.cwd(),"src","components","__generated__"))];case 1:return t.sent(),[4,c.generateAllComponentImportsFile(r)];case 2:return(n=t.sent())?[4,c.generateAllComponentImportsFileForEditor(r)]:[3,4];case 3:n=t.sent(),t.label=4;case 4:return[2,n]}}))}))},c.generateAllComponentImportsFileForEditor=function(e){return n(this,void 0,void 0,(function(){var n,c,i,s;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),n='import dynamic from "next/dynamic";\r\n',n+='import { IkasEditorComponentLoader } from "@ikas/storefront";\r\n',n+="\r\n",n+="\r\n",(c=e.components.filter((function(n){return"checkout"!==n.id}))).filter((function(n){return"checkout"!==n.id})).forEach((function(t,o){n+="const Component".concat(o,' = dynamic(() => import("../').concat(t.dir,'"), { loading: () => <IkasEditorComponentLoader /> });\r\n')})),n+="\r\n",n+="\nconst Components = {\n ".concat(c.map((function(n,t){return'"'.concat(n.id,'": Component').concat(t)})),"\n};\n"),n+="\r\n",n+="export default Components;",i=o.join(process.cwd(),"src","components","__generated__"),[4,r(i,"editor.tsx",n)];case 1:return[2,t.sent()];case 2:return s=t.sent(),console.error(s),[2,!1];case 3:return[2]}}))}))},c.generateAllComponentImportsFile=function(e){return n(this,void 0,void 0,(function(){var n,c,i,s;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),n="",(c=e.components.filter((function(n){return"checkout"!==n.id}))).filter((function(n){return"checkout"!==n.id})).forEach((function(t,o){n+="import Component".concat(o,' from "../').concat(t.dir,'";\r\n')})),n+="\r\n",n+="\nconst Components = {\n ".concat(c.map((function(n,t){return'"'.concat(n.id,'": Component').concat(t)})),"\n};\n"),n+="\r\n",n+="export default Components;",i=o.join(process.cwd(),"src","components","__generated__"),[4,r(i,"index.tsx",n)];case 1:return[2,t.sent()];case 2:return s=t.sent(),console.error(s),[2,!1];case 3:return[2]}}))}))},c}();export{c as ComponentImportsGenerator};
@@ -1 +0,0 @@
1
- var n={next:"12.0.7",react:"17.0.2","react-dom":"17.0.2",mobx:"^6.1.3","mobx-react-lite":"^3.1.5","next-transpile-modules":"^9.0.0","@ikas/storefront-utils":"^2.0.0-alpha.1"},e={"@types/node":"^14.14.6","@types/react":"^16.9.55","@typescript-eslint/eslint-plugin":"^2.10.0","@typescript-eslint/parser":"^2.10.0",eslint:"^6.6.0","eslint-config-react-app":"^5.2.1","eslint-loader":"3.0.3","eslint-plugin-flowtype":"4.6.0","eslint-plugin-import":"2.20.1","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-react":"7.19.0","eslint-plugin-react-hooks":"^1.6.1",sass:"^1.43.4",typescript:"^4.5.2"},t={upgradeDependencies:"yarn upgrade @ikas/storefront @ikas/storefront-utils",dev:"next dev -p 3333",build:"next build",start:"next start",generate:"ikas --generate","prettier:all":"npx prettier@^2.1 './**/src/**/*.(ts|tsx|css|scss)' --write"},s='{\n "compilerOptions": {\n "target": "esnext",\n "lib": [\n "dom",\n "dom.iterable",\n "esnext"\n ],\n "allowJs": true,\n "skipLibCheck": true,\n "strict": true,\n "forceConsistentCasingInFileNames": true,\n "experimentalDecorators": true,\n "noEmit": true,\n "esModuleInterop": true,\n "module": "esnext",\n "moduleResolution": "node",\n "resolveJsonModule": true,\n "isolatedModules": true,\n "jsx": "preserve",\n "baseUrl": ".",\n "useUnknownInCatchVariables": false,\n "incremental": true\n },\n "typeRoots": [\n "./node_modules/@types"\n ],\n "include": [\n "next-env.d.ts",\n "**/*.ts",\n "**/*.tsx",\n "**/typings/global.d.ts",\n ],\n "exclude": [\n "node_modules",\n "./src/pages/api",\n ]\n}',i='const withTM = require("next-transpile-modules")(["@ikas/storefront"]);\n\nconst config = {\n i18n: {\n defaultLocale: "en",\n locales: ["en"],\n localeDetection: false,\n },\n basePath: process.env.NEXTJS_BASE_PATH || "",\n\n images: {\n deviceSizes: [\n 180,\n 360,\n 540,\n 720,\n 900,\n 1080,\n 1296,\n 1512,\n 1728,\n 1950,\n 2560,\n 3840,\n ],\n },\n\n webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {\n if (!isServer) {\n config.resolve.fallback.fs = false;\n }\n return config;\n },\n};\n\nmodule.exports = withTM(config);',a="NEXT_PUBLIC_ENV=local\nNEXT_PUBLIC_BASE_URL=https://api.myikas.dev/api/sf\nNEXT_PUBLIC_IMG_BASE_URL=https://cdn.myikas.dev/\nNEXT_PUBLIC_UPLOAD_GQL_URL=https://api.myikas.dev/api/admin/graphql\nNEXT_PUBLIC_GQL_URL=https://api.myikas.dev/api/sf/graphql\n",r="NEXT_PUBLIC_ENV=local\nNEXT_PUBLIC_BASE_URL=https://api.myikas.com\nNEXT_PUBLIC_IMG_BASE_URL=https://cdn.myikas.com/\nNEXT_PUBLIC_UPLOAD_GQL_URL=https://api.myikas.com/api/admin/graphql\nNEXT_PUBLIC_GQL_URL=https://api.myikas.com/api/sf/graphql\n";export{n as DEPENDENCIES,e as DEV_DEPENDENCIES,a as DEV_ENV,i as NEXT_CONFIG,r as PROD_ENV,t as SCRIPTS,s as TS_CONFIG};
@@ -1 +0,0 @@
1
- import{__awaiter as e,__generator as n,__assign as t}from'../../../ext/tslib/tslib.es6.js';import r from"path";import s from"fs";import{sortObject as o}from"../../../utils/helper.js";import"../../../storefront/index.js";import"../../../utils/i18n.js";import{createFile as i}from"../../../utils/fs.js";import{TS_CONFIG as c,NEXT_CONFIG as a,SCRIPTS as u,DEV_ENV as f,PROD_ENV as p,DEV_DEPENDENCIES as l,DEPENDENCIES as g}from"./content.js";var d=function(){function d(){}return d.generate=function(t){return e(this,void 0,void 0,(function(){var e,r,s;return n(this,(function(n){switch(n.label){case 0:return[4,d.generateTsConfig()];case 1:return(s=n.sent())?[4,d.generateNextConfig()]:[3,3];case 2:s=n.sent(),n.label=3;case 3:return(r=s)?[4,d.generatePackageJson()]:[3,5];case 4:r=n.sent(),n.label=5;case 5:return(e=r)?[4,d.generateEnv(t)]:[3,7];case 6:e=n.sent(),n.label=7;case 7:return[2,e]}}))}))},d.generateTsConfig=function(){return i(process.cwd(),"tsconfig.json",c)},d.generateNextConfig=function(){return i(process.cwd(),"next.config.js",a)},d.generatePackageJson=function(){return e(this,void 0,void 0,(function(){var e,c,a,f,p;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e=r.join(process.cwd(),"package.json"),(c=s.readFileSync(e)).length?(a=JSON.parse(c.toString()),(f=function(e){var n="dev"===e?l:g,r="dev"===e?"devDependencies":"dependencies";a[r]&&"object"==typeof a[r]?a[r]=t(t({},a[r]),n):a[r]=n;var s=o(a[r]);a[r]=s})("dev"),f("normal"),a.scripts&&"object"==typeof a.scripts?a.scripts=t(t({},a.scripts),u):a.scripts=u,[4,i(e,"",JSON.stringify(a,null,2))]):[3,2];case 1:return[2,n.sent()];case 2:return[3,4];case 3:return p=n.sent(),console.error(p),[2,!1];case 4:return[2]}}))}))},d.generateEnv=function(e){var n="dev"===e?f:p;return i(process.cwd(),".env",n)},d}();export{d as ConfigGenerator};
@@ -1,7 +0,0 @@
1
- export * from "./api";
2
- export * from "./components";
3
- export * from "./config";
4
- export * from "./pages";
5
- export * from "./store";
6
- export * from "./theme";
7
- export * from "./types";
@@ -1 +0,0 @@
1
- import{__awaiter as e,__generator as n}from'../../../ext/tslib/tslib.es6.js';import t from"path";import{deleteDirContent as r,createFile as o}from"../../../utils/fs.js";import{PAGE_INFO as s,CHECKOUT_PAGE_CONTENT as a,EDITOR_PAGE_CONTENT as c}from"./info.js";var i=function(){function i(){}return i.generate=function(){return e(this,void 0,void 0,(function(){var e,o,a,c,p,u,m,f,g,d,l,h;return n(this,(function(n){switch(n.label){case 0:return e=t.join(process.cwd(),"src","pages"),[4,r(e,["_app.tsx","_document.tsx","api"])];case 1:n.sent(),o=!0,a=0,c=s,n.label=2;case 2:return a<c.length?(p=c[a],(u=o)?[4,i.generatePageWithInfo(p)]:[3,4]):[3,6];case 3:u=n.sent(),n.label=4;case 4:o=u,n.label=5;case 5:return a++,[3,2];case 6:return m=s.find((function(e){return e.isCheckout})),f=s.find((function(e){return e.isEditor})),m?[4,i.generatePageWithInfo(m)]:[3,8];case 7:return d=n.sent(),[3,9];case 8:d=!1,n.label=9;case 9:return g=d,f?[4,i.generatePageWithInfo(f)]:[3,11];case 10:return h=n.sent(),[3,12];case 11:h=!1,n.label=12;case 12:return l=h,[2,o&&g&&l]}}))}))},i.generatePageWithInfo=function(r){return e(this,void 0,void 0,(function(){var e,s,i,p,u,m;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e="",r.isCheckout?e=a:r.isEditor?e=c:(s="import { ".concat(r.pageComponentName,' } from "@ikas/storefront";\r\n'),'import Components from "src/components/__generated__/index";\r\n',i="\nconst PageComponent = ".concat(r.pageComponentName,".default;\n\nconst Page = (props: any) => {\n return <PageComponent components={Components} {...props} />;\n};\n\nexport default Page;\r\n"),p=r.isDynamicSSG?"export const getStaticPaths = ".concat(r.pageComponentName,".getStaticPaths;\r\n"):"",u=r.isSSR?"export const getServerSideProps = ".concat(r.pageComponentName,".getServerSideProps;\r\n"):"export const getStaticProps = ".concat(r.pageComponentName,".getStaticProps;\r\n"),e=s+'import Components from "src/components/__generated__/index";\r\n'+i+p+u),[4,o(t.join(process.cwd(),"src","pages"),r.path,e)];case 1:return[2,n.sent()];case 2:return m=n.sent(),console.error(m),[2,!1];case 3:return[2]}}))}))},i.generatePageWithType=function(t){return e(this,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return(e=s.find((function(e){return e.pageTypes.includes(t)})))?[4,i.generatePageWithInfo(e)]:[3,2];case 1:return[2,n.sent()];case 2:return[2,!1]}}))}))},i}();export{i as PageGenerator};
@@ -1 +0,0 @@
1
- import{IkasThemePageType as e}from"../../../models/theme/page/index.js";var a=[{path:"[slug]/index.tsx",pageComponentName:"SlugPage",pageTypes:[e.PRODUCT,e.CATEGORY,e.BRAND],isDynamicSSG:!0},{path:"account/orders/[id].tsx",pageComponentName:"OrderDetailPage",pageTypes:[e.ORDER_DETAIL],isSSR:!0},{path:"account/orders/index.tsx",pageComponentName:"OrdersPage",pageTypes:[e.ORDERS]},{path:"account/addresses.tsx",pageComponentName:"AddressesPage",pageTypes:[e.ADDRESSES]},{path:"account/favorite-products.tsx",pageComponentName:"FavoriteProductsPage",pageTypes:[e.FAVORITE_PRODUCTS]},{path:"account/forgot-password.tsx",pageComponentName:"ForgotPasswordPage",pageTypes:[e.FORGOT_PASSWORD]},{path:"account/index.tsx",pageComponentName:"AccountPage",pageTypes:[e.ACCOUNT]},{path:"account/login.tsx",pageComponentName:"LoginPage",pageTypes:[e.LOGIN]},{path:"account/raffles.tsx",pageComponentName:"AccountRafflesPage",pageTypes:[e.RAFFLE_ACCOUNT]},{path:"account/recover-password.tsx",pageComponentName:"RecoverPasswordPage",pageTypes:[e.RECOVER_PASSWORD]},{path:"account/register.tsx",pageComponentName:"RegisterPage",pageTypes:[e.REGISTER]},{path:"blog/[slug].tsx",pageComponentName:"BlogSlugPage",pageTypes:[e.BLOG,e.BLOG_CATEGORY],isDynamicSSG:!0},{path:"blog/index.tsx",pageComponentName:"BlogPage",pageTypes:[e.BLOG_INDEX]},{path:"pages/[slug].tsx",pageComponentName:"CustomPage",pageTypes:[e.CUSTOM],isDynamicSSG:!0},{path:"raffle/[slug].tsx",pageComponentName:"RafflePage",pageTypes:[e.RAFFLE_DETAIL],isDynamicSSG:!0},{path:"raffle/index.tsx",pageComponentName:"RafflesPage",pageTypes:[e.RAFFLE]},{path:"404.tsx",pageComponentName:"NotFoundPage",pageTypes:[e.NOT_FOUND]},{path:"cart.tsx",pageComponentName:"CartPage",pageTypes:[e.CART]},{path:"index.tsx",pageComponentName:"IndexPage",pageTypes:[e.INDEX]},{path:"search.tsx",pageComponentName:"SearchPage",pageTypes:[e.SEARCH]},{path:"checkout.tsx",pageComponentName:"CheckoutPage",pageTypes:[],isCheckout:!0},{path:"editor.tsx",pageComponentName:"EditorPage",pageTypes:[],isEditor:!0}],t='import { CheckoutPage } from "@ikas/storefront";\n\nexport default CheckoutPage.default;\nexport const getStaticProps = CheckoutPage.getStaticProps;\n',p='import { EditorPage } from "@ikas/storefront";\nimport Components from "../components/__generated__/editor";\n\nconst PageComponent = EditorPage.default;\n\nconst Page = (props: any) => {\n return <PageComponent components={Components} {...props} />;\n};\n\nexport default Page;\nexport const getStaticProps = EditorPage.getStaticProps;\n';export{t as CHECKOUT_PAGE_CONTENT,p as EDITOR_PAGE_CONTENT,a as PAGE_INFO};
@@ -1 +0,0 @@
1
- var e='import { IkasBaseStore } from "@ikas/storefront";\n\nexport default class Store extends IkasBaseStore {\n // Add your own stores here if needed\n // ex: yourStore: YourStore;\n\n constructor() {\n super();\n\n // Init your own stores here\n // ex: this.yourStore = new YourStore();\n }\n}\n';export{e as STORE_CONTENT};
@@ -1 +0,0 @@
1
- import{__awaiter as t,__generator as r}from'../../../ext/tslib/tslib.es6.js';import s from"path";import o from"fs";import{createFile as e}from"../../../utils/fs.js";import{STORE_CONTENT as n}from"./content.js";var i=function(){function i(){}return i.generate=function(){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return o.existsSync(s.join(process.cwd(),"src","store","index.ts"))?[3,2]:[4,e(s.join(process.cwd(),"src","store"),"index.ts",n)];case 1:return[2,t.sent()];case 2:return[2,!0]}}))}))},i}();export{i as StoreGenerator};
@@ -1 +0,0 @@
1
- import{__awaiter as e,__generator as r}from'../../../ext/tslib/tslib.es6.js';import t from"path";import n from"fs";import{createFile as o}from"../../../utils/fs.js";import{IkasTheme as i}from"../../../models/theme/theme.js";import{IkasThemePage as s,IkasThemePageType as m}from"../../../models/theme/page/index.js";var u=function(){function u(){}return u.generate=function(e){return o(t.join(process.cwd(),"src","theme.json"),"",JSON.stringify(e,null,2))},u.generateInitialThemeJsonFile=function(){var e=new i;return e.pages.push(new s({type:m.INDEX})),u.generate(e)},u.getTheme=function(){return e(this,void 0,void 0,(function(){var e,o;return r(this,(function(r){try{return e=t.join(process.cwd(),"src","theme.json"),[2,(o=n.readFileSync(e)).length?JSON.parse(o.toString()):null]}catch(e){console.error(e)}return[2]}))}))},u}();export{u as ThemeJsonGenerator};
@@ -1,15 +0,0 @@
1
- import { IkasTheme } from "../../../models/theme/theme";
2
- import { IkasThemeCustomData } from "../../../models/theme/custom-data";
3
- declare type File = {
4
- content: string;
5
- imports: string[];
6
- internalCustomDatas: IkasThemeCustomData[];
7
- };
8
- export declare class CustomDataTypesGenerator {
9
- static generate(themeJson: IkasTheme): Promise<boolean>;
10
- static generateAllCustomDataTypes(customData: IkasThemeCustomData, file: File): void;
11
- static genenateCustomDataType(customData: IkasThemeCustomData, file: File): void;
12
- static getType(customData: IkasThemeCustomData, file: File): string;
13
- static generateTypeName(customData: IkasThemeCustomData): string;
14
- }
15
- export {};
@@ -1 +0,0 @@
1
- import{__awaiter as e,__generator as t}from'../../../ext/tslib/tslib.es6.js';import a from"path";import{createFile as o,deleteDirContent as s}from"../../../utils/fs.js";import"../../../models/data/blog/index.js";import"../../../models/data/brand/index.js";import"../../../models/data/category/index.js";import"../../../models/data/checkout/index.js";import"../../../models/data/customer/address/index.js";import"../../../models/data/customer/index.js";import"../../../models/data/customer-review/index.js";import"../../../models/data/html-meta-data/index.js";import"../../../models/data/image/index.js";import"../../../models/data/installment-info/index.js";import"../../../models/data/order/index.js";import"../../../models/data/order/line-item/index.js";import"mobx";import"../../../models/data/product/index.js";import"../../../models/data/variant-type/index.js";import"../../../models/data/product/variant/index.js";import"../../../models/data/product/variant/price/index.js";import"../../../models/data/product-attribute/index.js";import"../../../models/data/product/attribute-value/index.js";import"../../../models/data/product-filter/index.js";import"../../../models/data/variant-type/variant-value/index.js";import"../../../models/data/order-transaction/index.js";import"../../../models/data/product-option-set/index.js";import"../../../models/data/raffle/index.js";import"../../../models/theme/theme.js";import"../../../models/theme/page/index.js";import{IkasThemeComponentPropType as r}from"../../../models/theme/component/prop/index.js";import"../../../models/theme/page/component/prop-value/link.js";import"../../../models/ui/brand-list/index.js";import"../../../models/ui/blog-list/index.js";import"../../../models/ui/blog-category-list/index.js";import"../../../models/ui/category-list/index.js";import"../../../models/ui/product-detail/index.js";import"../../../models/ui/product-list/index.js";import"../../../models/ui/product-attribute-detail/index.js";import"../../../models/ui/product-attribute-list/index.js";import"../../../models/ui/customer-review-list/index.js";import"../../../models/ui/validator/index.js";import"../../../models/ui/validator/rules/index.js";import"../../../models/ui/validator/form/login.js";import"../../../models/ui/validator/form/address.js";import"../../../models/ui/validator/form/register.js";import"../../../models/ui/validator/form/contact-form.js";import"../../../models/ui/validator/form/forgot-password.js";import"../../../models/ui/validator/form/recover-password.js";import"../../../models/ui/validator/form/account-info.js";import"../../../models/ui/validator/form/raffle-form.js";import"../../../models/ui/validator/form/customer-review.js";import"../../../models/ui/raffle-list/index.js";import"../../../models/theme/settings/index.js";import"../../../models/theme/custom-data/index.js";import i from'../../../ext/lodash/uniq.js';var n=function(){function n(){}return n.generate=function(r){return e(this,void 0,void 0,(function(){var e,m,d,p,c;return t(this,(function(t){switch(t.label){case 0:return[4,s(a.join(process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:return t.trys.push([2,4,,5]),r.customData.forEach((function(t){n.generateAllCustomDataTypes(t,e)})),e.internalCustomDatas.forEach((function(t){n.generateAllCustomDataTypes(t,e)})),m=a.join(process.cwd(),"src","components","__generated__"),e.imports=i(e.imports),d="import {\r\n",e.imports.forEach((function(e){d+="\t".concat(e,",\r\n")})),p=(d+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,o(m,"types.ts",p)];case 3:return[2,t.sent()];case 4:return c=t.sent(),console.log(c),[2,!1];case 5:return[2]}}))}))},n.generateAllCustomDataTypes=function(e,t){var a=e.type===r.ENUM,o="export ".concat(a?"enum":"type"," ").concat(n.generateTypeName(e)).concat(a?"":" = ","{ \r\n"),s="};\r\n\r\n";e.type!==r.DYNAMIC_LIST&&e.type!==r.STATIC_LIST||!e.nestedData?e.type===r.ENUM&&e.enumOptions?(t.content+=o,e.enumOptions.forEach((function(e){e.value&&e.value[0].match(/^\d/)&&(e.value="_"+e.value),t.content+='\t"'.concat(null==e?void 0:e.value,'" = "').concat(null==e?void 0:e.displayName,'",'),t.content+="\r\n"})),t.content+=s):(t.content+=o,e.nestedData&&e.nestedData.forEach((function(e){n.genenateCustomDataType(e,t),t.content+="\r\n"})),t.content+=s):n.generateAllCustomDataTypes(e.nestedData[0],t)},n.genenateCustomDataType=function(e,t){var a=n.getType(e,t);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(a).concat([r.DYNAMIC_LIST,r.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===r.ENUM?",":";")},n.getType=function(e,t){var a="";switch(e.type){case r.TEXT:case r.RICH_TEXT:case r.COLOR:a="string";break;case r.BOOLEAN:a="boolean";break;case r.IMAGE:a="IkasImage",t.imports.push(a);break;case r.IMAGE_LIST:a="IkasImageList",t.imports.push(a);break;case r.LINK:a="IkasNavigationLink",t.imports.push(a);break;case r.LIST_OF_LINK:a="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case r.PRODUCT_DETAIL:a="IkasProductDetail",t.imports.push(a);break;case r.PRODUCT_LIST:a="IkasProductDetail[]",t.imports.push("IkasProductDetail");break;case r.PRODUCT_ATTRIBUTE:a="IkasProductAttribute",t.imports.push(a);break;case r.PRODUCT_ATTRIBUTE_LIST:a="IkasProductAttribute[]",t.imports.push("IkasProductAttribute");break;case r.BRAND:a="IkasBrand",t.imports.push(a);break;case r.BRAND_LIST:a="IkasBrandList",t.imports.push(a);break;case r.CATEGORY:a="IkasCategory",t.imports.push(a);break;case r.CATEGORY_LIST:a="IkasCategoryList",t.imports.push(a);break;case r.COMPONENT:a="IkasComponentRenderer";break;case r.COMPONENT_LIST:a="IkasComponentRenderer[]";break;case r.BLOG:a="IkasBlog",t.imports.push(a);break;case r.BLOG_LIST:a="IkasBlogList",t.imports.push(a);break;case r.BLOG_CATEGORY:a="IkasBlogCategory",t.imports.push(a);break;case r.BLOG_CATEGORY_LIST:a="IkasBlogCategoryList",t.imports.push(a);break;case r.RAFFLE:a="IkasRaffle",t.imports.push(a);break;case r.RAFFLE_LIST:a="IkasRaffleList",t.imports.push(a);break;case r.ENUM:a=n.generateTypeName(e),t.content.includes("export enum ".concat(a))||t.internalCustomDatas.push(e);break;case r.DYNAMIC_LIST:case r.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===r.OBJECT||e.nestedData[0].type===r.ENUM?(a=n.generateTypeName(e),t.content.includes("export type ".concat(a))||t.internalCustomDatas.push(e)):a=n.getType(e.nestedData[0],t))}return a},n.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===r.ENUM&&(t+="Enum"),t},n}();export{n as CustomDataTypesGenerator};
package/build/utils/fs.js DELETED
@@ -1 +0,0 @@
1
- import{__awaiter as r,__generator as t,__spreadArray as n}from'../ext/tslib/tslib.es6.js';import i from"fs";import e from"path";function o(r){var t=r.split("/");return t.length>1?{dirParts:t.slice(0,t.length-1),filePart:t[t.length-1]}:{filePart:r}}function u(n,o){return r(this,void 0,void 0,(function(){return t(this,(function(r){try{return i.readdirSync(n).forEach((function(r){(null==o?void 0:o.includes(r))||i.unlinkSync(e.join(n,r))})),[2,!0]}catch(r){return[2,!1]}return[2]}))}))}function c(u,c,l){var s;return r(this,void 0,void 0,(function(){var r,d,f;return t(this,(function(t){try{return r=u,d=o(c),(null===(s=d.dirParts)||void 0===s?void 0:s.length)&&(r=e.join.apply(e,n([r],d.dirParts,!1))),i.existsSync(r)||i.mkdirSync(r,{recursive:!0}),f=e.join(r,d.filePart),i.writeFileSync(f,l),[2,!0]}catch(r){return console.error(r),[2,!1]}return[2]}))}))}export{c as createFile,u as deleteDirContent,o as getFilePathParts};
@@ -1,2 +0,0 @@
1
- import { IkasThemeFontFamily } from "src/models/theme/settings/font-family";
2
- export declare const getGoogleFontHref: (fontFamily: IkasThemeFontFamily) => string | undefined;
@@ -1 +0,0 @@
1
- var a=function(a){if(a.name){var t=a.name.replace(/ /g,"+"),e="";if(a.variants){e+=":";var r=a.variants.some((function(a){return"italic"===a}));if(r&&(e+="ital,"),e+="wght@",r){var n=new RegExp("italic","i");e+=a.variants.reduce((function(a,t){return n.test(t)?a:a+"0,".concat(t.replace("regular","400"),";")}),""),e+=a.variants.reduce((function(a,t){return n.test(t)?a+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):a}),"")}else e+=a.variants.reduce((function(a,t){return a+"".concat(t.replace("regular","400"),";")}),"");e=e.substring(0,e.length-1),e+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(t).concat(e)}};export{a as getGoogleFontHref};