Commit Graph
94 Commits
Author SHA1 Message Date
Jack Franklin 60cc8ba371 Upgrade DevTools Frontend to Puppeteer 7.0.4
DISABLE_THIRD_PARTY_CHECK=upgrading pptr

Bug: none
Change-Id: I3b0672d209bd6a35ab0eed7db7cc158cc40039dc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2678700
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-10 14:07:38 +00:00
Jack Franklin 49a9481a74 Lint color usage in background and border-* properties.
The list of CSS properties we check for colors wasn't thorough and
didn't include `border-left/right/top/bottom` or `background` on its
own. This CL fixes that and disables the rule for any current
violations.

Bug: 1152736
Change-Id: Ic732d653fdfab0462a04dc891bcece1f44e5d471
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-02-05 15:39:39 +00:00
Jack Franklin 8064d3ba7a Lint against non-theme-color variables
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.

There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.

Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.

Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-03 11:02:09 +00:00
Jack Franklin 40b5fb67b3 Remove python script for generating dark mode CSS
Now devtools_paths.js exists, we can use JS and remove the Python
version completely. This unblocks further work to enforce that
`.darkmode.css` files are up to date as part of a PRESUBMIT.

Bug: chromium:1164945
Change-Id: Ie9e8fa1cd5287d8e444085d7f036a4b17c99eda9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662976
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-01 14:51:37 +00:00
Simon Zünd 9c429fb138 Introduce new script to check external links
This CL introduces "npm run check-external-links". The check parses
all string literals in first party JS/TS code for Urls. All the Urls
are then "pinged" by making a HEAD request to verify they still point
to an active resource. Example output:

  $ time npm run check-external-links

  > chrome-devtools-frontend@ check-external-links /usr/local/google/home/szuend/dev/devtools/devtools-frontend
  > third_party/node/node.py --output scripts/check_external_links.js

  Collecting JS/TS source files ... 1019 files found.
  Collecting Urls from files ...248 unique Urls found.
  Sending a HEAD request to each one ...

  All Urls are accessible and point to existing resources.

  npm run check-external-links  9.21s user 0.40s system 149% cpu 6.415 total

Please note that we can't make this check part of our PRESUBMIT, as
it makes external requests.
Also note that this check can't be implemented as an ESLint rule,
as ESLint rules are not allowed to have an async workload.

R=aerotwist@chromium.org, sigurds@chromium.org

Bug: chromium:1170310
Change-Id: I064161dd9038143d2e360c1716f8fb622dc119ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2659021
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-01 08:33:44 +00:00
Jack Franklin 5afc7fed57 Lint inline CSS inside .ts components
This CL introduces a new lint which runs CSS linting against our
TypeScript files, and changes the CSS to pass the linting.

Bug: chromium:1166108
Change-Id: Idb8dcf00d7c578f8db0e91633c89ae92ca85bcd8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2635655
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-01-18 15:12:36 +00:00
Jack Franklin bc30234f61 Migrate run_lint_check_css to JS script
As part of the work to move more scripts to Node, not Python, over time,
picked this one as the starting point. I changed its API slightly to
allow more flags to be taken in, as we'll need that to do a stylelint
pass against TypeScript files, but I will do that in a subsequent CL.

I had to make quite a few changes to devtools_paths.js, but I think it's
now calculating paths correctly. It took a bit of messing to get the
equivalent of Python's path.abspath(__file__), as you'll see from the
large comment that tries to explain what's going on!

Bug: chromium:1166108, chromium:1166572
Change-Id: Ia0b19ff8956b2ede2447530be57876a88046887e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2631113
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-18 10:30:12 +00:00
Tim van der Lippe 1fe7f95b0e Add eslint-plugin-lit-a11y to manage_node_deps
This also adds the MPL-2.0 license as valid license to our allowed
licenses list.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=NPM update

Change-Id: I2a3bee2ffc0b328a0579ab62ab27f938bdc876c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593130
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-05 13:13:19 +00:00
Jack Franklin 81eb91a605 Script to generate dark mode stylesheets
This CL provides a script that generates a dark mode stylesheet for a
given sheet, just like the runtime color patching (in fact, it uses the
same code!).

