@rsbuild/shared
Advanced tools
Comparing version 0.7.0-beta.9 to 0.7.0
@@ -1,2 +0,2 @@ | ||
import type { InspectConfigOptions, NormalizedConfig, RsbuildConfig } from './types'; | ||
import type { InspectConfigOptions, NormalizedConfig } from './types'; | ||
export declare function outputInspectConfigFiles({ rsbuildConfig, rawRsbuildConfig, bundlerConfigs, inspectOptions, configType, }: { | ||
@@ -12,5 +12,1 @@ configType: string; | ||
export declare function stringifyConfig(config: unknown, verbose?: boolean): Promise<string>; | ||
/** | ||
* Omit unused keys from Rsbuild config passed by user | ||
*/ | ||
export declare const pickRsbuildConfig: (rsbuildConfig: RsbuildConfig) => RsbuildConfig; |
import type { ModuleFederationPluginOptions } from '@rspack/core'; | ||
import type { RsbuildPlugins, RsbuildProvider } from '..'; | ||
import type { RsbuildPlugins } from '..'; | ||
import type { DeepReadonly } from '../utils'; | ||
@@ -71,3 +71,3 @@ import type { DevConfig, NormalizedDevConfig } from './dev'; | ||
*/ | ||
provider?: RsbuildProvider<'rspack'> | RsbuildProvider<'webpack'>; | ||
provider?: unknown; | ||
/** | ||
@@ -89,3 +89,3 @@ * @private | ||
moduleFederation?: ModuleFederationConfig; | ||
provider?: RsbuildProvider<'rspack'> | RsbuildProvider<'webpack'>; | ||
provider?: unknown; | ||
_privateMeta?: RsbuildConfigMeta; | ||
@@ -92,0 +92,0 @@ }>; |
@@ -12,2 +12,1 @@ export * from './rspack'; | ||
export * from './thirdParty'; | ||
export * from './server'; |
import type { Compiler, MultiCompiler } from '@rspack/core'; | ||
import type { NormalizedConfig } from './config'; | ||
import type { RsbuildContext } from './context'; | ||
import type { PluginManager, RsbuildPluginAPI } from './plugin'; | ||
import type { CreateRsbuildOptions, RsbuildMode } from './rsbuild'; | ||
import type { RsbuildMode } from './rsbuild'; | ||
import type { RspackConfig } from './rspack'; | ||
import type { RsbuildDevServer, StartServerResult } from './server'; | ||
import type { WebpackConfig } from './thirdParty'; | ||
@@ -49,22 +46,2 @@ export type Bundler = 'rspack' | 'webpack'; | ||
}; | ||
export type RsbuildProvider<B extends 'rspack' | 'webpack' = 'rspack'> = (options: { | ||
pluginManager: PluginManager; | ||
rsbuildOptions: Required<CreateRsbuildOptions>; | ||
}) => Promise<ProviderInstance<B>>; | ||
export type CreateCompiler = <C = Compiler | MultiCompiler>(options?: CreateCompilerOptions) => Promise<C>; | ||
export type ProviderInstance<B extends 'rspack' | 'webpack' = 'rspack'> = { | ||
readonly bundler: Bundler; | ||
readonly publicContext: Readonly<RsbuildContext>; | ||
pluginAPI: RsbuildPluginAPI; | ||
applyDefaultPlugins: (pluginManager: PluginManager) => Promise<void>; | ||
createCompiler: CreateCompiler; | ||
/** | ||
* It is designed for high-level frameworks that require a custom server | ||
*/ | ||
createDevServer: (options?: CreateDevServerOptions) => Promise<RsbuildDevServer>; | ||
startDevServer: (options?: StartDevServerOptions) => Promise<StartServerResult>; | ||
preview: (options?: PreviewServerOptions) => Promise<StartServerResult>; | ||
build: (options?: BuildOptions) => Promise<void>; | ||
initConfigs: () => Promise<B extends 'rspack' ? RspackConfig[] : WebpackConfig[]>; | ||
inspectConfig: (options?: InspectConfigOptions) => Promise<InspectConfigResult<B>>; | ||
}; |
import type { EntryDescription } from '@rspack/core'; | ||
import type { RsbuildConfig } from './config'; | ||
import type { RsbuildContext } from './context'; | ||
import type { PluginManager } from './plugin'; | ||
import type { ProviderInstance, RsbuildProvider } from './provider'; | ||
export type RsbuildTarget = 'web' | 'node' | 'web-worker' | 'service-worker'; | ||
export type RsbuildEntry = Record<string, string | string[] | EntryDescription>; | ||
export type RsbuildMode = 'development' | 'production'; | ||
export type CreateRsbuildOptions = { | ||
/** The root path of current project. */ | ||
cwd?: string; | ||
/** Configurations of Rsbuild. */ | ||
rsbuildConfig?: RsbuildConfig; | ||
}; | ||
export type RsbuildInstance<P extends RsbuildProvider | RsbuildProvider<'webpack'> = RsbuildProvider> = { | ||
context: RsbuildContext; | ||
addPlugins: PluginManager['addPlugins']; | ||
getPlugins: PluginManager['getPlugins']; | ||
removePlugins: PluginManager['removePlugins']; | ||
isPluginExists: PluginManager['isPluginExists']; | ||
build: ProviderInstance['build']; | ||
preview: ProviderInstance['preview']; | ||
initConfigs: ProviderInstance['initConfigs']; | ||
inspectConfig: ProviderInstance['inspectConfig']; | ||
createCompiler: ProviderInstance['createCompiler']; | ||
createDevServer: ProviderInstance['createDevServer']; | ||
startDevServer: ProviderInstance['startDevServer']; | ||
getHTMLPaths: Awaited<ReturnType<P>>['pluginAPI']['getHTMLPaths']; | ||
getRsbuildConfig: Awaited<ReturnType<P>>['pluginAPI']['getRsbuildConfig']; | ||
getNormalizedConfig: Awaited<ReturnType<P>>['pluginAPI']['getNormalizedConfig']; | ||
onBeforeBuild: Awaited<ReturnType<P>>['pluginAPI']['onBeforeBuild']; | ||
onBeforeCreateCompiler: Awaited<ReturnType<P>>['pluginAPI']['onBeforeCreateCompiler']; | ||
onBeforeStartDevServer: Awaited<ReturnType<P>>['pluginAPI']['onBeforeStartDevServer']; | ||
onBeforeStartProdServer: Awaited<ReturnType<P>>['pluginAPI']['onBeforeStartProdServer']; | ||
onAfterBuild: Awaited<ReturnType<P>>['pluginAPI']['onAfterBuild']; | ||
onAfterCreateCompiler: Awaited<ReturnType<P>>['pluginAPI']['onAfterCreateCompiler']; | ||
onAfterStartDevServer: Awaited<ReturnType<P>>['pluginAPI']['onAfterStartDevServer']; | ||
onAfterStartProdServer: Awaited<ReturnType<P>>['pluginAPI']['onAfterStartProdServer']; | ||
onCloseDevServer: Awaited<ReturnType<P>>['pluginAPI']['onCloseDevServer']; | ||
onDevCompileDone: Awaited<ReturnType<P>>['pluginAPI']['onDevCompileDone']; | ||
onExit: Awaited<ReturnType<P>>['pluginAPI']['onExit']; | ||
}; |
@@ -6,2 +6,3 @@ import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core'; | ||
import type Autoprefixer from '../../compiled/autoprefixer/index.js'; | ||
import type { Rspack } from './rspack'; | ||
type AutoprefixerOptions = Autoprefixer.Options; | ||
@@ -38,13 +39,57 @@ export interface CSSExtractOptions { | ||
export type { AcceptedPlugin as PostCSSPlugin } from 'postcss'; | ||
export interface CSSModulesOptions { | ||
compileType?: string; | ||
mode?: string; | ||
export type CSSLoaderModulesMode = 'local' | 'global' | 'pure' | 'icss' | ((resourcePath: string) => 'local' | 'global' | 'pure' | 'icss'); | ||
export type CSSLoaderExportLocalsConvention = 'asIs' | 'as-is' | 'camelCase' | 'camel-case' | 'camelCaseOnly' | 'camel-case-only' | 'dashes' | 'dashesOnly' | 'dashes-only' | ((name: string) => string); | ||
export interface CSSLoaderModulesOptions { | ||
/** | ||
* Allows auto enable CSS modules/ICSS based on the filename, query or fragment. | ||
*/ | ||
auto?: boolean | RegExp | ((resourcePath: string, resourceQuery: string, resourceFragment: string) => boolean); | ||
/** | ||
* Allow `css-loader` to export names from global class or id, so you can use that as local name. | ||
*/ | ||
exportGlobals?: boolean; | ||
/** | ||
* Style of exported class names. | ||
*/ | ||
exportLocalsConvention?: CSSLoaderExportLocalsConvention; | ||
/** | ||
* Export only locals. | ||
*/ | ||
exportOnlyLocals?: boolean; | ||
/** | ||
* Allows to specify a function to generate the classname. | ||
*/ | ||
getLocalIdent?: (context: Rspack.LoaderContext, localIdentName: string, localName: string) => string; | ||
/** | ||
* Allows to configure the generated local ident name. | ||
*/ | ||
localIdentName?: string; | ||
/** | ||
* Allows to redefine basic loader context for local ident name. | ||
*/ | ||
localIdentContext?: string; | ||
localIdentHashPrefix?: string; | ||
/** | ||
* Allows to add custom hash to generate more unique classes. | ||
*/ | ||
localIdentHashSalt?: string; | ||
/** | ||
* Allows to specify hash function to generate classes. | ||
*/ | ||
localIdentHashFunction?: string; | ||
/** | ||
* Allows to specify hash digest to generate classes. | ||
*/ | ||
localIdentHashDigest?: string; | ||
/** | ||
* Allows to specify custom RegExp for local ident name. | ||
*/ | ||
localIdentRegExp?: string | RegExp; | ||
/** | ||
* Controls the level of compilation applied to the input styles. | ||
*/ | ||
mode?: CSSLoaderModulesMode; | ||
/** | ||
* Enables/disables ES modules named export for locals. | ||
*/ | ||
namedExport?: boolean; | ||
exportLocalsConvention?: string; | ||
exportOnlyLocals?: boolean; | ||
} | ||
@@ -68,3 +113,3 @@ export interface CSSLoaderOptions { | ||
*/ | ||
modules?: boolean | string | CSSModulesOptions; | ||
modules?: boolean | string | CSSLoaderModulesOptions; | ||
/** | ||
@@ -71,0 +116,0 @@ * By default generation of source maps depends on the devtool option. |
@@ -5,3 +5,3 @@ import { createRequire } from 'module'; | ||
// ../../node_modules/.pnpm/@modern-js+module-tools@2.49.3_eslint@8.57.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js | ||
// ../../node_modules/.pnpm/@modern-js+module-tools@2.50.0_eslint@9.3.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js | ||
import { fileURLToPath } from "url"; | ||
@@ -817,17 +817,2 @@ import path from "path"; | ||
} | ||
var pickRsbuildConfig = (rsbuildConfig) => { | ||
const keys = [ | ||
"dev", | ||
"html", | ||
"tools", | ||
"output", | ||
"source", | ||
"server", | ||
"security", | ||
"performance", | ||
"moduleFederation", | ||
"_privateMeta" | ||
]; | ||
return pick(rsbuildConfig, keys); | ||
}; | ||
@@ -1192,3 +1177,2 @@ // src/chain.ts | ||
pick, | ||
pickRsbuildConfig, | ||
prettyTime, | ||
@@ -1195,0 +1179,0 @@ removeLeadingSlash, |
{ | ||
"name": "@rsbuild/shared", | ||
"version": "0.7.0-beta.9", | ||
"version": "0.7.0", | ||
"description": "The internal shared modules and dependencies of Rsbuild.", | ||
@@ -51,6 +51,2 @@ "homepage": "https://rsbuild.dev", | ||
}, | ||
"./connect": { | ||
"types": "./compiled/connect/index.d.ts", | ||
"default": "./compiled/connect/index.js" | ||
}, | ||
"./mime-types": { | ||
@@ -89,3 +85,3 @@ "types": "./compiled/mime-types/index.d.ts", | ||
"dependencies": { | ||
"@rspack/core": "0.7.0-beta.2", | ||
"@rspack/core": "0.7.0", | ||
"caniuse-lite": "^1.0.30001617", | ||
@@ -96,3 +92,2 @@ "html-webpack-plugin": "npm:html-rspack-plugin@5.7.2", | ||
"devDependencies": { | ||
"@types/connect": "3.4.38", | ||
"@types/fs-extra": "^11.0.4", | ||
@@ -104,3 +99,2 @@ "@types/node": "18.x", | ||
"chokidar": "3.6.0", | ||
"connect": "3.7.0", | ||
"deepmerge": "^4.3.1", | ||
@@ -107,0 +101,0 @@ "fs-extra": "^11.2.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
25
65
4490354
103
74728
+ Added@rspack/binding@0.7.0(transitive)
+ Added@rspack/binding-darwin-arm64@0.7.0(transitive)
+ Added@rspack/binding-darwin-x64@0.7.0(transitive)
+ Added@rspack/binding-linux-arm64-gnu@0.7.0(transitive)
+ Added@rspack/binding-linux-arm64-musl@0.7.0(transitive)
+ Added@rspack/binding-linux-x64-gnu@0.7.0(transitive)
+ Added@rspack/binding-linux-x64-musl@0.7.0(transitive)
+ Added@rspack/binding-win32-arm64-msvc@0.7.0(transitive)
+ Added@rspack/binding-win32-ia32-msvc@0.7.0(transitive)
+ Added@rspack/binding-win32-x64-msvc@0.7.0(transitive)
+ Added@rspack/core@0.7.0(transitive)
- Removed@rspack/binding@0.7.0-beta.2(transitive)
- Removed@rspack/binding-darwin-arm64@0.7.0-beta.2(transitive)
- Removed@rspack/binding-darwin-x64@0.7.0-beta.2(transitive)
- Removed@rspack/binding-linux-arm64-gnu@0.7.0-beta.2(transitive)
- Removed@rspack/binding-linux-arm64-musl@0.7.0-beta.2(transitive)
- Removed@rspack/binding-linux-x64-gnu@0.7.0-beta.2(transitive)
- Removed@rspack/binding-linux-x64-musl@0.7.0-beta.2(transitive)
- Removed@rspack/binding-win32-arm64-msvc@0.7.0-beta.2(transitive)
- Removed@rspack/binding-win32-ia32-msvc@0.7.0-beta.2(transitive)
- Removed@rspack/binding-win32-x64-msvc@0.7.0-beta.2(transitive)
- Removed@rspack/core@0.7.0-beta.2(transitive)
Updated@rspack/core@0.7.0