@jsenv/core 34.1.2 → 34.1.4
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.js
CHANGED
|
@@ -7215,7 +7215,9 @@ const formatters = {
|
|
|
7215
7215
|
}
|
|
7216
7216
|
};
|
|
7217
7217
|
|
|
7218
|
-
const createUrlGraph = (
|
|
7218
|
+
const createUrlGraph = ({
|
|
7219
|
+
name = "anonymous"
|
|
7220
|
+
} = {}) => {
|
|
7219
7221
|
const createUrlInfoCallbackRef = {
|
|
7220
7222
|
current: () => {}
|
|
7221
7223
|
};
|
|
@@ -7419,6 +7421,7 @@ const createUrlGraph = () => {
|
|
|
7419
7421
|
iterate(urlInfo);
|
|
7420
7422
|
};
|
|
7421
7423
|
return {
|
|
7424
|
+
name,
|
|
7422
7425
|
createUrlInfoCallbackRef,
|
|
7423
7426
|
prunedUrlInfosCallbackRef,
|
|
7424
7427
|
urlInfoMap,
|
|
@@ -20457,6 +20460,12 @@ const jsenvPluginAutoreloadServer = ({
|
|
|
20457
20460
|
});
|
|
20458
20461
|
};
|
|
20459
20462
|
const propagateUpdate = firstUrlInfo => {
|
|
20463
|
+
if (!urlGraph.getUrlInfo(firstUrlInfo.url)) {
|
|
20464
|
+
return {
|
|
20465
|
+
declined: true,
|
|
20466
|
+
reason: `url not in the url graph`
|
|
20467
|
+
};
|
|
20468
|
+
}
|
|
20460
20469
|
const iterate = (urlInfo, seen) => {
|
|
20461
20470
|
if (urlInfo.data.hotAcceptSelf) {
|
|
20462
20471
|
return {
|
|
@@ -22321,7 +22330,10 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
22321
22330
|
const buildSpecifierBeforeRedirect = findKey(buildUrls, buildUrlFormatted);
|
|
22322
22331
|
mutations.push(() => {
|
|
22323
22332
|
setHtmlNodeAttributes(node, {
|
|
22324
|
-
href: buildSpecifierBeforeRedirect
|
|
22333
|
+
href: buildSpecifierBeforeRedirect,
|
|
22334
|
+
...(buildUrlInfo.type === "js_classic" ? {
|
|
22335
|
+
crossorigin: undefined
|
|
22336
|
+
} : {})
|
|
22325
22337
|
});
|
|
22326
22338
|
});
|
|
22327
22339
|
for (const dependencyUrl of buildUrlInfo.dependencies) {
|
|
@@ -22770,7 +22782,9 @@ const createFileService = ({
|
|
|
22770
22782
|
const watchAssociations = URL_META.resolveAssociations({
|
|
22771
22783
|
watch: stopWatchingSourceFiles.watchPatterns
|
|
22772
22784
|
}, sourceDirectoryUrl);
|
|
22773
|
-
const urlGraph = createUrlGraph(
|
|
22785
|
+
const urlGraph = createUrlGraph({
|
|
22786
|
+
name: runtimeId
|
|
22787
|
+
});
|
|
22774
22788
|
clientFileChangeCallbackList.push(({
|
|
22775
22789
|
url
|
|
22776
22790
|
}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "34.1.
|
|
3
|
+
"version": "34.1.4",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -43,14 +43,13 @@
|
|
|
43
43
|
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
|
|
44
44
|
"dev": "node --conditions=development ./scripts/dev/dev.mjs",
|
|
45
45
|
"test": "node --conditions=development ./scripts/test/test.mjs",
|
|
46
|
+
"test:dev_errors_snapshots": "node --conditions=development ./tests/dev_server/errors/generate_snapshot_files.mjs",
|
|
47
|
+
"test:workspace": "npm run test --workspaces --if-present -- --workspace",
|
|
46
48
|
"build": "node --conditions=development ./scripts/build/build.mjs",
|
|
47
|
-
"
|
|
49
|
+
"build:file_size": "node ./scripts/build/build_file_size.mjs --log",
|
|
48
50
|
"workspace:versions": "node ./scripts/publish/workspace_versions.mjs",
|
|
49
51
|
"workspace:publish": "node ./scripts/publish/workspace_publish.mjs",
|
|
50
52
|
"performances": "node --expose-gc ./scripts/performance/generate_performance_report.mjs --log --once",
|
|
51
|
-
"file-size": "node ./scripts/file_size/file_size.mjs --log",
|
|
52
|
-
"start_file_server": "node ./scripts/dev/start_file_server.mjs",
|
|
53
|
-
"generate-dev-errors-snapshot-files": "node --conditions=development ./tests/dev_server/errors/generate_snapshot_files.mjs",
|
|
54
53
|
"prettier": "prettier --write .",
|
|
55
54
|
"playwright:install": "npx playwright install-deps && npx playwright install",
|
|
56
55
|
"certificate:install": "node ./scripts/dev/install_certificate_authority.mjs",
|
package/src/build/build.js
CHANGED
|
@@ -1429,6 +1429,9 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
1429
1429
|
mutations.push(() => {
|
|
1430
1430
|
setHtmlNodeAttributes(node, {
|
|
1431
1431
|
href: buildSpecifierBeforeRedirect,
|
|
1432
|
+
...(buildUrlInfo.type === "js_classic"
|
|
1433
|
+
? { crossorigin: undefined }
|
|
1434
|
+
: {}),
|
|
1432
1435
|
})
|
|
1433
1436
|
})
|
|
1434
1437
|
for (const dependencyUrl of buildUrlInfo.dependencies) {
|
package/src/dev/file_service.js
CHANGED
|
@@ -72,7 +72,9 @@ export const createFileService = ({
|
|
|
72
72
|
{ watch: stopWatchingSourceFiles.watchPatterns },
|
|
73
73
|
sourceDirectoryUrl,
|
|
74
74
|
)
|
|
75
|
-
const urlGraph = createUrlGraph(
|
|
75
|
+
const urlGraph = createUrlGraph({
|
|
76
|
+
name: runtimeId,
|
|
77
|
+
})
|
|
76
78
|
clientFileChangeCallbackList.push(({ url }) => {
|
|
77
79
|
const onUrlInfo = (urlInfo) => {
|
|
78
80
|
urlGraph.considerModified(urlInfo)
|
package/src/kitchen/url_graph.js
CHANGED
|
@@ -2,7 +2,7 @@ import { urlToRelativeUrl } from "@jsenv/urls"
|
|
|
2
2
|
|
|
3
3
|
import { urlSpecifierEncoding } from "./url_specifier_encoding.js"
|
|
4
4
|
|
|
5
|
-
export const createUrlGraph = () => {
|
|
5
|
+
export const createUrlGraph = ({ name = "anonymous" } = {}) => {
|
|
6
6
|
const createUrlInfoCallbackRef = { current: () => {} }
|
|
7
7
|
const prunedUrlInfosCallbackRef = { current: () => {} }
|
|
8
8
|
|
|
@@ -208,6 +208,7 @@ export const createUrlGraph = () => {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
return {
|
|
211
|
+
name,
|
|
211
212
|
createUrlInfoCallbackRef,
|
|
212
213
|
prunedUrlInfosCallbackRef,
|
|
213
214
|
|
|
@@ -40,6 +40,12 @@ export const jsenvPluginAutoreloadServer = ({
|
|
|
40
40
|
})
|
|
41
41
|
}
|
|
42
42
|
const propagateUpdate = (firstUrlInfo) => {
|
|
43
|
+
if (!urlGraph.getUrlInfo(firstUrlInfo.url)) {
|
|
44
|
+
return {
|
|
45
|
+
declined: true,
|
|
46
|
+
reason: `url not in the url graph`,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
43
49
|
const iterate = (urlInfo, seen) => {
|
|
44
50
|
if (urlInfo.data.hotAcceptSelf) {
|
|
45
51
|
return {
|