@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.
- package/LICENSE +10 -6
- package/dist/index.d.cts +1815 -0
- package/dist/index.d.ts +1815 -0
- package/package.json +101 -101
- package/pnpm-lock.yaml +16526 -4200
- package/readme.md +77 -2017
- package/scripts/hot.js.liquid +25 -0
- package/dist/api.js +0 -16
- package/dist/cjs.js +0 -221
- package/dist/cli.js +0 -12
- package/dist/index.js +0 -18
- package/hot.js.liquid +0 -3
- package/schema/syncify.config.json +0 -676
- package/schema/syncify.env.json +0 -58
- package/schema/syncify.package.json +0 -11
- package/types/api.d.ts +0 -319
- package/types/cli.d.ts +0 -541
- package/types/config/index.d.ts +0 -530
- package/types/config/terser.d.ts +0 -267
- package/types/config/views.d.ts +0 -234
- package/types/index.d.ts +0 -55
- package/types/internal/cache.d.ts +0 -97
- package/types/internal/commands.d.ts +0 -396
- package/types/internal/errors.d.ts +0 -101
- package/types/internal/file.d.ts +0 -285
- package/types/internal/filters.d.ts +0 -81
- package/types/internal/hot.d.ts +0 -161
- package/types/internal/index.d.ts +0 -513
- package/types/internal/markdown.d.ts +0 -104
- package/types/internal/plugin.d.ts +0 -127
- package/types/internal/processors.d.ts +0 -54
- package/types/internal/reports.d.ts +0 -123
- package/types/internal/requests.d.ts +0 -288
- package/types/internal/shared.d.ts +0 -124
- package/types/modules/html-minifier-terser.d.ts +0 -211
- package/types/transforms/image.d.ts +0 -15
- package/types/transforms/json.d.ts +0 -42
- package/types/transforms/script.d.ts +0 -308
- package/types/transforms/style.d.ts +0 -219
- package/types/transforms/svg.d.ts +0 -189
package/schema/syncify.env.json
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
3
|
-
"$id": "syncify",
|
4
|
-
"version": 1.1,
|
5
|
-
"definitions": {
|
6
|
-
"schema": {
|
7
|
-
"oneOf": [
|
8
|
-
{
|
9
|
-
"type": "object",
|
10
|
-
"additionalProperties": false,
|
11
|
-
"properties": {
|
12
|
-
"domain": {
|
13
|
-
"description": "The shop domain",
|
14
|
-
"type": "string",
|
15
|
-
"default": "your-store.myshopify.com"
|
16
|
-
},
|
17
|
-
"key": {
|
18
|
-
"description": "The shop key",
|
19
|
-
"type": "string"
|
20
|
-
},
|
21
|
-
"secret": {
|
22
|
-
"description": "The shop secret",
|
23
|
-
"type": "string"
|
24
|
-
}
|
25
|
-
}
|
26
|
-
},
|
27
|
-
{
|
28
|
-
"type": "object",
|
29
|
-
"additionalProperties": false,
|
30
|
-
"properties": {
|
31
|
-
"domain": {
|
32
|
-
"description": "The shop domain",
|
33
|
-
"type": "string",
|
34
|
-
"default": "your-store.myshopify.com"
|
35
|
-
},
|
36
|
-
"token": {
|
37
|
-
"description": "The shop token",
|
38
|
-
"type": "string"
|
39
|
-
}
|
40
|
-
}
|
41
|
-
}
|
42
|
-
]
|
43
|
-
}
|
44
|
-
},
|
45
|
-
"oneOf": [
|
46
|
-
{
|
47
|
-
"type": "object",
|
48
|
-
"$ref": "#/definitions/schema"
|
49
|
-
},
|
50
|
-
{
|
51
|
-
"type": "array",
|
52
|
-
"items": {
|
53
|
-
"type": "object",
|
54
|
-
"$ref": "#/definitions/schema"
|
55
|
-
}
|
56
|
-
}
|
57
|
-
]
|
58
|
-
}
|
package/types/api.d.ts
DELETED
@@ -1,319 +0,0 @@
|
|
1
|
-
import { PartialDeep } from 'type-fest';
|
2
|
-
import { Config } from './config';
|
3
|
-
import { Asset } from './internal/requests';
|
4
|
-
import { File } from './internal/file';
|
5
|
-
|
6
|
-
type Download = (
|
7
|
-
this: {
|
8
|
-
/**
|
9
|
-
* The Shopify asset resource response
|
10
|
-
*/
|
11
|
-
asset: Asset
|
12
|
-
/**
|
13
|
-
* The destination directory of the asset
|
14
|
-
*/
|
15
|
-
output: string;
|
16
|
-
},
|
17
|
-
/**
|
18
|
-
* The asset contents as Buffer.
|
19
|
-
*
|
20
|
-
* > Convert to a string using `content.toString()`
|
21
|
-
*/
|
22
|
-
content: Buffer
|
23
|
-
) => (
|
24
|
-
string |
|
25
|
-
Buffer |
|
26
|
-
void |
|
27
|
-
{
|
28
|
-
/**
|
29
|
-
* Output the asset file to a new location
|
30
|
-
*/
|
31
|
-
output: string;
|
32
|
-
/**
|
33
|
-
* Updated content of the asset
|
34
|
-
*/
|
35
|
-
asset?: (
|
36
|
-
string |
|
37
|
-
Buffer |
|
38
|
-
object |
|
39
|
-
void
|
40
|
-
)
|
41
|
-
}
|
42
|
-
)
|
43
|
-
|
44
|
-
type Upload = (
|
45
|
-
this: File,
|
46
|
-
/**
|
47
|
-
* The file contents as Buffer.
|
48
|
-
*
|
49
|
-
* > Convert to a string using `content.toString()`
|
50
|
-
*/
|
51
|
-
content: Buffer
|
52
|
-
) => (
|
53
|
-
string |
|
54
|
-
Buffer |
|
55
|
-
void |
|
56
|
-
object
|
57
|
-
)
|
58
|
-
|
59
|
-
type Watch = (
|
60
|
-
this: File,
|
61
|
-
/**
|
62
|
-
* The file contents as Buffer.
|
63
|
-
*
|
64
|
-
* > Convert to a string using `content.toString()`
|
65
|
-
*/
|
66
|
-
content: Buffer
|
67
|
-
) => (
|
68
|
-
string |
|
69
|
-
Buffer |
|
70
|
-
void |
|
71
|
-
object
|
72
|
-
)
|
73
|
-
|
74
|
-
type Build = (
|
75
|
-
this: File,
|
76
|
-
/**
|
77
|
-
* The file contents as Buffer.
|
78
|
-
*
|
79
|
-
* > Convert to a string using `content.toString()`
|
80
|
-
*/
|
81
|
-
content: Buffer
|
82
|
-
) => (
|
83
|
-
string |
|
84
|
-
Buffer |
|
85
|
-
void |
|
86
|
-
object
|
87
|
-
)
|
88
|
-
|
89
|
-
export declare interface Resources {
|
90
|
-
/**
|
91
|
-
* Download
|
92
|
-
*
|
93
|
-
* Invoked for every asset that is downloaded from
|
94
|
-
* store theme. Use the `this` scope to access file
|
95
|
-
* information.
|
96
|
-
*/
|
97
|
-
download(callback: Download): void
|
98
|
-
/**
|
99
|
-
* Upload
|
100
|
-
*
|
101
|
-
* Invoked before each file is downloaded to the
|
102
|
-
* specified store theme. Use the `this` scope to
|
103
|
-
* access file information.
|
104
|
-
*/
|
105
|
-
upload(callback: Upload): void
|
106
|
-
/**
|
107
|
-
* Watch
|
108
|
-
*
|
109
|
-
* Invoked each time a file changes, after the transform
|
110
|
-
* operation has completed but before it uploaded
|
111
|
-
* to the specified store theme. Use the `this` scope to
|
112
|
-
* access file information.
|
113
|
-
*/
|
114
|
-
watch(callback: Watch): void
|
115
|
-
/**
|
116
|
-
* Build
|
117
|
-
*
|
118
|
-
* Invoked after transform operation has completed in build
|
119
|
-
* mode. Use the `this` scope to access file information.
|
120
|
-
*/
|
121
|
-
build(callback: Build): void
|
122
|
-
}
|
123
|
-
|
124
|
-
/**
|
125
|
-
* Syncify Utilities
|
126
|
-
*
|
127
|
-
* A couple of utilities which are helpful when working
|
128
|
-
* with external build tools or using Syncify within a script.
|
129
|
-
*/
|
130
|
-
export namespace utils {
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Conditional check of the current environment.
|
134
|
-
*/
|
135
|
-
export function env(env: 'dev' | 'prod'): boolean
|
136
|
-
|
137
|
-
/**
|
138
|
-
* Condition check of the current running resource.
|
139
|
-
*/
|
140
|
-
export function resource(resource: 'watch' | 'upload' | 'download'): boolean
|
141
|
-
|
142
|
-
}
|
143
|
-
|
144
|
-
/**
|
145
|
-
* **Syncify**
|
146
|
-
*
|
147
|
-
* The function returns a function with parameter
|
148
|
-
* Buffer value and a `this` holding file context.
|
149
|
-
* You can apply modifications to the file in pipeline by
|
150
|
-
* returning a type `string` or `Buffer`.
|
151
|
-
*
|
152
|
-
* If you return a `boolean` value `false` syncify will not
|
153
|
-
* process the file. An `undefined`, `void` or `true` return value
|
154
|
-
* will allow the file to pass through without modification.
|
155
|
-
* If the file extension is `.json` you can return an `object`.
|
156
|
-
*
|
157
|
-
* @example
|
158
|
-
*
|
159
|
-
* import syncify from '@liquify/syncify'
|
160
|
-
*
|
161
|
-
* // USING CURRY
|
162
|
-
*
|
163
|
-
* // Returns a function
|
164
|
-
* const watch = syncify('watch', {})
|
165
|
-
*
|
166
|
-
* // Hook into the transform
|
167
|
-
* watch(function (content){
|
168
|
-
*
|
169
|
-
* console.log(this) // Prints the file context to CLI
|
170
|
-
* console.log(content) // Buffer of the file
|
171
|
-
* console.log(content.toString()) // Convert the buffer to string
|
172
|
-
*
|
173
|
-
* // Update the content of the file
|
174
|
-
* return 'new value'
|
175
|
-
*
|
176
|
-
* })
|
177
|
-
*
|
178
|
-
* // USING INSTANCE
|
179
|
-
*
|
180
|
-
* // Create an instance
|
181
|
-
* const sync = syncify({})
|
182
|
-
*
|
183
|
-
* // Invoke watch mode
|
184
|
-
* sync.watch(function(content) {})
|
185
|
-
*
|
186
|
-
* // Invoke build mode
|
187
|
-
* sync.build(function(content) {})
|
188
|
-
*
|
189
|
-
* // Invoke download mode
|
190
|
-
* sync.download(function(content) {})
|
191
|
-
*
|
192
|
-
* // Invoke upload mode
|
193
|
-
* sync.upload(function(content) {})
|
194
|
-
*
|
195
|
-
* // ADDITIONAL METHODS
|
196
|
-
*
|
197
|
-
* syncify.clean()
|
198
|
-
* syncify.vsc()
|
199
|
-
* syncify.metafields()
|
200
|
-
* syncify.pages()
|
201
|
-
*/
|
202
|
-
export interface Syncify {
|
203
|
-
/**
|
204
|
-
* Download
|
205
|
-
*
|
206
|
-
* Invoked for every asset that is downloaded from
|
207
|
-
* store theme. Use the `this` scope to access file
|
208
|
-
* information.
|
209
|
-
*/
|
210
|
-
(resource: 'download', options?: PartialDeep<Config>): (callback: Download) => void
|
211
|
-
/**
|
212
|
-
* Upload
|
213
|
-
*
|
214
|
-
* Invoked before each file is downloaded to the
|
215
|
-
* specified store theme. Use the `this` scope to
|
216
|
-
* access file information.
|
217
|
-
*/
|
218
|
-
(resource: 'upload', options?: PartialDeep<Config>): (callback: Upload) => void
|
219
|
-
/**
|
220
|
-
* Watch
|
221
|
-
*
|
222
|
-
* Invoked each time a file changes, after the transform
|
223
|
-
* operation has completed but before it uploaded
|
224
|
-
* to the specified store theme. Use the `this` scope to
|
225
|
-
* access file information.
|
226
|
-
*/
|
227
|
-
(resource: 'watch', options?: PartialDeep<Config>): (callback: Watch) => void
|
228
|
-
/**
|
229
|
-
* Build
|
230
|
-
*
|
231
|
-
* Invoked after transform operation has completed in build
|
232
|
-
* mode. Use the `this` scope to access file information.
|
233
|
-
*/
|
234
|
-
(resource: 'build', options?: PartialDeep<Config>): (callback: Build) => void
|
235
|
-
/**
|
236
|
-
* Usage via instance
|
237
|
-
*
|
238
|
-
* **NOT YET AVAILABLE**
|
239
|
-
*/
|
240
|
-
(options?: PartialDeep<Config>): Resources
|
241
|
-
/**
|
242
|
-
* Theme resource
|
243
|
-
*
|
244
|
-
* **NOT YET AVAILABLE**
|
245
|
-
*/
|
246
|
-
themes: {
|
247
|
-
push(file: string, options?: any): Promise<any>;
|
248
|
-
pull(file: string, options?: any): Promise<any>;
|
249
|
-
merge(file: string, options?: any): Promise<any>;
|
250
|
-
delete(file: string, options?: any): Promise<any>;
|
251
|
-
query(file: string, options?: any): Promise<any>
|
252
|
-
};
|
253
|
-
/**
|
254
|
-
* Assets resource
|
255
|
-
*
|
256
|
-
* **NOT YET AVAILABLE**
|
257
|
-
*/
|
258
|
-
assets: {
|
259
|
-
push(file: string, options?: any): Promise<any>;
|
260
|
-
pull(file: string, options?: any): Promise<any>;
|
261
|
-
merge(file: string, options?: any): Promise<any>;
|
262
|
-
delete(file: string, options?: any): Promise<any>;
|
263
|
-
query(file: string, options?: any): Promise<any>
|
264
|
-
};
|
265
|
-
/**
|
266
|
-
* Files resource
|
267
|
-
*
|
268
|
-
* **NOT YET AVAILABLE**
|
269
|
-
*/
|
270
|
-
files: {
|
271
|
-
push(file: string, options?: any): Promise<any>;
|
272
|
-
pull(file: string, options?: any): Promise<any>;
|
273
|
-
merge(file: string, options?: any): Promise<any>;
|
274
|
-
delete(file: string, options?: any): Promise<any>;
|
275
|
-
query(file: string, options?: any): Promise<any>
|
276
|
-
};
|
277
|
-
/**
|
278
|
-
* Metafields resource
|
279
|
-
*
|
280
|
-
* **NOT YET AVAILABLE**
|
281
|
-
*/
|
282
|
-
metafields: {
|
283
|
-
push(file: string, options?: any): Promise<any>;
|
284
|
-
pull(file: string, options?: any): Promise<any>;
|
285
|
-
merge(file: string, options?: any): Promise<any>;
|
286
|
-
delete(file: string, options?: any): Promise<any>;
|
287
|
-
query(file: string, options?: any): Promise<any>
|
288
|
-
};
|
289
|
-
/**
|
290
|
-
* Pages resource
|
291
|
-
*
|
292
|
-
* **NOT YET AVAILABLE**
|
293
|
-
*/
|
294
|
-
pages: {
|
295
|
-
push(file: string, options?: any): Promise<any>;
|
296
|
-
pull(file: string, options?: any): Promise<any>;
|
297
|
-
merge(file: string, options?: any): Promise<any>;
|
298
|
-
delete(file: string, options?: any): Promise<any>;
|
299
|
-
query(file: string, options?: any): Promise<any>
|
300
|
-
};
|
301
|
-
/**
|
302
|
-
* Update the configuration
|
303
|
-
*
|
304
|
-
* **NOT YET AVAILABLE**
|
305
|
-
*/
|
306
|
-
config(options: Config): void
|
307
|
-
/**
|
308
|
-
* Clean the output directory
|
309
|
-
*
|
310
|
-
* **NOT YET AVAILABLE**
|
311
|
-
*/
|
312
|
-
clean(): Promise<void>
|
313
|
-
/**
|
314
|
-
* VS Code Schema Store generation
|
315
|
-
*
|
316
|
-
* **NOT YET AVAILABLE**
|
317
|
-
*/
|
318
|
-
vsc(): Promise<void>
|
319
|
-
}
|