@jsenv/core 39.13.1 → 39.13.3
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/jsenv_core.js
CHANGED
|
@@ -2717,12 +2717,18 @@ const applyMatching = (pattern, string) => {
|
|
|
2717
2717
|
}
|
|
2718
2718
|
};
|
|
2719
2719
|
const matchOne = () => {
|
|
2720
|
-
// pattern consumed
|
|
2721
|
-
if (remainingPattern === ""
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2720
|
+
// pattern consumed
|
|
2721
|
+
if (remainingPattern === "") {
|
|
2722
|
+
if (remainingString === "") {
|
|
2723
|
+
return true; // string fully matched pattern
|
|
2724
|
+
}
|
|
2725
|
+
if (remainingString[0] === "?") {
|
|
2726
|
+
// match search params
|
|
2727
|
+
consumeRemainingString();
|
|
2728
|
+
|
|
2729
|
+
return true;
|
|
2730
|
+
}
|
|
2731
|
+
// if remainingString
|
|
2726
2732
|
return false; // fails because string longer than expect
|
|
2727
2733
|
}
|
|
2728
2734
|
// -- from this point pattern is not consumed --
|
|
@@ -3220,6 +3226,27 @@ const readDirectory = async (url, { emfileMaxWait = 1000 } = {}) => {
|
|
|
3220
3226
|
return attempt();
|
|
3221
3227
|
};
|
|
3222
3228
|
|
|
3229
|
+
const generateWindowsEPERMErrorMessage = (
|
|
3230
|
+
error,
|
|
3231
|
+
{ operation, path },
|
|
3232
|
+
) => {
|
|
3233
|
+
const pathLengthIsExceedingUsualLimit = String(path).length >= 256;
|
|
3234
|
+
let message = "";
|
|
3235
|
+
|
|
3236
|
+
if (operation) {
|
|
3237
|
+
message += `error while trying to fix windows EPERM after ${operation} on ${path}`;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
if (pathLengthIsExceedingUsualLimit) {
|
|
3241
|
+
message += "\n";
|
|
3242
|
+
message += `Maybe because path length is exceeding the usual limit of 256 characters of windows OS?`;
|
|
3243
|
+
message += "\n";
|
|
3244
|
+
}
|
|
3245
|
+
message += "\n";
|
|
3246
|
+
message += error.stack;
|
|
3247
|
+
return message;
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3223
3250
|
const writeEntryPermissions = async (source, permissions) => {
|
|
3224
3251
|
const sourceUrl = assertAndNormalizeFileUrl(source);
|
|
3225
3252
|
|
|
@@ -3290,7 +3317,10 @@ const readEntryStat = async (
|
|
|
3290
3317
|
return stats;
|
|
3291
3318
|
} catch (e) {
|
|
3292
3319
|
console.error(
|
|
3293
|
-
|
|
3320
|
+
generateWindowsEPERMErrorMessage(e, {
|
|
3321
|
+
operation: "stats",
|
|
3322
|
+
path: sourcePath,
|
|
3323
|
+
}),
|
|
3294
3324
|
);
|
|
3295
3325
|
throw error;
|
|
3296
3326
|
}
|
|
@@ -3392,7 +3422,10 @@ const readEntryStatSync = (
|
|
|
3392
3422
|
return stats;
|
|
3393
3423
|
} catch (e) {
|
|
3394
3424
|
console.error(
|
|
3395
|
-
|
|
3425
|
+
generateWindowsEPERMErrorMessage(e, {
|
|
3426
|
+
operation: "stats",
|
|
3427
|
+
path: sourcePath,
|
|
3428
|
+
}),
|
|
3396
3429
|
);
|
|
3397
3430
|
throw error;
|
|
3398
3431
|
}
|
|
@@ -3810,7 +3843,10 @@ const removeDirectorySync$1 = (
|
|
|
3810
3843
|
return;
|
|
3811
3844
|
}
|
|
3812
3845
|
console.error(
|
|
3813
|
-
|
|
3846
|
+
generateWindowsEPERMErrorMessage(openOrCloseError, {
|
|
3847
|
+
path: directoryPath,
|
|
3848
|
+
operation: "readir",
|
|
3849
|
+
}),
|
|
3814
3850
|
);
|
|
3815
3851
|
throw error;
|
|
3816
3852
|
}
|
|
@@ -4146,7 +4182,6 @@ const removeDirectory = async (
|
|
|
4146
4182
|
console.error(
|
|
4147
4183
|
`trying to fix windows EPERM after readir on ${directoryPath}`,
|
|
4148
4184
|
);
|
|
4149
|
-
|
|
4150
4185
|
let openOrCloseError;
|
|
4151
4186
|
try {
|
|
4152
4187
|
const fd = openSync(directoryPath);
|
|
@@ -4160,7 +4195,10 @@ const removeDirectory = async (
|
|
|
4160
4195
|
return;
|
|
4161
4196
|
}
|
|
4162
4197
|
console.error(
|
|
4163
|
-
|
|
4198
|
+
generateWindowsEPERMErrorMessage(openOrCloseError, {
|
|
4199
|
+
operation: "readdir",
|
|
4200
|
+
path: directoryPath,
|
|
4201
|
+
}),
|
|
4164
4202
|
);
|
|
4165
4203
|
throw error;
|
|
4166
4204
|
}
|
|
@@ -4299,7 +4337,10 @@ const createWatcher = (sourcePath, options) => {
|
|
|
4299
4337
|
return;
|
|
4300
4338
|
}
|
|
4301
4339
|
console.error(
|
|
4302
|
-
|
|
4340
|
+
generateWindowsEPERMErrorMessage(error, {
|
|
4341
|
+
operation: "watch",
|
|
4342
|
+
path: sourcePath,
|
|
4343
|
+
}),
|
|
4303
4344
|
);
|
|
4304
4345
|
throw error;
|
|
4305
4346
|
}
|
|
@@ -19409,6 +19450,11 @@ return {
|
|
|
19409
19450
|
/*
|
|
19410
19451
|
* NICE TO HAVE:
|
|
19411
19452
|
*
|
|
19453
|
+
* - when clicking the server root directory from the root directory
|
|
19454
|
+
* we should see "/..." in the url bar
|
|
19455
|
+
* instead we ses "@fs/"
|
|
19456
|
+
* everything still works but that would be cleaner
|
|
19457
|
+
*
|
|
19412
19458
|
* - when visiting urls outside server root directory the UI is messed up
|
|
19413
19459
|
*
|
|
19414
19460
|
* Let's say I visit file outside the server root directory that is in 404
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "39.13.
|
|
3
|
+
"version": "39.13.3",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -70,20 +70,20 @@
|
|
|
70
70
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
71
71
|
"@jsenv/abort": "4.3.0",
|
|
72
72
|
"@jsenv/ast": "6.5.0",
|
|
73
|
-
"@jsenv/filesystem": "4.13.
|
|
73
|
+
"@jsenv/filesystem": "4.13.4",
|
|
74
74
|
"@jsenv/humanize": "1.2.8",
|
|
75
75
|
"@jsenv/importmap": "1.2.1",
|
|
76
76
|
"@jsenv/integrity": "0.0.2",
|
|
77
77
|
"@jsenv/js-module-fallback": "1.3.57",
|
|
78
78
|
"@jsenv/node-esm-resolution": "1.0.6",
|
|
79
|
-
"@jsenv/plugin-bundling": "2.7.
|
|
79
|
+
"@jsenv/plugin-bundling": "2.7.25",
|
|
80
80
|
"@jsenv/plugin-minification": "1.5.13",
|
|
81
81
|
"@jsenv/plugin-supervisor": "1.6.4",
|
|
82
82
|
"@jsenv/plugin-transpilation": "1.4.93",
|
|
83
83
|
"@jsenv/runtime-compat": "1.3.1",
|
|
84
|
-
"@jsenv/server": "15.5.
|
|
84
|
+
"@jsenv/server": "15.5.1",
|
|
85
85
|
"@jsenv/sourcemap": "1.2.30",
|
|
86
|
-
"@jsenv/url-meta": "8.5.
|
|
86
|
+
"@jsenv/url-meta": "8.5.3",
|
|
87
87
|
"@jsenv/urls": "2.6.0",
|
|
88
88
|
"@jsenv/utils": "2.1.2",
|
|
89
89
|
"string-width": "7.2.0"
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* NICE TO HAVE:
|
|
3
3
|
*
|
|
4
|
+
* - when clicking the server root directory from the root directory
|
|
5
|
+
* we should see "/..." in the url bar
|
|
6
|
+
* instead we ses "@fs/"
|
|
7
|
+
* everything still works but that would be cleaner
|
|
8
|
+
*
|
|
4
9
|
* - when visiting urls outside server root directory the UI is messed up
|
|
5
10
|
*
|
|
6
11
|
* Let's say I visit file outside the server root directory that is in 404
|