Skip to content

Commit

Permalink
Add CodeMirror.next as a third party dependency
Browse files Browse the repository at this point in the history
Bug: 1215072
Change-Id: Ibce7fb088d14344978c59558510d902a2acfcccc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3107134
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
  • Loading branch information
marijnh authored and Devtools-frontend LUCI CQ committed Sep 28, 2021
1 parent f514645 commit 6da128c
Show file tree
Hide file tree
Showing 25 changed files with 5,772 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Julian Geppert <spctstr@gmail.com>
Karntino Areros <karntino.c.areros@gmail.com>
Krishnal Ciccolella <ciccolella.krishnal@gmail.com>
Luke Swiderski <luke.swiderski@gmail.com>
Marijn Haverbeke <marijnh@gmail.com>
Michael Brüning <michael.bruning@qt.io>
Michael Rienstra <mrienstra@gmail.com>
Per-Olov Jernberg <possan@possan.se>
Expand Down
28 changes: 28 additions & 0 deletions front_end/third_party/codemirror.next/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 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("../../../scripts/build/ninja/devtools_pre_built.gni")

devtools_pre_built("bundle") {
sources_are_release = false

sources = [
"bundle-tsconfig.json",
"chunk/codemirror.js",
"chunk/cpp.js",
"chunk/css.js",
"chunk/html.js",
"chunk/java.js",
"chunk/javascript.js",
"chunk/json.js",
"chunk/legacy.js",
"chunk/markdown.js",
"chunk/php.js",
"chunk/python.js",
"chunk/wast.js",
"chunk/xml.js",
"codemirror.next.d.ts",
"codemirror.next.js",
]
}
21 changes: 21 additions & 0 deletions front_end/third_party/codemirror.next/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (C) 2018-2021 by Marijn Haverbeke <marijnh@gmail.com> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 3 additions & 0 deletions front_end/third_party/codemirror.next/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bmeurer@chromium.org
mathias@chromium.org
tvanderlippe@chromium.org
18 changes: 18 additions & 0 deletions front_end/third_party/codemirror.next/README.chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Name: CodeMirror.next
Short Name: CodeMirror.next
URL: https://github.com/codemirror/CodeMirror.next/
Version: 0.19.0
License: MIT
License File: LICENSE
Security Critical: no

Description:
CodeMirror is a code editor for the browser.

To update this package, adjust the version ranges in package.json if necessary, and run the following command:

```bash
./rebuild.sh
```

It will use npm to locally install the necessary packages and their dependencies, and bundle them into a single file (codemirror.js and codemirror.d.ts) with rollup.
21 changes: 21 additions & 0 deletions front_end/third_party/codemirror.next/bundle-tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"composite": true
},
"files": [
"codemirror.next.js",
"chunk/codemirror.js",
"chunk/cpp.js",
"chunk/css.js",
"chunk/html.js",
"chunk/java.js",
"chunk/javascript.js",
"chunk/json.js",
"chunk/legacy.js",
"chunk/markdown.js",
"chunk/php.js",
"chunk/python.js",
"chunk/wast.js",
"chunk/xml.js",
]
}
87 changes: 87 additions & 0 deletions front_end/third_party/codemirror.next/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Base script used with Rollup to bundle the necessary CodeMirror
// components.
//
// Note that this file is also used as a TypeScript source to bundle
// the .d.ts files.

import {StreamLanguage} from '@codemirror/stream-parser';

export {
acceptCompletion, autocompletion, completeAnyWord, Completion, CompletionContext,
CompletionResult, CompletionSource, currentCompletions, ifNotIn
} from '@codemirror/autocomplete';
export {closeBrackets, closeBracketsKeymap} from '@codemirror/closebrackets';
export {
cursorMatchingBracket, cursorSubwordBackward, cursorSubwordForward,
indentLess, indentMore, selectMatchingBracket, selectSubwordBackward, selectSubwordForward,
standardKeymap
} from '@codemirror/commands';
export {toggleComment} from '@codemirror/comment';
export {codeFolding, foldGutter, foldKeymap} from '@codemirror/fold';
export { gutter, GutterMarker, gutters,lineNumbers} from '@codemirror/gutter';
export {HighlightStyle, highlightTree, Tag, tags, TagStyle} from '@codemirror/highlight';
export {history, historyKeymap, redo, redoSelection, undo, undoSelection} from '@codemirror/history';
export { indentOnInput, indentUnit,Language, LanguageSupport, syntaxTree} from '@codemirror/language';
export {bracketMatching} from '@codemirror/matchbrackets';
export {Range, RangeSet, RangeSetBuilder} from '@codemirror/rangeset';
export {selectNextOccurrence} from '@codemirror/search';
export {
Annotation, AnnotationType, Compartment, EditorSelection,
EditorState, EditorStateConfig, Extension, Facet, Prec, SelectionRange,
StateEffect, StateEffectType, StateField, Transaction, TransactionSpec
} from '@codemirror/state';
export {StreamLanguage, StreamParser, StringStream} from '@codemirror/stream-parser';
export {Line, Text, TextIterator} from '@codemirror/text';
export {showTooltip, Tooltip, tooltips, TooltipView} from '@codemirror/tooltip';
export {
Command, Decoration, DecorationSet, drawSelection, EditorView,
highlightSpecialChars, KeyBinding, keymap, MatchDecorator, placeholder,
scrollPastEnd, ViewPlugin, ViewUpdate, WidgetType,
} from '@codemirror/view';
export {
NodeProp, NodeSet, NodeType, Parser, SyntaxNode, Tree, TreeCursor
} from '@lezer/common';
export {LRParser} from '@lezer/lr';

export async function clojure() {
return StreamLanguage.define((await import('@codemirror/legacy-modes/mode/clojure')).clojure);
}
export async function coffeescript() {
return StreamLanguage.define((await import('@codemirror/legacy-modes/mode/coffeescript')).coffeeScript);
}
export function cpp() {
return import('@codemirror/lang-cpp');
}
export function css() {
return import('@codemirror/lang-css');
}
export function html() {
return import('@codemirror/lang-html');
}
export function java() {
return import('@codemirror/lang-java');
}
export function javascript() {
return import('@codemirror/lang-javascript');
}
export function json() {
return import('@codemirror/lang-json');
}
export function markdown() {
return import('@codemirror/lang-markdown');
}
export function php() {
return import('@codemirror/lang-php');
}
export function python() {
return import('@codemirror/lang-python');
}
export async function shell() {
return StreamLanguage.define((await import('@codemirror/legacy-modes/mode/shell')).shell);
}
export function wast() {
return import('@codemirror/lang-wast');
}
export function xml() {
return import('@codemirror/lang-xml');
}
1 change: 1 addition & 0 deletions front_end/third_party/codemirror.next/chunk/codemirror.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/cpp.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/css.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions front_end/third_party/codemirror.next/chunk/html.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/java.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/javascript.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions front_end/third_party/codemirror.next/chunk/legacy.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions front_end/third_party/codemirror.next/chunk/markdown.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions front_end/third_party/codemirror.next/chunk/php.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/python.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions front_end/third_party/codemirror.next/chunk/wast.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6da128c

Please sign in to comment.