chore: bump dev dependencies (#1955)

* chore: bump devdeps

* upd infima url
This commit is contained in:
Endi 2019-11-11 17:44:26 +07:00 committed by GitHub
parent 72792a1e5c
commit 3be2e86546
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 505 additions and 497 deletions

View file

@ -57,6 +57,7 @@ module.exports = {
'react/prop-types': OFF, 'react/prop-types': OFF,
'react/destructuring-assignment': OFF, // Too many lines. 'react/destructuring-assignment': OFF, // Too many lines.
'react/prefer-stateless-function': WARNING, 'react/prefer-stateless-function': WARNING,
'react/jsx-props-no-spreading': OFF,
'react-hooks/rules-of-hooks': ERROR, 'react-hooks/rules-of-hooks': ERROR,
}, },
}; };

View file

@ -21,5 +21,7 @@ module.exports = {
plugins: [ plugins: [
'@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread', '@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
], ],
}; };

View file

@ -24,6 +24,8 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.7.2", "@babel/core": "^7.7.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/preset-typescript": "^7.7.2", "@babel/preset-typescript": "^7.7.2",
"@types/cross-spawn": "^6.0.1", "@types/cross-spawn": "^6.0.1",
"@types/express": "^4.17.1", "@types/express": "^4.17.1",
@ -41,30 +43,25 @@
"@types/webpack": "^4.32.0", "@types/webpack": "^4.32.0",
"@types/webpack-dev-server": "^3.1.5", "@types/webpack-dev-server": "^3.1.5",
"@types/webpack-merge": "^4.1.5", "@types/webpack-merge": "^4.1.5",
"babel-eslint": "8", "babel-eslint": "^10.0.3",
"enzyme": "^3.9.0", "enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.12.1", "enzyme-adapter-react-16": "^1.15.1",
"eslint": "4.x", "eslint": "^6.6.0",
"eslint-config-airbnb": "17.1.0", "eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^2.9.0", "eslint-config-prettier": "^6.5.0",
"eslint-plugin-header": "^3.0.0", "eslint-plugin-header": "^3.0.0",
"eslint-plugin-import": "^2.14.0", "eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.11.1", "eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^0.0.0", "eslint-plugin-react-hooks": "^2.2.0",
"filepath": "^1.1.0", "husky": "^3.0.9",
"front-matter": "^2.3.0",
"glob-promise": "^3.3.0",
"husky": "^1.3.1",
"jest": "^24.9.0", "jest": "^24.9.0",
"lerna": "^3.18.1", "lerna": "^3.18.1",
"lerna-changelog": "^0.8.2", "lerna-changelog": "^0.8.2",
"lint-staged": "^7.2.0", "lint-staged": "^7.2.0",
"picomatch": "^2.1.0", "prettier": "^1.19.0",
"prettier": "^1.18.2",
"react": "^16.8.4", "react": "^16.8.4",
"react-dom": "^16.8.4", "react-dom": "^16.8.4",
"rimraf": "^2.6.3",
"typescript": "^3.7.2" "typescript": "^3.7.2"
}, },
"lint-staged": { "lint-staged": {

View file

@ -33,6 +33,10 @@ module.exports = {
'react/button-has-type': OFF, // 1 'react/button-has-type': OFF, // 1
'react/forbid-prop-types': OFF, // 1 'react/forbid-prop-types': OFF, // 1
'react/require-default-props': OFF, // 1 'react/require-default-props': OFF, // 1
'jsx-a11y/control-has-associated-label': OFF, // 1
'react/jsx-props-no-spreading': OFF, // 2
'max-classes-per-file': OFF, // 2
'prefer-object-spread': OFF, // 5
'jsx-a11y/anchor-is-valid': OFF, // 9 'jsx-a11y/anchor-is-valid': OFF, // 9
'import/no-unresolved': OFF, // 15 'import/no-unresolved': OFF, // 15
'react/prefer-stateless-function': OFF, // 22 'react/prefer-stateless-function': OFF, // 22

View file

@ -375,9 +375,7 @@ function generateMetadataBlog(config = siteConfig) {
// Extract, YYYY, MM, DD from the file name // Extract, YYYY, MM, DD from the file name
const filePathDateArr = path.basename(file).split('-'); const filePathDateArr = path.basename(file).split('-');
metadata.date = new Date( metadata.date = new Date(
`${filePathDateArr[0]}-${filePathDateArr[1]}-${ `${filePathDateArr[0]}-${filePathDateArr[1]}-${filePathDateArr[2]}T06:00:00.000Z`,
filePathDateArr[2]
}T06:00:00.000Z`,
); );
// allow easier sorting of blog by providing seconds since epoch // allow easier sorting of blog by providing seconds since epoch
metadata.seconds = Math.round(metadata.date.getTime() / 1000); metadata.seconds = Math.round(metadata.date.getTime() / 1000);

View file

@ -75,5 +75,11 @@
"tiny-lr": "^1.1.1", "tiny-lr": "^1.1.1",
"tree-node-cli": "^1.2.5", "tree-node-cli": "^1.2.5",
"truncate-html": "^1.0.3" "truncate-html": "^1.0.3"
},
"devDependencies": {
"filepath": "^1.1.0",
"front-matter": "^2.3.0",
"glob-promise": "^3.3.0",
"rimraf": "^2.6.3"
} }
} }

