@jsenv/core 41.0.4 → 41.0.5

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.
@@ -3860,7 +3860,11 @@ const jsenvPluginDirectoryReferenceEffect = (
3860
3860
  reference.ownerUrlInfo.filenameHint
3861
3861
  }${urlToFilename(reference.url)}/`;
3862
3862
  } else if (reference.specifierPathname.endsWith("./")) ; else {
3863
- reference.filenameHint = `${urlToFilename(reference.url)}/`;
3863
+ const directoryRelativeUrl = urlToRelativeUrl(
3864
+ reference.url,
3865
+ reference.ownerUrlInfo.originalUrl,
3866
+ );
3867
+ reference.filenameHint = directoryRelativeUrl;
3864
3868
  }
3865
3869
  let actionForDirectory;
3866
3870
  if (reference.type === "a_href") {
@@ -7497,6 +7501,14 @@ const jsenvPluginImportMetaScenarios = () => {
7497
7501
  appliesDuring: "*",
7498
7502
  transformUrlContent: {
7499
7503
  js_module: async (urlInfo) => {
7504
+ // Do not scan node modules for import.meta.dev/import.meta.build
7505
+ // - node modules won't have this in their code
7506
+ // - ;or should use other an other technic as this one won't be available
7507
+ // They would be discarded by content.includes detection
7508
+ // but it's cheaper to detect by URL than to scan potentially large files
7509
+ if (urlInfo.url.includes("/node_modules/")) {
7510
+ return null;
7511
+ }
7500
7512
  if (
7501
7513
  !urlInfo.content.includes("import.meta.dev") &&
7502
7514
  !urlInfo.content.includes("import.meta.test") &&
@@ -7593,6 +7605,14 @@ const babelPluginMetadataImportMetaScenarios = () => {
7593
7605
 
7594
7606
  const jsenvPluginGlobalScenarios = () => {
7595
7607
  const transformIfNeeded = (urlInfo) => {
7608
+ // Do not scan node modules for __DEV__/__BUILD__
7609
+ // - node modules won't have this in their code
7610
+ // - ;or should use other an other technic as this one won't be available
7611
+ // They would be discarded by content.includes detection
7612
+ // but it's cheaper to detect by URL than to scan potentially large files
7613
+ if (urlInfo.url.includes("/node_modules/")) {
7614
+ return null;
7615
+ }
7596
7616
  return {
7597
7617
  contentInjections: {
7598
7618
  __DEV__: INJECTIONS.optional(urlInfo.context.dev),
@@ -7662,6 +7682,14 @@ const jsenvPluginImportMetaCss = () => {
7662
7682
  appliesDuring: "*",
7663
7683
  transformUrlContent: {
7664
7684
  js_module: async (urlInfo) => {
7685
+ // Do not scan node modules for import.meta.css
7686
+ // - unlikely to be there
7687
+ // - we don't watch node modules (too expensive)
7688
+ // They would be discarded by content.includes detection
7689
+ // but it's cheaper to detect by URL than to scan potentially large files
7690
+ if (urlInfo.url.includes("/node_modules/")) {
7691
+ return null;
7692
+ }
7665
7693
  if (!urlInfo.content.includes("import.meta.css")) {
7666
7694
  return null;
7667
7695
  }
@@ -8120,6 +8148,14 @@ const jsenvPluginImportMetaHot = () => {
8120
8148
  cssUrlInfo.data.hotAcceptDependencies = [];
8121
8149
  },
8122
8150
  js_module: async (urlInfo) => {
8151
+ // Do not scan node modules for import.meta.hot
8152
+ // - unlikely to be there
8153
+ // - we don't watch node modules (too expensive)
8154
+ // They would be discarded by content.includes detection
8155
+ // but it's cheaper to detect by URL than to scan potentially large files
8156
+ if (urlInfo.url.includes("/node_modules/")) {
8157
+ return null;
8158
+ }
8123
8159
  if (!urlInfo.content.includes("import.meta.hot")) {
8124
8160
  return null;
8125
8161
  }
@@ -3724,7 +3724,11 @@ const jsenvPluginDirectoryReferenceEffect = (
3724
3724
  reference.ownerUrlInfo.filenameHint
3725
3725
  }${urlToFilename(reference.url)}/`;
3726
3726
  } else if (reference.specifierPathname.endsWith("./")) ; else {
3727
- reference.filenameHint = `${urlToFilename(reference.url)}/`;
3727
+ const directoryRelativeUrl = urlToRelativeUrl(
3728
+ reference.url,
3729
+ reference.ownerUrlInfo.originalUrl,
3730
+ );
3731
+ reference.filenameHint = directoryRelativeUrl;
3728
3732
  }
3729
3733
  let actionForDirectory;
