@syncify/cli 0.2.4-beta → 0.3.0-beta
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/dist/cjs.js +191 -176
- package/dist/cli.js +1 -2
- package/hot.js.liquid +1 -1
- package/package.json +28 -26
- package/pnpm-lock.yaml +957 -513
- package/readme.md +437 -269
- package/types/api.d.ts +2 -2
- package/types/bundle/cache.d.ts +101 -0
- package/types/{internal → bundle}/hot.d.ts +25 -1
- package/types/{internal → bundle}/index.d.ts +113 -23
- package/types/{internal → bundle}/requests.d.ts +95 -9
- package/types/{internal → bundle}/shared.d.ts +1 -1
- package/types/cli.d.ts +6 -0
- package/types/config/index.d.ts +42 -22
- package/types/config/terser.d.ts +74 -22
- package/types/config/views.d.ts +0 -43
- package/types/index.d.ts +15 -15
- package/types/modules/html-minifier-terser.d.ts +7 -0
- package/types/stores.d.ts +11 -0
- package/types/transforms/image.d.ts +1 -1
- package/types/transforms/json.d.ts +10 -1
- package/types/{internal/markdown.d.ts → transforms/pages.d.ts} +150 -0
- package/types/transforms/script.d.ts +3 -3
- package/types/transforms/style.d.ts +2 -2
- package/types/transforms/svg.d.ts +2 -2
- package/types/internal/cache.d.ts +0 -97
- /package/types/{internal → bundle}/commands.d.ts +0 -0
- /package/types/{internal → bundle}/errors.d.ts +0 -0
- /package/types/{internal → bundle}/file.d.ts +0 -0
- /package/types/{internal → bundle}/filters.d.ts +0 -0
- /package/types/{internal → bundle}/plugin.d.ts +0 -0
- /package/types/{internal → bundle}/processors.d.ts +0 -0
- /package/types/{internal → bundle}/reports.d.ts +0 -0
package/readme.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# SYNCIFY
|
6
6
|
|
7
|
-
A lightening fast, extensible and superior alternative Shopify CLI (Theme Development) tool. Syncify provides developers with a powerful CLI and employs an intuitive approach for creating Shopify themes.
|
7
|
+
A lightening fast, extensible and superior alternative Shopify CLI (Theme Development) tool. Syncify provides developers with a powerful CLI and employs an intuitive approach for creating Shopify themes. It's batteries included solution designed for advanced theme development.
|
8
8
|
|
9
9
|
### Demos
|
10
10
|
|
@@ -13,25 +13,24 @@ A lightening fast, extensible and superior alternative Shopify CLI (Theme Develo
|
|
13
13
|
|
14
14
|
### Key Features
|
15
15
|
|
16
|
-
- Watch, upload,
|
17
|
-
- Intelligent path mapping
|
18
|
-
- HOT
|
19
|
-
- Clear, concise, informative and beautiful CLI logging.
|
16
|
+
- Watch, upload, import and export to multiple storefronts and themes.
|
17
|
+
- Intelligent path mapping resolutions that support custom directory structures.
|
18
|
+
- HOT Reloading of assets, section, snippets, templates and layouts.
|
19
|
+
- Clear, concise, informative and beautiful TUI/CLI logging.
|
20
20
|
- An elegant global directory based metafields sync approach using JSON files.
|
21
|
-
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
- Supports additional resources like Files, Pages and Redirects.
|
21
|
+
- Supports spawned processing with existing build tools.
|
22
|
+
- Additional resource controls for syncing Files, Pages and Redirects.
|
23
|
+
- Provides a simple Reusable Sections approach for shared section references
|
25
24
|
|
26
25
|
### Why?
|
27
26
|
|
28
|
-
I have been working on the Shopify platform for several years and nothing the Shopify team have produced has
|
27
|
+
I have been working on the Shopify platform for several years and nothing the Shopify team have produced has increased my productivity. Despite the advancements Shopify has made in recent years I still find their developer tooling to be missing the mark and a clear disconnect is apparent. The Shopify CLI is cool and all but for me the approach to theme development it fails to achieve fluidity. Syncify is how I believe theme creation, development and maintenance should be done.
|
29
28
|
|
30
|
-
Syncify
|
29
|
+
Syncify provides you with essential stack tooling for producing lean, performant and refined themes. It's fast, flexible, extensible, scalable but most importantly, it's an un-restrictive workflow.
|
31
30
|
|
32
|
-
#
|
31
|
+
# Installation
|
33
32
|
|
34
|
-
Syncify is distributed as both an ESM and CJS module. It is recommended that you install as a development dependency in your project opposed to installing globally.
|
33
|
+
Syncify is distributed as both an ESM and CJS module. It is recommended that you install as a development dependency in your project opposed to installing globally. Please consider choosing and adopting [pnpm](https://pnpm.js.org/en/cli/install) as your package manager for most optimal usage.
|
35
34
|
|
36
35
|
**PNPM**
|
37
36
|
|
@@ -55,22 +54,6 @@ npm i @syncify/cli --save-dev
|
|
55
54
|
yarn add @syncify/cli --dev
|
56
55
|
```
|
57
56
|
|
58
|
-
# Overview
|
59
|
-
|
60
|
-
The main purpose of Syncify is to facilitate seamless theme development between your local machine and Shopify store/s. It ships with build, watch, download, upload, merge and pull capabilities for interfacing with remote Shopify webshop's. Together with a prompt based execution model, Syncify provides developers with theme control that aims to exceed expectations.
|
61
|
-
|
62
|
-
### Theme Files
|
63
|
-
|
64
|
-
Syncify uses built-in capabilities when handling snippets, templates, layouts, locales, configs and sections. Files using a `.liquid` or `.json` extension are typically considered theme files in syncify and always determined before handling. Content transformations like minification and path mappings are applied to these files types either natively or with plugins.
|
65
|
-
|
66
|
-
### Data Files
|
67
|
-
|
68
|
-
Syncify exposes and introduces an elegant low-level method for interfacing with shop metafields, pages, redirects and files. Pull, push, merge and delete resource capabilities are provided for data identified files and for metafield resources a directory/file path based approach is employed which allows developers to advance their workflows in a controlled and extensible manner.
|
69
|
-
|
70
|
-
### Asset Files
|
71
|
-
|
72
|
-
Syncify does not want to re-create or impede on developer preferences and tool appropriation. Build tools and bundlers specifically designed for processing different asset types can be spawned and run in parallel with Syncify's `build` and `watch` instances, but for more advanced use cases, Syncify also provides developers with pre-processor capabilities via [transforms](#transform). Transform can be leveraged for processing TypeScript, JavaScript, CSS, SCSS and SVG file types by exposing integrated configuration wrappers around popular and performant modules like ESBuild, SASS Dart, SVGO Tailwind and more!
|
73
|
-
|
74
57
|
# Setup
|
75
58
|
|
76
59
|
After installing you will need to configure a connection to your shopify store. Syncify requires you provide either an Admin API Access Token (recommended) or API Key and Secret as credentials.
|
@@ -169,10 +152,12 @@ process.env['YOUR-SHOP-NAME_API_SECRET'] = 'abcdefghijklmnopqrstuvwz';
|
|
169
152
|
|
170
153
|
# Configuration
|
171
154
|
|
172
|
-
Syncify supports `syncify.config.
|
155
|
+
Syncify supports `syncify.config.ts` and `package.json` configurations. Depending on your preference, either option suffices and no restrictions are imposed. If you are defining options within your projects `package.json` file you can assign options on the `syncify` property.
|
173
156
|
|
174
157
|
### Supported Files
|
175
158
|
|
159
|
+
Syncify supports the following configuration file types. The recommended approach is the TypeScript `syncify.config.ts` configuration file type.
|
160
|
+
|
176
161
|
- `syncify.config.ts`
|
177
162
|
- `syncify.config.js`
|
178
163
|
- `syncify.config.ts`
|
@@ -182,11 +167,11 @@ Syncify supports `syncify.config.js` and `package.json` configurations. Dependin
|
|
182
167
|
|
183
168
|
### Default Options
|
184
169
|
|
185
|
-
|
170
|
+
Below are the **default** configurations. Options commented out within [transforms](#transform), [processors](#processors) and [terser](#terser) require peer dependencies to be installed for usage.
|
186
171
|
|
187
172
|
<!-- prettier-ignore -->
|
188
173
|
```ts
|
189
|
-
import { defineConfig } from '@syncify/
|
174
|
+
import { defineConfig } from '@syncify/cli';
|
190
175
|
|
191
176
|
export default defineConfig({
|
192
177
|
input: 'source',
|
@@ -206,6 +191,7 @@ export default defineConfig({
|
|
206
191
|
history: true,
|
207
192
|
method: 'hot',
|
208
193
|
inject: true,
|
194
|
+
strategy: 'hydrate',
|
209
195
|
scroll: 'preserved',
|
210
196
|
server: 3000,
|
211
197
|
socket: 8089,
|
@@ -229,6 +215,9 @@ export default defineConfig({
|
|
229
215
|
sections: 'sections/*.liquid',
|
230
216
|
snippets: 'snippets/*.liquid',
|
231
217
|
metafields: 'metafields/**/*.json',
|
218
|
+
metaobject: [
|
219
|
+
'templates/metaobject/*.json'
|
220
|
+
],
|
232
221
|
customers: [
|
233
222
|
'templates/customers/*.json',
|
234
223
|
'templates/customers/*.liquid'
|
@@ -248,29 +237,30 @@ export default defineConfig({
|
|
248
237
|
},
|
249
238
|
views: {
|
250
239
|
snippets: {
|
251
|
-
prefixDir: false,
|
252
240
|
separator: '-',
|
253
|
-
global: []
|
241
|
+
global: [],
|
242
|
+
prefixDir: false,
|
243
|
+
renamePatterns: {}
|
254
244
|
},
|
255
245
|
sections: {
|
256
|
-
prefixDir: false,
|
257
246
|
separator: '-',
|
258
|
-
|
247
|
+
prefixDir: false,
|
248
|
+
global: [],
|
249
|
+
renamePatterns: {}
|
259
250
|
},
|
260
251
|
pages: {
|
261
|
-
|
252
|
+
safeSync: true,
|
262
253
|
author: '',
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
'markdown'
|
267
|
-
],
|
254
|
+
importLanguage: 'html',
|
255
|
+
suffixDir: false,
|
256
|
+
global: []
|
268
257
|
}
|
269
258
|
},
|
270
259
|
transforms: {
|
271
260
|
script: {},
|
272
261
|
style: {},
|
273
|
-
svg: {}
|
262
|
+
svg: {},
|
263
|
+
image: {}
|
274
264
|
},
|
275
265
|
processors: {
|
276
266
|
json: {
|
@@ -278,7 +268,10 @@ export default defineConfig({
|
|
278
268
|
indent: 2,
|
279
269
|
useTab: false,
|
280
270
|
exclude: []
|
281
|
-
}
|
271
|
+
}
|
272
|
+
|
273
|
+
// Refer to transforms section for usage
|
274
|
+
//
|
282
275
|
// esbuild: {},
|
283
276
|
// sass: {},
|
284
277
|
// postcss: [],
|
@@ -286,6 +279,7 @@ export default defineConfig({
|
|
286
279
|
// svgo: {},
|
287
280
|
// sprite: {},
|
288
281
|
// sharp: {},
|
282
|
+
|
289
283
|
},
|
290
284
|
terser: {
|
291
285
|
json: {
|
@@ -305,6 +299,9 @@ export default defineConfig({
|
|
305
299
|
stripDashes: true,
|
306
300
|
exclude: []
|
307
301
|
},
|
302
|
+
|
303
|
+
// Refer to terser section for usage
|
304
|
+
//
|
308
305
|
// script: {},
|
309
306
|
// style: {},
|
310
307
|
}
|
@@ -313,7 +310,7 @@ export default defineConfig({
|
|
313
310
|
|
314
311
|
# Getting Started
|
315
312
|
|
316
|
-
It is relatively easy to get started developing Shopify themes using Syncify. If you are converting an existing project and using Theme Kit or another build environment you can progressively adapt it into your workflow by manually configuring how Syncify should behave. Whatever the case, have a look at the [Syncify
|
313
|
+
It is relatively easy to get started developing Shopify themes using Syncify. If you are converting an existing project and using Theme Kit, Shopify CLI or another build environment you can progressively adapt it into your workflow by manually configuring how Syncify should behave. Whatever the case, have a look at the [Syncify Dawn (Basic)](https://github.com/panoply/syncify-dawn-basic) example repository as a starting point.
|
317
314
|
|
318
315
|
### Pre-requisites
|
319
316
|
|
@@ -335,16 +332,41 @@ Before going over the features Syncify provides, it is assumed that you have don
|
|
335
332
|
- [Processors](#views)
|
336
333
|
- [Terser](#views)
|
337
334
|
|
338
|
-
|
335
|
+
# Directories
|
336
|
+
|
337
|
+
Syncify requires you to define custom **base** directory paths that point to theme files. The values you provide will refer to a directory name that is relative to the root of your project. You **cannot** define multi-level directories (eg: `some/dir`) or reverse paths (eg: `../dir`). You can pass these references within your syncify configuration file or via the CLI.
|
338
|
+
|
339
|
+
> **Note**
|
340
|
+
>
|
341
|
+
> References passed in via the CLI will overwrite those provided in syncify configuration files.
|
342
|
+
|
343
|
+
### Input → Output
|
339
344
|
|
340
|
-
|
345
|
+
Syncify expects projects to have an **input** directory path which contains theme **source** files. Files contained within an input directory are written to your defined **output** directory path. The generated output will be reflective of your online store and in most cases you will add the output directory to your `.gitignore` file (because it can always be rebuilt from input). If you have become accustomed to working from a single directory structure (i.e: Shopify Dawn) it is important that you understand the difference between the **input** and **output** directory approach.
|
346
|
+
|
347
|
+
Single directory structures are not a viable approach when building modern and performant Shopify themes. Client-side (front-end) development is not SaaS specific and thus, with the proper tooling, Shopify theme development does not require one to adhere to the imposed approach of Shopify Dawn (via Shopify CLI). The argument for multi-directory architecture rests upon the millions of projects which isolate source ~ distribution variations and appropriate such logic.
|
348
|
+
|
349
|
+
### Default Structure
|
350
|
+
|
351
|
+
Below is an example of a Syncify theme structure using the defaults. Syncify will assume this directory structure if you do not provide any customizations via the CLI or within your syncify config file.
|
352
|
+
|
353
|
+
```bash
|
354
|
+
├─ source # The src directory where you develop and theme files exist
|
355
|
+
├─ theme # The output directory where source files will be written
|
356
|
+
├─ .env # Shop credentials, such as Admin API Token or API key and secret
|
357
|
+
├─ .gitignore # Files to be ignored by git, e.g: your .env file
|
358
|
+
├─ package.json # The package.json file common in all Node projects, self explanatory
|
359
|
+
├─ syncify.config.ts # The syncify config file, you can optionally use package.json
|
360
|
+
└─ tsconfig.json # TypeScript configurations, this is optional but preferred.
|
361
|
+
|
362
|
+
```
|
341
363
|
|
342
364
|
<!-- prettier-ignore -->
|
343
365
|
<table>
|
344
366
|
<thead>
|
345
367
|
<tr>
|
346
|
-
<th width="500px">
|
347
|
-
<th width="500px">CLI</th>
|
368
|
+
<th width="500px">Config File</th>
|
369
|
+
<th width="500px">CLI Flags</th>
|
348
370
|
</tr>
|
349
371
|
</thead>
|
350
372
|
<tbody>
|
@@ -352,14 +374,16 @@ In Syncify you define custom base directories for your theme files. The values y
|
|
352
374
|
<td>
|
353
375
|
|
354
376
|
<!-- prettier-ignore -->
|
355
|
-
```
|
356
|
-
{
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
377
|
+
```ts
|
378
|
+
import { defineConfig } from '@syncify/cli';
|
379
|
+
|
380
|
+
export default defineConfig({
|
381
|
+
input: 'source',
|
382
|
+
output: 'theme',
|
383
|
+
import: 'import',
|
384
|
+
export: 'export',
|
385
|
+
config: '.'
|
386
|
+
})
|
363
387
|
```
|
364
388
|
|
365
389
|
</td>
|
@@ -367,10 +391,14 @@ In Syncify you define custom base directories for your theme files. The values y
|
|
367
391
|
|
368
392
|
<!-- prettier-ignore -->
|
369
393
|
```bash
|
370
|
-
|
371
|
-
|
372
|
-
--
|
373
|
-
--
|
394
|
+
|
395
|
+
|
396
|
+
--input -i # Input Path
|
397
|
+
--output -o # Output Path
|
398
|
+
--config -c # Config Path
|
399
|
+
--export -e # Export Path
|
400
|
+
|
401
|
+
|
374
402
|
```
|
375
403
|
|
376
404
|
</td>
|
@@ -379,241 +407,93 @@ In Syncify you define custom base directories for your theme files. The values y
|
|
379
407
|
</tbody>
|
380
408
|
</table>
|
381
409
|
|
382
|
-
### Input > Output
|
383
|
-
|
384
|
-
Syncify expects projects to have an **input** directory path which contains theme **source** files. Files contained within an input directory are written to your defined **output** directory path. The generated output will be reflective of your online store and in most cases you will add the output directory to your `.gitignore` file because it can always be rebuilt from input.
|
385
|
-
|
386
|
-
If you are used to working from a single directory (e.g: Dawn) then it is important that you understand the difference between the **input** and **output** directories.
|
387
|
-
|
388
410
|
# Stores (Required)
|
389
411
|
|
390
|
-
The `stores` option accepts an **object** or **array** type. Each item will hold
|
412
|
+
The `stores` option is required and will be used to perform sync operations. The option accepts an **object** or **array** type. Each item will hold reference to your shopify store/s and their theme/s. For each store you define, you will provide the **shop** name, theme **target** name and **id**. The `themes` object uses a **key** > **value** structure, where the **key** represent a theme name (target) and the value a theme id.
|
391
413
|
|
392
|
-
|
414
|
+
The information you provide to this option can be used via the CLI when targeting and executing operations. Please refer to the [commands](#commands) portion of this readme for more information on CLI usage.
|
393
415
|
|
394
|
-
|
416
|
+
> **Note**
|
417
|
+
>
|
418
|
+
> The theme target name does need to match that defined in your online store and can be anything you like.
|
395
419
|
|
396
|
-
|
397
|
-
--theme, -t <target> # theme targeting
|
398
|
-
```
|
420
|
+
### Config File
|
399
421
|
|
400
|
-
|
422
|
+
Below is an example of how a store reference can be defined. In the example, we have only provided a store domain `shop-1.myshopify.com` and 3 themes to connect and interface with. You can provide reference to multiple stores by passing an array list using the same structure.
|
401
423
|
|
424
|
+
<!-- prettier-ignore -->
|
402
425
|
```ts
|
403
426
|
import { defineConfig } from '@syncify/cli';
|
404
427
|
|
405
428
|
export default defineConfig({
|
406
|
-
stores:
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
stage: 123456789,
|
413
|
-
test: 123456789
|
414
|
-
}
|
429
|
+
stores: {
|
430
|
+
domain: 'shop-1', // equivalent of shop-1.myshopify.com
|
431
|
+
themes: {
|
432
|
+
dev: 123456789,
|
433
|
+
prod: 123456789,
|
434
|
+
test: 123456789
|
415
435
|
}
|
416
|
-
|
436
|
+
}
|
417
437
|
});
|
418
438
|
```
|
419
439
|
|
420
|
-
|
421
|
-
<summary>
|
422
|
-
<strong><code>Domain</code></strong>
|
423
|
-
</summary>
|
424
|
-
<p>
|
440
|
+
### CLI Usage
|
425
441
|
|
426
|
-
|
427
|
-
|
428
|
-
</p>
|
429
|
-
</details>
|
430
|
-
|
431
|
-
<details>
|
432
|
-
<summary>
|
433
|
-
<strong><code>Themes</code></strong>
|
434
|
-
</summary>
|
435
|
-
<p>
|
436
|
-
|
437
|
-
The `themes` option refers to theme ids the store contains. This option is an object type which uses **key** > **value** mappings. The theme **keys** represent a unique target name, this can be any alpha numeric value. The **key** value is used by the CLI as target reference. The **value** should be the theme id.
|
438
|
-
|
439
|
-
</p>
|
440
|
-
</details>
|
441
|
-
|
442
|
-
# Metafields
|
442
|
+
Based on the above example configuration, this is how we would target and perform operations with the store and its theme/s using the CLI. In Syncify, when performing a sync action, you pass the store name as the first argument, followed by any `--flags`.
|
443
443
|
|
444
|
-
|
445
|
-
|
446
|
-
The `metafields` directory `path` reference is where you can provide **global** JSON metafield files that can be synced to your Shopify store. Metafield sync capabilities provided by Syncify use a simple **directory** > **file** based approach. The sub-directory names represent a metafield `namespace` value and JSON file names contained within represent metafield `key` values.
|
447
|
-
|
448
|
-
> Syncify will keep your remote and local metafield references aligned with one another and warn you when local versions do not match remote versions. This will help prevent you from overwriting changes that may have been applied by third-party apps or online within your store.
|
449
|
-
|
450
|
-
**Pull Metafields**
|
444
|
+
<!-- prettier-ignore -->
|
445
|
+
```bash
|
451
446
|
|
452
|
-
|
447
|
+
# FLAGS
|
453
448
|
|
454
|
-
|
455
|
-
$ syncify --metafields --pull
|
456
|
-
```
|
449
|
+
--theme, -t <target> # Theme name or comma separated list of theme names to target
|
457
450
|
|
458
|
-
|
451
|
+
# EXAMPLES
|
459
452
|
|
460
|
-
|
453
|
+
$ syncify shop-1 -t dev --watch # Running watch mode and targeting dev theme
|
454
|
+
$ syncify shop-1 -t dev,prod --upload # Uploading to the dev and prod themes of shop-1
|
461
455
|
|
462
456
|
```
|
463
|
-
$ syncify --metafields --merge
|
464
|
-
```
|
465
|
-
|
466
|
-
**Structure**
|
467
|
-
|
468
|
-
In order to best illustrate how the metafield sync capabilities work it is important that you understand the structure logic. The directory based approach and naming conventions employed are imperative and strict. Syncify wants to prevent irreversible overwrites or deletions from occurring, so please be mindful and wary when using this feature.
|
469
|
-
|
470
|
-
<table>
|
471
|
-
<thead>
|
472
|
-
<tr>
|
473
|
-
<th align="left" width="300px"> Metafield Structure</th>
|
474
|
-
<th align="left" width="700px"> Description</th>
|
475
|
-
</tr>
|
476
|
-
</thead>
|
477
|
-
<tbody>
|
478
|
-
<td>
|
479
|
-
<pre>
|
480
|
-
<code>
|
481
|
-
source
|
482
|
-
│
|
483
|
-
└── metafields
|
484
|
-
│
|
485
|
-
├── garment
|
486
|
-
│ ├── fits.json
|
487
|
-
│ ├── sizes.json
|
488
|
-
│ └── fabrics.json ㅤㅤ ㅤㅤ ㅤㅤ
|
489
|
-
│
|
490
|
-
└── details
|
491
|
-
├── colors.json
|
492
|
-
└── weight.json
|
493
|
-
</code>
|
494
|
-
</pre>
|
495
|
-
</td>
|
496
|
-
<td>
|
497
|
-
Metafields will be published to the global <code>shop</code> object.<br>
|
498
|
-
Syncify will use the sub-directory names as the metafield<br>
|
499
|
-
<code>namespace</code> and the JSON file names contained within<br>
|
500
|
-
each namespace directory are used as the metafield <code>key</code> name.<br><br>
|
501
|
-
<strong>Example:</strong><br><br>
|
502
|
-
<ul>
|
503
|
-
<li><code>{{ shop.metafields.garment.fits.value }}</code></li>
|
504
|
-
<li><code>{{ shop.metafields.garment.sizes.value }}</code></li>
|
505
|
-
<li><code>{{ shop.metafields.garment.fabrics.value }}</code></li>
|
506
|
-
<li><code>{{ shop.metafields.details.colors.value }}</code></li>
|
507
|
-
<li><code>{{ shop.metafields.details.weight.value }}</code></li>
|
508
|
-
</ul>
|
509
|
-
</td>
|
510
|
-
</tr>
|
511
|
-
</tbody>
|
512
|
-
</table>
|
513
457
|
|
514
458
|
### Options
|
515
459
|
|
516
460
|
<details>
|
517
461
|
<summary>
|
518
|
-
<strong><code>
|
519
|
-
</summary>
|
520
|
-
<p>
|
521
|
-
|
522
|
-
The `input` option refers to your projects **src** location This is the directory where your development theme files exist. Syncify defaults this directory to `source`. The value defined here will be prepended to any path you define within `paths`.
|
523
|
-
|
524
|
-
</p>
|
525
|
-
</details>
|
526
|
-
|
527
|
-
<details>
|
528
|
-
<summary>
|
529
|
-
<strong><code>Output</code></strong>
|
530
|
-
</summary>
|
531
|
-
<p>
|
532
|
-
|
533
|
-
The `output` option refers to your project **dist** location. This is the directory where transformed theme files from `input` will be written. Syncify defaults this to `theme`. The `output` directory will be reflective of your online shop. You should point any asset files executing via spawned processes to the `assets` directory contained within this location.
|
534
|
-
|
535
|
-
</p>
|
536
|
-
</details>
|
537
|
-
|
538
|
-
<details>
|
539
|
-
<summary>
|
540
|
-
<strong><code>Config</code></strong>
|
541
|
-
</summary>
|
542
|
-
<p>
|
543
|
-
|
544
|
-
The `config` option refers to a directory within your project where configuration files exist, like (for example) a `rollup.config.js` or `webpack.config.js` file. Syncify by default (when this option is **undefined**) will look for config files in the root of your project but this might not always be ideal as it can create clutter in the workspace. The `config` directory allows you to optionally place spawned config files within a sub-directory and informs Syncify to look for these files from that location.
|
545
|
-
|
546
|
-
> Typically this is directory is named `scripts` in node projects.
|
547
|
-
|
548
|
-
</p>
|
549
|
-
</details>
|
550
|
-
|
551
|
-
<details>
|
552
|
-
<summary>
|
553
|
-
<strong><code>Import</code></strong>
|
554
|
-
</summary>
|
555
|
-
<p>
|
556
|
-
|
557
|
-
The `import` option refers to a directory where downloaded themes will be written. Syncify provides the ability to download themes from your online store and it is within this directory the files are created.
|
558
|
-
|
559
|
-
</p>
|
560
|
-
</details>
|
561
|
-
|
562
|
-
<details>
|
563
|
-
<summary>
|
564
|
-
<strong><code>Export</code></strong>
|
462
|
+
<strong><code>Domain</code></strong>
|
565
463
|
</summary>
|
566
464
|
<p>
|
567
465
|
|
568
|
-
The `
|
466
|
+
The `domain` option expects a string value, which is your Shopify store name without the `myshopify.com` portion. The domain will be used by the CLI as a target argument. Each store (domain) can have multiple themes.
|
569
467
|
|
570
468
|
</p>
|
571
469
|
</details>
|
572
470
|
|
573
471
|
<details>
|
574
472
|
<summary>
|
575
|
-
<strong><code>
|
473
|
+
<strong><code>Themes</code></strong>
|
576
474
|
</summary>
|
577
475
|
<p>
|
578
476
|
|
579
|
-
The `
|
580
|
-
|
581
|
-
**Correct**
|
582
|
-
|
583
|
-
```
|
584
|
-
{
|
585
|
-
"dirs": {
|
586
|
-
"metafields": "source/metafields"
|
587
|
-
}
|
588
|
-
}
|
589
|
-
```
|
590
|
-
|
591
|
-
**Invalid**
|
592
|
-
|
593
|
-
```
|
594
|
-
{
|
595
|
-
"dirs": {
|
596
|
-
"metafields": "source/metafields/**/*.json"
|
597
|
-
}
|
598
|
-
}
|
599
|
-
```
|
477
|
+
The `themes` option refers to theme ids the store contains. This option is an object type which uses **key** > **value** mappings. The theme **keys** represent a unique target name, this can be any alpha numeric value. The **key** value is used by the CLI as target reference. The **value** should be the theme id.
|
600
478
|
|
601
479
|
</p>
|
602
480
|
</details>
|
603
481
|
|
604
482
|
# Paths
|
605
483
|
|
606
|
-
The `paths` option allows you to define
|
484
|
+
The `paths` option allows you to define your theme/projects structure within the defined `input` directory. Syncify does not require you set a development structure required by Shopify and you should begin to decouple from that logic as it is generally flawed and restrictive when building advanced or large scale stores.
|
485
|
+
|
486
|
+
Each path key represents a theme directory or resource point. Path options accept either a `string` or `string[]` array list of glob [anymatch](https://www.npmjs.com/package/anymatch) patterns and can point to files contained within sub-directories of infinite depth. All defined references will automatically resolve to the defined `input` directory starting point, so you do not need to include it within your path definitions.
|
607
487
|
|
608
|
-
|
488
|
+
There is no restrictions or limitations imposed on structures other than **input** relativity. Syncify will obtain full resolution and build a valid theme structure that Shopify understands when generating an **output**.
|
609
489
|
|
610
|
-
###
|
490
|
+
### Config File
|
611
491
|
|
612
|
-
By default, Syncify assumes you are using
|
492
|
+
By default, Syncify assumes you are using a basic (defaults) structure. This structure is certainly not the preferred format and when leveraging Syncify you are encouraged to establish a structure which suits your project and adheres to your workflow or tastes.
|
613
493
|
|
614
494
|
<!-- prettier-ignore -->
|
615
495
|
```ts
|
616
|
-
import { defineConfig } from '@syncify/
|
496
|
+
import { defineConfig } from '@syncify/cli';
|
617
497
|
|
618
498
|
export default defineConfig({
|
619
499
|
input: 'source',
|
@@ -636,7 +516,7 @@ export default defineConfig({
|
|
636
516
|
|
637
517
|
### Custom Structures
|
638
518
|
|
639
|
-
Below are **2** different **input** structures and an **output** structure. The **default structure** is what Syncify will use (as above) if no `paths` have been defined in your configuration
|
519
|
+
Below are **2** different **input** structures and an **output** structure. The **default structure** is what Syncify will use (as above) if no `paths` have been defined in your configuration (the tool defaults to this). The **customized structure** is an example of how you _could_ arrange an `input` directory using the Syncify `paths` option. The **output structure** is what Syncify will generated as an **output** which Shopify can digest.
|
640
520
|
|
641
521
|
<table>
|
642
522
|
<thead>
|
@@ -666,6 +546,7 @@ Below are **2** different **input** structures and an **output** structure. The
|
|
666
546
|
├─ sections
|
667
547
|
├─ snippets
|
668
548
|
└─ templates
|
549
|
+
├─ metaobject
|
669
550
|
└─ customers
|
670
551
|
ㅤ
|
671
552
|
ㅤ
|
@@ -692,6 +573,7 @@ Below are **2** different **input** structures and an **output** structure. The
|
|
692
573
|
├─ scripts
|
693
574
|
└─ views
|
694
575
|
├─ customers
|
576
|
+
├─ meta
|
695
577
|
├─ sections
|
696
578
|
├─ snippets
|
697
579
|
├─ templates
|
@@ -717,6 +599,7 @@ Below are **2** different **input** structures and an **output** structure. The
|
|
717
599
|
├─ sections
|
718
600
|
├─ snippets
|
719
601
|
└─ template
|
602
|
+
├─ metaobject
|
720
603
|
└─ customers ㅤ
|
721
604
|
ㅤ
|
722
605
|
ㅤ
|
@@ -729,7 +612,9 @@ Below are **2** different **input** structures and an **output** structure. The
|
|
729
612
|
</tbody>
|
730
613
|
</table>
|
731
614
|
|
732
|
-
There is no distributed difference between the **default** and **customized** structures illustrated above. Both would generate an **output** that Shopify understands, requires and reasons with. Only the **input** source locations differ. The **output** Syncify creates will always be written to a standard Shopify theme structure regardless of how you may decide to organize **input** paths. Custom structures give you creative freedom and does not impose a restrictive workflow you may have become behest to working with Dawn and the Shopify CLI.
|
615
|
+
There is no distributed difference between the **default** and **customized** structures illustrated above. Both would generate an **output** that Shopify understands, requires and reasons with. Only the **input** source locations differ. The **output** Syncify creates will always be written to a standard Shopify theme structure regardless of how you may decide to organize **input** paths. Custom structures give you creative freedom and does not impose a restrictive workflow you may have become behest to working with Dawn and the Shopify CLI.
|
616
|
+
|
617
|
+
Welcome to the better approach, you're welcome.
|
733
618
|
|
734
619
|
### Options
|
735
620
|
|
@@ -833,23 +718,296 @@ An array list of glob path patterns to `.json` or `.liquid` **template** files.
|
|
833
718
|
</p>
|
834
719
|
</details>
|
835
720
|
|
721
|
+
<details>
|
722
|
+
<summary>
|
723
|
+
<strong><code>Metaobject</code></strong>
|
724
|
+
</summary>
|
725
|
+
<p>
|
726
|
+
|
727
|
+
An array list of glob path patterns to `.json` **metaobject** template files. These will be written to the `{output}/templates/metaobject` directory of your defined `output` path.
|
728
|
+
|
729
|
+
</p>
|
730
|
+
</details>
|
731
|
+
|
732
|
+
# Shared Sections
|
733
|
+
|
734
|
+
Syncify provides an elegant and simple solution for shared sections. This is an experimental feature and aims to provide developers an easy way to re-use section contents between section files containing schema.
|
735
|
+
|
836
736
|
# HOT
|
837
737
|
|
838
|
-
Live reloading is supported in watch mode. Syncify leverages websocket's, XHR and statically served endpoints to provide this capability with zero configuration or the need to install or setup additional tooling. No extensions and no complexities.
|
738
|
+
Live reloading is supported in watch mode. Syncify leverages websocket's, XHR and statically served endpoints to provide this capability with zero configuration or the need to install or setup additional tooling. No extensions and no complexities. Syncify will listen for messages sent via websocket on the client and carry out HOT replacements of Assets, Sections, Snippets, Layouts and Templates without triggering full-page refreshes. HOT Reloads can be enabled by passing the `--hot` flag via the CLI.
|
839
739
|
|
840
740
|
> The HOT reload approach Syncify employs tends to be considerably faster than HOT reloading with the Shopify CLI.
|
841
741
|
|
842
742
|
### Assets
|
843
743
|
|
844
|
-
SASS/CSS, TypeScript/JavaScript and SVG asset file types are HOT reloaded by swapping out the URL's or containing source with localhost equivalents
|
744
|
+
SASS/CSS, TypeScript/JavaScript and SVG asset file types are HOT reloaded by swapping out the URL's or containing source with localhost equivalents served statically by Syncify.
|
845
745
|
|
846
|
-
###
|
746
|
+
### Section
|
847
747
|
|
848
|
-
|
748
|
+
Dynamic sections, static sections of a combination of both are fetched via the Ajax [Section rendering API](https://shopify.dev/docs/api/section-rendering). Replacements are applied to fragments in real-time and surrounding nodes are left intact.
|
849
749
|
|
850
750
|
### Snippets, Layouts and Templates
|
851
751
|
|
852
|
-
In order to provide HOT replacements Syncify employs a mild form of DOM hydration. Snippets,
|
752
|
+
In order to provide HOT replacements Syncify employs a mild form of DOM hydration. Snippets, templates and Liquid/JSON layout files will inject HTML comments `<!-- hot:1aa4f32cf9 -->` containing a UUID before they are uploaded to themes. Syncify will pass this UUID to the client via websocket and once received an XHR (fetch) will be triggered. The response of the XHR request is then parsed and all nodes which proceed the injected UUID comment/s are plucked and swapped in the persisted DOM while leaving unchanged elements intact. The approach employed by Syncify is a mild form DOM hydration that's 10x faster than invoking a hard-refresh.
|
753
|
+
|
754
|
+
## Programmatic Control
|
755
|
+
|
756
|
+
Running in HOT mode will result in Syncify injecting a snippet into layouts. The snippet is the socket receiver that is responsible for executing replacements/morphs and exposes programmatic control for developers who can to customize or hook into the HOT reload rendering cycles.
|
757
|
+
|
758
|
+
```ts
|
759
|
+
// STATUS
|
760
|
+
//
|
761
|
+
window.syncify.ready: boolean
|
762
|
+
window.syncify.connected: boolean;
|
763
|
+
|
764
|
+
// RELOADS
|
765
|
+
//
|
766
|
+
window.syncify.assets(): void;
|
767
|
+
window.syncify.reload(): void;
|
768
|
+
window.syncify.refresh(): void
|
769
|
+
|
770
|
+
// SECTIONS
|
771
|
+
//
|
772
|
+
window.syncify.sections.get()
|
773
|
+
window.syncify.sections.list()
|
774
|
+
window.syncify.sections.load()
|
775
|
+
|
776
|
+
// LABEL
|
777
|
+
//
|
778
|
+
window.syncify.style.parent({ /* CSS */ });
|
779
|
+
window.syncify.style.label({ /* CSS */ });
|
780
|
+
```
|
781
|
+
|
782
|
+
# Pages
|
783
|
+
|
784
|
+
Syncify supports page sync and employs an intuitive approach to working with static pages for stores. The [paths](#paths) **pages** option is where you can provide path file references to be synced. Pages in Syncify can be either `.html` (markup) or `.md` (markdown) files and cannot contain Liquid syntax (Shopify does not support Liquid in pages only static markup). Syncify also support frontmatter in page files, this allows you to pass in additional data when syncing to store/s.
|
785
|
+
|
786
|
+
### Options
|
787
|
+
|
788
|
+
The `pages` setting available in the `views` option of your `syncify.config.ts` file allows you to configure page processing and transforms. In Syncify, frontmatter can be used to configure per-page control.
|
789
|
+
|
790
|
+
<!--prettier-ignore-->
|
791
|
+
```js
|
792
|
+
import { defaultConfig } from '@syncify/cli'
|
793
|
+
|
794
|
+
export default defineConfig({
|
795
|
+
...,
|
796
|
+
paths: {
|
797
|
+
// Set the location of page files
|
798
|
+
pages: [
|
799
|
+
'pages/*.md',
|
800
|
+
'pages/*.html'
|
801
|
+
]
|
802
|
+
},
|
803
|
+
views: {
|
804
|
+
|
805
|
+
pages: {
|
806
|
+
suffixDir: false, // When true, directory name will be used for template_suffix
|
807
|
+
safeSync: true, // Ensure local and remote versions are aligned
|
808
|
+
author: '', // Fallback author name
|
809
|
+
global: [], // List of directories to exclude from applying template_suffix
|
810
|
+
importLanguage: 'html' // Set the import language when remote sources sync to local ones
|
811
|
+
}
|
812
|
+
|
813
|
+
}
|
814
|
+
})
|
815
|
+
```
|
816
|
+
|
817
|
+
### Remote and Local sources
|
818
|
+
|
819
|
+
By default, syncify will perform **safe** synchronization. The `safeSync` option instructs syncify to pull down remote versions before uploading local ones in watch and upload modes. This operation ensures that you do not overwrite page content in situations where changes have been applied in your store since the last sync was performed on your local machine. Syncify will prompt you when misalignment is detected and allow you to pull in the remote versions.
|
820
|
+
|
821
|
+
### Markdown Support
|
822
|
+
|
823
|
+
Pages can be written in markdown, Syncify will transform `.md` page files into valid HTML markup when syncing. Markdown pages are parsed and transformed using the the powerful [markdown-it](https://github.com/markdown-it/markdown-it) and support Github flavored markdown syntax. In addition to Markdown → HTML generation, Syncify can also perform reversed conversion (HTML → Markdown). Using the `importLanguage` option, any time a remote to local alignment is carried out, files will be written in markdown.
|
824
|
+
|
825
|
+
### Frontmatter Support
|
826
|
+
|
827
|
+
You can pass frontmatter data in page files. Page frontmatter can be used to control per-page publishing settings and allows for additional request payloads to be passed. Syncify supports a modest schema structure for page frontmatter.
|
828
|
+
|
829
|
+
<!-- prettier-ignore -->
|
830
|
+
```yaml
|
831
|
+
---
|
832
|
+
title: 'Lorem Ipsum' # The page title
|
833
|
+
handle: '/some-handle' # Custom page handle
|
834
|
+
template: 'example' # Specify a template_suffix
|
835
|
+
published: true # Whether the page is published
|
836
|
+
links: false # Auto-convert URL-like
|
837
|
+
breaks: true # Convert '\n' into `<br>`
|
838
|
+
metafields: # Pass in additional metafields
|
839
|
+
- namespace: 'foo'
|
840
|
+
key: 'greeting'
|
841
|
+
type: 'single_line_text_field'
|
842
|
+
value: 'Hello World!'
|
843
|
+
- namespace: 'bar'
|
844
|
+
key: 'some_condition'
|
845
|
+
type: 'boolean'
|
846
|
+
value: true
|
847
|
+
---
|
848
|
+
```
|
849
|
+
|
850
|
+
# Metafields
|
851
|
+
|
852
|
+
###### NOT YET AVAILABLE
|
853
|
+
|
854
|
+
The `metafields` directory `path` reference is where you can provide **global** JSON metafield files that can be synced to your Shopify store. Metafield sync capabilities provided by Syncify use a simple **directory** > **file** based approach. The sub-directory names represent a metafield `namespace` value and JSON file names contained within represent metafield `key` values.
|
855
|
+
|
856
|
+
> Syncify will keep your remote and local metafield references aligned with one another and warn you when local versions do not match remote versions. This will help prevent you from overwriting changes that may have been applied by third-party apps or online within your store.
|
857
|
+
|
858
|
+
**Pull Metafields**
|
859
|
+
|
860
|
+
Syncify provides you with simple interactive prompt based approach for importing pre-existing metafields from your online store. You can optionally choose which metafields you'd like to maintain. Use the `-m` or `--metafields` flag together with the `--pull` flag on the command line to download metafields:
|
861
|
+
|
862
|
+
```
|
863
|
+
$ syncify --metafields --pull
|
864
|
+
```
|
865
|
+
|
866
|
+
**Merge Metafields**
|
867
|
+
|
868
|
+
Working with metafields from your local machine may have result in unexpected overwrites if changes were made to remote versions that conflict with local versions. In order to combat this Syncify support **merge** capabilities which can be used to merge changes when metafield modification timestamps differ. Use the `-m` or `--metafields` flag together with the `--merge` flag on the command line perform local and remote alignments.
|
869
|
+
|
870
|
+
```
|
871
|
+
$ syncify --metafields --merge
|
872
|
+
```
|
873
|
+
|
874
|
+
**Structure**
|
875
|
+
|
876
|
+
In order to best illustrate how the metafield sync capabilities work it is important that you understand the structure logic. The directory based approach and naming conventions employed are imperative and strict. Syncify wants to prevent irreversible overwrites or deletions from occurring, so please be mindful and wary when using this feature.
|
877
|
+
|
878
|
+
<table>
|
879
|
+
<thead>
|
880
|
+
<tr>
|
881
|
+
<th align="left" width="300px"> Metafield Structure</th>
|
882
|
+
<th align="left" width="700px"> Description</th>
|
883
|
+
</tr>
|
884
|
+
</thead>
|
885
|
+
<tbody>
|
886
|
+
<td>
|
887
|
+
<pre>
|
888
|
+
<code>
|
889
|
+
source
|
890
|
+
│
|
891
|
+
└── metafields
|
892
|
+
│
|
893
|
+
├── garment
|
894
|
+
│ ├── fits.json
|
895
|
+
│ ├── sizes.json
|
896
|
+
│ └── fabrics.json ㅤㅤ ㅤㅤ ㅤㅤ
|
897
|
+
│
|
898
|
+
└── details
|
899
|
+
├── colors.json
|
900
|
+
└── weight.json
|
901
|
+
</code>
|
902
|
+
</pre>
|
903
|
+
</td>
|
904
|
+
<td>
|
905
|
+
Metafields will be published to the global <code>shop</code> object.<br>
|
906
|
+
Syncify will use the sub-directory names as the metafield<br>
|
907
|
+
<code>namespace</code> and the JSON file names contained within<br>
|
908
|
+
each namespace directory are used as the metafield <code>key</code> name.<br><br>
|
909
|
+
<strong>Example:</strong><br><br>
|
910
|
+
<ul>
|
911
|
+
<li><code>{{ shop.metafields.garment.fits.value }}</code></li>
|
912
|
+
<li><code>{{ shop.metafields.garment.sizes.value }}</code></li>
|
913
|
+
<li><code>{{ shop.metafields.garment.fabrics.value }}</code></li>
|
914
|
+
<li><code>{{ shop.metafields.details.colors.value }}</code></li>
|
915
|
+
<li><code>{{ shop.metafields.details.weight.value }}</code></li>
|
916
|
+
</ul>
|
917
|
+
</td>
|
918
|
+
</tr>
|
919
|
+
</tbody>
|
920
|
+
</table>
|
921
|
+
|
922
|
+
### Options
|
923
|
+
|
924
|
+
<details>
|
925
|
+
<summary>
|
926
|
+
<strong><code>Input</code></strong>
|
927
|
+
</summary>
|
928
|
+
<p>
|
929
|
+
|
930
|
+
The `input` option refers to your projects **src** location This is the directory where your development theme files exist. Syncify defaults this directory to `source`. The value defined here will be prepended to any path you define within `paths`.
|
931
|
+
|
932
|
+
</p>
|
933
|
+
</details>
|
934
|
+
|
935
|
+
<details>
|
936
|
+
<summary>
|
937
|
+
<strong><code>Output</code></strong>
|
938
|
+
</summary>
|
939
|
+
<p>
|
940
|
+
|
941
|
+
The `output` option refers to your project **dist** location. This is the directory where transformed theme files from `input` will be written. Syncify defaults this to `theme`. The `output` directory will be reflective of your online shop. You should point any asset files executing via spawned processes to the `assets` directory contained within this location.
|
942
|
+
|
943
|
+
</p>
|
944
|
+
</details>
|
945
|
+
|
946
|
+
<details>
|
947
|
+
<summary>
|
948
|
+
<strong><code>Config</code></strong>
|
949
|
+
</summary>
|
950
|
+
<p>
|
951
|
+
|
952
|
+
The `config` option refers to a directory within your project where configuration files exist, like (for example) a `rollup.config.js` or `webpack.config.js` file. Syncify by default (when this option is **undefined**) will look for config files in the root of your project but this might not always be ideal as it can create clutter in the workspace. The `config` directory allows you to optionally place spawned config files within a sub-directory and informs Syncify to look for these files from that location.
|
953
|
+
|
954
|
+
> Typically this is directory is named `scripts` in node projects.
|
955
|
+
|
956
|
+
</p>
|
957
|
+
</details>
|
958
|
+
|
959
|
+
<details>
|
960
|
+
<summary>
|
961
|
+
<strong><code>Import</code></strong>
|
962
|
+
</summary>
|
963
|
+
<p>
|
964
|
+
|
965
|
+
The `import` option refers to a directory where downloaded themes will be written. Syncify provides the ability to download themes from your online store and it is within this directory the files are created.
|
966
|
+
|
967
|
+
</p>
|
968
|
+
</details>
|
969
|
+
|
970
|
+
<details>
|
971
|
+
<summary>
|
972
|
+
<strong><code>Export</code></strong>
|
973
|
+
</summary>
|
974
|
+
<p>
|
975
|
+
|
976
|
+
The `export` option refers to a directory where packaged (`.zip`) themes will be written when running the `package` command. Packaged themes will be prepended with the version number defined in the projects `package.json` file.
|
977
|
+
|
978
|
+
</p>
|
979
|
+
</details>
|
980
|
+
|
981
|
+
<details>
|
982
|
+
<summary>
|
983
|
+
<strong><code>Metafields</code></strong>
|
984
|
+
</summary>
|
985
|
+
<p>
|
986
|
+
|
987
|
+
The `metafields` option refers to a directory within your project which can contain global JSON metafield files. The path location you reference here should point to a directory of sub-directories. Please refer to the [Metafields](#metafields) section for more information.
|
988
|
+
|
989
|
+
**Correct**
|
990
|
+
|
991
|
+
```
|
992
|
+
{
|
993
|
+
"dirs": {
|
994
|
+
"metafields": "source/metafields"
|
995
|
+
}
|
996
|
+
}
|
997
|
+
```
|
998
|
+
|
999
|
+
**Invalid**
|
1000
|
+
|
1001
|
+
```
|
1002
|
+
{
|
1003
|
+
"dirs": {
|
1004
|
+
"metafields": "source/metafields/**/*.json"
|
1005
|
+
}
|
1006
|
+
}
|
1007
|
+
```
|
1008
|
+
|
1009
|
+
</p>
|
1010
|
+
</details>
|
853
1011
|
|
854
1012
|
# Spawn
|
855
1013
|
|
@@ -873,7 +1031,7 @@ The Syncify **build** mode re-builds the entire theme and you might choose to ru
|
|
873
1031
|
|
874
1032
|
<!-- prettier-ignore -->
|
875
1033
|
```ts
|
876
|
-
import { defineConfig } from '@syncify/
|
1034
|
+
import { defineConfig } from '@syncify/cli';
|
877
1035
|
|
878
1036
|
export default defineConfig({
|
879
1037
|
|
@@ -899,7 +1057,7 @@ If you are processing JavaScript asset files using the [Rollup](https://rollupjs
|
|
899
1057
|
|
900
1058
|
<!-- prettier-ignore -->
|
901
1059
|
```ts
|
902
|
-
import { defineConfig } from '@syncify/
|
1060
|
+
import { defineConfig } from '@syncify/cli';
|
903
1061
|
|
904
1062
|
export default defineConfig({
|
905
1063
|
spawn: {
|
@@ -922,7 +1080,7 @@ If you are processing JavaScript asset files using the [Webpack](https://webpack
|
|
922
1080
|
|
923
1081
|
<!-- prettier-ignore -->
|
924
1082
|
```ts
|
925
|
-
import { defineConfig } from '@syncify/
|
1083
|
+
import { defineConfig } from '@syncify/cli';
|
926
1084
|
|
927
1085
|
export default defineConfig({
|
928
1086
|
spawn: {
|
@@ -945,7 +1103,7 @@ Though it is unlikely you'd ever need to include 2 different JavaScript bundlers
|
|
945
1103
|
|
946
1104
|
<!-- prettier-ignore -->
|
947
1105
|
```ts
|
948
|
-
import { defineConfig } from '@syncify/
|
1106
|
+
import { defineConfig } from '@syncify/cli';
|
949
1107
|
|
950
1108
|
export default defineConfig({
|
951
1109
|
spawn: {
|
@@ -966,7 +1124,7 @@ export default defineConfig({
|
|
966
1124
|
|
967
1125
|
# Transform
|
968
1126
|
|
969
|
-
In Syncify, asset files can be transformed before being written to the defined `output` directory and uploaded to your Shopify store. The `transform` option provides users with control of the "asset pipeline" and Syncify exposes configuration wrappers for handling files together with modern developer tooling.
|
1127
|
+
In Syncify, asset files can be transformed before being written to the defined `output` directory and uploaded to your Shopify store. The `transform` option provides users with control of the "asset pipeline" and Syncify exposes configuration wrappers for handling files together with modern developer tooling. Transforms are totally optional, and require you to provide additional modules in your project.
|
970
1128
|
|
971
1129
|
Syncify supports built-in and partial processing for the following file types:
|
972
1130
|
|
@@ -1002,7 +1160,7 @@ The `script` options accepts several different structures and it is up to you ho
|
|
1002
1160
|
|
1003
1161
|
<!--prettier-ignore-->
|
1004
1162
|
```ts
|
1005
|
-
import { defineConfig } from '@syncify/
|
1163
|
+
import { defineConfig } from '@syncify/cli';
|
1006
1164
|
|
1007
1165
|
export default defineConfig({
|
1008
1166
|
transforms: {
|
@@ -1028,7 +1186,7 @@ You may prefer to use rename (entry point) structures instead. When we are using
|
|
1028
1186
|
|
1029
1187
|
<!--prettier-ignore-->
|
1030
1188
|
```ts
|
1031
|
-
import { defineConfig } from '@syncify/
|
1189
|
+
import { defineConfig } from '@syncify/cli';
|
1032
1190
|
|
1033
1191
|
export default defineConfig({
|
1034
1192
|
transforms: {
|
@@ -1099,7 +1257,7 @@ In the below example we are generating multiple stylesheets and compiling both S
|
|
1099
1257
|
|
1100
1258
|
<!-- prettier-ignore-->
|
1101
1259
|
```ts
|
1102
|
-
import { defineConfig } from '@syncify/
|
1260
|
+
import { defineConfig } from '@syncify/cli'
|
1103
1261
|
|
1104
1262
|
export default defineConfig({
|
1105
1263
|
transforms: {
|
@@ -1705,7 +1863,7 @@ export default defineConfig({
|
|
1705
1863
|
|
1706
1864
|
# Terser
|
1707
1865
|
|
1708
|
-
The **Terser** option is for minification configuration options. Syncify supports minification and compression of Liquid, HTML JSON and also provides handling around Script and Style
|
1866
|
+
The **Terser** option is for minification configuration options. Syncify supports minification and compression of Liquid, HTML JSON and also provides handling around Script and Style transform file types. Terse output is core to theme development using Syncify and developers should indeed get into a habit a distributing themes in terse a format.
|
1709
1867
|
|
1710
1868
|
### Does Liquid Minification Matter?
|
1711
1869
|
|
@@ -1713,11 +1871,11 @@ When we are talking about Liquid syntax specifically, there is no real measurabl
|
|
1713
1871
|
|
1714
1872
|
### Usage
|
1715
1873
|
|
1716
|
-
Produce terse output by passing `--terse` command flag. The `--prod` flag will also produce terse output. You can pass a boolean `false` to options to skip minification.
|
1874
|
+
Produce terse output by passing the `--terse` command flag. The `--prod` flag will also produce terse output. You can pass a boolean `false` to options to skip minification. The `terser` options defined within your Syncify configuration file will be used when performing minification. If all terser options are set to `false` then (logically) terse minification will not be applied.
|
1717
1875
|
|
1718
1876
|
### Terse Options
|
1719
1877
|
|
1720
|
-
Below is is the default configuration Syncify uses for minification.
|
1878
|
+
Below is is the default configuration Syncify uses for minification. The `json`, `liquid`, `markup` and `script` options accept either an object or a boolean value. Passing boolean `true` will use defaults, whereas boolean `false` will skip minification.
|
1721
1879
|
|
1722
1880
|
<!-- prettier-ignore -->
|
1723
1881
|
```ts
|
@@ -1730,18 +1888,28 @@ export default defineConfig({
|
|
1730
1888
|
config: true,
|
1731
1889
|
locales: true,
|
1732
1890
|
metafields: true,
|
1891
|
+
metaobject: true,
|
1892
|
+
groups: true,
|
1733
1893
|
templates: true,
|
1734
1894
|
exclude: []
|
1735
1895
|
},
|
1736
|
-
|
1896
|
+
liquid: {
|
1737
1897
|
collapseWhitespace: true,
|
1738
|
-
|
1898
|
+
collapseInner: false,
|
1899
|
+
removeComments: true,
|
1900
|
+
minifyJavascript: false,
|
1901
|
+
minifySchema: false,
|
1902
|
+
minifyStyle: false,
|
1903
|
+
minifyStylesheet: false,
|
1904
|
+
stripDashes: true,
|
1905
|
+
exclude: []
|
1906
|
+
},
|
1907
|
+
markup: {
|
1908
|
+
collapseWhitespace: true,
|
1909
|
+
minifyScriptJSON: true,
|
1739
1910
|
minifyScript: true,
|
1740
1911
|
minifyStyle: true,
|
1741
|
-
replaceSugar: true,
|
1742
1912
|
removeComments: true,
|
1743
|
-
stripDashes: true,
|
1744
|
-
swapAssign: true,
|
1745
1913
|
exclude: []
|
1746
1914
|
},
|
1747
1915
|
// Requires ESBuild to be installed
|
@@ -2073,11 +2241,11 @@ util.spawned(): string[]
|
|
2073
2241
|
|
2074
2242
|
# Contributing
|
2075
2243
|
|
2076
|
-
This project uses [pnpm](https://pnpm.js.org/en/cli/install). Fork the project, run `pnpm i` and you're good to go.
|
2244
|
+
This project uses [pnpm](https://pnpm.js.org/en/cli/install). Fork the project, run `pnpm i` and you're good to go.
|
2077
2245
|
|
2078
2246
|
# Author
|
2079
2247
|
|
2080
|
-
Created by [Nίκος Σαβίδης](https://github.com/panoply)
|
2248
|
+
Created by [Nίκος Σαβίδης](https://github.com/panoply).
|
2081
2249
|
|
2082
2250
|
### Acknowledgements
|
2083
2251
|
|