@syncify/cli 0.2.4-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 (40) 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 -101
  5. package/pnpm-lock.yaml +16526 -4200
  6. package/readme.md +77 -2017
  7. package/scripts/hot.js.liquid +25 -0
  8. package/dist/api.js +0 -16
  9. package/dist/cjs.js +0 -221
  10. package/dist/cli.js +0 -12
  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/cli.d.ts +0 -541
  18. package/types/config/index.d.ts +0 -530
  19. package/types/config/terser.d.ts +0 -267
  20. package/types/config/views.d.ts +0 -234
  21. package/types/index.d.ts +0 -55
  22. package/types/internal/cache.d.ts +0 -97
  23. package/types/internal/commands.d.ts +0 -396
  24. package/types/internal/errors.d.ts +0 -101
  25. package/types/internal/file.d.ts +0 -285
  26. package/types/internal/filters.d.ts +0 -81
  27. package/types/internal/hot.d.ts +0 -161
  28. package/types/internal/index.d.ts +0 -513
  29. package/types/internal/markdown.d.ts +0 -104
  30. package/types/internal/plugin.d.ts +0 -127
  31. package/types/internal/processors.d.ts +0 -54
  32. package/types/internal/reports.d.ts +0 -123
  33. package/types/internal/requests.d.ts +0 -288
  34. package/types/internal/shared.d.ts +0 -124
  35. package/types/modules/html-minifier-terser.d.ts +0 -211
  36. package/types/transforms/image.d.ts +0 -15
  37. package/types/transforms/json.d.ts +0 -42
  38. package/types/transforms/script.d.ts +0 -308
  39. package/types/transforms/style.d.ts +0 -219
  40. package/types/transforms/svg.d.ts +0 -189
