Skip to content

Commit

Permalink
Finish build function
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Oct 16, 2021
1 parent f0b4c2f commit 9094c89
Show file tree
Hide file tree
Showing 33 changed files with 1,838 additions and 1,634 deletions.
8 changes: 4 additions & 4 deletions examples/classic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"dev": "docusaurus start"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.6",
"@docusaurus/preset-classic": "2.0.0-beta.6",
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/preset-classic": "2.0.0-beta.7",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
Expand All @@ -28,7 +28,7 @@
"url-loader": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.6",
"@docusaurus/module-type-aliases": "2.0.0-beta.7",
"@tsconfig/docusaurus": "^1.0.4",
"@types/react": "^17.0.14",
"@types/react-helmet": "^6.1.2",
Expand All @@ -48,4 +48,4 @@
]
},
"description": "Docusaurus example project (classic-typescript template)"
}
}
6 changes: 3 additions & 3 deletions examples/classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"dev": "docusaurus start"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.6",
"@docusaurus/preset-classic": "2.0.0-beta.6",
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/preset-classic": "2.0.0-beta.7",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
Expand All @@ -39,4 +39,4 @@
]
},
"description": "Docusaurus example project"
}
}
6 changes: 3 additions & 3 deletions examples/facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"dev": "docusaurus start"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.6",
"@docusaurus/preset-classic": "2.0.0-beta.6",
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/preset-classic": "2.0.0-beta.7",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
Expand Down Expand Up @@ -55,4 +55,4 @@
]
},
"description": "Docusaurus example project (facebook template)"
}
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ module.exports = {
// Maybe point to a fixture?
'@generated/.*': '<rootDir>/jest/emptyModule.js',
// TODO maybe use "projects" + multiple configs if we plan to add tests to another theme?
'@theme/(.*)': '@docusaurus/theme-classic/lib-next/theme/$1',
'@theme/(.*)': '@docusaurus/theme-classic/lib/theme/$1',
},
};
3 changes: 0 additions & 3 deletions packages/create-docusaurus/bin/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env node

// TODO remove when fixed: https://github.com/Stuk/eslint-plugin-header/issues/39
/* eslint-disable header/header */
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
3 changes: 0 additions & 3 deletions packages/docusaurus-migrate/bin/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env node

// TODO remove when fixed: https://github.com/Stuk/eslint-plugin-header/issues/39
/* eslint-disable header/header */
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
Expand Down
6 changes: 4 additions & 2 deletions packages/docusaurus-plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@docusaurus/utils-common": "2.0.0-beta.7",
"@docusaurus/utils-validation": "2.0.0-beta.7",
"chalk": "^4.1.2",
Expand All @@ -31,6 +29,10 @@
"lodash": "^4.17.20",
"tslib": "^2.3.1"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
Expand Down
6 changes: 4 additions & 2 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"dependencies": {
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/mdx-loader": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@docusaurus/utils-validation": "2.0.0-beta.7",
"chalk": "^4.1.2",
"escape-string-regexp": "^4.0.0",
Expand All @@ -38,6 +36,10 @@
"utility-types": "^3.10.0",
"webpack": "^5.40.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-plugin-content-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
},
"license": "MIT",
"devDependencies": {
"@docusaurus/utils-build": "2.0.0-beta.7",
"@docusaurus/module-type-aliases": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@types/js-yaml": "^4.0.0",
"@types/picomatch": "^2.2.1",
"commander": "^5.1.0",
Expand All @@ -29,7 +30,6 @@
"dependencies": {
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/mdx-loader": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils": "2.0.0-beta.7",
"@docusaurus/utils-validation": "2.0.0-beta.7",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-content-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function pluginContentDocs(
name: 'docusaurus-plugin-content-docs',

getThemePath() {
return path.resolve(__dirname, 'js-theme');
return path.resolve(__dirname, 'theme');
},

getTypeScriptThemePath() {
Expand Down
6 changes: 4 additions & 2 deletions packages/docusaurus-plugin-content-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
"dependencies": {
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/mdx-loader": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@docusaurus/utils-validation": "2.0.0-beta.7",
"globby": "^11.0.2",
"lodash": "^4.17.20",
"remark-admonitions": "^1.2.1",
"tslib": "^2.3.1",
"webpack": "^5.40.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
Expand Down
20 changes: 0 additions & 20 deletions packages/docusaurus-plugin-debug/copyUntypedFiles.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tslib": "^2.3.1"
},
"devDependencies": {
"@docusaurus/utils-plugin": "2.0.0-beta.6"
"@docusaurus/utils-build": "2.0.0-beta.7"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-debug/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function pluginDebug({
name: 'docusaurus-plugin-debug',

getThemePath() {
return path.resolve(__dirname, 'js-theme');
return path.resolve(__dirname, 'theme');
},

getTypeScriptThemePath() {
Expand Down
20 changes: 0 additions & 20 deletions packages/docusaurus-plugin-ideal-image/copyUntypedFiles.js

This file was deleted.

3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-ideal-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.0-beta.7",
"description": "Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder).",
"main": "lib/index.js",
"types": "src/plugin-ideal-image.d.ts",
"scripts": {
"build": "docusaurus-plugin build",
"watch": "docusaurus-plugin watch"
Expand All @@ -17,7 +18,7 @@
},
"license": "MIT",
"devDependencies": {
"@docusaurus/utils-plugin": "2.0.0-beta.6",
"@docusaurus/utils-build": "2.0.0-beta.7",
"fs-extra": "^10.0.0"
},
"dependencies": {
Expand Down
8 changes: 6 additions & 2 deletions packages/docusaurus-plugin-ideal-image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {LoadContext, Plugin} from '@docusaurus/types';
import {PluginOptions} from './types';
import type {PluginOptions} from '@docusaurus/plugin-ideal-image';
import {Configuration} from 'webpack';

import path from 'path';
Expand All @@ -18,7 +18,11 @@ export default function (
name: 'docusaurus-plugin-ideal-image',

getThemePath() {
return path.resolve(__dirname, './theme');
return path.resolve(__dirname, 'theme');
},

getTypeScriptThemePath() {
return path.resolve(__dirname, '..', 'src', 'theme');
},

configureWebpack(_config: Configuration, isServer: boolean) {
Expand Down
41 changes: 41 additions & 0 deletions packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

declare module '@docusaurus/plugin-ideal-image' {
export type PluginOptions = {
/**
* Filename template for output files.
*/
name?: string;
/**
* Specify all widths you want to use; if a specified size exceeds the original image's width, the latter will be used (i.e. images won't be scaled up). You may also declare a default sizes array in the loader options in your webpack.config.js.
*/
sizes?: number[];
/**
* Specify one width you want to use; if the specified size exceeds the original image's width, the latter will be used (i.e. images won't be scaled up)
*/
size?: number;
/**
* As an alternative to manually specifying sizes, you can specify min, max and steps, and the sizes will be generated for you.
*/
min?: number;
/**
* See min above
*/
max?: number;
/**
* Configure the number of images generated between min and max (inclusive)
*/
steps?: number;
/**
* JPEG compression quality
*/
quality?: number;
};
}

declare module '@endiliey/react-ideal-image';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import IdealImage from '@endiliey/react-ideal-image';

function Image(props) {
function Image(props: React.ComponentProps<'img'> & {img: any}): JSX.Element {
const {alt, className, img} = props;

// In dev env just use regular img with original file
Expand All @@ -25,7 +25,7 @@ function Image(props) {
width={img.src.width || 100}
placeholder={{lqip: img.preSrc}}
src={img.src.src}
srcSet={img.src.images.map((image) => ({
srcSet={img.src.images.map((image: any) => ({
...image,
src: image.path,
}))}
Expand Down
37 changes: 0 additions & 37 deletions packages/docusaurus-plugin-ideal-image/src/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@docusaurus/plugin-content-docs": "2.0.0-beta.7",
"@docusaurus/plugin-content-pages": "2.0.0-beta.7",
"@docusaurus/theme-common": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@docusaurus/utils-common": "2.0.0-beta.7",
Expand All @@ -49,6 +48,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.7",
"@docusaurus/types": "2.0.0-beta.7",
"@docusaurus/utils-build": "2.0.0-beta.7",
"@types/mdx-js__react": "^1.5.4",
"@types/parse-numeric-range": "^0.0.1",
Expand Down
Loading

0 comments on commit 9094c89

Please sign in to comment.