@ikas/storefront-cmd 4.0.0-alpha.50 → 4.0.0-alpha.51

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 (46) hide show
  1. package/build/_virtual/_cloneBuffer.js +1 -0
  2. package/build/_virtual/_commonjsHelpers.js +1 -0
  3. package/build/_virtual/_nodeUtil.js +1 -0
  4. package/build/_virtual/isBuffer.js +1 -0
  5. package/{src/index.ts → build/index.d.ts} +3 -4
  6. package/build/index.js +1 -0
  7. package/build/scripts/generators/api/index.d.ts +5 -0
  8. package/build/scripts/generators/api/index.js +1 -0
  9. package/build/scripts/generators/api/info.d.ts +12 -0
  10. package/build/scripts/generators/api/info.js +1 -0
  11. package/build/scripts/generators/components/index.d.ts +11 -0
  12. package/build/scripts/generators/components/index.js +1 -0
  13. package/build/scripts/generators/config/content.d.ts +58 -0
  14. package/build/scripts/generators/config/content.js +1 -0
  15. package/build/scripts/generators/config/index.d.ts +9 -0
  16. package/build/scripts/generators/config/index.js +1 -0
  17. package/{src/scripts/generators/index.ts → build/scripts/generators/index.d.ts} +6 -6
  18. package/build/scripts/generators/pages/index.d.ts +7 -0
  19. package/build/scripts/generators/pages/index.js +1 -0
  20. package/build/scripts/generators/pages/info.d.ts +14 -0
  21. package/build/scripts/generators/pages/info.js +1 -0
  22. package/build/scripts/generators/theme/index.d.ts +6 -0
  23. package/build/scripts/generators/theme/index.js +1 -0
  24. package/build/scripts/generators/types/index.d.ts +19 -0
  25. package/build/scripts/generators/types/index.js +1 -0
  26. package/build/scripts/ikas.d.ts +1 -0
  27. package/build/scripts/theme-build/index.d.ts +3 -0
  28. package/build/scripts/theme-build/index.js +1 -0
  29. package/build/utils/fs.d.ts +28 -0
  30. package/build/utils/fs.js +1 -0
  31. package/build/utils/helper.d.ts +2 -0
  32. package/build/utils/helper.js +1 -0
  33. package/package.json +6 -6
  34. package/src/scripts/generators/api/index.ts +0 -27
  35. package/src/scripts/generators/api/info.ts +0 -47
  36. package/src/scripts/generators/components/index.ts +0 -270
  37. package/src/scripts/generators/config/content.ts +0 -170
  38. package/src/scripts/generators/config/index.ts +0 -113
  39. package/src/scripts/generators/pages/index.ts +0 -102
  40. package/src/scripts/generators/pages/info.ts +0 -161
  41. package/src/scripts/generators/theme/index.ts +0 -63
  42. package/src/scripts/generators/types/index.ts +0 -526
  43. package/src/scripts/ikas.ts +0 -45
  44. package/src/scripts/theme-build/index.ts +0 -99
  45. package/src/utils/fs.ts +0 -93
  46. package/src/utils/helper.ts +0 -20
