Commit Graph
9 Commits
Author SHA1 Message Date
Philip Pfaffe 6368c91be7 Fix two minor issues in node.py
- Comparison with 0 should use != and not `is not`
- stderr and stdout can be None, meaning they can't be concatenated

Change-Id: Ib84b969b1f7fec2c03a0aea095521f8c7ab3674e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485073
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-10-19 15:50:44 +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 99f1003577 Fix node output for Ninja actions
Ninja actions should not print any output, unless they fail. Therefore,
we should only print the `stdout` if the action fails.

R=jacktfranklin@chromium.org

Change-Id: If56ae2401823b6d93aaeb0d2814634bf4563154a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2249667
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-06-17 14:37:37 +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
Tim van der Lippe 931cc8450e Revert "Add rollup_entrypoint to rollup entrypoints in front_end"
This reverts commit 9f16ccc6a1.

Reason for revert: Fails in Chromium roll: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8877691983703106912/+/steps/compile__with_patch_/0/stdout

Original change's description:
> Add rollup_entrypoint to rollup entrypoints in front_end
> 
> To support lit-html in a release build, we have to run rollup
> separately. Since lit-html source code is targeted to TypeScript,
> the entrypoint front_end/lit-html/lit-html.ts is a TypeScript-authored
> file.
> 
> This means that we can't use `build_release_applications.py` to rollup
> this file (this is by design). Instead, we introduce a new
> `rollup_entrypoint` Ninja target that calls Rollup. We don't have to
> write a special Python file, as we can reuse `node.py` for this, which
> is essentially a pipe-through with a pinned version of Node.
> 
> While the rollup build works, for debug builds we are still missing
> the `front_end/third_party/lit-html` files. We will address that
> in a follow-up CL, once we introduce the first usage of lit-html
> in the codebase.
> 
> We are going to need to make more changes to Rollup later (most notably
> the external files check), but since we aren't using this codepath
> in `build_release_applications.py`, I will fix that in a separate CL.
> 
> To reduce duplication in the Ninja build system, I also extract
> a vars.gni file that has the relevant variables. These are currently
> used in the rollup.gni and typescript.gni.
> 
> Lastly, I had to fix node.py to make sure it wouldn't always print
> the stdout. In Ninja, we should only print to stdout if there is
> an error.
> 
> DISABLE_THIRD_PARTY_CHECK=Ninja fixes
> R=​jacktfranklin@chromium.org,aerotwist@chromium.org
> 
> Bug: 1011811, 1061037
> Change-Id: Ib22ff9c1d78e61c922101444f27c4f0d4ccf9bd6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2238232
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

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

Change-Id: Ida2a1e30d601e87f64a7c35bbc527c700d9cbe70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811, 1061037
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2243175
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-12 14:48:09 +00:00
Tim van der Lippe 9f16ccc6a1 Add rollup_entrypoint to rollup entrypoints in front_end
To support lit-html in a release build, we have to run rollup
separately. Since lit-html source code is targeted to TypeScript,
the entrypoint front_end/lit-html/lit-html.ts is a TypeScript-authored
file.

This means that we can't use `build_release_applications.py` to rollup
this file (this is by design). Instead, we introduce a new
`rollup_entrypoint` Ninja target that calls Rollup. We don't have to
write a special Python file, as we can reuse `node.py` for this, which
is essentially a pipe-through with a pinned version of Node.

While the rollup build works, for debug builds we are still missing
the `front_end/third_party/lit-html` files. We will address that
in a follow-up CL, once we introduce the first usage of lit-html
in the codebase.

We are going to need to make more changes to Rollup later (most notably
the external files check), but since we aren't using this codepath
in `build_release_applications.py`, I will fix that in a separate CL.

To reduce duplication in the Ninja build system, I also extract
a vars.gni file that has the relevant variables. These are currently
used in the rollup.gni and typescript.gni.

Lastly, I had to fix node.py to make sure it wouldn't always print
the stdout. In Ninja, we should only print to stdout if there is
an error.

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

Bug: 1011811, 1061037
Change-Id: Ib22ff9c1d78e61c922101444f27c4f0d4ccf9bd6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2238232
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-12 13:09:06 +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
Yang Guo 4fd355cc40 Switch to new repository 2019-10-21 08:08:56 +02:00