3730
3734
  if (reference.type === "a_href") {
@@ -4450,6 +4454,14 @@ const jsenvPluginImportMetaScenarios = () => {
4450
4454
  appliesDuring: "*",
4451
4455
  transformUrlContent: {
4452
4456
  js_module: async (urlInfo) => {
4457
+ // Do not scan node modules for import.meta.dev/import.meta.build
4458
+ // - node modules won't have this in their code
4459
+ // - ;or should use other an other technic as this one won't be available
4460
+ // They would be discarded by content.includes detection
4461
+ // but it's cheaper to detect by URL than to scan potentially large files
4462
+ if (urlInfo.url.includes("/node_modules/")) {
4463
+ return null;
4464
+ }
4453
4465
  if (
4454
4466
  !urlInfo.content.includes("import.meta.dev") &&
4455
4467
  !urlInfo.content.includes("import.meta.test") &&
@@ -4546,6 +4558,14 @@ const babelPluginMetadataImportMetaScenarios = () => {
4546
4558
 
4547
4559
  const jsenvPluginGlobalScenarios = () => {
4548
4560
  const transformIfNeeded = (urlInfo) => {
4561
+ // Do not scan node modules for __DEV__/__BUILD__
4562
+ // - node modules won't have this in their code
4563
+ // - ;or should use other an other technic as this one won't be available
4564
+ // They would be discarded by content.includes detection
4565
+ // but it's cheaper to detect by URL than to scan potentially large files
4566
+ if (urlInfo.url.includes("/node_modules/")) {
4567
+ return null;
4568
+ }
4549
4569
  return {
4550
4570
  contentInjections: {
4551
4571
  __DEV__: INJECTIONS.optional(urlInfo.context.dev),
@@ -4615,6 +4635,14 @@ const jsenvPluginImportMetaCss = () => {
4615
4635
  appliesDuring: "*",
4616
4636
  transformUrlContent: {
4617
4637
  js_module: async (urlInfo) => {
4638
+ // Do not scan node modules for import.meta.css
4639
+ // - unlikely to be there
4640
+ // - we don't watch node modules (too expensive)
4641
+ // They would be discarded by content.includes detection
4642
+ // but it's cheaper to detect by URL than to scan potentially large files
4643
+ if (urlInfo.url.includes("/node_modules/")) {
4644
+ return null;
4645
+ }
4618
4646
  if (!urlInfo.content.includes("import.meta.css")) {
4619
4647
  return null;
4620
4648
  }
@@ -5073,6 +5101,14 @@ const jsenvPluginImportMetaHot = () => {
5073
5101
  cssUrlInfo.data.hotAcceptDependencies = [];
5074
5102
  },
5075
5103
  js_module: async (urlInfo) => {
5104
+ // Do not scan node modules for import.meta.hot
5105
+ // - unlikely to be there
5106
+ // - we don't watch node modules (too expensive)
5107
+ // They would be discarded by content.includes detection
5108
+ // but it's cheaper to detect by URL than to scan potentially large files
5109
+ if (urlInfo.url.includes("/node_modules/")) {
5110
+ return null;
5111
+ }
5076
5112
  if (!urlInfo.content.includes("import.meta.hot")) {
5077
5113
  return null;
5078
5114
  }
@@ -10190,6 +10226,8 @@ const startDevServer = async ({
10190
10226
  port,
10191
10227
  requestWaitingMs: 60_000,
10192
10228
  plugins: finalServerPlugins,
10229
+ // will allow to open file, provide more context on each route
10230
+ canExposeSensitiveData: true,
10193
10231
  });
10194
10232
  server.stoppedPromise.then((reason) => {
10195
10233
  onStop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "41.0.4",
3
+ "version": "41.0.5",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -81,7 +81,7 @@
81
81
  "@jsenv/plugin-minification": "1.7.3",
82
82
  "@jsenv/plugin-supervisor": "1.7.15",
83
83
  "@jsenv/plugin-transpilation": "1.5.70",
84
- "@jsenv/server": "17.0.3",
84
+ "@jsenv/server": "17.1.0",
85
85
  "@jsenv/sourcemap": "1.3.17",
86
86
  "react-table": "7.8.0"
87
87
  },
@@ -94,6 +94,7 @@
94
94
  "@jsenv/assert": "workspace:*",
95
95
  "@jsenv/cli": "workspace:*",
96
96
  "@jsenv/core": "./",
97
+ "@jsenv/database-manager": "workspace:*",
97
98
  "@jsenv/eslint-config-relax": "workspace:*",
98
99
  "@jsenv/file-size-impact": "workspace:*",
99
100
  "@jsenv/filesystem": "workspace:*",
@@ -108,7 +109,6 @@
108
109
  "@jsenv/os-metrics": "workspace:*",
109
110
  "@jsenv/performance-impact": "workspace:*",
110
111
  "@jsenv/plugin-as-js-classic": "workspace:*",
111
- "@jsenv/plugin-database-manager": "workspace:*",
112
112
  "@jsenv/runtime-compat": "workspace:*",
113
113
  "@jsenv/snapshot": "workspace:*",
114
114
  "@jsenv/terminal-table": "workspace:*",
@@ -271,6 +271,8 @@ export const startDevServer = async ({
271
271
  port,
272
272
  requestWaitingMs: 60_000,
273
273
  plugins: finalServerPlugins,
274
+ // will allow to open file, provide more context on each route
275
+ canExposeSensitiveData: true,
274
276
  });
275
277
  server.stoppedPromise.then((reason) => {
276
278
  onStop();
@@ -1,5 +1,6 @@
1
1
  import { URL_META } from "@jsenv/url-meta";
2
- import { urlToFilename } from "@jsenv/urls";
2
+ import { urlToFilename, urlToRelativeUrl } from "@jsenv/urls";
3
+
3
4
  import { defineNonEnumerableProperties } from "../../kitchen/errors.js";
4
5
 
5
6
  export const jsenvPluginDirectoryReferenceEffect = (
@@ -51,7 +52,11 @@ export const jsenvPluginDirectoryReferenceEffect = (
51
52
  }${urlToFilename(reference.url)}/`;
52
53
  } else if (reference.specifierPathname.endsWith("./")) {
53
54
  } else {
54
- reference.filenameHint = `${urlToFilename(reference.url)}/`;
55
+ const directoryRelativeUrl = urlToRelativeUrl(
56
+ reference.url,
57
+ reference.ownerUrlInfo.originalUrl,
58
+ );
59
+ reference.filenameHint = directoryRelativeUrl;
55
60
  }
56
61
  let actionForDirectory;
57
62
  if (reference.type === "a_href") {
@@ -9,6 +9,14 @@ import { INJECTIONS } from "../../kitchen/url_graph/url_info_injections.js";
9
9
 
10
10
  export const jsenvPluginGlobalScenarios = () => {
11
11
  const transformIfNeeded = (urlInfo) => {
12
+ // Do not scan node modules for __DEV__/__BUILD__
13
+ // - node modules won't have this in their code
14
+ // - ;or should use other an other technic as this one won't be available
15
+ // They would be discarded by content.includes detection
16
+ // but it's cheaper to detect by URL than to scan potentially large files
17
+ if (urlInfo.url.includes("/node_modules/")) {
18
+ return null;
19
+ }
12
20
  return {
13
21
  contentInjections: {
14
22
  __DEV__: INJECTIONS.optional(urlInfo.context.dev),
@@ -36,6 +36,14 @@ export const jsenvPluginImportMetaCss = () => {
36
36
  appliesDuring: "*",
37
37
  transformUrlContent: {
38
38
  js_module: async (urlInfo) => {
39
+ // Do not scan node modules for import.meta.css
40
+ // - unlikely to be there
41
+ // - we don't watch node modules (too expensive)
42
+ // They would be discarded by content.includes detection
43
+ // but it's cheaper to detect by URL than to scan potentially large files
44
+ if (urlInfo.url.includes("/node_modules/")) {
45
+ return null;
46
+ }
39
47
  if (!urlInfo.content.includes("import.meta.css")) {
40
48
  return null;
41
49
  }
@@ -53,6 +53,14 @@ export const jsenvPluginImportMetaHot = () => {
53
53
  cssUrlInfo.data.hotAcceptDependencies = [];
54
54
  },
55
55
  js_module: async (urlInfo) => {
56
+ // Do not scan node modules for import.meta.hot
57
+ // - unlikely to be there
58
+ // - we don't watch node modules (too expensive)
59
+ // They would be discarded by content.includes detection
60
+ // but it's cheaper to detect by URL than to scan potentially large files
61
+ if (urlInfo.url.includes("/node_modules/")) {
62
+ return null;
63
+ }
56
64
  if (!urlInfo.content.includes("import.meta.hot")) {
57
65
  return null;
58
66
  }
@@ -19,6 +19,14 @@ export const jsenvPluginImportMetaScenarios = () => {
19
19
  appliesDuring: "*",
20
20
  transformUrlContent: {
21
21
  js_module: async (urlInfo) => {
22
+ // Do not scan node modules for import.meta.dev/import.meta.build
23
+ // - node modules won't have this in their code
24
+ // - ;or should use other an other technic as this one won't be available
25
+ // They would be discarded by content.includes detection
26
+ // but it's cheaper to detect by URL than to scan potentially large files
27
+ if (urlInfo.url.includes("/node_modules/")) {
28
+ return null;
29
+ }
22
30
  if (
23
31
  !urlInfo.content.includes("import.meta.dev") &&
24
32
  !urlInfo.content.includes("import.meta.test") &&