Prepare formatter_worker/ for typescriptification

This adds the existing files to the `ts_library`. As such, we can
parallelize the typescriptication work on these files, without
causing merge conflicts

It also adds several `.d.ts` files to the codemirror package, as
we are using these for typescript compilation.

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

Bug: 1011811, 1098730
Change-Id: Ie4e184ce1462fc8486e3b0139c3bb9bb8fcf5fae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2266997
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>
This commit is contained in:
Tim van der Lippe
2020-06-25 14:37:23 +00:00
committed by Commit Bot
parent 394ca15479
commit 70ada5b1cf
13 changed files with 48 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../third_party/typescript/typescript.gni")
ts_library("cm_headless") {
sources = [ "cm_headless.js" ]
deps = [ "../third_party/codemirror" ]
}
+10
View File
@@ -8,16 +8,26 @@ ts_library("formatter_worker") {
sources = [
"Acorn.js",
"AcornTokenizer.js",
"CSSFormatter.js",
"CSSRuleParser.js",
"ESTreeWalker.js",
"FormattedContentBuilder.js",
"FormatterWorker.js",
"HTMLFormatter.js",
"IdentityFormatter.js",
"JavaScriptFormatter.js",
"JavaScriptOutline.js",
"RelaxedJSONParser.js",
"formatter_worker.js",
]
deps = [
"../cm_headless",
"../platform",
"../text_utils",
"../third_party/acorn",
"../third_party/acorn-logical-assignment",
"../third_party/acorn-loose",
"../third_party/codemirror",
]
}
@@ -28,6 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import {FormattedContentBuilder} from './FormattedContentBuilder.js'; // eslint-disable-line no-unused-vars
import {createTokenizer} from './FormatterWorker.js';
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import {createTokenizer} from './FormatterWorker.js';
export const CSSParserStates = {
@@ -28,6 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Platform from '../platform/platform.js';
import * as Acorn from './Acorn.js';
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Platform from '../platform/platform.js';
import {CSSFormatter} from './CSSFormatter.js';
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Platform from '../platform/platform.js';
import * as TextUtils from '../text_utils/text_utils.js';
import * as AcornLoose from '../third_party/acorn-loose/package/dist/acorn-loose.mjs';
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Acorn from './Acorn.js';
import {ECMA_VERSION} from './AcornTokenizer.js';
import {ESTreeWalker} from './ESTreeWalker.js';
+5
View File
@@ -7,7 +7,12 @@ import("../../../scripts/build/copy_to_gen.gni")
copy_to_gen("codemirror") {
sources = [
"codemirror-tsconfig.json",
"package/addon/runmode/runmode-standalone.d.ts",
"package/addon/runmode/runmode-standalone.js",
"package/mode/css/css.d.ts",
"package/mode/css/css.js",
"package/mode/xml/xml.d.ts",
"package/mode/xml/xml.js",
"package/src/codemirror.js",
"package/src/display/Display.js",
"package/src/display/focus.js",
+1 -1
View File
@@ -18,5 +18,5 @@ wget -qO- https://registry.npmjs.org/codemirror/-/codemirror-5.53.2.tgz | tar xz
```
Local changes applied:
- `package/addon/runmode/runmode-standalone.js` change `window.CodeMirror` to `globalThis.CodeMirror`
- Run `wget -qOpackage/mode/wast/wast.js https://raw.githubusercontent.com/codemirror/CodeMirror/dfb497cb797667850f1908bcc57cfe6a2c8c1e39/mode/wast/wast.js` to synchronize unreleased changes for WebAssembly disassembly syntax highlighting.
- Some files have a `.d.ts` file added, as they are used during TypeScript compilation
@@ -0,0 +1 @@
export {}
@@ -0,0 +1 @@
export {}
@@ -0,0 +1 @@
export {}