@rsbuild/core 1.3.4 → 1.3.6

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 (48) hide show
  1. package/compiled/chokidar/index.d.ts +2 -1
  2. package/compiled/css-loader/index.js +18 -18
  3. package/compiled/html-rspack-plugin/index.js +14 -14
  4. package/compiled/http-proxy-middleware/index.d.ts +3 -2
  5. package/compiled/postcss/lib/at-rule.d.ts +140 -0
  6. package/compiled/postcss/lib/comment.d.ts +68 -0
  7. package/compiled/postcss/lib/container.d.ts +480 -0
  8. package/compiled/postcss/lib/css-syntax-error.d.ts +248 -0
  9. package/compiled/postcss/lib/declaration.d.ts +151 -0
  10. package/compiled/postcss/lib/document.d.ts +69 -0
  11. package/compiled/postcss/lib/fromJSON.d.ts +9 -0
  12. package/compiled/postcss/lib/input.d.ts +206 -0
  13. package/compiled/postcss/lib/lazy-result.d.ts +190 -0
  14. package/compiled/postcss/lib/list.d.ts +60 -0
  15. package/compiled/postcss/lib/no-work-result.d.ts +46 -0
  16. package/compiled/postcss/lib/node.d.ts +541 -0
  17. package/compiled/postcss/lib/parse.d.ts +9 -0
  18. package/compiled/postcss/lib/postcss.d.ts +458 -0
  19. package/compiled/postcss/lib/previous-map.d.ts +81 -0
  20. package/compiled/postcss/lib/processor.d.ts +115 -0
  21. package/compiled/postcss/lib/result.d.ts +205 -0
  22. package/compiled/postcss/lib/root.d.ts +87 -0
  23. package/compiled/postcss/lib/rule.d.ts +126 -0
  24. package/compiled/postcss/lib/stringifier.d.ts +46 -0
  25. package/compiled/postcss/lib/stringify.d.ts +9 -0
  26. package/compiled/postcss/lib/warning.d.ts +147 -0
  27. package/compiled/postcss/package.json +1 -1
  28. package/compiled/postcss-loader/index.js +6 -6
  29. package/compiled/rslog/index.d.ts +2 -1
  30. package/compiled/rspack-chain/index.js +66 -66
  31. package/compiled/rspack-chain/package.json +1 -1
  32. package/compiled/rspack-chain/{index.d.ts → types/index.d.ts} +18 -2
  33. package/compiled/rspack-manifest-plugin/index.d.ts +2 -1
  34. package/compiled/rspack-manifest-plugin/index.js +4 -4
  35. package/compiled/tinyglobby/index.d.ts +2 -1
  36. package/dist/index.cjs +92 -51
  37. package/dist/index.js +90 -50
  38. package/dist-types/configChain.d.ts +1 -1
  39. package/dist-types/helpers/exitHook.d.ts +3 -0
  40. package/dist-types/helpers/index.d.ts +1 -1
  41. package/dist-types/types/config.d.ts +2 -3
  42. package/dist-types/types/hooks.d.ts +6 -2
  43. package/dist-types/types/plugin.d.ts +1 -1
  44. package/dist-types/types/rspack.d.ts +1 -1
  45. package/dist-types/types/thirdParty.d.ts +2 -2
  46. package/package.json +6 -6
  47. package/types.d.ts +8 -8
  48. package/compiled/postcss/index.d.ts +0 -1
