@jsenv/core 39.8.1 → 39.9.0
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 +29 -22
- package/package.json +2 -2
- package/src/dev/start_dev_server.js +6 -2
- package/src/kitchen/url_graph/url_graph.js +13 -15
package/dist/jsenv_core.js
CHANGED
|
@@ -4662,7 +4662,8 @@ const registerDirectoryLifecycle = (
|
|
|
4662
4662
|
}
|
|
4663
4663
|
};
|
|
4664
4664
|
|
|
4665
|
-
readdirSync(new URL(sourceUrl))
|
|
4665
|
+
const entries = readdirSync(new URL(sourceUrl));
|
|
4666
|
+
for (const entry of entries) {
|
|
4666
4667
|
const entryUrl = new URL(entry, sourceUrl).href;
|
|
4667
4668
|
const entryInfo = readEntryInfo(entryUrl);
|
|
4668
4669
|
if (entryInfo.type !== null && entryInfo.patternValue) {
|
|
@@ -4670,7 +4671,7 @@ const registerDirectoryLifecycle = (
|
|
|
4670
4671
|
notify: notifyExistent,
|
|
4671
4672
|
});
|
|
4672
4673
|
}
|
|
4673
|
-
}
|
|
4674
|
+
}
|
|
4674
4675
|
if (debug) {
|
|
4675
4676
|
const relativeUrls = Array.from(infoMap.keys());
|
|
4676
4677
|
if (relativeUrls.length === 0) {
|
|
@@ -4704,11 +4705,11 @@ const shouldCallUpdated = (entryInfo) => {
|
|
|
4704
4705
|
if (!stat.atimeMs) {
|
|
4705
4706
|
return true;
|
|
4706
4707
|
}
|
|
4707
|
-
if (stat.atimeMs
|
|
4708
|
+
if (stat.atimeMs <= stat.mtimeMs) {
|
|
4708
4709
|
return true;
|
|
4709
4710
|
}
|
|
4710
|
-
if (
|
|
4711
|
-
return
|
|
4711
|
+
if (stat.mtimeMs !== previousInfo.stat.mtimeMs) {
|
|
4712
|
+
return true;
|
|
4712
4713
|
}
|
|
4713
4714
|
return true;
|
|
4714
4715
|
};
|
|
@@ -4742,6 +4743,10 @@ const fileSystemPathToDirectoryRelativeUrlAndFilename = (path) => {
|
|
|
4742
4743
|
};
|
|
4743
4744
|
};
|
|
4744
4745
|
|
|
4746
|
+
process.platform === "darwin";
|
|
4747
|
+
process.platform === "linux";
|
|
4748
|
+
process.platform === "freebsd";
|
|
4749
|
+
|
|
4745
4750
|
/*
|
|
4746
4751
|
* - Buffer documentation on Node.js
|
|
4747
4752
|
* https://nodejs.org/docs/latest-v13.x/api/buffer.html
|
|
@@ -14003,6 +14008,19 @@ const createUrlInfo = (url, context) => {
|
|
|
14003
14008
|
reference.next = referenceWithoutSearchParam;
|
|
14004
14009
|
return referenceWithoutSearchParam.urlInfo;
|
|
14005
14010
|
};
|
|
14011
|
+
urlInfo.onRemoved = () => {
|
|
14012
|
+
urlInfo.kitchen.urlInfoTransformer.resetContent(urlInfo);
|
|
14013
|
+
urlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
14014
|
+
referenceToOther.remove();
|
|
14015
|
+
});
|
|
14016
|
+
if (urlInfo.searchParams.size > 0) {
|
|
14017
|
+
const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
|
|
14018
|
+
const urlInfoWithoutSearch = urlInfo.graph.getUrlInfo(urlWithoutSearch);
|
|
14019
|
+
if (urlInfoWithoutSearch) {
|
|
14020
|
+
urlInfoWithoutSearch.searchParamVariantSet.delete(urlInfo);
|
|
14021
|
+
}
|
|
14022
|
+
}
|
|
14023
|
+
};
|
|
14006
14024
|
urlInfo.onModified = ({ modifiedTimestamp = Date.now() } = {}) => {
|
|
14007
14025
|
const visitedSet = new Set();
|
|
14008
14026
|
const considerModified = (urlInfo) => {
|
|
@@ -14039,21 +14057,6 @@ const createUrlInfo = (url, context) => {
|
|
|
14039
14057
|
);
|
|
14040
14058
|
};
|
|
14041
14059
|
|
|
14042
|
-
// not used for now
|
|
14043
|
-
// urlInfo.deleteFromGraph = () => {
|
|
14044
|
-
// urlInfo.kitchen.urlInfoTransformer.resetContent(urlInfo);
|
|
14045
|
-
// urlInfo.graph.urlInfoMap.delete(url);
|
|
14046
|
-
// urlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
14047
|
-
// referenceToOther.remove();
|
|
14048
|
-
// });
|
|
14049
|
-
// if (urlInfo.searchParams.size > 0) {
|
|
14050
|
-
// const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
|
|
14051
|
-
// const urlInfoWithoutSearch = urlInfo.graph.getUrlInfo(urlWithoutSearch);
|
|
14052
|
-
// if (urlInfoWithoutSearch) {
|
|
14053
|
-
// urlInfoWithoutSearch.searchParamVariantSet.delete(urlInfo);
|
|
14054
|
-
// }
|
|
14055
|
-
// }
|
|
14056
|
-
// };
|
|
14057
14060
|
urlInfo.cook = (customContext) => {
|
|
14058
14061
|
return urlInfo.context.cook(urlInfo, customContext);
|
|
14059
14062
|
};
|
|
@@ -23805,10 +23808,14 @@ const startDevServer = async ({
|
|
|
23805
23808
|
sourceDirectoryUrl,
|
|
23806
23809
|
);
|
|
23807
23810
|
let kitchen;
|
|
23808
|
-
clientFileChangeEventEmitter.on(({ url }) => {
|
|
23811
|
+
clientFileChangeEventEmitter.on(({ url, event }) => {
|
|
23809
23812
|
const urlInfo = kitchen.graph.getUrlInfo(url);
|
|
23810
23813
|
if (urlInfo) {
|
|
23811
|
-
|
|
23814
|
+
if (event === "removed") {
|
|
23815
|
+
urlInfo.onRemoved();
|
|
23816
|
+
} else {
|
|
23817
|
+
urlInfo.onModified();
|
|
23818
|
+
}
|
|
23812
23819
|
}
|
|
23813
23820
|
});
|
|
23814
23821
|
const clientRuntimeCompat = { [runtimeName]: runtimeVersion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "39.
|
|
3
|
+
"version": "39.9.0",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
71
71
|
"@jsenv/abort": "4.3.0",
|
|
72
72
|
"@jsenv/ast": "6.4.1",
|
|
73
|
-
"@jsenv/filesystem": "4.
|
|
73
|
+
"@jsenv/filesystem": "4.13.0",
|
|
74
74
|
"@jsenv/humanize": "1.2.8",
|
|
75
75
|
"@jsenv/importmap": "1.2.1",
|
|
76
76
|
"@jsenv/integrity": "0.0.2",
|
|
@@ -237,10 +237,14 @@ export const startDevServer = async ({
|
|
|
237
237
|
sourceDirectoryUrl,
|
|
238
238
|
);
|
|
239
239
|
let kitchen;
|
|
240
|
-
clientFileChangeEventEmitter.on(({ url }) => {
|
|
240
|
+
clientFileChangeEventEmitter.on(({ url, event }) => {
|
|
241
241
|
const urlInfo = kitchen.graph.getUrlInfo(url);
|
|
242
242
|
if (urlInfo) {
|
|
243
|
-
|
|
243
|
+
if (event === "removed") {
|
|
244
|
+
urlInfo.onRemoved();
|
|
245
|
+
} else {
|
|
246
|
+
urlInfo.onModified();
|
|
247
|
+
}
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
const clientRuntimeCompat = { [runtimeName]: runtimeVersion };
|
|
@@ -356,6 +356,19 @@ const createUrlInfo = (url, context) => {
|
|
|
356
356
|
reference.next = referenceWithoutSearchParam;
|
|
357
357
|
return referenceWithoutSearchParam.urlInfo;
|
|
358
358
|
};
|
|
359
|
+
urlInfo.onRemoved = () => {
|
|
360
|
+
urlInfo.kitchen.urlInfoTransformer.resetContent(urlInfo);
|
|
361
|
+
urlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
362
|
+
referenceToOther.remove();
|
|
363
|
+
});
|
|
364
|
+
if (urlInfo.searchParams.size > 0) {
|
|
365
|
+
const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
|
|
366
|
+
const urlInfoWithoutSearch = urlInfo.graph.getUrlInfo(urlWithoutSearch);
|
|
367
|
+
if (urlInfoWithoutSearch) {
|
|
368
|
+
urlInfoWithoutSearch.searchParamVariantSet.delete(urlInfo);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
359
372
|
urlInfo.onModified = ({ modifiedTimestamp = Date.now() } = {}) => {
|
|
360
373
|
const visitedSet = new Set();
|
|
361
374
|
const considerModified = (urlInfo) => {
|
|
@@ -392,21 +405,6 @@ const createUrlInfo = (url, context) => {
|
|
|
392
405
|
);
|
|
393
406
|
};
|
|
394
407
|
|
|
395
|
-
// not used for now
|
|
396
|
-
// urlInfo.deleteFromGraph = () => {
|
|
397
|
-
// urlInfo.kitchen.urlInfoTransformer.resetContent(urlInfo);
|
|
398
|
-
// urlInfo.graph.urlInfoMap.delete(url);
|
|
399
|
-
// urlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
400
|
-
// referenceToOther.remove();
|
|
401
|
-
// });
|
|
402
|
-
// if (urlInfo.searchParams.size > 0) {
|
|
403
|
-
// const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
|
|
404
|
-
// const urlInfoWithoutSearch = urlInfo.graph.getUrlInfo(urlWithoutSearch);
|
|
405
|
-
// if (urlInfoWithoutSearch) {
|
|
406
|
-
// urlInfoWithoutSearch.searchParamVariantSet.delete(urlInfo);
|
|
407
|
-
// }
|
|
408
|
-
// }
|
|
409
|
-
// };
|
|
410
408
|
urlInfo.cook = (customContext) => {
|
|
411
409
|
return urlInfo.context.cook(urlInfo, customContext);
|
|
412
410
|
};
|