chrome-devtools-frontend 1.0.965611 → 1.0.967596

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.
Files changed (61) hide show
  1. package/config/gni/devtools_grd_files.gni +6 -5
  2. package/front_end/core/i18n/locales/en-US.json +3 -0
  3. package/front_end/core/i18n/locales/en-XL.json +3 -0
  4. package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
  5. package/front_end/core/sdk/CSSQuery.ts +1 -1
  6. package/front_end/core/sdk/CSSRule.ts +6 -6
  7. package/front_end/core/sdk/CSSSupports.ts +30 -0
  8. package/front_end/core/sdk/NetworkManager.ts +58 -70
  9. package/front_end/core/sdk/sdk.ts +2 -0
  10. package/front_end/devtools_compatibility.js +19 -0
  11. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +4 -4
  12. package/front_end/generated/InspectorBackendCommands.js +27 -2
  13. package/front_end/generated/protocol.ts +61 -0
  14. package/front_end/legacy_test_runner/bindings_test_runner/PersistenceTestRunner.js +2 -2
  15. package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +1 -0
  16. package/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js +1 -2
  17. package/front_end/models/extensions/ExtensionServer.ts +7 -1
  18. package/front_end/models/javascript_metadata/NativeFunctions.js +18 -21
  19. package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
  20. package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -4
  21. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +10 -2
  22. package/front_end/panels/application/components/interestGroupAccessGrid.css +1 -1
  23. package/front_end/panels/application/interestGroupStorageView.css +4 -0
  24. package/front_end/panels/elements/StylePropertyTreeElement.ts +14 -2
  25. package/front_end/panels/elements/StylesSidebarPane.ts +33 -11
  26. package/front_end/panels/event_listeners/EventListenersUtils.ts +3 -2
  27. package/front_end/panels/event_listeners/EventListenersView.ts +3 -3
  28. package/front_end/panels/lighthouse/lighthouse.ts +1 -1
  29. package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
  30. package/front_end/panels/sources/SourcesPanel.ts +7 -10
  31. package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
  32. package/front_end/panels/sources/debuggerPausedMessage.css +5 -1
  33. package/front_end/third_party/codemirror/README.chromium +5 -0
  34. package/front_end/third_party/codemirror/codemirror-tsconfig.json +4 -4
  35. package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.js → runmode-standalone.mjs} +0 -0
  36. package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.d.ts → runmode-standalone.mjs.d.ts} +0 -0
  37. package/front_end/third_party/codemirror/package/mode/css/{css.js → css.mjs} +0 -0
  38. package/front_end/third_party/codemirror/package/mode/css/{css.d.ts → css.mjs.d.ts} +0 -0
  39. package/front_end/third_party/codemirror/package/mode/javascript/{javascript.js → javascript.mjs} +0 -0
  40. package/front_end/third_party/codemirror/package/mode/javascript/{javascript.d.ts → javascript.mjs.d.ts} +0 -0
  41. package/front_end/third_party/codemirror/package/mode/xml/{xml.js → xml.mjs} +0 -0
  42. package/front_end/third_party/codemirror/package/mode/xml/{xml.d.ts → xml.mjs.d.ts} +0 -0
  43. package/front_end/third_party/lighthouse/README.chromium +0 -1
  44. package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +1 -1
  45. package/front_end/third_party/lighthouse/report-assets/{report-generator.js → report-generator.mjs} +0 -0
  46. package/front_end/third_party/lighthouse/report-assets/{report-generator.d.ts → report-generator.mjs.d.ts} +0 -0
  47. package/front_end/third_party/puppeteer/puppeteer.ts +1 -2
  48. package/front_end/ui/components/text_editor/config.ts +1 -0
  49. package/front_end/ui/legacy/Icon.ts +2 -2
  50. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
  51. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -4
  52. package/front_end/ui/legacy/themeColors.css +1 -1
  53. package/package.json +2 -1
  54. package/scripts/build/devtools_plugin.js +11 -0
  55. package/scripts/build/esbuild.js +63 -0
  56. package/scripts/build/ninja/bundle.gni +77 -32
  57. package/scripts/build/ninja/minify-json-files.js +19 -0
  58. package/scripts/build/ninja/minify_json.gni +28 -0
  59. package/scripts/build/tests/plugins_test.js +30 -0
  60. package/scripts/javascript_natives/index.js +9 -6
  61. package/scripts/javascript_natives/package.json +4 -4
