@rspack/binding
Advanced tools
Comparing version 0.0.0-20221108135816 to 0.0.0-20221124101348
146
binding.d.ts
@@ -19,2 +19,7 @@ /* tslint:disable */ | ||
} | ||
export interface RawDecoratorOptions { | ||
legacy: boolean | ||
emitMetadata: boolean | ||
useDefineForClassFields: boolean | ||
} | ||
/** | ||
@@ -81,3 +86,7 @@ * It seems napi not support enum well | ||
react?: RawReactOptions | ||
decorator?: RawDecoratorOptions | ||
} | ||
export interface RawDevServer { | ||
hot?: boolean | ||
} | ||
/** | ||
@@ -100,6 +109,29 @@ * `loader` is for js side loader, `builtin_loader` is for rust side loader, | ||
} | ||
export interface RawModuleRuleCondition { | ||
/** Condition can be either a `string` or `Regexp`. */ | ||
type: "string" | "regexp" | ||
/** | ||
* Based on the condition type, the value can be either a `string` or `Regexp`. | ||
* - "string": The value will be matched against the string. | ||
* - "regexp": The value will be matched against the raw regexp source from JS side. | ||
*/ | ||
matcher?: string | ||
} | ||
export interface RawModuleRule { | ||
test?: string | ||
resource?: string | ||
resourceQuery?: string | ||
/** | ||
* A condition matcher matching an absolute path. | ||
* - String: To match the input must start with the provided string. I. e. an absolute directory path, or absolute path to the file. | ||
* - Regexp: It's tested with the input. | ||
*/ | ||
test?: RawModuleRuleCondition | ||
/** | ||
* A condition matcher matching an absolute path. | ||
* See `test` above | ||
*/ | ||
resource?: RawModuleRuleCondition | ||
/** | ||
* A condition matcher against the resource query. | ||
* TODO: align with webpack's `?` prefixed `resourceQuery` | ||
*/ | ||
resourceQuery?: RawModuleRuleCondition | ||
func?: (...args: any[]) => any | ||
@@ -145,3 +177,3 @@ uses?: Array<RawModuleRuleUse> | ||
export interface RawSplitChunksOptions { | ||
cacheGroups: Record<string, RawCacheGroupOptions> | ||
cacheGroups?: Record<string, RawCacheGroupOptions> | ||
/** What kind of chunks should be selected. */ | ||
@@ -173,15 +205,8 @@ chunks?: string | ||
stats?: RawStatsOptions | ||
devServer?: RawDevServer | ||
} | ||
export interface AssetContent { | ||
buffer?: Buffer | ||
source?: string | ||
} | ||
export interface UpdateAssetOptions { | ||
asset: AssetContent | ||
filename: string | ||
} | ||
export interface AssetInfoRelated { | ||
export interface JsAssetInfoRelated { | ||
sourceMap?: string | ||
} | ||
export interface AssetInfo { | ||
export interface JsAssetInfo { | ||
/** | ||
@@ -202,20 +227,27 @@ * if the asset can be long term cached forever (contains a hash) | ||
development: boolean | ||
/** when asset ships data for updating an existing application (HMR) */ | ||
hotModuleReplacement: boolean | ||
/** | ||
* when asset ships data for updating an existing application (HMR) | ||
* when asset is javascript and an ESM | ||
* related object to other assets, keyed by type of relation (only points from parent to child) | ||
*/ | ||
related: AssetInfoRelated | ||
related: JsAssetInfoRelated | ||
} | ||
export interface Asset { | ||
export interface JsAsset { | ||
name: string | ||
source: JsCompatSource | ||
info: AssetInfo | ||
info: JsAssetInfo | ||
} | ||
export interface PluginCallbacks { | ||
doneCallback: (...args: any[]) => any | ||
processAssetsCallback: (...args: any[]) => any | ||
compilationCallback: (...args: any[]) => any | ||
thisCompilationCallback: (...args: any[]) => any | ||
export interface JsChunk { | ||
files: Array<string> | ||
} | ||
export interface JsChunkGroup { | ||
chunks: Array<JsChunk> | ||
} | ||
export interface JsHooks { | ||
done: (...args: any[]) => any | ||
processAssets: (...args: any[]) => any | ||
compilation: (...args: any[]) => any | ||
thisCompilation: (...args: any[]) => any | ||
} | ||
export interface JsCompatSource { | ||
@@ -229,24 +261,11 @@ /** Whether the underlying data structure is a `RawSource` */ | ||
} | ||
export const enum DiffStatKind { | ||
Changed = 0, | ||
Deleted = 1, | ||
Added = 2 | ||
} | ||
export interface DiffStat { | ||
content: string | ||
kind: DiffStatKind | ||
} | ||
export interface RebuildResult { | ||
diff: Record<string, DiffStat> | ||
stats: StatsCompilation | ||
} | ||
export interface StatsError { | ||
export interface JsStatsError { | ||
message: string | ||
formatted: string | ||
} | ||
export interface StatsWarning { | ||
export interface JsStatsWarning { | ||
message: string | ||
formatted: string | ||
} | ||
export interface StatsAsset { | ||
export interface JsStatsAsset { | ||
type: string | ||
@@ -257,8 +276,10 @@ name: string | ||
chunkNames: Array<string> | ||
info: StatsAssetInfo | ||
info: JsStatsAssetInfo | ||
emitted: boolean | ||
} | ||
export interface StatsAssetInfo { | ||
export interface JsStatsAssetInfo { | ||
development: boolean | ||
hotModuleReplacement: boolean | ||
} | ||
export interface StatsModule { | ||
export interface JsStatsModule { | ||
type: string | ||
@@ -272,3 +293,3 @@ moduleType: string | ||
} | ||
export interface StatsChunk { | ||
export interface JsStatsChunk { | ||
type: string | ||
@@ -282,23 +303,34 @@ files: Array<string> | ||
} | ||
export interface StatsCompilation { | ||
assets: Array<StatsAsset> | ||
modules: Array<StatsModule> | ||
chunks: Array<StatsChunk> | ||
errors: Array<StatsError> | ||
export interface JsStatsEntrypointAsset { | ||
name: string | ||
size: number | ||
} | ||
export interface JsStatsEntrypoint { | ||
name: string | ||
assets: Array<JsStatsEntrypointAsset> | ||
chunks: Array<string> | ||
assetsSize: number | ||
} | ||
export interface JsStatsCompilation { | ||
assets: Array<JsStatsAsset> | ||
modules: Array<JsStatsModule> | ||
chunks: Array<JsStatsChunk> | ||
entrypoints: Array<JsStatsEntrypoint> | ||
errors: Array<JsStatsError> | ||
errorsCount: number | ||
warnings: Array<StatsWarning> | ||
warnings: Array<JsStatsWarning> | ||
warningsCount: number | ||
} | ||
export interface OnLoadContext { | ||
id: string | ||
} | ||
export function initCustomTraceSubscriber(): void | ||
export class JsCompilation { | ||
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void | ||
getAssets(): Readonly<Asset>[] | ||
emitAsset(filename: string, source: JsCompatSource, assetInfo: AssetInfo): void | ||
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void | ||
getAssets(): Readonly<JsAsset>[] | ||
getAsset(name: string): JsAsset | null | ||
emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void | ||
deleteAsset(filename: string): void | ||
get assets(): Record<string, JsCompatSource> | ||
get entrypoints(): Record<string, JsChunkGroup> | ||
} | ||
export class Rspack { | ||
constructor(options: RawOptions, pluginCallbacks?: PluginCallbacks | undefined | null) | ||
constructor(options: RawOptions, jsHooks?: JsHooks | undefined | null) | ||
/** | ||
@@ -310,3 +342,3 @@ * Build with the given option passed to the constructor | ||
*/ | ||
unsafe_build(callback: (err: null | Error, result: StatsCompilation) => void): void | ||
unsafe_build(callback: (err: null | Error, result: JsStatsCompilation) => void): void | ||
/** | ||
@@ -313,0 +345,0 @@ * Rebuild with the given option passed to the constructor |
{ | ||
"name": "@rspack/binding", | ||
"version": "0.0.0-20221108135816", | ||
"version": "0.0.0-20221124101348", | ||
"description": "Node binding for rspack", | ||
@@ -20,9 +20,12 @@ "main": "binding.js", | ||
"@napi-rs/cli": "^2.6.2", | ||
"why-is-node-running": "2.2.1" | ||
"why-is-node-running": "2.2.1", | ||
"npm-run-all": "4.1.5" | ||
}, | ||
"scripts": { | ||
"build": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json", | ||
"build:debug": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json", | ||
"build:release:all": "run-p build:release build:release:x64 build:release:linux", | ||
"build:release": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json", | ||
"build:release-debuginfo": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json --cargo-flags='--profile release-debuginfo'" | ||
"build:release:x64": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --target x86_64-apple-darwin", | ||
"build:release:linux": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --zig --target x86_64-unknown-linux-gnu --zig-abi-suffix=2.17" | ||
} | ||
} |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances 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
6
571
112687582
3
3