Commit Graph
107 Commits
Author SHA1 Message Date
Alex Rudenko fd136e001e Rename DEBUG env var to DEBUG_TEST
Currently, you cannot run tests in non-debug mode
and turn on debug logging from Puppeteer that relies
on https://www.npmjs.com/package/debug.

Running `DEBUG=puppeteer.* ...` would also start the
test runner in a debug and non headless mode. This
CL renames the DEBUG variable that DevTools test runner
relies on so that debug logging is independent from the
debug mode we have for tests.

Bug: none
Change-Id: I8b8476f7c26c07eea1db29bfae74d4fb61afd42c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2963755
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2021-06-16 12:47:15 +00:00
Tim van der Lippe 727227900c Dynamically optimize svgs
Currently, we optimize our SVGs out-of-sync and have a Python
script and PRESUBMIT check to make sure that the SVGs are correctly
optimized. This means that the SVGs are duplicated in the Images
folder and requires developers to install `svgo` on their command
line, which could be using differing versions.

Instead, we can optimize the SVG images (which is computationally
cheap) during build time using the rollup-plugin-import-meta-assets
and svgo packages. The rollup plugin traverses the required SVG
image files and puts them and rewrites them to the Images/ folder
(rather than in src/), while also allowing us to optimize them
along the way.

DISABLE_THIRD_PARTY_CHECK=Removing script from package.json
R=jacktfranklin@chromium.org

Bug: 1216402
Change-Id: Ieb6932b9a81753be5ecbccd00a5d84bd0efa23f8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2939994
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-06-10 10:09:30 +00:00
Paul Lewis 05cf8ebb14 Add build scripts to package.json
I am rather fond of Cmd/Ctrl+Shift+B in VSCode to build my current
project. However, that presupposes that there is a script in the
package.json named "build" (or some variant, e.g., "build-release").
This CL adds those scripts to the package.json file.

R=jacktfranklin@chromium.org

Bug: None
Change-Id: I8e685d098b1bf3c9b6b8b1c85d1a97d693a344f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2891843
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-13 08:59:49 +00:00
Jack Franklin 87fa2776a8 [TestRunner] update npm run X scripts to use run_test_suite.js
Bug: chromium:1186163
Change-Id: Ibea84f2d675c2a9cc2ba81aaf805fd08e7506757
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2810288
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-04-07 14:57:09 +00:00
Jack Franklin cb0638c044 Migrate npm run perf to new test runner
That - want to see that it all works OK and also it's not a test suite
that people run often / configure so a good low risk one to move.

Bug: chromium:1186163
Change-Id: I94cc20adca99216a3b24639dbc57c3d74bdae758
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2784720
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-29 11:01:21 +00:00
Philip Pfaffe 92feb60a1a Add an eslint check to prevent crbugs at the beginning of an it()
There are a handful of e2e tests which test regressions, and consequently
have a bug assiciation. This association was part of the test names in
the same way as we reference bugs for skipped tests. If such a test is
then skipped it needs to start with two crbug references. That's
confusing for the reader as well as a the skipped test lint check, for
which the regression bug references can lead to false negatives. This CL
introduces a new lint check that prevents bug references in non-skipped
tests with the same syntax as skipped tests.

Bug: none
Change-Id: Ibdf59091aba942f85424c1f12cc31160d9fe786a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2761357
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-03-16 14:14:54 +00:00
Jack Franklin 29bb6314ce [TestRunner] create new test runner that takes configuration file
This CL lands the initial new run_test_suite.js that can take its
configuration from a config JSON file, or from flags.

This new script is only used to run `npm run auto-interactionstest`
and nothing more; I want to roll it out slowly and ensure that
everyone is aware of it before removing the old Python script. I will
create a doc with all the various steps, and required documentation,
as I've taken the chance to rename some options to make them clearer.

Bug: chromium:1186163
Change-Id: I5a199f82ac7ab0f323988acacaa7aae2d64e6349
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2763866
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-03-16 10:35:54 +00:00
Christy Chen 5e32bcbcf7 [Loc] Un-hook presubmit scripts
The Localization presubmit steps include checking Loc V1 and V2:
V1: Done with migration, safe to remove
V2:
- check unused string in UIStrings (Moved to ESLint)
- check migrated directory (Done with migration, safe to remove)
- check the shape of API calls (Done by typescript or ESLint)

Since all checks are obsolete or moved, this CL removes the presubmit step to unhook the scripts inside scripts/localization. I will follow up a CL to remove the actual scripts.
The CL that introduced this step https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1931279


Bug: 1136655
Change-Id: If203607588896693a6331de606c873458b74cd6e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2746919
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2021-03-11 03:32:57 +00:00
Sigurd Schneider a96c51065b Add npm run collect-strings which updates the localization files
This is useful when working on a CL that changes localization strings
frequently during rebuilds.

Bug: chromium:1136655
Change-Id: Id9d56728351a07d796036664a3a730184c6356c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2744047
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-03-09 16:15:15 +00:00
Jack Franklin 736a4b51b0 Improve path detection in hosted-mode server
This CL improves how the hosted-mode server finds the root folder. It
also removes `npm run hosted-server`, which has been broken ever since
we migrated any source files to *.ts. People shouldn't be using it and
should instead be running the server from ./out/Target/gen/scripts/....

Bug: 1182255
Change-Id: If7a37bff0c3488679c0abd69a0ec548feda8aa22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2735895
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-08 07:02:19 +00:00
Jack Franklin 6dbe837682 Lint border-color and outline usages in CSS.
Updates the use_theme_colors rule to pick out border-color rules.

Fixed:chromium:1182679
Change-Id: I0f0f9b4a30f588e901b57131c796d73f2ac73656
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2722441
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-03-02 07:20:46 +00:00
Jack Franklin d0bac676f2 Update run_test_suite to support --test-suite-path
The current test suite runner assumes the paths; you pass
--test-suite=interactions and it assumes that they live in
out/TARGET/gen/test/interactions. This CL removes that assumption by
asking people to pass --test-suite-path, which would be
out/gen/interactions.

We will remove the --test-suite flag, but for now we're keeping it
around so the bots can still run their tests. I will file a bug to ask
that the bots have their recipes updated.

Bug:1182255
Change-Id: I6d9e5d419231845047394c5f7cbd0c74ebad3a58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2722448
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-01 10:24:17 +00:00
Changhao Han 5663e48217 Add override prefix to stylelint theme color logic
Bug: chromium:1171775
Change-Id: Ia63217e154009034a585e8ccbd8ac482da519fae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720368
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2021-02-26 11:52:44 +00:00
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