@syncify/cli 1.0.0-unstable.2 → 1.0.0-unstable.3
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/cli.js +119 -112
- package/dist/index.d.ts +225 -128
- package/dist/syncify.js +10769 -6211
- package/hot.js.liquid +2 -2
- package/package.json +34 -31
- package/readme.md +67 -21
- package/scripts/postinstall.js +9 -0
- package/scripts/postuninstall.js +104 -0
- package/scripts/postversion.js +4 -1
- package/scripts/prepublish.js +63 -0
package/dist/index.d.ts
CHANGED
@@ -9,10 +9,11 @@ import { BuildOptions } from 'esbuild';
|
|
9
9
|
export { BuildOptions as ESBuildOptions } from 'esbuild';
|
10
10
|
import { OptionsOutput } from 'clean-css';
|
11
11
|
import { AcceptedPlugin, Plugin, Transformer, TransformCallback } from 'postcss';
|
12
|
+
import { Options } from 'sass-embedded';
|
12
13
|
import { Config as Config$1 } from 'tailwindcss';
|
13
14
|
import { Config as Config$2 } from 'svgo';
|
14
15
|
export { Config as SVGOConfig } from 'svgo';
|
15
|
-
import { Options } from 'markdown-it';
|
16
|
+
import { Options as Options$1 } from 'markdown-it';
|
16
17
|
|
17
18
|
/* -------------------------------------------- */
|
18
19
|
/* BASE DIRECTORIES */
|
@@ -31,12 +32,6 @@ type Directories = {
|
|
31
32
|
* @default 'theme/'
|
32
33
|
*/
|
33
34
|
output?: string;
|
34
|
-
/**
|
35
|
-
* The resolved `config` directory path for build tool files
|
36
|
-
*
|
37
|
-
* @default '/'
|
38
|
-
*/
|
39
|
-
config?: string;
|
40
35
|
}
|
41
36
|
|
42
37
|
type Git = {
|
@@ -420,7 +415,7 @@ type HOTShared = {
|
|
420
415
|
* Specify the websocket port. By default, Syncify uses port `51001` to
|
421
416
|
* avoid any conflicts with other running hosts of tools.
|
422
417
|
*
|
423
|
-
* @default
|
418
|
+
* @default 51001
|
424
419
|
* @example 'ws://localhost:51001/ws'
|
425
420
|
*/
|
426
421
|
socket?: number;
|
@@ -583,47 +578,11 @@ interface Logger {
|
|
583
578
|
clear?: boolean;
|
584
579
|
}
|
585
580
|
|
586
|
-
type StashType = string | number;
|
587
|
-
|
588
|
-
/**
|
589
|
-
* Stash Reference
|
590
|
-
*/
|
591
|
-
type Stash = {
|
592
|
-
/**
|
593
|
-
* Set a stash import location for remote `pull` operations. Files which cannot
|
594
|
-
* be mapped to an existing project-level path location (relative to your `input`)
|
595
|
-
* will be written the provided stash destination defined here.
|
596
|
-
*
|
597
|
-
* > `*`
|
598
|
-
* >
|
599
|
-
* > asterisk value signals for stashes to be written within directory at index `0`
|
600
|
-
*
|
601
|
-
* > `number`
|
602
|
-
* >
|
603
|
-
* > number value will default to `*` and write within directories at that index.
|
604
|
-
*
|
605
|
-
* > `true`
|
606
|
-
* >
|
607
|
-
* > boolean `true` value signals for stashed to be written in `stash/` directory at index `0`
|
608
|
-
*
|
609
|
-
* ---
|
610
|
-
*
|
611
|
-
* You can optionally provide a sub-directory path.
|
612
|
-
*
|
613
|
-
*/
|
614
|
-
stash: StashType;
|
615
|
-
}
|
616
|
-
|
617
581
|
/**
|
618
582
|
* String or Array of strings
|
619
583
|
*/
|
620
584
|
type Path = string | string[];
|
621
585
|
|
622
|
-
/**
|
623
|
-
* Union join of accepted Path patterns
|
624
|
-
*/
|
625
|
-
type Pattern = Path | [ ...globs: string[], stash: Stash ];
|
626
|
-
|
627
586
|
/**
|
628
587
|
* Section and Snippet Rename Paths
|
629
588
|
*/
|
@@ -638,9 +597,8 @@ type Rename = {
|
|
638
597
|
* 'sections/foo/*', // sections in this directory will prefix foo-
|
639
598
|
* 'sections/bar/*' // sections in this directory will prefix bar-
|
640
599
|
* ],
|
641
|
-
* '
|
642
|
-
* './sections/**'
|
643
|
-
* { stash: 'files' } // stashes imports within sections/files
|
600
|
+
* '[name]': [
|
601
|
+
* './sections/**' // all other sections will use source name
|
644
602
|
* ],
|
645
603
|
* },
|
646
604
|
* snippets: {
|
@@ -648,14 +606,13 @@ type Rename = {
|
|
648
606
|
* 'snippets/foo/*', // snippets in this directory will prefix foo-
|
649
607
|
* 'snippets/bar/*' // snippets in this directory will prefix bar-
|
650
608
|
* ],
|
651
|
-
* '
|
609
|
+
* '[name]': [
|
652
610
|
* './snippets/**', // all other snippets will use source name
|
653
|
-
* { stash: true } // stashes will be written
|
654
611
|
* ]
|
655
612
|
* }
|
656
613
|
* }
|
657
614
|
*/
|
658
|
-
'*'?:
|
615
|
+
'*'?: Path;
|
659
616
|
/**
|
660
617
|
* Use the filename as per the source. Passing `[name]` only will result in fallback
|
661
618
|
* behaviour, as that of `'*'`.
|
@@ -687,35 +644,35 @@ type Rename = {
|
|
687
644
|
* }
|
688
645
|
* }
|
689
646
|
*/
|
690
|
-
'[name]'?:
|
647
|
+
'[name]'?: Path;
|
691
648
|
/**
|
692
649
|
* Prefix directory name and suffix filename in **kebab-case** format.
|
693
650
|
*
|
694
651
|
* @example
|
695
652
|
* 'layout/header.liquid' > 'layout-header.liquid'
|
696
653
|
*/
|
697
|
-
'[dir]-[name]'?:
|
654
|
+
'[dir]-[name]'?: Path;
|
698
655
|
/**
|
699
656
|
* Prefix directory name and suffix filename in **snake_case** format.
|
700
657
|
*
|
701
658
|
* @example
|
702
659
|
* 'layout/header.liquid' > 'layout_header.liquid'
|
703
660
|
*/
|
704
|
-
'[dir]_[name]'?:
|
661
|
+
'[dir]_[name]'?: Path;
|
705
662
|
/**
|
706
663
|
* Prefix filename and suffix directory in **kebab-case** format.
|
707
664
|
*
|
708
665
|
* @example
|
709
666
|
* 'layout/header.liquid' > 'header-layout.liquid'
|
710
667
|
*/
|
711
|
-
'[name]-[dir]'?:
|
668
|
+
'[name]-[dir]'?: Path;
|
712
669
|
/**
|
713
670
|
* Prefix filename and suffix directory in **snake_case** format.
|
714
671
|
*
|
715
672
|
* @example
|
716
673
|
* 'layout/header.liquid' > 'header_layout.liquid'
|
717
674
|
*/
|
718
|
-
'[name]_[dir]'?:
|
675
|
+
'[name]_[dir]'?: Path;
|
719
676
|
}
|
720
677
|
|
721
678
|
/**
|
@@ -728,14 +685,14 @@ type RenameSnippets = Rename & {
|
|
728
685
|
* @example
|
729
686
|
* 'layout/header.liquid' > 'header.layout.liquid'
|
730
687
|
*/
|
731
|
-
'[name].[dir]'?:
|
688
|
+
'[name].[dir]'?: Path;
|
732
689
|
/**
|
733
690
|
* Prefix directory and suffix filename with `.` dot separator.
|
734
691
|
*
|
735
692
|
* @example
|
736
693
|
* 'layout/header.liquid' > 'layout.header.liquid'
|
737
694
|
*/
|
738
|
-
'[dir].[name]'?:
|
695
|
+
'[dir].[name]'?: Path;
|
739
696
|
}
|
740
697
|
|
741
698
|
type Paths = {
|
@@ -781,7 +738,7 @@ type Paths = {
|
|
781
738
|
* }
|
782
739
|
* }
|
783
740
|
*/
|
784
|
-
snippets?:
|
741
|
+
snippets?: Path | RenameSnippets
|
785
742
|
/**
|
786
743
|
* A glob string, glob array or rename `output → input` key/value object of files to be uploaded as sections.
|
787
744
|
*
|
@@ -835,55 +792,55 @@ type Paths = {
|
|
835
792
|
* ]
|
836
793
|
* }
|
837
794
|
*/
|
838
|
-
sections?:
|
795
|
+
sections?: Path | Rename;
|
839
796
|
/**
|
840
797
|
* A glob string or glob array of files to be uploaded as blocks
|
841
798
|
*
|
842
799
|
* @default 'source/blocks/*.{liquid}'
|
843
800
|
*/
|
844
|
-
blocks?:
|
801
|
+
blocks?: Path;
|
845
802
|
/**
|
846
803
|
* A glob string or glob array of files to be uploaded as templates.
|
847
804
|
*
|
848
805
|
* @default 'source/templates/*.{liquid,json}'
|
849
806
|
*/
|
850
|
-
templates?:
|
807
|
+
templates?: Path;
|
851
808
|
/**
|
852
809
|
* A glob string or glob array of files to be uploaded asas metaobject templates
|
853
810
|
*
|
854
811
|
* @default 'source/templates/metaobject/*.{liquid,json}'
|
855
812
|
*/
|
856
|
-
metaobject?:
|
813
|
+
metaobject?: Path;
|
857
814
|
/**
|
858
815
|
* A glob string or glob array of files to be uploaded as template/customers
|
859
816
|
*
|
860
817
|
* @default 'source/templates/customers/*.{liquid,json}'
|
861
818
|
*/
|
862
|
-
customers?:
|
819
|
+
customers?: Path;
|
863
820
|
/**
|
864
821
|
* A glob string or glob array of files to be uploaded as assets
|
865
822
|
*
|
866
823
|
* @default 'source/assets/*'
|
867
824
|
*/
|
868
|
-
assets?:
|
825
|
+
assets?: Path;
|
869
826
|
/**
|
870
827
|
* A glob string or glob array of files to be uploaded as layouts
|
871
828
|
*
|
872
829
|
* @default 'source/layout/*.liquid'
|
873
830
|
*/
|
874
|
-
layout?:
|
831
|
+
layout?: Path;
|
875
832
|
/**
|
876
833
|
* A glob string or glob array of files to be uploaded as configs, i.e, `settings_schema.json`
|
877
834
|
*
|
878
835
|
* @default 'source/config/.json'
|
879
836
|
*/
|
880
|
-
config?:
|
837
|
+
config?: Path;
|
881
838
|
/**
|
882
839
|
* A glob string or glob array of files to be uploaded as config, i.e, `en.default.json`
|
883
840
|
*
|
884
841
|
* @default 'source/locales/*.json'
|
885
842
|
*/
|
886
|
-
locales?:
|
843
|
+
locales?: Path;
|
887
844
|
/**
|
888
845
|
* A glob string or glob array of files to be uploaded as **shared schema** `.json` or `.schema` files.
|
889
846
|
*
|
@@ -903,9 +860,11 @@ type Paths = {
|
|
903
860
|
*/
|
904
861
|
metafields?: Path;
|
905
862
|
/**
|
906
|
-
* **NOT YET AVAILABLE**
|
863
|
+
* > **NOT YET AVAILABLE**
|
864
|
+
* >
|
865
|
+
* > **This option will be available in later versions**
|
907
866
|
*
|
908
|
-
*
|
867
|
+
* ---
|
909
868
|
*
|
910
869
|
* A glob string or glob array string to be uploaded, published and controlled as `pages`
|
911
870
|
*
|
@@ -913,33 +872,41 @@ type Paths = {
|
|
913
872
|
*/
|
914
873
|
pages?: Path;
|
915
874
|
/**
|
916
|
-
* **NOT YET AVAILABLE**
|
875
|
+
* > **NOT YET AVAILABLE**
|
876
|
+
* >
|
877
|
+
* > **This option will be available in later versions**
|
917
878
|
*
|
918
|
-
*
|
879
|
+
* ---
|
919
880
|
*
|
920
881
|
* @default 'source/+/blogs/*'
|
921
882
|
*/
|
922
883
|
blogs?: Path;
|
923
884
|
/**
|
924
|
-
* **NOT YET AVAILABLE**
|
885
|
+
* > **NOT YET AVAILABLE**
|
886
|
+
* >
|
887
|
+
* > **This option will be available in later versions**
|
925
888
|
*
|
926
|
-
*
|
889
|
+
* ---
|
927
890
|
*
|
928
891
|
* @default 'source/+/menus/*.json'
|
929
892
|
*/
|
930
893
|
navigation?: Path;
|
931
894
|
/**
|
932
|
-
* **NOT YET AVAILABLE**
|
895
|
+
* > **NOT YET AVAILABLE**
|
896
|
+
* >
|
897
|
+
* > **This option will be available in later versions**
|
933
898
|
*
|
934
|
-
*
|
899
|
+
* ---
|
935
900
|
*
|
936
901
|
* @default 'source/+/policies/*.{html,md}'
|
937
902
|
*/
|
938
903
|
policies?: Path;
|
939
904
|
/**
|
940
|
-
* **NOT YET AVAILABLE**
|
905
|
+
* > **NOT YET AVAILABLE**
|
906
|
+
* >
|
907
|
+
* > **This option will be available in later versions**
|
941
908
|
*
|
942
|
-
*
|
909
|
+
* ---
|
943
910
|
*
|
944
911
|
* @default 'source/+/files/**'
|
945
912
|
*/
|
@@ -1235,6 +1202,15 @@ type PostCSSConfig = (
|
|
1235
1202
|
| any
|
1236
1203
|
);
|
1237
1204
|
|
1205
|
+
type SassOptions = Pick<
|
1206
|
+
Options<'sync'>,
|
1207
|
+
| 'fatalDeprecations'
|
1208
|
+
| 'functions'
|
1209
|
+
| 'futureDeprecations'
|
1210
|
+
| 'quietDeps'
|
1211
|
+
| 'silenceDeprecations'
|
1212
|
+
>
|
1213
|
+
|
1238
1214
|
/**
|
1239
1215
|
* Style Minification
|
1240
1216
|
*/
|
@@ -1278,7 +1254,7 @@ type TailwindConfig = Config$1 & {
|
|
1278
1254
|
config: string[]
|
1279
1255
|
}
|
1280
1256
|
|
1281
|
-
type SASSConfig = {
|
1257
|
+
type SASSConfig = SassOptions & {
|
1282
1258
|
/**
|
1283
1259
|
* Whether or not to generate sourcemaps
|
1284
1260
|
*
|
@@ -1299,18 +1275,6 @@ type SASSConfig = {
|
|
1299
1275
|
* @default true
|
1300
1276
|
*/
|
1301
1277
|
warnings?: boolean;
|
1302
|
-
/**
|
1303
|
-
* This option is passed to SASS Dart compile instance. If this option is set to `true`,
|
1304
|
-
* Sass won’t print warnings that are caused by dependencies. A "dependency" is defined
|
1305
|
-
* as any file that’s loaded through external sources.
|
1306
|
-
*
|
1307
|
-
* This is useful for silencing deprecation warnings that you can’t fix on your own.
|
1308
|
-
* However, please also notify your dependencies of the deprecations so that they can get
|
1309
|
-
* fixed as soon as possible!
|
1310
|
-
*
|
1311
|
-
* @default false
|
1312
|
-
*/
|
1313
|
-
quietDeps?: boolean;
|
1314
1278
|
/**
|
1315
1279
|
* A list of paths to include, ie: node_modules.
|
1316
1280
|
*
|
@@ -1439,14 +1403,18 @@ type StyleTransform<T = string | string[]> = {
|
|
1439
1403
|
*/
|
1440
1404
|
sass?: boolean | SASSConfig;
|
1441
1405
|
/**
|
1442
|
-
* **
|
1406
|
+
* > **NOT YET AVAILABLE**
|
1407
|
+
* >
|
1408
|
+
* > **This option will be available in later versions**
|
1409
|
+
*
|
1410
|
+
* ---
|
1443
1411
|
*
|
1444
1412
|
* Terse Style (CSS) Minification
|
1445
1413
|
*
|
1446
1414
|
* > Uses [clean-css](https://github.com/clean-css/clean-css) minification
|
1447
1415
|
* > Uses [purge-css](https://github.com/FullHuman/purgecss)
|
1448
1416
|
*/
|
1449
|
-
terse?: boolean |
|
1417
|
+
terse?: boolean | OptionsOutput;
|
1450
1418
|
}
|
1451
1419
|
|
1452
1420
|
/* -------------------------------------------- */
|
@@ -1498,6 +1466,7 @@ type SVGFile = {
|
|
1498
1466
|
/**
|
1499
1467
|
* Rename the svg file/s. The same name as source file will be used
|
1500
1468
|
* when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
|
1469
|
+
*
|
1501
1470
|
* ---
|
1502
1471
|
*
|
1503
1472
|
* @default undefined
|
@@ -1688,14 +1657,7 @@ type Processors = {
|
|
1688
1657
|
/**
|
1689
1658
|
* [Markdown](https://github.com/markdown-it/markdown-it) Config
|
1690
1659
|
*/
|
1691
|
-
markdown?: Options;
|
1692
|
-
}
|
1693
|
-
|
1694
|
-
interface Publishing {
|
1695
|
-
/**
|
1696
|
-
* Git publish
|
1697
|
-
*/
|
1698
|
-
git: Git;
|
1660
|
+
markdown?: Options$1;
|
1699
1661
|
}
|
1700
1662
|
|
1701
1663
|
/**
|
@@ -1822,7 +1784,7 @@ type JSONTransform = {
|
|
1822
1784
|
* An optional string list of paths/filenames to exclude
|
1823
1785
|
* from processing, ie: pass through
|
1824
1786
|
*
|
1825
|
-
* @default
|
1787
|
+
* @default []
|
1826
1788
|
*/
|
1827
1789
|
exclude?: string[];
|
1828
1790
|
/**
|
@@ -1906,10 +1868,13 @@ type LiquidTransform = {
|
|
1906
1868
|
|
1907
1869
|
type Transforms = {
|
1908
1870
|
/**
|
1909
|
-
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/style/)
|
1910
|
-
*
|
1911
1871
|
* **Style File transforms**
|
1912
1872
|
*
|
1873
|
+
* Style transformations perform CSS processing. Syncify supports various cascades,
|
1874
|
+
* including SASS, Tailwind and PostCSS.
|
1875
|
+
*
|
1876
|
+
* [Syncify Documentation](https://syncify.sh/options/transform/style/)
|
1877
|
+
*
|
1913
1878
|
* @example
|
1914
1879
|
*
|
1915
1880
|
* // OPTION 1 - Rename with single input
|
@@ -1979,14 +1944,13 @@ type Transforms = {
|
|
1979
1944
|
style?: StyleTransformer;
|
1980
1945
|
|
1981
1946
|
/**
|
1982
|
-
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/script/)
|
1983
|
-
*
|
1984
1947
|
* **JavaScript/TypeScript Transforms**
|
1985
1948
|
*
|
1986
1949
|
* Script inputs can be defined a few different ways depending on your preference.
|
1987
1950
|
* You can also override ESBuild `processor` defined options on a per-file basis.
|
1988
1951
|
* Options 1, 2 and 3 are typically the preferred structures.
|
1989
1952
|
*
|
1953
|
+
* [Syncify Documentation](https://syncify.sh/options/transform/script/)
|
1990
1954
|
*
|
1991
1955
|
* @example
|
1992
1956
|
*
|
@@ -2045,37 +2009,33 @@ type Transforms = {
|
|
2045
2009
|
*/
|
2046
2010
|
script?: false | ScriptTransformer
|
2047
2011
|
/**
|
2048
|
-
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/svg/)
|
2049
|
-
*
|
2050
2012
|
* **SVG File Transforms**
|
2051
2013
|
*
|
2052
2014
|
* Inline SVG files and Sprites generation. Uses SVGO under the hood
|
2053
2015
|
* and can export as assets (or snippets).
|
2016
|
+
*
|
2017
|
+
* [Syncify Documentation](https://syncify.sh/options/transform/svg/)
|
2054
2018
|
*/
|
2055
2019
|
svg?: SVGTransformer;
|
2056
2020
|
/**
|
2057
|
-
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/json/)
|
2058
|
-
*
|
2059
2021
|
* **JSON File Transforms**
|
2060
2022
|
*
|
2061
2023
|
* Options defined here are used when writing to the file system and
|
2062
|
-
* uploading `.json` files to themes. When running
|
2063
|
-
* import from
|
2024
|
+
* uploading `.json` files to themes. When running `sy pull` or operations
|
2025
|
+
* that import from online stores, configuration defined here will be respected.
|
2064
2026
|
*
|
2065
|
-
*
|
2066
|
-
* - `--pull`
|
2067
|
-
* - `--download`
|
2027
|
+
* [Syncify Documentation](https://syncify.sh/options/transform/json/)
|
2068
2028
|
*/
|
2069
2029
|
json?: JSONTransform;
|
2070
2030
|
/**
|
2071
|
-
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/liquid/)
|
2072
|
-
*
|
2073
2031
|
* **Liquid File Transforms**
|
2074
2032
|
*
|
2075
2033
|
* Liquid transform options are terse-specific and related to minification operations.
|
2076
2034
|
* Syncify uses HTML Minifier Terser under the hood, it has been configured to work with
|
2077
2035
|
* Liquid files.
|
2078
2036
|
*
|
2037
|
+
* [Syncify Documentation](https://syncify.sh/options/transform/liquid/)
|
2038
|
+
*
|
2079
2039
|
* > **NOTE**
|
2080
2040
|
*
|
2081
2041
|
* > Liquid transforms will only be carried out under the `--prod` or `--terse` flag.
|
@@ -2083,7 +2043,11 @@ type Transforms = {
|
|
2083
2043
|
*/
|
2084
2044
|
liquid?: LiquidTransform;
|
2085
2045
|
/**
|
2086
|
-
*
|
2046
|
+
* > **NOT YET AVAILABLE**
|
2047
|
+
* >
|
2048
|
+
* > **This option will be available in later versions**
|
2049
|
+
*
|
2050
|
+
* ---
|
2087
2051
|
*
|
2088
2052
|
* **Markdown File Transforms**
|
2089
2053
|
*
|
@@ -2143,7 +2107,7 @@ type VC = {
|
|
2143
2107
|
*
|
2144
2108
|
* The `defineConfig` named export used within `syncify.config.js` (or `.ts`) configuration files.
|
2145
2109
|
*/
|
2146
|
-
|
2110
|
+
type Config = Directories & {
|
2147
2111
|
/**
|
2148
2112
|
* Specify the text-editor you use for development. This is optional and when
|
2149
2113
|
* left undefined, Syncify will attempt guess your preferred editor.
|
@@ -2168,9 +2132,13 @@ interface Config extends Directories {
|
|
2168
2132
|
*/
|
2169
2133
|
paths?: Paths;
|
2170
2134
|
/**
|
2171
|
-
* **NOT YET AVAILABLE**
|
2135
|
+
* > **NOT YET AVAILABLE**
|
2136
|
+
* >
|
2137
|
+
* > **This option will be available in later versions**
|
2172
2138
|
*
|
2173
|
-
*
|
2139
|
+
* ---
|
2140
|
+
*
|
2141
|
+
* Syncify plugins are planned in future releases!
|
2174
2142
|
*/
|
2175
2143
|
plugins?: never;
|
2176
2144
|
/**
|
@@ -2194,12 +2162,6 @@ interface Config extends Directories {
|
|
2194
2162
|
* Console log options
|
2195
2163
|
*/
|
2196
2164
|
log?: Logger;
|
2197
|
-
/**
|
2198
|
-
* **Publish**
|
2199
|
-
*
|
2200
|
-
* Provide publish configuration
|
2201
|
-
*/
|
2202
|
-
publish?: Publishing;
|
2203
2165
|
/**
|
2204
2166
|
* **Git**
|
2205
2167
|
*
|
@@ -2234,6 +2196,141 @@ interface Config extends Directories {
|
|
2234
2196
|
processor?: Processors;
|
2235
2197
|
}
|
2236
2198
|
|
2199
|
+
declare global {
|
2200
|
+
|
2201
|
+
export interface Window {
|
2202
|
+
/**
|
2203
|
+
* Syncify HOT Reloading
|
2204
|
+
*/
|
2205
|
+
Syncify: {
|
2206
|
+
/**
|
2207
|
+
* The HOT Module version number
|
2208
|
+
*/
|
2209
|
+
readonly version: string;
|
2210
|
+
/**
|
2211
|
+
* Returns the current `template` name according to Liquid objects
|
2212
|
+
*/
|
2213
|
+
readonly template: string;
|
2214
|
+
/**
|
2215
|
+
* Sends a message to the server of websocket to informs upon the current template.
|
2216
|
+
* In most cases, this will be dispatched automatically, but in some cases you may
|
2217
|
+
* control the rendering cycle and need to issue this programmatically.
|
2218
|
+
*/
|
2219
|
+
route: (params?: { directory: string; template: string; }) => void;
|
2220
|
+
/**
|
2221
|
+
* Check to see if Syncify is ready or not
|
2222
|
+
*/
|
2223
|
+
isReady: boolean;
|
2224
|
+
/**
|
2225
|
+
* Whether or not the websocket is connected
|
2226
|
+
*/
|
2227
|
+
isConnected: boolean;
|
2228
|
+
/**
|
2229
|
+
* A Map of web components registered in the DOM.
|
2230
|
+
*/
|
2231
|
+
WebC: Map<string, string>;
|
2232
|
+
/**
|
2233
|
+
* List of errors encountered
|
2234
|
+
*/
|
2235
|
+
errors: Array<{
|
2236
|
+
/**
|
2237
|
+
* Error title
|
2238
|
+
*/
|
2239
|
+
title: string;
|
2240
|
+
/**
|
2241
|
+
* Description
|
2242
|
+
*/
|
2243
|
+
description: string;
|
2244
|
+
/**
|
2245
|
+
* Group
|
2246
|
+
*/
|
2247
|
+
group: string;
|
2248
|
+
}>
|
2249
|
+
/**
|
2250
|
+
* Page section maps
|
2251
|
+
*/
|
2252
|
+
sections: {
|
2253
|
+
/**
|
2254
|
+
* Returns the object where section ids are properties
|
2255
|
+
* and the values are an array list of dynamic applied ids.
|
2256
|
+
* Returns `null` if no section exist.
|
2257
|
+
*/
|
2258
|
+
list: () => {
|
2259
|
+
/**
|
2260
|
+
* Map holds the dynamic identifiers
|
2261
|
+
*/
|
2262
|
+
map: {
|
2263
|
+
[id: string]: string[];
|
2264
|
+
},
|
2265
|
+
/**
|
2266
|
+
* Alias is template defined sections
|
2267
|
+
*/
|
2268
|
+
alias: {
|
2269
|
+
[template: string]: {
|
2270
|
+
[section: string]: string[];
|
2271
|
+
}
|
2272
|
+
}
|
2273
|
+
}
|
2274
|
+
/**
|
2275
|
+
* Method for loading section id maps. Helpful when executing
|
2276
|
+
* OTW (Over the wire) page replacements like SPX. When invoked,
|
2277
|
+
* it will obtains all the section ids in the document body.
|
2278
|
+
*
|
2279
|
+
* This is called at runtime in HOT method. Returns the object map
|
2280
|
+
* of matches or `null` if no sections exist.
|
2281
|
+
*/
|
2282
|
+
load: (dom?: HTMLElement) => { [id: string]: string[]; };
|
2283
|
+
/**
|
2284
|
+
* Returns all elements matching the provided `id` which is obtained
|
2285
|
+
* via the websocket `data` parameter. Query Selects all matches. If
|
2286
|
+
* no matches are found, returns null.
|
2287
|
+
*/
|
2288
|
+
get: (id: string[]) => NodeListOf<HTMLElement>;
|
2289
|
+
};
|
2290
|
+
/**
|
2291
|
+
* Full page refresh
|
2292
|
+
*/
|
2293
|
+
refresh: () => void;
|
2294
|
+
/**
|
2295
|
+
* HOT reloads the `<body>`
|
2296
|
+
*/
|
2297
|
+
reload: (callback?: (dom: Document) => void) => void;
|
2298
|
+
/**
|
2299
|
+
* List of event hooks to fire during HOT swaps
|
2300
|
+
*/
|
2301
|
+
onReload: (callback: (instance: Window['Syncify']) => void) => void;
|
2302
|
+
/**
|
2303
|
+
* List of event hooks to fire during HOT swaps
|
2304
|
+
*/
|
2305
|
+
onMorph: (callback: (oldDom: HTMLElement, newDom: HTMLElement) => boolean) => void;
|
2306
|
+
/**
|
2307
|
+
* List of event hooks to fire during HOT swaps
|
2308
|
+
*/
|
2309
|
+
onAsset: (callback: (type: 'stylesheet' | 'script', url: string) => boolean) => void;
|
2310
|
+
/**
|
2311
|
+
* HOT Reloads all assets
|
2312
|
+
*/
|
2313
|
+
assets: () => void;
|
2314
|
+
/**
|
2315
|
+
* Change the label style
|
2316
|
+
*/
|
2317
|
+
style: {
|
2318
|
+
/**
|
2319
|
+
* The dynamic parent node
|
2320
|
+
*/
|
2321
|
+
parent: (style: Partial<CSSStyleDeclaration>) => void;
|
2322
|
+
/**
|
2323
|
+
* The inner node which contains the event text
|
2324
|
+
*/
|
2325
|
+
label: (style: Partial<CSSStyleDeclaration>) => void;
|
2326
|
+
}
|
2327
|
+
}
|
2328
|
+
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
export const Syncify: Window['Syncify'];
|
2332
|
+
}
|
2333
|
+
|
2237
2334
|
/**
|
2238
2335
|
* ENV Utilities
|
2239
2336
|
*
|
@@ -2255,10 +2352,10 @@ declare const env: {
|
|
2255
2352
|
};
|
2256
2353
|
|
2257
2354
|
/**
|
2258
|
-
* Define Config (named export)
|
2355
|
+
* Syncify Define Config (named export)
|
2259
2356
|
*
|
2260
2357
|
* Used in `syncify.config.js` or `syncify.config.ts` files and provides type completions to the export.
|
2261
2358
|
*/
|
2262
2359
|
declare const defineConfig: (config: Config) => Config;
|
2263
2360
|
|
2264
|
-
export { type Config, type Directories, type ESBuildConfig, type ESBuildTarget, type Git, type HOT, type JSONTerse, type JSONTransform, type LiquidTerse, type LiquidTransform, type Logger, type Paths, type
|
2361
|
+
export { type Config, type Directories, type ESBuildConfig, type ESBuildTarget, type Git, type HOT, type JSONTerse, type JSONTransform, type LiquidTerse, type LiquidTransform, type Logger, type Paths, type PostCSSConfig, type Processors, type Rename, type SASSConfig, type SVGFile, type SVGSprite, type SVGTransform, type SVGTransformer, type SassOptions, type ScriptTransform, type ScriptTransformer, type StyleTerse, type StyleTransform, type StyleTransformer, type TailwindConfig, type Transforms, type VC, defineConfig, env };
|