@syncify/cli 0.1.3-beta → 0.2.0-beta
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/cjs.js +176 -147
- package/dist/cli.js +7 -2
- package/package.json +60 -35
- package/pnpm-lock.yaml +1493 -1461
- package/readme.md +464 -182
- package/types/api.d.ts +2 -2
- package/types/cli.d.ts +46 -42
- package/types/config/index.d.ts +18 -12
- package/types/config/terser.d.ts +267 -0
- package/types/config/views.d.ts +13 -5
- package/types/index.d.ts +13 -9
- package/types/{misc → internal}/commands.d.ts +16 -28
- package/types/{bundle → internal}/file.d.ts +87 -30
- package/types/internal/filters.d.ts +81 -0
- package/types/{bundle → internal}/hot.d.ts +14 -4
- package/types/internal/index.d.ts +509 -0
- package/types/{bundle → internal}/plugin.d.ts +7 -5
- package/types/internal/processors.d.ts +54 -0
- package/types/{misc/modes.d.ts → internal/reports.d.ts} +57 -6
- package/types/{misc → internal}/requests.d.ts +5 -4
- package/types/{misc → internal}/shared.d.ts +6 -10
- package/types/modules/html-minifier-terser.d.ts +211 -0
- package/types/transforms/image.d.ts +1 -1
- package/types/transforms/script.d.ts +191 -57
- package/types/transforms/style.d.ts +51 -10
- package/types/transforms/svg.d.ts +1 -1
- package/types/bundle/index.d.ts +0 -479
- package/types/config/minify.d.ts +0 -115
- /package/types/{bundle → internal}/cache.d.ts +0 -0
- /package/types/{misc → internal}/errors.d.ts +0 -0
- /package/types/{misc → internal}/markdown.d.ts +0 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
/* -------------------------------------------- */
|
3
2
|
/* CLI OPTIONS */
|
4
3
|
/* -------------------------------------------- */
|
@@ -84,10 +83,10 @@ export interface Commands {
|
|
84
83
|
* Example:
|
85
84
|
*
|
86
85
|
* ```bash
|
87
|
-
* $ syncify --
|
86
|
+
* $ syncify --interactive
|
88
87
|
* ```
|
89
88
|
*/
|
90
|
-
|
89
|
+
interactive?: boolean;
|
91
90
|
/**
|
92
91
|
* Run in watch mode (chokidar). This requires a store target be passed.
|
93
92
|
*
|
@@ -204,20 +203,19 @@ export interface Commands {
|
|
204
203
|
*/
|
205
204
|
pull?: boolean;
|
206
205
|
/**
|
207
|
-
*
|
208
|
-
*
|
209
|
-
* together with the `-f` filter flag.
|
206
|
+
* Force uploads a resource from local to remote shop. This will instruct
|
207
|
+
* syncify to overwrite any remote versions.
|
210
208
|
*
|
211
209
|
* ---
|
212
210
|
*
|
213
211
|
* Example:
|
214
212
|
*
|
215
213
|
* ```bash
|
216
|
-
* $ syncify store_1 -t dev_theme -f assets/file --
|
217
|
-
* $ syncify store_1 -f metafields/namespace/*.json --
|
214
|
+
* $ syncify store_1 -t dev_theme -f assets/file -u --force
|
215
|
+
* $ syncify store_1 -f metafields/namespace/*.json -u --force
|
218
216
|
* ```
|
219
217
|
*/
|
220
|
-
|
218
|
+
force?: boolean;
|
221
219
|
/**
|
222
220
|
* Generator flag for automatically applying JSON schema specifications
|
223
221
|
* for VS Code users.
|
@@ -294,19 +292,6 @@ export interface Commands {
|
|
294
292
|
* ```
|
295
293
|
*/
|
296
294
|
silent?: boolean;
|
297
|
-
/**
|
298
|
-
* Initialized Browser Sync in watch mode. Can only be used when
|
299
|
-
* targeting a single store and theme.
|
300
|
-
*
|
301
|
-
* ---
|
302
|
-
*
|
303
|
-
* Example:
|
304
|
-
*
|
305
|
-
* ```bash
|
306
|
-
* $ syncify store_1 --watch --server
|
307
|
-
* ```
|
308
|
-
*/
|
309
|
-
server?: boolean;
|
310
295
|
/**
|
311
296
|
* Pulls in a Syncify theme strap environment.
|
312
297
|
*
|
@@ -315,7 +300,7 @@ export interface Commands {
|
|
315
300
|
* Example:
|
316
301
|
*
|
317
302
|
* ```bash
|
318
|
-
* $ syncify --strap
|
303
|
+
* $ syncify --strap dawn
|
319
304
|
* $ syncify --strap silk
|
320
305
|
* ```
|
321
306
|
*/
|
@@ -378,7 +363,7 @@ export interface Commands {
|
|
378
363
|
*/
|
379
364
|
input?: string;
|
380
365
|
/**
|
381
|
-
* An optional output path. This will overwrite
|
366
|
+
* An optional output path. This will overwrite any configuration predefined
|
382
367
|
* in settings.
|
383
368
|
*
|
384
369
|
* ---
|
@@ -392,16 +377,19 @@ export interface Commands {
|
|
392
377
|
output?: string;
|
393
378
|
/**
|
394
379
|
* Version control. The bump flag accepts 3 different arguments.
|
395
|
-
*
|
396
|
-
* Passing `--bump
|
397
|
-
* Passing `--bump
|
380
|
+
*
|
381
|
+
* 1. Passing `--bump major` bumps main version, eg: `1.0.0` > `2.0,0`
|
382
|
+
* 2. Passing `--bump minor` bumps minor version, eg: `1.0.0` > `1.1.0`
|
383
|
+
* 3. Passing `--bump patch` bumps patch version, eg: `1.0.0` > `1.0.1`
|
398
384
|
*
|
399
385
|
* ---
|
400
386
|
*
|
401
387
|
* Example:
|
402
388
|
*
|
403
389
|
* ```bash
|
404
|
-
* $ syncify --
|
390
|
+
* $ syncify --bump major
|
391
|
+
* $ syncify --bump minor
|
392
|
+
* $ syncify --bump patch
|
405
393
|
* ```
|
406
394
|
*/
|
407
395
|
bump?: string;
|
@@ -1,13 +1,12 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
|
3
|
-
import {
|
4
|
-
import { LiteralUnion } from 'type-fest';
|
3
|
+
import { LiteralUnion, Merge } from 'type-fest';
|
5
4
|
|
6
5
|
/**
|
7
6
|
* File types are represented as numeric values.
|
8
7
|
* The infer the following:
|
9
8
|
*/
|
10
|
-
export enum
|
9
|
+
export enum FileTypes {
|
11
10
|
Template = 1,
|
12
11
|
Layout,
|
13
12
|
Snippet,
|
@@ -16,9 +15,9 @@ export enum Types {
|
|
16
15
|
Locale,
|
17
16
|
Style,
|
18
17
|
Script,
|
18
|
+
Svg,
|
19
19
|
Redirect,
|
20
20
|
File,
|
21
|
-
Svg,
|
22
21
|
Asset,
|
23
22
|
Metafield,
|
24
23
|
Page,
|
@@ -26,9 +25,10 @@ export enum Types {
|
|
26
25
|
}
|
27
26
|
|
28
27
|
/**
|
29
|
-
* File Kinds
|
28
|
+
* File Kinds
|
30
29
|
*
|
31
|
-
*
|
30
|
+
* Applied to `file.kind` context. The is a text value
|
31
|
+
* Used to describe of file being handled.
|
32
32
|
*/
|
33
33
|
export type FileKinds = LiteralUnion<
|
34
34
|
| 'style'
|
@@ -47,26 +47,39 @@ export type FileKinds = LiteralUnion<
|
|
47
47
|
>
|
48
48
|
|
49
49
|
/**
|
50
|
-
* Shopify Asset Key
|
50
|
+
* Shopify Asset Key
|
51
|
+
*
|
52
|
+
* Applied to `file.key` context and required in theme asset
|
53
|
+
* requests. The `key` represents to the file and directory
|
54
|
+
* structure.
|
55
|
+
*
|
56
|
+
* > Used in REST API request payload
|
57
|
+
*
|
58
|
+
* @example
|
59
|
+
*
|
60
|
+
* 'snippets/filename.liquid'
|
51
61
|
*
|
52
|
-
* _Used in REST API request payload_
|
53
62
|
*/
|
54
63
|
export type FileKeys = LiteralUnion<
|
55
64
|
| `templates/${string}${'.liquid' | '.json'}`
|
56
65
|
| `templates/customer/${string}${'.liquid' | '.json'}`
|
57
66
|
| `assets/${string}`
|
58
|
-
| `sections/${string}${'.liquid'}`
|
67
|
+
| `sections/${string}${'.liquid' | '-group.json'}`
|
59
68
|
| `snippets/${string}${'.liquid'}`
|
60
69
|
| `layout/${string}${'.liquid'}`
|
61
70
|
| `locales/${string}${'.json'}`
|
62
71
|
| `config/settings_${'data' | 'schema'}${'.json'}`
|
63
72
|
, string
|
64
|
-
|
73
|
+
>
|
65
74
|
|
66
75
|
/**
|
67
|
-
* File Namespace
|
76
|
+
* File Namespace
|
68
77
|
*
|
69
|
-
*
|
78
|
+
* Applied to `file.namespace` context. This value represents the
|
79
|
+
* the output theme directory where a file should be written, but
|
80
|
+
* may also represent an endpoint.
|
81
|
+
*
|
82
|
+
* > Used in logs, reports and other logic
|
70
83
|
*/
|
71
84
|
export type FileNamespaces = LiteralUnion<
|
72
85
|
| 'template'
|
@@ -87,8 +100,8 @@ export type FileNamespaces = LiteralUnion<
|
|
87
100
|
/**
|
88
101
|
* File Resource - Applied to `file.resource` context
|
89
102
|
*
|
90
|
-
*
|
91
|
-
* will use the insufferable Shopify GraphQL endpoint
|
103
|
+
* Applied to `file.resource` context. Infers the REST API endpoint
|
104
|
+
* excluding `files` which will use the insufferable Shopify GraphQL endpoint.
|
92
105
|
*/
|
93
106
|
export type FileResources = LiteralUnion<
|
94
107
|
| 'pages'
|
@@ -101,22 +114,33 @@ export type FileResources = LiteralUnion<
|
|
101
114
|
>
|
102
115
|
|
103
116
|
/**
|
104
|
-
* File context generated when passed to a sync
|
105
|
-
*
|
106
|
-
* process.
|
117
|
+
* File context generated when passed to a sync resource and used
|
118
|
+
* to dispatch to correct transform process.
|
107
119
|
*/
|
108
|
-
interface File<T = any>
|
120
|
+
interface File<T = any> {
|
121
|
+
/**
|
122
|
+
* A unique UUID reference for this file - This option can change
|
123
|
+
* where required and when dealing with multiple stores at the request level.
|
124
|
+
*
|
125
|
+
* @example
|
126
|
+
*
|
127
|
+
* 'ABD41WX'
|
128
|
+
*/
|
129
|
+
uuid: string;
|
109
130
|
/**
|
110
131
|
* The file type that was intercepted. This is an enum number value.
|
111
|
-
* The number value will infer on how the file should be handled
|
132
|
+
* The number value will infer on how the file should be handled and uses
|
133
|
+
* the `FileType` enum for checks.
|
112
134
|
*
|
113
135
|
* @example
|
114
136
|
*
|
115
|
-
*
|
137
|
+
* file.type === FileType.Template
|
138
|
+
*
|
116
139
|
*/
|
117
140
|
type: number;
|
118
141
|
/**
|
119
|
-
* The resource endpoint to which the file will be
|
142
|
+
* The resource API endpoint to which the file will be synced.
|
143
|
+
* This will be passed to the request client.
|
120
144
|
*
|
121
145
|
* @example
|
122
146
|
*
|
@@ -124,9 +148,41 @@ interface File<T = any> extends ParsedPath {
|
|
124
148
|
* 'redirects'
|
125
149
|
*/
|
126
150
|
resource: FileResources;
|
151
|
+
/**
|
152
|
+
* The root of the file path
|
153
|
+
*
|
154
|
+
* > Value is obtained via the native `path.parse()` method
|
155
|
+
*
|
156
|
+
* @example
|
157
|
+
*
|
158
|
+
* '/' OR 'c:\'
|
159
|
+
*/
|
160
|
+
root: string;
|
161
|
+
/**
|
162
|
+
* The full directory path such.
|
163
|
+
*
|
164
|
+
* > Value is obtained via the native `path.parse()` method
|
165
|
+
*
|
166
|
+
* @example
|
167
|
+
*
|
168
|
+
* '/home/user/dir' OR 'c:\path\dir'
|
169
|
+
*/
|
170
|
+
dir: string;
|
171
|
+
/**
|
172
|
+
* The file name without extension (if any).
|
173
|
+
*
|
174
|
+
* > Value is obtained via the native `path.parse()` method
|
175
|
+
*
|
176
|
+
* @example
|
177
|
+
*
|
178
|
+
* 'filename' // filename.ext
|
179
|
+
*/
|
180
|
+
name: string;
|
127
181
|
/**
|
128
182
|
* The filename extension including the dot, eg: `.liquid`
|
129
183
|
*
|
184
|
+
* > Value is obtained via the native `path.parse()` method
|
185
|
+
*
|
130
186
|
* @example
|
131
187
|
*
|
132
188
|
* '.ext'
|
@@ -135,6 +191,8 @@ interface File<T = any> extends ParsedPath {
|
|
135
191
|
/**
|
136
192
|
* The input base filename including file extension.
|
137
193
|
*
|
194
|
+
* > Value is obtained via the native `path.parse()` method
|
195
|
+
*
|
138
196
|
* @example
|
139
197
|
*
|
140
198
|
* 'filename.ext'
|
@@ -195,10 +253,9 @@ interface File<T = any> extends ParsedPath {
|
|
195
253
|
*/
|
196
254
|
input: string;
|
197
255
|
/**
|
198
|
-
* The output path location which files will be written.
|
199
|
-
*
|
200
|
-
*
|
201
|
-
* have a `null` value.
|
256
|
+
* The output path location which files will be written. Only theme specific files
|
257
|
+
* have an output path location, when a file writes from its source (like a metafield) or
|
258
|
+
* if the file is handled in an asset pipeline transform then this will have a `null` value.
|
202
259
|
*
|
203
260
|
* @example
|
204
261
|
*
|
@@ -210,7 +267,8 @@ interface File<T = any> extends ParsedPath {
|
|
210
267
|
*/
|
211
268
|
output: string;
|
212
269
|
/**
|
213
|
-
* The file size in bytes before any augmentation is applied.
|
270
|
+
* The file size in bytes before any augmentation is applied. This
|
271
|
+
* value will assigned post-context, typically in a transform.
|
214
272
|
*
|
215
273
|
* @example
|
216
274
|
*
|
@@ -218,11 +276,10 @@ interface File<T = any> extends ParsedPath {
|
|
218
276
|
*/
|
219
277
|
size?: number;
|
220
278
|
/**
|
221
|
-
* Configuration reference. This will hold a reference
|
222
|
-
*
|
223
|
-
* transforms, wherein it holds the indexed config.
|
279
|
+
* Configuration reference. This will hold a reference to additional data.
|
280
|
+
* Typically, this is used for transforms, wherein it holds the indexed config.
|
224
281
|
*
|
225
282
|
* @default undefined // getter when required
|
226
283
|
*/
|
227
|
-
|
284
|
+
get data(): T
|
228
285
|
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
export interface Filters {
|
2
|
+
/**
|
3
|
+
* Theme Asset filters
|
4
|
+
*
|
5
|
+
* @example
|
6
|
+
* '--filter assets/*'
|
7
|
+
*/
|
8
|
+
assets?: string[];
|
9
|
+
/**
|
10
|
+
* Theme Config filters
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* '--filter config/*'
|
14
|
+
*/
|
15
|
+
config?: string[];
|
16
|
+
/**
|
17
|
+
* Theme Layout filters
|
18
|
+
*
|
19
|
+
* @example
|
20
|
+
* '--filter layout/*'
|
21
|
+
*/
|
22
|
+
layout?: string[];
|
23
|
+
/**
|
24
|
+
* Theme Locales filters
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
* '--filter locales/*'
|
28
|
+
*/
|
29
|
+
locales?: string[];
|
30
|
+
/**
|
31
|
+
* Theme Templates filters
|
32
|
+
*
|
33
|
+
* @example
|
34
|
+
* '--filter assets/*'
|
35
|
+
*/
|
36
|
+
templates?: string[];
|
37
|
+
/**
|
38
|
+
* Theme Customers filters
|
39
|
+
*
|
40
|
+
* @example
|
41
|
+
* '--filter assets/*'
|
42
|
+
*/
|
43
|
+
customers?: string[];
|
44
|
+
/**
|
45
|
+
* Theme Snippets filters
|
46
|
+
*
|
47
|
+
* @example
|
48
|
+
* '--filter snippets/*'
|
49
|
+
*/
|
50
|
+
snippets?: string[];
|
51
|
+
/**
|
52
|
+
* Theme sections filters
|
53
|
+
*
|
54
|
+
* @example
|
55
|
+
* '--filter sections/*'
|
56
|
+
*/
|
57
|
+
sections?: string[];
|
58
|
+
/**
|
59
|
+
* Store Metafields filters
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* '--filter assets/*'
|
63
|
+
*/
|
64
|
+
metafields?: string[];
|
65
|
+
/**
|
66
|
+
* Store pages filters
|
67
|
+
*
|
68
|
+
* @example
|
69
|
+
* '--filter pages/*'
|
70
|
+
*/
|
71
|
+
pages?: string[];
|
72
|
+
/**
|
73
|
+
* Terse filters
|
74
|
+
*
|
75
|
+
* @example
|
76
|
+
* '--filter terse:script'
|
77
|
+
* '--filter terse:style'
|
78
|
+
* '--filter terse:views'
|
79
|
+
*/
|
80
|
+
terse?: string[];
|
81
|
+
}
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
/* -------------------------------------------- */
|
3
2
|
/* LIVE RELOADS */
|
4
3
|
/* -------------------------------------------- */
|
5
4
|
|
6
|
-
export interface
|
5
|
+
export interface WSS {
|
7
6
|
/**
|
8
7
|
* Hot Socket for `<script>` tags
|
9
8
|
*/
|
@@ -35,13 +34,24 @@ export interface HOTSockets {
|
|
35
34
|
|
36
35
|
}
|
37
36
|
|
38
|
-
|
37
|
+
/**
|
38
|
+
* **INTERNAL USE**
|
39
|
+
*/
|
40
|
+
export interface HOTBundle {
|
39
41
|
/**
|
40
42
|
* Whether or not Syncify hot reloads UI labels should render.
|
41
43
|
*
|
42
44
|
* @default true
|
43
45
|
*/
|
44
46
|
label?: 'visible' | 'hidden';
|
47
|
+
/**
|
48
|
+
* **NOT YET AVAILABLE**
|
49
|
+
*
|
50
|
+
* Whether or not to record changes. When enabled, Syncify
|
51
|
+
* will keep track of the last 25 changes applied and allow
|
52
|
+
* you to walk through the stack.
|
53
|
+
*/
|
54
|
+
history?: boolean;
|
45
55
|
/**
|
46
56
|
* Whether or not Syncify should inject the required HOT snippet
|
47
57
|
* at runtime layout/s. When `false` you will need to manually place
|
@@ -126,7 +136,7 @@ export interface HOT {
|
|
126
136
|
alive?: { [template: string]: boolean; };
|
127
137
|
}
|
128
138
|
|
129
|
-
export type HOTConfig = Pick<
|
139
|
+
export type HOTConfig = Pick<HOTBundle,
|
130
140
|
| 'inject'
|
131
141
|
| 'label'
|
132
142
|
| 'layouts'
|