The script loads up the given CSS file, imports `ThemeSupport`, and
patches it. It then takes the final CSS file and prefixes
`:host-context(.-theme-with-dark-background)` to each selector. We can
then load the lightmode and the dark mode stylesheet into DevTools.

This is non ideal because we end up loading two stylesheets, but the
alternative is to maintain the runtime color patching for ever, or
update all third party stylesheets to use our CSS variables, which is a
lot of work.

The script does rely on the hosted mode server running but I think this
is reasonable; it's only going to be run rarely on a few CSS files, so
we won't be running it automatically on CI or anything so we can keep
the process fairly manual.

Bug: 1152736
Change-Id: I707c53fbccb3e03c9fac6691f40df32bcdb17c1f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2587024
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-12-14 10:47:31 +00:00
Tim van der Lippe fd6e13bee3 Fix proxy configuration for images when debugging Karma tests
When debugging Karma tests, all network requests for /Images would
return 400 errors. It turns out that the proxypath we were redirecting
towards should include the full base url, including the target dir,
like we did for locales.

R=szuend@chromium.org

Fixed: 1153339
Change-Id: I34b39f28254f1e0011ce96a34a22f0f31468b064
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571463
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-08 11:13:32 +00:00
Tim van der Lippe 8e12f92229 Use Python version bundled with depot_tools for all scripts
depot_tools ships a "vpython" binary that is added to the $PATH
for all Chromium engineers. This binary is versioned by depot_tools
which we roll in ourselves as part of `gclient sync`.

By using `vpython` instead of `python`, we are no longer depended
on the Python version installed locally and instead use the version
we pull in from DEPS.

R=liviurau@chromium.org

Change-Id: If49a54c24b6cf129ff843cd9ca1140a723a78afb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571462
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-04 14:08:59 +00:00
Jack Franklin 3b3a782f3a Enable interaction tests
This CL introduces the infrastructure and first test for what we're calling
"Interaction tests". These are tests that can be used to test component
behaviour that cannot be tested via Karma unit tests but don't require an e2e
test either.

The best example here is complex user interactions: clicking and dragging a
mouse, or doing multiple tabs to navigate through the UI.

Note that the one interaction test added here for theme_colors isn't the best
example of a complex test, but it's a test that's good enough for now whilst we
get everything set up on infrastructure and make sure it runs without flaking.

Bug: 1153281
Change-Id: Ifb37639a557c459974f703b8954ae68a93d5d368
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566808
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-03 10:44:22 +00:00
Jack Franklin c4492956ad Remove component bridges generation
Now Closure is gone we don't need bridges and this removes all the code
and tests for them.

All relevant checks we wanted to keep around have been moved to ESLint
rules (see attached bug).

Fixed: 1130536
Change-Id: I82a7b8e5e7b047b36f42c5c76ddb9dfbd0742d45
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2565377
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-30 17:33:11 +00:00
Tim van der Lippe 7104ca0b6b Cleanup package.json scripts
These scripts should have been removed as part of
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I82c64e158fcf27d0c6adedff06e4bc97fc1fe1e8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560250
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-25 13:41:37 +00:00
Tim van der Lippe 16534e267d Remove Python infrastructure for the Closure Compiler
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I2ae75adec9fc47eedc410b4f066342ed3fb0a136
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560245
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-25 12:39:37 +00:00
Jack Franklin 5006ab2f52 Fix bad gen in npm bridges script
The gen directory doesn't exist any more, we generate to the same dir as
the source code.

Change-Id: Icf90df81c3c8cdbd849de116633c14a28b164046
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479135
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-16 11:32:27 +00:00
Changhao Han 1100a6c15f Fix generate-bridge-file script path
It seems like the old "cli.js" lives inside a folder called "gen", but
this folder has been removed recently. The npm script has not been
updated. This CL updates the npm script for this.

Change-Id: If1c7e5128a0d1f14d784982e2c801b661f6e232e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2470622
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-14 09:01:10 +00:00
Jack Franklin 102df67838 Fix component bridges tests
A recent TS config change elsewhere had caused these tests not to
compile with the error of:

```
error TS6307: File '/Users/jacktfranklin/src/devtools/devtools-frontend/scripts/component_bridges/value_for_type_node.ts' is not listed within the file list of project '/Users/jacktfranklin/src/devtools/devtools-frontend/test/unittests/scripts/component_bridges/tsconfig.json'.
```

