-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
635 changed files
with
115,564 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Last 2 versions of each browsers, excluding dead browsers (e.g., BlackBerry) | ||
last 2 versions | ||
not dead | ||
|
||
# Browsers with more than 0.1% global usage, excluding old browsers | ||
> 0.1% | ||
not chrome < 45 | ||
not ie < 9 | ||
|
||
# Currently maintained Node.js versions | ||
maintained node versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
firefox: | ||
docker: | ||
- image: circleci/node:6 | ||
- image: selenium/standalone-firefox:2.48.2 | ||
chrome: | ||
docker: | ||
- image: circleci/node:6 | ||
- image: selenium/standalone-chrome:2.48.2 | ||
environment: | ||
# workaround for https://github.com/SeleniumHQ/docker-selenium/issues/87 | ||
DBUS_SESSION_BUS_ADDRESS: /dev/null | ||
|
||
commands: | ||
checkout_repo: | ||
steps: | ||
- checkout | ||
- run: | ||
name: Checkout submodule | ||
command: | | ||
git submodule sync | ||
git submodule update --init --recursive | ||
- run: | ||
name: Get changed files | ||
command: | | ||
if [[ $CIRCLE_PULL_REQUEST ]]; then | ||
BASE_COMMIT=$(curl -s -H "Authorization: token a61ecb2fc5b72da54431""1b3db3875c96854958a8" \ | ||
https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER \ | ||
| jq -r ".base.sha | select(. != null)")... | ||
else | ||
BASE_COMMIT=HEAD^ | ||
fi | ||
if [[ $BASE_COMMIT ]]; then | ||
CHANGED=$(git diff --name-only $BASE_COMMIT) | ||
echo "$CHANGED" | ||
echo "export CHANGED=\"$CHANGED\"" >> $BASH_ENV | ||
fi | ||
skip_if_only_changed: | ||
parameters: | ||
filter: | ||
type: string | ||
steps: | ||
- run: | ||
name: Skip tests if only "<< parameters.filter >>" are changed | ||
command: echo "$CHANGED" | grep -qvE '<< parameters.filter >>' || circleci step halt | ||
|
||
install_dependencies: | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- yarn-deps-v3-{{ checksum "yarn.lock" }} | ||
- yarn-deps-v3- | ||
- run: | ||
name: Install dependencies | ||
# upgrade Yarn before installing dependencies, if needed | ||
command: | | ||
if ! yarn check; then | ||
curl -o- -L https://yarnpkg.com/install.sh | PROFILE=$BASH_ENV bash | ||
source $BASH_ENV | ||
yarn | ||
fi | ||
- save_cache: | ||
key: yarn-deps-v3-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules | ||
|
||
codecov: | ||
parameters: | ||
flag: | ||
type: string | ||
steps: | ||
- run: | ||
name: Upload code coverage reports to Codecov | ||
# do not upload if screenshotter tests are skipped | ||
command: ./node_modules/.bin/codecov -F "<< parameters.flag >>" | ||
|
||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/node:6 | ||
steps: | ||
- run: | ||
name: Check whether the build is running on the main repository | ||
command: | | ||
if [[ $CIRCLE_PULL_REQUEST && $CIRCLE_PROJECT_USERNAME != "KaTeX" ]]; then | ||
echo "Please disable CircleCI on your forked repository!" | ||
exit 1 | ||
fi | ||
- checkout_repo | ||
- skip_if_only_changed: | ||
filter: '^docs/|^LICENSE|\.md$' | ||
- install_dependencies | ||
|
||
- run: | ||
name: Lint code | ||
command: yarn test:lint | ||
- skip_if_only_changed: | ||
filter: '^static/|^website/' | ||
- run: | ||
name: Run Flow and Jest tests | ||
command: | | ||
yarn test:flow | ||
yarn test:jest --coverage --runInBand | ||
- codecov: | ||
flag: test | ||
|
||
screenshotter: | ||
parameters: | ||
browser: | ||
type: executor | ||
executor: << parameters.browser >> | ||
steps: | ||
- checkout_repo | ||
- skip_if_only_changed: | ||
filter: '^docs/|^static/|^website/|^LICENSE|\.md$' | ||
- install_dependencies | ||
|
||
- run: | ||
name: Verify screenshots and generate diffs and new screenshots | ||
command: node dockers/screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new --coverage | ||
- codecov: | ||
flag: screenshotter | ||
- store_artifacts: | ||
path: test/screenshotter/new | ||
destination: new | ||
- store_artifacts: | ||
path: test/screenshotter/diff | ||
destination: diff | ||
|
||
workflows: | ||
test: | ||
jobs: | ||
- test | ||
- screenshotter: | ||
name: firefox | ||
browser: firefox | ||
- screenshotter: | ||
name: chrome | ||
browser: chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70...100" | ||
|
||
status: | ||
project: | ||
default: on | ||
patch: | ||
default: off | ||
changes: | ||
default: off | ||
|
||
comment: | ||
layout: "header, reach, diff, flags, files, footer" | ||
behavior: default | ||
require_changes: no | ||
require_base: no | ||
require_head: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**/node_modules/* | ||
dist/* | ||
website/build/* | ||
**/*.min.js | ||
contrib/mhchem/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"flowtype", | ||
"transform-runtime-aliasing" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:flowtype/recommended" | ||
], | ||
"rules": { | ||
"arrow-spacing": 2, | ||
"brace-style": [2, "1tbs", { "allowSingleLine": true }], | ||
// We'd possibly like to remove the 'properties': 'never' one day. | ||
"camelcase": [2, { "properties": "never" }], | ||
"comma-dangle": [2, "always-multiline"], | ||
"comma-spacing": [2, { "before": false, "after": true }], | ||
"constructor-super": 2, | ||
"curly": 2, | ||
"eol-last": 2, | ||
"eqeqeq": [2, "allow-null"], | ||
"guard-for-in": 2, | ||
"indent": "off", | ||
"indent-legacy": [2, 4, {"SwitchCase": 1}], | ||
"keyword-spacing": 2, | ||
"linebreak-style": [2, "unix"], | ||
"max-len": [2, 84, 4, { "ignoreUrls": true, "ignorePattern": "\\brequire\\([\"']|eslint-disable" }], | ||
"new-cap": 2, | ||
"no-alert": 2, | ||
"no-array-constructor": 2, | ||
"no-console": 2, | ||
"no-const-assign": 2, | ||
"no-debugger": 2, | ||
"no-dupe-class-members": 2, | ||
"no-dupe-keys": 2, | ||
"no-extra-bind": 2, | ||
"no-new": 2, | ||
"no-new-func": 2, | ||
"no-new-object": 2, | ||
"no-spaced-func": 2, | ||
"no-this-before-super": 2, | ||
"no-throw-literal": 2, | ||
"no-trailing-spaces": 2, | ||
"no-undef": 2, | ||
"no-unexpected-multiline": 2, | ||
"no-unreachable": 2, | ||
"no-unused-vars": [2, {"args": "none", "varsIgnorePattern": "^_*$"}], | ||
"no-useless-call": 2, | ||
"no-var": 2, | ||
"no-with": 2, | ||
"object-curly-spacing": [2, "never"], | ||
"one-var": [2, "never"], | ||
"prefer-const": 2, | ||
"prefer-spread": 0, // re-enable once we use es6 | ||
"semi": [2, "always"], | ||
"space-before-blocks": 2, | ||
"space-before-function-paren": [2, "never"], | ||
"space-infix-ops": 2, | ||
"space-unary-ops": 2, | ||
// --------------------------------------- | ||
// Stuff we explicitly disable. | ||
// We turned this off because it complains when you have a | ||
// multi-line string, which I think is going too far. | ||
"prefer-template": 0, | ||
// We've decided explicitly not to care about this. | ||
"arrow-parens": 0, | ||
// --------------------------------------- | ||
// TODO(csilvers): enable these if/when community agrees on it. | ||
"prefer-arrow-callback": 0, | ||
// Might be nice to turn this on one day, but since we don't | ||
// use jsdoc anywhere it seems silly to require it yet. | ||
"valid-jsdoc": 0, | ||
"require-jsdoc": 0 | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true, | ||
"browser": true | ||
}, | ||
"overrides": [{ | ||
"files": ["katex.js", "src/**/*.js", "contrib/**/*.js"], | ||
"excludedFiles": ["*-spec.js", "unicodeMake.js"], | ||
"rules": { | ||
"no-restricted-syntax": [2, "ForOfStatement", "ClassDeclaration[superClass]", "ClassExpression[superClass]"], | ||
"transform-runtime-aliasing/no-transform-runtime-aliasing": [2, { | ||
"transformEnabled": false, | ||
"ignore": ["parseInt", "parseFloat", "JSON.stringify"] | ||
}] | ||
}, | ||
"env": { | ||
"node": false | ||
} | ||
}], | ||
"root": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ignore] | ||
<PROJECT_ROOT>/dist | ||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[lints] | ||
|
||
[options] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Install ttx from https://github.com/fonttools/fonttools, | ||
# then add this to your ~/.gitconfig to diff fonts more easily: | ||
|
||
#[diff "font"] | ||
# binary = true | ||
# textconv = ttx -q -i -o - | ||
|
||
*.ttf diff=font | ||
*.woff diff=font |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
katex.tar.gz | ||
katex.zip | ||
node_modules | ||
npm-debug.log | ||
debug.log | ||
last.png | ||
diff.png | ||
/.npm-install.stamp | ||
/dist/ | ||
/test/screenshotter/tex/ | ||
/test/screenshotter/diff/ | ||
/test/screenshotter/new/ | ||
/test/symgroups.tex | ||
/test/symgroups.aux | ||
/test/symgroups.log | ||
/test/symgroups.pdf | ||
/test/screenshotter/unicode-fonts | ||
coverage/ | ||
docs/cli.md | ||
lib/core/metadata.js | ||
lib/core/MetadataBlog.js | ||
website/translated_docs | ||
website/build/ | ||
website/yarn.lock | ||
website/node_modules | ||
website/i18n/* | ||
website/static/static/katex.* | ||
website/static/static/fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "submodules/katex-fonts"] | ||
path = submodules/katex-fonts | ||
url = https://github.com/KaTeX/katex-fonts | ||
[submodule "submodules/katex-test-fonts"] | ||
path = submodules/katex-test-fonts | ||
url = https://github.com/KaTeX/katex-test-fonts.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "stylelint-config-standard", | ||
"rules": { | ||
"indentation": 4, | ||
}, | ||
"ignoreFiles": [ | ||
"**/*.min.css" | ||
] | ||
} |
Oops, something went wrong.