This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds certain @types/*** to package.json "dependencies". The rationale is explained here: microsoft/types-publisher#81
- Loading branch information
1 parent
2d28d89
commit 0f7ab3f
Showing
3 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import express from 'express' | ||
import webpack from 'webpack' | ||
import WebpackChainConfig from 'webpack-chain' | ||
|
||
export interface LogOptions { | ||
logLevel: number | ||
debug: boolean | ||
silly: boolean | ||
quiet: boolean | ||
logUpdate: boolean | ||
} | ||
|
||
export interface Options extends LogOptions { | ||
dev: boolean | ||
baseDir: string | ||
config: string | false | ||
inspectWebpack: boolean | ||
} | ||
|
||
export interface WebpackConfigContext { | ||
isServer: boolean | ||
isClient: boolean | ||
dev: boolean | ||
type: string | ||
} | ||
|
||
export type ChainWebpackFn = (config: WebpackChainConfig, context: WebpackConfigContext) => void | ||
|
||
export type ConfigureWebpackFn = (config: webpack.Configuration, context: WebpackConfigContext) => void | ||
|
||
export type ConfigureServerFn = (server: express.Express) => void | ||
|
||
export type GeneratedRoutes = string[] | ||
|
||
export interface PluginDef { | ||
name: string | ||
apply: (ream: Ream) => void | ||
} | ||
|
||
export interface GenerateOptions { | ||
routes: GeneratedRoutes | ||
} | ||
|
||
export interface Config { | ||
entry: string | ||
outDir: string | ||
fsRoutes: boolean | { | ||
baseDir: string | ||
basePath: string | ||
match: RegExp | ||
} | ||
transpileDependencies: string[] | ||
runtimeCompiler: boolean | ||
productionSourceMap: boolean | ||
chainWebpack: ChainWebpackFn | ||
configureWebpack: ConfigureWebpackFn | ||
server: { | ||
port: number | ||
host: string | ||
} | ||
plugins: PluginDef[] | ||
generate: GenerateOptions | ||
css: { | ||
extract: boolean | ||
} | ||
pwa: boolean | ||
minimize: boolean | ||
defaultBabelPreset: 'minimal' | false | ||
} | ||
|
||
export class Ream { | ||
constructor(options?: Partial<Options>, config?: Partial<Config>) | ||
chainWebpack(ChainWebpackFn): void | ||
addGenerateRoutes(GeneratedRoutes): void | ||
hasPlugin(string): PluginDef | ||
loadPlugins(): void | ||
createConfigs(): void | ||
createCompilers(): void | ||
build(): Promise<void> | ||
generate(opts?: GenerateOptions): Promise<void> | ||
generateOnly(opts?: GenerateOptions): Promise<void> | ||
configureServer(fn: ConfigureServerFn): void | ||
prepareFiles(): Promise<void> | ||
writeCreateAppFile(): Promise<void> | ||
writeEntryFile(): Promise<void> | ||
getServer(): Promise<express.Express> | ||
getRequestHandler(): Promise<express.Application> | ||
start(): Promise<void> | ||
prepareWebpack(): Promise<void> | ||
prepareProduction(): Promise<void> | ||
createRenderer({ serverBundle, clientManifest, serverType }: { serverBundle: string | object, clientManifest: object, serverType: 'generate' | 'production' }): void | ||
resolveOutDir(...args): string | ||
resolveBaseDir(...args): string | ||
} | ||
|
||
export default function ream(options?: Partial<Options>, config?: Partial<Config>): Ream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters