rolldown 1.0.0-beta.8-commit.c76291c → 1.0.0-beta.8-commit.56abf23

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 (37) hide show
  1. package/dist/cli.cjs +9 -9
  2. package/dist/cli.mjs +8 -8
  3. package/dist/experimental-index.cjs +7 -3
  4. package/dist/experimental-index.d.cts +2 -2
  5. package/dist/experimental-index.d.mts +2 -2
  6. package/dist/experimental-index.mjs +5 -3
  7. package/dist/filter-index.cjs +93 -11
  8. package/dist/filter-index.d.cts +4 -3
  9. package/dist/filter-index.d.mts +4 -3
  10. package/dist/filter-index.mjs +44 -3
  11. package/dist/index.cjs +3 -3
  12. package/dist/index.d.cts +2 -2
  13. package/dist/index.d.mts +2 -2
  14. package/dist/index.mjs +3 -3
  15. package/dist/parallel-plugin-worker.cjs +5 -4
  16. package/dist/parallel-plugin-worker.mjs +5 -4
  17. package/dist/parallel-plugin.d.cts +2 -2
  18. package/dist/parallel-plugin.d.mts +2 -2
  19. package/dist/parse-ast-index.cjs +1 -1
  20. package/dist/parse-ast-index.d.cts +1 -1
  21. package/dist/parse-ast-index.d.mts +1 -1
  22. package/dist/parse-ast-index.mjs +1 -1
  23. package/dist/shared/{binding.d-BRwjFIld.d.cts → binding.d-Ddl7hcN3.d.cts} +2 -0
  24. package/dist/shared/{binding.d-DVNuaImz.d.mts → binding.d-Y-OUMnnv.d.mts} +2 -0
  25. package/dist/shared/{chunk-DUYDk_2O.mjs → chunk--iN_1bjD.mjs} +1 -1
  26. package/dist/shared/{input-options.d-CcrldgHK.d.cts → input-options.d-DVmWlHE9.d.cts} +3 -56
  27. package/dist/shared/{input-options.d-DVGWBVp4.d.mts → input-options.d-Dnzz-V9o.d.mts} +3 -56
  28. package/dist/shared/misc-BWx4LNta.cjs +68 -0
  29. package/dist/shared/misc-DGAe2XOW.mjs +28 -0
  30. package/dist/shared/{parse-ast-index-CHCsJTcD.mjs → parse-ast-index-BXDjUzKF.mjs} +4 -4
  31. package/dist/shared/{parse-ast-index-n6Ys2h9o.cjs → parse-ast-index-C37DYnt2.cjs} +7 -7
  32. package/dist/shared/{prompt-UMUDMApt.mjs → prompt-AXtOIn-r.mjs} +1 -1
  33. package/dist/shared/{src-_pefwDkF.cjs → src-RTReWFUn.cjs} +127 -119
  34. package/dist/shared/{src-DdLhlxoJ.mjs → src-TcTOaWt7.mjs} +127 -111
  35. package/package.json +16 -16
  36. package/dist/shared/filter-index-DblXSw9s.cjs +0 -255
  37. package/dist/shared/filter-index-hnEzlqRW.mjs +0 -174
