Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Oct 21, 2024
1 parent a637d0d commit ca8664e
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 103 deletions.
18 changes: 2 additions & 16 deletions Target/Function/Copy.d.ts
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>;
1 change: 0 additions & 1 deletion Target/Function/Ensure.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type MaybeArray from "../Type/MaybeArray.js";

/**
* @module Ensure
*
Expand Down
6 changes: 2 additions & 4 deletions Target/Function/Format.d.ts
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[];
15 changes: 2 additions & 13 deletions Target/Function/Handle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@
* @param Dry Dry run mode
* @returns
*/
declare const _default: (
Out: string,
Raw: string[],
Glob: string,
Base: string,
Verbose?: boolean,
Dry?: boolean,
) => Promise<void>;
declare const _default: (Out: string, Raw: string[], Glob: string, Base: string, Verbose?: boolean, Dry?: boolean) => Promise<void>;
export default _default;
export declare const resolve: (...paths: string[]) => string;
export declare const Log: (
Message: string,
Verbose: boolean,
Before?: boolean,
) => Promise<void>;
export declare const Log: (Message: string, Verbose: boolean, Before?: boolean) => Promise<void>;
2 changes: 1 addition & 1 deletion Target/Function/Handle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Target/Function/Log.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
* @module Log
*
*/
declare const _default: (
Message: string,
Verbose: boolean,
Before?: boolean,
) => Promise<void>;
declare const _default: (Message: string, Verbose: boolean, Before?: boolean) => Promise<void>;
export default _default;
19 changes: 9 additions & 10 deletions Target/Interface/AssetPair.d.ts
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>;
}
104 changes: 51 additions & 53 deletions Target/Interface/Option.d.ts
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;
}

0 comments on commit ca8664e

Please sign in to comment.