The fix is to mark the dependency from the unit tests as a TS project
reference, and then generate output in the same place as the source, so
that import paths don't need to change.

This isn't ideal, and we would use ts_library if doing this now, but
this code pre-dates ts_library and also is only going to be around for
the length of the TypeScriptification work, so it doesn't feel worth the
effort to restructure it.

Change-Id: I9a924bf3e2ed945dd22ce233eda2c8c15f3193c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466188
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-10-13 10:35:14 +00:00
Maksim Sadym d53ca9807f Respect additional arguments in npm targets
Make following targets respect additional arguments, so that `--chrome-binary=[LOCATION] --chrome-features=[FEATURES]` can be used.
* `auto-debug-e2etest`
* `auto-debug-unittest`
* `auto-e2etest`

Bug: 1130513
Change-Id: I416dd08cc38597355d98ec43029e639716762296
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2422946
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
2020-09-22 10:24:34 +00:00
Jack Franklin d557298f36 Add npm run auto-debug-unittest
To match the npm run auto-debug-e2etest command.

Change-Id: I06b7cb4b4a92d9bd986d25faf0a72554402e512e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409954
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-09-16 12:05:17 +00:00
Tim van der Lippe 5f83b28dd7 Update TypeScript to 4.0.2
DISABLE_THIRD_PARTY_CHECK=Updating TypeScript
R=szuend@chromium.org

Fixed: 1120303
Change-Id: I342cfacaf25c4b450bb00703454fe69db4b6f3cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367944
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-21 13:17:14 +00:00
Jack Franklin 580a4b1d52 Script to re-generate all bridges
This script will regenerate all _bridge.js files, which will be useful when we
come to fixing bugs in the generation and need to apply that across the entire
codebase.

Change-Id: Id2a12f9b134564f221ff49d7beb92861544c0dcf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332809
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-08-04 22:35:39 +00:00
Peter Marshall 9c4cbce5ab Set env to disable chromium download in manage_node_deps.py
Previously this was set in package.json which assumed the script would
not be run directly.

Set it in the script instead so it can be run directly.

Change-Id: I96d7f9d4589585d1a83655c6b1967e1a89ba7958
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279843
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-06 14:30:42 +00:00
Paul Lewis ee1b328d6a [Watch] Changes autoninja target
We are building the :front_end target when files change, but this
doesn't seem to be broad enough to ensure we build on all changes. This
CL updates the target to devtools_frontend_resources, which does seem to
be a broader target.

This CL also includes a drive-by fix so that the output is sent to
stdout.

Bug: 1098694
Change-Id: I1d02cc0226767377aa4729af3cf3a734ec774026
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2278471
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-02 10:59:39 +00:00
Paul Lewis 64ba20b911 Adds watch mode for rebuillding changes
Since we are moving to running from built content in the gen/ directory,
we need to have a watcher to ensure convenience for anyone working on
the codebase. This CL introduces a watcher that calls autoninja whenever
a file is changed in the front_end folder. It also updates node.py so
that it outputs the contents of stdout and stderr when the --output flag
is set.

R=tvanderlippe@chromium.org

DISABLE_THIRD_PARTY_CHECK=Updating node alongside relevant changes

Bug: 1098694
Change-Id: I4ddb3d250d0fd80455ea24e95055de74b2be879c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2272559
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-29 15:32:58 +00:00
Paul Lewis 5ad7492821 Update node.py to allow logging
The node.py script does not currently output stdout or stderr, which for
ninja-based work makes total sense. However, when using it in more
general contexts (including debugging), having access to stdout and
stderr is useful. This CL allows the addition of --output as the first
argument to node.py, which, if found, will disable the piping of stdout
and stderr, allowing the developer to see their contents.

DISABLE_THIRD_PARTY_CHECK=Update package.json in line with node.py

Change-Id: Icfdd5479a391539dcf8b17e8d2180b5223ee1ea8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2273180
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-29 14:40:33 +00:00
Tim van der Lippe fe75007069 Run e2e-tests on build output
The e2e-tests now use the build output in resources/inspector in
the out directory. This allows us to introduce TypeScript-authored
files in the source directory `front_end`, which will get compiled
into resourc/inspector.

