@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.
Files changed (41) hide show
  1. package/LICENSE +10 -6
  2. package/dist/index.d.cts +1815 -0
  3. package/dist/index.d.ts +1815 -0
  4. package/package.json +101 -103
  5. package/pnpm-lock.yaml +16312 -4430
  6. package/readme.md +76 -2184
  7. package/scripts/hot.js.liquid +25 -0
  8. package/dist/api.js +0 -16
  9. package/dist/cjs.js +0 -236
  10. package/dist/cli.js +0 -11
  11. package/dist/index.js +0 -18
  12. package/hot.js.liquid +0 -3
  13. package/schema/syncify.config.json +0 -676
  14. package/schema/syncify.env.json +0 -58
  15. package/schema/syncify.package.json +0 -11
  16. package/types/api.d.ts +0 -319
  17. package/types/bundle/cache.d.ts +0 -101
  18. package/types/bundle/commands.d.ts +0 -396
  19. package/types/bundle/errors.d.ts +0 -101
  20. package/types/bundle/file.d.ts +0 -285
  21. package/types/bundle/filters.d.ts +0 -81
  22. package/types/bundle/hot.d.ts +0 -185
  23. package/types/bundle/index.d.ts +0 -603
  24. package/types/bundle/plugin.d.ts +0 -127
  25. package/types/bundle/processors.d.ts +0 -54
  26. package/types/bundle/reports.d.ts +0 -123
  27. package/types/bundle/requests.d.ts +0 -374
  28. package/types/bundle/shared.d.ts +0 -124
  29. package/types/cli.d.ts +0 -547
  30. package/types/config/index.d.ts +0 -550
  31. package/types/config/terser.d.ts +0 -319
  32. package/types/config/views.d.ts +0 -191
  33. package/types/index.d.ts +0 -55
  34. package/types/modules/html-minifier-terser.d.ts +0 -218
  35. package/types/stores.d.ts +0 -11
  36. package/types/transforms/image.d.ts +0 -15
  37. package/types/transforms/json.d.ts +0 -51
  38. package/types/transforms/pages.d.ts +0 -254
  39. package/types/transforms/script.d.ts +0 -308
  40. package/types/transforms/style.d.ts +0 -219
  41. package/types/transforms/svg.d.ts +0 -189