@@ -0,0 +1,190 @@
1
+ import Document from './document.js'
2
+ import { SourceMap } from './postcss.js'
3
+ import Processor from './processor.js'
4
+ import Result, { Message, ResultOptions } from './result.js'
5
+ import Root from './root.js'
6
+ import Warning from './warning.js'
7
+
8
+ declare namespace LazyResult {
9
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
10
+ export { LazyResult_ as default }
11
+ }
12
+
13
+ /**
14
+ * A Promise proxy for the result of PostCSS transformations.
15
+ *
16
+ * A `LazyResult` instance is returned by `Processor#process`.
17
+ *
18
+ * ```js
19
+ * const lazy = postcss([autoprefixer]).process(css)
20
+ * ```
21
+ */
22
+ declare class LazyResult_<RootNode = Document | Root>
23
+ implements PromiseLike<Result<RootNode>>
24
+ {
25
+ /**
26
+ * Processes input CSS through synchronous and asynchronous plugins
27
+ * and calls onRejected for each error thrown in any plugin.
28
+ *
29
+ * It implements standard Promise API.
30
+ *
31
+ * ```js
32
+ * postcss([autoprefixer]).process(css).then(result => {
33
+ * console.log(result.css)
34
+ * }).catch(error => {
35
+ * console.error(error)
36
+ * })
37
+ * ```
38
+ */
39
+ catch: Promise<Result<RootNode>>['catch']
40
+
41
+ /**
42
+ * Processes input CSS through synchronous and asynchronous plugins
43
+ * and calls onFinally on any error or when all plugins will finish work.
44
+ *
45
+ * It implements standard Promise API.
46
+ *
47
+ * ```js
48
+ * postcss([autoprefixer]).process(css).finally(() => {
49
+ * console.log('processing ended')
50
+ * })
51
+ * ```
52
+ */
53
+ finally: Promise<Result<RootNode>>['finally']
54
+
55
+ /**
56
+ * Processes input CSS through synchronous and asynchronous plugins
57
+ * and calls `onFulfilled` with a Result instance. If a plugin throws
58
+ * an error, the `onRejected` callback will be executed.
59
+ *
60
+ * It implements standard Promise API.
61
+ *
62
+ * ```js
63
+ * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => {
64
+ * console.log(result.css)
65
+ * })
66
+ * ```
67
+ */
68
+ then: Promise<Result<RootNode>>['then']
69
+
70
+ /**
71
+ * An alias for the `css` property. Use it with syntaxes
72
+ * that generate non-CSS output.
73
+ *
74
+ * This property will only work with synchronous plugins.
75
+ * If the processor contains any asynchronous plugins
76
+ * it will throw an error.
77
+ *
78
+ * PostCSS runners should always use `LazyResult#then`.
79
+ */
80
+ get content(): string
81
+
82
+ /**
83
+ * Processes input CSS through synchronous plugins, converts `Root`
84
+ * to a CSS string and returns `Result#css`.
85
+ *
86
+ * This property will only work with synchronous plugins.
87
+ * If the processor contains any asynchronous plugins
88
+ * it will throw an error.
89
+ *
90
+ * PostCSS runners should always use `LazyResult#then`.
91
+ */
92
+ get css(): string
93
+
94
+ /**
95
+ * Processes input CSS through synchronous plugins
96
+ * and returns `Result#map`.
97
+ *
98
+ * This property will only work with synchronous plugins.
99
+ * If the processor contains any asynchronous plugins
100
+ * it will throw an error.
101
+ *
102
+ * PostCSS runners should always use `LazyResult#then`.
103
+ */
104
+ get map(): SourceMap
105
+
106
+ /**
107
+ * Processes input CSS through synchronous plugins
108
+ * and returns `Result#messages`.
109
+ *
110
+ * This property will only work with synchronous plugins. If the processor
111
+ * contains any asynchronous plugins it will throw an error.
112
+ *
113
+ * PostCSS runners should always use `LazyResult#then`.
114
+ */
115
+ get messages(): Message[]
116
+
117
+ /**
118
+ * Options from the `Processor#process` call.
119
+ */
120
+ get opts(): ResultOptions
121
+
122
+ /**
123
+ * Returns a `Processor` instance, which will be used
124
+ * for CSS transformations.
125
+ */
126
+ get processor(): Processor
127
+
128
+ /**
129
+ * Processes input CSS through synchronous plugins
130
+ * and returns `Result#root`.
131
+ *
132
+ * This property will only work with synchronous plugins. If the processor
133
+ * contains any asynchronous plugins it will throw an error.
134
+ *
135
+ * PostCSS runners should always use `LazyResult#then`.
136
+ */
137
+ get root(): RootNode
138
+
139
+ /**
140
+ * Returns the default string description of an object.
141
+ * Required to implement the Promise interface.
142
+ */
143
+ get [Symbol.toStringTag](): string
144
+
145
+ /**
146
+ * @param processor Processor used for this transformation.
147
+ * @param css CSS to parse and transform.
148
+ * @param opts Options from the `Processor#process` or `Root#toResult`.
149
+ */
150
+ constructor(processor: Processor, css: string, opts: ResultOptions)
151
+
152
+ /**
153
+ * Run plugin in async way and return `Result`.
154
+ *
155
+ * @return Result with output content.
156
+ */
157
+ async(): Promise<Result<RootNode>>
158
+
159
+ /**
160
+ * Run plugin in sync way and return `Result`.
161
+ *
162
+ * @return Result with output content.
163
+ */
164
+ sync(): Result<RootNode>
165
+
166
+ /**
167
+ * Alias for the `LazyResult#css` property.
168
+ *
169
+ * ```js
170
+ * lazy + '' === lazy.css
171
+ * ```
172
+ *
173
+ * @return Output CSS.
174
+ */
175
+ toString(): string
176
+
177
+ /**
178
+ * Processes input CSS through synchronous plugins
179
+ * and calls `Result#warnings`.
180
+ *
181
+ * @return Warnings from plugins.
182
+ */
183
+ warnings(): Warning[]
184
+ }
185
+
186
+ declare class LazyResult<
187
+ RootNode = Document | Root
188
+ > extends LazyResult_<RootNode> {}
189
+
190
+ export = LazyResult
@@ -0,0 +1,60 @@
1
+ declare namespace list {
2
+ type List = {
3
+ /**
4
+ * Safely splits comma-separated values (such as those for `transition-*`
5
+ * and `background` properties).
6
+ *
7
+ * ```js
8
+ * Once (root, { list }) {
9
+ * list.comma('black, linear-gradient(white, black)')
10
+ * //=> ['black', 'linear-gradient(white, black)']
11
+ * }
12
+ * ```
13
+ *
14
+ * @param str Comma-separated values.
15
+ * @return Split values.
16
+ */
17
+ comma(str: string): string[]
18
+
19
+ default: List
20
+
21
+ /**
22
+ * Safely splits space-separated values (such as those for `background`,
23
+ * `border-radius`, and other shorthand properties).
24
+ *
25
+ * ```js
26
+ * Once (root, { list }) {
27
+ * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
28
+ * }
29
+ * ```
30
+ *
31
+ * @param str Space-separated values.
32
+ * @return Split values.
33
+ */
34
+ space(str: string): string[]
35
+
36
+ /**
37
+ * Safely splits values.
38
+ *
39
+ * ```js
40
+ * Once (root, { list }) {
41
+ * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)']
42
+ * }
43
+ * ```
44
+ *
45
+ * @param string separated values.
46
+ * @param separators array of separators.
47
+ * @param last boolean indicator.
48
+ * @return Split values.
49
+ */
50
+ split(
51
+ string: string,
52
+ separators: readonly string[],
53
+ last: boolean
54
+ ): string[]
55
+ }
56
+ }
57
+
58
+ declare const list: list.List
59
+
60
+ export = list
@@ -0,0 +1,46 @@
1
+ import LazyResult from './lazy-result.js'
2
+ import { SourceMap } from './postcss.js'
3
+ import Processor from './processor.js'
4
+ import Result, { Message, ResultOptions } from './result.js'
5
+ import Root from './root.js'
6
+ import Warning from './warning.js'
7
+
8
+ declare namespace NoWorkResult {
9
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
10
+ export { NoWorkResult_ as default }
11
+ }
12
+
13
+ /**
14
+ * A Promise proxy for the result of PostCSS transformations.
15
+ * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root`
16
+ * are accessed. See the example below for details.
17
+ * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined.
18
+ *
19
+ * ```js
20
+ * const noWorkResult = postcss().process(css) // No plugins are defined.
21
+ * // CSS is not parsed
22
+ * let root = noWorkResult.root // now css is parsed because we accessed the root
23
+ * ```
24
+ */
25
+ declare class NoWorkResult_ implements LazyResult<Root> {
26
+ catch: Promise<Result<Root>>['catch']
27
+ finally: Promise<Result<Root>>['finally']
28
+ then: Promise<Result<Root>>['then']
29
+ get content(): string
30
+ get css(): string
31
+ get map(): SourceMap
32
+ get messages(): Message[]
33
+ get opts(): ResultOptions
34
+ get processor(): Processor
35
+ get root(): Root
36
+ get [Symbol.toStringTag](): string
37
+ constructor(processor: Processor, css: string, opts: ResultOptions)
38
+ async(): Promise<Result<Root>>
39
+ sync(): Result<Root>
40
+ toString(): string
41
+ warnings(): Warning[]
42
+ }
43
+
44
+ declare class NoWorkResult extends NoWorkResult_ {}
45
+
46
+ export = NoWorkResult