@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,219 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
-
3
- import type { LiteralUnion, Merge } from 'type-fest';
4
- import type { Tester } from 'anymatch';
5
- import type { Config as TailwindConfig } from 'tailwindcss';
6
- import type { Plugin as PostCSSPlugin, Transformer, TransformCallback } from 'postcss';
7
- import type { GetProcessorConfigs, RenamePaths } from '../internal/shared';
8
-
9
- /* -------------------------------------------- */
10
- /* PROCESSOR CONFIGS */
11
- /* -------------------------------------------- */
12
-
13
- export type PostCSSConfig = (
14
- | PostCSSPlugin
15
- | Transformer
16
- | TransformCallback
17
- );
18
-
19
- export interface TailwindCSSConfig {
20
- important: TailwindConfig['important'];
21
- prefix: TailwindConfig['PrefixConfig'];
22
- separator: TailwindConfig['SeparatorConfig'];
23
- safelist: TailwindConfig['SafelistConfig'];
24
- blocklist: TailwindConfig['BlocklistConfig'];
25
- presets: TailwindConfig['presets'];
26
- future: TailwindConfig['future'];
27
- experimental: TailwindConfig['experimental'];
28
- darkMode: TailwindConfig['darkMode'];
29
- theme: TailwindConfig['theme'];
30
- corePlugins: TailwindConfig['corePlugins'];
31
- plugins: TailwindConfig['plugins'];
32
- }
33
-
34
- export interface SASSConfig {
35
- /**
36
- * Whether or not to generate sourcemaps
37
- *
38
- * @default true
39
- */
40
- sourcemap?: boolean;
41
- /**
42
- * The style compiled CSS should be output.
43
- *
44
- * @default 'compressed'
45
- */
46
- style?: 'expanded' | 'compressed';
47
- /**
48
- * Whether or not to print warnings to CLI - Warnings will require
49
- * an `stdin` invocation to view. Setting this to `false` will hide
50
- * warnings all together.
51
- *
52
- * @default true
53
- */
54
- warnings?: boolean;
55
- /**
56
- * A list of paths to include, ie: node_modules.
57
- *
58
- * @default ['node_modules']
59
- */
60
- include?: string[];
61
- }
62
-
63
- /* -------------------------------------------- */
64
- /* TRANSFORM */
65
- /* -------------------------------------------- */
66
-
67
- export interface StyleTransform {
68
- /**
69
- * SVG input source paths. Accepts `string` or `string[]` glob patterns.
70
- * Resolution is relative to your defined `input` directory.
71
- *
72
- * @default undefined
73
- */
74
- input: string | string[];
75
- /**
76
- * Glob stylesheet paths/files to watch. When changes
77
- * are applied to matched files, then the defined `input`
78
- * will be compiled.
79
- *
80
- * @default []
81
- */
82
- watch?: string[];
83
- /**
84
- * Rename the stylesheet file/s. The same name as source file will be used
85
- * when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
86
- *
87
- * ---
88
- *
89
- * @default undefined
90
- */
91
- rename?: string;
92
- /**
93
- * Optionally output the CSS as a snippet. This will transform
94
- * the stylesheet inline, wrap output within `<style></style>`
95
- * tags and write it to `snippets`.
96
- *
97
- * @default false
98
- */
99
- snippet?: boolean;
100
- /**
101
- * **NOT YET AVAILABLE**
102
- *
103
- * [TailwindCSS](https://tailwindcss.com/) Override
104
- *
105
- * Tailwind transforms will use the `tailwind.config.js` configuration
106
- * file in your projects root (or defined `config` path). If you have not
107
- * provided a tailwind config file, then syncify will use options defined
108
- * via `processor.tailwind`. You can optionally override configuration
109
- * on a per-transform basis and any options defined here will be merged with
110
- * those defined in your `tailwind.config.js` or `processor.tailwind`.
111
- *
112
- * @default true // if tailwind is not installed this is false
113
- */
114
- tailwind?: boolean | TailwindCSSConfig;
115
- /**
116
- * [PostCSS](https://postcss.org/) Override
117
- *
118
- * CSS File transforms will use the options provided to `processor.postcss`
119
- * but you can optionally override those defaults on a per-transform
120
- * basis. Any configuration options defined here will be merged with
121
- * the options defined in `processor.postcss`.
122
- *
123
- * You can also skip pre-processing with postcss by passing a _boolean_
124
- * `false` which will inform Syncify to not pass output to PostCSS. By
125
- * default, Syncify will pass all compiled SASS and files with `.css`
126
- * extensions to PostCSS.
127
- *
128
- * @default true // if postcss is not installed this is false
129
- */
130
- postcss?: boolean | PostCSSConfig[];
131
- /**
132
- * [SASS Dart](https://sass-lang.com/documentation/js-api/) Override
133
- *
134
- * SASS File transforms will use the options provided to `processor.sass`
135
- * but you can optionally override those defaults on a per-transform
136
- * basis. Any configuration options defined here will be merged with
137
- * the options defined in `processor.sass`.
138
- *
139
- * You can also skip SASS transfroms by passing a _boolean_ `false` which will
140
- * inform Syncify to not pass output to SASS, which is the default if SASS is not
141
- * installed.
142
- *
143
- * By default, Syncify will forward all input files using `.scss` or `.sass`
144
- * or extension to SASS Dart. If you have PostCSS installed then Syncify will
145
- * automatically pass SASS files to PostCSS in the post-process.
146
- *
147
- * @default true // if sass is not installed this is false
148
- */
149
- sass?: boolean | SASSConfig;
150
- }
151
-
152
- /* -------------------------------------------- */
153
- /* TRANSFORMER */
154
- /* -------------------------------------------- */
155
-
156
- export type StyleTransformer = (
157
- | string
158
- | string[]
159
- | StyleTransform
160
- | StyleTransform[]
161
- | {
162
- [K in RenamePaths]: (
163
- | string
164
- | string[]
165
- | Pick<StyleTransform,
166
- | 'postcss'
167
- | 'sass'
168
- | 'snippet'
169
- | 'watch'
170
- | 'input'
171
- >
172
- )
173
- }
174
- )
175
-
176
- /* -------------------------------------------- */
177
- /* INTERNAL USE */
178
- /* -------------------------------------------- */
179
-
180
- /**
181
- * **INTERNAL USE**
182
- *
183
- * PostCSS Processor Configuration
184
- */
185
- export type PostCSSProcesser = GetProcessorConfigs<PostCSSConfig[]>;
186
-
187
- /**
188
- * **INTERNAL USE**
189
- *
190
- * Tailwind Processor Configuration
191
- */
192
- export type TailwindCSSProcesser = GetProcessorConfigs<TailwindCSSConfig>
193
-
194
- /**
195
- * **INTERNAL USE**
196
- *
197
- * SASS Processor Configuration
198
- */
199
- export type SASSProcesser = GetProcessorConfigs<SASSConfig>
200
-
201
- /**
202
- * **INTERNAL USE**
203
- *
204
- * Bundling Configuration
205
- */
206
- export type StyleBundle = Merge<StyleTransform, {
207
- /**
208
- * A UUID reference for this bundle.
209
- */
210
- uuid: string;
211
- /**
212
- * Resolved input path
213
- */
214
- input: string;
215
- /**
216
- * Anymatch function
217
- */
218
- watch: Tester;
219
- }>;
@@ -1,189 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
-
3
- import type { LiteralUnion, Merge } from 'type-fest';
4
- import type { Tester } from 'anymatch';
5
- import type { Config as SVGOConfig } from 'svgo';
6
- import type { Config as SVGSpriteConfig } from 'svg-sprite';
7
- import type { GetProcessorConfigs, RenamePaths } from '../internal/shared';
8
-
9
- /* -------------------------------------------- */
10
- /* PROCESSOR CONFIGS */
11
- /* -------------------------------------------- */
12
-
13
- export { SVGOConfig, SVGSpriteConfig };
14
-
15
- /* -------------------------------------------- */
16
- /* SHARED */
17
- /* -------------------------------------------- */
18
-
19
- interface SVGShared<T extends 'file' | 'sprite'> {
20
- /**
21
- * SVG input source paths. Accepts `string` or `string[]` glob patterns.
22
- * Resolution is relative to your defined `input` directory.
23
- *
24
- * @default ''
25
- */
26
- input: string | string[];
27
- /**
28
- * Rename the svg file/s. The same name as source file will be used
29
- * when undefined. Accepts namespaces, `[file]`, `[dir]` and `[ext]`.
30
- * ---
31
- *
32
- * @default undefined
33
- *
34
- * @example
35
- * 'source/svgs/arrow.svg' > 'arrow.svg' // if snippet is false
36
- * 'source/svgs/checkmark.svg' > 'checkmark.liquid' // if snippet is true
37
- */
38
- rename?: string;
39
- /**
40
- * Whether to generate svg as snippet or asset. When `true` the
41
- * svg source will be written as a snippet
42
- *
43
- * @default false
44
- */
45
- snippet?: boolean;
46
- /**
47
- * The SVG export format. Syncify can produce 2 different SVG formats:
48
- *
49
- * You can omit this option when you have only 1 pre-processor installed or
50
- * if you are applying a per-transfrom configuration override as it will default
51
- * to the format which the inferred pre-processor produces. If you are using
52
- * both the supported processors ([SVGO](https://github.com/svg/svgo) &
53
- * [SVG Sprite](https://github.com/svg-sprite)) then you will need
54
- * to inform Syncify on which format it should produce.
55
- *
56
- * ---
57
- *
58
- * **File Format**
59
- *
60
- * _SVG transforms using a `file` format require SVGO to be installed. File
61
- * formats will produce individual `.svg` files from that can be output as
62
- * an`asset` or inlined into a `snippet`_
63
- *
64
- * ---
65
- *
66
- * **Sprite Format**
67
- *
68
- * _SVG transforms using a `sprite` format require SVG Sprite to be installed.
69
- * Sprite formats will produce an SVG Sprite that can be output as an `asset`
70
- * or inlined into a `snippet`_
71
- *
72
- * ---
73
- *
74
- * @default
75
- * undefined // When no SVG pre-processor is installed
76
- * null // When both SVGO and SVG Sprite are installed (required)
77
- * 'file' // When SVGO is the only processor installed
78
- * 'sprite' // When SVG Sprite is the only processor installed
79
- */
80
- format?: LiteralUnion<T, string>;
81
- }
82
-
83
- export interface SVGFile extends SVGShared<'file'> {
84
- /**
85
- * [SVGO](https://github.com/svg/svgo) Override
86
- *
87
- * SVG File transforms will use the options provided to `processor.svgo`
88
- * but you can optionally override those defaults on a per-transform
89
- * basis. Any configuration options defined here will be merged with
90
- * the options defined in `processor.svgo`.
91
- *
92
- * @default
93
- * processor.svgo // When processor configuration is defined
94
- */
95
- svgo?: SVGOConfig
96
- }
97
-
98
- export interface SVGSprite extends SVGShared<'sprite'> {
99
- /**
100
- * [SVG Sprite](https://github.com/svg-sprite) Override
101
- *
102
- * SVG Sprite transforms will use the options provided to `processor.sprite`
103
- * but you can optionally override those defaults on a per-transform
104
- * basis. Any configuration options defined here will be merged with
105
- * the options defined in `processor.sprite`.
106
- *
107
- * @default
108
- * processor.sprite // When processor configuration is defined
109
- */
110
- sprite?: SVGSpriteConfig
111
- }
112
-
113
- /* -------------------------------------------- */
114
- /* TRANSFORM */
115
- /* -------------------------------------------- */
116
-
117
- /**
118
- * SVG processing transforms
119
- */
120
- export type SVGTransform = (
121
- | SVGFile
122
- | SVGSprite
123
- )
124
-
125
- /* -------------------------------------------- */
126
- /* TRANSFORMER */
127
- /* -------------------------------------------- */
128
-
129
- export type SVGTransformer = (
130
- | string
131
- | string[]
132
- | SVGTransform
133
- | SVGTransform[]
134
- | {
135
- [K in RenamePaths]: (
136
- | string
137
- | string[]
138
- | Pick<SVGFile, 'format' | 'input' | 'snippet' | 'svgo'>
139
- | Pick<SVGSprite, 'format'| 'input'| 'snippet' | 'sprite'>
140
- )
141
- }
142
- )
143
-
144
- /* -------------------------------------------- */
145
- /* INTERAL USE */
146
- /* -------------------------------------------- */
147
-
148
- /**
149
- * **INTERNAL USE**
150
- *
151
- * Processor Configuration
152
- */
153
- export type SVGOProcesser = GetProcessorConfigs<SVGOConfig>
154
-
155
- /**
156
- * **INTERNAL USE**
157
- *
158
- * Processor Configuration
159
- */
160
- export type SVGSpriteProcesser = GetProcessorConfigs<SVGSpriteConfig>
161
-
162
- /**
163
- * **INTERNAL USE**
164
- *
165
- * Bundling Configuration
166
- */
167
- export type SVGBundle = Merge<SVGTransform, {
168
- /**
169
- * A UUID reference for this bundle.
170
- */
171
- uuid: string;
172
- /**
173
- * Resolved input paths (paths are expanded)
174
- */
175
- input: Set<string>;
176
- /**
177
- * File matching, used to determine when new files are
178
- * added to an `input` defined path/directory.
179
- */
180
- match: Tester;
181
- /**
182
- * SVGO Override
183
- */
184
- svgo?: true | SVGOConfig;
185
- /**
186
- * SVG Sprite Override
187
- */
188
- sprite?: true | SVGSpriteConfig;
189
- }>;