forked from LinbuduLab/esbuild-plugins
-
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.
- Loading branch information
1 parent
a637d0d
commit ca8664e
Showing
8 changed files
with
68 additions
and
103 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 |
---|---|---|
@@ -1,22 +1,8 @@ | ||
import type { Plugin } from "esbuild"; | ||
|
||
import type Option from "../Interface/Option.js"; | ||
|
||
declare const _default: (Option?: Partial<Option>) => Promise<Plugin>; | ||
export default _default; | ||
|
||
export declare const PLUGIN_EXECUTED_FLAG = "esbuild_copy_executed"; | ||
export declare const Chalk: import("chalk").ChalkInstance; | ||
export declare const Log: ( | ||
Message: string, | ||
Verbose: boolean, | ||
Before?: boolean, | ||
) => Promise<void>; | ||
export declare const Handle: ( | ||
Out: string, | ||
Raw: string[], | ||
Glob: string, | ||
Base: string, | ||
Verbose?: boolean, | ||
Dry?: boolean, | ||
) => Promise<void>; | ||
export declare const Log: (Message: string, Verbose: boolean, Before?: boolean) => Promise<void>; | ||
export declare const Handle: (Out: string, Raw: string[], Glob: string, Base: string, Verbose?: boolean, Dry?: boolean) => Promise<void>; |
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,5 +1,4 @@ | ||
import type MaybeArray from "../Type/MaybeArray.js"; | ||
|
||
/** | ||
* @module Ensure | ||
* | ||
|
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,14 +1,12 @@ | ||
import type AssetPair from "../Interface/AssetPair.js"; | ||
import type MaybeArray from "../Type/MaybeArray.js"; | ||
|
||
/** | ||
* @module Format | ||
* | ||
*/ | ||
declare const _default: (Asset: MaybeArray<AssetPair>) => { | ||
from: string[]; | ||
to: string[]; | ||
from: string[]; | ||
to: string[]; | ||
}[]; | ||
export default _default; | ||
|
||
export declare const Ensure: <T>(item: MaybeArray<T>) => T[]; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 +1,16 @@ | ||
import type MaybeArray from "../Type/MaybeArray.js"; | ||
|
||
/** | ||
* @module AssetPair | ||
* | ||
*/ | ||
export default interface Interface { | ||
/** | ||
* from path is resolved based on `cwd` | ||
*/ | ||
from: MaybeArray<string>; | ||
/** | ||
* to path is resolved based on `outdir` or `outfile` in your ESBuild options by default | ||
* you can also set `Resolve` to change the base dir | ||
*/ | ||
to: MaybeArray<string>; | ||
/** | ||
* from path is resolved based on `cwd` | ||
*/ | ||
from: MaybeArray<string>; | ||
/** | ||
* to path is resolved based on `outdir` or `outfile` in your ESBuild options by default | ||
* you can also set `Resolve` to change the base dir | ||
*/ | ||
to: MaybeArray<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 |
---|---|---|
@@ -1,62 +1,60 @@ | ||
import type { Options } from "fast-glob"; | ||
|
||
import type AssetPair from "../Interface/AssetPair.js"; | ||
import type MaybeArray from "../Type/MaybeArray.js"; | ||
|
||
/** | ||
* @module Option | ||
* | ||
*/ | ||
export default interface Interface { | ||
/** | ||
* Asset pair to copy | ||
* | ||
* @default [] | ||
*/ | ||
Asset: MaybeArray<AssetPair>; | ||
/** | ||
* Copy in `ESBuild.onEnd` hook(recommended) | ||
* | ||
* set to true if you want to execute in onStart hook | ||
* | ||
* @default false | ||
*/ | ||
Copy: boolean; | ||
/** | ||
* enable verbose logging | ||
* | ||
* outputs from-path and to-path finally passed to `fs.copyFileSync` method | ||
* | ||
* @default false | ||
*/ | ||
Verbose: boolean; | ||
/** | ||
* options passed to `fast-glob` when we 're globbing for files to copy | ||
* | ||
* @default {} | ||
*/ | ||
Glob: Options; | ||
/** | ||
* Execute copy operation only once | ||
* | ||
* @default false | ||
*/ | ||
Once: boolean; | ||
/** | ||
* Resolve base path relative `assets.to` path | ||
* by default this plugin use `outdir` or `outfile` in your ESBuild options | ||
* you can specify "Current" or process.cwd() to resolve from current working directory, | ||
* also, you can specify somewhere else to resolve from. | ||
* | ||
* @default "Out" | ||
*/ | ||
Resolve: "Current" | "Out" | (string & {}); | ||
/** | ||
* use dry run mode to see what's happening. | ||
* | ||
* by default, enable this option means enable `verbose` option in the same time | ||
* | ||
* @default false | ||
*/ | ||
Dry?: boolean; | ||
/** | ||
* Asset pair to copy | ||
* | ||
* @default [] | ||
*/ | ||
Asset: MaybeArray<AssetPair>; | ||
/** | ||
* Copy in `ESBuild.onEnd` hook(recommended) | ||
* | ||
* set to true if you want to execute in onStart hook | ||
* | ||
* @default false | ||
*/ | ||
Copy: boolean; | ||
/** | ||
* enable verbose logging | ||
* | ||
* outputs from-path and to-path finally passed to `fs.copyFileSync` method | ||
* | ||
* @default false | ||
*/ | ||
Verbose: boolean; | ||
/** | ||
* options passed to `fast-glob` when we 're globbing for files to copy | ||
* | ||
* @default {} | ||
*/ | ||
Glob: Options; | ||
/** | ||
* Execute copy operation only once | ||
* | ||
* @default false | ||
*/ | ||
Once: boolean; | ||
/** | ||
* Resolve base path relative `assets.to` path | ||
* by default this plugin use `outdir` or `outfile` in your ESBuild options | ||
* you can specify "Current" or process.cwd() to resolve from current working directory, | ||
* also, you can specify somewhere else to resolve from. | ||
* | ||
* @default "Out" | ||
*/ | ||
Resolve: "Current" | "Out" | (string & {}); | ||
/** | ||
* use dry run mode to see what's happening. | ||
* | ||
* by default, enable this option means enable `verbose` option in the same time | ||
* | ||
* @default false | ||
*/ | ||
Dry?: boolean; | ||
} |