@syncify/cli 1.0.0-alpha.1 → 1.0.0-unstable.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/dist/index.d.cts DELETED
@@ -1,1815 +0,0 @@
1
- /// <reference path="../node_modules/@types/clean-css/index.d.ts" />
2
- /// <reference path="../node_modules/@types/svg-sprite/index.d.ts" />
3
- /// <reference path="../node_modules/svgo/lib/svgo.d.ts" />
4
- /// <reference path="../node_modules/postcss/lib/postcss.d.ts" />
5
- /// <reference path="../node_modules/tailwindcss/types/index.d.ts" />
6
- /// <reference path="../node_modules/esbuild/lib/main.d.ts" />
7
- /// <reference path="../node_modules/type-fest/index.d.ts" />
8
-
9
- import { LiteralUnion, Merge } from 'type-fest';
10
- import { BuildOptions } from 'esbuild';
11
- export { BuildOptions as ESBuildOptions } from 'esbuild';
12
- import { OptionsOutput } from 'clean-css';
13
- import { AcceptedPlugin, Plugin, Transformer, TransformCallback } from 'postcss';
14
- import { Config as Config$1 } from 'tailwindcss';
15
- import { Config as Config$3 } from 'svg-sprite';
16
- export { Config as SVGSpriteConfig } from 'svg-sprite';
17
- import { Config as Config$2 } from 'svgo';
18
- export { Config as SVGOConfig } from 'svgo';
19
- import { Options } from 'markdown-it';
20
-
21
- /* -------------------------------------------- */
22
- /* BASE DIRECTORIES */
23
- /* -------------------------------------------- */
24
-
25
- interface Directories {
26
- /**
27
- * The resolved `input` directory path
28
- *
29
- * @default 'source'
30
- */
31
- input?: string;
32
- /**
33
- * The resolved `output` directory path
34
- *
35
- * @default 'theme/'
36
- */
37
- output?: string;
38
- /**
39
- * The resolved `import` directory path for downloaded themes
40
- *
41
- * @default 'import/'
42
- */
43
- import?: string;
44
- /**
45
- * The resolved `export` directory path for packaged `.zip` themes
46
- *
47
- * @default 'export'
48
- */
49
- export?: string;
50
- /**
51
- * The resolved `config` directory path for build tool files
52
- *
53
- * @default '/'
54
- */
55
- config?: string;
56
- }
57
-
58
- interface Shared {
59
- /**
60
- * Specify the static server port. By default, Syncify uses port `41001` to
61
- * avoid any conflicts with other running hosts of tools.
62
- *
63
- * @default 41001
64
- * @example 'http://localhost:41001/some-asset.js'
65
- */
66
- server?: number;
67
- /**
68
- * Specify the websocket port. By default, Syncify uses port `51001` to
69
- * avoid any conflicts with other running hosts of tools.
70
- *
71
- * @default w
72
- * @example 'ws://localhost:51001/ws'
73
- */
74
- socket?: number;
75
- /**
76
- * Determines the reload method Syncify should use. Syncify provides 3
77
- * reload tactics and defaults to using `hot`.
78
- *
79
- * > `hot`
80
- * >
81
- * > Performs real HMR and partial swaps (recommended)
82
- *
83
- * > `live`
84
- * >
85
- * > Similar to `hot` but each change will swap the entire `<body>`
86
- *
87
- * > `refresh`
88
- * >
89
- * > Replicates the Shopify CLI behaviour (fake reloading). Hard refreshes on every change.
90
- *
91
- * @default 'hot'
92
- */
93
- method?: LiteralUnion<'hot' | 'live' | 'refresh', string>;
94
- /**
95
- * Whether or not the Syncify UI status label should render.
96
- *
97
- * @default true
98
- */
99
- label?: boolean;
100
- /**
101
- * The theme roles in which HOT reloading can apply. By default, HOT modes will on
102
- * apply to themes with an `unpublished` or `development` role. Themes which are
103
- * published (the one which customers see when they visit the online store) requires
104
- * you to explicitly enable.
105
- *
106
- * @default
107
- * {
108
- * published: false, // set to true to enable on published themes
109
- * development: true,
110
- * unpublished: true
111
- * }
112
- */
113
- roles?: {
114
- /**
115
- * Whether or not HOT Reloading is enabled on published themes with a `main` role.
116
- *
117
- * > **NOTE ON DISTINCTION**
118
- * >
119
- * > Syncify considers `published` themes as those which are **live**. Shopify,
120
- * > references **live** themes using `main` role but this is not really logical
121
- * > so we instead use a more coherent naming convention.
122
- *
123
- * @default false
124
- */
125
- published?: boolean;
126
- /**
127
- * Whether or not HOT Reloading is enabled on unpublished role themes
128
- *
129
- * @default true
130
- */
131
- unpublished?: boolean;
132
- /**
133
- * Whether or not HOT Reloading is enabled on development role themes
134
- *
135
- * @default true
136
- */
137
- development?: boolean;
138
- }
139
- /**
140
- * Accepts a string list of flags that enable Syncify to
141
- * wrangle CFH slop in development mode along with normalisation.
142
- *
143
- * > `--no-preview-bar`
144
- * >
145
- * > Automatically hides the preview bar
146
- *
147
- * > `--no-web-pixels-manager`
148
- * >
149
- * > Prevents the WPM evaluation from ocurring and blocks the CFH injection scripting
150
- *
151
- * > `--no-checkout-preloads`
152
- * >
153
- * > Prevents the checkout preload tags from injecting. In development, you don't need them.
154
- *
155
- * > `--no-shopify-features`
156
- * >
157
- * > Prevents the Shopify Features scripting from evaluating and blocks the CFH injections.
158
- *
159
- * > `--no-trekkie`
160
- * >
161
- * > Prevents Trekkie from evaluating, helping per-page navigation performance in development.
162
- *
163
- * > `--no-perfkit`
164
- * >
165
- * > Prevents Perfkit scripting from evaluating and the CFH injections.
166
- *
167
- * @default
168
- * [
169
- * '--no-preview-bar',
170
- * ]
171
- */
172
- flags?: [
173
- '--no-preview-bar'?,
174
- '--no-web-pixels-manager'?,
175
- '--no-checkout-preloads'?,
176
- '--no-shopify-features'?,
177
- '--no-trekkie'?,
178
- '--no-perfkit'?
179
- ];
180
- }
181
-
182
- interface Extension extends Shared {
183
- /**
184
- * > **!! NOT YET AVAILABLE !!**
185
- * >
186
- * > **This feature is planned and not yet available for usage**
187
- *
188
- * The type of client-side scripting method being used. If you are using the Syncify browser
189
- * extension then set this value to `extension`, otherwise use `inject`.
190
- *
191
- * @default 'injection'
192
- */
193
- client?: 'extension'
194
- }
195
-
196
- interface Inject extends Shared {
197
- /**
198
- * The type of client-side scripting method being used. If you are using the Syncify browser
199
- * extension then set this value to `extension`, otherwise use `inject`.
200
- *
201
- * @default 'injection'
202
- */
203
- client?: 'inject'
204
- /**
205
- * Set a list of theme layout files for snippet injection. This option is only applicable
206
- * when `client` is set to `inject`.
207
- *
208
- * > **NOTE**
209
- * >
210
- * > Option does not accept path structures, only file names are to be provided
211
- * >
212
- * > ```js
213
- * > // 𐄂 DO NOT DO THIS
214
- * > ['source/layout/theme.liquid']
215
- * >
216
- * > // ✓ THIS IS GOOD
217
- * > ['theme.liquid']
218
- * > ```
219
- *
220
- * @default
221
- * [
222
- * 'theme.liquid'
223
- * ]
224
- */
225
- layouts?: string[];
226
- }
227
-
228
- type HOT = Inject | Extension
229
-
230
- /* -------------------------------------------- */
231
- /* LOGGER */
232
- /* -------------------------------------------- */
233
-
234
- interface Logger {
235
- /**
236
- * Whether or not file stats should print
237
- *
238
- * > Helpful when building for production (`--prod`)
239
- *
240
- * @default true
241
- */
242
- stats?: boolean;
243
- /**
244
- * Whether or not to print warnings
245
- *
246
- * @default true
247
- */
248
- warnings?: boolean;
249
- /**
250
- * Suppress CLI logs
251
- *
252
- * @default false
253
- */
254
- silent?: boolean;
255
- /**
256
- * Whether or not to clear the screen between changes.
257
- *
258
- * @default true
259
- */
260
- clear?: boolean;
261
- }
262
-
263
- /**
264
- * Section and Snippet Rename Paths
265
- */
266
- interface RenamePaths$1<T = string | string[]> {
267
- /**
268
- * Uses the filename as per the source, idenitical behaviour as that of `[name]`.
269
- *
270
- * @example
271
- * {
272
- * sections: {
273
- * '[dir]-[name]': [
274
- * 'sections/foo/*', // sections in this directory will prefix foo-
275
- * 'sections/bar/*' // sections in this directory will prefix bar-
276
- * ],
277
- * '*': [
278
- * './sections/**' // all other sections will use source name
279
- * ]
280
- * },
281
- * snippets: {
282
- * '[dir]-[name]': [
283
- * 'snippets/foo/*', // snippets in this directory will prefix foo-
284
- * 'snippets/bar/*' // snippets in this directory will prefix bar-
285
- * ],
286
- * '*': [
287
- * './snippets/**' // all other snippets will use source name
288
- * ]
289
- * }
290
- * }
291
- */
292
- '*'?: T;
293
- /**
294
- * Use the filename as per the source. Passing `[name]` only will result in fallback
295
- * behaviour, as that of `'*'`.
296
- *
297
- * @example
298
- * @example
299
- * {
300
- * sections: {
301
- * '[dir]-[name]': [
302
- * 'sections/foo/*', // sections in this directory will prefix foo-
303
- * ],
304
- * 'xxx-[name]': [
305
- * 'sections/bar/*', // sections in this directory will prefix xxx-
306
- * ],
307
- * '[name]': [
308
- * './sections/**' // all other sections will use source filename
309
- * ]
310
- * },
311
- * snippets: {
312
- * '[dir]-[name]': [
313
- * 'snippets/foo/*', // snippets in this directory will prefix foo-
314
- * ],
315
- * 'xxx-[name]': [
316
- * 'snippets/bar/*', // snippets in this directory will prefix xxx-
317
- * ],
318
- * '[name]': [
319
- * './snippets/**' // all other sections will use source filename
320
- * ]
321
- * }
322
- * }
323
- */
324
- '[name]'?: T;
325
- /**
326
- * Prefix directory name and suffix filename in **kebab-case** format.
327
- *
328
- * @example
329
- * 'layout/header.liquid' > 'layout-header.liquid'
330
- */
331
- '[dir]-[name]'?: T;
332
- /**
333
- * Prefix directory name and suffix filename in **snake_case** format.
334
- *
335
- * @example
336
- * 'layout/header.liquid' > 'layout_header.liquid'
337
- */
338
- '[dir]_[name]'?: T;
339
- /**
340
- * Prefix filename and suffix directory in **kebab-case** format.
341
- *
342
- * @example
343
- * 'layout/header.liquid' > 'header-layout.liquid'
344
- */
345
- '[name]-[dir]'?: T;
346
- /**
347
- * Prefix filename and suffix directory in **snake_case** format.
348
- *
349
- * @example
350
- * 'layout/header.liquid' > 'header_layout.liquid'
351
- */
352
- '[name]_[dir]'?: T;
353
- }
354
-
355
- interface Paths<T = string | string[]> {
356
- /**
357
- * A glob string, glob array or rename `output → input` key/value object of files to be uploaded as snippets.
358
- *
359
- * @default 'source/snippets/*.{liquid}'
360
- * @example
361
- *
362
- * //OPTION 1 - Globs
363
- * {
364
- * snippets: 'source/snippets/*.liquid'
365
- * }
366
- *
367
- * //OPTION 2 - Globs Array
368
- * {
369
- * snippets: [
370
- * 'source/snippets/*.liquid',
371
- * 'source/snippets/xxx/*'
372
- * ]
373
- * }
374
- *
375
- * //OPTION 3 - Rename Object
376
- * {
377
- * snippets: {
378
- * // Output will be: snippets/foo.bar.liquid
379
- * '[dir].[name]': 'source/snippets/foo/bar.liquid',
380
- * // Output will be: snippets/quz-baz.liquid
381
- * '[name]-[dir]': 'source/snippets/baz/qux.liquid'
382
- * }
383
- * }
384
- *
385
- *
386
- * //OPTION 4 - Rename Object Glob Array
387
- * {
388
- * snippets: {
389
- * // Output will be: snippets/foo.bar.liquid
390
- * // Output will be: snippets/baz.qux.liquid
391
- * '[dir].[name]': [
392
- * 'source/snippets/foo/bar.liquid',
393
- * 'source/snippets/baz/qux.liquid'
394
- * ]
395
- * }
396
- * }
397
- */
398
- snippets?: T | Record<string, T> | RenamePaths$1<T>;
399
- /**
400
- * A glob string, glob array or rename `output → input` key/value object of files to be uploaded as sections.
401
- *
402
- * > **NOTE**
403
- * > This path reference will also sync section group files.
404
- *
405
- * @default 'source/sections/*.{liquid,json}'
406
- * @example
407
- *
408
- * //OPTION 1 - Globs
409
- * {
410
- * sections: 'source/sections/*.liquid'
411
- * }
412
- *
413
- * //OPTION 2 - Globs Array
414
- * {
415
- * sections: [
416
- * 'source/sections/*.liquid',
417
- * 'source/sections/xxx/*'
418
- * ]
419
- * }
420
- *
421
- * //OPTION 3 - Rename Object Glob
422
- * {
423
- * sections: {
424
- * // Output will be: sections/foo.bar.liquid
425
- * '[dir].[name]': 'source/sections/foo/bar.liquid',
426
- * // Output will be: sections/quz-baz.liquid
427
- * '[name]-[dir]': 'source/sections/baz/qux.liquid'
428
- * }
429
- * }
430
- *
431
- * //OPTION 4 - Rename Object Glob Array
432
- * {
433
- * sections: {
434
- * // Output will be: sections/foo.bar.liquid
435
- * // Output will be: sections/baz.qux.liquid
436
- * '[dir].[name]': [
437
- * 'source/sections/foo/bar.liquid',
438
- * 'source/sections/baz/qux.liquid'
439
- * ]
440
- * }
441
- * }
442
- */
443
- sections?: T | Record<string, T> | RenamePaths$1<T>;
444
- /**
445
- * A glob string or glob array of files to be uploaded as templates.
446
- *
447
- * @default 'source/templates/*.{liquid,json}'
448
- */
449
- templates?: T;
450
- /**
451
- * A glob string or glob array of files to be uploaded asas metaobject templates
452
- *
453
- * @default 'source/templates/metaobject/*.{liquid,json}'
454
- */
455
- metaobject?: T;
456
- /**
457
- * A glob string or glob array of files to be uploaded as template/customers
458
- *
459
- * @default 'source/templates/customers/*.{liquid,json}'
460
- */
461
- customers?: T;
462
- /**
463
- * A glob string or glob array of files to be uploaded as assets
464
- *
465
- * @default 'source/assets/*'
466
- */
467
- assets?: T;
468
- /**
469
- * A glob string or glob array of files to be uploaded as layouts
470
- *
471
- * @default 'source/layout/*.liquid'
472
- */
473
- layout?: T;
474
- /**
475
- * A glob string or glob array of files to be uploaded as configs, i.e, `settings_schema.json`
476
- *
477
- * @default 'source/config/.json'
478
- */
479
- config?: T;
480
- /**
481
- * A glob string or glob array of files to be uploaded as config, i.e, `en.default.json`
482
- *
483
- * @default 'source/locales/*.json'
484
- */
485
- locales?: T;
486
- /**
487
- * A glob string or glob array of files to be uploaded as **shared schema** `.json` or `.schema` files.
488
- *
489
- * @default 'source/schema/*.{json,schema}'
490
- */
491
- schema?: T;
492
- /**
493
- * **NOT YET AVAILABLE**
494
- *
495
- * > **This option will be available in later versions**
496
- *
497
- * ---
498
- *
499
- * The resolved `metafields` directory path
500
- *
501
- * @default 'source/metafields/'
502
- */
503
- metafields?: T;
504
- /**
505
- * A glob string or glob array string to be uploaded, published and controlled as `pages`
506
- *
507
- * @default 'source/pages/*.{md,html}'
508
- */
509
- pages?: T;
510
- /**
511
- * **NOT YET AVAILABLE**
512
- *
513
- * > **This option will be available in later versions**
514
- *
515
- * ---
516
- *
517
- * @default 'redirects.yaml'
518
- */
519
- redirects?: `${string}.${'yaml' | 'yml'}`;
520
- }
521
-
522
- type TargetBrowser = (
523
- | 'chrome'
524
- | 'deno'
525
- | 'edge'
526
- | 'firefox'
527
- | 'hermes'
528
- | 'ie'
529
- | 'ios'
530
- | 'node'
531
- | 'opera'
532
- | 'rhino'
533
- | 'safari'
534
- );
535
-
536
- type TargetBrowserVersion = (
537
- | `${TargetBrowser}${number}`
538
- | `${TargetBrowser}${number}.${number}`
539
- | `${TargetBrowser}${number}.${number}.${number}`
540
- );
541
-
542
- type TargetESVersion = (
543
- | 'es3'
544
- | 'es5'
545
- | 'es6'
546
- | 'es2015'
547
- | 'es2016'
548
- | 'es2017'
549
- | 'es2018'
550
- | 'es2019'
551
- | 'es2020'
552
- | 'es2021'
553
- | 'es2022'
554
- | 'esnext'
555
- );
556
-
557
- type ESBuildAllowedOptions = Pick<BuildOptions, (
558
- | 'alias'
559
- | 'assetNames'
560
- | 'banner'
561
- | 'bundle'
562
- | 'charset'
563
- | 'chunkNames'
564
- | 'entryNames'
565
- | 'conditions'
566
- | 'define'
567
- | 'external'
568
- | 'footer'
569
- | 'format'
570
- | 'globalName'
571
- | 'inject'
572
- | 'ignoreAnnotations'
573
- | 'tsconfigRaw'
574
- | 'tsconfig'
575
- | 'treeShaking'
576
- | 'target'
577
- | 'jsx'
578
- | 'keepNames'
579
- | 'jsxDev'
580
- | 'jsxFactory'
581
- | 'jsxFragment'
582
- | 'jsxImportSource'
583
- | 'jsxSideEffects'
584
- | 'loader'
585
- | 'minify'
586
- | 'mangleCache'
587
- | 'mangleQuoted'
588
- | 'mangleProps'
589
- | 'minifyIdentifiers'
590
- | 'minifySyntax'
591
- | 'minifyWhitespace'
592
- | 'mangleQuoted'
593
- | 'metafile'
594
- | 'drop'
595
- | 'splitting'
596
- | 'supported'
597
- | 'sourcesContent'
598
- | 'sourceRoot'
599
- | 'sourcemap'
600
- | 'pure'
601
- | 'plugins'
602
- | 'publicPath'
603
- )>
604
-
605
-
606
- type Target = (
607
- | TargetBrowser
608
- | TargetBrowserVersion
609
- | TargetESVersion
610
- );
611
-
612
- /**
613
- * Public exposed configurations
614
- */
615
- type ESBuildConfig = Merge<ESBuildAllowedOptions, {
616
- /**
617
- * The format to be generated. Because we are targeting
618
- * browser environments, Syncify does not allow for CJS (commonjs)
619
- * bundles to be produced.
620
- *
621
- * @default 'esm'
622
- */
623
- format?: 'esm' | 'iife';
624
- /**
625
- * Whether or not sourcemaps should be generated.
626
- * Syncify will process sourcemap generation internally,
627
- * so this option only accepts a boolean value.
628
- *
629
- * @default true
630
- */
631
- sourcemap?: boolean;
632
- }
633
- >;
634
-
635
- /* -------------------------------------------- */
636
- /* TRANSFORM */
637
- /* -------------------------------------------- */
638
-
639
- interface ScriptSharedConfig {
640
- /**
641
- * JS/TS input source paths. Accepts `string` or `string[]` glob patterns.
642
- * Resolution is relative to your defined `input` directory.
643
- *
644
- * ---
645
- *
646
- * @default undefined
647
- */
648
- input: string | string[];
649
- /**
650
- * This sets the target environment for the generated JavaScript. It
651
- * tells esbuild to transform JavaScript syntax which is too new for
652
- * these environments into older JavaScript syntax that works in this
653
- * environment\s.
654
- *
655
- * ---
656
- *
657
- * @default 'es2016'
658
- */
659
- target?: Target | Target[];
660
- /**
661
- * Instructs ESBuild to treat these modules as external. The import/s
662
- * will be preserved and evaluated at run time instead.
663
- *
664
- * ---
665
- *
666
- * @see
667
- * https://esbuild.github.io/api/#external
668
- *
669
- * @default
670
- * []
671
- */
672
- external?: string[];
673
- /**
674
- * Rename the JavaScript file/s. The same name as source file will be used
675
- * when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
676
- *
677
- * ---
678
- *
679
- * @default undefined
680
- */
681
- rename?: string;
682
- /**
683
- * Optionally write the javascript file inline as a snippet. This will transform
684
- * the JS and contained code will be output within `<script></script>` tags as a
685
- * `snippet.liquid` file.
686
- *
687
- * @default false
688
- */
689
- snippet?: boolean;
690
- /**
691
- * When `snippet` is `true` you can provide an additional list of attributes to
692
- * be applied to inlined `<script>` tag which code will be output within. This only applies
693
- * to snippet generation and entries will be ignored if snippet is `false`.
694
- *
695
- * **Example Definition**
696
- *
697
- * ```js
698
- * // Attribute definitions
699
- * {
700
- * attrs: [
701
- * ['id', 'foo']
702
- * ['data-attr', 'bar'],
703
- * ['{{ object.prop }}'],
704
- * ['{% if xxx %}', 'data-xxx', '{% endif %}']
705
- * ]
706
- * }
707
- * ```
708
- *
709
- * **Example Output**
710
- *
711
- * ```liquid
712
- * <script
713
- * id="foo"
714
- * data-attr="bar"
715
- * {{ object.prop }}
716
- * {% if xxx %}data-xxx{% endif %}></script>
717
- * ```
718
- *
719
- * // Output
720
- * @default []
721
- */
722
- attrs?: Array<string[]>;
723
- /**
724
- * Entry points (paths/files) to watch that will trigger a rebuilds of
725
- * the defined _input_ file. By default, Syncify will watch all import entries
726
- * imported by the _input_.
727
- *
728
- * @default []
729
- */
730
- watch?: string[]
731
- /**
732
- * [ESBuild](https://esbuild.github.io/) Override
733
- *
734
- * ESBuild file transforms will use the options provided to `processor.esbuild`
735
- * but you can optionally override those defaults on a per-transform
736
- * basis. Any configuration options defined here will be merged with
737
- * the options defined in `processor.esbuild`.
738
- *
739
- * You can also skip pre-processing with esbuild by passing a _boolean_
740
- * `false` which will inform Syncify to skip processing scripts with ESBuild.
741
- *
742
- * @default true // if esbuild is not installed this is false
743
- */
744
- esbuild?: boolean | ESBuildConfig;
745
- }
746
-
747
- interface ScriptFormatESM extends ScriptSharedConfig {
748
-
749
- /**
750
- * The format to be generated. Because we are targeting
751
- * browser environments, Syncify does not allow for CJS (commonjs)
752
- * bundles to be produced.
753
- *
754
- * @default 'esm'
755
- */
756
- format?: 'esm';
757
- }
758
-
759
- interface ScriptFormatIIFE extends ScriptSharedConfig {
760
- /**
761
- * The format to be generated. Because we are targeting
762
- * browser environments, Syncify does not allow for CJS (commonjs)
763
- * bundles to be produced.
764
- *
765
- * @see https://esbuild.github.io/api/#format
766
- * @default 'esm'
767
- */
768
- format?: 'iife';
769
- /**
770
- * Sets the name of the global variable which is used to store the
771
- * exports from the entry point.
772
- *
773
- * @see https://esbuild.github.io/api/#global-name
774
- * @default undefined
775
- */
776
- globalName?: string;
777
- }
778
-
779
- type ScriptTransform = ScriptFormatESM | ScriptFormatIIFE;
780
-
781
- /* -------------------------------------------- */
782
- /* TRANSFORMER */
783
- /* -------------------------------------------- */
784
-
785
- type ScriptTransformer = (
786
- | string
787
- | string[]
788
- | ScriptTransform
789
- | ScriptTransform[]
790
- | { [rename: ScriptRename]: string | string[] | Omit<ScriptTransform, 'rename'> }
791
- )
792
-
793
- /* eslint-disable no-unused-vars */
794
-
795
-
796
-
797
- /* -------------------------------------------- */
798
- /* PROCESSOR CONFIGS */
799
- /* -------------------------------------------- */
800
-
801
- type StyleRename = `${'assets' | 'snippets'}/${string}`
802
-
803
- type PostCSSConfig = (
804
- | AcceptedPlugin
805
- | Plugin
806
- | Transformer
807
- | TransformCallback
808
- | any
809
- );
810
-
811
- /**
812
- * Style Minification
813
- */
814
- interface StyleTerse extends OptionsOutput {
815
- /**
816
- * Whether or not to purge unused CSS class names
817
- *
818
- * @default false
819
- */
820
- purgeUnusedCSS?: boolean;
821
- /**
822
- * Whether or not to obfuscate CSS class names
823
- *
824
- * @default false
825
- */
826
- obfuscateClassNames?: boolean;
827
- /**
828
- * List of class names that should be excluded from
829
- * obfuscation and shortnaming.
830
- */
831
- obfuscateWhitelist?: string[];
832
- /**
833
- * The alphabet used to generate the new class names.
834
- *
835
- * > **NOTE**
836
- * >
837
- * > There is no `d` in the default alphabet to avoid adblock issues.
838
- *
839
- * @default 'abcefghijklmnopqrstuvwxyz0123456789'
840
- */
841
- obfuscateAlphabet?: string;
842
- /**
843
- * Excluded files from terser minification
844
- *
845
- * @default []
846
- */
847
- exclude?: string[]
848
- }
849
-
850
- interface TailwindConfig extends Config$1 {
851
- config: string[]
852
- }
853
-
854
- interface SASSConfig {
855
- /**
856
- * Whether or not to generate sourcemaps
857
- *
858
- * @default true
859
- */
860
- sourcemap?: boolean;
861
- /**
862
- * The style compiled CSS should be output.
863
- *
864
- * @default 'compressed'
865
- */
866
- style?: 'expanded' | 'compressed';
867
- /**
868
- * Whether or not to print warnings to CLI - Warnings will require
869
- * an `stdin` invocation to view. Setting this to `false` will hide
870
- * warnings all together.
871
- *
872
- * @default true
873
- */
874
- warnings?: boolean;
875
- /**
876
- * This option is passed to SASS Dart compile instance. If this option is set to `true`,
877
- * Sass won’t print warnings that are caused by dependencies. A "dependency" is defined
878
- * as any file that’s loaded through external sources.
879
- *
880
- * This is useful for silencing deprecation warnings that you can’t fix on your own.
881
- * However, please also notify your dependencies of the deprecations so that they can get
882
- * fixed as soon as possible!
883
- *
884
- * @default false
885
- */
886
- quietDeps?: boolean;
887
- /**
888
- * A list of paths to include, ie: node_modules.
889
- *
890
- * @default ['node_modules']
891
- */
892
- include?: string[];
893
- }
894
-
895
- /* -------------------------------------------- */
896
- /* TRANSFORM */
897
- /* -------------------------------------------- */
898
-
899
- interface StyleTransform<T = string | string[]> {
900
- /**
901
- * SVG input source paths. Accepts `string` or `string[]` glob patterns.
902
- * Resolution is relative to your defined `input` directory.
903
- *
904
- * @default undefined
905
- */
906
- input: T;
907
- /**
908
- * Glob stylesheet paths/files to watch. When changes
909
- * are applied to matched files, then the defined `input`
910
- * will be compiled.
911
- *
912
- * @default []
913
- */
914
- watch?: string[];
915
- /**
916
- * Rename the stylesheet file/s. The same name as source file will be used
917
- * when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
918
- *
919
- * ---
920
- *
921
- * @default undefined
922
- */
923
- rename?: string;
924
- /**
925
- * Optionally output the CSS as a snippet. This will transform
926
- * the stylesheet inline, wrap output within `<style></style>`
927
- * tags and write it to `snippets`.
928
- *
929
- * @default false
930
- */
931
- snippet?: boolean;
932
- /**
933
- * When `snippet` is `true` you can provide an additional list of attributes to
934
- * be applied to `<style>` tag which code will be output within. This only applies
935
- * to snippet generation and entries will be ignored if snippet is `false`.
936
- *
937
- * **Example Definition**
938
- *
939
- * ```js
940
- * // Attribute definitions
941
- * {
942
- * attrs: [
943
- * ['id', 'foo']
944
- * ['data-attr', 'bar'],
945
- * ['{{ object.prop }}'],
946
- * ['{% if xxx %}', 'data-xxx', '{% endif %}']
947
- * ]
948
- * }
949
- * ```
950
- *
951
- * **Example Output**
952
- *
953
- * ```liquid
954
- * <style
955
- * id="foo"
956
- * data-attr="bar"
957
- * {{ object.prop }}
958
- * {% if xxx %}data-xxx{% endif %}></style>
959
- * ```
960
- *
961
- * // Output
962
- * @default []
963
- */
964
- attrs?: string[][];
965
- /**
966
- *
967
- * [TailwindCSS](https://tailwindcss.com/) Override
968
- *
969
- * Tailwind transforms will use the `tailwind.config.js` configuration
970
- * file in your projects root (or defined `config` path). If you have not
971
- * provided a tailwind config file, then syncify will use options defined
972
- * via `processor.tailwind`. You can optionally override configuration
973
- * on a per-transform basis and any options defined here will be merged with
974
- * those defined in your `tailwind.config.js` or `processor.tailwind`.
975
- *
976
- * @default true // if tailwind is not installed this is false
977
- */
978
- tailwind?: boolean | Partial<TailwindConfig>;
979
- /**
980
- * [PostCSS](https://postcss.org/) Override
981
- *
982
- * CSS File transforms will use the options provided to `processor.postcss`
983
- * but you can optionally override those defaults on a per-transform
984
- * basis. Any configuration options defined here will be merged with
985
- * the options defined in `processor.postcss`.
986
- *
987
- * You can also skip pre-processing with postcss by passing a _boolean_
988
- * `false` which will inform Syncify to not pass output to PostCSS. By
989
- * default, Syncify will pass all compiled SASS and files with `.css`
990
- * extensions to PostCSS.
991
- *
992
- * @default true // if postcss is not installed this is false
993
- */
994
- postcss?: boolean | PostCSSConfig[];
995
- /**
996
- * [SASS Dart](https://sass-lang.com/documentation/js-api/) Override
997
- *
998
- * SASS File transforms will use the options provided to `processor.sass`
999
- * but you can optionally override those defaults on a per-transform
1000
- * basis. Any configuration options defined here will be merged with
1001
- * the options defined in `processor.sass`.
1002
- *
1003
- * You can also skip SASS transfroms by passing a _boolean_ `false` which will
1004
- * inform Syncify to not pass output to SASS, which is the default if SASS is not
1005
- * installed.
1006
- *
1007
- * By default, Syncify will forward all input files using `.scss` or `.sass`
1008
- * or extension to SASS Dart. If you have PostCSS installed then Syncify will
1009
- * automatically pass SASS files to PostCSS in the post-process.
1010
- *
1011
- * @default true // if sass is not installed this is false
1012
- */
1013
- sass?: boolean | SASSConfig;
1014
- /**
1015
- * **NOTE YET AVAILABLE**
1016
- *
1017
- * Terse Style (CSS) Minification
1018
- *
1019
- * > Uses [clean-css](https://github.com/clean-css/clean-css) minification
1020
- * > Uses [purge-css](https://github.com/FullHuman/purgecss)
1021
- */
1022
- terser?: boolean | SASSConfig;
1023
- }
1024
-
1025
- /* -------------------------------------------- */
1026
- /* TRANSFORMER */
1027
- /* -------------------------------------------- */
1028
-
1029
- type StyleTransformer = (
1030
- | string
1031
- | string[]
1032
- | StyleTransform
1033
- | StyleTransform[]
1034
- | {
1035
- [K in StyleRename]: (
1036
- | string
1037
- | string[]
1038
- | Pick<StyleTransform,
1039
- | 'postcss'
1040
- | 'sass'
1041
- | 'tailwind'
1042
- | 'snippet'
1043
- | 'watch'
1044
- | 'input'
1045
- >
1046
- )
1047
- }
1048
- )
1049
-
1050
- /* eslint-disable no-unused-vars */
1051
-
1052
-
1053
-
1054
- /* -------------------------------------------- */
1055
- /* SHARED */
1056
- /* -------------------------------------------- */
1057
-
1058
- type RenamePaths = `${'assets' | 'snippets'}/${string}`
1059
-
1060
- interface SVGShared<T extends 'file' | 'sprite'> {
1061
- /**
1062
- * SVG input source paths. Accepts `string` or `string[]` glob patterns.
1063
- * Resolution is relative to your defined `input` directory.
1064
- *
1065
- * @default ''
1066
- */
1067
- input: string | string[];
1068
- /**
1069
- * Rename the svg file/s. The same name as source file will be used
1070
- * when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
1071
- * ---
1072
- *
1073
- * @default undefined
1074
- *
1075
- * @example
1076
- * 'source/svgs/arrow.svg' > 'arrow.svg' // if snippet is false
1077
- * 'source/svgs/checkmark.svg' > 'checkmark.liquid' // if snippet is true
1078
- */
1079
- rename?: string;
1080
- /**
1081
- * Whether to generate svg as snippet or asset. When `true` the
1082
- * svg source will be written as a snippet
1083
- *
1084
- * @default false
1085
- */
1086
- snippet?: boolean;
1087
- /**
1088
- * The SVG export format. Syncify can produce 2 different SVG formats:
1089
- *
1090
- * You can omit this option when you have only 1 pre-processor installed or
1091
- * if you are applying a per-transfrom configuration override as it will default
1092
- * to the format which the inferred pre-processor produces. If you are using
1093
- * both the supported processors ([SVGO](https://github.com/svg/svgo) &
1094
- * [SVG Sprite](https://github.com/svg-sprite)) then you will need
1095
- * to inform Syncify on which format it should produce.
1096
- *
1097
- * ---
1098
- *
1099
- * **File Format**
1100
- *
1101
- * _SVG transforms using a `file` format require SVGO to be installed. File
1102
- * formats will produce individual `.svg` files from that can be output as
1103
- * an`asset` or inlined into a `snippet`_
1104
- *
1105
- * ---
1106
- *
1107
- * **Sprite Format**
1108
- *
1109
- * _SVG transforms using a `sprite` format require SVG Sprite to be installed.
1110
- * Sprite formats will produce an SVG Sprite that can be output as an `asset`
1111
- * or inlined into a `snippet`_
1112
- *
1113
- * ---
1114
- *
1115
- * @default
1116
- * undefined // When no SVG pre-processor is installed
1117
- * null // When both SVGO and SVG Sprite are installed (required)
1118
- * 'file' // When SVGO is the only processor installed
1119
- * 'sprite' // When SVG Sprite is the only processor installed
1120
- */
1121
- format?: LiteralUnion<T, string>;
1122
- }
1123
-
1124
- interface SVGFile extends SVGShared<'file'> {
1125
- /**
1126
- * [SVGO](https://github.com/svg/svgo) Override
1127
- *
1128
- * SVG File transforms will use the options provided to `processor.svgo`
1129
- * but you can optionally override those defaults on a per-transform
1130
- * basis. Any configuration options defined here will be merged with
1131
- * the options defined in `processor.svgo`.
1132
- *
1133
- * @default
1134
- * processor.svgo // When processor configuration is defined
1135
- */
1136
- svgo?: Config$2
1137
- }
1138
-
1139
- interface SVGSprite extends SVGShared<'sprite'> {
1140
- /**
1141
- * [SVG Sprite](https://github.com/svg-sprite) Override
1142
- *
1143
- * SVG Sprite transforms will use the options provided to `processor.sprite`
1144
- * but you can optionally override those defaults on a per-transform
1145
- * basis. Any configuration options defined here will be merged with
1146
- * the options defined in `processor.sprite`.
1147
- *
1148
- * @default
1149
- * processor.sprite // When processor configuration is defined
1150
- */
1151
- sprite?: Config$3
1152
- }
1153
-
1154
- /* -------------------------------------------- */
1155
- /* TRANSFORM */
1156
- /* -------------------------------------------- */
1157
-
1158
- /**
1159
- * SVG processing transforms
1160
- */
1161
- type SVGTransform = (
1162
- | SVGFile
1163
- | SVGSprite
1164
- )
1165
-
1166
- /* -------------------------------------------- */
1167
- /* TRANSFORMER */
1168
- /* -------------------------------------------- */
1169
-
1170
- type SVGTransformer = (
1171
- | string
1172
- | string[]
1173
- | SVGTransform
1174
- | SVGTransform[]
1175
- | {
1176
- [K in RenamePaths]: (
1177
- | string
1178
- | string[]
1179
- | Pick<SVGFile, 'format' | 'input' | 'snippet' | 'svgo'>
1180
- | Pick<SVGSprite, 'format'| 'input'| 'snippet' | 'sprite'>
1181
- )
1182
- }
1183
- )
1184
-
1185
- /**
1186
- * Processor Default Configurations
1187
- *
1188
- * Holds reference to default config options for each supported processor.
1189
- */
1190
- interface Processors {
1191
- /**
1192
- * [ESBuild](https://esbuild.github.io/) Config
1193
- */
1194
- esbuild?: ESBuildConfig;
1195
- /**
1196
- * [PostCSS](https://postcss.org/) Plugins
1197
- */
1198
- postcss?: PostCSSConfig[];
1199
- /**
1200
- * [TailwindCSS](https://tailwindcss.com/) Config
1201
- */
1202
- tailwind?: TailwindConfig[];
1203
- /**
1204
- * [SASS Dart](https://sass-lang.com/documentation/js-api/) Config
1205
- */
1206
- sass?: SASSConfig;
1207
- /**
1208
- * [SVGO](https://github.com/svg/svgo) Config
1209
- */
1210
- svgo?: Config$2;
1211
- /**
1212
- * [SVG Sprite](https://github.com/svg-sprite) Config
1213
- */
1214
- sprite?: Config$3;
1215
- /**
1216
- * [Markdown](https://github.com/markdown-it/markdown-it) Config
1217
- */
1218
- markdown?: Options;
1219
- /**
1220
- * [Turndown](https://github.com/mixmark-io/turndown) Config
1221
- */
1222
- turndown?: Config$3;
1223
- }
1224
-
1225
- interface Publishing {
1226
- /**
1227
- * Set the publishment role to use - This defaults to `unpublished`
1228
- * which means theme publishes will not be made pushed live.
1229
- *
1230
- * `main`
1231
- *
1232
- * The theme is published. Customers see it when they visit the online store.
1233
- *
1234
- * `unpublished`
1235
- *
1236
- * The theme is unpublished. Customers can't see it.
1237
- *
1238
- * `development`
1239
- *
1240
- * The theme is used for development. The theme can't be published, and is temporary.
1241
- *
1242
- * @default 'unpublished'
1243
- */
1244
- role?: 'main' | 'unpublished' | 'development';
1245
- /**
1246
- * **NOT YET AVAILABLE**
1247
- *
1248
- * Bind theme version with the `settings_schema.json` version.
1249
- *
1250
- * @default false
1251
- */
1252
- branches?: string[]
1253
- /**
1254
- * Limit the amount of new theme publishments.
1255
- *
1256
- * @default 3
1257
- */
1258
- themeLimit?: number;
1259
- }
1260
-
1261
- /**
1262
- * JSON File Minification
1263
- */
1264
- interface JSONTerse {
1265
- /**
1266
- * Minify `.json` files writing to `theme/assets`
1267
- *
1268
- * @default true
1269
- */
1270
- assets?: boolean;
1271
- /**
1272
- * Minify `settings_schema.json` and `settings_data.json` config files.
1273
- *
1274
- * @default true
1275
- */
1276
- config?: boolean;
1277
- /**
1278
- * Minify `locale` and `.json` files.
1279
- *
1280
- * @default true
1281
- */
1282
- locales?: boolean;
1283
- /**
1284
- * Minify `metafield` and `.json` files.
1285
- *
1286
- * @default true
1287
- */
1288
- metafields?: boolean;
1289
- /**
1290
- * Minify `metaobject` and `.json` files.
1291
- *
1292
- * @default true
1293
- */
1294
- metaobject?: boolean;
1295
- /**
1296
- * Minify section group `.json` files
1297
- *
1298
- * @default true
1299
- */
1300
- groups?: boolean;
1301
- /**
1302
- * Minify `template` and `.json` files.
1303
- *
1304
- * @default true
1305
- */
1306
- templates?: boolean;
1307
- /**
1308
- * An optional list of paths/files to exclude from minification.
1309
- *
1310
- * @default []
1311
- */
1312
- exclude?: string[]
1313
- }
1314
-
1315
- interface JSONTransform {
1316
- /**
1317
- * If line termination should be Windows (CRLF) format.
1318
- * Unix (LF) format is the default.
1319
- *
1320
- * @default false
1321
- */
1322
- crlf?: boolean;
1323
- /**
1324
- * The indentation level
1325
- *
1326
- * @default 2
1327
- */
1328
- indent?: number;
1329
- /**
1330
- * Whether to use tabbed `\t` identation characters. When `true`, tabs will apply
1331
- * at the division of `2` relative to the `indent` option value.
1332
- *
1333
- * @default false
1334
- */
1335
- useTab?: boolean;
1336
- /**
1337
- * Whether or not comments should be stripped or preserved.
1338
- * This effects how Syncify handles both local and remote sources.
1339
- *
1340
- * @default false
1341
- */
1342
- stripComments?: boolean;
1343
- /**
1344
- * Whether or not Syncify should apply alpha-numeric sorting to object properties
1345
- * or not. This will apply deep sorting, so all objects within a structure will adhere.
1346
- *
1347
- * @default false
1348
- */
1349
- sortObjects?: boolean;
1350
- /**
1351
- * Define a list of property names with object values that should be excluded and skipped
1352
- * from sorting. This option only applies when `sortObjects` is set to `true` and will
1353
- * have no effect if `sortObjects` is not enabled.
1354
- *
1355
- * @default []
1356
- */
1357
- sortExclude?: string[];
1358
- /**
1359
- * An optional string list of paths/filenames to exclude
1360
- * from processing, ie: pass through
1361
- *
1362
- * @default false
1363
- */
1364
- exclude?: string[];
1365
- /**
1366
- * JSON minification options. By default, this option is set to `false`
1367
- * which disables minification being applied to `.json` file types. Setting
1368
- * this to `true` will enabled JSON minification to apply.
1369
- *
1370
- * > **NOTE**
1371
- * >
1372
- * > Terse operations require the explicit `--prod` OR `--terse` flags be provided.
1373
- * > Failure to pass such flags will result in minification being skipped.
1374
- */
1375
- terse?: boolean | JSONTerse;
1376
- }
1377
-
1378
- interface LiquidTerse {
1379
- /**
1380
- * Removes redundant whitespace Liquid dash trims from Liquid tags and objects.
1381
- *
1382
- * @default true
1383
- */
1384
- stripTrims?: boolean;
1385
- /**
1386
- * Minifies inner contents of `<script>` and `{% javascript %}` tags
1387
- *
1388
- * @default true
1389
- */
1390
- minifyJS?: boolean;
1391
- /**
1392
- * Minifies inner contents of `<style>`, `{% style %}` and `{% stylesheet %}` tags
1393
- *
1394
- * @default true
1395
- */
1396
- minifyCSS?: boolean;
1397
- /**
1398
- * Minifies inner contents of `{% schema %}` tags
1399
- *
1400
- * @default true
1401
- */
1402
- minifySchema?: boolean;
1403
- /**
1404
- * Remove all occurances of HTML and Liquid comments
1405
- *
1406
- * @default true
1407
- */
1408
- removeComments?: boolean;
1409
- /**
1410
- * Collapse all whitespace and newlines
1411
- *
1412
- * @default true
1413
- */
1414
- collapseWhitespace?: boolean;
1415
- /**
1416
- * Excluded files from minification
1417
- *
1418
- * @default []
1419
- */
1420
- exclude?: string[]
1421
- }
1422
-
1423
- /**
1424
- * Liquid Minification
1425
- */
1426
- interface LiquidTransform {
1427
- /**
1428
- * Liquid and HTML minification options. By default, the option is set to `false`
1429
- * which disables minification being applied to `.liquid` file types. Setting
1430
- * this to `true` will enabled minification.
1431
- *
1432
- * > **NOTE**
1433
- * >
1434
- * > Terse operations require explicit `--prod` OR `--terse` flags be provided.
1435
- * > Failure to pass such flags will result in minification being skipped.
1436
- */
1437
- terse?: boolean | LiquidTerse;
1438
- }
1439
-
1440
- /* -------------------------------------------- */
1441
- /* TRANSFORMS */
1442
- /* -------------------------------------------- */
1443
-
1444
- interface Transforms {
1445
- /**
1446
- * ###### [DOCUMENTATION](https://syncify.sh/options/transform/style/)
1447
- *
1448
- * **Style File transforms**
1449
- *
1450
- * @example
1451
- *
1452
- * // OPTION 1 - Rename with single input
1453
- * {
1454
- * style: {
1455
- * 'assets/stylesheet.css': 'path/to/file.scss', // write to assets dir and compile with sass
1456
- * 'snippets/style.liquid': 'path/to/foo.css' // write as snippet
1457
- * }
1458
- * }
1459
- *
1460
- * // OPTION 2 - Rename with multiple inputs
1461
- * {
1462
- * style: {
1463
- * 'assets/stylesheet.css': [
1464
- * 'path/to/source/file-1.scss',
1465
- * 'path/to/source/file-2.scss',
1466
- * ]
1467
- * }
1468
- * }
1469
- *
1470
- * // OPTION 3 - Rename with overrides
1471
- * {
1472
- * style: {
1473
- * 'assets/filename.min.css': {
1474
- * input: 'path/to/source/file.scss',
1475
- * includePaths: ['node_modules'],
1476
- * watch: []
1477
- * }
1478
- * }
1479
- * }
1480
- *
1481
- * // OPTION 4 - Single config
1482
- * {
1483
- * style: {
1484
- * input: 'path/to/source/file.scss',
1485
- * rename: 'filename.min.css',
1486
- * postcss: [ plugin() ] // use some postcss plugin with this file
1487
- * sass: {
1488
- * includePaths: [
1489
- * 'node_modules/bootstrap' // include this path
1490
- * ]
1491
- * }
1492
- * }
1493
- * }
1494
- *
1495
- * // OPTION 5 - Multiple configs
1496
- * {
1497
- * style: [
1498
- * {
1499
- * input: 'path/to/source/file-1.css',
1500
- * snippet: true,
1501
- * rename: 'some-name.liquid',
1502
- * postcss: [ plugin() ], // use some plugin with this file
1503
- * sass: false // do not process with sass
1504
- * },
1505
- * {
1506
- * input: 'path/to/source/file-2.scss',
1507
- * postcss: false, // do not process with postcss
1508
- * sass: true, // use processor defined settings
1509
- * watch: [
1510
- * 'path/to/files/*.scss'
1511
- * ]
1512
- * }
1513
- * ]
1514
- * }
1515
- */
1516
- style?: StyleTransformer;
1517
-
1518
- /**
1519
- * ###### [DOCUMENTATION](https://syncify.sh/options/transform/script/)
1520
- *
1521
- * **JavaScript/TypeScript Transforms**
1522
- *
1523
- * Script inputs can be defined a few different ways depending on your preference.
1524
- * You can also override ESBuild `processor` defined options on a per-file basis.
1525
- * Options 1, 2 and 3 are typically the preferred structures.
1526
- *
1527
- *
1528
- * @example
1529
- *
1530
- * // OPTION 1 - Rename with single input
1531
- * {
1532
- * script: {
1533
- * 'assets/filename.min.js': 'path/to/source/file.ts', // write to assets dir
1534
- * 'snippets/js-file.liquid': 'path/to/source/foo.ts' // write as snippet
1535
- * }
1536
- * }
1537
- *
1538
- * // OPTION 2 - Rename with multiple inputs
1539
- * {
1540
- * script: {
1541
- * 'assets/[file].min.[ext]': [
1542
- * 'path/to/source/file-1.ts', // outputs assets/file-1.min.js
1543
- * 'path/to/source/file-2.ts', // outputs assets/file-2.min.js
1544
- * ]
1545
- * }
1546
- * }
1547
- *
1548
- * // OPTION 3 - Rename with overrides
1549
- * {
1550
- * script: {
1551
- * 'assets/filename.min.js': {
1552
- * input: 'path/to/source/file.ts',
1553
- * splitting: true,
1554
- * treeShaking: false
1555
- * }
1556
- * }
1557
- * }
1558
- *
1559
- * // OPTION 4 - Single config
1560
- * {
1561
- * script: {
1562
- * input: 'path/to/source/file.ts',
1563
- * rename: 'filename.min.js',
1564
- * esbuild: {}
1565
- * }
1566
- * }
1567
- *
1568
- * // OPTION 5 - Multiple configs
1569
- * {
1570
- * script: [
1571
- * {
1572
- * input: 'path/to/source/file-1.ts',
1573
- * rename: 'filename.min.js',
1574
- * esbuild: {}
1575
- * },
1576
- * {
1577
- * input: 'path/to/source/file-2.ts',
1578
- * snippet: true
1579
- * }
1580
- * ]
1581
- * }
1582
- */
1583
- script?: false | ScriptTransformer
1584
- /**
1585
- * ###### [DOCUMENTATION](https://syncify.sh/options/transform/svg/)
1586
- *
1587
- * **SVG File Transforms**
1588
- *
1589
- * Inline SVG files and Sprites generation. Uses SVGO under the hood
1590
- * and can export as assets (or snippets).
1591
- */
1592
- svg?: SVGTransformer;
1593
- /**
1594
- * ###### [DOCUMENTATION](https://syncify.sh/options/transform/json/)
1595
- *
1596
- * **JSON File Transforms**
1597
- *
1598
- * Options defined here are used when writing to the file system and
1599
- * uploading `.json` files to themes. When running sync operations that
1600
- * import from remote sources will also use these options, they include:
1601
- *
1602
- * - `--merge`
1603
- * - `--pull`
1604
- * - `--download`
1605
- */
1606
- json?: JSONTransform;
1607
- /**
1608
- * ###### [DOCUMENTATION](https://syncify.sh/options/transform/liquid/)
1609
- *
1610
- * **Liquid File Transforms**
1611
- *
1612
- * Liquid transform options are terse-specific and related to minification operations.
1613
- * Syncify uses HTML Minifier Terser under the hood, it has been configured to work with
1614
- * Liquid files.
1615
- *
1616
- * > **NOTE**
1617
- *
1618
- * > Liquid transforms will only be carried out under the `--prod` or `--terse` flag.
1619
- * > If this option is set to `false` then no minification will be applied to `.liquid` files.
1620
- */
1621
- liquid?: LiquidTransform;
1622
-
1623
- }
1624
-
1625
- interface Versioning {
1626
- /**
1627
- * Sets the maximum patch number before incrementing the minor version. Passing a value of `0` will
1628
- * result in **minor** version increments only.
1629
- *
1630
- * @default 10
1631
- */
1632
- patchLimit?: number;
1633
- /**
1634
- * Sets the maximum minor version before incrementing the major version. Passing a value of 0 will
1635
- * result in **major** version increments only.
1636
- *
1637
- * @default 10
1638
- */
1639
- minorLimit?: number;
1640
- /**
1641
- * Sets the version source references that will increment. By default, Syncify will ensure both
1642
- * the `package.json` (if present) and `settings_schema.json` version numbers match, but you may
1643
- * prefer to use a single source.
1644
- *
1645
- * @default
1646
- * [
1647
- * 'package.json'
1648
- * 'settings_schema.json'
1649
- * ]
1650
- */
1651
- references?: [
1652
- 'package.json'?,
1653
- 'settings_schema.json'?
1654
- ]
1655
- }
1656
-
1657
- /* -------------------------------------------- */
1658
- /* IMPORTS */
1659
- /* -------------------------------------------- */
1660
-
1661
-
1662
-
1663
- /* -------------------------------------------- */
1664
- /* EXPORTS */
1665
- /* -------------------------------------------- */
1666
-
1667
- /**
1668
- * **Syncify Configuration**
1669
- *
1670
- * The `defineConfig` named export used within `syncify.config.js` (or `.ts`) configuration files.
1671
- */
1672
- interface Config extends Directories {
1673
- /**
1674
- * Specify the text-editor you use for development. This is optional and when
1675
- * left undefined, Syncify will attempt guess your preferred editor.
1676
- */
1677
- editor?: LiteralUnion<
1678
- | 'vscode'
1679
- | 'sublime'
1680
- | 'atom'
1681
- | 'webstorm'
1682
- | 'intellij'
1683
- | 'textmate'
1684
- | 'xcode'
1685
- | 'nano'
1686
- | 'notepad++'
1687
- | 'gedit'
1688
- | 'vim'
1689
- , string>;
1690
- /**
1691
- * Define customize input structures. Paths will automatically resolve
1692
- * the `input` directory you provide.
1693
- */
1694
- paths?: Paths;
1695
- /**
1696
- * **NOT YET AVAILABLE**
1697
- */
1698
- plugins?: any;
1699
- /**
1700
- * **Clean**
1701
- *
1702
- * Whether of not Syncify should clean output before building.
1703
- */
1704
- clean?: boolean;
1705
- /**
1706
- * **HOT**
1707
- *
1708
- * Hot reloading options. Pass the `--hot` flag to enable.
1709
- *
1710
- * > Passing `--hot` will enable **watch** mode. You do not need to pass `-w`
1711
- * > or `--watch` when `--hot` is provided as it will be assumed.
1712
- */
1713
- hot?: HOT;
1714
- /**
1715
- * **Log**
1716
- *
1717
- * Console log options
1718
- */
1719
- log?: Logger;
1720
- /**
1721
- * **Publish**
1722
- *
1723
- * Provide publish configuration
1724
- */
1725
- publish?: Publishing;
1726
- /**
1727
- * **Spawn**
1728
- *
1729
- * Spawn child process
1730
- */
1731
- spawn?: {
1732
- /**
1733
- * Processes to spawn when running **build** mode, ie: `--build` or `-b`
1734
- *
1735
- * @default {}
1736
- *
1737
- * @example
1738
- *
1739
- * {
1740
- * build: {
1741
- * rollup: 'rollup -c',
1742
- * gulp: ['gulp', 'build-task'] // can also use arrays
1743
- * }
1744
- * }
1745
- */
1746
- build?: { [target: string]: string | string[] };
1747
- /**
1748
- * Processes to spawn when running **watch** mode, ie: `--watch` or `-w`
1749
- *
1750
- * @default {}
1751
- *
1752
- * @example
1753
- * {
1754
- * build: {
1755
- * rollup: 'rollup -c --watch',
1756
- * gulp: ['gulp', 'watch-task'], // can also use arrays
1757
- * }
1758
- * }
1759
- */
1760
- watch?: { [target: string]: string | string[] }
1761
- };
1762
- /**
1763
- * **Transform**
1764
- *
1765
- * The asset transform pipeline configurations
1766
- */
1767
- transform?: Transforms;
1768
- /**
1769
- * **Processor**
1770
- *
1771
- * Configurations for the `transform` processors. Define options for a transform to inherit.
1772
- * You can override these on a per-transform basis. Optionally, you can use the default presets
1773
- * which syncify has pre-configured for optimal output.
1774
- */
1775
- processor?: Processors;
1776
- /**
1777
- * **Version Control**
1778
- *
1779
- * Syncify introduces a strategic version control system based on the Modular Arithmetic Model (**MaM**),
1780
- * a unique approach inspired by, but distinct from, [SemVer](https://semver.org/). The MaM tactic in
1781
- * its appropriation by Syncify to Theme development is designed around the idea that progression should
1782
- * be predictive and controlled. The [Version Control](https://syncify.sh/usage/version-control/) documentation
1783
- * guide provides a strong overview for how Syncify applies versioning to themes.
1784
- */
1785
- versioning?: Versioning
1786
- }
1787
-
1788
- /**
1789
- * ENV Utilities
1790
- *
1791
- * Helper utility for checking environment variables and returning some other data references
1792
- */
1793
- declare const env: {
1794
- /**
1795
- * Whether or not `--dev` mode is running
1796
- */
1797
- readonly dev: boolean;
1798
- /**
1799
- * Whether or not `--prod` mode is running
1800
- */
1801
- readonly prod: boolean;
1802
- /**
1803
- * Whether or not `--watch` mode is running
1804
- */
1805
- readonly watch: boolean;
1806
- };
1807
-
1808
- /**
1809
- * Define Config (named export)
1810
- *
1811
- * Used in `syncify.config.js` or `syncify.config.ts` files and provides type completions to the export.
1812
- */
1813
- declare const defineConfig: (config: Config) => Config;
1814
-
1815
- export { type Config, type Directories, type ESBuildConfig, type HOT, type JSONTerse, type JSONTransform, type LiquidTerse, type LiquidTransform, type Logger, type Paths, type PostCSSConfig, type Processors, type Publishing, type RenamePaths$1 as RenamePaths, type SASSConfig, type SVGFile, type SVGSprite, type SVGTransform, type SVGTransformer, type ScriptTransform, type ScriptTransformer, type StyleTerse, type StyleTransform, type StyleTransformer, type TailwindConfig, type Target, type Transforms, type Versioning, defineConfig, env };