@lynx-js/react-alias-rsbuild-plugin 0.10.8 → 0.10.10
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/CHANGELOG.md +8 -0
- package/dist/index.js +378 -4
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,374 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import node_path from "node:path";
|
|
3
|
+
var __webpack_modules__ = {
|
|
4
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
5
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js");
|
|
6
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js");
|
|
7
|
+
const { safeRe: re, t } = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js");
|
|
8
|
+
const parseOptions = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js");
|
|
9
|
+
const { compareIdentifiers } = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js");
|
|
10
|
+
class SemVer {
|
|
11
|
+
constructor(version, options){
|
|
12
|
+
options = parseOptions(options);
|
|
13
|
+
if (version instanceof SemVer) if (!!options.loose === version.loose && !!options.includePrerelease === version.includePrerelease) return version;
|
|
14
|
+
else version = version.version;
|
|
15
|
+
else if ('string' != typeof version) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
16
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
17
|
+
debug('SemVer', version, options);
|
|
18
|
+
this.options = options;
|
|
19
|
+
this.loose = !!options.loose;
|
|
20
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
21
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
22
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
23
|
+
this.raw = version;
|
|
24
|
+
this.major = +m[1];
|
|
25
|
+
this.minor = +m[2];
|
|
26
|
+
this.patch = +m[3];
|
|
27
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version');
|
|
28
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version');
|
|
29
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version');
|
|
30
|
+
if (m[4]) this.prerelease = m[4].split('.').map((id)=>{
|
|
31
|
+
if (/^[0-9]+$/.test(id)) {
|
|
32
|
+
const num = +id;
|
|
33
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
34
|
+
}
|
|
35
|
+
return id;
|
|
36
|
+
});
|
|
37
|
+
else this.prerelease = [];
|
|
38
|
+
this.build = m[5] ? m[5].split('.') : [];
|
|
39
|
+
this.format();
|
|
40
|
+
}
|
|
41
|
+
format() {
|
|
42
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
43
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join('.')}`;
|
|
44
|
+
return this.version;
|
|
45
|
+
}
|
|
46
|
+
toString() {
|
|
47
|
+
return this.version;
|
|
48
|
+
}
|
|
49
|
+
compare(other) {
|
|
50
|
+
debug('SemVer.compare', this.version, this.options, other);
|
|
51
|
+
if (!(other instanceof SemVer)) {
|
|
52
|
+
if ('string' == typeof other && other === this.version) return 0;
|
|
53
|
+
other = new SemVer(other, this.options);
|
|
54
|
+
}
|
|
55
|
+
if (other.version === this.version) return 0;
|
|
56
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
57
|
+
}
|
|
58
|
+
compareMain(other) {
|
|
59
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
60
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
61
|
+
}
|
|
62
|
+
comparePre(other) {
|
|
63
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
64
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
65
|
+
if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
66
|
+
if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
67
|
+
let i = 0;
|
|
68
|
+
do {
|
|
69
|
+
const a = this.prerelease[i];
|
|
70
|
+
const b = other.prerelease[i];
|
|
71
|
+
debug('prerelease compare', i, a, b);
|
|
72
|
+
if (void 0 === a && void 0 === b) return 0;
|
|
73
|
+
if (void 0 === b) return 1;
|
|
74
|
+
if (void 0 === a) return -1;
|
|
75
|
+
else if (a === b) continue;
|
|
76
|
+
else return compareIdentifiers(a, b);
|
|
77
|
+
}while (++i);
|
|
78
|
+
}
|
|
79
|
+
compareBuild(other) {
|
|
80
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
81
|
+
let i = 0;
|
|
82
|
+
do {
|
|
83
|
+
const a = this.build[i];
|
|
84
|
+
const b = other.build[i];
|
|
85
|
+
debug('build compare', i, a, b);
|
|
86
|
+
if (void 0 === a && void 0 === b) return 0;
|
|
87
|
+
if (void 0 === b) return 1;
|
|
88
|
+
if (void 0 === a) return -1;
|
|
89
|
+
else if (a === b) continue;
|
|
90
|
+
else return compareIdentifiers(a, b);
|
|
91
|
+
}while (++i);
|
|
92
|
+
}
|
|
93
|
+
inc(release, identifier, identifierBase) {
|
|
94
|
+
if (release.startsWith('pre')) {
|
|
95
|
+
if (!identifier && false === identifierBase) throw new Error('invalid increment argument: identifier is empty');
|
|
96
|
+
if (identifier) {
|
|
97
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
98
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
switch(release){
|
|
102
|
+
case 'premajor':
|
|
103
|
+
this.prerelease.length = 0;
|
|
104
|
+
this.patch = 0;
|
|
105
|
+
this.minor = 0;
|
|
106
|
+
this.major++;
|
|
107
|
+
this.inc('pre', identifier, identifierBase);
|
|
108
|
+
break;
|
|
109
|
+
case 'preminor':
|
|
110
|
+
this.prerelease.length = 0;
|
|
111
|
+
this.patch = 0;
|
|
112
|
+
this.minor++;
|
|
113
|
+
this.inc('pre', identifier, identifierBase);
|
|
114
|
+
break;
|
|
115
|
+
case 'prepatch':
|
|
116
|
+
this.prerelease.length = 0;
|
|
117
|
+
this.inc('patch', identifier, identifierBase);
|
|
118
|
+
this.inc('pre', identifier, identifierBase);
|
|
119
|
+
break;
|
|
120
|
+
case 'prerelease':
|
|
121
|
+
if (0 === this.prerelease.length) this.inc('patch', identifier, identifierBase);
|
|
122
|
+
this.inc('pre', identifier, identifierBase);
|
|
123
|
+
break;
|
|
124
|
+
case 'release':
|
|
125
|
+
if (0 === this.prerelease.length) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
126
|
+
this.prerelease.length = 0;
|
|
127
|
+
break;
|
|
128
|
+
case 'major':
|
|
129
|
+
if (0 !== this.minor || 0 !== this.patch || 0 === this.prerelease.length) this.major++;
|
|
130
|
+
this.minor = 0;
|
|
131
|
+
this.patch = 0;
|
|
132
|
+
this.prerelease = [];
|
|
133
|
+
break;
|
|
134
|
+
case 'minor':
|
|
135
|
+
if (0 !== this.patch || 0 === this.prerelease.length) this.minor++;
|
|
136
|
+
this.patch = 0;
|
|
137
|
+
this.prerelease = [];
|
|
138
|
+
break;
|
|
139
|
+
case 'patch':
|
|
140
|
+
if (0 === this.prerelease.length) this.patch++;
|
|
141
|
+
this.prerelease = [];
|
|
142
|
+
break;
|
|
143
|
+
case 'pre':
|
|
144
|
+
{
|
|
145
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
146
|
+
if (0 === this.prerelease.length) this.prerelease = [
|
|
147
|
+
base
|
|
148
|
+
];
|
|
149
|
+
else {
|
|
150
|
+
let i = this.prerelease.length;
|
|
151
|
+
while(--i >= 0)if ('number' == typeof this.prerelease[i]) {
|
|
152
|
+
this.prerelease[i]++;
|
|
153
|
+
i = -2;
|
|
154
|
+
}
|
|
155
|
+
if (-1 === i) {
|
|
156
|
+
if (identifier === this.prerelease.join('.') && false === identifierBase) throw new Error('invalid increment argument: identifier already exists');
|
|
157
|
+
this.prerelease.push(base);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (identifier) {
|
|
161
|
+
let prerelease = [
|
|
162
|
+
identifier,
|
|
163
|
+
base
|
|
164
|
+
];
|
|
165
|
+
if (false === identifierBase) prerelease = [
|
|
166
|
+
identifier
|
|
167
|
+
];
|
|
168
|
+
if (0 === compareIdentifiers(this.prerelease[0], identifier)) {
|
|
169
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
170
|
+
} else this.prerelease = prerelease;
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
default:
|
|
175
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
176
|
+
}
|
|
177
|
+
this.raw = this.format();
|
|
178
|
+
if (this.build.length) this.raw += `+${this.build.join('.')}`;
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
module.exports = SemVer;
|
|
183
|
+
},
|
|
184
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
185
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js");
|
|
186
|
+
const compare = (a, b, loose)=>new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
187
|
+
module.exports = compare;
|
|
188
|
+
},
|
|
189
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
190
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js");
|
|
191
|
+
const gte = (a, b, loose)=>compare(a, b, loose) >= 0;
|
|
192
|
+
module.exports = gte;
|
|
193
|
+
},
|
|
194
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js": function(module) {
|
|
195
|
+
const SEMVER_SPEC_VERSION = '2.0.0';
|
|
196
|
+
const MAX_LENGTH = 256;
|
|
197
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
198
|
+
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
199
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
200
|
+
const RELEASE_TYPES = [
|
|
201
|
+
'major',
|
|
202
|
+
'premajor',
|
|
203
|
+
'minor',
|
|
204
|
+
'preminor',
|
|
205
|
+
'patch',
|
|
206
|
+
'prepatch',
|
|
207
|
+
'prerelease'
|
|
208
|
+
];
|
|
209
|
+
module.exports = {
|
|
210
|
+
MAX_LENGTH,
|
|
211
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
212
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
213
|
+
MAX_SAFE_INTEGER,
|
|
214
|
+
RELEASE_TYPES,
|
|
215
|
+
SEMVER_SPEC_VERSION,
|
|
216
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
217
|
+
FLAG_LOOSE: 2
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js": function(module) {
|
|
221
|
+
const debug = 'object' == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args)=>console.error('SEMVER', ...args) : ()=>{};
|
|
222
|
+
module.exports = debug;
|
|
223
|
+
},
|
|
224
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js": function(module) {
|
|
225
|
+
const numeric = /^[0-9]+$/;
|
|
226
|
+
const compareIdentifiers = (a, b)=>{
|
|
227
|
+
const anum = numeric.test(a);
|
|
228
|
+
const bnum = numeric.test(b);
|
|
229
|
+
if (anum && bnum) {
|
|
230
|
+
a *= 1;
|
|
231
|
+
b *= 1;
|
|
232
|
+
}
|
|
233
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
234
|
+
};
|
|
235
|
+
const rcompareIdentifiers = (a, b)=>compareIdentifiers(b, a);
|
|
236
|
+
module.exports = {
|
|
237
|
+
compareIdentifiers,
|
|
238
|
+
rcompareIdentifiers
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js": function(module) {
|
|
242
|
+
const looseOption = Object.freeze({
|
|
243
|
+
loose: true
|
|
244
|
+
});
|
|
245
|
+
const emptyOpts = Object.freeze({});
|
|
246
|
+
const parseOptions = (options)=>{
|
|
247
|
+
if (!options) return emptyOpts;
|
|
248
|
+
if ('object' != typeof options) return looseOption;
|
|
249
|
+
return options;
|
|
250
|
+
};
|
|
251
|
+
module.exports = parseOptions;
|
|
252
|
+
},
|
|
253
|
+
"../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js": function(module, exports, __webpack_require__) {
|
|
254
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js");
|
|
255
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js");
|
|
256
|
+
exports = module.exports = {};
|
|
257
|
+
const re = exports.re = [];
|
|
258
|
+
const safeRe = exports.safeRe = [];
|
|
259
|
+
const src = exports.src = [];
|
|
260
|
+
const safeSrc = exports.safeSrc = [];
|
|
261
|
+
const t = exports.t = {};
|
|
262
|
+
let R = 0;
|
|
263
|
+
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
264
|
+
const safeRegexReplacements = [
|
|
265
|
+
[
|
|
266
|
+
'\\s',
|
|
267
|
+
1
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
'\\d',
|
|
271
|
+
MAX_LENGTH
|
|
272
|
+
],
|
|
273
|
+
[
|
|
274
|
+
LETTERDASHNUMBER,
|
|
275
|
+
MAX_SAFE_BUILD_LENGTH
|
|
276
|
+
]
|
|
277
|
+
];
|
|
278
|
+
const makeSafeRegex = (value)=>{
|
|
279
|
+
for (const [token, max] of safeRegexReplacements)value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
280
|
+
return value;
|
|
281
|
+
};
|
|
282
|
+
const createToken = (name, value, isGlobal)=>{
|
|
283
|
+
const safe = makeSafeRegex(value);
|
|
284
|
+
const index = R++;
|
|
285
|
+
debug(name, index, value);
|
|
286
|
+
t[name] = index;
|
|
287
|
+
src[index] = value;
|
|
288
|
+
safeSrc[index] = safe;
|
|
289
|
+
re[index] = new RegExp(value, isGlobal ? 'g' : void 0);
|
|
290
|
+
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : void 0);
|
|
291
|
+
};
|
|
292
|
+
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
293
|
+
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
294
|
+
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
295
|
+
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
296
|
+
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
297
|
+
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
298
|
+
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
299
|
+
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
300
|
+
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
301
|
+
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
|
|
302
|
+
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
303
|
+
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
304
|
+
createToken('FULL', `^${src[t.FULLPLAIN]}$`);
|
|
305
|
+
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
306
|
+
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
|
|
307
|
+
createToken('GTLT', '((?:<|>)?=?)');
|
|
308
|
+
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
309
|
+
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
310
|
+
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
311
|
+
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
312
|
+
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
313
|
+
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
314
|
+
createToken('COERCEPLAIN', `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
315
|
+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
316
|
+
createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + "(?:$|[^\\d])");
|
|
317
|
+
createToken('COERCERTL', src[t.COERCE], true);
|
|
318
|
+
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
319
|
+
createToken('LONETILDE', '(?:~>?)');
|
|
320
|
+
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
321
|
+
exports.tildeTrimReplace = '$1~';
|
|
322
|
+
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
323
|
+
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
324
|
+
createToken('LONECARET', '(?:\\^)');
|
|
325
|
+
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
326
|
+
exports.caretTrimReplace = '$1^';
|
|
327
|
+
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
328
|
+
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
329
|
+
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
330
|
+
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
331
|
+
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
332
|
+
exports.comparatorTrimReplace = '$1$2$3';
|
|
333
|
+
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*\$`);
|
|
334
|
+
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*\$`);
|
|
335
|
+
createToken('STAR', '(<|>)?=?\\s*\\*');
|
|
336
|
+
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
337
|
+
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
var __webpack_module_cache__ = {};
|
|
341
|
+
function __webpack_require__(moduleId) {
|
|
342
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
343
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
344
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
345
|
+
exports: {}
|
|
346
|
+
};
|
|
347
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
348
|
+
return module.exports;
|
|
349
|
+
}
|
|
350
|
+
(()=>{
|
|
351
|
+
__webpack_require__.n = (module)=>{
|
|
352
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
353
|
+
__webpack_require__.d(getter, {
|
|
354
|
+
a: getter
|
|
355
|
+
});
|
|
356
|
+
return getter;
|
|
357
|
+
};
|
|
358
|
+
})();
|
|
359
|
+
(()=>{
|
|
360
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
361
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
362
|
+
enumerable: true,
|
|
363
|
+
get: definition[key]
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
})();
|
|
367
|
+
(()=>{
|
|
368
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
369
|
+
})();
|
|
370
|
+
var gte = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js");
|
|
371
|
+
var gte_default = /*#__PURE__*/ __webpack_require__.n(gte);
|
|
3
372
|
const S_PLUGIN_REACT_ALIAS = Symbol.for('@lynx-js/plugin-react-alias');
|
|
4
373
|
function pluginReactAlias(options) {
|
|
5
374
|
const { LAYERS, lazy, rootPath } = options ?? {};
|
|
@@ -10,11 +379,14 @@ function pluginReactAlias(options) {
|
|
|
10
379
|
if (hasAlias) return;
|
|
11
380
|
api.expose(S_PLUGIN_REACT_ALIAS, true);
|
|
12
381
|
const require = createRequire(import.meta.url);
|
|
13
|
-
const
|
|
382
|
+
const reactLynxPkg = require.resolve('@lynx-js/react/package.json', {
|
|
14
383
|
paths: [
|
|
15
384
|
rootPath ?? api.context.rootPath
|
|
16
385
|
]
|
|
17
|
-
})
|
|
386
|
+
});
|
|
387
|
+
const reactLynxPkgContent = require(reactLynxPkg);
|
|
388
|
+
const version = reactLynxPkgContent.version;
|
|
389
|
+
const reactLynxDir = node_path.dirname(reactLynxPkg);
|
|
18
390
|
const resolve = createLazyResolver(reactLynxDir, lazy ? [
|
|
19
391
|
'lazy',
|
|
20
392
|
'import'
|
|
@@ -29,13 +401,14 @@ function pluginReactAlias(options) {
|
|
|
29
401
|
}
|
|
30
402
|
}));
|
|
31
403
|
api.modifyBundlerChain(async (chain, { isProd })=>{
|
|
32
|
-
const [jsxRuntimeBackground, jsxRuntimeMainThread, jsxDevRuntimeBackground, jsxDevRuntimeMainThread, reactLepusBackground, reactLepusMainThread] = await Promise.all([
|
|
404
|
+
const [jsxRuntimeBackground, jsxRuntimeMainThread, jsxDevRuntimeBackground, jsxDevRuntimeMainThread, reactLepusBackground, reactLepusMainThread, reactCompat] = await Promise.all([
|
|
33
405
|
resolve('@lynx-js/react/jsx-runtime'),
|
|
34
406
|
resolve('@lynx-js/react/lepus/jsx-runtime'),
|
|
35
407
|
resolve('@lynx-js/react/jsx-dev-runtime'),
|
|
36
408
|
resolve('@lynx-js/react/lepus/jsx-dev-runtime'),
|
|
37
409
|
resolve('@lynx-js/react'),
|
|
38
|
-
resolve('@lynx-js/react/lepus')
|
|
410
|
+
resolve('@lynx-js/react/lepus'),
|
|
411
|
+
gte_default()(version, '0.111.9999') ? resolve('@lynx-js/react/compat') : Promise.resolve(null)
|
|
39
412
|
]);
|
|
40
413
|
const jsxRuntime = {
|
|
41
414
|
background: jsxRuntimeBackground,
|
|
@@ -62,6 +435,7 @@ function pluginReactAlias(options) {
|
|
|
62
435
|
})));
|
|
63
436
|
if (isProd) chain.resolve.alias.set('@lynx-js/react/debug$', false);
|
|
64
437
|
chain.resolve.alias.set('react$', reactLepus.background).set('@lynx-js/react$', reactLepus.background);
|
|
438
|
+
if (reactCompat) chain.resolve.alias.set('@lynx-js/react/compat$', reactCompat);
|
|
65
439
|
const preactEntries = [
|
|
66
440
|
'preact',
|
|
67
441
|
'preact/compat',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-alias-rsbuild-plugin",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.10",
|
|
4
4
|
"description": "A rsbuild plugin for making alias in ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
"unrs-resolver": "1.9.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@microsoft/api-extractor": "7.52.
|
|
39
|
-
"@rsbuild/core": "1.4.
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
38
|
+
"@microsoft/api-extractor": "7.52.10",
|
|
39
|
+
"@rsbuild/core": "1.4.12",
|
|
40
|
+
"@types/semver": "^7.7.0",
|
|
41
|
+
"semver": "^7.7.2",
|
|
42
|
+
"@lynx-js/react": "0.112.1",
|
|
43
|
+
"@lynx-js/react-webpack-plugin": "0.6.19",
|
|
42
44
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
43
45
|
},
|
|
44
46
|
"engines": {
|