@@ -1,319 +0,0 @@
1
- import type { BuildOptions } from 'esbuild';
2
- import type { LiteralUnion, Merge } from 'type-fest';
3
- import type { OptionsOutput as CleanCSSOptions } from 'clean-css';
4
- import type { HTMLMinifierTerserOptions } from '../modules/html-minifier-terser';
5
-
6
- /**
7
- * ESBuild minification options
8
- */
9
- export type ScriptTerse = Merge<Pick<BuildOptions,
10
- | 'keepNames'
11
- | 'mangleProps'
12
- | 'minifyIdentifiers'
13
- | 'minifySyntax'
14
- | 'minifyWhitespace'
15
- | 'mangleQuoted'
16
- >,
17
- {
18
- /**
19
- * List of input file names to exclude from minification
20
- *
21
- * @default 'none'
22
- */
23
- legalComments?: LiteralUnion<BuildOptions['legalComments'], string>
24
- /**
25
- * List of input file names to exclude from minification
26
- *
27
- * @default []
28
- */
29
- exclude?: string[];
30
- }
31
- >
32
-
33
- /**
34
- * JSON File Minification
35
- */
36
- export interface JSONTerse {
37
- /**
38
- * Minify `.json` files writing to `theme/assets`
39
- *
40
- * @default true
41
- */
42
- assets?: boolean;
43
- /**
44
- * Minify `settings_schema.json` and `settings_data.json` config files.
45
- *
46
- * @default true
47
- */
48
- config?: boolean;
49
- /**
50
- * Minify `locale` and `.json` files.
51
- *
52
- * @default true
53
- */
54
- locales?: boolean;
55
- /**
56
- * Minify `metafield` and `.json` files.
57
- *
58
- * @default true
59
- */
60
- metafields?: boolean;
61
- /**
62
- * Minify `metaobject` and `.json` files.
63
- *
64
- * @default true
65
- */
66
- metaobject?: boolean;
67
- /**
68
- * Minify section group `.json` files
69
- *
70
- * @default true
71
- */
72
- groups?: boolean;
73
- /**
74
- * Minify `template` and `.json` files.
75
- *
76
- * @default true
77
- */
78
- templates?: boolean;
79
- /**
80
- * An optional list of paths/files to exclude from minification.
81
- *
82
- * @default []
83
- */
84
- exclude?: string[]
85
- }
86
-
87
- /**
88
- * Liquid Minification
89
- */
90
- export interface LiquidTerse {
91
- /**
92
- * Minifies inner contents of `{% javascript %}` tags
93
- *
94
- * @default false
95
- */
96
- minifyJavascript?: boolean;
97
- /**
98
- * Minifies inner contents of `{% stylesheet %}`` tags
99
- *
100
- * @default false
101
- */
102
- minifyStylesheet?: boolean;
103
- /**
104
- * Minifies inner contents of `{% style %}` tags
105
- *
106
- * @default false
107
- */
108
- minifyStyle?: boolean;
109
- /**
110
- * Minifies JSON contained within Liquid `{% schema %}` tags.
111
- *
112
- * > **NOTE**
113
- * >
114
- * > Minifying schema tag contents has no effect on store performance.
115
- *
116
- * @default false
117
- */
118
- minifySchema?: boolean;
119
- /**
120
- * Remove all occurances of Liquid comments
121
- *
122
- * @default true
123
- */
124
- removeComments?: boolean;
125
- /**
126
- * Collapse all whitespace and newlines
127
- *
128
- * @default true
129
- */
130
- collapseWhitespace?: boolean;
131
- /**
132
- * Removes redundant whitespace Liquid dash trims from Liquid tags and objects.
133
- *
134
- * @default true
135
- */
136
- stripDashes?: boolean;
137
- /**
138
- * **NOT YET AVAILABLE**
139
- *
140
- * Removes all whitespace and newline occurances within Liquid syntax.
141
- *
142
- * > **NOTE**
143
- * >
144
- * > Liquid token minification has no effect on store performance.
145
- *
146
- * @default
147
- * true
148
- *
149
- * @example
150
- *
151
- * // Assuming that collapseWhitespace is set to true.
152
- * // Using this option would result in the following
153
- *
154
- * // BEFORE
155
- *
156
- * {% unless foo == bar %}
157
- * {{ some.object | filter: 'foo' }}
158
- * {% endunless %}
159
- *
160
- * // AFTER
161
- *
162
- * {%unless foo==bar%}{{some.object|filter:'foo'}}{%endunless%}
163
- */
164
- collapseInner?: boolean;
165
- /**
166
- * Excluded files from minification
167
- *
168
- * @default []
169
- */
170
- exclude?: string[]
171
- }
172
-
173
- /**
174
- * Liquid Minification
175
- */
176
- export interface MarkupTerse {
177
- /**
178
- * Minifies inner contents of `<script>` tags
179
- *
180
- * @default true
181
- */
182
- minifyJS?: boolean;
183
- /**
184
- * Minifies inner contents of `<style>` tags
185
- *
186
- * @default true
187
- */
188
- minifyCSS?: boolean;
189
- /**
190
- * Remove all occurances of HTML comments
191
- *
192
- * @default true
193
- */
194
- removeComments?: boolean;
195
- /**
196
- * Collapse all whitespace and newlines
197
- *
198
- * @default true
199
- */
200
- collapseWhitespace?: boolean;
201
- /**
202
- * Excluded files from minification
203
- *
204
- * @default []
205
- */
206
- exclude?: string[]
207
- }
208
-
209
- /**
210
- * Style Minification
211
- */
212
- export interface StyleTerse extends CleanCSSOptions {
213
- /**
214
- * Whether or not to purge unused CSS class names
215
- *
216
- * @default false
217
- */
218
- purgeUnusedCSS?: boolean;
219
- /**
220
- * Whether or not to obfuscate CSS class names
221
- *
222
- * @default false
223
- */
224
- obfuscateClassNames?: boolean;
225
- /**
226
- * List of class names that should be excluded from
227
- * obfuscation and shortnaming.
228
- */
229
- obfuscateWhitelist?: string[];
230
- /**
231
- * The alphabet used to generate the new class names.
232
- *
233
- * > **NOTE**
234
- * >
235
- * > There is no `d` in the default alphabet to avoid adblock issues.
236
- *
237
- * @default 'abcefghijklmnopqrstuvwxyz0123456789'
238
- */
239
- obfuscateAlphabet?: string;
240
- /**
241
- * Excluded files from terser minification
242
- *
243
- * @default []
244
- */
245
- exclude?: string[]
246
- }
247
-
248
- /* -------------------------------------------- */
249
- /* INTERNAL USE */
250
- /* -------------------------------------------- */
251
-
252
- /**
253
- * **INTERNAL USE**
254
- *
255
- * Terser minification configuration
256
- */
257
- export interface TerserConfig {
258
- /**
259
- * Terse JSON Minification
260
- */
261
- json?: JSONTerse;
262
- /**
263
- * Terse View (Liquid) Minification
264
- */
265
- liquid?: LiquidTerse;
266
- /**
267
- * Terse Markup (HTML) Minification
268
- *
269
- * > Uses [html-minifier-terser](https://github.com/terser/html-minifier-terser)
270
- */
271
- markup?: HTMLMinifierTerserOptions;
272
- /**
273
- * **NOTE YET AVAILABLE**
274
- *
275
- * Terse Style (CSS) Minification
276
- *
277
- * > Uses [clean-css](https://github.com/clean-css/clean-css) minification
278
- * > Uses [purge-css](https://github.com/FullHuman/purgecss)
279
- */
280
- style?: StyleTerse;
281
- /**
282
- * Terse Script (JS/TS) Minification
283
- *
284
- * > Uses [esbuild](https://esbuild.github.io/api/#minify) minificiation
285
- */
286
- script?: ScriptTerse;
287
- }
288
-
289
- /**
290
- * **INTERNAL USE**
291
- *
292
- * Terser minification configuration
293
- */
294
- export interface TerserBundle {
295
- /**
296
- * Terse JSON Minification
297
- *
298
- * @default false
299
- */
300
- json: boolean;
301
- /**
302
- * HTML (Markup) Minification
303
- */
304
- markup: boolean;
305
- /**
306
- * Liquid Minification
307
- */
308
- liquid: boolean;
309
- /**
310
- * **NOTE YET AVAILABLE**
311
- *
312
- * Terse Style (CSS) Minification
313
- */
314
- style: boolean;
315
- /**
316
- * Terse Script (JS/TS) Minification
317
- */
318
- script: boolean;
319
- }
@@ -1,191 +0,0 @@
1
- import { LiteralUnion } from 'type-fest';
2
-
3
- export interface Icons {
4
- /**
5
- * Whether or not to support icon custom tags. When `true` you can
6
- * reference SVG icons using a HTML tag with a `name=""` property and
7
- * Syncify will replace all occurances with the embedded SVG.
8
- *
9
- * For example:
10
- *
11
- * ```html
12
- * <!-- In your HTML you can reference the SVG -->
13
- * <i name="name-of-icon" from="sprite-id"></i>
14
- *
15
- * <!-- Syncify will replace this with the raw data -->
16
- * <svg id="name-of-icon"><path>...</path></svg>
17
- * ```
18
- *
19
- * This approach will likely improve render times of your webshop.
20
- * Using Snippets to render inline SVGs is costly and a performance
21
- * bottleneck. Just because Shopify does this in Dawn, does not mean
22
- * it is a good idea.
23
- *
24
- * @default false
25
- */
26
- useCustomTag: boolean;
27
- /**
28
- * Replacer HTML tag to look for occurances within
29
- *
30
- * @default 'i' // eg: <i name="svg"></i>
31
- */
32
- tagName?: string;
33
- /**
34
- * Whether or not to treat the custom tag as a void (self-closing)
35
- *
36
- * @default false
37
- */
38
- tagVoid?: boolean
39
- /**
40
- * A vscode user specific option which will auto-generate
41
- * icon name completions for you and link them to your workspace settings.
42
- *
43
- * > Option is only available to vscode users.
44
- *
45
- * @default false
46
- */
47
- vscodeCustomData?: boolean;
48
- }
49
-
50
- /**
51
- * Snippet sub-directory grouping options
52
- */
53
- export interface Snippets {
54
- /**
55
- * Whether snippets allow sub-directory name prefixing
56
- *
57
- * @default false
58
- *
59
- * @example
60
- *
61
- * // Assuming the separator is '_'
62
- * // Take the following structure:
63
- *
64
- * snippets
65
- * │
66
- * ├─ head
67
- * │ └─ foo.liquid
68
- * └─ body
69
- * ├─ bar.liquid
70
- * └─ baz.liquid
71
- *
72
- * // The output result will be:
73
- *
74
- * theme
75
- * └─ snippets
76
- * ├─ head_foo.liquid
77
- * ├─ body_bar.liquid
78
- * └─ body_baz.liquid
79
- */
80
- prefixDir?: boolean;
81
- /**
82
- * Prefix separator character
83
- *
84
- * @default '-'
85
- *
86
- * @example
87
- *
88
- * // Filename will be prefix
89
- * 'dir/file.liquid' => 'dir-file.liquid'
90
- */
91
- separator?: LiteralUnion<
92
- | '-'
93
- | '_'
94
- | '.'
95
- | '@'
96
- | ':'
97
- ,
98
- string
99
- >;
100
- /**
101
- * A list snippet sub-directories or relative files that should
102
- * pass through or snip prefixing
103
- *
104
- * _cannot contain glob (`*`) stars_
105
- *
106
- * @default []
107
- *
108
- * @example
109
- *
110
- * // ✓ This is correct
111
- * { global: ['some-dir/filename.liquid' ] }
112
- *
113
- * // ✗ This is incorrect
114
- * { global: ['some-dir/*.liquid' ] }
115
- */
116
- global?: string[];
117
- }
118
-
119
- /**
120
- * Sections sub-directory grouping options
121
- */
122
- export interface Sections {
123
- /**
124
- * Whether sections allow directory name prefixing
125
- *
126
- * @default false
127
- *
128
- * @example
129
- *
130
- * // Assuming the separator is '_'
131
- * // Take the following structure:
132
- *
133
- * sections
134
- * │
135
- * ├─ index
136
- * │ ├─ slideshow.liquid
137
- * │ └─ banner.liquid
138
- * └─ layouts
139
- * ├─ header.liquid
140
- * └─ footer.liquid
141
- *
142
- * // The output result will be:
143
- *
144
- * theme
145
- * └─ sections
146
- * ├─ index_slideshow.liquid
147
- * ├─ index_banner.liquid
148
- * ├─ layout_header.liquid
149
- * └─ layout_footer.liquid
150
- *
151
- */
152
- prefixDir?: boolean;
153
- /**
154
- * Prefix separator character
155
- *
156
- * @default '-'
157
- *
158
- * @example
159
- *
160
- * // Filename will be prefix
161
- * 'dir/file.liquid' => 'dir-file.liquid'
162
- */
163
- separator?: LiteralUnion<
164
- | '-'
165
- | '_'
166
- | '.'
167
- | '@'
168
- | ':'
169
- ,
170
- string
171
- >;
172
- /**
173
- * A list section sub-directories or relative files that should
174
- * pass through or snip prefixing
175
- *
176
- * **NOTE:**
177
- *
178
- * **Cannot contain glob (`*`) stars**
179
- *
180
- * @default []
181
- *
182
- * @example
183
- *
184
- * // ✓ This is correct
185
- * { global: ['some-dir/filename.liquid' ] }
186
- *
187
- * // ✗ This is incorrect
188
- * { global: ['some-dir/*.liquid' ] }
189
- */
190
- global?: string[];
191
- }
package/types/index.d.ts DELETED
@@ -1,55 +0,0 @@
1
- import { Config } from './config';
2
- import { Syncify as syncify } from './api';
3
-
4
- export type { Tsconfig } from 'tsconfig-type';
5
- export type { FileKeys } from './bundle/file';
6
-
7
- export * from './api';
8
- export * from './cli';
9
- export * from './config';
10
- export * from './config/views';
11
- export * from './config/terser';
12
- export * from './bundle/cache';
13
- export * from './bundle/filters';
14
- export * from './bundle/requests';
15
- export * from './bundle/shared';
16
- export * from './bundle/errors';
17
- export * from './bundle/reports';
18
- export * from './bundle/file';
19
- export * from './bundle';
20
- export * from './bundle/plugin';
21
- export * from './bundle/hot';
22
- export * from './transforms/pages';
23
- export * from './transforms/image';
24
- export * from './transforms/json';
25
- export * from './transforms/script';
26
- export * from './transforms/style';
27
- export * from './transforms/svg';
28
-
29
- /**
30
- * **Define Config:**
31
- *
32
- * Provide to the default export in your `syncify.config.js` file.
33
- *
34
- * ---
35
- *
36
- * **Supported Files:**
37
- *
38
- * - syncify.config.ts
39
- * - syncify.config.js
40
- * - syncify.config.mjs
41
- * - syncify.config.cjs
42
- *
43
- * ---
44
- *
45
- * @example
46
- *
47
- * import { defineConfig } from '@syncify/cli';
48
- *
49
- * export default defineConfig({
50
- * //...
51
- * });
52
- *
53
- */
54
- export declare function defineConfig<T>(config: Config<T>): void;
55
- export default syncify;