@syncify/cli 0.3.0-beta → 1.0.0-alpha.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/LICENSE +10 -6
- package/dist/index.d.cts +1815 -0
- package/dist/index.d.ts +1815 -0
- package/package.json +101 -103
- package/pnpm-lock.yaml +16312 -4430
- package/readme.md +76 -2184
- package/scripts/hot.js.liquid +25 -0
- package/dist/api.js +0 -16
- package/dist/cjs.js +0 -236
- package/dist/cli.js +0 -11
- package/dist/index.js +0 -18
- package/hot.js.liquid +0 -3
- package/schema/syncify.config.json +0 -676
- package/schema/syncify.env.json +0 -58
- package/schema/syncify.package.json +0 -11
- package/types/api.d.ts +0 -319
- package/types/bundle/cache.d.ts +0 -101
- package/types/bundle/commands.d.ts +0 -396
- package/types/bundle/errors.d.ts +0 -101
- package/types/bundle/file.d.ts +0 -285
- package/types/bundle/filters.d.ts +0 -81
- package/types/bundle/hot.d.ts +0 -185
- package/types/bundle/index.d.ts +0 -603
- package/types/bundle/plugin.d.ts +0 -127
- package/types/bundle/processors.d.ts +0 -54
- package/types/bundle/reports.d.ts +0 -123
- package/types/bundle/requests.d.ts +0 -374
- package/types/bundle/shared.d.ts +0 -124
- package/types/cli.d.ts +0 -547
- package/types/config/index.d.ts +0 -550
- package/types/config/terser.d.ts +0 -319
- package/types/config/views.d.ts +0 -191
- package/types/index.d.ts +0 -55
- package/types/modules/html-minifier-terser.d.ts +0 -218
- package/types/stores.d.ts +0 -11
- package/types/transforms/image.d.ts +0 -15
- package/types/transforms/json.d.ts +0 -51
- package/types/transforms/pages.d.ts +0 -254
- package/types/transforms/script.d.ts +0 -308
- package/types/transforms/style.d.ts +0 -219
- package/types/transforms/svg.d.ts +0 -189
package/types/cli.d.ts
DELETED
@@ -1,547 +0,0 @@
|
|
1
|
-
/* -------------------------------------------- */
|
2
|
-
/* LOGGER */
|
3
|
-
/* -------------------------------------------- */
|
4
|
-
|
5
|
-
import { LiteralUnion } from 'type-fest';
|
6
|
-
|
7
|
-
export type Group = LiteralUnion<
|
8
|
-
| 'Syncify'
|
9
|
-
| 'Asset'
|
10
|
-
| 'Spawn'
|
11
|
-
| 'SVG'
|
12
|
-
| 'Snippet'
|
13
|
-
| 'Layout'
|
14
|
-
| 'Section'
|
15
|
-
| 'Page'
|
16
|
-
| 'Locale'
|
17
|
-
| 'Config'
|
18
|
-
| 'Template'
|
19
|
-
| 'Metafield'
|
20
|
-
, string
|
21
|
-
>
|
22
|
-
|
23
|
-
/* -------------------------------------------- */
|
24
|
-
/* CLI OPTIONS */
|
25
|
-
/* -------------------------------------------- */
|
26
|
-
|
27
|
-
export interface Commands {
|
28
|
-
/**
|
29
|
-
* First command is a store or comma separated list of stores. When
|
30
|
-
* a comma list is supplied it is converted to an array. You can use
|
31
|
-
* use the store target name as a --flag to cherry pick specific themes
|
32
|
-
* from that store.
|
33
|
-
*
|
34
|
-
* ---
|
35
|
-
*
|
36
|
-
* Example:
|
37
|
-
*
|
38
|
-
* ```bash
|
39
|
-
* $ syncify store-name
|
40
|
-
* $ syncify store1,store2,store3
|
41
|
-
* ```
|
42
|
-
*/
|
43
|
-
_?: string[];
|
44
|
-
/**
|
45
|
-
* Whether or not syncify was called via the cli
|
46
|
-
*
|
47
|
-
* @default true
|
48
|
-
*/
|
49
|
-
cli?: boolean;
|
50
|
-
/**
|
51
|
-
* Whether or not syncify interactive command prompt
|
52
|
-
*
|
53
|
-
* @default false
|
54
|
-
*/
|
55
|
-
interactive?: boolean;
|
56
|
-
/**
|
57
|
-
* The current working directory, this a reference to `process.cwd()`
|
58
|
-
*/
|
59
|
-
cwd?: string;
|
60
|
-
/**
|
61
|
-
* The `package.json` url path, this is written post-command parse
|
62
|
-
*/
|
63
|
-
pkg?: string;
|
64
|
-
/**
|
65
|
-
* The post-parse temp storage reference to stores
|
66
|
-
*/
|
67
|
-
store?: string | string[];
|
68
|
-
/**
|
69
|
-
* An optional config path to the `syncify.config.js` file.
|
70
|
-
*
|
71
|
-
* ---
|
72
|
-
*
|
73
|
-
* Example:
|
74
|
-
*
|
75
|
-
* ```bash
|
76
|
-
* $ syncify store_1 -c path/to/file
|
77
|
-
* $ syncify store_1 --config path/to/file
|
78
|
-
* $ syncify store_1 --config=path/to/file
|
79
|
-
* ```
|
80
|
-
*/
|
81
|
-
config?: string;
|
82
|
-
/**
|
83
|
-
* Run in production mode
|
84
|
-
*
|
85
|
-
* ---
|
86
|
-
*
|
87
|
-
* Example:
|
88
|
-
*
|
89
|
-
* ```bash
|
90
|
-
* $ syncify --prod
|
91
|
-
* $ syncify --production
|
92
|
-
* ```
|
93
|
-
*/
|
94
|
-
prod?: boolean;
|
95
|
-
/**
|
96
|
-
* Run in development mode (default build mode) and can be omitted
|
97
|
-
*
|
98
|
-
* ---
|
99
|
-
*
|
100
|
-
* Example:
|
101
|
-
*
|
102
|
-
* ```bash
|
103
|
-
* $ syncify
|
104
|
-
* $ syncify --dev
|
105
|
-
* $ syncify --development
|
106
|
-
* ```
|
107
|
-
*/
|
108
|
-
dev?: boolean;
|
109
|
-
/**
|
110
|
-
* Run minification on resources. This acts similar to `--prod`
|
111
|
-
* but allows for invocation in an isolated manner.
|
112
|
-
*
|
113
|
-
* ---
|
114
|
-
*
|
115
|
-
* Example:
|
116
|
-
*
|
117
|
-
* ```bash
|
118
|
-
* $ syncify --terse
|
119
|
-
* ```
|
120
|
-
*/
|
121
|
-
terse?: boolean
|
122
|
-
/**
|
123
|
-
* Run in watch mode (chokidar). This requires a store target be passed.
|
124
|
-
*
|
125
|
-
* ---
|
126
|
-
*
|
127
|
-
* Example:
|
128
|
-
*
|
129
|
-
* ```bash
|
130
|
-
* $ syncify store_1 -w
|
131
|
-
* $ syncify store_1 --watch
|
132
|
-
* ```
|
133
|
-
*/
|
134
|
-
watch?: boolean;
|
135
|
-
/**
|
136
|
-
* Run in build mode, this is default trigger when no arguments provided.
|
137
|
-
* It can optionally be triggered along other flags like `-u` (`--upload`).
|
138
|
-
*
|
139
|
-
* ---
|
140
|
-
*
|
141
|
-
* Example:
|
142
|
-
*
|
143
|
-
* ```bash
|
144
|
-
* $ syncify
|
145
|
-
* $ syncify -b
|
146
|
-
* $ syncify store_1 --clean --build --theme=prod_theme -u
|
147
|
-
*
|
148
|
-
* # Short version for brevity
|
149
|
-
* $ syncify store_1 -t prod_theme -u -b --clean
|
150
|
-
* ```
|
151
|
-
*/
|
152
|
-
build?: boolean;
|
153
|
-
/**
|
154
|
-
* Run in upload mode, this will trigger a full theme upload. Requires a store
|
155
|
-
* target and theme target (theme target is optional but recommended).
|
156
|
-
*
|
157
|
-
* ---
|
158
|
-
*
|
159
|
-
* Example:
|
160
|
-
*
|
161
|
-
* ```bash
|
162
|
-
* $ syncify store_1 -t dev_theme -u
|
163
|
-
* $ syncify store_1 -t dev_theme --upload
|
164
|
-
* ```
|
165
|
-
*/
|
166
|
-
upload?: boolean;
|
167
|
-
/**
|
168
|
-
* Exports the theme and generates a `.zip` compressed directory.
|
169
|
-
*
|
170
|
-
* ---
|
171
|
-
*
|
172
|
-
* Example:
|
173
|
-
*
|
174
|
-
* ```bash
|
175
|
-
* $ syncify --import # import to the defined directory in syncify config
|
176
|
-
* $ syncify --import -o ./some-dir # override and import to a specific directory
|
177
|
-
* ```
|
178
|
-
*/
|
179
|
-
import?: boolean;
|
180
|
-
/**
|
181
|
-
* Exports the theme and generates a `.zip` compressed directory.
|
182
|
-
*
|
183
|
-
* ---
|
184
|
-
*
|
185
|
-
* Example:
|
186
|
-
*
|
187
|
-
* ```bash
|
188
|
-
* $ syncify --import # export to the defined directory in syncify config
|
189
|
-
* $ syncify --import -o ./some-dir # override and export to a specific directory
|
190
|
-
* ```
|
191
|
-
*/
|
192
|
-
export?: boolean;
|
193
|
-
/**
|
194
|
-
* Triggers a resource mode
|
195
|
-
*
|
196
|
-
* @default ''
|
197
|
-
*/
|
198
|
-
resource?: string;
|
199
|
-
/**
|
200
|
-
* Download a theme from a store. Will be place in `import` driectory. Requires a store
|
201
|
-
* target and theme target to be passed.
|
202
|
-
*
|
203
|
-
* ---
|
204
|
-
*
|
205
|
-
* Example:
|
206
|
-
*
|
207
|
-
* ```bash
|
208
|
-
* $ syncify store_1 -t dev_theme -d
|
209
|
-
* $ syncify store_1 -t dev_theme --download
|
210
|
-
* ```
|
211
|
-
*/
|
212
|
-
download?: boolean;
|
213
|
-
/**
|
214
|
-
* Triggers the metafields resource, presents the interactive shell with list of
|
215
|
-
* options to choose from. Requires a store target to be passed.
|
216
|
-
*
|
217
|
-
* ---
|
218
|
-
*
|
219
|
-
* Example:
|
220
|
-
*
|
221
|
-
* ```bash
|
222
|
-
* $ syncify store_1 --metafields
|
223
|
-
* ```
|
224
|
-
*/
|
225
|
-
metafields?: boolean;
|
226
|
-
/**
|
227
|
-
* Triggers the pages resource, presents the interactive shell with list of
|
228
|
-
* options to choose from. Requires a store target to be passed.
|
229
|
-
*
|
230
|
-
* ---
|
231
|
-
*
|
232
|
-
* Example:
|
233
|
-
*
|
234
|
-
* ```bash
|
235
|
-
* $ syncify store_1 --pages
|
236
|
-
* ```
|
237
|
-
*/
|
238
|
-
pages?: boolean;
|
239
|
-
/**
|
240
|
-
* Triggers the redirects resource, presents the interactive shell with list of
|
241
|
-
* options to choose from. Requires a store target to be passed.
|
242
|
-
*
|
243
|
-
* ---
|
244
|
-
*
|
245
|
-
* Example:
|
246
|
-
*
|
247
|
-
* ```bash
|
248
|
-
* $ syncify store_1 --redirects
|
249
|
-
* ```
|
250
|
-
*/
|
251
|
-
redirects?: boolean;
|
252
|
-
/**
|
253
|
-
* Pull data reference from a store target resource. Queries the store API. Used to
|
254
|
-
* populate local setup with remote data like `metafields` and `pages`
|
255
|
-
*
|
256
|
-
* ---
|
257
|
-
*
|
258
|
-
* Example:
|
259
|
-
*
|
260
|
-
* ```bash
|
261
|
-
* $ syncify store_1 --metafields --pull
|
262
|
-
* $ syncify store_1 --pages --pull
|
263
|
-
* ```
|
264
|
-
*/
|
265
|
-
pull?: boolean;
|
266
|
-
/**
|
267
|
-
* Generator flag for automatically applying JSON schema specifications
|
268
|
-
* for VS Code users.
|
269
|
-
*
|
270
|
-
* ---
|
271
|
-
*
|
272
|
-
* Example:
|
273
|
-
*
|
274
|
-
* ```bash
|
275
|
-
* $ syncify --vsc
|
276
|
-
* ```
|
277
|
-
*/
|
278
|
-
vsc?: boolean;
|
279
|
-
/**
|
280
|
-
* Filter targeting of resources, assets or files. This can be used together
|
281
|
-
* with several different flags, like `-u`, `-d` and even `-b`. Filters a
|
282
|
-
* glob pattern or specific file.
|
283
|
-
*
|
284
|
-
* ---
|
285
|
-
*
|
286
|
-
* Example:
|
287
|
-
*
|
288
|
-
* ```bash
|
289
|
-
* # Uploads only .css assets
|
290
|
-
* $ syncify store_1 -t dev_theme -f assets/*.css -u
|
291
|
-
*
|
292
|
-
* # Builds locales in production mode
|
293
|
-
* $ syncify -f locales/*.json --prod
|
294
|
-
*
|
295
|
-
* # Uploads specific page
|
296
|
-
* $ syncify store_1 -u -f pages/shipping-info.md --prod
|
297
|
-
* ```
|
298
|
-
*/
|
299
|
-
filter?: string;
|
300
|
-
/**
|
301
|
-
* Triggers a clean of the output directory. When provided, this will be
|
302
|
-
* executed at the initial run (or before any else). Use together with
|
303
|
-
* production builds.
|
304
|
-
*
|
305
|
-
* ---
|
306
|
-
*
|
307
|
-
* Example:
|
308
|
-
*
|
309
|
-
* ```bash
|
310
|
-
* $ syncify --clean --prod
|
311
|
-
* $ syncify -b --clean --prod # Using with build
|
312
|
-
* ```
|
313
|
-
*/
|
314
|
-
clean?: boolean;
|
315
|
-
/**
|
316
|
-
* Show command-line help information. Also prints a disclaimer informing
|
317
|
-
* users that Centra is a better e-commerce platform than Shopify for shits
|
318
|
-
* and giggles (it actually is though).
|
319
|
-
*
|
320
|
-
* ---
|
321
|
-
*
|
322
|
-
* Example:
|
323
|
-
*
|
324
|
-
* ```bash
|
325
|
-
* $ syncify -h
|
326
|
-
* $ syncify --help
|
327
|
-
* ```
|
328
|
-
*/
|
329
|
-
help?: boolean;
|
330
|
-
/**
|
331
|
-
* Hides logs from being printed (shows errors though)
|
332
|
-
*
|
333
|
-
* ---
|
334
|
-
*
|
335
|
-
* Example:
|
336
|
-
*
|
337
|
-
* ```bash
|
338
|
-
* $ syncify --silent
|
339
|
-
* ```
|
340
|
-
*/
|
341
|
-
silent?: boolean;
|
342
|
-
/**
|
343
|
-
* Initializes hot-reloading in watch mode. Can only be used when
|
344
|
-
* targeting a single store and theme.
|
345
|
-
*
|
346
|
-
* ---
|
347
|
-
*
|
348
|
-
* Example:
|
349
|
-
*
|
350
|
-
* ```bash
|
351
|
-
* $ syncify store_1 -w -h
|
352
|
-
* $ syncify store_1 -w --hot
|
353
|
-
* $ syncify store_1 --watch -h
|
354
|
-
* $ syncify store_1 --watch --hot
|
355
|
-
* ```
|
356
|
-
*/
|
357
|
-
hot?: boolean;
|
358
|
-
/**
|
359
|
-
* Pulls in a Syncify theme strap environment.
|
360
|
-
*
|
361
|
-
* ---
|
362
|
-
*
|
363
|
-
* Example:
|
364
|
-
*
|
365
|
-
* ```bash
|
366
|
-
* $ syncify --strap dawn
|
367
|
-
* $ syncify --strap silk
|
368
|
-
* ```
|
369
|
-
*/
|
370
|
-
strap?: string;
|
371
|
-
/**
|
372
|
-
* Deletes a resource, file or asset from the remote store. Requires a store
|
373
|
-
* target be passed and if need be a theme target too. Does not delete local
|
374
|
-
* copies, do that manually for now.
|
375
|
-
*
|
376
|
-
* ---
|
377
|
-
*
|
378
|
-
* Example:
|
379
|
-
*
|
380
|
-
* ```bash
|
381
|
-
* $ syncify -del assets/image-name.jpg
|
382
|
-
* ```
|
383
|
-
*/
|
384
|
-
del?: string;
|
385
|
-
/**
|
386
|
-
* Trigger a spawn, isolating it so it will run as if it were a node script.
|
387
|
-
*
|
388
|
-
* ---
|
389
|
-
*
|
390
|
-
* Example:
|
391
|
-
*
|
392
|
-
* ```bash
|
393
|
-
* $ syncify -s spawn-name
|
394
|
-
* $ syncify -s spawn-name,some-other-spawn
|
395
|
-
*
|
396
|
-
* # OR
|
397
|
-
|
398
|
-
* $ syncify --spawn spawn-name
|
399
|
-
* $ syncify --spawn spawn-name,some-other-spawn
|
400
|
-
*
|
401
|
-
* ```
|
402
|
-
*/
|
403
|
-
spawn?: string;
|
404
|
-
/**
|
405
|
-
* Themes within stores to target. This argument requires a store target/s
|
406
|
-
* be passed and accept a comma separated list of target names as per the users
|
407
|
-
* Syncify configuration. Users can pass wildcard `--flags` to reference different
|
408
|
-
* stores when multiple store target are passed.
|
409
|
-
*
|
410
|
-
* ---
|
411
|
-
*
|
412
|
-
* Example:
|
413
|
-
*
|
414
|
-
* ```bash
|
415
|
-
* $ syncify store_1 -t theme_1
|
416
|
-
* $ syncify store_1,store_2 --store_1 dev,prod --store_2 foo_theme
|
417
|
-
* $ syncify store_1 --theme=dev,prod,test
|
418
|
-
* ```
|
419
|
-
*/
|
420
|
-
theme?: string[];
|
421
|
-
/**
|
422
|
-
* An optional input base directory path. This will overwrite and configuration predefined
|
423
|
-
* in settings.
|
424
|
-
*
|
425
|
-
* ---
|
426
|
-
*
|
427
|
-
* Example:
|
428
|
-
*
|
429
|
-
* ```bash
|
430
|
-
* $ syncify --clean -b -i some/directory
|
431
|
-
* ```
|
432
|
-
*/
|
433
|
-
input?: string;
|
434
|
-
/**
|
435
|
-
* An optional output path. This will overwrite the configuration predefined
|
436
|
-
* in settings.
|
437
|
-
*
|
438
|
-
* ---
|
439
|
-
*
|
440
|
-
* Example:
|
441
|
-
*
|
442
|
-
* ```bash
|
443
|
-
* $ syncify --clean -b -o some/directory
|
444
|
-
* ```
|
445
|
-
*/
|
446
|
-
output?: string;
|
447
|
-
/**
|
448
|
-
* Force overwrite of a theme file
|
449
|
-
*
|
450
|
-
* ---
|
451
|
-
*
|
452
|
-
* Example:
|
453
|
-
*
|
454
|
-
* ```bash
|
455
|
-
* $ syncify store_1 -t dev_theme -f section/file.liquid -u --force
|
456
|
-
* ```
|
457
|
-
*/
|
458
|
-
force?: boolean;
|
459
|
-
/**
|
460
|
-
* Version control. The bump flag accepts 3 different arguments.
|
461
|
-
*
|
462
|
-
* 1. Passing `--bump major` bumps main version, eg: `1.0.0` > `2.0,0`
|
463
|
-
* 2. Passing `--bump minor` bumps minor version, eg: `1.0.0` > `1.1.0`
|
464
|
-
* 3. Passing `--bump patch` bumps patch version, eg: `1.0.0` > `1.0.1`
|
465
|
-
*
|
466
|
-
* ---
|
467
|
-
*
|
468
|
-
* Example:
|
469
|
-
*
|
470
|
-
* ```bash
|
471
|
-
* $ syncify --bump major
|
472
|
-
* $ syncify --bump minor
|
473
|
-
* $ syncify --bump patch
|
474
|
-
* ```
|
475
|
-
*/
|
476
|
-
bump?: string;
|
477
|
-
/**
|
478
|
-
* Runs view transforms only (i.e: `.liquid` and `.json` files)
|
479
|
-
* ---
|
480
|
-
*
|
481
|
-
* Example:
|
482
|
-
*
|
483
|
-
* ```bash
|
484
|
-
* $ syncify --views # executes build
|
485
|
-
* $ syncify -w --views # executes in watch mode
|
486
|
-
* $ syncify --views --prod # executes build with minify
|
487
|
-
* $ syncify --views --terse # executes build with minify
|
488
|
-
* ```
|
489
|
-
*/
|
490
|
-
views?: boolean;
|
491
|
-
/**
|
492
|
-
* Runs the script transform only
|
493
|
-
* ---
|
494
|
-
*
|
495
|
-
* Example:
|
496
|
-
*
|
497
|
-
* ```bash
|
498
|
-
* $ syncify --script # executes build
|
499
|
-
* $ syncify -w --script # executes in watch mode
|
500
|
-
* $ syncify --script --prod # executes build with minify
|
501
|
-
* $ syncify --script --terse # executes build with minify
|
502
|
-
* ```
|
503
|
-
*/
|
504
|
-
script?: boolean;
|
505
|
-
/**
|
506
|
-
* Runs the style transform only
|
507
|
-
* ---
|
508
|
-
*
|
509
|
-
* Example:
|
510
|
-
*
|
511
|
-
* ```bash
|
512
|
-
* $ syncify --style # executes build
|
513
|
-
* $ syncify -w --style # executes in watch mode
|
514
|
-
* $ syncify --style --prod # executes build with minify
|
515
|
-
* $ syncify --style --terse # executes build with minify
|
516
|
-
* ```
|
517
|
-
*/
|
518
|
-
style?: boolean;
|
519
|
-
/**
|
520
|
-
* Runs the svg transform only
|
521
|
-
* ---
|
522
|
-
*
|
523
|
-
* Example:
|
524
|
-
*
|
525
|
-
* ```bash
|
526
|
-
* $ syncify --svg # executes build
|
527
|
-
* $ syncify -w --svg # executes in watch mode
|
528
|
-
* $ syncify --svg --prod # executes build with minify
|
529
|
-
* $ syncify --svg --terse # executes build with minify
|
530
|
-
* ```
|
531
|
-
*/
|
532
|
-
svg?: boolean;
|
533
|
-
/**
|
534
|
-
* Runs the image transform only
|
535
|
-
* ---
|
536
|
-
*
|
537
|
-
* Example:
|
538
|
-
*
|
539
|
-
* ```bash
|
540
|
-
* $ syncify --image # executes build
|
541
|
-
* $ syncify -w --image # executes in watch mode
|
542
|
-
* $ syncify --image --prod # executes build with minify
|
543
|
-
* $ syncify --image --terse # executes build with minify
|
544
|
-
* ```
|
545
|
-
*/
|
546
|
-
image?: boolean;
|
547
|
-
}
|