@@ -1,513 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
-
3
- import type { Tester } from 'anymatch';
4
- import type { Config as TailwindProcessor } from 'tailwindcss';
5
- import type { Merge } from 'type-fest';
6
- import type { Markdown } from './markdown';
7
- import type { AxiosRequestConfig } from 'axios';
8
- import type { ESBuildProcesser, ScriptBundle } from '../transforms/script';
9
- import type { SASSProcesser, PostCSSProcesser, StyleBundle } from '../transforms/style';
10
- import type { SVGOProcesser, SVGSpriteProcesser } from '../transforms/svg';
11
- import type { JSONBundle } from '../transforms/json';
12
- import type { FSWatcher } from 'chokidar';
13
- import type { ChildProcessWithoutNullStreams } from 'child_process';
14
- import type * as Config from '../config/index';
15
-
16
- /* -------------------------------------------- */
17
- /* PROCESSORS */
18
- /* -------------------------------------------- */
19
-
20
- export interface SpawnCommand {
21
- /**
22
- * The base command, For example `esbuild` would be the
23
- * _base_ command in `esbuild src/file.js --watch`. If an
24
- * array command was provided in config then this value would
25
- * represent the first item in that array.
26
- */
27
- cmd: string;
28
- /**
29
- * The command arguments. For example, all commands following
30
- * the base command. The value here will be passed to spawn.
31
- */
32
- args: string[];
33
- /**
34
- * The process id (pid) assigned to the spawn. This is dynamically
35
- * assigned and will be `NaN` until spawn has been invoked.
36
- */
37
- pid: number;
38
- }
39
-
40
- /* -------------------------------------------- */
41
- /* ENVIRONMENT REFERENCES */
42
- /* -------------------------------------------- */
43
-
44
- /**
45
- * **INTERNAL USE**
46
- *
47
- * Execution options which describe the invocation and operation
48
- * instructions which Syncify was initialised.
49
- */
50
- export interface Env {
51
- /**
52
- * Building for development (default)
53
- *
54
- * @default true
55
- */
56
- dev: boolean;
57
- /**
58
- * Building for production (default)
59
- *
60
- * @default false
61
- */
62
- prod: boolean;
63
- /**
64
- * Signals sync execution, values represent the following:
65
- *
66
- * `0` - _No sync operation inferred_
67
- *
68
- * `1` - _Sync to 1 store and 1 theme_
69
- *
70
- * `2` - _Syncing to more than 1 store or theme._
71
- *
72
- * @default 0
73
- */
74
- sync: 0 | 1 | 2;
75
- /**
76
- * Whether or not syncify was CLI Initialized. When `false` syncify
77
- * was called from JavaScript API, whereas `true` means it was invoked via API.
78
- *
79
- * @default false
80
- */
81
- cli: boolean;
82
- }
83
-
84
- /* -------------------------------------------- */
85
- /* SPAWN CONFIGURATION */
86
- /* -------------------------------------------- */
87
-
88
- /**
89
- * **INTERNAL USE**
90
- *
91
- * Spawn configuration state.
92
- */
93
- export interface Spawn {
94
- /**
95
- * Dynamically populated `Set` of file paths
96
- * that were generated from a spawned process.
97
- * Each item in the set will be matched against
98
- * in modes like `watch` from the chokidar instance.
99
- */
100
- paths: Set<string>;
101
- /**
102
- * Whether or not a spawn process ran. This is used
103
- * to determine what action took place in the build
104
- * cycles. When this value is `true` it infers a spawn
105
- * process was fired, when `false` it infers the opposite.
106
- *
107
- * > _Spawned invocation uses the `stdio` stream to determine
108
- * whether or not a change was fired by a child running process_
109
- */
110
- invoked: boolean;
111
- /**
112
- * Child Processes
113
- *
114
- * Collection of spawned child proccesses. We need to hold reference of these
115
- * so as they can be killed when ending the session.
116
- */
117
- streams: Map<string, ChildProcessWithoutNullStreams>
118
- /**
119
- * Commands that were spawned.
120
- */
121
- commands: {
122
- /**
123
- * The name of the process that will run, eg: `esbuild`
124
- */
125
- [name: string]: SpawnCommand
126
- }
127
- }
128
-
129
- /* -------------------------------------------- */
130
- /* STORE CONFIGURATION */
131
- /* -------------------------------------------- */
132
-
133
- /**
134
- * **INTERNAL USE**
135
- *
136
- * Store authorisation client
137
- */
138
- export interface Store {
139
- /**
140
- * The store domain name in Upcase (without `myshopify.com`)
141
- */
142
- store: string;
143
- /**
144
- * The store myshopify domain, eg: `store.myshopify.com`
145
- */
146
- domain: string;
147
- /**
148
- * Client instances
149
- */
150
- client: AxiosRequestConfig
151
- /**
152
- * Queue
153
- */
154
- queue: boolean;
155
- }
156
-
157
- /* -------------------------------------------- */
158
- /* THEME CONFIGURATION */
159
- /* -------------------------------------------- */
160
-
161
- /**
162
- * **INTERNAL USE**
163
- *
164
- * Theme related model
165
- */
166
- export interface Theme {
167
- /**
168
- * The store index reference
169
- */
170
- sidx: number;
171
- /**
172
- * The theme id.
173
- */
174
- id: number;
175
- /**
176
- * The store domain name
177
- */
178
- store: string;
179
- /**
180
- * The theme target name
181
- */
182
- target: string;
183
- /**
184
- * The authorized assets URL endpoint
185
- */
186
- url: string;
187
- }
188
-
189
- /* -------------------------------------------- */
190
- /* SYNC CONFIGURATION */
191
- /* -------------------------------------------- */
192
-
193
- /**
194
- * **INTERNAL USE**
195
- *
196
- * Sync clients
197
- */
198
- export interface Sync {
199
- /**
200
- * Theme synchronization options
201
- */
202
- themes: Array<Theme>;
203
- /**
204
- * Store synchronization options
205
- */
206
- stores: Array<Store>;
207
- }
208
-
209
- /* -------------------------------------------- */
210
- /* TERSER CONFIGURATION */
211
- /* -------------------------------------------- */
212
-
213
- /* -------------------------------------------- */
214
- /* MODE CONFIGURATION */
215
- /* -------------------------------------------- */
216
-
217
- /**
218
- * **INTERNAL USE**
219
- *
220
- * Execution modes
221
- */
222
- export interface Modes {
223
- /**
224
- * Run the command prompt
225
- */
226
- interactive: boolean;
227
- /**
228
- * Execute a build, alias: `-b`
229
- */
230
- build: boolean;
231
- /**
232
- * Execute watch, alias: `-w`
233
- */
234
- watch: boolean;
235
- /**
236
- * Execute Upload, alias: `-u`
237
- */
238
- upload: boolean;
239
- /**
240
- * Execute Download, alias: `-d`
241
- */
242
- download: boolean;
243
- /**
244
- * Execute Clean, alias: `-c`
245
- */
246
- clean: boolean;
247
- /**
248
- * Generates VSC Schema spec file
249
- */
250
- vsc: boolean;
251
- /**
252
- * Execute metafields action, `--metafields`
253
- */
254
- metafields: boolean
255
- /**
256
- * Execute redirects resource, `--redirects`
257
- */
258
- redirects: boolean;
259
- /**
260
- * Execute page action, `--pages`
261
- */
262
- pages: boolean
263
- /**
264
- * Pull data from remote store, `--pull`
265
- */
266
- pull: boolean;
267
- /**
268
- * Force upload and overwrite, `--force`
269
- */
270
- force: boolean;
271
- /**
272
- * Invoke HOT reloads, `--hot`
273
- */
274
- hot: boolean;
275
- /**
276
- * Run the views transform, `--views`
277
- */
278
- views: boolean;
279
- /**
280
- * Run the style transform, `--style`
281
- */
282
- style: boolean;
283
- /**
284
- * Run the script transform, `--script`
285
- */
286
- script: boolean;
287
- /**
288
- * Run the svg transform, `--svg`
289
- */
290
- svg: boolean;
291
- /**
292
- * Run the image transform, `--image`
293
- */
294
- image: boolean;
295
- /**
296
- * Run minification, either `--prod`, `--terse`
297
- */
298
- terse: boolean;
299
- /**
300
- * Trigger export, alias: `-e`
301
- */
302
- export: boolean;
303
- }
304
-
305
- /* -------------------------------------------- */
306
- /* CMD CONFIGURATION */
307
- /* -------------------------------------------- */
308
-
309
- /**
310
- * **INTERNAL USE**
311
- *
312
- * Passed command overwrites
313
- */
314
- export interface CommandBundle {
315
- /**
316
- * An input overwrite path was passed
317
- *
318
- * @default null
319
- */
320
- input: string;
321
- /**
322
- * An output overwrite path was passed
323
- *
324
- * @default null
325
- */
326
- output: string;
327
- /**
328
- * A config overwrite path was passed
329
- *
330
- * @default null
331
- */
332
- config: string;
333
- /**
334
- * Filters were passed in the command
335
- *
336
- * @default null
337
- */
338
- filter: string;
339
- /**
340
- * Deletions were passed in the command
341
- *
342
- * @default null
343
- */
344
- delete: string;
345
- }
346
-
347
- /* -------------------------------------------- */
348
- /* CONFIG FILE RESOLUTION */
349
- /* -------------------------------------------- */
350
-
351
- /**
352
- * **INTERNAL USE**
353
- *
354
- * Configuration File
355
- */
356
- export interface ConfigFile {
357
- /**
358
- * The full resolved path to the syncify configuration file
359
- *
360
- * @example
361
- *
362
- * 'Users/Sissel/Sites/Folder/views/dir/syncify.config.ts'
363
- */
364
- path: string;
365
- /**
366
- * The config file name including file extension.
367
- *
368
- * @example
369
- *
370
- * 'syncify.config.ts'
371
- */
372
- base: string;
373
- /**
374
- * The config file relative path location from current _root_ working directory.
375
- * This is typically going to match the `base` value as most config files work
376
- * from workspace root directory unless inferred otherwise.
377
- *
378
- * @example
379
- *
380
- * 'dir/syncify.config.ts'
381
- */
382
- relative: string;
383
- }
384
-
385
- /* -------------------------------------------- */
386
- /* SECTIONS */
387
- /* -------------------------------------------- */
388
-
389
- /**
390
- * **INTERNAL USE**
391
- *
392
- * Sections sub-directory configuration
393
- */
394
- export type SectionBundle = Merge<Config.Views['sections'], {
395
- global: RegExp;
396
- paths?: Tester;
397
- }>
398
-
399
- /* -------------------------------------------- */
400
- /* SNIPPETS */
401
- /* -------------------------------------------- */
402
-
403
- /**
404
- * **INTERNAL USE**
405
- *
406
- * Snippets sub-directory configuration
407
- */
408
- export type SnippetBundle = Merge<Config.Views['snippets'], {
409
- global: RegExp;
410
- paths?: Tester;
411
- }>
412
-
413
- /* -------------------------------------------- */
414
- /* PATHS */
415
- /* -------------------------------------------- */
416
-
417
- /**
418
- * **INTERNAL USE**
419
- *
420
- * Anymatched paths
421
- */
422
- export type PathsBundle = Merge<Config.Paths<Tester>, {
423
- transforms?: Map<string, 7 | 8 | 9>
424
- }>;
425
-
426
- /* -------------------------------------------- */
427
- /* PAGES */
428
- /* -------------------------------------------- */
429
-
430
- /**
431
- * **INTERNAL USE**
432
- *
433
- * Page configuration
434
- */
435
- export type PagesBundle = Merge<Config.Views['pages'], {
436
- import: Markdown.Import;
437
- export: Markdown.Export
438
- }>
439
-
440
- /* -------------------------------------------- */
441
- /* WATCH */
442
- /* -------------------------------------------- */
443
-
444
- /**
445
- * **INTERNAL USE**
446
- *
447
- * Chokidar watch instance
448
- */
449
- export type WatchBundle = Merge<FSWatcher, {
450
- /**
451
- * Private method of chokidar
452
- */
453
- _watched: Map<string, { items: Set<string> }>;
454
- /**
455
- * The chokidar instance will be a `Set` when running in
456
- * non-watch modes. This value is used in the `paths` getter
457
- * to convert entries to an array.
458
- */
459
- values (): IterableIterator<string>;
460
- /**
461
- * Check whether or not a path is being watched
462
- */
463
- has (path: string, dir?: string): boolean;
464
- /**
465
- * Returns all watched paths
466
- */
467
- get paths (): string[]
468
- }>;
469
-
470
- /* -------------------------------------------- */
471
- /* PROCESSORS */
472
- /* -------------------------------------------- */
473
-
474
- /**
475
- * **INTERNAL USE**
476
- *
477
- * Processor configuration state. This model infers which
478
- * pre-processors are being used and/or available.
479
- */
480
- export interface ProcessorsBundle {
481
- /**
482
- * JSON processing
483
- */
484
- json: JSONBundle;
485
- /**
486
- * [PostCSS](https://postcss.org/) Pre-Processor
487
- */
488
- postcss: PostCSSProcesser;
489
- /**
490
- * [SASS Dart](https://sass-lang.com/documentation/js-api/) Pre-Processor
491
- */
492
- sass: SASSProcesser;
493
- /**
494
- * [TailwindCSS](https://tailwindcss.com/) Pre-Processor
495
- */
496
- tailwind: TailwindProcessor;
497
- /**
498
- * [Sharp](https://sharp.pixelplumbing.com) Pre-Processor
499
- */
500
- sharp: any;
501
- /**
502
- * [SVG Sprite](https://github.com/svg-sprite) Pre-Processor
503
- */
504
- sprite: SVGSpriteProcesser;
505
- /**
506
- * [SVGO](https://github.com/svg/svgo) Pre-Processor
507
- */
508
- svgo: SVGOProcesser
509
- /**
510
- * [ESBuild](https://esbuild.github.io/) Pre-Processor
511
- */
512
- esbuild: ESBuildProcesser
513
- }
@@ -1,104 +0,0 @@
1
- /**
2
- * **Markdown > HTML**
3
- *
4
- * Syncify uses [markdown-it](https://github.com/markdown-it/markdown-it) when
5
- * converting markdown to HTML (export).
6
- *
7
- * **HTML > Markdown**
8
- *
9
- * Syncify uses [Turndown](https://github.com/mixmark-io/turndown) when
10
- * converting HTML to HTML (import).
11
- */
12
- export namespace Markdown {
13
- /**
14
- * Syncify uses [markdown-it](https://github.com/markdown-it/markdown-it) under
15
- * the hood for transforming markdown pages into HTML. The options provided here
16
- * will be passed onto markdown-it.
17
- */
18
- export interface Export {
19
- /**
20
- * Enable HTML tags in source, defaults to `true`
21
- */
22
- html: boolean;
23
- /**
24
- * // Use `/` to close single tags (<br />), defaults to `false`.
25
- * This is only for full CommonMark compatibility.
26
- */
27
- xhtmlOut: boolean;
28
- /**
29
- * Convert '\n' in paragraphs into `<br>`, defaults to `true`
30
- */
31
- breaks: boolean;
32
- /**
33
- * CSS language prefix for fenced blocks. Can be useful for external
34
- * highlighters, defaults to `language-`
35
- */
36
- langPrefix: string;
37
- /**
38
- * Autoconvert URL-like text to links, defaults to `false`
39
- */
40
- linkify: boolean;
41
-
42
- /**
43
- * Enable some language-neutral replacement + quotes beautification (defaults to `false`)
44
- * For the full list of replacements, see;
45
- * https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js
46
- */
47
- typographer: boolean;
48
- /**
49
- * Double + single quotes replacement pairs, when typographer enabled,
50
- * and smartquotes on. Could be either a String or an Array.
51
- * For example, you can use '«»„“' for Russian, '„“‚‘' for German,
52
- * and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
53
- */
54
- quotes: string;
55
- }
56
-
57
- /**
58
- * Syncify uses [Turndown](https://github.com/mixmark-io/turndown) under
59
- * the hood to convert pages imported from stores into Markdown. The
60
- * `language` option **MUST** be set to `markdown`.
61
- */
62
- export interface Import {
63
- /**
64
- * Heading style for conversion. This defaults to `atx`.
65
- */
66
- headingStyle?: 'setext' | 'atx';
67
- /**
68
- * Horizontal Rules, defaults to `***`
69
- */
70
- hr?: '***' | '---' | '___';
71
- /**
72
- * Bullet list markers, defaults to `-`
73
- */
74
- bulletListMarker?: '-' | '+' | '*'
75
- /**
76
- * Code blocks, defaults to `fenced`
77
- */
78
- codeBlockStyle?: 'indented' | 'fenced';
79
- /**
80
- * EM Delimiter (ie: Italic), defaults to `_`
81
- */
82
- emDelimiter?: '_' | '*';
83
- /**
84
- * Code block fence style, defaults to ```
85
- */
86
- fence?: '```' | '~~~' | undefined;
87
- /**
88
- * Strong Delimiter (ie: bold), defaults to `**`
89
- */
90
- strongDelimiter?: '__' | '**' | undefined;
91
- /**
92
- * Link style, defaults to `inlined`
93
- *
94
- * _Don't fuck around with this and leave it as `inlined`_
95
- */
96
- linkStyle?: 'inlined' | 'referenced' | undefined;
97
- /**
98
- * Link style reference, defaults to `full`
99
- *
100
- * _Don't fuck around with this and leave it as `full`_
101
- */
102
- linkReferenceStyle?: 'full' | 'collapsed' | 'shortcut' | undefined;
103
- }
104
- }