View file

@ -32,9 +32,9 @@ describe('loadBlog', () => {
); );
const {blogPosts} = await plugin.loadContent(); const {blogPosts} = await plugin.loadContent();
const noDateSource = path.join('@site', pluginPath, 'no date.md'); const noDateSource = path.join('@site', pluginPath, 'no date.md');
const noDateSourceBirthTime = (await fs.stat( const noDateSourceBirthTime = (
noDateSource.replace('@site', siteDir), await fs.stat(noDateSource.replace('@site', siteDir))
)).birthtime; ).birthtime;
const noDatePermalink = `/blog/${noDateSourceBirthTime const noDatePermalink = `/blog/${noDateSourceBirthTime
.toISOString() .toISOString()
.substr(0, '2019-01-01'.length) .substr(0, '2019-01-01'.length)

View file

@ -11,7 +11,8 @@
}, },
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@docusaurus/types": "^2.0.0-alpha.33" "@docusaurus/types": "^2.0.0-alpha.33",
"picomatch": "^2.1.0"
}, },
"dependencies": { "dependencies": {
"@docusaurus/mdx-loader": "^2.0.0-alpha.33", "@docusaurus/mdx-loader": "^2.0.0-alpha.33",

View file

@ -30,7 +30,10 @@ describe('createOrder', () => {
{ {
type: 'category', type: 'category',
label: 'Category2', label: 'Category2',
items: [{type: 'doc', id: 'doc3'}, {type: 'doc', id: 'doc4'}], items: [
{type: 'doc', id: 'doc3'},
{type: 'doc', id: 'doc4'},
],
}, },
], ],
otherDocs: [ otherDocs: [
@ -75,12 +78,18 @@ describe('createOrder', () => {
{ {
type: 'category', type: 'category',
label: 'Category1', label: 'Category1',
items: [{type: 'doc', id: 'doc1'}, {type: 'doc', id: 'doc2'}], items: [
{type: 'doc', id: 'doc1'},
{type: 'doc', id: 'doc2'},
],
}, },
{ {
type: 'category', type: 'category',
label: 'Category2', label: 'Category2',
items: [{type: 'doc', id: 'doc3'}, {type: 'doc', id: 'doc4'}], items: [
{type: 'doc', id: 'doc3'},
{type: 'doc', id: 'doc4'},
],
}, },
], ],
otherDocs: [ otherDocs: [
@ -188,7 +197,10 @@ describe('createOrder', () => {
{ {
type: 'category', type: 'category',
label: 'Category2', label: 'Category2',
items: [{type: 'doc', id: 'doc3'}, {type: 'ref', id: 'doc4'}], items: [
{type: 'doc', id: 'doc3'},
{type: 'ref', id: 'doc4'},
],
}, },
], ],
otherDocs: [ otherDocs: [
@ -225,7 +237,10 @@ describe('createOrder', () => {
{ {
type: 'category', type: 'category',
label: 'Category1', label: 'Category1',
items: [{type: 'endi', id: 'doc1'}, {type: 'doc', id: 'doc2'}], items: [
{type: 'endi', id: 'doc1'},
{type: 'doc', id: 'doc2'},
],
}, },
], ],
otherDocs: [ otherDocs: [

View file

@ -37,7 +37,7 @@ function Layout(props) {
const metaImageUrl = siteUrl + useBaseUrl(metaImage); const metaImageUrl = siteUrl + useBaseUrl(metaImage);
const faviconUrl = useBaseUrl(favicon); const faviconUrl = useBaseUrl(favicon);
return ( return (
<React.Fragment> <>
<Head> <Head>
<meta charSet="utf-8" /> <meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" /> <meta httpEquiv="x-ua-compatible" content="ie=edge" />
@ -63,7 +63,7 @@ function Layout(props) {
<Navbar /> <Navbar />
<main className="main">{children}</main> <main className="main">{children}</main>
{!noFooter && <Footer />} {!noFooter && <Footer />}
</React.Fragment> </>
); );
} }

View file

@ -69,7 +69,7 @@ function Navbar() {
const logoUrl = useBaseUrl(logo.src); const logoUrl = useBaseUrl(logo.src);
return ( return (
<React.Fragment> <>
<Head> <Head>
{/* TODO: Do not assume that it is in english language */} {/* TODO: Do not assume that it is in english language */}
<html lang="en" data-theme={theme} /> <html lang="en" data-theme={theme} />
@ -187,7 +187,7 @@ function Navbar() {
</div> </div>
</div> </div>
</nav> </nav>
</React.Fragment> </>
); );
} }

View file

@ -61,6 +61,7 @@ const Search = props => {
return isEnabled ? ( return isEnabled ? (
<div className="navbar__search" key="search-box"> <div className="navbar__search" key="search-box">
<span <span
aria-label="expand searchbar"
role="button" role="button"
className={classnames('search-icon', { className={classnames('search-icon', {
'search-icon-hidden': props.isSearchBarExpanded, 'search-icon-hidden': props.isSearchBarExpanded,

View file

@ -25,13 +25,15 @@ export interface DocusaurusConfig {
| { | {
src: string; src: string;
[key: string]: any; [key: string]: any;
})[]; }
)[];
stylesheets?: ( stylesheets?: (
| string | string
| { | {
href: string; href: string;
[key: string]: any; [key: string]: any;
})[]; }
)[];
} }
export interface DocusaurusContext { export interface DocusaurusContext {

View file

@ -90,10 +90,7 @@ export function genComponentName(pagePath: string): string {
return 'index'; return 'index';
} }
const pageHash = docuHash(pagePath); const pageHash = docuHash(pagePath);
const pascalCase = _.flow( const pascalCase = _.flow(_.camelCase, _.upperFirst);
_.camelCase,
_.upperFirst,
);
return pascalCase(pageHash); return pascalCase(pageHash);
} }

View file

@ -17,7 +17,7 @@ function Layout(props) {
const {children, title, description} = props; const {children, title, description} = props;
const faviconUrl = useBaseUrl(favicon); const faviconUrl = useBaseUrl(favicon);
return ( return (
<React.Fragment> <>
<Head defaultTitle={`${defaultTitle} · ${tagline}`}> <Head defaultTitle={`${defaultTitle} · ${tagline}`}>
{title && <title>{`${title} · ${tagline}`}</title>} {title && <title>{`${title} · ${tagline}`}</title>}
{favicon && <link rel="shortcut icon" href={faviconUrl} />} {favicon && <link rel="shortcut icon" href={faviconUrl} />}
@ -27,7 +27,7 @@ function Layout(props) {
)} )}
</Head> </Head>
{children} {children}
</React.Fragment> </>
); );
} }

View file

@ -21,8 +21,8 @@ export function loadPresets(
themes: PluginConfig[]; themes: PluginConfig[];
} { } {
const presets: PresetConfig[] = (context.siteConfig || {}).presets || []; const presets: PresetConfig[] = (context.siteConfig || {}).presets || [];
const unflatPlugins: (PluginConfig[])[] = []; const unflatPlugins: PluginConfig[][] = [];
const unflatThemes: (PluginConfig[])[] = []; const unflatThemes: PluginConfig[][] = [];
presets.forEach(presetItem => { presets.forEach(presetItem => {
let presetModuleImport; let presetModuleImport;

View file

@ -29,7 +29,7 @@ Any CSS you write within that file will be available globally and can be referen
## Styling your site with Infima ## Styling your site with Infima
`@docusaurus/preset-classic` uses [Infima](http://facebookincubator.github.io/infima/) as the underlying styling framework. Infima provides flexible layout and common UI components styling suitable for content-centric websites (blogs, documentation, landing pages). For more details, check out the [Infima website](http://facebookincubator.github.io/infima/). `@docusaurus/preset-classic` uses [Infima](https://facebookincubator.github.io/infima/) as the underlying styling framework. Infima provides flexible layout and common UI components styling suitable for content-centric websites (blogs, documentation, landing pages). For more details, check out the [Infima website](https://facebookincubator.github.io/infima/).
When you `init` your Docusaurus 2 project, the website will be generated with basic Infima stylesheets and default styling. You may customize the styling by editing the `src/css/custom.css` file. When you `init` your Docusaurus 2 project, the website will be generated with basic Infima stylesheets and default styling. You may customize the styling by editing the `src/css/custom.css` file.

890
yarn.lock

File diff suppressed because it is too large Load diff