mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
chore: bump dev dependencies (#1955)
* chore: bump devdeps * upd infima url
This commit is contained in:
parent
72792a1e5c
commit
3be2e86546
18 changed files with 505 additions and 497 deletions
|
@ -57,6 +57,7 @@ module.exports = {
|
|||
'react/prop-types': OFF,
|
||||
'react/destructuring-assignment': OFF, // Too many lines.
|
||||
'react/prefer-stateless-function': WARNING,
|
||||
'react/jsx-props-no-spreading': OFF,
|
||||
'react-hooks/rules-of-hooks': ERROR,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -21,5 +21,7 @@ module.exports = {
|
|||
plugins: [
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
],
|
||||
};
|
||||
|
|
31
package.json
31
package.json
|
@ -24,6 +24,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@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",
|
||||
"@types/cross-spawn": "^6.0.1",
|
||||
"@types/express": "^4.17.1",
|
||||
|
@ -41,30 +43,25 @@
|
|||
"@types/webpack": "^4.32.0",
|
||||
"@types/webpack-dev-server": "^3.1.5",
|
||||
"@types/webpack-merge": "^4.1.5",
|
||||
"babel-eslint": "8",
|
||||
"enzyme": "^3.9.0",
|
||||
"enzyme-adapter-react-16": "^1.12.1",
|
||||
"eslint": "4.x",
|
||||
"eslint-config-airbnb": "17.1.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.15.1",
|
||||
"eslint": "^6.6.0",
|
||||
"eslint-config-airbnb": "^18.0.1",
|
||||
"eslint-config-prettier": "^6.5.0",
|
||||
"eslint-plugin-header": "^3.0.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.0.3",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"eslint-plugin-react-hooks": "^0.0.0",
|
||||
"filepath": "^1.1.0",
|
||||
"front-matter": "^2.3.0",
|
||||
"glob-promise": "^3.3.0",
|
||||
"husky": "^1.3.1",
|
||||
"eslint-plugin-import": "^2.18.2",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-react": "^7.16.0",
|
||||
"eslint-plugin-react-hooks": "^2.2.0",
|
||||
"husky": "^3.0.9",
|
||||
"jest": "^24.9.0",
|
||||
"lerna": "^3.18.1",
|
||||
"lerna-changelog": "^0.8.2",
|
||||
"lint-staged": "^7.2.0",
|
||||
"picomatch": "^2.1.0",
|
||||
"prettier": "^1.18.2",
|
||||
"prettier": "^1.19.0",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4",
|
||||
"rimraf": "^2.6.3",
|
||||
"typescript": "^3.7.2"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
|
|
@ -33,6 +33,10 @@ module.exports = {
|
|||
'react/button-has-type': OFF, // 1
|
||||
'react/forbid-prop-types': 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
|
||||
'import/no-unresolved': OFF, // 15
|
||||
'react/prefer-stateless-function': OFF, // 22
|
||||
|
|
|
@ -375,9 +375,7 @@ function generateMetadataBlog(config = siteConfig) {
|
|||
// Extract, YYYY, MM, DD from the file name
|
||||
const filePathDateArr = path.basename(file).split('-');
|
||||
metadata.date = new Date(
|
||||
`${filePathDateArr[0]}-${filePathDateArr[1]}-${
|
||||
filePathDateArr[2]
|
||||
}T06:00:00.000Z`,
|
||||
`${filePathDateArr[0]}-${filePathDateArr[1]}-${filePathDateArr[2]}T06:00:00.000Z`,
|
||||
);
|
||||
// allow easier sorting of blog by providing seconds since epoch
|
||||
metadata.seconds = Math.round(metadata.date.getTime() / 1000);
|
||||
|
|
|
@ -75,5 +75,11 @@
|
|||
"tiny-lr": "^1.1.1",
|
||||
"tree-node-cli": "^1.2.5",
|
||||
"truncate-html": "^1.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"filepath": "^1.1.0",
|
||||
"front-matter": "^2.3.0",
|
||||
"glob-promise": "^3.3.0",
|
||||
"rimraf": "^2.6.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ describe('loadBlog', () => {
|
|||
);
|
||||
const {blogPosts} = await plugin.loadContent();
|
||||
const noDateSource = path.join('@site', pluginPath, 'no date.md');
|
||||
const noDateSourceBirthTime = (await fs.stat(
|
||||
noDateSource.replace('@site', siteDir),
|
||||
)).birthtime;
|
||||
const noDateSourceBirthTime = (
|
||||
await fs.stat(noDateSource.replace('@site', siteDir))
|
||||
).birthtime;
|
||||
const noDatePermalink = `/blog/${noDateSourceBirthTime
|
||||
.toISOString()
|
||||
.substr(0, '2019-01-01'.length)
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "^2.0.0-alpha.33"
|
||||
"@docusaurus/types": "^2.0.0-alpha.33",
|
||||
"picomatch": "^2.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/mdx-loader": "^2.0.0-alpha.33",
|
||||
|
|
|
@ -30,7 +30,10 @@ describe('createOrder', () => {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Category2',
|
||||
items: [{type: 'doc', id: 'doc3'}, {type: 'doc', id: 'doc4'}],
|
||||
items: [
|
||||
{type: 'doc', id: 'doc3'},
|
||||
{type: 'doc', id: 'doc4'},
|
||||
],
|
||||
},
|
||||
],
|
||||
otherDocs: [
|
||||
|
@ -75,12 +78,18 @@ describe('createOrder', () => {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Category1',
|
||||
items: [{type: 'doc', id: 'doc1'}, {type: 'doc', id: 'doc2'}],
|
||||
items: [
|
||||
{type: 'doc', id: 'doc1'},
|
||||
{type: 'doc', id: 'doc2'},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Category2',
|
||||
items: [{type: 'doc', id: 'doc3'}, {type: 'doc', id: 'doc4'}],
|
||||
items: [
|
||||
{type: 'doc', id: 'doc3'},
|
||||
{type: 'doc', id: 'doc4'},
|
||||
],
|
||||
},
|
||||
],
|
||||
otherDocs: [
|
||||
|
@ -188,7 +197,10 @@ describe('createOrder', () => {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Category2',
|
||||
items: [{type: 'doc', id: 'doc3'}, {type: 'ref', id: 'doc4'}],
|
||||
items: [
|
||||
{type: 'doc', id: 'doc3'},
|
||||
{type: 'ref', id: 'doc4'},
|
||||
],
|
||||
},
|
||||
],
|
||||
otherDocs: [
|
||||
|
@ -225,7 +237,10 @@ describe('createOrder', () => {
|
|||
{
|
||||
type: 'category',
|
||||
label: 'Category1',
|
||||
items: [{type: 'endi', id: 'doc1'}, {type: 'doc', id: 'doc2'}],
|
||||
items: [
|
||||
{type: 'endi', id: 'doc1'},
|
||||
{type: 'doc', id: 'doc2'},
|
||||
],
|
||||
},
|
||||
],
|
||||
otherDocs: [
|
||||
|
|
|
@ -37,7 +37,7 @@ function Layout(props) {
|
|||
const metaImageUrl = siteUrl + useBaseUrl(metaImage);
|
||||
const faviconUrl = useBaseUrl(favicon);
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<Head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
|
||||
|
@ -63,7 +63,7 @@ function Layout(props) {
|
|||
<Navbar />
|
||||
<main className="main">{children}</main>
|
||||
{!noFooter && <Footer />}
|
||||
</React.Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ function Navbar() {
|
|||
|
||||
const logoUrl = useBaseUrl(logo.src);
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<Head>
|
||||
{/* TODO: Do not assume that it is in english language */}
|
||||
<html lang="en" data-theme={theme} />
|
||||
|
@ -187,7 +187,7 @@ function Navbar() {
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</React.Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ const Search = props => {
|
|||
return isEnabled ? (
|
||||
<div className="navbar__search" key="search-box">
|
||||
<span
|
||||
aria-label="expand searchbar"
|
||||
role="button"
|
||||
className={classnames('search-icon', {
|
||||
'search-icon-hidden': props.isSearchBarExpanded,
|
||||
|
|
6
packages/docusaurus-types/src/index.d.ts
vendored
6
packages/docusaurus-types/src/index.d.ts
vendored
|
@ -25,13 +25,15 @@ export interface DocusaurusConfig {
|
|||
| {
|
||||
src: string;
|
||||
[key: string]: any;
|
||||
})[];
|
||||
}
|
||||
)[];
|
||||
stylesheets?: (
|
||||
| string
|
||||
| {
|
||||
href: string;
|
||||
[key: string]: any;
|
||||
})[];
|
||||
}
|
||||
)[];
|
||||
}
|
||||
|
||||
export interface DocusaurusContext {
|
||||
|
|
|
@ -90,10 +90,7 @@ export function genComponentName(pagePath: string): string {
|
|||
return 'index';
|
||||
}
|
||||
const pageHash = docuHash(pagePath);
|
||||
const pascalCase = _.flow(
|
||||
_.camelCase,
|
||||
_.upperFirst,
|
||||
);
|
||||
const pascalCase = _.flow(_.camelCase, _.upperFirst);
|
||||
return pascalCase(pageHash);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function Layout(props) {
|
|||
const {children, title, description} = props;
|
||||
const faviconUrl = useBaseUrl(favicon);
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<Head defaultTitle={`${defaultTitle} · ${tagline}`}>
|
||||
{title && <title>{`${title} · ${tagline}`}</title>}
|
||||
{favicon && <link rel="shortcut icon" href={faviconUrl} />}
|
||||
|
@ -27,7 +27,7 @@ function Layout(props) {
|
|||
)}
|
||||
</Head>
|
||||
{children}
|
||||
</React.Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ export function loadPresets(
|
|||
themes: PluginConfig[];
|
||||
} {
|
||||
const presets: PresetConfig[] = (context.siteConfig || {}).presets || [];
|
||||
const unflatPlugins: (PluginConfig[])[] = [];
|
||||
const unflatThemes: (PluginConfig[])[] = [];
|
||||
const unflatPlugins: PluginConfig[][] = [];
|
||||
const unflatThemes: PluginConfig[][] = [];
|
||||
|
||||
presets.forEach(presetItem => {
|
||||
let presetModuleImport;
|
||||
|
|
|
@ -29,7 +29,7 @@ Any CSS you write within that file will be available globally and can be referen
|
|||
|
||||
## 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.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue