@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/LICENSE +1 -1
- package/dist/api.js +36 -0
- package/dist/cli.js +630 -0
- package/dist/index.d.ts +733 -284
- package/dist/index.js +18 -0
- package/dist/syncify.js +21907 -0
- package/hot.js.liquid +14 -0
- package/package.json +75 -70
- package/readme.md +93 -51
- package/scripts/postinstall.js +116 -0
- package/scripts/postversion.js +60 -0
- package/dist/index.d.cts +0 -1815
- package/pnpm-lock.yaml +0 -17544
- package/scripts/hot.js.liquid +0 -25
package/dist/index.d.ts
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
/// <reference path="../node_modules/@types/clean-css/index.d.ts" />
|
2
|
-
/// <reference path="../node_modules/@types/svg-sprite/index.d.ts" />
|
3
2
|
/// <reference path="../node_modules/svgo/lib/svgo.d.ts" />
|
4
3
|
/// <reference path="../node_modules/postcss/lib/postcss.d.ts" />
|
5
4
|
/// <reference path="../node_modules/tailwindcss/types/index.d.ts" />
|
6
5
|
/// <reference path="../node_modules/esbuild/lib/main.d.ts" />
|
7
6
|
/// <reference path="../node_modules/type-fest/index.d.ts" />
|
8
7
|
|
9
|
-
import { LiteralUnion, Merge } from 'type-fest';
|
10
8
|
import { BuildOptions } from 'esbuild';
|
11
9
|
export { BuildOptions as ESBuildOptions } from 'esbuild';
|
12
10
|
import { OptionsOutput } from 'clean-css';
|
13
11
|
import { AcceptedPlugin, Plugin, Transformer, TransformCallback } from 'postcss';
|
14
12
|
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
13
|
import { Config as Config$2 } from 'svgo';
|
18
14
|
export { Config as SVGOConfig } from 'svgo';
|
19
15
|
import { Options } from 'markdown-it';
|
@@ -22,11 +18,11 @@ import { Options } from 'markdown-it';
|
|
22
18
|
/* BASE DIRECTORIES */
|
23
19
|
/* -------------------------------------------- */
|
24
20
|
|
25
|
-
|
21
|
+
type Directories = {
|
26
22
|
/**
|
27
23
|
* The resolved `input` directory path
|
28
24
|
*
|
29
|
-
* @default 'source'
|
25
|
+
* @default 'source/'
|
30
26
|
*/
|
31
27
|
input?: string;
|
32
28
|
/**
|
@@ -36,26 +32,382 @@ interface Directories {
|
|
36
32
|
*/
|
37
33
|
output?: string;
|
38
34
|
/**
|
39
|
-
* The resolved `
|
35
|
+
* The resolved `config` directory path for build tool files
|
40
36
|
*
|
41
|
-
* @default '
|
37
|
+
* @default '/'
|
42
38
|
*/
|
43
|
-
|
39
|
+
config?: string;
|
40
|
+
}
|
41
|
+
|
42
|
+
type Git = {
|
44
43
|
/**
|
45
|
-
*
|
44
|
+
* Specifies the default branch where your project exists. This branch will be be used to trigger
|
45
|
+
* the auto-merging behaviour when running `git pull`. Your `output` (theme) directory will not
|
46
|
+
* exist within this branch unless explicitly excluded from `.gitignore` file.
|
47
|
+
*
|
48
|
+
* > Please refer to the [Syncify Git Integration](https://syncify.sh/usage/git) for more information.
|
46
49
|
*
|
47
|
-
* @default '
|
50
|
+
* @default 'master'
|
48
51
|
*/
|
49
|
-
|
52
|
+
default?: string;
|
50
53
|
/**
|
51
|
-
*
|
54
|
+
* Specifies the production branch name, which is primary sync branch. This is the branch
|
55
|
+
* that Syncify will auto-publish the flat **output** directory too, and is not to be confused
|
56
|
+
* with the branch where your **input** (source) lives. Instead, this is the branch used by the
|
57
|
+
* [Shopify Github Integration](https://shopify.dev/docs/storefronts/themes/tools/github).
|
52
58
|
*
|
53
|
-
*
|
59
|
+
* > **PLEASE NOTE**
|
60
|
+
* >
|
61
|
+
* > Syncify assumes that the default branch of your respository is named `master` (as per the original
|
62
|
+
* > and correct naming convention for Git). The `main` branch is **NOT** considered the "main" branch
|
63
|
+
* > but instead it is used as the distributed flat-structure point of your theme as per the `role` name
|
64
|
+
* > used for live themes published in your store.
|
65
|
+
* >
|
66
|
+
* > Please refer to the [Syncify Git Integration](https://syncify.sh/usage/git) for more information.
|
67
|
+
*
|
68
|
+
* @default 'main'
|
54
69
|
*/
|
55
|
-
|
70
|
+
branch?: string;
|
71
|
+
/**
|
72
|
+
* A glob pattern of files (or directories) which apply conflict-free merging. These entires force-merge
|
73
|
+
* into **input** (source) upon `git pull` operations. You'd use the option for `.json` configuration
|
74
|
+
* specific files such as templates that auto-write settings from the editor.
|
75
|
+
*
|
76
|
+
* ```js
|
77
|
+
* {
|
78
|
+
* // all templates will overwrite source.
|
79
|
+
* force: ['templates/*.json' ]
|
80
|
+
* }
|
81
|
+
* ```
|
82
|
+
*
|
83
|
+
* @default []
|
84
|
+
*/
|
85
|
+
force?: string[];
|
86
|
+
/**
|
87
|
+
* Defines branch relationships for mirroring. Each key is a branch name, and the value is an
|
88
|
+
* array of branches that will mirror content changes published via the Shopify Github Integration.
|
89
|
+
*
|
90
|
+
* Mirrors allow developers to define dynamic branch reflections, for example:
|
91
|
+
*
|
92
|
+
* ```js
|
93
|
+
* {
|
94
|
+
* stage: ['pre'] // ensures the stage branch mirrors the pre branch.
|
95
|
+
* dev: ['main','pre'] // ensures the dev branch mirrors both main and pre branches.
|
96
|
+
* }
|
97
|
+
* ```
|
98
|
+
*
|
99
|
+
* @default {}
|
100
|
+
*/
|
101
|
+
mirror?: { [branch: string]: string[] }
|
102
|
+
}
|
103
|
+
|
104
|
+
/**
|
105
|
+
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
106
|
+
|
107
|
+
@category Type
|
108
|
+
*/
|
109
|
+
type Primitive =
|
110
|
+
| null
|
111
|
+
| undefined
|
112
|
+
| string
|
113
|
+
| number
|
114
|
+
| boolean
|
115
|
+
| symbol
|
116
|
+
| bigint;
|
117
|
+
|
118
|
+
declare global {
|
119
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
120
|
+
interface SymbolConstructor {
|
121
|
+
readonly observable: symbol;
|
122
|
+
}
|
56
123
|
}
|
57
124
|
|
58
|
-
|
125
|
+
/**
|
126
|
+
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
127
|
+
|
128
|
+
@example
|
129
|
+
```
|
130
|
+
import type {Simplify} from 'type-fest';
|
131
|
+
|
132
|
+
type PositionProps = {
|
133
|
+
top: number;
|
134
|
+
left: number;
|
135
|
+
};
|
136
|
+
|
137
|
+
type SizeProps = {
|
138
|
+
width: number;
|
139
|
+
height: number;
|
140
|
+
};
|
141
|
+
|
142
|
+
// In your editor, hovering over `Props` will show a flattened object with all the properties.
|
143
|
+
type Props = Simplify<PositionProps & SizeProps>;
|
144
|
+
```
|
145
|
+
|
146
|
+
Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
|
147
|
+
|
148
|
+
If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
|
149
|
+
|
150
|
+
@example
|
151
|
+
```
|
152
|
+
import type {Simplify} from 'type-fest';
|
153
|
+
|
154
|
+
interface SomeInterface {
|
155
|
+
foo: number;
|
156
|
+
bar?: string;
|
157
|
+
baz: number | undefined;
|
158
|
+
}
|
159
|
+
|
160
|
+
type SomeType = {
|
161
|
+
foo: number;
|
162
|
+
bar?: string;
|
163
|
+
baz: number | undefined;
|
164
|
+
};
|
165
|
+
|
166
|
+
const literal = {foo: 123, bar: 'hello', baz: 456};
|
167
|
+
const someType: SomeType = literal;
|
168
|
+
const someInterface: SomeInterface = literal;
|
169
|
+
|
170
|
+
function fn(object: Record<string, unknown>): void {}
|
171
|
+
|
172
|
+
fn(literal); // Good: literal object type is sealed
|
173
|
+
fn(someType); // Good: type is sealed
|
174
|
+
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
175
|
+
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
176
|
+
```
|
177
|
+
|
178
|
+
@link https://github.com/microsoft/TypeScript/issues/15300
|
179
|
+
@see SimplifyDeep
|
180
|
+
@category Object
|
181
|
+
*/
|
182
|
+
type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};
|
183
|
+
|
184
|
+
/**
|
185
|
+
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
186
|
+
|
187
|
+
This is the counterpart of `PickIndexSignature`.
|
188
|
+
|
189
|
+
Use-cases:
|
190
|
+
- Remove overly permissive signatures from third-party types.
|
191
|
+
|
192
|
+
This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
|
193
|
+
|
194
|
+
It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
|
195
|
+
|
196
|
+
(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
|
197
|
+
|
198
|
+
```
|
199
|
+
const indexed: Record<string, unknown> = {}; // Allowed
|
200
|
+
|
201
|
+
const keyed: Record<'foo', unknown> = {}; // Error
|
202
|
+
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
203
|
+
```
|
204
|
+
|
205
|
+
Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
|
206
|
+
|
207
|
+
```
|
208
|
+
type Indexed = {} extends Record<string, unknown>
|
209
|
+
? '✅ `{}` is assignable to `Record<string, unknown>`'
|
210
|
+
: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
|
211
|
+
// => '✅ `{}` is assignable to `Record<string, unknown>`'
|
212
|
+
|
213
|
+
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
214
|
+
? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
|
215
|
+
: "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
|
216
|
+
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
|
217
|
+
```
|
218
|
+
|
219
|
+
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
220
|
+
|
221
|
+
```
|
222
|
+
import type {OmitIndexSignature} from 'type-fest';
|
223
|
+
|
224
|
+
type OmitIndexSignature<ObjectType> = {
|
225
|
+
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
226
|
+
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
227
|
+
};
|
228
|
+
```
|
229
|
+
|
230
|
+
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
231
|
+
|
232
|
+
```
|
233
|
+
import type {OmitIndexSignature} from 'type-fest';
|
234
|
+
|
235
|
+
type OmitIndexSignature<ObjectType> = {
|
236
|
+
[KeyType in keyof ObjectType
|
237
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
238
|
+
as {} extends Record<KeyType, unknown>
|
239
|
+
? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
240
|
+
: ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
241
|
+
]: ObjectType[KeyType];
|
242
|
+
};
|
243
|
+
```
|
244
|
+
|
245
|
+
If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
|
246
|
+
|
247
|
+
@example
|
248
|
+
```
|
249
|
+
import type {OmitIndexSignature} from 'type-fest';
|
250
|
+
|
251
|
+
interface Example {
|
252
|
+
// These index signatures will be removed.
|
253
|
+
[x: string]: any
|
254
|
+
[x: number]: any
|
255
|
+
[x: symbol]: any
|
256
|
+
[x: `head-${string}`]: string
|
257
|
+
[x: `${string}-tail`]: string
|
258
|
+
[x: `head-${string}-tail`]: string
|
259
|
+
[x: `${bigint}`]: string
|
260
|
+
[x: `embedded-${number}`]: string
|
261
|
+
|
262
|
+
// These explicitly defined keys will remain.
|
263
|
+
foo: 'bar';
|
264
|
+
qux?: 'baz';
|
265
|
+
}
|
266
|
+
|
267
|
+
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
268
|
+
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
269
|
+
```
|
270
|
+
|
271
|
+
@see PickIndexSignature
|
272
|
+
@category Object
|
273
|
+
*/
|
274
|
+
type OmitIndexSignature<ObjectType> = {
|
275
|
+
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
|
276
|
+
? never
|
277
|
+
: KeyType]: ObjectType[KeyType];
|
278
|
+
};
|
279
|
+
|
280
|
+
/**
|
281
|
+
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
282
|
+
|
283
|
+
This is the counterpart of `OmitIndexSignature`.
|
284
|
+
|
285
|
+
@example
|
286
|
+
```
|
287
|
+
import type {PickIndexSignature} from 'type-fest';
|
288
|
+
|
289
|
+
declare const symbolKey: unique symbol;
|
290
|
+
|
291
|
+
type Example = {
|
292
|
+
// These index signatures will remain.
|
293
|
+
[x: string]: unknown;
|
294
|
+
[x: number]: unknown;
|
295
|
+
[x: symbol]: unknown;
|
296
|
+
[x: `head-${string}`]: string;
|
297
|
+
[x: `${string}-tail`]: string;
|
298
|
+
[x: `head-${string}-tail`]: string;
|
299
|
+
[x: `${bigint}`]: string;
|
300
|
+
[x: `embedded-${number}`]: string;
|
301
|
+
|
302
|
+
// These explicitly defined keys will be removed.
|
303
|
+
['kebab-case-key']: string;
|
304
|
+
[symbolKey]: string;
|
305
|
+
foo: 'bar';
|
306
|
+
qux?: 'baz';
|
307
|
+
};
|
308
|
+
|
309
|
+
type ExampleIndexSignature = PickIndexSignature<Example>;
|
310
|
+
// {
|
311
|
+
// [x: string]: unknown;
|
312
|
+
// [x: number]: unknown;
|
313
|
+
// [x: symbol]: unknown;
|
314
|
+
// [x: `head-${string}`]: string;
|
315
|
+
// [x: `${string}-tail`]: string;
|
316
|
+
// [x: `head-${string}-tail`]: string;
|
317
|
+
// [x: `${bigint}`]: string;
|
318
|
+
// [x: `embedded-${number}`]: string;
|
319
|
+
// }
|
320
|
+
```
|
321
|
+
|
322
|
+
@see OmitIndexSignature
|
323
|
+
@category Object
|
324
|
+
*/
|
325
|
+
type PickIndexSignature<ObjectType> = {
|
326
|
+
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
|
327
|
+
? KeyType
|
328
|
+
: never]: ObjectType[KeyType];
|
329
|
+
};
|
330
|
+
|
331
|
+
// Merges two objects without worrying about index signatures.
|
332
|
+
type SimpleMerge<Destination, Source> = {
|
333
|
+
[Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
|
334
|
+
} & Source;
|
335
|
+
|
336
|
+
/**
|
337
|
+
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
338
|
+
|
339
|
+
@example
|
340
|
+
```
|
341
|
+
import type {Merge} from 'type-fest';
|
342
|
+
|
343
|
+
interface Foo {
|
344
|
+
[x: string]: unknown;
|
345
|
+
[x: number]: unknown;
|
346
|
+
foo: string;
|
347
|
+
bar: symbol;
|
348
|
+
}
|
349
|
+
|
350
|
+
type Bar = {
|
351
|
+
[x: number]: number;
|
352
|
+
[x: symbol]: unknown;
|
353
|
+
bar: Date;
|
354
|
+
baz: boolean;
|
355
|
+
};
|
356
|
+
|
357
|
+
export type FooBar = Merge<Foo, Bar>;
|
358
|
+
// => {
|
359
|
+
// [x: string]: unknown;
|
360
|
+
// [x: number]: number;
|
361
|
+
// [x: symbol]: unknown;
|
362
|
+
// foo: string;
|
363
|
+
// bar: Date;
|
364
|
+
// baz: boolean;
|
365
|
+
// }
|
366
|
+
```
|
367
|
+
|
368
|
+
@category Object
|
369
|
+
*/
|
370
|
+
type Merge<Destination, Source> =
|
371
|
+
Simplify<
|
372
|
+
SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
|
373
|
+
& SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
|
374
|
+
>;
|
375
|
+
|
376
|
+
/**
|
377
|
+
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
378
|
+
|
379
|
+
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
|
380
|
+
|
381
|
+
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
|
382
|
+
|
383
|
+
@example
|
384
|
+
```
|
385
|
+
import type {LiteralUnion} from 'type-fest';
|
386
|
+
|
387
|
+
// Before
|
388
|
+
|
389
|
+
type Pet = 'dog' | 'cat' | string;
|
390
|
+
|
391
|
+
const pet: Pet = '';
|
392
|
+
// Start typing in your TypeScript-enabled IDE.
|
393
|
+
// You **will not** get auto-completion for `dog` and `cat` literals.
|
394
|
+
|
395
|
+
// After
|
396
|
+
|
397
|
+
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
398
|
+
|
399
|
+
const pet: Pet2 = '';
|
400
|
+
// You **will** get auto-completion for `dog` and `cat` literals.
|
401
|
+
```
|
402
|
+
|
403
|
+
@category Type
|
404
|
+
*/
|
405
|
+
type LiteralUnion<
|
406
|
+
LiteralType,
|
407
|
+
BaseType extends Primitive,
|
408
|
+
> = LiteralType | (BaseType & Record<never, never>);
|
409
|
+
|
410
|
+
type HOTShared = {
|
59
411
|
/**
|
60
412
|
* Specify the static server port. By default, Syncify uses port `41001` to
|
61
413
|
* avoid any conflicts with other running hosts of tools.
|
@@ -98,44 +450,15 @@ interface Shared {
|
|
98
450
|
*/
|
99
451
|
label?: boolean;
|
100
452
|
/**
|
101
|
-
*
|
102
|
-
*
|
103
|
-
*
|
104
|
-
* you to explicitly enable.
|
453
|
+
* Controls whether ot the HOT Snippet injection is auto-removed from layout/s.
|
454
|
+
* When set to `false`, the HOT render snippet is persisted on process exit whereas
|
455
|
+
* the default behaviour is to remove it from layouts.
|
105
456
|
*
|
106
|
-
*
|
107
|
-
*
|
108
|
-
*
|
109
|
-
* development: true,
|
110
|
-
* unpublished: true
|
111
|
-
* }
|
457
|
+
* Setting this `false` will improve start-up runtime in `--hot` mode by a few hundred ms.
|
458
|
+
*
|
459
|
+
* @default true
|
112
460
|
*/
|
113
|
-
|
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
|
-
}
|
461
|
+
eject?: boolean
|
139
462
|
/**
|
140
463
|
* Accepts a string list of flags that enable Syncify to
|
141
464
|
* wrangle CFH slop in development mode along with normalisation.
|
@@ -179,7 +502,7 @@ interface Shared {
|
|
179
502
|
];
|
180
503
|
}
|
181
504
|
|
182
|
-
|
505
|
+
type HOTExtension = HOTShared & {
|
183
506
|
/**
|
184
507
|
* > **!! NOT YET AVAILABLE !!**
|
185
508
|
* >
|
@@ -193,7 +516,7 @@ interface Extension extends Shared {
|
|
193
516
|
client?: 'extension'
|
194
517
|
}
|
195
518
|
|
196
|
-
|
519
|
+
type HOTInject = HOTShared & {
|
197
520
|
/**
|
198
521
|
* The type of client-side scripting method being used. If you are using the Syncify browser
|
199
522
|
* extension then set this value to `extension`, otherwise use `inject`.
|
@@ -225,7 +548,7 @@ interface Inject extends Shared {
|
|
225
548
|
layouts?: string[];
|
226
549
|
}
|
227
550
|
|
228
|
-
type HOT =
|
551
|
+
type HOT = HOTInject | HOTExtension
|
229
552
|
|
230
553
|
/* -------------------------------------------- */
|
231
554
|
/* LOGGER */
|
@@ -260,10 +583,51 @@ interface Logger {
|
|
260
583
|
clear?: boolean;
|
261
584
|
}
|
262
585
|
|
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
|
+
/**
|
618
|
+
* String or Array of strings
|
619
|
+
*/
|
620
|
+
type Path = string | string[];
|
621
|
+
|
622
|
+
/**
|
623
|
+
* Union join of accepted Path patterns
|
624
|
+
*/
|
625
|
+
type Pattern = Path | [ ...globs: string[], stash: Stash ];
|
626
|
+
|
263
627
|
/**
|
264
628
|
* Section and Snippet Rename Paths
|
265
629
|
*/
|
266
|
-
|
630
|
+
type Rename = {
|
267
631
|
/**
|
268
632
|
* Uses the filename as per the source, idenitical behaviour as that of `[name]`.
|
269
633
|
*
|
@@ -275,8 +639,9 @@ interface RenamePaths$1<T = string | string[]> {
|
|
275
639
|
* 'sections/bar/*' // sections in this directory will prefix bar-
|
276
640
|
* ],
|
277
641
|
* '*': [
|
278
|
-
* './sections/**'
|
279
|
-
*
|
642
|
+
* './sections/**', // all other sections will use source name
|
643
|
+
* { stash: 'files' } // stashes imports within sections/files
|
644
|
+
* ],
|
280
645
|
* },
|
281
646
|
* snippets: {
|
282
647
|
* '[dir]-[name]': [
|
@@ -284,12 +649,13 @@ interface RenamePaths$1<T = string | string[]> {
|
|
284
649
|
* 'snippets/bar/*' // snippets in this directory will prefix bar-
|
285
650
|
* ],
|
286
651
|
* '*': [
|
287
|
-
* './snippets/**' // all other snippets will use source name
|
652
|
+
* './snippets/**', // all other snippets will use source name
|
653
|
+
* { stash: true } // stashes will be written
|
288
654
|
* ]
|
289
655
|
* }
|
290
656
|
* }
|
291
657
|
*/
|
292
|
-
'*'?:
|
658
|
+
'*'?: Pattern;
|
293
659
|
/**
|
294
660
|
* Use the filename as per the source. Passing `[name]` only will result in fallback
|
295
661
|
* behaviour, as that of `'*'`.
|
@@ -321,38 +687,58 @@ interface RenamePaths$1<T = string | string[]> {
|
|
321
687
|
* }
|
322
688
|
* }
|
323
689
|
*/
|
324
|
-
'[name]'?:
|
690
|
+
'[name]'?: Pattern;
|
325
691
|
/**
|
326
692
|
* Prefix directory name and suffix filename in **kebab-case** format.
|
327
693
|
*
|
328
694
|
* @example
|
329
695
|
* 'layout/header.liquid' > 'layout-header.liquid'
|
330
696
|
*/
|
331
|
-
'[dir]-[name]'?:
|
697
|
+
'[dir]-[name]'?: Pattern;
|
332
698
|
/**
|
333
699
|
* Prefix directory name and suffix filename in **snake_case** format.
|
334
700
|
*
|
335
701
|
* @example
|
336
702
|
* 'layout/header.liquid' > 'layout_header.liquid'
|
337
703
|
*/
|
338
|
-
'[dir]_[name]'?:
|
704
|
+
'[dir]_[name]'?: Pattern;
|
339
705
|
/**
|
340
706
|
* Prefix filename and suffix directory in **kebab-case** format.
|
341
707
|
*
|
342
708
|
* @example
|
343
709
|
* 'layout/header.liquid' > 'header-layout.liquid'
|
344
710
|
*/
|
345
|
-
'[name]-[dir]'?:
|
711
|
+
'[name]-[dir]'?: Pattern;
|
346
712
|
/**
|
347
713
|
* Prefix filename and suffix directory in **snake_case** format.
|
348
714
|
*
|
349
715
|
* @example
|
350
716
|
* 'layout/header.liquid' > 'header_layout.liquid'
|
351
717
|
*/
|
352
|
-
'[name]_[dir]'?:
|
718
|
+
'[name]_[dir]'?: Pattern;
|
719
|
+
}
|
720
|
+
|
721
|
+
/**
|
722
|
+
* Snippet Renames accept `.` separated values
|
723
|
+
*/
|
724
|
+
type RenameSnippets = Rename & {
|
725
|
+
/**
|
726
|
+
* Prefix filename and suffix directory with `.` dot separator.
|
727
|
+
*
|
728
|
+
* @example
|
729
|
+
* 'layout/header.liquid' > 'header.layout.liquid'
|
730
|
+
*/
|
731
|
+
'[name].[dir]'?: Pattern;
|
732
|
+
/**
|
733
|
+
* Prefix directory and suffix filename with `.` dot separator.
|
734
|
+
*
|
735
|
+
* @example
|
736
|
+
* 'layout/header.liquid' > 'layout.header.liquid'
|
737
|
+
*/
|
738
|
+
'[dir].[name]'?: Pattern;
|
353
739
|
}
|
354
740
|
|
355
|
-
|
741
|
+
type Paths = {
|
356
742
|
/**
|
357
743
|
* A glob string, glob array or rename `output → input` key/value object of files to be uploaded as snippets.
|
358
744
|
*
|
@@ -395,7 +781,7 @@ interface Paths<T = string | string[]> {
|
|
395
781
|
* }
|
396
782
|
* }
|
397
783
|
*/
|
398
|
-
snippets?:
|
784
|
+
snippets?: Pattern | RenameSnippets
|
399
785
|
/**
|
400
786
|
* A glob string, glob array or rename `output → input` key/value object of files to be uploaded as sections.
|
401
787
|
*
|
@@ -439,86 +825,129 @@ interface Paths<T = string | string[]> {
|
|
439
825
|
* ]
|
440
826
|
* }
|
441
827
|
* }
|
828
|
+
*
|
829
|
+
* //OPTION 5 - Define a custom stash
|
830
|
+
* {
|
831
|
+
* sections: [
|
832
|
+
* 'source/sections/*.liquid',
|
833
|
+
* 'source/sections/xxx/*',
|
834
|
+
* { stash: '*' } // pull stashes will write to source/sections/*
|
835
|
+
* ]
|
836
|
+
* }
|
837
|
+
*/
|
838
|
+
sections?: Pattern | Rename;
|
839
|
+
/**
|
840
|
+
* A glob string or glob array of files to be uploaded as blocks
|
841
|
+
*
|
842
|
+
* @default 'source/blocks/*.{liquid}'
|
442
843
|
*/
|
443
|
-
|
844
|
+
blocks?: Pattern;
|
444
845
|
/**
|
445
846
|
* A glob string or glob array of files to be uploaded as templates.
|
446
847
|
*
|
447
848
|
* @default 'source/templates/*.{liquid,json}'
|
448
849
|
*/
|
449
|
-
templates?:
|
850
|
+
templates?: Pattern;
|
450
851
|
/**
|
451
852
|
* A glob string or glob array of files to be uploaded asas metaobject templates
|
452
853
|
*
|
453
854
|
* @default 'source/templates/metaobject/*.{liquid,json}'
|
454
855
|
*/
|
455
|
-
metaobject?:
|
856
|
+
metaobject?: Pattern;
|
456
857
|
/**
|
457
858
|
* A glob string or glob array of files to be uploaded as template/customers
|
458
859
|
*
|
459
860
|
* @default 'source/templates/customers/*.{liquid,json}'
|
460
861
|
*/
|
461
|
-
customers?:
|
862
|
+
customers?: Pattern;
|
462
863
|
/**
|
463
864
|
* A glob string or glob array of files to be uploaded as assets
|
464
865
|
*
|
465
866
|
* @default 'source/assets/*'
|
466
867
|
*/
|
467
|
-
assets?:
|
868
|
+
assets?: Pattern;
|
468
869
|
/**
|
469
870
|
* A glob string or glob array of files to be uploaded as layouts
|
470
871
|
*
|
471
872
|
* @default 'source/layout/*.liquid'
|
472
873
|
*/
|
473
|
-
layout?:
|
874
|
+
layout?: Pattern;
|
474
875
|
/**
|
475
876
|
* A glob string or glob array of files to be uploaded as configs, i.e, `settings_schema.json`
|
476
877
|
*
|
477
878
|
* @default 'source/config/.json'
|
478
879
|
*/
|
479
|
-
config?:
|
880
|
+
config?: Pattern;
|
480
881
|
/**
|
481
882
|
* A glob string or glob array of files to be uploaded as config, i.e, `en.default.json`
|
482
883
|
*
|
483
884
|
* @default 'source/locales/*.json'
|
484
885
|
*/
|
485
|
-
locales?:
|
886
|
+
locales?: Pattern;
|
486
887
|
/**
|
487
888
|
* A glob string or glob array of files to be uploaded as **shared schema** `.json` or `.schema` files.
|
488
889
|
*
|
489
|
-
* @default 'source
|
890
|
+
* @default 'source/+/schema/*.{json,schema}'
|
490
891
|
*/
|
491
|
-
schema?:
|
892
|
+
schema?: Path;
|
492
893
|
/**
|
493
894
|
* **NOT YET AVAILABLE**
|
494
895
|
*
|
495
|
-
*
|
896
|
+
* **This option will be available in later versions**
|
496
897
|
*
|
497
898
|
* ---
|
498
899
|
*
|
499
900
|
* The resolved `metafields` directory path
|
500
901
|
*
|
501
|
-
* @default 'source
|
902
|
+
* @default 'source/+/metafields/**'
|
502
903
|
*/
|
503
|
-
metafields?:
|
904
|
+
metafields?: Path;
|
504
905
|
/**
|
906
|
+
* **NOT YET AVAILABLE**
|
907
|
+
*
|
908
|
+
* **This option will be available in later versions**
|
909
|
+
*
|
505
910
|
* A glob string or glob array string to be uploaded, published and controlled as `pages`
|
506
911
|
*
|
507
|
-
* @default 'source
|
912
|
+
* @default 'source/+/pages/*.{md,html}'
|
508
913
|
*/
|
509
|
-
pages?:
|
914
|
+
pages?: Path;
|
510
915
|
/**
|
511
916
|
* **NOT YET AVAILABLE**
|
512
917
|
*
|
513
|
-
*
|
918
|
+
* **This option will be available in later versions**
|
514
919
|
*
|
515
|
-
*
|
920
|
+
* @default 'source/+/blogs/*'
|
921
|
+
*/
|
922
|
+
blogs?: Path;
|
923
|
+
/**
|
924
|
+
* **NOT YET AVAILABLE**
|
925
|
+
*
|
926
|
+
* **This option will be available in later versions**
|
927
|
+
*
|
928
|
+
* @default 'source/+/menus/*.json'
|
929
|
+
*/
|
930
|
+
navigation?: Path;
|
931
|
+
/**
|
932
|
+
* **NOT YET AVAILABLE**
|
933
|
+
*
|
934
|
+
* **This option will be available in later versions**
|
935
|
+
*
|
936
|
+
* @default 'source/+/policies/*.{html,md}'
|
937
|
+
*/
|
938
|
+
policies?: Path;
|
939
|
+
/**
|
940
|
+
* **NOT YET AVAILABLE**
|
941
|
+
*
|
942
|
+
* **This option will be available in later versions**
|
516
943
|
*
|
517
|
-
* @default '
|
944
|
+
* @default 'source/+/files/**'
|
518
945
|
*/
|
519
|
-
|
946
|
+
files?: Path;
|
520
947
|
}
|
521
948
|
|
949
|
+
type ScriptRename = `${'assets' | 'snippets'}/${string}`
|
950
|
+
|
522
951
|
type TargetBrowser = (
|
523
952
|
| 'chrome'
|
524
953
|
| 'deno'
|
@@ -603,7 +1032,7 @@ type ESBuildAllowedOptions = Pick<BuildOptions, (
|
|
603
1032
|
)>
|
604
1033
|
|
605
1034
|
|
606
|
-
type
|
1035
|
+
type ESBuildTarget = (
|
607
1036
|
| TargetBrowser
|
608
1037
|
| TargetBrowserVersion
|
609
1038
|
| TargetESVersion
|
@@ -636,7 +1065,7 @@ type ESBuildConfig = Merge<ESBuildAllowedOptions, {
|
|
636
1065
|
/* TRANSFORM */
|
637
1066
|
/* -------------------------------------------- */
|
638
1067
|
|
639
|
-
|
1068
|
+
type ScriptSharedConfig = {
|
640
1069
|
/**
|
641
1070
|
* JS/TS input source paths. Accepts `string` or `string[]` glob patterns.
|
642
1071
|
* Resolution is relative to your defined `input` directory.
|
@@ -656,7 +1085,7 @@ interface ScriptSharedConfig {
|
|
656
1085
|
*
|
657
1086
|
* @default 'es2016'
|
658
1087
|
*/
|
659
|
-
target?:
|
1088
|
+
target?: ESBuildTarget | ESBuildTarget[];
|
660
1089
|
/**
|
661
1090
|
* Instructs ESBuild to treat these modules as external. The import/s
|
662
1091
|
* will be preserved and evaluated at run time instead.
|
@@ -672,7 +1101,7 @@ interface ScriptSharedConfig {
|
|
672
1101
|
external?: string[];
|
673
1102
|
/**
|
674
1103
|
* Rename the JavaScript file/s. The same name as source file will be used
|
675
|
-
* when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
|
1104
|
+
* when undefined. Accepts namespaces, `[file]` or `[name]`, `[dir]` and/or `[ext]`.
|
676
1105
|
*
|
677
1106
|
* ---
|
678
1107
|
*
|
@@ -744,7 +1173,7 @@ interface ScriptSharedConfig {
|
|
744
1173
|
esbuild?: boolean | ESBuildConfig;
|
745
1174
|
}
|
746
1175
|
|
747
|
-
|
1176
|
+
type ScriptFormatESM = ScriptSharedConfig & {
|
748
1177
|
|
749
1178
|
/**
|
750
1179
|
* The format to be generated. Because we are targeting
|
@@ -756,7 +1185,7 @@ interface ScriptFormatESM extends ScriptSharedConfig {
|
|
756
1185
|
format?: 'esm';
|
757
1186
|
}
|
758
1187
|
|
759
|
-
|
1188
|
+
type ScriptFormatIIFE = ScriptSharedConfig & {
|
760
1189
|
/**
|
761
1190
|
* The format to be generated. Because we are targeting
|
762
1191
|
* browser environments, Syncify does not allow for CJS (commonjs)
|
@@ -787,13 +1216,11 @@ type ScriptTransformer = (
|
|
787
1216
|
| string[]
|
788
1217
|
| ScriptTransform
|
789
1218
|
| ScriptTransform[]
|
790
|
-
|
|
1219
|
+
| Record<ScriptRename, string>
|
1220
|
+
| Record<ScriptRename, string[]>
|
1221
|
+
| Record<ScriptRename, Omit<ScriptTransform, 'rename'>>
|
791
1222
|
)
|
792
1223
|
|
793
|
-
/* eslint-disable no-unused-vars */
|
794
|
-
|
795
|
-
|
796
|
-
|
797
1224
|
/* -------------------------------------------- */
|
798
1225
|
/* PROCESSOR CONFIGS */
|
799
1226
|
/* -------------------------------------------- */
|
@@ -811,7 +1238,7 @@ type PostCSSConfig = (
|
|
811
1238
|
/**
|
812
1239
|
* Style Minification
|
813
1240
|
*/
|
814
|
-
|
1241
|
+
type StyleTerse = OptionsOutput & {
|
815
1242
|
/**
|
816
1243
|
* Whether or not to purge unused CSS class names
|
817
1244
|
*
|
@@ -847,11 +1274,11 @@ interface StyleTerse extends OptionsOutput {
|
|
847
1274
|
exclude?: string[]
|
848
1275
|
}
|
849
1276
|
|
850
|
-
|
1277
|
+
type TailwindConfig = Config$1 & {
|
851
1278
|
config: string[]
|
852
1279
|
}
|
853
1280
|
|
854
|
-
|
1281
|
+
type SASSConfig = {
|
855
1282
|
/**
|
856
1283
|
* Whether or not to generate sourcemaps
|
857
1284
|
*
|
@@ -896,7 +1323,7 @@ interface SASSConfig {
|
|
896
1323
|
/* TRANSFORM */
|
897
1324
|
/* -------------------------------------------- */
|
898
1325
|
|
899
|
-
|
1326
|
+
type StyleTransform<T = string | string[]> = {
|
900
1327
|
/**
|
901
1328
|
* SVG input source paths. Accepts `string` or `string[]` glob patterns.
|
902
1329
|
* Resolution is relative to your defined `input` directory.
|
@@ -1019,7 +1446,7 @@ interface StyleTransform<T = string | string[]> {
|
|
1019
1446
|
* > Uses [clean-css](https://github.com/clean-css/clean-css) minification
|
1020
1447
|
* > Uses [purge-css](https://github.com/FullHuman/purgecss)
|
1021
1448
|
*/
|
1022
|
-
|
1449
|
+
terse?: boolean | SASSConfig;
|
1023
1450
|
}
|
1024
1451
|
|
1025
1452
|
/* -------------------------------------------- */
|
@@ -1031,33 +1458,18 @@ type StyleTransformer = (
|
|
1031
1458
|
| string[]
|
1032
1459
|
| StyleTransform
|
1033
1460
|
| StyleTransform[]
|
1034
|
-
|
|
1035
|
-
|
1036
|
-
|
1037
|
-
| string[]
|
1038
|
-
| Pick<StyleTransform,
|
1039
|
-
| 'postcss'
|
1040
|
-
| 'sass'
|
1041
|
-
| 'tailwind'
|
1042
|
-
| 'snippet'
|
1043
|
-
| 'watch'
|
1044
|
-
| 'input'
|
1045
|
-
>
|
1046
|
-
)
|
1047
|
-
}
|
1461
|
+
| Record<StyleRename, string>
|
1462
|
+
| Record<StyleRename, string[]>
|
1463
|
+
| Record<StyleRename, Pick<StyleTransform, 'postcss' | 'sass' | 'tailwind' | 'snippet' | 'watch' | 'input'>>
|
1048
1464
|
)
|
1049
1465
|
|
1050
|
-
/* eslint-disable no-unused-vars */
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
1466
|
/* -------------------------------------------- */
|
1055
1467
|
/* SHARED */
|
1056
1468
|
/* -------------------------------------------- */
|
1057
1469
|
|
1058
1470
|
type RenamePaths = `${'assets' | 'snippets'}/${string}`
|
1059
1471
|
|
1060
|
-
|
1472
|
+
type SVGFile = {
|
1061
1473
|
/**
|
1062
1474
|
* SVG input source paths. Accepts `string` or `string[]` glob patterns.
|
1063
1475
|
* Resolution is relative to your defined `input` directory.
|
@@ -1065,6 +1477,24 @@ interface SVGShared<T extends 'file' | 'sprite'> {
|
|
1065
1477
|
* @default ''
|
1066
1478
|
*/
|
1067
1479
|
input: string | string[];
|
1480
|
+
/**
|
1481
|
+
* The SVG export format. Syncify can produce 2 different SVG formats.
|
1482
|
+
* All SVG file types will pre-process and transform using [SVGO](https://github.com/svg/svgo).
|
1483
|
+
* This option cannot be undefined and is required.
|
1484
|
+
*
|
1485
|
+
* ---
|
1486
|
+
*
|
1487
|
+
* > `file`
|
1488
|
+
* >
|
1489
|
+
* > SVG transforms using a `file` format will produce individual `.svg` files from
|
1490
|
+
* that can be output as an`asset` or inlined into a `snippet`
|
1491
|
+
*
|
1492
|
+
* > `sprite`
|
1493
|
+
* >
|
1494
|
+
* > SVG transforms using a `sprite` format will produce an SVG Sprite that can be
|
1495
|
+
* output as an `asset` or inlined into a `snippet`
|
1496
|
+
*/
|
1497
|
+
format: 'file';
|
1068
1498
|
/**
|
1069
1499
|
* Rename the svg file/s. The same name as source file will be used
|
1070
1500
|
* when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
|
@@ -1084,44 +1514,6 @@ interface SVGShared<T extends 'file' | 'sprite'> {
|
|
1084
1514
|
* @default false
|
1085
1515
|
*/
|
1086
1516
|
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
1517
|
/**
|
1126
1518
|
* [SVGO](https://github.com/svg/svgo) Override
|
1127
1519
|
*
|
@@ -1133,35 +1525,125 @@ interface SVGFile extends SVGShared<'file'> {
|
|
1133
1525
|
* @default
|
1134
1526
|
* processor.svgo // When processor configuration is defined
|
1135
1527
|
*/
|
1136
|
-
svgo?: Config$2
|
1528
|
+
svgo?: Config$2;
|
1137
1529
|
}
|
1138
1530
|
|
1139
|
-
|
1531
|
+
type SVGSprite = Omit<SVGFile, 'format'> & {
|
1140
1532
|
/**
|
1141
|
-
*
|
1533
|
+
* The SVG export format. Syncify can produce 2 different SVG formats.
|
1534
|
+
* All SVG file types will pre-process and transform using [SVGO](https://github.com/svg/svgo).
|
1535
|
+
* This option cannot be undefined and is required.
|
1142
1536
|
*
|
1143
|
-
*
|
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`.
|
1537
|
+
* ---
|
1147
1538
|
*
|
1148
|
-
*
|
1149
|
-
*
|
1539
|
+
* > `file`
|
1540
|
+
* >
|
1541
|
+
* > SVG transforms using a `file` format will produce individual `.svg` files from
|
1542
|
+
* that can be output as an`asset` or inlined into a `snippet`
|
1543
|
+
*
|
1544
|
+
* > `sprite`
|
1545
|
+
* >
|
1546
|
+
* > SVG transforms using a `sprite` format will produce an SVG Sprite that can be
|
1547
|
+
* output as an `asset` or inlined into a `snippet`
|
1150
1548
|
*/
|
1151
|
-
sprite
|
1549
|
+
format: 'sprite';
|
1550
|
+
/**
|
1551
|
+
* Add a DOCTYPE declaration to SVG documents
|
1552
|
+
*
|
1553
|
+
* @type {boolean}
|
1554
|
+
*/
|
1555
|
+
sprite?: {
|
1556
|
+
/**
|
1557
|
+
* Apply a custome set of sprite attributes on the
|
1558
|
+
* parent `<svg>` element containing the `<symbol>` reference.
|
1559
|
+
*
|
1560
|
+
* **Example Definition**
|
1561
|
+
*
|
1562
|
+
* ```js
|
1563
|
+
* // Attribute definitions
|
1564
|
+
* {
|
1565
|
+
* attrs: [
|
1566
|
+
* ['id', 'foo']
|
1567
|
+
* ['data-attr', 'bar'],
|
1568
|
+
* ['{{ object.prop }}'],
|
1569
|
+
* ['{% if xxx %}', 'data-xxx', '{% endif %}']
|
1570
|
+
* ]
|
1571
|
+
* }
|
1572
|
+
* ```
|
1573
|
+
*
|
1574
|
+
* **Example Output**
|
1575
|
+
*
|
1576
|
+
* ```liquid
|
1577
|
+
* <svg
|
1578
|
+
* id="foo"
|
1579
|
+
* data-attr="bar"
|
1580
|
+
* {{ object.prop }}
|
1581
|
+
* {% if xxx %}data-xxx{% endif %}>
|
1582
|
+
* <symbol id="a">....</symbol>
|
1583
|
+
* <symbol id="b">....</symbol>
|
1584
|
+
* <symbol id="c">....</symbol>
|
1585
|
+
* </svg>
|
1586
|
+
* ```
|
1587
|
+
*
|
1588
|
+
* // Output
|
1589
|
+
* @default []
|
1590
|
+
*/
|
1591
|
+
attrs?: Array<string[]>;
|
1592
|
+
/**
|
1593
|
+
* Additional optional to be applied on containing `<symbol>`
|
1594
|
+
* elements in the sprite.
|
1595
|
+
*/
|
1596
|
+
symbols?: {
|
1597
|
+
/**
|
1598
|
+
* The identifier applied to `<symbol>` elements. This
|
1599
|
+
* value will be the `<use>` referenced via `xlink:href`.
|
1600
|
+
* By default, Syncify prefixes `svg-` followed by SVG filename.
|
1601
|
+
*
|
1602
|
+
* > `[id]`
|
1603
|
+
* >
|
1604
|
+
* > Passing a value of `[id]` will instruct syncify to use the `id=""` value
|
1605
|
+
* > already applied and when missing fallback to the default `svg-`
|
1606
|
+
*
|
1607
|
+
*
|
1608
|
+
* **Example**
|
1609
|
+
*
|
1610
|
+
* ```liquid
|
1611
|
+
* <!-- REFERENCING -->
|
1612
|
+
* <svg><use xlink:href="#svg-a"></use></svg>
|
1613
|
+
* <svg><use xlink:href="#svg-b"></use></svg>
|
1614
|
+
* <svg><use xlink:href="#svg-c"></use></svg>
|
1615
|
+
*
|
1616
|
+
* <!-- EXAMPLE SPRITE -->
|
1617
|
+
* <svg>
|
1618
|
+
* <symbol id="a">...</symbol>
|
1619
|
+
* <symbol id="b">...</symbol>
|
1620
|
+
* <symbol id="c">...</symbol>
|
1621
|
+
* </svg>
|
1622
|
+
* ```
|
1623
|
+
*/
|
1624
|
+
id?: LiteralUnion<`${string}-[name]` | `[name]-${string}` | '[id]', string>;
|
1625
|
+
/**
|
1626
|
+
* Whether or not containing `<symbol>` elements should be annotated
|
1627
|
+
* with `xmlns` attributes. Defaults to `false`.
|
1628
|
+
*
|
1629
|
+
* **Example Output**
|
1630
|
+
*
|
1631
|
+
* ```liquid
|
1632
|
+
* <svg>
|
1633
|
+
* <symbol id="a" xmlns="http://www.w3.org/2000/svg">...</symbol>
|
1634
|
+
* <symbol id="b" xmlns="http://www.w3.org/2000/svg">...</symbol>
|
1635
|
+
* <symbol id="c" xmlns="http://www.w3.org/2000/svg">...</symbol>
|
1636
|
+
* </svg>
|
1637
|
+
* ```
|
1638
|
+
*
|
1639
|
+
* @default false
|
1640
|
+
*/
|
1641
|
+
xmlns?: boolean;
|
1642
|
+
}
|
1643
|
+
}
|
1152
1644
|
}
|
1153
1645
|
|
1154
|
-
|
1155
|
-
/* TRANSFORM */
|
1156
|
-
/* -------------------------------------------- */
|
1157
|
-
|
1158
|
-
/**
|
1159
|
-
* SVG processing transforms
|
1160
|
-
*/
|
1161
|
-
type SVGTransform = (
|
1162
|
-
| SVGFile
|
1163
|
-
| SVGSprite
|
1164
|
-
)
|
1646
|
+
type SVGTransform = SVGFile | SVGSprite
|
1165
1647
|
|
1166
1648
|
/* -------------------------------------------- */
|
1167
1649
|
/* TRANSFORMER */
|
@@ -1172,14 +1654,9 @@ type SVGTransformer = (
|
|
1172
1654
|
| string[]
|
1173
1655
|
| SVGTransform
|
1174
1656
|
| SVGTransform[]
|
1175
|
-
|
|
1176
|
-
|
1177
|
-
|
1178
|
-
| string[]
|
1179
|
-
| Pick<SVGFile, 'format' | 'input' | 'snippet' | 'svgo'>
|
1180
|
-
| Pick<SVGSprite, 'format'| 'input'| 'snippet' | 'sprite'>
|
1181
|
-
)
|
1182
|
-
}
|
1657
|
+
| Record<RenamePaths, string>
|
1658
|
+
| Record<RenamePaths, string[]>
|
1659
|
+
| Record<RenamePaths, SVGTransform>
|
1183
1660
|
)
|
1184
1661
|
|
1185
1662
|
/**
|
@@ -1187,7 +1664,7 @@ type SVGTransformer = (
|
|
1187
1664
|
*
|
1188
1665
|
* Holds reference to default config options for each supported processor.
|
1189
1666
|
*/
|
1190
|
-
|
1667
|
+
type Processors = {
|
1191
1668
|
/**
|
1192
1669
|
* [ESBuild](https://esbuild.github.io/) Config
|
1193
1670
|
*/
|
@@ -1208,60 +1685,23 @@ interface Processors {
|
|
1208
1685
|
* [SVGO](https://github.com/svg/svgo) Config
|
1209
1686
|
*/
|
1210
1687
|
svgo?: Config$2;
|
1211
|
-
/**
|
1212
|
-
* [SVG Sprite](https://github.com/svg-sprite) Config
|
1213
|
-
*/
|
1214
|
-
sprite?: Config$3;
|
1215
1688
|
/**
|
1216
1689
|
* [Markdown](https://github.com/markdown-it/markdown-it) Config
|
1217
1690
|
*/
|
1218
1691
|
markdown?: Options;
|
1219
|
-
/**
|
1220
|
-
* [Turndown](https://github.com/mixmark-io/turndown) Config
|
1221
|
-
*/
|
1222
|
-
turndown?: Config$3;
|
1223
1692
|
}
|
1224
1693
|
|
1225
1694
|
interface Publishing {
|
1226
1695
|
/**
|
1227
|
-
*
|
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
|
1696
|
+
* Git publish
|
1257
1697
|
*/
|
1258
|
-
|
1698
|
+
git: Git;
|
1259
1699
|
}
|
1260
1700
|
|
1261
1701
|
/**
|
1262
1702
|
* JSON File Minification
|
1263
1703
|
*/
|
1264
|
-
|
1704
|
+
type JSONTerse = {
|
1265
1705
|
/**
|
1266
1706
|
* Minify `.json` files writing to `theme/assets`
|
1267
1707
|
*
|
@@ -1312,7 +1752,7 @@ interface JSONTerse {
|
|
1312
1752
|
exclude?: string[]
|
1313
1753
|
}
|
1314
1754
|
|
1315
|
-
|
1755
|
+
type JSONTransform = {
|
1316
1756
|
/**
|
1317
1757
|
* If line termination should be Windows (CRLF) format.
|
1318
1758
|
* Unix (LF) format is the default.
|
@@ -1344,17 +1784,40 @@ interface JSONTransform {
|
|
1344
1784
|
* Whether or not Syncify should apply alpha-numeric sorting to object properties
|
1345
1785
|
* or not. This will apply deep sorting, so all objects within a structure will adhere.
|
1346
1786
|
*
|
1787
|
+
* Apply object sorting on a specific list of entries in the JSON structure. Target deeply nested
|
1788
|
+
* property objects and their values using dot `.` separated expressions by passing sting list.
|
1789
|
+
*
|
1790
|
+
* ```js
|
1791
|
+
* { sortObjects: ['a.b'] } // sort only these objects
|
1792
|
+
*
|
1793
|
+
* // BEFORE
|
1794
|
+
* { a: { b: { z: '2', x: '1' } }, c: { b: '2', a: '1' } }
|
1795
|
+
*
|
1796
|
+
* // AFTER
|
1797
|
+
* { a: { b: { x: '1', z: '2', } }, c: { b: '2', a: '1' } }
|
1798
|
+
* ```
|
1799
|
+
*
|
1800
|
+
* @default false
|
1801
|
+
*/
|
1802
|
+
sortObjects?: boolean | string[];
|
1803
|
+
/**
|
1804
|
+
* Whether or not Syncify should apply alpha-numeric sorting to arrays in JSON.
|
1805
|
+
* You should avoid setting this to `true` and use with caution.
|
1806
|
+
*
|
1807
|
+
* Apply array sorting on a specific list of entries in the JSON structure. Target deeply nested
|
1808
|
+
* properties and their values using dot `.` separated expressions by passing sting list.
|
1809
|
+
*
|
1347
1810
|
* @default false
|
1348
1811
|
*/
|
1349
|
-
|
1812
|
+
sortArrays?: boolean | string[];
|
1350
1813
|
/**
|
1351
1814
|
* 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
|
1353
|
-
* have no effect if `sortObjects` is not enabled.
|
1815
|
+
* from sorting. This option only applies when `sortObjects` and/or `sortArrays` is set to
|
1816
|
+
* `true` and will have no effect if `sortObjects` and/or `sortArrays` is not enabled.
|
1354
1817
|
*
|
1355
1818
|
* @default []
|
1356
1819
|
*/
|
1357
|
-
|
1820
|
+
noSortList?: string[];
|
1358
1821
|
/**
|
1359
1822
|
* An optional string list of paths/filenames to exclude
|
1360
1823
|
* from processing, ie: pass through
|
@@ -1375,11 +1838,11 @@ interface JSONTransform {
|
|
1375
1838
|
terse?: boolean | JSONTerse;
|
1376
1839
|
}
|
1377
1840
|
|
1378
|
-
|
1841
|
+
type LiquidTerse = {
|
1379
1842
|
/**
|
1380
1843
|
* Removes redundant whitespace Liquid dash trims from Liquid tags and objects.
|
1381
1844
|
*
|
1382
|
-
* @default
|
1845
|
+
* @default false
|
1383
1846
|
*/
|
1384
1847
|
stripTrims?: boolean;
|
1385
1848
|
/**
|
@@ -1423,7 +1886,7 @@ interface LiquidTerse {
|
|
1423
1886
|
/**
|
1424
1887
|
* Liquid Minification
|
1425
1888
|
*/
|
1426
|
-
|
1889
|
+
type LiquidTransform = {
|
1427
1890
|
/**
|
1428
1891
|
* Liquid and HTML minification options. By default, the option is set to `false`
|
1429
1892
|
* which disables minification being applied to `.liquid` file types. Setting
|
@@ -1441,7 +1904,7 @@ interface LiquidTransform {
|
|
1441
1904
|
/* TRANSFORMS */
|
1442
1905
|
/* -------------------------------------------- */
|
1443
1906
|
|
1444
|
-
|
1907
|
+
type Transforms = {
|
1445
1908
|
/**
|
1446
1909
|
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/style/)
|
1447
1910
|
*
|
@@ -1619,10 +2082,21 @@ interface Transforms {
|
|
1619
2082
|
* > If this option is set to `false` then no minification will be applied to `.liquid` files.
|
1620
2083
|
*/
|
1621
2084
|
liquid?: LiquidTransform;
|
2085
|
+
/**
|
2086
|
+
* ###### [DOCUMENTATION](https://syncify.sh/options/transform/svg/)
|
2087
|
+
*
|
2088
|
+
* **Markdown File Transforms**
|
2089
|
+
*
|
2090
|
+
* Supported markdown transforms accepted for resource specific operations.
|
2091
|
+
*/
|
2092
|
+
markdown?: SVGTransformer;
|
1622
2093
|
|
1623
2094
|
}
|
1624
2095
|
|
1625
|
-
|
2096
|
+
/**
|
2097
|
+
* Version Control
|
2098
|
+
*/
|
2099
|
+
type VC = {
|
1626
2100
|
/**
|
1627
2101
|
* Sets the maximum patch number before incrementing the minor version. Passing a value of `0` will
|
1628
2102
|
* result in **minor** version increments only.
|
@@ -1677,6 +2151,7 @@ interface Config extends Directories {
|
|
1677
2151
|
editor?: LiteralUnion<
|
1678
2152
|
| 'vscode'
|
1679
2153
|
| 'sublime'
|
2154
|
+
| 'cursor'
|
1680
2155
|
| 'atom'
|
1681
2156
|
| 'webstorm'
|
1682
2157
|
| 'intellij'
|
@@ -1694,8 +2169,10 @@ interface Config extends Directories {
|
|
1694
2169
|
paths?: Paths;
|
1695
2170
|
/**
|
1696
2171
|
* **NOT YET AVAILABLE**
|
2172
|
+
*
|
2173
|
+
* > Syncify plugins are planned in future releases!
|
1697
2174
|
*/
|
1698
|
-
plugins?:
|
2175
|
+
plugins?: never;
|
1699
2176
|
/**
|
1700
2177
|
* **Clean**
|
1701
2178
|
*
|
@@ -1724,41 +2201,23 @@ interface Config extends Directories {
|
|
1724
2201
|
*/
|
1725
2202
|
publish?: Publishing;
|
1726
2203
|
/**
|
1727
|
-
* **
|
2204
|
+
* **Git**
|
1728
2205
|
*
|
1729
|
-
*
|
2206
|
+
* Git automation and workflow configuration for controlling the integration pipline. Settings
|
2207
|
+
* defined here will be used to provide a streamlines tactic for theme publishing, version
|
2208
|
+
* control and source control.
|
1730
2209
|
*/
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
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
|
-
};
|
2210
|
+
git?: false | Git
|
2211
|
+
/**
|
2212
|
+
* **Version Control**
|
2213
|
+
*
|
2214
|
+
* Syncify introduces a strategic version control system based on the Modular Arithmetic Model (**MaM**),
|
2215
|
+
* a unique approach inspired by, but distinct from, [SemVer](https://semver.org/). The MaM tactic in
|
2216
|
+
* its appropriation by Syncify to Theme development is designed around the idea that progression should
|
2217
|
+
* be predictive and controlled. The [Version Control](https://syncify.sh/usage/version-control/) documentation
|
2218
|
+
* guide provides a strong overview for how Syncify applies versioning to themes.
|
2219
|
+
*/
|
2220
|
+
vc?: false | VC
|
1762
2221
|
/**
|
1763
2222
|
* **Transform**
|
1764
2223
|
*
|
@@ -1773,16 +2232,6 @@ interface Config extends Directories {
|
|
1773
2232
|
* which syncify has pre-configured for optimal output.
|
1774
2233
|
*/
|
1775
2234
|
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
2235
|
}
|
1787
2236
|
|
1788
2237
|
/**
|
@@ -1812,4 +2261,4 @@ declare const env: {
|
|
1812
2261
|
*/
|
1813
2262
|
declare const defineConfig: (config: Config) => Config;
|
1814
2263
|
|
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
|
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 Pattern, type PostCSSConfig, type Processors, type Publishing, type Rename, type SASSConfig, type SVGFile, type SVGSprite, type SVGTransform, type SVGTransformer, type ScriptTransform, type ScriptTransformer, type Stash, type StyleTerse, type StyleTransform, type StyleTransformer, type TailwindConfig, type Transforms, type VC, defineConfig, env };
|