@junobuild/cli-tools 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/index.mjs +21 -19
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/commands/build.d.ts +32 -6
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Message, Metafile } from 'esbuild';
|
|
1
|
+
import type { Message, Metafile, OutputFile } from 'esbuild';
|
|
2
2
|
/**
|
|
3
|
-
* Builds
|
|
3
|
+
* Builds the serverless functions using `esbuild`.
|
|
4
4
|
*
|
|
5
|
-
* This
|
|
5
|
+
* This feature:
|
|
6
6
|
* - Ensures `esbuild` is available.
|
|
7
7
|
* - Deletes the existing output file if it exists.
|
|
8
8
|
* - Builds the input file with optimizations: minification, tree-shaking, etc.
|
|
@@ -22,15 +22,41 @@ import type { Message, Metafile } from 'esbuild';
|
|
|
22
22
|
*
|
|
23
23
|
* @throws Will exit the process if `esbuild` is not installed.
|
|
24
24
|
*/
|
|
25
|
-
export declare const
|
|
25
|
+
export declare const buildFunctions: ({ infile, outfile, banner }: {
|
|
26
26
|
infile: string;
|
|
27
27
|
outfile: string;
|
|
28
28
|
banner?: {
|
|
29
29
|
[type: string]: string;
|
|
30
30
|
};
|
|
31
|
-
}) => Promise<
|
|
31
|
+
}) => Promise<Omit<EsbuildResult, "outputFiles">>;
|
|
32
|
+
/**
|
|
33
|
+
* Builds a script using `esbuild` for `juno run`.
|
|
34
|
+
*
|
|
35
|
+
* This feature:
|
|
36
|
+
* - Ensures `esbuild` is available.
|
|
37
|
+
* - Builds the input file for Node with optimizations: minification, tree-shaking, etc.
|
|
38
|
+
* - Returns the esbuild output files, `metafile`, version, and any build errors or warnings.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} options - Build configuration.
|
|
41
|
+
* @param {string} options.infile - The path to the input file to be bundled.
|
|
42
|
+
*
|
|
43
|
+
* @returns {Promise<{
|
|
44
|
+
* metafile: Metafile,
|
|
45
|
+
* errors: Message[],
|
|
46
|
+
* warnings: Message[],
|
|
47
|
+
* version: string,
|
|
48
|
+
* outputFiles: OutputFile[] | undefined;
|
|
49
|
+
* }>} An object containing the esbuild outputFiles, metafile, build errors/warnings, and the version of esbuild used.
|
|
50
|
+
*
|
|
51
|
+
* @throws Will exit the process if `esbuild` is not installed.
|
|
52
|
+
*/
|
|
53
|
+
export declare const buildScript: ({ infile }: {
|
|
54
|
+
infile: string;
|
|
55
|
+
}) => Promise<EsbuildResult>;
|
|
56
|
+
export interface EsbuildResult {
|
|
32
57
|
metafile: Metafile;
|
|
33
58
|
errors: Message[];
|
|
34
59
|
warnings: Message[];
|
|
35
60
|
version: string;
|
|
36
|
-
|
|
61
|
+
outputFiles: OutputFile[] | undefined;
|
|
62
|
+
}
|