@@ -1,161 +0,0 @@
1
- import { IkasThemeJsonPageType } from "@ikas/storefront-models";
2
-
3
- export type PageInfo = {
4
- path: string;
5
- pageComponentName: string;
6
- pageTypes: IkasThemeJsonPageType[];
7
- isDynamicSSG?: boolean;
8
- isSSR?: boolean;
9
- isEditor?: boolean;
10
- isCheckout?: boolean;
11
- };
12
-
13
- export const CHECKOUT_COMPONENT_ID = "checkout";
14
-
15
- export const PAGE_INFO: PageInfo[] = [
16
- {
17
- path: "[slug]/index.tsx",
18
- pageComponentName: "SlugPage",
19
- pageTypes: [
20
- IkasThemeJsonPageType.PRODUCT,
21
- IkasThemeJsonPageType.CATEGORY,
22
- IkasThemeJsonPageType.BRAND,
23
- ],
24
- isDynamicSSG: true,
25
- },
26
- {
27
- path: "account/orders/[id].tsx",
28
- pageComponentName: "OrderDetailPage",
29
- pageTypes: [IkasThemeJsonPageType.ORDER_DETAIL],
30
- isSSR: true,
31
- },
32
- {
33
- path: "account/orders/index.tsx",
34
- pageComponentName: "OrdersPage",
35
- pageTypes: [IkasThemeJsonPageType.ORDERS],
36
- },
37
- {
38
- path: "account/addresses.tsx",
39
- pageComponentName: "AddressesPage",
40
- pageTypes: [IkasThemeJsonPageType.ADDRESSES],
41
- },
42
- {
43
- path: "account/favorite-products.tsx",
44
- pageComponentName: "FavoriteProductsPage",
45
- pageTypes: [IkasThemeJsonPageType.FAVORITE_PRODUCTS],
46
- },
47
- {
48
- path: "account/forgot-password.tsx",
49
- pageComponentName: "ForgotPasswordPage",
50
- pageTypes: [IkasThemeJsonPageType.FORGOT_PASSWORD],
51
- },
52
- {
53
- path: "account/index.tsx",
54
- pageComponentName: "AccountPage",
55
- pageTypes: [IkasThemeJsonPageType.ACCOUNT],
56
- },
57
- {
58
- path: "account/login.tsx",
59
- pageComponentName: "LoginPage",
60
- pageTypes: [IkasThemeJsonPageType.LOGIN],
61
- },
62
- {
63
- path: "account/raffles.tsx",
64
- pageComponentName: "AccountRafflesPage",
65
- pageTypes: [IkasThemeJsonPageType.RAFFLE_ACCOUNT],
66
- },
67
- {
68
- path: "account/recover-password.tsx",
69
- pageComponentName: "RecoverPasswordPage",
70
- pageTypes: [IkasThemeJsonPageType.RECOVER_PASSWORD],
71
- },
72
- {
73
- path: "account/register.tsx",
74
- pageComponentName: "RegisterPage",
75
- pageTypes: [IkasThemeJsonPageType.REGISTER],
76
- },
77
- {
78
- path: "blog/[slug].tsx",
79
- pageComponentName: "BlogSlugPage",
80
- pageTypes: [
81
- IkasThemeJsonPageType.BLOG,
82
- IkasThemeJsonPageType.BLOG_CATEGORY,
83
- ],
84
- isDynamicSSG: true,
85
- },
86
- {
87
- path: "blog/index.tsx",
88
- pageComponentName: "BlogPage",
89
- pageTypes: [IkasThemeJsonPageType.BLOG_INDEX],
90
- },
91
- {
92
- path: "pages/[slug].tsx",
93
- pageComponentName: "CustomPage",
94
- pageTypes: [IkasThemeJsonPageType.CUSTOM],
95
- isDynamicSSG: true,
96
- },
97
- {
98
- path: "raffle/[slug].tsx",
99
- pageComponentName: "RafflePage",
100
- pageTypes: [IkasThemeJsonPageType.RAFFLE_DETAIL],
101
- isDynamicSSG: true,
102
- },
103
- {
104
- path: "raffle/index.tsx",
105
- pageComponentName: "RafflesPage",
106
- pageTypes: [IkasThemeJsonPageType.RAFFLE],
107
- },
108
- {
109
- path: "404.tsx",
110
- pageComponentName: "NotFoundPage",
111
- pageTypes: [IkasThemeJsonPageType.NOT_FOUND],
112
- },
113
- {
114
- path: "cart.tsx",
115
- pageComponentName: "CartPage",
116
- pageTypes: [IkasThemeJsonPageType.CART],
117
- },
118
- {
119
- path: "index.tsx",
120
- pageComponentName: "IndexPage",
121
- pageTypes: [IkasThemeJsonPageType.INDEX],
122
- },
123
- {
124
- path: "search.tsx",
125
- pageComponentName: "SearchPage",
126
- pageTypes: [IkasThemeJsonPageType.SEARCH],
127
- },
128
- {
129
- path: "checkout.tsx",
130
- pageComponentName: "CheckoutPage",
131
- pageTypes: [],
132
- isCheckout: true,
133
- },
134
- {
135
- path: "editor.tsx",
136
- pageComponentName: "EditorPage",
137
- pageTypes: [],
138
- isEditor: true,
139
- },
140
- ];
141
-
142
- export const CHECKOUT_PAGE_CONTENT = `import { CheckoutPage } from "@ikas/storefront";
143
- import { CheckoutPage as CheckoutPageNext } from "@ikas/storefront-next";
144
-
145
- export default CheckoutPage.default;
146
- export const getStaticProps = CheckoutPageNext.getStaticProps;
147
- `;
148
-
149
- export const EDITOR_PAGE_CONTENT = `import { EditorPage } from "@ikas/storefront";
150
- import { EditorPage as EditorPageNext } from "@ikas/storefront-next";
151
- import Components from "../components/__generated__/editor";
152
-
153
- const PageComponent = EditorPage.default;
154
-
155
- const Page = (props: any) => {
156
- return <PageComponent components={Components} {...props} />;
157
- };
158
-
159
- export default Page;
160
- export const getStaticProps = EditorPageNext.getStaticProps;
161
- `;
@@ -1,63 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import { createFile } from "../../../utils/fs";
4
- import {
5
- IkasThemeJson,
6
- IkasThemeJsonPageType,
7
- IkasThemeJsonStockPreference,
8
- } from "@ikas/storefront-models";
9
-
10
- export class ThemeJsonGenerator {
11
- static generate(themeJson: IkasThemeJson) {
12
- return createFile(
13
- path.join(process.cwd(), "src", "theme.json"),
14
- "",
15
- JSON.stringify(themeJson, null, 2)
16
- );
17
- }
18
-
19
- static generateInitialThemeJsonFile() {
20
- const themeJson: IkasThemeJson = {
21
- pages: [],
22
- components: [],
23
- name: "My Theme",
24
- customData: [],
25
- settings: {
26
- colors: [],
27
- favicon: {
28
- id: null,
29
- },
30
- fontFamily: {
31
- name: null,
32
- variants: null,
33
- },
34
- stockPreference: IkasThemeJsonStockPreference.SHOW_ALL,
35
- },
36
- };
37
-
38
- themeJson.pages.push({
39
- id: "1",
40
- components: [],
41
- canonicals: null,
42
- description: null,
43
- disableIndex: null,
44
- name: null,
45
- pageTitle: null,
46
- slug: null,
47
- specifications: [],
48
- type: IkasThemeJsonPageType.INDEX,
49
- });
50
-
51
- return ThemeJsonGenerator.generate(themeJson);
52
- }
53
-
54
- static async getTheme() {
55
- try {
56
- const themePath = path.join(process.cwd(), "src", "theme.json");
57
- const fileBuffer = fs.readFileSync(themePath);
58
- return fileBuffer.length ? JSON.parse(fileBuffer.toString()) : null;
59
- } catch (err) {
60
- console.error(err);
61
- }
62
- }
63
- }