shoplazza-cli 0.0.1
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/.editorconfig +28 -0
- package/.prettierrc +9 -0
- package/LICENSE +21 -0
- package/README.md +208 -0
- package/bin/shoplazza +117 -0
- package/fixtures/assets/blog.scss +74 -0
- package/fixtures/assets/cart_modal.scss +450 -0
- package/fixtures/assets/collection_detail.js +234 -0
- package/fixtures/assets/collection_detail.scss +345 -0
- package/fixtures/assets/collection_list.scss +11 -0
- package/fixtures/assets/collection_slider.scss +169 -0
- package/fixtures/assets/feature_columns.scss +26 -0
- package/fixtures/assets/feature_product.scss +109 -0
- package/fixtures/assets/footer.js +58 -0
- package/fixtures/assets/footer.scss +337 -0
- package/fixtures/assets/four_images.scss +29 -0
- package/fixtures/assets/gallery.scss +55 -0
- package/fixtures/assets/header.js +178 -0
- package/fixtures/assets/header.scss +929 -0
- package/fixtures/assets/image_text.scss +72 -0
- package/fixtures/assets/logo_bar.scss +11 -0
- package/fixtures/assets/newsletter.scss +90 -0
- package/fixtures/assets/not_found.scss +39 -0
- package/fixtures/assets/page_detail.scss +16 -0
- package/fixtures/assets/pagination.scss +150 -0
- package/fixtures/assets/postcss.config.js +6 -0
- package/fixtures/assets/product_description.scss +88 -0
- package/fixtures/assets/product_detail.js +634 -0
- package/fixtures/assets/product_detail.scss +1106 -0
- package/fixtures/assets/relative_product.scss +45 -0
- package/fixtures/assets/reviews.scss +70 -0
- package/fixtures/assets/rich_text.scss +71 -0
- package/fixtures/assets/search.js +87 -0
- package/fixtures/assets/search.scss +67 -0
- package/fixtures/assets/slide.scss +51 -0
- package/fixtures/assets/slider.scss +141 -0
- package/fixtures/assets/theme.css +976 -0
- package/fixtures/assets/theme.scss +1100 -0
- package/fixtures/assets/three_images.scss +20 -0
- package/fixtures/assets/tools.scss +23 -0
- package/fixtures/assets/two_images.scss +24 -0
- package/fixtures/assets/video.scss +45 -0
- package/fixtures/assets/video_text.scss +63 -0
- package/fixtures/config/settings_data.json +107 -0
- package/fixtures/config/settings_schema.json +690 -0
- package/fixtures/layout/theme.liquid +76 -0
- package/fixtures/locales/ar-SA.json +212 -0
- package/fixtures/locales/de-DE.json +290 -0
- package/fixtures/locales/en-US.json +290 -0
- package/fixtures/locales/es-ES.json +290 -0
- package/fixtures/locales/fr-FR.json +290 -0
- package/fixtures/locales/id-ID.json +212 -0
- package/fixtures/locales/it-IT.json +212 -0
- package/fixtures/locales/ja-JP.json +289 -0
- package/fixtures/locales/ko-KR.json +290 -0
- package/fixtures/locales/nl-NL.json +290 -0
- package/fixtures/locales/pl-PL.json +290 -0
- package/fixtures/locales/pt-PT.json +212 -0
- package/fixtures/locales/ru-RU.json +212 -0
- package/fixtures/locales/th-TH.json +212 -0
- package/fixtures/locales/zh-CN.json +290 -0
- package/fixtures/locales/zh-TW.json +290 -0
- package/fixtures/sections/apps.liquid +47 -0
- package/fixtures/sections/blog.liquid +137 -0
- package/fixtures/sections/collection_desc.liquid +34 -0
- package/fixtures/sections/collection_detail.liquid +436 -0
- package/fixtures/sections/collection_image.liquid +104 -0
- package/fixtures/sections/collection_list.liquid +161 -0
- package/fixtures/sections/collection_name.liquid +34 -0
- package/fixtures/sections/collection_slider.liquid +330 -0
- package/fixtures/sections/feature_columns.liquid +275 -0
- package/fixtures/sections/feature_product.liquid +227 -0
- package/fixtures/sections/footer.liquid +488 -0
- package/fixtures/sections/four_images.liquid +160 -0
- package/fixtures/sections/gallery.liquid +258 -0
- package/fixtures/sections/header.liquid +1157 -0
- package/fixtures/sections/html.liquid +40 -0
- package/fixtures/sections/image_text.liquid +350 -0
- package/fixtures/sections/instagram_plus.liquid +393 -0
- package/fixtures/sections/logo_bar.liquid +183 -0
- package/fixtures/sections/newsletter.liquid +225 -0
- package/fixtures/sections/not_found.liquid +39 -0
- package/fixtures/sections/overlay_image.liquid +648 -0
- package/fixtures/sections/page_detail.liquid +39 -0
- package/fixtures/sections/photo_collection.liquid +433 -0
- package/fixtures/sections/product_description.liquid +208 -0
- package/fixtures/sections/product_detail.liquid +611 -0
- package/fixtures/sections/products.liquid +216 -0
- package/fixtures/sections/relative_product.liquid +121 -0
- package/fixtures/sections/reviews.liquid +115 -0
- package/fixtures/sections/rich_text.liquid +157 -0
- package/fixtures/sections/search.liquid +163 -0
- package/fixtures/sections/slide.liquid +719 -0
- package/fixtures/sections/three_images.liquid +157 -0
- package/fixtures/sections/two_images.liquid +125 -0
- package/fixtures/sections/video.liquid +95 -0
- package/fixtures/sections/video_text.liquid +128 -0
- package/fixtures/snippets/bgset.liquid +21 -0
- package/fixtures/snippets/card_title.liquid +8 -0
- package/fixtures/snippets/cart_modal.liquid +74 -0
- package/fixtures/snippets/collection.liquid +77 -0
- package/fixtures/snippets/collection_filter_modal.liquid +56 -0
- package/fixtures/snippets/default_image_4.liquid +14 -0
- package/fixtures/snippets/default_image_6.liquid +18 -0
- package/fixtures/snippets/default_image_8.liquid +23 -0
- package/fixtures/snippets/four_images_item.liquid +8 -0
- package/fixtures/snippets/header_ads.liquid +95 -0
- package/fixtures/snippets/hero_image.liquid +94 -0
- package/fixtures/snippets/icon_video_play_large.liquid +1 -0
- package/fixtures/snippets/icon_video_play_medium.liquid +4 -0
- package/fixtures/snippets/icon_video_play_small.liquid +4 -0
- package/fixtures/snippets/lazyimg.liquid +22 -0
- package/fixtures/snippets/lazyimg_art.liquid +36 -0
- package/fixtures/snippets/lazysizes.liquid +41 -0
- package/fixtures/snippets/link.liquid +2 -0
- package/fixtures/snippets/pagination.liquid +48 -0
- package/fixtures/snippets/product.liquid +126 -0
- package/fixtures/snippets/product_art_tpl.liquid +152 -0
- package/fixtures/snippets/product_info_body.liquid +337 -0
- package/fixtures/snippets/product_info_tpl.liquid +423 -0
- package/fixtures/snippets/product_label.liquid +46 -0
- package/fixtures/snippets/settings.liquid +295 -0
- package/fixtures/snippets/social-meta-tags.liquid +106 -0
- package/fixtures/snippets/video_html.liquid +11 -0
- package/fixtures/snippets/video_source.liquid +98 -0
- package/fixtures/snippets/video_thumb_icon.liquid +2 -0
- package/fixtures/templates/404.liquid +1 -0
- package/fixtures/templates/collection.liquid +92 -0
- package/fixtures/templates/index.liquid +206 -0
- package/fixtures/templates/page.liquid +1 -0
- package/fixtures/templates/product.liquid +99 -0
- package/fixtures/templates/search.liquid +1 -0
- package/jest.config.js +192 -0
- package/lib/__tests__/log.test.js +15 -0
- package/lib/__tests__/utils.test.js +69 -0
- package/lib/auth/__mocks__/getCode.js +7 -0
- package/lib/auth/__mocks__/index.js +0 -0
- package/lib/auth/child.js +23 -0
- package/lib/auth/getCode.js +35 -0
- package/lib/auth/index.js +91 -0
- package/lib/commands/__tests__/login.test.js +77 -0
- package/lib/commands/__tests__/logout.test.js +29 -0
- package/lib/commands/__tests__/store.test.js +44 -0
- package/lib/commands/__tests__/switch.test.js +45 -0
- package/lib/commands/login.js +99 -0
- package/lib/commands/logout.js +14 -0
- package/lib/commands/store.js +14 -0
- package/lib/commands/switch.js +52 -0
- package/lib/commands/theme/__tests__/delete.test.js +49 -0
- package/lib/commands/theme/__tests__/init.test.js +21 -0
- package/lib/commands/theme/__tests__/list.test.js +80 -0
- package/lib/commands/theme/__tests__/package.test.js +17 -0
- package/lib/commands/theme/__tests__/publish.test.js +61 -0
- package/lib/commands/theme/__tests__/pull.test.js +69 -0
- package/lib/commands/theme/__tests__/push.test.js +63 -0
- package/lib/commands/theme/__tests__/serve.test.js +107 -0
- package/lib/commands/theme/delete.js +64 -0
- package/lib/commands/theme/init.js +51 -0
- package/lib/commands/theme/list.js +28 -0
- package/lib/commands/theme/package.js +37 -0
- package/lib/commands/theme/publish.js +56 -0
- package/lib/commands/theme/pull.js +62 -0
- package/lib/commands/theme/push.js +106 -0
- package/lib/commands/theme/serve.js +153 -0
- package/lib/commands/theme/share.js +20 -0
- package/lib/commands/version.js +6 -0
- package/lib/config.js +5 -0
- package/lib/db/__mocks__/index.js +9 -0
- package/lib/db/__tests__/analytics.test.js +19 -0
- package/lib/db/__tests__/user.test.js +20 -0
- package/lib/db/analytics.js +48 -0
- package/lib/db/index.js +9 -0
- package/lib/db/user.js +68 -0
- package/lib/log.js +13 -0
- package/lib/openAPI/__mocks__/index.js +20 -0
- package/lib/openAPI/api.js +76 -0
- package/lib/openAPI/index.js +46 -0
- package/lib/report.js +37 -0
- package/lib/tracing.js +50 -0
- package/lib/utils.js +48 -0
- package/package.json +54 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
+
|
|
3
|
+
# top-most EditorConfig file
|
|
4
|
+
root = true
|
|
5
|
+
|
|
6
|
+
# Unix-style newlines with a newline ending every file
|
|
7
|
+
[*]
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
|
|
11
|
+
# Matches multiple files with brace expansion notation
|
|
12
|
+
# Set default charset
|
|
13
|
+
[*.{js}]
|
|
14
|
+
charset = utf-8
|
|
15
|
+
|
|
16
|
+
# Tab indentation (no size specified)
|
|
17
|
+
[Makefile]
|
|
18
|
+
indent_style = tab
|
|
19
|
+
|
|
20
|
+
# Indentation override for all JS under lib directory
|
|
21
|
+
[lib/**.js]
|
|
22
|
+
indent_style = space
|
|
23
|
+
indent_size = 2
|
|
24
|
+
|
|
25
|
+
# Matches the exact files either package.json or .travis.yml
|
|
26
|
+
[{package.json,.travis.yml}]
|
|
27
|
+
indent_style = space
|
|
28
|
+
indent_size = 2
|
package/.prettierrc
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Shoplazza Opensource
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h3 align="center">Shoplazza CLI</h3>
|
|
3
|
+
<p align="center">Shoplazza CLI is a command-line interface tool that helps you build Shoplazza themes. It quickly generates Shoplazza themes. You can also use it to automate many common development tasks.</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<img src="https://img.shields.io/npm/v/shoplazza-cli">
|
|
6
|
+
</p>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Shoplazza CLI is a cross-platform command line tool that you can use to build Shoplazza themes.
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
Shoplazza CLI accelerates your theme development process with the following features:
|
|
15
|
+
|
|
16
|
+
- Safely preview, test, and share changes to themes using unpublish themes
|
|
17
|
+
- Hot reload CSS and section changes, or automatically refresh a page on file change, when previewing a theme.
|
|
18
|
+
- Initialize a new theme using LifeStyle as a starting point.
|
|
19
|
+
- Use workflow tools like Git to work with a team of theme developers.
|
|
20
|
+
- Upload themes to your store.
|
|
21
|
+
- Watch for local changes and upload them automatically to Shoplazza.
|
|
22
|
+
- Work on Linux, macOS, and Windows.
|
|
23
|
+
|
|
24
|
+
## Installation [shoplazza-cli](https://www.npmjs.com/package/shoplazza-themekit)
|
|
25
|
+
``` terminal
|
|
26
|
+
$ npm install shoplazza-cli -g
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Before you start
|
|
30
|
+
|
|
31
|
+
Before you start using Shoplazza CLI to develop themes, make sure that you do the following tasks:
|
|
32
|
+
|
|
33
|
+
- Install [Node.js](https://nodejs.org/en/) (14.14.0 or higher).
|
|
34
|
+
- Install [Git](https://git-scm.com/downloads).
|
|
35
|
+
- Make sure that you have a account with the Manage themes permission for the store that you want to work on, or you're the owner of the store.
|
|
36
|
+
- Note the URL of the store that you want to work on.
|
|
37
|
+
- Make sure that you're connected to the internet. Most Shoplazza CLI commands need an internet connection to run.
|
|
38
|
+
|
|
39
|
+
## Getting started
|
|
40
|
+
### Authenticate
|
|
41
|
+
``` terminal
|
|
42
|
+
$ shoplazza login --store developer.myshoplaza.com
|
|
43
|
+
```
|
|
44
|
+
> In your browser window, log into the account that's attached to the store that you want to use for development.
|
|
45
|
+
|
|
46
|
+
### Create a new theme
|
|
47
|
+
``` terminal
|
|
48
|
+
$ shoplazza theme init
|
|
49
|
+
```
|
|
50
|
+
> Use `shoplazza theme init` to create a new theme on your local machine. This command clones a Git repository to your local machine to use as the starting point for building a theme.
|
|
51
|
+
|
|
52
|
+
### Connect to existing theme
|
|
53
|
+
``` terminal
|
|
54
|
+
$ shoplazza theme pull
|
|
55
|
+
```
|
|
56
|
+
> Pull the theme onto your local machine using `shoplazza theme pull`. You're prompted to select a theme from the list of themes on the store.
|
|
57
|
+
|
|
58
|
+
### Preview, test, and share your theme
|
|
59
|
+
``` terminal
|
|
60
|
+
$ shoplazza theme serve
|
|
61
|
+
```
|
|
62
|
+
> After you create or navigate to your theme, you can run `shoplazza theme serve` to interact with the theme in a browser.
|
|
63
|
+
|
|
64
|
+
### Push your theme to your store
|
|
65
|
+
``` terminal
|
|
66
|
+
$ shoplazza theme push
|
|
67
|
+
```
|
|
68
|
+
> Use `shoplazza theme push` to upload your local theme files to Shoplazza, overwriting the remote versions.
|
|
69
|
+
|
|
70
|
+
### Publish your theme
|
|
71
|
+
``` terminal
|
|
72
|
+
$ shoplazza theme publish
|
|
73
|
+
```
|
|
74
|
+
> Use `shoplazza theme publish` to select and publish an unpublished theme from your theme library. If you want to publish your local theme, then you need to run `shoplazza theme push` first.
|
|
75
|
+
|
|
76
|
+
### Find your theme ID
|
|
77
|
+
``` terminal
|
|
78
|
+
$ shoplazza theme list
|
|
79
|
+
```
|
|
80
|
+
> You might want to use a theme's ID to pull, push, publish, or delete a theme using Shoplazza CLI.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Core commands
|
|
84
|
+
|
|
85
|
+
### help
|
|
86
|
+
``` terminal
|
|
87
|
+
$ shoplazza help
|
|
88
|
+
```
|
|
89
|
+
> Lists the available commands and describes what they do.
|
|
90
|
+
|
|
91
|
+
### login
|
|
92
|
+
``` terminal
|
|
93
|
+
$ shoplazza login --store developer.myshoplaza.com
|
|
94
|
+
```
|
|
95
|
+
> Authenticates and logs you into the specified store with Shoplazza CLI.
|
|
96
|
+
|
|
97
|
+
### logout
|
|
98
|
+
``` terminal
|
|
99
|
+
$ shoplazza logout
|
|
100
|
+
```
|
|
101
|
+
> Logs you out of the Shoplazza account and store, the logout command clears credentials. You need to reauthenticate the next time that you connect to a store.
|
|
102
|
+
|
|
103
|
+
### switch
|
|
104
|
+
``` terminal
|
|
105
|
+
$ shoplazza switch --store developer.myshoplaza.com
|
|
106
|
+
```
|
|
107
|
+
> Switches between stores without logging out and logging in again.
|
|
108
|
+
|
|
109
|
+
### store
|
|
110
|
+
``` terminal
|
|
111
|
+
$ shoplazza store
|
|
112
|
+
```
|
|
113
|
+
> Displays the store that you're currently connected to.
|
|
114
|
+
|
|
115
|
+
### version
|
|
116
|
+
``` terminal
|
|
117
|
+
$ shoplazza version
|
|
118
|
+
```
|
|
119
|
+
> Displays the version of Shoplazza CLI that you're running.
|
|
120
|
+
|
|
121
|
+
## Theme commands
|
|
122
|
+
|
|
123
|
+
### init
|
|
124
|
+
``` terminal
|
|
125
|
+
$ shoplazza theme init [--name]
|
|
126
|
+
```
|
|
127
|
+
> Clones a Git repository to your local machine to use as the starting point for building a theme.
|
|
128
|
+
|
|
129
|
+
### serve
|
|
130
|
+
``` terminal
|
|
131
|
+
$ shoplazza theme serve [--theme]
|
|
132
|
+
```
|
|
133
|
+
> Uploads the current theme to the store that you're connected to, and returns the preview link.
|
|
134
|
+
|
|
135
|
+
### list
|
|
136
|
+
``` terminal
|
|
137
|
+
$ shoplazza theme list
|
|
138
|
+
```
|
|
139
|
+
> Lists the themes in your store, along with their IDs and statuses.
|
|
140
|
+
|
|
141
|
+
### pull
|
|
142
|
+
``` terminal
|
|
143
|
+
$ shoplazza theme pull [--theme]
|
|
144
|
+
```
|
|
145
|
+
> Retrieves theme files from Shoplazza, if no theme is specified, then you're prompted to select the theme to pull from the list of the themes in your store.
|
|
146
|
+
|
|
147
|
+
### push
|
|
148
|
+
``` terminal
|
|
149
|
+
$ shoplazza theme push [--theme]
|
|
150
|
+
```
|
|
151
|
+
> Uploads your local theme files to Shoplazza, overwriting the remote theme if specified, if no theme is specified, then you're prompted to select the theme to overwrite from the list of the themes in your store.
|
|
152
|
+
|
|
153
|
+
### share
|
|
154
|
+
``` terminal
|
|
155
|
+
$ shoplazza theme share
|
|
156
|
+
```
|
|
157
|
+
> Uploads your theme as a new, unpublished theme in your theme library. The command return a preview link that you can share with others.
|
|
158
|
+
|
|
159
|
+
### publish
|
|
160
|
+
``` terminal
|
|
161
|
+
$ shoplazza theme publish [--theme]
|
|
162
|
+
```
|
|
163
|
+
> Publishes an unpublished theme from your theme library, if no theme ID is specified, then you're prompted to select the theme that you want to publish from the list of themes in your store.
|
|
164
|
+
|
|
165
|
+
### package
|
|
166
|
+
``` terminal
|
|
167
|
+
$ shoplazza theme package
|
|
168
|
+
```
|
|
169
|
+
> Packages your local theme files into a ZIP file that can be uploaded to Shoplazza. The ZIP file uses the name theme_name-theme_version.zip, based on parameters in your `settings_schema.json` file.
|
|
170
|
+
|
|
171
|
+
### delete
|
|
172
|
+
``` terminal
|
|
173
|
+
$ shoplazza theme delete [--theme]
|
|
174
|
+
```
|
|
175
|
+
> Deletes a theme from your store, if no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## Theme Directory
|
|
179
|
+
|
|
180
|
+
You can run certain theme commands, such as shoplazza theme serve, only if the directory you're using matches the default Shoplazza theme directory structure. This structure represents a buildless theme, or a theme that has already gone through any necessary file transformations. If you use build tools to generate theme files, then you might need to run commands from the directory where the generated files are stored.
|
|
181
|
+
|
|
182
|
+
The default Shoplazza theme directory structure is as follows:
|
|
183
|
+
``` terminal
|
|
184
|
+
└── project
|
|
185
|
+
├── assets
|
|
186
|
+
├── config
|
|
187
|
+
├── layout
|
|
188
|
+
├── locales
|
|
189
|
+
├── sections
|
|
190
|
+
├── snippets
|
|
191
|
+
└── templates
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Support(OS Terminals)
|
|
195
|
+
|
|
196
|
+
You should expect mostly good support for the CLI below. This does not mean we won't look at issues found on other command line - feel free to report any!
|
|
197
|
+
|
|
198
|
+
- Mac OS
|
|
199
|
+
- Terminal.app
|
|
200
|
+
- iTerm
|
|
201
|
+
- Windows (Known issues):
|
|
202
|
+
- ConEmu
|
|
203
|
+
- cmd.exe
|
|
204
|
+
- Powershell
|
|
205
|
+
- Cygwin
|
|
206
|
+
- Linux (Ubuntu, openSUSE, Arch Linux, etc):
|
|
207
|
+
- gnome-terminal (Terminal GNOME)
|
|
208
|
+
- konsole
|
package/bin/shoplazza
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const updateNotifier = require('update-notifier');
|
|
5
|
+
const Sentry = require('@sentry/node');
|
|
6
|
+
const Tracing = require('@sentry/tracing');
|
|
7
|
+
const pkg = require('../package.json');
|
|
8
|
+
const report = require('../lib/report');
|
|
9
|
+
require('../lib/tracing');
|
|
10
|
+
|
|
11
|
+
Sentry.init({
|
|
12
|
+
dsn: 'https://89964605acaf4db8839f2d5237396d6c@sentry.shoplazza.com/730',
|
|
13
|
+
integrations: [
|
|
14
|
+
// enable HTTP calls tracing
|
|
15
|
+
new Sentry.Integrations.Http({ tracing: true })
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
// Set tracesSampleRate to 1.0 to capture 100%
|
|
19
|
+
// of transactions for performance monitoring.
|
|
20
|
+
// We recommend adjusting this value in production
|
|
21
|
+
tracesSampleRate: 1.0
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
updateNotifier({ pkg }).notify({
|
|
25
|
+
isGlobal: true
|
|
26
|
+
});
|
|
27
|
+
program.usage('[command] [options]');
|
|
28
|
+
|
|
29
|
+
program.command('version').description('Welcome to the Shoplazza CLI').action(require('../lib/commands/version'));
|
|
30
|
+
|
|
31
|
+
program
|
|
32
|
+
.command('login')
|
|
33
|
+
.description('Authenticates and logs you into the specified store with Shoplazza CLI.')
|
|
34
|
+
.option('-s, --store <store>', 'The store domain (Eg: developer.myshoplaza.com)')
|
|
35
|
+
.action(require('../lib/commands/login').login);
|
|
36
|
+
|
|
37
|
+
program
|
|
38
|
+
.command('logout')
|
|
39
|
+
.description('Logs you out of the Shoplazza account.')
|
|
40
|
+
.action(require('../lib/commands/logout'));
|
|
41
|
+
|
|
42
|
+
program
|
|
43
|
+
.command('switch')
|
|
44
|
+
.option('-s, --store <store>', 'The store url')
|
|
45
|
+
.description(`Switches between stores without logging out and logging in again.`)
|
|
46
|
+
.action(require('../lib/commands/switch'));
|
|
47
|
+
|
|
48
|
+
program
|
|
49
|
+
.command('store')
|
|
50
|
+
.description(`Displays the store that you're currently connected to.`)
|
|
51
|
+
.action(require('../lib/commands/store'));
|
|
52
|
+
|
|
53
|
+
const theme = program
|
|
54
|
+
.command('theme')
|
|
55
|
+
.description('Some commands related to the theme, Use `shoplazza theme --help` for more details.')
|
|
56
|
+
.usage('[command] [options]');
|
|
57
|
+
|
|
58
|
+
theme
|
|
59
|
+
.command('init')
|
|
60
|
+
.description('Clones a Git repository to your local machine to use as the starting point for building a theme.')
|
|
61
|
+
.option('-n, --name <name>', 'Theme folder name')
|
|
62
|
+
.action(require('../lib/commands/theme/init'));
|
|
63
|
+
|
|
64
|
+
theme
|
|
65
|
+
.command('serve')
|
|
66
|
+
.description(`Uploads the current theme to the store that you're connected to, and returns the following.`)
|
|
67
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to overwrite.')
|
|
68
|
+
.action(require('../lib/commands/theme/serve'));
|
|
69
|
+
|
|
70
|
+
theme
|
|
71
|
+
.command('pull')
|
|
72
|
+
.description(`Retrieves theme files from Shoplazza.`)
|
|
73
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to pull.')
|
|
74
|
+
.action(require('../lib/commands/theme/pull'));
|
|
75
|
+
|
|
76
|
+
theme
|
|
77
|
+
.command('push')
|
|
78
|
+
.description(`Uploads your local theme files to Shoplazza, overwriting the remote theme if specified.`)
|
|
79
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to overwrite.')
|
|
80
|
+
.action(require('../lib/commands/theme/push').pushCommand);
|
|
81
|
+
|
|
82
|
+
theme
|
|
83
|
+
.command('publish')
|
|
84
|
+
.description(`Publishes a theme from your theme library.`)
|
|
85
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to publish.')
|
|
86
|
+
.action(require('../lib/commands/theme/publish'));
|
|
87
|
+
|
|
88
|
+
theme.command('list').description(`Lists the themes in your store.`).action(require('../lib/commands/theme/list'));
|
|
89
|
+
|
|
90
|
+
theme
|
|
91
|
+
.command('share')
|
|
92
|
+
.description(`Return a theme preview link.`)
|
|
93
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to delete.')
|
|
94
|
+
.action(require('../lib/commands/theme/share'));
|
|
95
|
+
|
|
96
|
+
theme
|
|
97
|
+
.command('package')
|
|
98
|
+
.description(`Packages your local theme files into a ZIP file that can be uploaded to Shoplazza.`)
|
|
99
|
+
.action(require('../lib/commands/theme/package').packageCommand);
|
|
100
|
+
|
|
101
|
+
theme
|
|
102
|
+
.command('delete')
|
|
103
|
+
.description(`Deletes a theme from your store.`)
|
|
104
|
+
.option('-t, --theme <theme>', 'The ID of the theme that you want to delete.')
|
|
105
|
+
.action(require('../lib/commands/theme/delete'));
|
|
106
|
+
|
|
107
|
+
program.parse(process.argv);
|
|
108
|
+
!program.args.length && program.help();
|
|
109
|
+
|
|
110
|
+
const yargs = require('yargs/yargs');
|
|
111
|
+
const { hideBin } = require('yargs/helpers');
|
|
112
|
+
const { argv } = yargs(hideBin(process.argv));
|
|
113
|
+
|
|
114
|
+
report('cli_usage', {
|
|
115
|
+
command: argv._,
|
|
116
|
+
argv: hideBin(process.argv)
|
|
117
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.blogsection {
|
|
2
|
+
hr {
|
|
3
|
+
margin: 0;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.article {
|
|
8
|
+
&__title {
|
|
9
|
+
font-size: 32px;
|
|
10
|
+
color: rgba(56, 56, 56, 1);
|
|
11
|
+
line-height: 48px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__date {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
color: rgba(102, 102, 102, 1);
|
|
17
|
+
line-height: 28px;
|
|
18
|
+
margin-top: 20px;
|
|
19
|
+
margin-bottom: 10px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__excerpt {
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
color: rgba(102, 102, 102, 1);
|
|
25
|
+
line-height: 28px;
|
|
26
|
+
margin-top: 20px;
|
|
27
|
+
margin-bottom: 25px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
display: -webkit-box;
|
|
30
|
+
-webkit-line-clamp: 3;
|
|
31
|
+
-webkit-box-orient: vertical;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__readline {
|
|
35
|
+
margin-bottom: 50px;
|
|
36
|
+
margin-top: 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__read {
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
color: rgba(27, 122, 213, 1);
|
|
43
|
+
line-height: 28px;
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
margin-right: 10px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__blogs {
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
color: rgba(102, 102, 102, 1);
|
|
51
|
+
line-height: 28px;
|
|
52
|
+
word-break: break-all;
|
|
53
|
+
text-align: right;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-section-type='blog'] .container {
|
|
58
|
+
padding: 0;
|
|
59
|
+
margin-top: 56px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[data-section-type='blog'] .container .row {
|
|
63
|
+
margin: 0 -12px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-section-type='blog'] .container .col-12 {
|
|
67
|
+
padding: 0 12px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (max-width: 767.98px) {
|
|
71
|
+
[data-section-type='blog'] .container {
|
|
72
|
+
padding: 0 15px;
|
|
73
|
+
}
|
|
74
|
+
}
|