@jsenv/core 31.2.0 → 32.0.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.
- package/dist/js/v8_coverage.js +36 -23
- package/dist/main.js +483 -546
- package/package.json +5 -5
- package/src/basic_fetch.js +42 -0
- package/src/build/build.js +81 -93
- package/src/build/start_build_server.js +32 -112
- package/src/dev/file_service.js +49 -66
- package/src/dev/start_dev_server.js +43 -94
- package/src/execute/execute.js +4 -1
- package/src/execute/runtimes/node/node_child_process.js +0 -1
- package/src/jsenv_internal_directory.js +18 -0
- package/src/kitchen/kitchen.js +2 -0
- package/src/lookup_package_directory.js +34 -0
- package/src/plugins/explorer/jsenv_plugin_explorer.js +5 -4
- package/src/plugins/plugins.js +4 -16
- package/src/plugins/url_resolution/jsenv_plugin_url_resolution.js +2 -2
- package/src/test/coverage/v8_coverage_node_directory.js +4 -2
- package/src/test/execute_plan.js +6 -67
- package/src/test/execute_test_plan.js +199 -45
- package/src/watch_source_files.js +52 -0
package/dist/js/v8_coverage.js
CHANGED
|
@@ -222,24 +222,30 @@ const applyMatching = (pattern, string) => {
|
|
|
222
222
|
// pattern leading **
|
|
223
223
|
if (remainingPattern.slice(0, 2) === "**") {
|
|
224
224
|
consumePattern(2); // consumes "**"
|
|
225
|
+
let skipAllowed = true;
|
|
225
226
|
if (remainingPattern[0] === "/") {
|
|
226
227
|
consumePattern(1); // consumes "/"
|
|
228
|
+
if (!remainingString.includes("/")) {
|
|
229
|
+
skipAllowed = false;
|
|
230
|
+
}
|
|
227
231
|
}
|
|
228
|
-
// pattern ending with ** always match remaining string
|
|
232
|
+
// pattern ending with "**" or "**/" always match remaining string
|
|
229
233
|
if (remainingPattern === "") {
|
|
230
234
|
consumeRemainingString();
|
|
231
235
|
return true;
|
|
232
236
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
237
|
+
if (skipAllowed) {
|
|
238
|
+
const skipResult = skipUntilMatch({
|
|
239
|
+
pattern: remainingPattern,
|
|
240
|
+
string: remainingString,
|
|
241
|
+
canSkipSlash: true
|
|
242
|
+
});
|
|
243
|
+
groups.push(...skipResult.groups);
|
|
244
|
+
consumePattern(skipResult.patternIndex);
|
|
245
|
+
consumeRemainingString();
|
|
246
|
+
restoreIndexes = false;
|
|
247
|
+
return skipResult.matched;
|
|
248
|
+
}
|
|
243
249
|
}
|
|
244
250
|
if (remainingPattern[0] === "*") {
|
|
245
251
|
consumePattern(1); // consumes "*"
|
|
@@ -297,7 +303,7 @@ const skipUntilMatch = ({
|
|
|
297
303
|
}) => {
|
|
298
304
|
let index = 0;
|
|
299
305
|
let remainingString = string;
|
|
300
|
-
let
|
|
306
|
+
let longestAttemptRange = null;
|
|
301
307
|
const tryToMatch = () => {
|
|
302
308
|
const matchAttempt = applyMatching(pattern, remainingString);
|
|
303
309
|
if (matchAttempt.matched) {
|
|
@@ -311,18 +317,25 @@ const skipUntilMatch = ({
|
|
|
311
317
|
}
|
|
312
318
|
};
|
|
313
319
|
}
|
|
314
|
-
const
|
|
315
|
-
const
|
|
320
|
+
const attemptIndex = matchAttempt.index;
|
|
321
|
+
const attemptRange = {
|
|
316
322
|
patternIndex: matchAttempt.patternIndex,
|
|
317
323
|
index,
|
|
318
|
-
length:
|
|
324
|
+
length: attemptIndex,
|
|
319
325
|
groups: matchAttempt.groups
|
|
320
326
|
};
|
|
321
|
-
if (!
|
|
322
|
-
|
|
327
|
+
if (!longestAttemptRange || longestAttemptRange.length < attemptRange.length) {
|
|
328
|
+
longestAttemptRange = attemptRange;
|
|
329
|
+
}
|
|
330
|
+
const nextIndex = attemptIndex + 1;
|
|
331
|
+
let canSkip;
|
|
332
|
+
if (nextIndex >= remainingString.length) {
|
|
333
|
+
canSkip = false;
|
|
334
|
+
} else if (remainingString[0] === "/") {
|
|
335
|
+
canSkip = canSkipSlash;
|
|
336
|
+
} else {
|
|
337
|
+
canSkip = true;
|
|
323
338
|
}
|
|
324
|
-
const nextIndex = matchAttemptIndex + 1;
|
|
325
|
-
const canSkip = nextIndex < remainingString.length && (canSkipSlash || remainingString[0] !== "/");
|
|
326
339
|
if (canSkip) {
|
|
327
340
|
// search against the next unattempted string
|
|
328
341
|
index += nextIndex;
|
|
@@ -331,11 +344,11 @@ const skipUntilMatch = ({
|
|
|
331
344
|
}
|
|
332
345
|
return {
|
|
333
346
|
matched: false,
|
|
334
|
-
patternIndex:
|
|
335
|
-
index:
|
|
336
|
-
groups:
|
|
347
|
+
patternIndex: longestAttemptRange.patternIndex,
|
|
348
|
+
index: longestAttemptRange.index + longestAttemptRange.length,
|
|
349
|
+
groups: longestAttemptRange.groups,
|
|
337
350
|
group: {
|
|
338
|
-
string: string.slice(0,
|
|
351
|
+
string: string.slice(0, longestAttemptRange.index)
|
|
339
352
|
}
|
|
340
353
|
};
|
|
341
354
|
};
|