chore(deps): update dependency flow-bin to v0.134.0 [skip netlify] (#2533)

* chore(deps): update dependency flow-bin to v0.134.0 [skip netlify]

* Fix flow errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Young Min Kin <mail@ylem.kim>
This commit is contained in:
renovate[bot]
2020-09-26 12:19:42 +09:00
committed by GitHub
parent 7418057e3a
commit 16a34c3b35
19 changed files with 43 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
[version] [version]
0.133.0 0.134.0
[ignore] [ignore]
<PROJECT_ROOT>/dist <PROJECT_ROOT>/dist

View File

@@ -1,5 +1,5 @@
{ {
"name": "flow-bin", "name": "flow-bin",
"version": "0.133.0-pnpify", "version": "0.134.0-pnpify",
"type": "commonjs" "type": "commonjs"
} }

View File

@@ -710,7 +710,10 @@ const flatten = function(array) {
return result; return result;
}; };
const renderA11yString = function(text: string, settings?: SettingsOptions) { const renderA11yString = function(
text: string,
settings?: SettingsOptions,
): string {
const tree = katex.__parse(text, settings); const tree = katex.__parse(text, settings);
const a11yStrings = buildA11yStrings(tree, [], "normal"); const a11yStrings = buildA11yStrings(tree, [], "normal");

View File

@@ -25,6 +25,7 @@ import {
import type {SettingsOptions} from "./src/Settings"; import type {SettingsOptions} from "./src/Settings";
import type {AnyParseNode} from "./src/parseNode"; import type {AnyParseNode} from "./src/parseNode";
import type {DomSpan} from "./src/domTree";
import {defineSymbol} from './src/symbols'; import {defineSymbol} from './src/symbols';
import {defineMacro} from './src/macros'; import {defineMacro} from './src/macros';
@@ -36,7 +37,7 @@ declare var __VERSION__: string;
* Parse and build an expression, and place that expression in the DOM node * Parse and build an expression, and place that expression in the DOM node
* given. * given.
*/ */
let render = function( let render: (string, Node, SettingsOptions) => void = function(
expression: string, expression: string,
baseNode: Node, baseNode: Node,
options: SettingsOptions, options: SettingsOptions,
@@ -109,7 +110,7 @@ const renderError = function(
const renderToDomTree = function( const renderToDomTree = function(
expression: string, expression: string,
options: SettingsOptions, options: SettingsOptions,
) { ): DomSpan {
const settings = new Settings(options); const settings = new Settings(options);
try { try {
const tree = parseTree(expression, settings); const tree = parseTree(expression, settings);
@@ -126,7 +127,7 @@ const renderToDomTree = function(
const renderToHTMLTree = function( const renderToHTMLTree = function(
expression: string, expression: string,
options: SettingsOptions, options: SettingsOptions,
) { ): DomSpan {
const settings = new Settings(options); const settings = new Settings(options);
try { try {
const tree = parseTree(expression, settings); const tree = parseTree(expression, settings);

View File

@@ -43,7 +43,7 @@
"eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-react": "^7.20.3", "eslint-plugin-react": "^7.20.3",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"flow-bin": "^0.133.0", "flow-bin": "^0.134.0",
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
"husky": "^4.2.5", "husky": "^4.2.5",
"istanbul-lib-coverage": "^3.0.0", "istanbul-lib-coverage": "^3.0.0",

View File

@@ -42,7 +42,7 @@ const controlWordWhitespaceRegexString =
const controlWordWhitespaceRegex = new RegExp( const controlWordWhitespaceRegex = new RegExp(
`^(${controlWordRegexString})${spaceRegexString}*$`); `^(${controlWordRegexString})${spaceRegexString}*$`);
const combiningDiacriticalMarkString = "[\u0300-\u036f]"; const combiningDiacriticalMarkString = "[\u0300-\u036f]";
export const combiningDiacriticalMarksEndRegex = export const combiningDiacriticalMarksEndRegex: RegExp =
new RegExp(`${combiningDiacriticalMarkString}+$`); new RegExp(`${combiningDiacriticalMarkString}+$`);
const tokenRegexString = `(${spaceRegexString}+)|` + // whitespace const tokenRegexString = `(${spaceRegexString}+)|` + // whitespace
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint "([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint

View File

@@ -83,7 +83,7 @@ class Options {
/** /**
* The base size index. * The base size index.
*/ */
static BASESIZE = 6; static BASESIZE: number = 6;
constructor(data: OptionsData) { constructor(data: OptionsData) {
this.style = data.style; this.style = data.style;
@@ -242,7 +242,7 @@ class Options {
/** /**
* Create a new options objects with the given fontFamily. * Create a new options objects with the given fontFamily.
*/ */
withTextFontFamily(fontFamily: string) { withTextFontFamily(fontFamily: string): Options {
return this.extend({ return this.extend({
fontFamily, fontFamily,
font: "", font: "",

View File

@@ -18,7 +18,7 @@ class ParseError {
constructor( constructor(
message: string, // The error message message: string, // The error message
token?: ?Token | AnyParseNode, // An object providing position information token?: ?Token | AnyParseNode, // An object providing position information
) { ): Error {
let error = "KaTeX parse error: " + message; let error = "KaTeX parse error: " + message;
let start; let start;

View File

@@ -143,7 +143,7 @@ export default class Parser {
return parse; return parse;
} }
static endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; static endOfExpression: string[] = ["}", "\\endgroup", "\\end", "\\right", "&"];
/** /**
* Parses an "expression", which is a list of atoms. * Parses an "expression", which is a list of atoms.

View File

@@ -158,7 +158,7 @@ export default class Settings {
* This is for the second category of `errorCode`s listed in the README. * This is for the second category of `errorCode`s listed in the README.
*/ */
useStrictBehavior(errorCode: string, errorMsg: string, useStrictBehavior(errorCode: string, errorMsg: string,
token?: Token | AnyParseNode) { token?: Token | AnyParseNode): boolean {
let strict = this.strict; let strict = this.strict;
if (typeof strict === "function") { if (typeof strict === "function") {
// Allow return value of strict function to be boolean or string // Allow return value of strict function to be boolean or string
@@ -196,7 +196,7 @@ export default class Settings {
* If `context` has a `url` field, a `protocol` field will automatically * If `context` has a `url` field, a `protocol` field will automatically
* get added by this function (changing the specified object). * get added by this function (changing the specified object).
*/ */
isTrusted(context: AnyTrustContext) { isTrusted(context: AnyTrustContext): boolean {
if (context.url && !context.protocol) { if (context.url && !context.protocol) {
context.protocol = utils.protocolFromUrl(context.url); context.protocol = utils.protocolFromUrl(context.url);
} }

View File

@@ -123,8 +123,8 @@ const text = [D, Dc, T, Tc, T, Tc, T, Tc];
// We only export some of the styles. // We only export some of the styles.
export default { export default {
DISPLAY: styles[D], DISPLAY: (styles[D]: Style),
TEXT: styles[T], TEXT: (styles[T]: Style),
SCRIPT: styles[S], SCRIPT: (styles[S]: Style),
SCRIPTSCRIPT: styles[SS], SCRIPTSCRIPT: (styles[SS]: Style),
}; };

View File

@@ -41,7 +41,7 @@ export class Token {
range( range(
endToken: Token, // last token of the range, inclusive endToken: Token, // last token of the range, inclusive
text: string, // the text of the newly constructed token text: string, // the text of the newly constructed token
) { ): Token {
return new Token(text, SourceLocation.range(this, endToken)); return new Token(text, SourceLocation.range(this, endToken));
} }
} }

View File

@@ -349,7 +349,7 @@ const makeLineSpan = function(
className: string, className: string,
options: Options, options: Options,
thickness?: number, thickness?: number,
) { ): DomSpan {
const line = makeSpan([className], [], options); const line = makeSpan([className], [], options);
line.height = Math.max( line.height = Math.max(
thickness || options.fontMetrics().defaultRuleThickness, thickness || options.fontMetrics().defaultRuleThickness,
@@ -369,7 +369,7 @@ const makeAnchor = function(
classes: string[], classes: string[],
children: HtmlDomNode[], children: HtmlDomNode[],
options: Options, options: Options,
) { ): Anchor {
const anchor = new Anchor(href, classes, children, options); const anchor = new Anchor(href, classes, children, options);
sizeElementFromChildren(anchor); sizeElementFromChildren(anchor);

View File

@@ -4,6 +4,8 @@ import buildCommon from "../buildCommon";
import mathMLTree from "../mathMLTree"; import mathMLTree from "../mathMLTree";
import {assertNodeType} from "../parseNode"; import {assertNodeType} from "../parseNode";
import type {AnyParseNode} from '../parseNode';
import * as html from "../buildHTML"; import * as html from "../buildHTML";
import * as mml from "../buildMathML"; import * as mml from "../buildMathML";
@@ -47,7 +49,7 @@ defineFunction({
type: "color", type: "color",
mode: parser.mode, mode: parser.mode,
color, color,
body: ordargument(body), body: (ordargument(body): AnyParseNode[]),
}; };
}, },
htmlBuilder, htmlBuilder,
@@ -72,7 +74,7 @@ defineFunction({
parser.gullet.macros.set("\\current@color", color); parser.gullet.macros.set("\\current@color", color);
// Parse out the implicit body that should be colored. // Parse out the implicit body that should be colored.
const body = parser.parseExpression(true, breakOnTokenText); const body: AnyParseNode[] = parser.parseExpression(true, breakOnTokenText);
return { return {
type: "color", type: "color",

View File

@@ -3,8 +3,8 @@ const {targets, createConfig} = require('./webpack.common');
// $FlowIgnore // $FlowIgnore
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// dev minify // dev minify
const katexConfig = createConfig(targets.shift(), false, false); const katexConfig /*: Object */ = createConfig(targets.shift(), false, false);
katexConfig.plugins.push(new BundleAnalyzerPlugin()); katexConfig.plugins.push(new BundleAnalyzerPlugin());

View File

@@ -172,6 +172,7 @@ function createConfig(target /*: Target */, dev /*: boolean */,
plugins: [PnpWebpackPlugin], plugins: [PnpWebpackPlugin],
}, },
resolveLoader: { resolveLoader: {
// $FlowIgnore
plugins: [PnpWebpackPlugin.moduleLoader(module)], plugins: [PnpWebpackPlugin.moduleLoader(module)],
}, },
}; };

View File

@@ -1,7 +1,7 @@
// @flow // @flow
const {targets, createConfig} = require('./webpack.common'); const {targets, createConfig} = require('./webpack.common');
module.exports = [ // dev minify module.exports = ([ // dev minify
...targets.map(target => createConfig(target, false, false)), ...targets.map(target => createConfig(target, false, false)),
...targets.map(target => createConfig(target, false, true)), ...targets.map(target => createConfig(target, false, true)),
]; ] /*: Array<Object> */);

View File

@@ -3,8 +3,8 @@ const {targets, createConfig} = require('./webpack.common');
const path = require('path'); const path = require('path');
const PORT = 7936; const PORT = 7936;
// dev minify // dev minify
const katexConfig = createConfig(targets.shift(), true, false); const katexConfig /*: Object*/ = createConfig(targets.shift(), true, false);
// add the entry point for test page // add the entry point for test page
katexConfig.entry.main = './static/main.js'; katexConfig.entry.main = './static/main.js';
@@ -24,7 +24,7 @@ katexConfig.devServer = {
}, },
}; };
module.exports = [ module.exports = ([
katexConfig, katexConfig,
...targets.map(target => createConfig(target, true, false)), ...targets.map(target => createConfig(target, true, false)),
]; ] /*: Array<Object> */);

View File

@@ -5345,12 +5345,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"flow-bin@npm:^0.133.0": "flow-bin@npm:^0.134.0":
version: 0.133.0 version: 0.134.0
resolution: "flow-bin@npm:0.133.0" resolution: "flow-bin@npm:0.134.0"
bin: bin:
flow: cli.js flow: cli.js
checksum: b767946fb8763372127d7c7fd013a8c39de2066e59e19210aba17e6e7bb772bdd19f225b90466ca02bcdb2523463d59eb10d15f671d1ea024612219ed9f44fb2 checksum: 8858ccda62b4e7d30c1672cb48dfcd43c9421c89c692f295224090032573b1488a07abbd7cabdd9d4e2acd8792467d67e7fbeaeb0792191af772e4eae70c4010
languageName: node languageName: node
linkType: hard linkType: hard
@@ -7657,7 +7657,7 @@ fsevents@^1.2.7:
eslint-plugin-flowtype: ^5.2.0 eslint-plugin-flowtype: ^5.2.0
eslint-plugin-react: ^7.20.3 eslint-plugin-react: ^7.20.3
file-loader: ^6.0.0 file-loader: ^6.0.0
flow-bin: ^0.133.0 flow-bin: ^0.134.0
fs-extra: ^9.0.1 fs-extra: ^9.0.1
husky: ^4.2.5 husky: ^4.2.5
istanbul-lib-coverage: ^3.0.0 istanbul-lib-coverage: ^3.0.0