easyorders 0.1.14 → 0.1.16

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 (51) hide show
  1. package/README.md +93 -93
  2. package/dist/bin/cli.js +12 -5
  3. package/dist/template/theme/config.json +113 -95
  4. package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/config.json +107 -0
  5. package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/template.liquid +171 -0
  6. package/dist/template/theme/home-sections/category-mosaic/config.json +89 -4
  7. package/dist/template/theme/home-sections/category-mosaic/template.liquid +84 -69
  8. package/dist/template/theme/home-sections/different-hero/config.json +199 -0
  9. package/dist/template/theme/home-sections/different-hero/template.liquid +219 -0
  10. package/dist/template/theme/home-sections/editorial-feature/config.json +27 -1
  11. package/dist/template/theme/home-sections/editorial-feature/template.liquid +11 -10
  12. package/dist/template/theme/home-sections/newsletter-luxe/config.json +28 -2
  13. package/dist/template/theme/home-sections/newsletter-luxe/template.liquid +19 -13
  14. package/dist/template/theme/home-sections/runway-hero/config.json +87 -30
  15. package/dist/template/theme/home-sections/runway-hero/template.liquid +59 -29
  16. package/dist/template/theme/home-sections/shop-the-look/config.json +93 -1
  17. package/dist/template/theme/home-sections/shop-the-look/template.liquid +41 -19
  18. package/dist/template/theme/home-sections/slider-before-after/config.json +213 -0
  19. package/dist/template/theme/home-sections/slider-before-after/template.liquid +336 -0
  20. package/dist/template/theme/home-sections/test-hero-allbird/config.json +130 -0
  21. package/dist/template/theme/home-sections/test-hero-allbird/template.liquid +149 -0
  22. package/dist/template/theme/home-sections/trust-promise/config.json +76 -2
  23. package/dist/template/theme/home-sections/trust-promise/template.liquid +119 -96
  24. package/dist/template/theme/home-sections/zoom-parallax/config.json +48 -0
  25. package/dist/template/theme/home-sections/zoom-parallax/template.liquid +135 -0
  26. package/dist/template/theme/product-data-schema.json +27 -0
  27. package/dist/template/theme/schema.json +136 -151
  28. package/dist/template/theme/script.js +1095 -586
  29. package/dist/template/theme/sections/breadcrumbs.liquid +17 -17
  30. package/dist/template/theme/sections/categories.liquid +26 -10
  31. package/dist/template/theme/sections/fake-counter.liquid +27 -27
  32. package/dist/template/theme/sections/fake-stock.liquid +6 -6
  33. package/dist/template/theme/sections/fake-visitor.liquid +6 -6
  34. package/dist/template/theme/sections/featured-products.liquid +143 -110
  35. package/dist/template/theme/sections/fixed-buy-button.liquid +51 -46
  36. package/dist/template/theme/sections/footer.liquid +128 -129
  37. package/dist/template/theme/sections/gallery.liquid +65 -61
  38. package/dist/template/theme/sections/header.liquid +232 -152
  39. package/dist/template/theme/sections/home-products-grid.liquid +167 -109
  40. package/dist/template/theme/sections/list-products.liquid +136 -93
  41. package/dist/template/theme/sections/order-invoice.liquid +102 -154
  42. package/dist/template/theme/sections/product-description.liquid +40 -30
  43. package/dist/template/theme/sections/product-details.liquid +48 -63
  44. package/dist/template/theme/sections/products-grid.liquid +134 -86
  45. package/dist/template/theme/sections/related-products.liquid +152 -88
  46. package/dist/template/theme/sections/reviews.liquid +70 -55
  47. package/dist/template/theme/sections/slider.liquid +43 -43
  48. package/dist/template/theme/sections/thanks.liquid +33 -33
  49. package/dist/template/theme/style.css +5617 -3923
  50. package/dist/template/theme/theme-data.json +26 -9
  51. package/package.json +40 -40