@@ -1,255 +0,0 @@
1
- "use strict";
2
-
3
- //#region src/utils/misc.ts
4
- function arraify(value) {
5
- return Array.isArray(value) ? value : [value];
6
- }
7
- function isNullish(value) {
8
- return value === null || value === void 0;
9
- }
10
- function isPromiseLike(value) {
11
- return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
12
- }
13
- function unimplemented(info) {
14
- if (info) throw new Error(`unimplemented: ${info}`);
15
- throw new Error("unimplemented");
16
- }
17
- function unreachable(info) {
18
- if (info) throw new Error(`unreachable: ${info}`);
19
- throw new Error("unreachable");
20
- }
21
- function unsupported(info) {
22
- throw new Error(`UNSUPPORTED: ${info}`);
23
- }
24
- function noop(..._args) {}
25
-
26
- //#endregion
27
- //#region src/plugin/with-filter.ts
28
- function withFilterImpl(pluginOption, filterObjectList) {
29
- if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
30
- if (pluginOption == false || pluginOption == null) return pluginOption;
31
- if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
32
- let plugin = pluginOption;
33
- let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
34
- if (filterObjectIndex === -1) return plugin;
35
- let filterObject = filterObjectList[filterObjectIndex];
36
- Object.keys(plugin).forEach((key) => {
37
- switch (key) {
38
- case "transform":
39
- case "resolveId":
40
- case "load":
41
- if (!plugin[key]) return;
42
- if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
43
- else plugin[key] = {
44
- handler: plugin[key],
45
- filter: filterObject[key]
46
- };
47
- break;
48
- default: break;
49
- }
50
- });
51
- return plugin;
52
- }
53
- function withFilter(pluginOption, filterObject) {
54
- return withFilterImpl(pluginOption, arraify(filterObject));
55
- }
56
- function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
57
- if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
58
- for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
59
- let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
60
- if (typeof pattern === "string" && pattern === pluginName) return i;
61
- else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
62
- }
63
- return -1;
64
- }
65
-
66
- //#endregion
67
- //#region src/filter-index.ts
68
- var And = class {
69
- kind;
70
- args;
71
- constructor(...args) {
72
- if (args.length === 0) throw new Error("`And` expects at least one operand");
73
- this.args = args;
74
- this.kind = "and";
75
- }
76
- };
77
- var Or = class {
78
- kind;
79
- args;
80
- constructor(...args) {
81
- if (args.length === 0) throw new Error("`Or` expects at least one operand");
82
- this.args = args;
83
- this.kind = "or";
84
- }
85
- };
86
- var Not = class {
87
- kind;
88
- expr;
89
- constructor(expr) {
90
- this.expr = expr;
91
- this.kind = "not";
92
- }
93
- };
94
- var Id = class {
95
- kind;
96
- pattern;
97
- constructor(pattern) {
98
- this.pattern = pattern;
99
- this.kind = "id";
100
- }
101
- };
102
- var ModuleType = class {
103
- kind;
104
- pattern;
105
- constructor(pattern) {
106
- this.pattern = pattern;
107
- this.kind = "moduleType";
108
- }
109
- };
110
- var Code = class {
111
- kind;
112
- pattern;
113
- constructor(expr) {
114
- this.pattern = expr;
115
- this.kind = "code";
116
- }
117
- };
118
- var Include = class {
119
- kind;
120
- expr;
121
- constructor(expr) {
122
- this.expr = expr;
123
- this.kind = "include";
124
- }
125
- };
126
- var Exclude = class {
127
- kind;
128
- expr;
129
- constructor(expr) {
130
- this.expr = expr;
131
- this.kind = "exclude";
132
- }
133
- };
134
- function and(...args) {
135
- return new And(...args);
136
- }
137
- function or(...args) {
138
- return new Or(...args);
139
- }
140
- function not(expr) {
141
- return new Not(expr);
142
- }
143
- function id(pattern) {
144
- return new Id(pattern);
145
- }
146
- function moduleType(pattern) {
147
- return new ModuleType(pattern);
148
- }
149
- function code(pattern) {
150
- return new Code(pattern);
151
- }
152
- function include(expr) {
153
- return new Include(expr);
154
- }
155
- function exclude(expr) {
156
- return new Exclude(expr);
157
- }
158
-
159
- //#endregion
160
- Object.defineProperty(exports, 'And', {
161
- enumerable: true,
162
- get: function () {
163
- return And;
164
- }
165
- });
166
- Object.defineProperty(exports, 'and', {
167
- enumerable: true,
168
- get: function () {
169
- return and;
170
- }
171
- });
172
- Object.defineProperty(exports, 'arraify', {
173
- enumerable: true,
174
- get: function () {
175
- return arraify;
176
- }
177
- });
178
- Object.defineProperty(exports, 'code', {
179
- enumerable: true,
180
- get: function () {
181
- return code;
182
- }
183
- });
184
- Object.defineProperty(exports, 'exclude', {
185
- enumerable: true,
186
- get: function () {
187
- return exclude;
188
- }
189
- });
190
- Object.defineProperty(exports, 'id', {
191
- enumerable: true,
192
- get: function () {
193
- return id;
194
- }
195
- });
196
- Object.defineProperty(exports, 'include', {
197
- enumerable: true,
198
- get: function () {
199
- return include;
200
- }
201
- });
202
- Object.defineProperty(exports, 'isNullish', {
203
- enumerable: true,
204
- get: function () {
205
- return isNullish;
206
- }
207
- });
208
- Object.defineProperty(exports, 'moduleType', {
209
- enumerable: true,
210
- get: function () {
211
- return moduleType;
212
- }
213
- });
214
- Object.defineProperty(exports, 'noop', {
215
- enumerable: true,
216
- get: function () {
217
- return noop;
218
- }
219
- });
220
- Object.defineProperty(exports, 'not', {
221
- enumerable: true,
222
- get: function () {
223
- return not;
224
- }
225
- });
226
- Object.defineProperty(exports, 'or', {
227
- enumerable: true,
228
- get: function () {
229
- return or;
230
- }
231
- });
232
- Object.defineProperty(exports, 'unimplemented', {
233
- enumerable: true,
234
- get: function () {
235
- return unimplemented;
236
- }
237
- });
238
- Object.defineProperty(exports, 'unreachable', {
239
- enumerable: true,
240
- get: function () {
241
- return unreachable;
242
- }
243
- });
244
- Object.defineProperty(exports, 'unsupported', {
245
- enumerable: true,
246
- get: function () {
247
- return unsupported;
248
- }
249
- });
250
- Object.defineProperty(exports, 'withFilter', {
251
- enumerable: true,
252
- get: function () {
253
- return withFilter;
254
- }
255
- });
@@ -1,174 +0,0 @@
1
- import { __esm } from "./chunk-DUYDk_2O.mjs";
2
-
3
- //#region src/utils/misc.ts
4
- function arraify(value) {
5
- return Array.isArray(value) ? value : [value];
6
- }
7
- function isNullish(value) {
8
- return value === null || value === void 0;
9
- }
10
- function isPromiseLike(value) {
11
- return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
12
- }
13
- function unimplemented(info) {
14
- if (info) throw new Error(`unimplemented: ${info}`);
15
- throw new Error("unimplemented");
16
- }
17
- function unreachable(info) {
18
- if (info) throw new Error(`unreachable: ${info}`);
19
- throw new Error("unreachable");
20
- }
21
- function unsupported(info) {
22
- throw new Error(`UNSUPPORTED: ${info}`);
23
- }
24
- function noop(..._args) {}
25
- var init_misc = __esm({ "src/utils/misc.ts"() {} });
26
-
27
- //#endregion
28
- //#region src/plugin/with-filter.ts
29
- function withFilterImpl(pluginOption, filterObjectList) {
30
- if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
31
- if (pluginOption == false || pluginOption == null) return pluginOption;
32
- if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
33
- let plugin = pluginOption;
34
- let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
35
- if (filterObjectIndex === -1) return plugin;
36
- let filterObject = filterObjectList[filterObjectIndex];
37
- Object.keys(plugin).forEach((key) => {
38
- switch (key) {
39
- case "transform":
40
- case "resolveId":
41
- case "load":
42
- if (!plugin[key]) return;
43
- if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
44
- else plugin[key] = {
45
- handler: plugin[key],
46
- filter: filterObject[key]
47
- };
48
- break;
49
- default: break;
50
- }
51
- });
52
- return plugin;
53
- }
54
- function withFilter(pluginOption, filterObject) {
55
- return withFilterImpl(pluginOption, arraify(filterObject));
56
- }
57
- function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
58
- if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
59
- for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
60
- let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
61
- if (typeof pattern === "string" && pattern === pluginName) return i;
62
- else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
63
- }
64
- return -1;
65
- }
66
- var init_with_filter = __esm({ "src/plugin/with-filter.ts"() {
67
- init_misc();
68
- } });
69
-
70
- //#endregion
71
- //#region src/plugin/index.ts
72
- var init_plugin = __esm({ "src/plugin/index.ts"() {
73
- init_with_filter();
74
- } });
75
-
76
- //#endregion
77
- //#region src/filter-index.ts
78
- function and(...args) {
79
- return new And(...args);
80
- }
81
- function or(...args) {
82
- return new Or(...args);
83
- }
84
- function not(expr) {
85
- return new Not(expr);
86
- }
87
- function id(pattern) {
88
- return new Id(pattern);
89
- }
90
- function moduleType(pattern) {
91
- return new ModuleType(pattern);
92
- }
93
- function code(pattern) {
94
- return new Code(pattern);
95
- }
96
- function include(expr) {
97
- return new Include(expr);
98
- }
99
- function exclude(expr) {
100
- return new Exclude(expr);
101
- }
102
- var And, Or, Not, Id, ModuleType, Code, Include, Exclude;
103
- var init_filter_index = __esm({ "src/filter-index.ts"() {
104
- init_plugin();
105
- And = class {
106
- kind;
107
- args;
108
- constructor(...args) {
109
- if (args.length === 0) throw new Error("`And` expects at least one operand");
110
- this.args = args;
111
- this.kind = "and";
112
- }
113
- };
114
- Or = class {
115
- kind;
116
- args;
117
- constructor(...args) {
118
- if (args.length === 0) throw new Error("`Or` expects at least one operand");
119
- this.args = args;
120
- this.kind = "or";
121
- }
122
- };
123
- Not = class {
124
- kind;
125
- expr;
126
- constructor(expr) {
127
- this.expr = expr;
128
- this.kind = "not";
129
- }
130
- };
131
- Id = class {
132
- kind;
133
- pattern;
134
- constructor(pattern) {
135
- this.pattern = pattern;
136
- this.kind = "id";
137
- }
138
- };
139
- ModuleType = class {
140
- kind;
141
- pattern;
142
- constructor(pattern) {
143
- this.pattern = pattern;
144
- this.kind = "moduleType";
145
- }
146
- };
147
- Code = class {
148
- kind;
149
- pattern;
150
- constructor(expr) {
151
- this.pattern = expr;
152
- this.kind = "code";
153
- }
154
- };
155
- Include = class {
156
- kind;
157
- expr;
158
- constructor(expr) {
159
- this.expr = expr;
160
- this.kind = "include";
161
- }
162
- };
163
- Exclude = class {
164
- kind;
165
- expr;
166
- constructor(expr) {
167
- this.expr = expr;
168
- this.kind = "exclude";
169
- }
170
- };
171
- } });
172
-
173
- //#endregion
174
- export { And, and, arraify, code, exclude, id, include, init_filter_index, init_misc, isNullish, moduleType, noop, not, or, unimplemented, unreachable, unsupported, withFilter };