chore: finally got all the types building

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-04-15 10:46:17 +02:00
parent fcb8cfa7b9
commit 566e492359
4 changed files with 185 additions and 118 deletions
+2 -6
View File
@@ -50,7 +50,6 @@
"@svgr/plugin-svgo": "5.4.x",
"@svgr/rollup": "5.5.x",
"@svgr/webpack": "5.5.x",
"@types/start-server-webpack-plugin": "^2.2.0",
"@types/webpack-env": "^1.15.2",
"@typescript-eslint/eslint-plugin": "^v4.28.3",
"@typescript-eslint/parser": "^v4.28.3",
@@ -78,13 +77,13 @@
"fork-ts-checker-webpack-plugin": "^6.2.9",
"fs-extra": "9.1.0",
"handlebars": "^4.7.3",
"html-webpack-plugin": "^4.3.0",
"html-webpack-plugin": "^5.3.1",
"inquirer": "^7.0.4",
"jest": "^26.0.1",
"jest-css-modules": "^2.1.0",
"json-schema": "^0.3.0",
"lodash": "^4.17.19",
"mini-css-extract-plugin": "^0.9.0",
"mini-css-extract-plugin": "^1.4.1",
"ora": "^5.3.0",
"postcss": "^8.1.0",
"process": "^0.11.10",
@@ -130,13 +129,10 @@
"@types/diff": "^5.0.0",
"@types/express": "^4.17.6",
"@types/fs-extra": "^9.0.1",
"@types/html-webpack-plugin": "^3.2.2",
"@types/http-proxy": "^1.17.4",
"@types/inquirer": "^7.3.1",
"@types/mini-css-extract-plugin": "^1.2.2",
"@types/mock-fs": "^4.13.0",
"@types/node": "^14.14.32",
"@types/react-dev-utils": "^9.0.4",
"@types/recursive-readdir": "^2.2.0",
"@types/rollup-plugin-peer-deps-external": "^2.2.0",
"@types/rollup-plugin-postcss": "^2.0.0",
+163
View File
@@ -32,6 +32,169 @@ declare module '@rollup/plugin-yaml';
declare module 'terser-webpack-plugin';
declare module 'react-dev-utils/formatWebpackMessages' {
export default function (
stats: any,
): {
errors: string[];
warnings: string[];
};
}
declare module 'react-dev-utils/openBrowser' {
export default function (url: string): boolean;
}
declare module 'react-dev-utils/ModuleScopePlugin' {
import webpack = require('webpack');
export default class ModuleScopePlugin
implements webpack.WebpackPluginInstance {
constructor(
appSrc: string | ReadonlyArray<string>,
allowedFiles?: ReadonlyArray<string>,
);
apply: (compiler: webpack.Compiler) => void;
}
}
declare module 'react-dev-utils/FileSizeReporter' {
import webpack = require('webpack');
export interface OpaqueFileSizes {
root: string;
sizes: Record<string, number>;
}
/**
* Captures JS and CSS asset sizes inside the passed `buildFolder`. Save the
* result value to compare it after the build.
*/
export function measureFileSizesBeforeBuild(
buildFolder: string,
): Promise<OpaqueFileSizes>;
/**
* Prints the JS and CSS asset sizes after the build, and includes a size
* comparison with `previousFileSizes` that were captured earlier using
* `measureFileSizesBeforeBuild()`. `maxBundleGzipSize` and
* `maxChunkGzipSizemay` may optionally be specified to display a warning when
* the main bundle or a chunk exceeds the specified size (in bytes).
*/
export function printFileSizesAfterBuild(
webpackStats: webpack.Stats,
previousFileSizes: OpaqueFileSizes,
buildFolder: string,
maxBundleGzipSize?: number,
maxChunkGzipSize?: number,
): void;
}
declare module 'mini-css-extract-plugin' {
import webpack = require('webpack');
/**
* Lightweight CSS extraction webpack plugin.
*
* This plugin extracts CSS into separate files. It creates a CSS file per JS file which
* contains CSS. It supports On-Demand-Loading of CSS and SourceMaps.
*
* Configuration Detail: https://github.com/webpack-contrib/mini-css-extract-plugin#configuration
*/
export default class MiniCssExtractPlugin {
/**
* Webpack loader always used at the end of loaders list (ie. array index zero).
*/
static loader: string;
constructor(options?: MiniCssExtractPlugin.PluginOptions);
/**
* Apply the plugin
*/
apply(compiler: webpack.Compiler): void;
}
namespace MiniCssExtractPlugin {
interface PluginOptions {
/**
* Works like [`output.filename`](https://webpack.js.org/configuration/output/#outputfilename).
*/
filename?: Required<webpack.Configuration>['output']['filename'];
/**
* Works like [`output.chunkFilename`](https://webpack.js.org/configuration/output/#outputchunkfilename).
*/
chunkFilename?: string;
/**
* For projects where CSS ordering has been mitigated through consistent
* use of scoping or naming conventions, the CSS order warnings can be
* disabled by setting this flag to true for the plugin.
*/
ignoreOrder?: boolean;
/**
* Specify where to insert the link tag.
*
* A string value specifies a DOM query for a parent element to attach to.
*
* A function allows to override default behavior for non-entry CSS chunks.
* This code will run in the browser alongside your application. It is recommend
* to only use ECMA 5 features and syntax. The function won't have access to the
* scope of the webpack configuration module.
*
* @default function() { document.head.appendChild(linkTag); }
*/
insert?: string | ((linkTag: any) => void);
/**
* Specify additional html attributes to add to the link tag.
*
* Note: These are only applied to dynamically loaded css chunks. To modify link
* attributes for entry CSS chunks, please use html-webpack-plugin.
*/
attributes?: Record<string, string>;
/**
* This option allows loading asynchronous chunks with a custom link type, such as
* `<link type="text/css" ...>`.
*
* `false` disables the link `type` attribute.
*
* @default 'text/css'
*/
linkType?: string | false | 'text/css';
}
interface LoaderOptions {
/**
* Overrides [`output.publicPath`](https://webpack.js.org/configuration/output/#outputpublicpath).
* @default output.publicPath
*/
publicPath?: string | ((resourcePath: string, context: string) => string);
/**
* If false, the plugin will extract the CSS but **will not** emit the file
* @default true
*/
emit?: boolean;
/**
* By default, `mini-css-extract-plugin` generates JS modules that use the ES modules syntax.
* There are some cases in which using ES modules is beneficial,
* like in the case of module concatenation and tree shaking.
* @default true
*/
esModule?: boolean;
modules?: {
/**
* Enables/disables ES modules named export for locals.
*
* Names of locals are converted to camelCase. It is not allowed to use
* JavaScript reserved words in CSS class names. Options `esModule` and
* `modules.namedExport` in css-loader and MiniCssExtractPlugin.loader
* must be enabled.
*
* @default false
*/
namedExport?: boolean;
};
}
}
}
declare module 'webpack-node-externals' {
export default function webpackNodeExternals(
options?: webpackNodeExternals.Options,