After to making a change to a e2e-test or the front_end, you need
to rebuild Devtools, after which you can run `npm run e2etest` as
normal.

Since we now use the build output, this also means that you can
run the e2e-tests on the release build. In other words, if you
build DevTools with build optimizations (such as Rollup), the
e2e-tests will now use the output (and thus provide test coverage).

DISABLE_THIRD_PARTY_CHECK=Node fixes
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Fixed: 1088463
Change-Id: I02ec3c2476bc3647158fede9e1d347963b3a720a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224809
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-06-29 11:35:23 +00:00
Mathias Bynens 1b2c5e463e Enable stylelint on presubmit
Bug: chromium:1083142
Change-Id: I74136f2ba5b74d4385760e157e2495d706cb5c35
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2248184
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-18 10:41:46 +00:00
Tim van der Lippe 8dcbdb8aeb Remove npm run start script
It is superseded by the runtime flag `--custom-devtools-frontend`,
as documented in our README.

We can no longer keep this script around, as it blocks the inclusion
of TypeScript-authored files in the source tree.

R=yangguo@chromium.org,Rob.Paveza@microsoft.com

Design-Doc: https://docs.google.com/document/d/1COgCBWWuTh2o-Zbp6h_z0h0LtlJaimaEDsION4RZPxc/edit
Bug: 1061037, 1011811
Change-Id: Id7a347f28acf7a3a065c5c3dea4e74443d4ac7ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247653
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-06-17 11:33:07 +00:00
Mathias Bynens 8a163a0661 Use the bundled node binary for all npm scripts
It was previously only done for 1 out of 12 scripts.

DISABLE_THIRD_PARTY_CHECK=updating Node.js wrapper
No-Presubmit: true
Bug: chromium:1074325
Change-Id: I18cb95af0acfcabb8b2fcb5e9e889921b0ab04db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2247644
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-16 12:07:58 +00:00
Jack Franklin 1557a1c167 Components dev server
This introduces the components server that we will use to view
components locally.

Design doc:
https://docs.google.com/document/d/1P6qtACf4aryfT9OSHxNFI3okMKt9oUrtzOKCws5bOec/edit?pli=1

Change-Id: I6cd7588f045c3cd46e57f1f44441ffa95f0b70bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199081
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-06-08 14:53:56 +00:00
Tim van der Lippe 3116ece03e Update license field in package.json to SPDX identifier
This allows automated tooling to confirm that the licenses are valid.
Before, we used a custom license reference, which automated tooling
can not understand.

R=yangguo@chromium.org

Change-Id: Ib719c61fd68d11363a20e214ec51faacdf4b1a1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199084
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-05-15 14:24:26 +00:00
Tim van der Lippe 0cbb83a5ec Allow node.py to run node scripts
If third_party/node/node.py is executed as a regular script,
it will consequently run the Node script with the node version
that is synced with gclient sync.

DISABLE_THIRD_PARTY_CHECK=Node Python fix
R=liviurau@chromium.org

Bug: 1074325
Change-Id: I738dc3de5dabdef349f90dfc972acd99f139c027
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2194873
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-13 09:10:31 +00:00
Tim van der Lippe 40875028ce Update Puppeteer to v3.0.3
DISABLE_THIRD_PARTY_CHECK=update Puppeteer

Also-By: tvanderlippe@chromium.org
Change-Id: I4ddb6a2b426bcde95f9b764790e88b560441225c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2187209
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-07 11:21:08 +00:00
Jack Franklin c6577bae1c Add support for Platform.UIString calls in GRDP parsing
Now UIString is defined in Platform [1] we need to update the GRDP
parsing code to look for calls to it rather than `Common.UIString`.

We still support `Common.UIString` so this CL extends the script to look
for:

1) Usage outside of Platform:

```
import * as Platform from '../platform/platform.js';

Platform.UIString.UIString('foobarbaz');
```

2) Usage inside of Platform:
```
import {UIString} from './UIString.js';

UIString('foobarbaz');
```

[1]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165793

Change-Id: I8c0f97817709e936bdddce8f0b60d759e80fd1ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2170067
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-04-28 14:13:33 +00:00
Tim van der Lippe efb2a94cdc Run Karma unittests on the Ninja output directory
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder.
It uses the Ninja build output to find the unittest files.