@@ -20,3 +20,8 @@ wget -qO- https://registry.npmjs.org/codemirror/-/codemirror-5.61.0.tgz | tar xz
20
20
  Local changes applied:
21
21
  - Run `wget -qOpackage/mode/wast/wast.js https://raw.githubusercontent.com/codemirror/CodeMirror/0bf9231f90925acc7b273ef9aaf89730ddf6e07b/mode/wast/wast.js` to synchronize unreleased changes for WebAssembly disassembly syntax highlighting.
22
22
  - Some files have a `.d.ts` file added, as they are used during TypeScript compilation
23
+ - Change extension of following files from `.js` to `.mjs`.
24
+ - package/addon/runmode/runmode-standalone.js
25
+ - package/mode/css/css.js
26
+ - package/mode/javascript/javascript.js
27
+ - package/mode/xml/xml.js
@@ -3,9 +3,9 @@
3
3
  "composite": true
4
4
  },
5
5
  "files": [
6
- "package/addon/runmode/runmode-standalone.js",
7
- "package/mode/css/css.js",
8
- "package/mode/javascript/javascript.js",
9
- "package/mode/xml/xml.js"
6
+ "package/addon/runmode/runmode-standalone.mjs",
7
+ "package/mode/css/css.mjs",
8
+ "package/mode/javascript/javascript.mjs",
9
+ "package/mode/xml/xml.mjs"
10
10
  ]
11
11
  }
@@ -5,4 +5,3 @@ License: Apache License 2.0
5
5
  Security Critical: no
6
6
 
7
7
  This directory contains Chromium's version of the lighthouse report assets, including renderer.
8
-
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "files": [
6
6
  "report-assets/report.js",
7
- "report-assets/report-generator.js",
7
+ "report-assets/report-generator.mjs",
8
8
  "lighthouse-dt-bundle.js"
9
9
  ]
10
10
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { Browser } from './package/lib/esm/puppeteer/common/Browser.js';
6
6
  import { Connection } from './package/lib/esm/puppeteer/common/Connection.js';
7
- import { ConnectionTransport } from './package/lib/esm/puppeteer/common/ConnectionTransport.js';
7
+ import { type ConnectionTransport } from './package/lib/esm/puppeteer/common/ConnectionTransport.js';
8
8
  import { Frame } from './package/lib/esm/puppeteer/common/FrameManager.js';
9
9
  import { ElementHandle } from './package/lib/esm/puppeteer/common/JSHandle.js';
10
10
  import { Page } from './package/lib/esm/puppeteer/common/Page.js';
@@ -17,4 +17,3 @@ export {
17
17
  Frame,
18
18
  Page,
19
19
  };