package/README.md CHANGED
@@ -1,93 +1,93 @@
1
- # Easy Orders CLI
2
-
3
- CLI tool for creating and developing [EasyOrders](https://www.easyorders.eg) storefront themes. Edit Liquid templates, CSS, and JavaScript in the `theme/` folder and preview changes on a live store instantly.
4
-
5
- Full theme documentation — Liquid variables, palette, sections, events:
6
-
7
- **https://themes-docs.easy-orders.net/docs/custom-themes/getting-started**
8
-
9
- ## ⚠️ Important Notice
10
-
11
- The tunnel URL is tied to your current browser session. When you stop the dev server (tunnel) or close the theme editor, you **must close the browser entirely** to end the session. Otherwise the browser may continue trying to load the old tunnel URL, causing errors on subsequent runs.
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npm install -g easyorders
17
- ```
18
-
19
- ## Usage
20
-
21
- ### Create a new theme project
22
-
23
- ```bash
24
- easyorders create-theme my-theme
25
- ```
26
-
27
- This scaffolds a new directory `my-theme/` containing only the `theme/` folder and a minimal `package.json`. No server code is included — the server runs from the CLI package itself.
28
-
29
- ### Start the dev server
30
-
31
- ```bash
32
- cd my-theme
33
- easyorders start
34
- ```
35
-
36
- This will:
37
-
38
- 1. Prompt you for your store subdomain (e.g. `sand` from `sand.myeasyorders.com`)
39
- 2. Authenticate with the Easy Orders API
40
- 3. Start a local Express server that serves your theme
41
- 4. Open a Cloudflare tunnel so your store can load the theme in real-time
42
-
43
- ### Interactive mode
44
-
45
- Running `easyorders` without arguments shows an interactive menu where you can choose to create a theme or start the dev server.
46
-
47
- ## Environment Variables
48
-
49
- Create a `.env` file in your theme project root (or export the variables) to customise the defaults:
50
-
51
- | Variable | Description | Default |
52
- | ------------------- | ------------------------------------------------- | ----------------------------- |
53
- | `PORT` | Local server port | `4000` |
54
- | `API_BASE_URL` | Backend API base URL used for CLI token endpoints | `https://api.easy-orders.net` |
55
- | `FRONTEND_BASE_URL` | Frontend base URL used for the approval page | `https://app.easy-orders.net` |
56
- | `STORE_DOMAIN` | Domain used to build the store preview URL | `myeasyorders.com` |
57
-
58
- ## Theme Project Structure
59
-
60
- After running `create-theme`, your project will look like:
61
-
62
- ```
63
- my-theme/
64
- ├── package.json
65
- ├── .gitignore
66
- └── theme/
67
- ├── config.json
68
- ├── schema.json
69
- ├── theme-data.json
70
- ├── style.css
71
- ├── script.js
72
- ├── sections/
73
- │ ├── header.liquid
74
- │ ├── footer.liquid
75
- │ └── ...
76
- └── home-sections/
77
- ├── <section-key>/
78
- │ ├── config.json
79
- │ └── template.liquid
80
- └── ...
81
- ```
82
-
83
- You only need to edit files inside the `theme/` folder. The server code is handled by the CLI.
84
-
85
- ## 🔑 Clearing Sessions & Auth
86
-
87
- If you want to delete any saved sessions or store authentication, simply delete the `.cli-tokens.json` file in your theme project root:
88
-
89
- ```bash
90
- rm .cli-tokens.json
91
- ```
92
-
93
- The next time you run the dev server, you will be prompted to authenticate again.
1
+ # Easy Orders CLI
2
+
3
+ CLI tool for creating and developing [EasyOrders](https://www.easyorders.eg) storefront themes. Edit Liquid templates, CSS, and JavaScript in the `theme/` folder and preview changes on a live store instantly.
4
+
5
+ Full theme documentation — Liquid variables, palette, sections, events:
6
+
7
+ **https://themes-docs.easy-orders.net/docs/custom-themes/getting-started**
8
+
9
+ ## ⚠️ Important Notice
10
+
11
+ The tunnel URL is tied to your current browser session. When you stop the dev server (tunnel) or close the theme editor, you **must close the browser entirely** to end the session. Otherwise the browser may continue trying to load the old tunnel URL, causing errors on subsequent runs.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install -g easyorders
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Create a new theme project
22
+
23
+ ```bash
24
+ easyorders create-theme my-theme
25
+ ```
26
+
27
+ This scaffolds a new directory `my-theme/` containing only the `theme/` folder and a minimal `package.json`. No server code is included — the server runs from the CLI package itself.
28
+
29
+ ### Start the dev server
30
+
31
+ ```bash
32
+ cd my-theme
33
+ easyorders start
34
+ ```
35
+
36
+ This will:
37
+
38
+ 1. Prompt you for your store subdomain (e.g. `sand` from `sand.myeasyorders.com`)
39
+ 2. Authenticate with the Easy Orders API
40
+ 3. Start a local Express server that serves your theme
41
+ 4. Open a Cloudflare tunnel so your store can load the theme in real-time
42
+
43
+ ### Interactive mode
44
+
45
+ Running `easyorders` without arguments shows an interactive menu where you can choose to create a theme or start the dev server.
46
+
47
+ ## Environment Variables
48
+
49
+ Create a `.env` file in your theme project root (or export the variables) to customise the defaults:
50
+
51
+ | Variable | Description | Default |
52
+ | ------------------- | ------------------------------------------------- | ----------------------------- |
53
+ | `PORT` | Local server port | `4000` |
54
+ | `API_BASE_URL` | Backend API base URL used for CLI token endpoints | `https://api.easy-orders.net` |
55
+ | `FRONTEND_BASE_URL` | Frontend base URL used for the approval page | `https://app.easy-orders.net` |
56
+ | `STORE_DOMAIN` | Domain used to build the store preview URL | `myeasyorders.com` |
57
+
58
+ ## Theme Project Structure
59
+
60
+ After running `create-theme`, your project will look like:
61
+
62
+ ```
63
+ my-theme/
64
+ ├── package.json
65
+ ├── .gitignore
66
+ └── theme/
67
+ ├── config.json
68
+ ├── schema.json
69
+ ├── theme-data.json
70
+ ├── style.css
71
+ ├── script.js
72
+ ├── sections/
73
+ │ ├── header.liquid
74
+ │ ├── footer.liquid
75
+ │ └── ...
76
+ └── home-sections/
77
+ ├── <section-key>/
78
+ │ ├── config.json
79
+ │ └── template.liquid
80
+ └── ...
81
+ ```
82
+
83
+ You only need to edit files inside the `theme/` folder. The server code is handled by the CLI.
84
+
85
+ ## 🔑 Clearing Sessions & Auth
86
+
87
+ If you want to delete any saved sessions or store authentication, simply delete the `.cli-tokens.json` file in your theme project root:
88
+
89
+ ```bash
90
+ rm .cli-tokens.json
91
+ ```
92
+
93
+ The next time you run the dev server, you will be prompted to authenticate again.
package/dist/bin/cli.js CHANGED
@@ -5,7 +5,6 @@ import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import readline from "node:readline";
7
7
  import { fileURLToPath } from "node:url";
8
- import { getCliVersion } from "../server/api.js";
9
8
  const __filename = fileURLToPath(import.meta.url);
10
9
  const __dirname = path.dirname(__filename);
11
10
  const CLI_ROOT = path.resolve(__dirname, "..");
@@ -169,13 +168,21 @@ async function interactiveMenu() {
169
168
  // ── Version check ───────────────────────────────────────────
170
169
  async function checkForUpdates() {
171
170
  const pkgPath = path.resolve(__dirname, "..", "..", "package.json");
172
- const localVersion = JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version;
171
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
172
+ const localVersion = pkg.version;
173
+ const packageName = pkg.name;
173
174
  try {
174
- const latestVersion = await getCliVersion();
175
- if (latestVersion.localeCompare(localVersion, undefined, { numeric: true }) > 0) {
175
+ const res = await fetch(`https://registry.npmjs.org/${packageName}/latest`);
176
+ if (!res.ok)
177
+ return;
178
+ const data = (await res.json());
179
+ const latestVersion = data.version;
180
+ if (latestVersion.localeCompare(localVersion, undefined, {
181
+ numeric: true,
182
+ }) > 0) {
176
183
  console.log("");
177
184
  console.log(` ${YELLOW}${BOLD}⚠ Update available!${RESET} ${DIM}${localVersion}${RESET} → ${GREEN}${BOLD}${latestVersion}${RESET}`);
178
- console.log(` ${DIM}Run${RESET} ${CYAN}npm install -g easyorders@latest${RESET} ${DIM}to update.${RESET}`);
185
+ console.log(` ${DIM}Run${RESET} ${CYAN}npm install -g ${packageName}@latest${RESET} ${DIM}to update.${RESET}`);
179
186
  console.log("");
180
187
  process.exit(1);
181
188
  }
@@ -1,95 +1,113 @@
1
- {
2
- "footer": {
3
- "logo": "",
4
- "pages": [
5
- {
6
- "id": "ADD_PAGE_ID_HERE"
7
- }
8
- ],
9
- "social": [
10
- {
11
- "url": "https://facebook.com",
12
- "type": "facebook"
13
- },
14
- {
15
- "url": "https://facebook.com",
16
- "type": "instagram"
17
- },
18
- {
19
- "url": "https://facebook.com",
20
- "type": "twitter"
21
- },
22
- {
23
- "url": "https://facebook.com",
24
- "type": "linkedin"
25
- },
26
- {
27
- "url": "https://facebook.com",
28
- "type": "tiktok"
29
- },
30
- {
31
- "url": "https://facebook.com",
32
- "type": "youtube"
33
- }
34
- ],
35
- "categories": [
36
- {
37
- "id": "ADD_CATEGORY_ID_HERE"
38
- }
39
- ],
40
- "payment_img": "https://easyorders.fra1.digitaloceanspaces.com/1773958283329740254payment_icons.svg",
41
- "is_use_config": true
42
- },
43
- "header": {
44
- "logo": "",
45
- "links": [
46
- {
47
- "id": "ADD_CATEGORY_ID_HERE",
48
- "type": "category"
49
- },
50
- {
51
- "id": "ADD_PAGE_ID_HERE",
52
- "type": "page"
53
- }
54
- ],
55
- "is_use_config": true
56
- },
57
- "palette": {
58
- "hd_bg": "",
59
- "hd_text": "",
60
- "ann_bg": "",
61
- "ann_text": "",
62
- "ft_bg": "",
63
- "ft_text": "",
64
- "buy_btn_bg": "",
65
- "buy_btn_text": "",
66
- "buy_btn_border": "",
67
- "crt_btn_bg": "",
68
- "crt_btn_text": "",
69
- "crt_btn_border": "",
70
- "product_name_text": "",
71
- "product_price_text": "",
72
- "product_sale_price_text": "",
73
- "body_bg": "",
74
- "body_text": "",
75
- "input_border": "",
76
- "input_bg": "",
77
- "input_text": "",
78
- "checkout_form_bg": "",
79
- "checkout_heading_text": ""
80
- },
81
- "theme_data": {
82
- "hero_slides": [],
83
- "color_scheme": "light",
84
- "color_primary": "#1A1A2E",
85
- "hero_headline": "Welcome to Our Store",
86
- "font_size_base": 16,
87
- "hero_show_overlay": true,
88
- "product_badge_types": ["sale", "new"]
89
- },
90
- "announcement_bar": {
91
- "text": ["it works", "Free shipping for 1000 EGP", "Genuine Quality"],
92
- "type": "marquee",
93
- "is_use_config": true
94
- }
95
- }
1
+ {
2
+ "footer": {
3
+ "logo": "",
4
+ "pages": [
5
+ {
6
+ "id": "f0c83f71-05a6-42da-8911-ae7f45a88aac",
7
+ "type": "page"
8
+ },
9
+ {
10
+ "id": "97f8d618-dce3-4d1c-bcf3-75284532d2da",
11
+ "type": "page"
12
+ }
13
+ ],
14
+ "social": [
15
+ {
16
+ "type": "facebook",
17
+ "url": "https://facebook.com"
18
+ },
19
+ {
20
+ "type": "instagram",
21
+ "url": "https://facebook.com"
22
+ }
23
+ ],
24
+ "categories": [
25
+ {
26
+ "id": "c2e15720-56f5-4f57-92aa-84d8dca24cb0",
27
+ "type": "category"
28
+ }
29
+ ],
30
+ "payment_img": "https://easyorders.fra1.digitaloceanspaces.com/1773958283329740254payment_icons.svg",
31
+ "is_use_config": true
32
+ },
33
+ "header": {
34
+ "logo": "",
35
+ "links": [
36
+ {
37
+ "id": "c2e15720-56f5-4f57-92aa-84d8dca24cb0",
38
+ "type": "category"
39
+ },
40
+ {
41
+ "id": "a43e3bbe-afaf-4f96-b2a8-609574c618be",
42
+ "type": "category"
43
+ },
44
+ {
45
+ "id": "5057e926-fd39-476a-a7c5-c91790121c95",
46
+ "type": "category"
47
+ },
48
+ {
49
+ "id": "f0c83f71-05a6-42da-8911-ae7f45a88aac",
50
+ "type": "page"
51
+ },
52
+ {
53
+ "id": "97f8d618-dce3-4d1c-bcf3-75284532d2da",
54
+ "type": "page"
55
+ }
56
+ ],
57
+ "is_use_config": true
58
+ },
59
+ "palette": {
60
+ "hd_bg": "#fff",
61
+ "hd_text": "",
62
+ "ann_bg": "#212121",
63
+ "ann_text": "",
64
+ "ft_bg": "",
65
+ "ft_text": "",
66
+ "buy_btn_bg": "",
67
+ "buy_btn_text": "",
68
+ "buy_btn_border": "",
69
+ "crt_btn_bg": "",
70
+ "crt_btn_text": "",
71
+ "crt_btn_border": "",
72
+ "product_name_text": "",
73
+ "product_price_text": "",
74
+ "product_sale_price_text": "",
75
+ "body_bg": "",
76
+ "body_text": "",
77
+ "input_border": "",
78
+ "input_bg": "",
79
+ "input_text": "",
80
+ "checkout_form_bg": "",
81
+ "checkout_heading_text": ""
82
+ },
83
+ "theme_data": {
84
+ "hero_slides": [],
85
+ "color_scheme": "light",
86
+ "color_primary": "#1A1A2E",
87
+ "hero_headline": "Welcome to Our Store",
88
+ "font_size_base": 16,
89
+ "main_container_padding_top": 40,
90
+ "hero_show_overlay": true,
91
+ "product_badge_types": ["sale", "new"],
92
+ "sale_badge_bg_color": "#c94a4a",
93
+ "sale_badge_text_color": "#ffffff",
94
+ "card_background_product": "color",
95
+ "card_background_product_color": "#f5f4f2",
96
+ "footer_newsletter_title": "",
97
+ "footer_newsletter_description": "",
98
+ "footer_newsletter_text_color": "#ffffff",
99
+ "hide_newsletter_mobile": false,
100
+ "pgrid_hero_cta_text_color": "#1f272b",
101
+ "pgrid_hero_cta_font_weight": "600",
102
+ "featured_hero_subtitle_text_color": "#ffffff",
103
+ "featured_hero_cta_background_color": "#ffffff",
104
+ "featured_hero_cta_text_color": "#1f272b",
105
+ "header_category_strip_bg_color": "#e1dbd1",
106
+ "header_category_strip_text_color": "#212a2f"
107
+ },
108
+ "announcement_bar": {
109
+ "text": ["it works", "Free shipping for 1000 EGP", "Genuine Quality"],
110
+ "type": "marquee",
111
+ "is_use_config": true
112
+ }
113
+ }
@@ -0,0 +1,107 @@
1
+ {
2
+ "icon": "https://files.easy-orders.net/1778107485984969174.png",
3
+ "label": "Scrolling Marquee (Infinite)",
4
+ "section_schema": [
5
+ {
6
+ "name": "bg_color",
7
+ "type": "color",
8
+ "default": "#000000",
9
+ "description": "خلفية الشريط"
10
+ },
11
+ {
12
+ "name": "text_color",
13
+ "type": "color",
14
+ "default": "#ffffff",
15
+ "description": "لون النص"
16
+ },
17
+ {
18
+ "name": "messages",
19
+ "type": "object_array",
20
+ "fields": [
21
+ {
22
+ "name": "text",
23
+ "type": "string",
24
+ "default": "LIMITED EDITION COLLECTION",
25
+ "description": "الجملة"
26
+ }
27
+ ],
28
+ "description": "الجمل المكررة"
29
+ },
30
+ {
31
+ "name": "text_language",
32
+ "type": "select",
33
+ "default": "auto",
34
+ "description": "لغة المحتوى واتجاه الحركة",
35
+ "options": [
36
+ { "label": "تلقائي", "value": "auto" },
37
+ { "label": "عربي (حركة من الشمال لليمين)", "value": "ar" },
38
+ { "label": "إنجليزي/لاتيني", "value": "en" }
39
+ ]
40
+ },
41
+ {
42
+ "name": "tilt_direction",
43
+ "type": "select",
44
+ "default": "straight",
45
+ "description": "ميل الشريط",
46
+ "options": [
47
+ { "label": "مستقيم", "value": "straight" },
48
+ { "label": "مائل لليمين (5°)", "value": "right" },
49
+ { "label": "مائل لليسار (-5°)", "value": "left" }
50
+ ]
51
+ },
52
+ {
53
+ "name": "font_weight",
54
+ "type": "select",
55
+ "default": "700",
56
+ "description": "وزن الخط",
57
+ "options": [
58
+ { "label": "Normal", "value": "400" },
59
+ { "label": "Medium", "value": "500" },
60
+ { "label": "Bold", "value": "700" },
61
+ { "label": "Black", "value": "900" }
62
+ ]
63
+ },
64
+ {
65
+ "name": "letter_spacing",
66
+ "type": "number",
67
+ "default": 2,
68
+ "description": "تباعد الحروف (px)"
69
+ },
70
+ {
71
+ "name": "desktop_font_size",
72
+ "type": "number",
73
+ "default": 48,
74
+ "description": "حجم الخط - ديسكتوب (px)"
75
+ },
76
+ {
77
+ "name": "desktop_line_height",
78
+ "type": "number",
79
+ "default": 68,
80
+ "description": "ارتفاع الشريط - ديسكتوب (px)"
81
+ },
82
+ {
83
+ "name": "mobile_font_size",
84
+ "type": "number",
85
+ "default": 24,
86
+ "description": "حجم الخط - موبايل (px)"
87
+ },
88
+ {
89
+ "name": "mobile_line_height",
90
+ "type": "number",
91
+ "default": 48,
92
+ "description": "ارتفاع الشريط - موبايل (px)"
93
+ },
94
+ {
95
+ "name": "desktop_speed",
96
+ "type": "number",
97
+ "default": 20,
98
+ "description": "مدة الدورة - ديسكتوب (ثواني - أقل أسرع)"
99
+ },
100
+ {
101
+ "name": "mobile_speed",
102
+ "type": "number",
103
+ "default": 10,
104
+ "description": "مدة الدورة - موبايل (ثواني)"
105
+ }
106
+ ]
107
+ }