@rspack/core 0.6.4 → 0.6.5-canary-0a5cf0d-20240508123903
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/compiled/browserslist/index.d.ts +1 -0
- package/compiled/browserslist/index.js +2028 -0
- package/compiled/browserslist/license +20 -0
- package/compiled/browserslist/package.json +1 -0
- package/compiled/graceful-fs/index.d.ts +13 -0
- package/compiled/graceful-fs/index.js +1063 -0
- package/compiled/graceful-fs/license +15 -0
- package/compiled/graceful-fs/package.json +1 -0
- package/compiled/json-parse-even-better-errors/index.d.ts +1 -0
- package/compiled/json-parse-even-better-errors/index.js +193 -0
- package/compiled/json-parse-even-better-errors/package.json +1 -0
- package/compiled/neo-async/index.d.ts +685 -0
- package/compiled/neo-async/index.js +9207 -0
- package/compiled/neo-async/license +22 -0
- package/compiled/neo-async/package.json +1 -0
- package/compiled/watchpack/index.d.ts +216 -0
- package/compiled/watchpack/index.js +2075 -0
- package/compiled/watchpack/license +20 -0
- package/compiled/watchpack/package.json +1 -0
- package/compiled/zod/index.d.ts +1647 -0
- package/compiled/zod/index.js +4208 -0
- package/compiled/zod/license +21 -0
- package/compiled/zod/package.json +1 -0
- package/compiled/zod-validation-error/index.d.ts +188 -0
- package/compiled/zod-validation-error/index.js +4367 -0
- package/compiled/zod-validation-error/license +9 -0
- package/compiled/zod-validation-error/package.json +1 -0
- package/dist/Compiler.d.ts +2 -2
- package/dist/MultiCompiler.js +1 -1
- package/dist/MultiWatching.js +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.js +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.js +1 -1
- package/dist/builtin-plugin/IgnorePlugin.js +1 -1
- package/dist/config/browserslistTargetHandler.js +1 -1
- package/dist/config/zod.d.ts +1 -1
- package/dist/config/zod.js +1 -1
- package/dist/lib/CacheFacade.js +1 -1
- package/dist/loader-runner/index.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.js +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +3 -3
- package/dist/node/NodeWatchFileSystem.js +1 -1
- package/dist/rspackOptionsApply.js +1 -1
- package/dist/util/validate.d.ts +1 -1
- package/dist/util/validate.js +1 -1
- package/package.json +20 -14
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"graceful-fs","version":"4.2.10","license":"ISC","types":"index.d.ts","type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export = any;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 245:
|
|
6
|
+
/***/ ((module) => {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const INDENT = Symbol.for('indent')
|
|
11
|
+
const NEWLINE = Symbol.for('newline')
|
|
12
|
+
|
|
13
|
+
const DEFAULT_NEWLINE = '\n'
|
|
14
|
+
const DEFAULT_INDENT = ' '
|
|
15
|
+
const BOM = /^\uFEFF/
|
|
16
|
+
|
|
17
|
+
// only respect indentation if we got a line break, otherwise squash it
|
|
18
|
+
// things other than objects and arrays aren't indented, so ignore those
|
|
19
|
+
// Important: in both of these regexps, the $1 capture group is the newline
|
|
20
|
+
// or undefined, and the $2 capture group is the indent, or undefined.
|
|
21
|
+
const FORMAT = /^\s*[{[]((?:\r?\n)+)([\s\t]*)/
|
|
22
|
+
const EMPTY = /^(?:\{\}|\[\])((?:\r?\n)+)?$/
|
|
23
|
+
|
|
24
|
+
// Node 20 puts single quotes around the token and a comma after it
|
|
25
|
+
const UNEXPECTED_TOKEN = /^Unexpected token '?(.)'?(,)? /i
|
|
26
|
+
|
|
27
|
+
const hexify = (char) => {
|
|
28
|
+
const h = char.charCodeAt(0).toString(16).toUpperCase()
|
|
29
|
+
return `0x${h.length % 2 ? '0' : ''}${h}`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
33
|
+
// because the buffer-to-string conversion in `fs.readFileSync()`
|
|
34
|
+
// translates it to FEFF, the UTF-16 BOM.
|
|
35
|
+
const stripBOM = (txt) => String(txt).replace(BOM, '')
|
|
36
|
+
|
|
37
|
+
const makeParsedError = (msg, parsing, position = 0) => ({
|
|
38
|
+
message: `${msg} while parsing ${parsing}`,
|
|
39
|
+
position,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const parseError = (e, txt, context = 20) => {
|
|
43
|
+
let msg = e.message
|
|
44
|
+
|
|
45
|
+
if (!txt) {
|
|
46
|
+
return makeParsedError(msg, 'empty string')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const badTokenMatch = msg.match(UNEXPECTED_TOKEN)
|
|
50
|
+
const badIndexMatch = msg.match(/ position\s+(\d+)/i)
|
|
51
|
+
|
|
52
|
+
if (badTokenMatch) {
|
|
53
|
+
msg = msg.replace(
|
|
54
|
+
UNEXPECTED_TOKEN,
|
|
55
|
+
`Unexpected token ${JSON.stringify(badTokenMatch[1])} (${hexify(badTokenMatch[1])})$2 `
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let errIdx
|
|
60
|
+
if (badIndexMatch) {
|
|
61
|
+
errIdx = +badIndexMatch[1]
|
|
62
|
+
} else if (msg.match(/^Unexpected end of JSON.*/i)) {
|
|
63
|
+
errIdx = txt.length - 1
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (errIdx == null) {
|
|
67
|
+
return makeParsedError(msg, `'${txt.slice(0, context * 2)}'`)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const start = errIdx <= context ? 0 : errIdx - context
|
|
71
|
+
const end = errIdx + context >= txt.length ? txt.length : errIdx + context
|
|
72
|
+
const slice = `${start ? '...' : ''}${txt.slice(start, end)}${end === txt.length ? '' : '...'}`
|
|
73
|
+
|
|
74
|
+
return makeParsedError(
|
|
75
|
+
msg,
|
|
76
|
+
`${txt === slice ? '' : 'near '}${JSON.stringify(slice)}`,
|
|
77
|
+
errIdx
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class JSONParseError extends SyntaxError {
|
|
82
|
+
constructor (er, txt, context, caller) {
|
|
83
|
+
const metadata = parseError(er, txt, context)
|
|
84
|
+
super(metadata.message)
|
|
85
|
+
Object.assign(this, metadata)
|
|
86
|
+
this.code = 'EJSONPARSE'
|
|
87
|
+
this.systemError = er
|
|
88
|
+
Error.captureStackTrace(this, caller || this.constructor)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get name () {
|
|
92
|
+
return this.constructor.name
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set name (n) {}
|
|
96
|
+
|
|
97
|
+
get [Symbol.toStringTag] () {
|
|
98
|
+
return this.constructor.name
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const parseJson = (txt, reviver) => {
|
|
103
|
+
const result = JSON.parse(txt, reviver)
|
|
104
|
+
if (result && typeof result === 'object') {
|
|
105
|
+
// get the indentation so that we can save it back nicely
|
|
106
|
+
// if the file starts with {" then we have an indent of '', ie, none
|
|
107
|
+
// otherwise, pick the indentation of the next line after the first \n If the
|
|
108
|
+
// pattern doesn't match, then it means no indentation. JSON.stringify ignores
|
|
109
|
+
// symbols, so this is reasonably safe. if the string is '{}' or '[]', then
|
|
110
|
+
// use the default 2-space indent.
|
|
111
|
+
const match = txt.match(EMPTY) || txt.match(FORMAT) || [null, '', '']
|
|
112
|
+
result[NEWLINE] = match[1] ?? DEFAULT_NEWLINE
|
|
113
|
+
result[INDENT] = match[2] ?? DEFAULT_INDENT
|
|
114
|
+
}
|
|
115
|
+
return result
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const parseJsonError = (raw, reviver, context) => {
|
|
119
|
+
const txt = stripBOM(raw)
|
|
120
|
+
try {
|
|
121
|
+
return parseJson(txt, reviver)
|
|
122
|
+
} catch (e) {
|
|
123
|
+
if (typeof raw !== 'string' && !Buffer.isBuffer(raw)) {
|
|
124
|
+
const msg = Array.isArray(raw) && raw.length === 0 ? 'an empty array' : String(raw)
|
|
125
|
+
throw Object.assign(
|
|
126
|
+
new TypeError(`Cannot parse ${msg}`),
|
|
127
|
+
{ code: 'EJSONPARSE', systemError: e }
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
throw new JSONParseError(e, txt, context, parseJsonError)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module.exports = parseJsonError
|
|
135
|
+
parseJsonError.JSONParseError = JSONParseError
|
|
136
|
+
parseJsonError.noExceptions = (raw, reviver) => {
|
|
137
|
+
try {
|
|
138
|
+
return parseJson(stripBOM(raw), reviver)
|
|
139
|
+
} catch {
|
|
140
|
+
// no exceptions
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
/***/ })
|
|
146
|
+
|
|
147
|
+
/******/ });
|
|
148
|
+
/************************************************************************/
|
|
149
|
+
/******/ // The module cache
|
|
150
|
+
/******/ var __webpack_module_cache__ = {};
|
|
151
|
+
/******/
|
|
152
|
+
/******/ // The require function
|
|
153
|
+
/******/ function __nccwpck_require__(moduleId) {
|
|
154
|
+
/******/ // Check if module is in cache
|
|
155
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
156
|
+
/******/ if (cachedModule !== undefined) {
|
|
157
|
+
/******/ return cachedModule.exports;
|
|
158
|
+
/******/ }
|
|
159
|
+
/******/ // Create a new module (and put it into the cache)
|
|
160
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
161
|
+
/******/ // no module.id needed
|
|
162
|
+
/******/ // no module.loaded needed
|
|
163
|
+
/******/ exports: {}
|
|
164
|
+
/******/ };
|
|
165
|
+
/******/
|
|
166
|
+
/******/ // Execute the module function
|
|
167
|
+
/******/ var threw = true;
|
|
168
|
+
/******/ try {
|
|
169
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
170
|
+
/******/ threw = false;
|
|
171
|
+
/******/ } finally {
|
|
172
|
+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
173
|
+
/******/ }
|
|
174
|
+
/******/
|
|
175
|
+
/******/ // Return the exports of the module
|
|
176
|
+
/******/ return module.exports;
|
|
177
|
+
/******/ }
|
|
178
|
+
/******/
|
|
179
|
+
/************************************************************************/
|
|
180
|
+
/******/ /* webpack/runtime/compat */
|
|
181
|
+
/******/
|
|
182
|
+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
183
|
+
/******/
|
|
184
|
+
/************************************************************************/
|
|
185
|
+
/******/
|
|
186
|
+
/******/ // startup
|
|
187
|
+
/******/ // Load entry module and return exports
|
|
188
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
189
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(245);
|
|
190
|
+
/******/ module.exports = __webpack_exports__;
|
|
191
|
+
/******/
|
|
192
|
+
/******/ })()
|
|
193
|
+
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"json-parse-even-better-errors","author":"GitHub Inc.","version":"3.0.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
|