forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restrict typings and refactor
RenderedModule
(rolldown#503)
- Loading branch information
Showing
19 changed files
with
124 additions
and
128 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
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
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
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
#[derive(Debug, Clone)] | ||
pub struct RenderedModule { | ||
// The code of the module is omit at now. | ||
pub original_length: u32, | ||
pub rendered_length: u32, | ||
pub code: Option<String>, | ||
} |
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 |
---|---|---|
|
@@ -78,6 +78,7 @@ lint-node: | |
yarn lint-filename | ||
yarn lint | ||
yarn prettier:ci | ||
yarn typecheck | ||
|
||
lint: | ||
just lint-rust | ||
|
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
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,5 @@ | ||
import { RolldownOutputAsset, RolldownOutputChunk } from './rolldown-output'; | ||
|
||
export interface OutputBundle { | ||
[fileName: string]: RolldownOutputAsset | RolldownOutputChunk; | ||
} |
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 @@ | ||
export interface RenderedModule { } |
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,43 @@ | ||
import type { OutputAsset, OutputChunk, RollupOutput } from '../rollup' | ||
import { HasProperty, IsPropertiesEqual, IsPropertyEqual, TypeAssert } from '../utils/type-assert'; | ||
import { RenderedModule } from './rendered-module'; | ||
|
||
export interface RolldownOutputAsset { | ||
type: 'asset'; | ||
fileName: string; | ||
source: string | Uint8Array; | ||
} | ||
|
||
function _assertRolldownOutputAsset() { | ||
type _ = TypeAssert<IsPropertiesEqual<RolldownOutputAsset, OutputAsset>>; | ||
} | ||
|
||
export interface RolldownOutputChunk { | ||
type: 'chunk'; | ||
code: string; | ||
isEntry: boolean; | ||
exports: string[]; | ||
fileName: string; | ||
modules: { | ||
[id: string]: RenderedModule; | ||
}; | ||
facadeModuleId: string | null; | ||
isDynamicEntry: boolean; | ||
moduleIds: string[]; | ||
} | ||
|
||
function _assertRolldownOutputChunk() { | ||
type _ = TypeAssert<IsPropertiesEqual<Omit<RolldownOutputChunk, 'modules'>, OutputChunk>>; | ||
} | ||
|
||
export interface RolldownOutput { | ||
output: [ | ||
RolldownOutputChunk, | ||
...(RolldownOutputChunk | RolldownOutputAsset)[], | ||
] | ||
} | ||
|
||
|
||
function _assertRolldownOutput() { | ||
type _ = TypeAssert<HasProperty<RolldownOutput, 'output'>>; | ||
} |
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
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
export type { | ||
RollupBuild, | ||
RollupOutput, | ||
OutputOptions, | ||
SerializedTimings, | ||
InputOptions, | ||
Plugin, | ||
OutputPlugin, | ||
|
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
Oops, something went wrong.