20
-
@@ -188,6 +188,7 @@ function detectLineSeparator(text: string): CM.Extension {
188
188
 
189
189
  const baseKeymap = CM.keymap.of([
190
190
  {key: 'Tab', run: CM.acceptCompletion},
191
+ {key: 'End', run: CM.acceptCompletion},
191
192
  {key: 'Ctrl-m', run: CM.cursorMatchingBracket, shift: CM.selectMatchingBracket},
192
193
  {key: 'Mod-/', run: CM.toggleComment},
193
194
  {key: 'Mod-d', run: CM.selectNextOccurrence},
@@ -131,8 +131,8 @@ const initialDescriptors = new Map<string, Descriptor>([
131
131
  ['smallicon-warning', {position: 'd1', spritesheet: 'smallicons'}],
132
132
  ['smallicon-network-product', {position: 'e1', spritesheet: 'smallicons'}],
133
133
  ['smallicon-clear-warning', {position: 'f1', spritesheet: 'smallicons', isMask: true}],
134
- ['smallicon-clear-info', {position: 'f2', spritesheet: 'smallicons'}],
135
- ['smallicon-clear-error', {position: 'f3', spritesheet: 'smallicons'}],
134
+ ['smallicon-clear-info', {position: 'f2', spritesheet: 'smallicons', isMask: true}],
135
+ ['smallicon-clear-error', {position: 'f3', spritesheet: 'smallicons', isMask: true}],
136
136
  ['smallicon-account-circle', {position: 'f4', spritesheet: 'smallicons'}],
137
137
  ['smallicon-videoplayer-paused', {position: 'f6', spritesheet: 'smallicons', isMask: true}],
138
138
  ['smallicon-videoplayer-playing', {position: 'g6', spritesheet: 'smallicons', isMask: true}],
@@ -677,7 +677,7 @@ export class CookiesTable extends UI.Widget.VBox {
677
677
  cookie.addAttribute(
678
678
  SDK.Cookie.Attributes.SourcePort, Number.parseInt(data[SDK.Cookie.Attributes.SourcePort], 10) || undefined);
679
679
  }
680
- if (SDK.Cookie.Attributes.PartitionKey in data) {
680
+ if (data[SDK.Cookie.Attributes.PartitionKey]) {
681
681
  cookie.addAttribute(SDK.Cookie.Attributes.PartitionKey, data[SDK.Cookie.Attributes.PartitionKey]);
682
682
  }
683
683
  cookie.setSize(data[SDK.Cookie.Attributes.Name].length + data[SDK.Cookie.Attributes.Value].length);
@@ -1612,12 +1612,12 @@ export class Renderer implements UI.UIUtils.Renderer {
1612
1612
  return rendererInstance;
1613
1613
  }
1614
1614
 
1615
- render(object: Object, options?: UI.UIUtils.Options): Promise<{
1615
+ async render(object: Object, options?: UI.UIUtils.Options): Promise<{
1616
1616
  node: Node,
1617
1617
  tree: UI.TreeOutline.TreeOutline|null,
1618
1618
  }|null> {
1619
1619
  if (!(object instanceof SDK.RemoteObject.RemoteObject)) {
1620
- return Promise.reject(new Error('Can\'t render ' + object));
1620
+ throw new Error('Can\'t render ' + object);
1621
1621
  }
1622
1622
  options = options || {title: undefined, editable: undefined};
1623
1623
  const title = options.title;
@@ -1626,10 +1626,10 @@ export class Renderer implements UI.UIUtils.Renderer {
1626
1626
  section.titleLessMode();
1627
1627
  }
1628
1628
  section.editable = Boolean(options.editable);
1629
- return Promise.resolve(({node: section.element, tree: section} as {
1629
+ return {node: section.element, tree: section} as {
1630
1630
  node: Node,
1631
1631
  tree: UI.TreeOutline.TreeOutline | null,
1632
- } | null));
1632
+ } | null;
1633
1633
  }
1634
1634
  }
1635
1635
 
@@ -267,7 +267,7 @@
267
267
  --color-input-text-disabled: rgba(128 134 139 / 70%);
268
268
  /* Colors for styling buttons */
269
269
  --color-button-outline-focus: rgb(138 180 248 / 75%);
270
- --color-button-primary-background-hovering: rgb(174 203 250 / 100%);
270
+ --color-button-primary-background-hovering: rgb(128 167 229 / 100%);
271
271
  --color-button-primary-background-pressed: rgb(210 227 252 / 100%);
272
272
  --color-button-primary-text: rgb(0 0 0);
273
273
  --color-button-secondary-background-hovering: rgb(138 180 248 / 15%);
package/package.json CHANGED
@@ -39,6 +39,7 @@
39
39
  "debug-unittest": "DEBUG_TEST=1 npm run unittest",
40
40
  "e2etest": "third_party/node/node.py --output scripts/test/run_test_suite.js --config=test/e2e/test-runner-config.json",
41
41
  "eslint-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/eslint_rules/tests/*_test.js\"",
42
+ "build-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/build/tests/*_test.js\"",
42
43
  "generate-dark-mode-styles": "third_party/node/node.py --output scripts/dark_mode/generate_dark_theme_sheet.js",
43
44
  "generate-protocol-resources": "scripts/deps/generate_protocol_resources.py && git cl format --js",
44
45
  "install-deps": "scripts/deps/manage_node_deps.py",
@@ -53,5 +54,5 @@
53
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
56
  },
56
- "version": "1.0.965611"
57
+ "version": "1.0.967596"
57
58
  }
@@ -42,6 +42,17 @@ function devtoolsPlugin(source, importer) {
42
42
  if (!importer) {
43
43
  return null;
44
44
  }
45
+
46
+ if (source === '../../lib/codemirror' || !source.startsWith('.')) {
47
+ // These are imported via require(...), but we don't use
48
+ // @rollup/plugin-commonjs. So this check is not necessary for rollup. But
49
+ // need to have this for esbuild as it doesn't ignore require(...).
50
+ return {
51
+ id: source,
52
+ external: true,
53
+ };
54
+ }
55
+
45
56
  const currentDirectory = path.normalize(dirnameWithSeparator(importer));
46
57
  const importedFilelocation = path.normalize(path.join(currentDirectory, source));
47
58
  const importedFileDirectory = dirnameWithSeparator(importedFilelocation);
@@ -0,0 +1,63 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ // @ts-check
6
+
7
+ const path = require('path');
8
+
9
+ const devtools_paths = require('../devtools_paths.js');
10
+ const devtools_plugin = require('./devtools_plugin.js');
11
+
12
+ // esbuild module uses binary in this path.
13
+ process.env.ESBUILD_BINARY_PATH = path.join(devtools_paths.devtoolsRootPath(), 'third_party', 'esbuild', 'esbuild');
14
+
15
+ const entryPoints = [process.argv[2]];
16
+ const outfile = process.argv[3];
17
+
18
+ const outdir = path.dirname(outfile);
19
+
20
+ const plugin = {
21
+ name: 'devtools-plugin',
22
+ setup(build) {
23
+ // https://esbuild.github.io/plugins/#on-resolve
24
+ build.onResolve({filter: /.*/}, args => {
25
+ const res = devtools_plugin.devtoolsPlugin(args.path, args.importer);
26
+ if (!res) {
27
+ return null;
28
+ }
29
+
30
+ if (res.external) {
31
+ // res.id can be both of absolutized local JavaScript path or node's
32
+ // builtin module (e.g. 'fs', 'path'), and only relativize the path in
33
+ // former case.
34
+ if (path.isAbsolute(res.id)) {
35
+ res.id = './' + path.relative(outdir, res.id);
36
+ }
37
+
38
+ return {
39
+ external: res.external,
40
+ path: res.id,
41
+ };
42
+ }
43
+
44
+ return {
45
+ path: res.id,
46
+ };
47
+ });
48
+ },
49
+ };
50
+
51
+ require('esbuild')
52
+ .build({
53
+ entryPoints,
54
+ outfile,
55
+ bundle: true,
56
+ format: 'esm',
57
+ platform: 'browser',
58
+ plugins: [plugin],
59
+ })
60
+ .catch(err => {
61
+ console.error('failed to run esbuild:', err);
62
+ process.exit(1);
63
+ });
@@ -2,46 +2,91 @@
2
2
  # Use of this source code is governed by a BSD-style license that can be
3
3
  # found in the LICENSE file.
4
4
 
5
+ import("../../../third_party/typescript/typescript.gni")
5
6
  import("./node.gni")
6
7
  import("./vars.gni")
7
8
 
9
+ declare_args() {
10
+ # If this is enabled, devtools build uses esbuild instead of rollup.js to
11
+ # bundle JavaScript files.
12
+ devtools_fast_bundle = devtools_skip_typecheck
13
+ }
14
+
15
+ assert(!(devtools_fast_bundle && is_official_build),
16
+ "Official build should not bundle with esbuild")
17
+
8
18
  template("bundle") {
9
19
  assert(defined(invoker.entrypoint),
10
20
  "You must define the 'entrypoint' for a bundle target")
11
21
 
12
- node_action(target_name) {
13
- script = "node_modules/rollup/dist/bin/rollup"
14
-
15
- forward_variables_from(invoker,
16
- [
17
- "visibility",
18
- "deps",
19
- "public_deps",
20
- ])
21
-
22
- inputs = [
23
- invoker.entrypoint,
24
- devtools_location_prepend + "scripts/build/rollup.config.js",
25
- ]
26
-
27
- args = [
28
- # TODO(crbug.com/1098074): We need to hide warnings that are written stderr,
29
- # as Chromium does not process the returncode of the subprocess correctly
30
- # and instead looks if `stderr` is empty.
31
- "--silent",
32
- "--config",
33
- rebase_path(devtools_location_prepend + "scripts/build/rollup.config.js",
34
- root_build_dir),
35
- "--input",
36
- rebase_path(invoker.entrypoint, root_build_dir),
37
- "--file",
38
- rebase_path(invoker.output_file_location, root_build_dir),
39
- ]
40
-
41
- if (!devtools_dcheck_always_on) {
42
- args += [ "--configDCHECK" ]
22
+ if (devtools_fast_bundle) {
23
+ node_action(target_name) {
24
+ script = "scripts/build/esbuild.js"
25
+ forward_variables_from(invoker,
26
+ [
27
+ "visibility",
28
+ "deps",
29
+ "public_deps",
30
+ ])
31
+
32
+ inputs = [
33
+ invoker.entrypoint,
34
+ devtools_location_prepend + "scripts/build/devtools_plugin.js",
35
+ devtools_location_prepend + "scripts/devtools_paths.js",
36
+ ]
37
+
38
+ _esbuild = devtools_location_prepend + "third_party/esbuild/esbuild"
39
+ if (host_os == "win") {
40
+ inputs += [ _esbuild + ".exe" ]
41
+ } else {
42
+ inputs += [ _esbuild ]
43
+ }
44
+
45
+ args = [
46
+ rebase_path(invoker.entrypoint, root_build_dir),
47
+ rebase_path(invoker.output_file_location, root_build_dir),
48
+ ]
49
+
50
+ outputs = [ invoker.output_file_location ]
43
51
  }
52
+ } else {
53
+ node_action(target_name) {
54
+ script = "node_modules/rollup/dist/bin/rollup"
55
+
56
+ forward_variables_from(invoker,
57
+ [
58
+ "visibility",
59
+ "deps",
60
+ "public_deps",
61
+ ])
62
+
63
+ inputs = [
64
+ invoker.entrypoint,
65
+ devtools_location_prepend + "scripts/build/rollup.config.js",
66
+ devtools_location_prepend + "scripts/build/devtools_plugin.js",
67
+ devtools_location_prepend + "scripts/devtools_paths.js",
68
+ ]
44
69
 
45
- outputs = [ invoker.output_file_location ]
70
+ args = [
71
+ # TODO(crbug.com/1098074): We need to hide warnings that are written stderr,
72
+ # as Chromium does not process the returncode of the subprocess correctly
73
+ # and instead looks if `stderr` is empty.
74
+ "--silent",
75
+ "--config",
76
+ rebase_path(
77
+ devtools_location_prepend + "scripts/build/rollup.config.js",
78
+ root_build_dir),
79
+ "--input",
80
+ rebase_path(invoker.entrypoint, root_build_dir),
81
+ "--file",
82
+ rebase_path(invoker.output_file_location, root_build_dir),
83
+ ]
84
+
85
+ if (!devtools_dcheck_always_on) {
86
+ args += [ "--configDCHECK" ]
87
+ }
88
+
89
+ outputs = [ invoker.output_file_location ]
90
+ }
46
91
  }
47
92
  }
@@ -0,0 +1,19 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const {writeIfChanged} = require('./write-if-changed.js');
8
+
9
+ const [, , src, dest, files] = process.argv;
10
+
11
+ for (const file of files.split(',')) {
12
+ const srcPath = path.join(src, file);
13
+ const destPath = path.join(dest, file);
14
+
15
+ // Minifying JSON is straight-forward as JSON.stringify omits whitespace.
16
+ const srcContents = fs.readFileSync(srcPath);
17
+ const destContents = JSON.stringify(JSON.parse(srcContents));
18
+ writeIfChanged(destPath, destContents);
19
+ }
@@ -0,0 +1,28 @@
1
+ # Copyright 2022 The Chromium Authors. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ import("./node.gni")
6
+ import("./vars.gni")
7
+
8
+ template("minify_json") {
9
+ node_action(target_name) {
10
+ forward_variables_from(invoker, [ "sources" ])
11
+
12
+ script = "scripts/build/ninja/minify-json-files.js"
13
+
14
+ _src = rebase_path(".", root_build_dir)
15
+ _dest = rebase_path(target_gen_dir, root_build_dir)
16
+
17
+ args = [
18
+ _src,
19
+ _dest,
20
+ string_join(",", sources),
21
+ ]
22
+
23
+ outputs = []
24
+ foreach(_input, sources) {
25
+ outputs += [ "$target_gen_dir/$_input" ]
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,30 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ const {assert} = require('chai');
6
+ const path = require('path');
7
+
8
+ const {devtoolsPlugin} = require('../devtools_plugin.js');
9
+
10
+ describe('devtools_plugin can compute paths with', () => {
11
+ it('same directory import', () => {
12
+ assert.deepEqual(
13
+ devtoolsPlugin('./AnotherFile.js', 'front_end/core/sdk/FirstFile.js'),
14
+ {id: path.join('front_end', 'core', 'sdk', 'AnotherFile.js'), external: false});
15
+ });
16
+
17
+ it('different directory import', () => {
18
+ assert.deepEqual(
19
+ devtoolsPlugin('../common/common.js', 'front_end/core/sdk/FirstFile.js'),
20
+ {id: path.join('front_end', 'core', 'common', 'common.js'), external: true});
21
+ });
22
+
23
+ it('node built-in modules', () => {
24
+ assert.deepEqual(devtoolsPlugin('fs', 'scripts/some-script.js'), {id: 'fs', external: true});
25
+ });
26
+
27
+ it('importing generated files', () => {
28
+ assert.strictEqual(devtoolsPlugin('../../generated/Protocol.js', 'front_end/core/sdk/FirstFile.js'), null);
29
+ });
30
+ });
@@ -10,11 +10,14 @@ import * as WebIDL2 from 'webidl2';
10
10
 
11
11
  import {parseTSFunction, postProcess, walkRoot} from './helpers.js';
12
12
 
13
- const program = ts.createProgram(
14
- [
15
- new URL('node_modules/typescript/lib/lib.esnext.d.ts', import.meta.url).pathname,
16
- ],
17
- {noLib: false, types: []});
13
+ if (process.argv.length !== 4) {
14
+ throw new Error('Please provide path to chromium/src and devtools-frontend');
15
+ }
16
+
17
+ const chromiumSource = process.argv[2];
18
+ const typescriptSource = process.argv[3] + 'node_modules/typescript/lib/lib.esnext.d.ts';
19
+
20
+ const program = ts.createProgram([typescriptSource], {noLib: false, types: []});
18
21
 
19
22
  for (const file of program.getSourceFiles()) {
20
23
  ts.forEachChild(file, node => {
@@ -36,7 +39,7 @@ for (const file of program.getSourceFiles()) {
36
39
  // `devtools/devtools-frontend`, where `devtools` is on the same level
37
40
  // as `chromium`. This matches `scripts/npm_test.js`.
38
41
  const files =
39
- glob.sync('../../../../chromium/src/third_party/blink/renderer/+(core|modules)/**/*.idl', {cwd: process.env.PWD});
42
+ glob.sync(`${chromiumSource}/third_party/blink/renderer/+(core|modules)/**/*.idl`, {cwd: process.env.PWD});
40
43
 
41
44
  for (const file of files) {
42
45
  if (file.includes('testing')) {
@@ -7,10 +7,10 @@
7
7
  },
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@types/webidl2": "^23.13.6",
11
- "glob": "^7.1.2",
12
- "mocha": "^9.1.4",
10
+ "@types/webidl2": "23.13.6",
11
+ "glob": "7.1.7",
12
+ "mocha": "9.1.3",
13
13
  "typescript": "latest",
14
- "webidl2": "^24.2.0"
14
+ "webidl2": "24.2.0"
15
15
  }
16
16
  }