@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,396 +0,0 @@
1
- /* -------------------------------------------- */
2
- /* CLI OPTIONS */
3
- /* -------------------------------------------- */
4
-
5
- export interface Commands {
6
- /**
7
- * First command is a store or comma separated list of stores. When
8
- * a comma list is supplied it is converted to an array. You can use
9
- * use the store target name as a --flag to cherry pick specific themes
10
- * from that store.
11
- *
12
- * ---
13
- *
14
- * Example:
15
- *
16
- * ```bash
17
- * $ syncify store-name
18
- * $ syncify store1,store2,store3
19
- * ```
20
- */
21
- _?: string[];
22
- /**
23
- * Whether or not syncify was called via the cli
24
- *
25
- * @default true
26
- */
27
- cli?: boolean;
28
- /**
29
- * The current working directory, this a reference to `process.cwd()`
30
- */
31
- cwd?: string;
32
- /**
33
- * The `package.json` url path, this is written post-command parse
34
- */
35
- pkg?: string;
36
- /**
37
- * The post-parse temp storage reference to stores
38
- */
39
- store?: string[];
40
- /**
41
- * An optional config path to the `syncify.config.js` file.
42
- *
43
- * ---
44
- *
45
- * Example:
46
- *
47
- * ```bash
48
- * $ syncify store_1 -c path/to/file
49
- * $ syncify store_1 --config path/to/file
50
- * $ syncify store_1 --config=path/to/file
51
- * ```
52
- */
53
- config?: string;
54
- /**
55
- * Run in production mode
56
- *
57
- * ---
58
- *
59
- * Example:
60
- *
61
- * ```bash
62
- * $ syncify --prod
63
- * ```
64
- */
65
- prod?: boolean;
66
- /**
67
- * Run in development mode (default build mode) and can be omitted
68
- *
69
- * ---
70
- *
71
- * Example:
72
- *
73
- * ```bash
74
- * $ syncify
75
- * ```
76
- */
77
- dev?: boolean;
78
- /**
79
- * Show the command prompt interactive shell
80
- *
81
- * ---
82
- *
83
- * Example:
84
- *
85
- * ```bash
86
- * $ syncify --interactive
87
- * ```
88
- */
89
- interactive?: boolean;
90
- /**
91
- * Run in watch mode (chokidar). This requires a store target be passed.
92
- *
93
- * ---
94
- *
95
- * Example:
96
- *
97
- * ```bash
98
- * $ syncify store_1 -w
99
- * $ syncify store_1 --watch
100
- * ```
101
- */
102
- watch?: boolean;
103
- /**
104
- * Run in build mode, this is default trigger when no arguments provided.
105
- * It can optionally be triggered along other flags like `-u` (`--upload`).
106
- *
107
- * ---
108
- *
109
- * Example:
110
- *
111
- * ```bash
112
- * $ syncify
113
- * $ syncify -b
114
- * $ syncify store_1 --clean --build --theme=prod_theme -u
115
- *
116
- * # Short version for brevity
117
- * $ syncify store_1 -t prod_theme -u -b --clean
118
- * ```
119
- */
120
- build?: boolean;
121
- /**
122
- * Run in upload mode, this will trigger a full theme upload. Requires a store
123
- * target and theme target (theme target is optional but recommended).
124
- *
125
- * ---
126
- *
127
- * Example:
128
- *
129
- * ```bash
130
- * $ syncify store_1 -t dev_theme -u
131
- * $ syncify store_1 -t dev_theme --upload
132
- * ```
133
- */
134
- upload?: boolean;
135
- /**
136
- * Download a theme from a store. Will be place in `import` driectory. Requires a store
137
- * target and theme target to be passed.
138
- *
139
- * ---
140
- *
141
- * Example:
142
- *
143
- * ```bash
144
- * $ syncify store_1 -t dev_theme -d
145
- * $ syncify store_1 -t dev_theme --download
146
- * ```
147
- */
148
- download?: boolean;
149
- /**
150
- * Triggers the metafields resource, presents the interactive shell with list of
151
- * options to choose from. Requires a store target to be passed.
152
- *
153
- * ---
154
- *
155
- * Example:
156
- *
157
- * ```bash
158
- * $ syncify store_1 -m
159
- * $ syncify store_1 --metafields
160
- * ```
161
- */
162
- metafields?: boolean;
163
- /**
164
- * Triggers the pages resource, presents the interactive shell with list of
165
- * options to choose from. Requires a store target to be passed.
166
- *
167
- * ---
168
- *
169
- * Example:
170
- *
171
- * ```bash
172
- * $ syncify store_1 -p
173
- * $ syncify store_1 --pages
174
- * ```
175
- */
176
- pages?: boolean;
177
- /**
178
- * Triggers the redirects resource, presents the interactive shell with list of
179
- * options to choose from. Requires a store target to be passed.
180
- *
181
- * ---
182
- *
183
- * Example:
184
- *
185
- * ```bash
186
- * $ syncify store_1 -r
187
- * $ syncify store_1 --redirects
188
- * ```
189
- */
190
- redirects?: boolean;
191
- /**
192
- * Pull data reference from a store target resource. Queries the store API. Used to
193
- * populate local setup with remote data like `metafields` and `pages`
194
- *
195
- * ---
196
- *
197
- * Example:
198
- *
199
- * ```bash
200
- * $ syncify store_1 -m --pull
201
- * $ syncify store_1 -p --pull
202
- * ```
203
- */
204
- pull?: boolean;
205
- /**
206
- * Force uploads a resource from local to remote shop. This will instruct
207
- * syncify to overwrite any remote versions.
208
- *
209
- * ---
210
- *
211
- * Example:
212
- *
213
- * ```bash
214
- * $ syncify store_1 -t dev_theme -f assets/file -u --force
215
- * $ syncify store_1 -f metafields/namespace/*.json -u --force
216
- * ```
217
- */
218
- force?: boolean;
219
- /**
220
- * Generator flag for automatically applying JSON schema specifications
221
- * for VS Code users.
222
- *
223
- * ---
224
- *
225
- * Example:
226
- *
227
- * ```bash
228
- * $ syncify --vsc
229
- * ```
230
- */
231
- vsc?: boolean;
232
- /**
233
- * Filter targeting of resources, assets or files. This can be used together
234
- * with several different flags, like `-u`, `-d` and even `-b`. Filters a
235
- * glob pattern or specific file.
236
- *
237
- * ---
238
- *
239
- * Example:
240
- *
241
- * ```bash
242
- * # Uploads only .css assets
243
- * $ syncify store_1 -t dev_theme -f assets/*.css --push
244
- *
245
- * # Builds locales in production mode
246
- * $ syncify -f locales/*.json --prod
247
- *
248
- * # Uploads specific page
249
- * $ syncify store_1 -u -f pages/shipping-info.md --prod --push
250
- * ```
251
- */
252
- filter?: string;
253
- /**
254
- * Triggers a clean of the output directory. When provided, this will be
255
- * executed at the initial run (or before any else). Use together with
256
- * production builds.
257
- *
258
- * ---
259
- *
260
- * Example:
261
- *
262
- * ```bash
263
- * $ syncify --clean --prod
264
- * $ syncify -b --clean --prod # Using with build
265
- * ```
266
- */
267
- clean?: boolean;
268
- /**
269
- * Show command-line help information. Also prints a disclaimer informing
270
- * users that Centra is a better e-commerce platform than Shopify for shits
271
- * and giggles (it actually is though).
272
- *
273
- * ---
274
- *
275
- * Example:
276
- *
277
- * ```bash
278
- * $ syncify -h
279
- * $ syncify --help
280
- * ```
281
- */
282
- help?: boolean;
283
- /**
284
- * Hides logs from being printed (shows errors though)
285
- *
286
- * ---
287
- *
288
- * Example:
289
- *
290
- * ```bash
291
- * $ syncify --silent
292
- * ```
293
- */
294
- silent?: boolean;
295
- /**
296
- * Pulls in a Syncify theme strap environment.
297
- *
298
- * ---
299
- *
300
- * Example:
301
- *
302
- * ```bash
303
- * $ syncify --strap dawn
304
- * $ syncify --strap silk
305
- * ```
306
- */
307
- strap?: string;
308
- /**
309
- * Deletes a resource, file or asset from the remote store. Requires a store
310
- * target be passed and if need be a theme target too. Does not delete local
311
- * copies, do that manually for now.
312
- *
313
- * ---
314
- *
315
- * Example:
316
- *
317
- * ```bash
318
- * $ syncify -del assets/image-name.jpg
319
- * ```
320
- */
321
- del?: string;
322
- /**
323
- * Trigger a spawn, isolating it so it will run as if it were a node script.
324
- *
325
- * ---
326
- *
327
- * Example:
328
- *
329
- * ```bash
330
- * $ syncify -s spawn-name
331
- * $ syncify -s spawn-name,some-other-spawn
332
- * ```
333
- */
334
- spawn?: string;
335
- /**
336
- * Themes within stores to target. This argument requires a store target/s
337
- * be passed and accept a comma separated list of target names as per the users
338
- * Syncify configuration. Users can pass wildcard `--flags` to reference different
339
- * stores when multiple store target are passed.
340
- *
341
- * ---
342
- *
343
- * Example:
344
- *
345
- * ```bash
346
- * $ syncify store_1 -t theme_1
347
- * $ syncify store_1,store_2 --store_1 dev,prod --store_2 foo_theme
348
- * $ syncify store_1 --theme=dev,prod,test
349
- * ```
350
- */
351
- theme?: string[];
352
- /**
353
- * An optional input base directory path. This will overwrite and configuration predefined
354
- * in settings.
355
- *
356
- * ---
357
- *
358
- * Example:
359
- *
360
- * ```bash
361
- * $ syncify --clean -b -i some/directory
362
- * ```
363
- */
364
- input?: string;
365
- /**
366
- * An optional output path. This will overwrite any configuration predefined
367
- * in settings.
368
- *
369
- * ---
370
- *
371
- * Example:
372
- *
373
- * ```bash
374
- * $ syncify --clean -b -o some/directory
375
- * ```
376
- */
377
- output?: string;
378
- /**
379
- * Version control. The bump flag accepts 3 different arguments.
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`
384
- *
385
- * ---
386
- *
387
- * Example:
388
- *
389
- * ```bash
390
- * $ syncify --bump major
391
- * $ syncify --bump minor
392
- * $ syncify --bump patch
393
- * ```
394
- */
395
- bump?: string;
396
- }
@@ -1,101 +0,0 @@
1
- export type ErrorTypes = (
2
- | 'request'
3
- | 'syntax'
4
- | 'transform'
5
- | 'esbuild'
6
- | 'sass'
7
- | 'postcss'
8
- | 'minify'
9
- | 'json'
10
- | 'liquid'
11
- | 'shopify'
12
- | 'sharp'
13
- | 'svgo'
14
- | 'sprite'
15
- | 'resolve'
16
- )
17
-
18
- export interface RequestError {
19
- /**
20
- * An error code number - Typically used in request errors
21
- *
22
- * @default false
23
- */
24
- code?: number;
25
- /**
26
- * The error message to be printed
27
- */
28
- message: string;
29
- /**
30
- *
31
- */
32
- detail?: string;
33
- /**
34
- *
35
- */
36
- info?: string[];
37
- /**
38
- * The stack trace
39
- */
40
- stack?: string;
41
- /**
42
- * Additional notes or suggestions
43
- */
44
- notes?: string;
45
- }
46
-
47
- export interface Error {
48
- /**
49
- * The error type - This can one of many issues
50
- */
51
- type: ErrorTypes
52
- /**
53
- * An error code number - Typically used in request errors
54
- *
55
- * @default false
56
- */
57
- code?: number;
58
- /**
59
- * The error message to be printed
60
- */
61
- message: string | string[];
62
- /**
63
- *
64
- */
65
- data?: { details: string[]; line?: number }[]
66
- /**
67
- * Error details, typically used in request failures
68
- */
69
- details?: string | string[];
70
- /**
71
- * Whether or not to throw
72
- *
73
- * @default false
74
- */
75
- throw?: boolean;
76
- /**
77
- * The stack trace
78
- */
79
- stack?: string;
80
- /**
81
- * Additional notes or suggestions
82
- */
83
- notes?: string | string[];
84
- /**
85
- * The line number and column (if any)
86
- */
87
- location?: {
88
- /**
89
- * Line number
90
- */
91
- line: number;
92
- /**
93
- * Column number (ie: character)
94
- */
95
- column?: number;
96
- /**
97
- * Code sample indicating where the error occurs
98
- */
99
- sample?: string
100
- }
101
- }