You can run the new script with:

npm run unittest
npm run unittest -- --target=Release

To make sure you perform a minimal build and run tests right after it, run:

npm run auto-unittest
npm run auto-unittest -- --target=Release

If no ninja-build-name is set, it assumes that `out/Default` exists.
The `auto-unittest` command will run autoninja for you on the output folder.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

No-Presubmit: true
Bug: 1061125
Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 10:16:15 +00:00
Tim van der Lippe dfd18c4e75 Remove istanbul-diff from node_modules
The package is unused at the moment. It was originally added in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2024871
to enable karma-coverage support. However, istanbul-diff itself
is not required for that process, as we still generate the
karma-coverage report without it.

R=liviurau@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove istanbul-diff

Bug: 1068145
Change-Id: I38df9ebdfeb5232f013ea45b4a596239bfd63d7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137391
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-14 11:21:15 +00:00
Mathias Bynens 1f948917ee Remove preinstall hook from package.json
The `preinstall` hook is problematic for users trying to `npm install
chrome-devtools-frontend`. For DevTools development, it’s not
directly needed since `npm run install-deps` is supposed to be used
instead of `npm install` anyway.

Therefore, this patch removes the `preinstall` hook.

Bug: chromium:1066415
Fixed: chromium:1058161
Change-Id: If7fccf2ed392ec47bf79e55470a0fd3cc5a8b880
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144091
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-09 10:30:20 +00:00
Tim van der Lippe 35cca41271 Allow manage_node_deps to run custom npm commands
This allows us to execute the following:

npm run install-deps -- outdated

Which is equivalent to `npm outdated`, although it will run on the
actual node_modules output (that we can verify is unchanged).

Most of the npm commands require the private information to exist.
Therefore, if we run a custom command we first have to install with
`npm ci` to get the private information. Then we have to execute
the command, perform the cleanup and only after that finisht the
script. If we would bail out right after executing the custom command,
the private information would remain in the repository.

R=jacktfranklin@chromium.org

Fixed: 1068132
Change-Id: I50d3538a7115783dea19e1899faf17b1622f22ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137381
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-06 13:01:08 +00:00
Tim van der Lippe 2dceb7fba0 Run the formatter after generating protocol resources
This makes reading the diff a lot easier.

R=kimanh@chromium.org

Change-Id: I50c4c630dab52c2520e80f252be7b3c647ae8c8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122146
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2020-03-26 16:46:00 +00:00
Paul Lewis 3fc8005cfe [e2e] Allows debug of single test file
The use of npm run e2etest inside of debug-e2etest was blocking the
passing of more params. This CL changes debug-e2etest to call the python
script directly.

Change-Id: I19c9009e7054c59e1f4f1456448304dc1c44d00b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122055
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-26 12:34:20 +00:00
Jack Franklin d3f547209d Component bridges generation
This CL introduces a script to generate `_bridges.js` files for TypeScript web components.

For further details see:

* `scripts/component_bridges/README.md` in this CL.
* Modernising UI components: https://docs.google.com/document/d/1Asq9BDFFvnsqhDbpu2Ez92pugPN2-8nq50O6sNO0SpY/edit
* Building bridges to a TypeScript world: https://docs.google.com/document/d/1qpa5QSSHrvvo_w73GV0hOJRug4N0_9JfFDw01d-NaCE/edit#heading=h.7nki9mck5t64

Change-Id: I95656acd6d22f5e09d178875dd3bcaf47da75a9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108761
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-03-26 11:36:00 +00:00
Tim van der Lippe 2ffbc3f6d5 Check Ninja output with expected build output
We now check that the build_output.txt is equivalent to the build_output.txt.expected.
This includes compilation failures, which `compilation_failure_front_end` shows.

To be able to have machine-agnostic buildoutputs, the toolchains need to be
absolutely referenced and thus every fixture needs the same copy of a toolchain.
Also, the ts_library print must use the relative path rather than the absolute path.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Add ts_library tests.

Bug: 1064287
Change-Id: I4a4db566cc155b7f6e73cadc2efcfa8d615286ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2118097
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-25 13:06:03 +00:00
Tim van der Lippe d9de4a0ddb Rename check-type to check-type-closure
To reduce confusion as to which typechecker is running when executing
`npm run check-type`, rename this command to `check-type-closure`.
For those that invoke the previous `check-type` command, it will now
provide a descriptive message on which command to run for the
respective typechecker.

R=yangguo@chromium.org

Bug: 1011811
Change-Id: I1e8c1d64de2a3d3799e36ef8bc42dce76af44402
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2112369
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-03-20 15:35:27 +00:00
Tim van der Lippe 8fa65441f9 Add filesystem TypeScript types
We use these types for all of our interactions with the local filesystem
API's and they don't normally ship with TypeScript library definitions.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Add node_module

Bug: 1011811
Change-Id: I41ae8faf8cce289c86a6795ff76d8a10b5b3609d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108760
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 17:58:39 +00:00
Jack Franklin 02d03f4ef2 Revert "Add tsickle as a node dep"
This reverts commit 82dc0cef49.

Reason for revert: We don't think that we're going to use tsickle yet. Apologies - I made this CL a little hastily in hindsight.
Original change's description:
> Add tsickle as a node dep
> 
> We need it to convert from TypeScript to Closure to generate bridges
> whilst we migrate from Closure to TS.
> 
> DISABLE_THIRD_PARTY_CHECK=adding tsickle
> 
> Change-Id: I0bb28ecd6f5f6f131a59a02c8833aebd7ae92471
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107215
> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=tvanderlippe@chromium.org,jacktfranklin@chromium.org

Change-Id: Iee3631911650c03df4c18d07969b94b2d797cb5a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107530
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-03-18 11:15:28 +00:00
Jack Franklin 82dc0cef49 Add tsickle as a node dep
We need it to convert from TypeScript to Closure to generate bridges
whilst we migrate from Closure to TS.

DISABLE_THIRD_PARTY_CHECK=adding tsickle

Change-Id: I0bb28ecd6f5f6f131a59a02c8833aebd7ae92471
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107215
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-17 11:40:19 +00:00
Tim van der Lippe 60bc8888bf Remove jsconfig configuration files
These files were used in the pre-ES module module era, to instruct
editors like VS Code to resolve symbols. However, since we are in ES
modules land we explicitly *don't* want this resolution. By removing
suport for jsconfig, the editor will now warn before hand on un-imported
symbols. This should reduce the risk of accidentally using the global
symbol rather than the import.

After this change, there will be numerous `jsconfig.json` in the
repository. You are recommended to `git add . && git reset --hard` to
remove these from your local checkout.

Most files will now see a lot of red squiggles with errors, which is to
be expected, as TypeScript does not understand many of the globals. I
have declared `ls` in the globals to at least suppress these, as well as
fix the definition of UIString. These seem to be the most prominent.

All other usages will still need fixing before the files in question can
be typescriptified. However, we do hope that with this change, it is
more difficult to check in new code that is not compliant with
TypeScript already.

Bug: 1006759
Change-Id: I6591e73d66c845a2160b843b627c1adcb1389c24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2098602
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-03-16 17:13:36 +00:00
Tim van der Lippe 4a8441c385 Port license header check to ESLint
This improves the PRESUBMIT performance as we can rely on the AST
parsing of ESLint, meaning we don't have to parse AST twice.

It also allows us to use the nice `--fix` solution to insert the proper
license header in the files.

This shaves an expected 5 seconds of the presubmit time
(non-scientifically computed based on 2 uploads).

Change-Id: I5c53e9b232585f9ec46f86b36557c50bf80f7add
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097992
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:08:22 +00:00
Jack Franklin 8297869795 Generate protocol.d.ts files in devtools-frontend
We need this to be able to migrate parts of the frontend over to
TypeScript that use the Protocol.

We can generate this automatically via a script [1] from the
devtools-protocol repository on GitHub that we've pulled into our repo
and tweaked slightly.

The files are commited and can be easily re-generated should the PDL
files be updated.

DISABLE_THIRD_PARTY_CHECK=expected ts_library changes

[1]: https://github.com/ChromeDevTools/devtools-protocol/tree/master/scripts

Change-Id: I7115fdf109487a82edcaaf7f9984e8ec587d8b04
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096703
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-12 15:18:42 +00:00