@storm-software/unbuild 0.35.1 → 0.36.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/README.md +1 -1
- package/bin/unbuild.cjs +55 -25
- package/bin/unbuild.js +55 -25
- package/dist/build.cjs +7 -7
- package/dist/build.d.cts +2 -0
- package/dist/build.d.ts +2 -0
- package/dist/build.js +6 -6
- package/dist/{chunk-3HGUCQU6.cjs → chunk-5XTLMOFH.cjs} +3 -3
- package/dist/{chunk-5FQVMM7I.cjs → chunk-A45F3XCO.cjs} +26 -15
- package/dist/{chunk-PLJQK2VX.js → chunk-A7ULBMR4.js} +26 -15
- package/dist/{chunk-Y7PS2HJA.cjs → chunk-AI7YECRT.cjs} +3 -3
- package/dist/{chunk-ZPWH22ZM.cjs → chunk-BZELKGMN.cjs} +2 -2
- package/dist/{chunk-2E6P5U5P.js → chunk-FLMNRVR2.js} +1 -1
- package/dist/{chunk-3M7GEZDL.js → chunk-FRURXT64.js} +1 -1
- package/dist/{chunk-TG57GPRS.js → chunk-JONED24L.js} +34 -15
- package/dist/{chunk-N5KR37LU.cjs → chunk-MXG2QBLK.cjs} +2 -2
- package/dist/{chunk-6BNX524O.cjs → chunk-PX6F2F5P.cjs} +122 -103
- package/dist/{chunk-RFEZKCMQ.js → chunk-R6HJQ5XB.js} +1 -1
- package/dist/{chunk-L3WYWYD4.js → chunk-XRMMVXZP.js} +1 -1
- package/dist/clean.cjs +3 -3
- package/dist/clean.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -6
- package/dist/plugins/analyze.cjs +3 -3
- package/dist/plugins/analyze.d.cts +2 -0
- package/dist/plugins/analyze.d.ts +2 -0
- package/dist/plugins/analyze.js +2 -2
- package/dist/plugins/on-error.cjs +3 -3
- package/dist/plugins/on-error.d.cts +2 -0
- package/dist/plugins/on-error.d.ts +2 -0
- package/dist/plugins/on-error.js +2 -2
- package/dist/plugins/swc.d.cts +2 -0
- package/dist/plugins/swc.d.ts +2 -0
- package/dist/plugins/tsc.cjs +3 -3
- package/dist/plugins/tsc.d.cts +2 -0
- package/dist/plugins/tsc.d.ts +2 -0
- package/dist/plugins/tsc.js +2 -2
- package/dist/plugins/type-definitions.d.cts +2 -0
- package/dist/plugins/type-definitions.d.ts +2 -0
- package/dist/types.d.cts +47 -2
- package/dist/types.d.ts +47 -2
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.cjs';
|
|
2
2
|
export { clean, cleanDirectories } from './clean.cjs';
|
|
3
|
-
export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
|
|
3
|
+
export { DeepPartial, LoadFile, Loader, LoaderContext, LoaderInputFile, LoaderOptions, LoaderOutputFile, LoaderResult, Loaders, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.cjs';
|
|
4
4
|
import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
|
5
5
|
import { StormConfig } from '@storm-software/config';
|
|
6
6
|
import ts from 'typescript';
|
|
7
7
|
import { RollupBuildOptions } from 'unbuild';
|
|
8
8
|
import '@storm-software/config/types';
|
|
9
9
|
import '@storm-software/build-tools';
|
|
10
|
+
import 'esbuild';
|
|
11
|
+
import 'mkdist';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Load a rolldown configuration file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { build, cleanOutputPath, copyBuildAssets, executeUnbuild, generatePackageJson, resolveOptions } from './build.js';
|
|
2
2
|
export { clean, cleanDirectories } from './clean.js';
|
|
3
|
-
export { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.js';
|
|
3
|
+
export { DeepPartial, LoadFile, Loader, LoaderContext, LoaderInputFile, LoaderOptions, LoaderOutputFile, LoaderResult, Loaders, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions } from './types.js';
|
|
4
4
|
import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
|
5
5
|
import { StormConfig } from '@storm-software/config';
|
|
6
6
|
import ts from 'typescript';
|
|
7
7
|
import { RollupBuildOptions } from 'unbuild';
|
|
8
8
|
import '@storm-software/config/types';
|
|
9
9
|
import '@storm-software/build-tools';
|
|
10
|
+
import 'esbuild';
|
|
11
|
+
import 'mkdist';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Load a rolldown configuration file
|
package/dist/index.js
CHANGED
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
executeUnbuild,
|
|
6
6
|
generatePackageJson,
|
|
7
7
|
resolveOptions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JONED24L.js";
|
|
9
9
|
import "./chunk-RBYYB7X2.js";
|
|
10
10
|
import {
|
|
11
11
|
clean,
|
|
12
12
|
cleanDirectories
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FLMNRVR2.js";
|
|
14
14
|
import "./chunk-OULCUN6I.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-XRMMVXZP.js";
|
|
16
|
+
import "./chunk-R6HJQ5XB.js";
|
|
17
17
|
import {
|
|
18
18
|
createTsCompilerOptions,
|
|
19
19
|
loadConfig
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-FRURXT64.js";
|
|
21
|
+
import "./chunk-A7ULBMR4.js";
|
|
22
22
|
import "./chunk-3GQAWCBQ.js";
|
|
23
23
|
export {
|
|
24
24
|
build,
|
package/dist/plugins/analyze.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkMXG2QBLKcjs = require('../chunk-MXG2QBLK.cjs');
|
|
4
|
+
require('../chunk-A45F3XCO.cjs');
|
|
5
5
|
require('../chunk-BGYQAVKQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.analyzePlugin =
|
|
8
|
+
exports.analyzePlugin = _chunkMXG2QBLKcjs.analyzePlugin;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Plugin } from 'rollup';
|
|
2
2
|
import { UnbuildResolvedOptions } from '../types.cjs';
|
|
3
3
|
import '@storm-software/build-tools';
|
|
4
|
+
import 'esbuild';
|
|
5
|
+
import 'mkdist';
|
|
4
6
|
import 'unbuild';
|
|
5
7
|
|
|
6
8
|
declare const analyzePlugin: (options: UnbuildResolvedOptions) => Plugin;
|
package/dist/plugins/analyze.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkAI7YECRTcjs = require('../chunk-AI7YECRT.cjs');
|
|
4
|
+
require('../chunk-A45F3XCO.cjs');
|
|
5
5
|
require('../chunk-BGYQAVKQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.onErrorPlugin =
|
|
8
|
+
exports.onErrorPlugin = _chunkAI7YECRTcjs.onErrorPlugin;
|
package/dist/plugins/on-error.js
CHANGED
package/dist/plugins/swc.d.cts
CHANGED
package/dist/plugins/swc.d.ts
CHANGED
package/dist/plugins/tsc.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkBZELKGMNcjs = require('../chunk-BZELKGMN.cjs');
|
|
4
|
+
require('../chunk-A45F3XCO.cjs');
|
|
5
5
|
require('../chunk-BGYQAVKQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.tscPlugin =
|
|
8
|
+
exports.tscPlugin = _chunkBZELKGMNcjs.tscPlugin;
|
package/dist/plugins/tsc.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Plugin } from 'rollup';
|
|
2
2
|
import { UnbuildResolvedOptions } from '../types.cjs';
|
|
3
3
|
import '@storm-software/build-tools';
|
|
4
|
+
import 'esbuild';
|
|
5
|
+
import 'mkdist';
|
|
4
6
|
import 'unbuild';
|
|
5
7
|
|
|
6
8
|
declare const tscPlugin: (options: UnbuildResolvedOptions) => Promise<Plugin<any>>;
|
package/dist/plugins/tsc.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Plugin } from 'rollup';
|
|
2
2
|
import { UnbuildResolvedOptions } from '../types.js';
|
|
3
3
|
import '@storm-software/build-tools';
|
|
4
|
+
import 'esbuild';
|
|
5
|
+
import 'mkdist';
|
|
4
6
|
import 'unbuild';
|
|
5
7
|
|
|
6
8
|
declare const tscPlugin: (options: UnbuildResolvedOptions) => Promise<Plugin<any>>;
|
package/dist/plugins/tsc.js
CHANGED
package/dist/types.d.cts
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
import { TypeScriptBuildOptions, TypeScriptBuildResolvedOptions, AdditionalCLIOptions } from '@storm-software/build-tools';
|
|
2
|
-
import {
|
|
2
|
+
import { CommonOptions } from 'esbuild';
|
|
3
|
+
import { MkdistOptions } from 'mkdist';
|
|
4
|
+
import { BuildOptions, RollupBuildOptions, BuildContext, MkdistBuildEntry, BuildConfig } from 'unbuild';
|
|
3
5
|
|
|
4
6
|
type DeepPartial<T> = T extends object ? {
|
|
5
7
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
6
8
|
} : T;
|
|
9
|
+
interface LoaderInputFile {
|
|
10
|
+
path: string;
|
|
11
|
+
extension: string;
|
|
12
|
+
srcPath?: string;
|
|
13
|
+
getContents: () => Promise<string> | string;
|
|
14
|
+
}
|
|
15
|
+
interface LoaderOutputFile {
|
|
16
|
+
/**
|
|
17
|
+
* relative to distDir
|
|
18
|
+
*/
|
|
19
|
+
path: string;
|
|
20
|
+
srcPath?: string;
|
|
21
|
+
extension?: string;
|
|
22
|
+
contents?: string;
|
|
23
|
+
declaration?: boolean;
|
|
24
|
+
errors?: Error[];
|
|
25
|
+
raw?: boolean;
|
|
26
|
+
skip?: boolean;
|
|
27
|
+
}
|
|
28
|
+
type LoaderResult = LoaderOutputFile[] | undefined;
|
|
29
|
+
type LoadFile = (input: LoaderInputFile) => LoaderResult | Promise<LoaderResult>;
|
|
30
|
+
interface LoaderOptions {
|
|
31
|
+
ext?: "js" | "mjs" | "cjs" | "ts" | "mts" | "cts";
|
|
32
|
+
format?: "cjs" | "esm";
|
|
33
|
+
declaration?: boolean;
|
|
34
|
+
esbuild?: CommonOptions;
|
|
35
|
+
postcss?: false | Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
interface LoaderContext {
|
|
38
|
+
loadFile: LoadFile;
|
|
39
|
+
options: LoaderOptions;
|
|
40
|
+
}
|
|
41
|
+
type Loader = (input: LoaderInputFile, context: LoaderContext) => LoaderResult | Promise<LoaderResult>;
|
|
42
|
+
type Loaders = ("js" | "vue" | "sass" | "postcss" | Loader)[];
|
|
7
43
|
type UnbuildOptions = Omit<Partial<BuildOptions>, "entries" | "rootDir" | "externals" | "rollupConfig" | "outDir" | "declaration" | "format" | "parallel"> & Omit<TypeScriptBuildOptions, "entry" | "format"> & {
|
|
8
44
|
/**
|
|
9
45
|
* The directories to run the build process out of
|
|
@@ -19,7 +55,16 @@ type UnbuildOptions = Omit<Partial<BuildOptions>, "entries" | "rootDir" | "exter
|
|
|
19
55
|
* Path to a unbuild configuration file relative to the project root
|
|
20
56
|
*/
|
|
21
57
|
configPath?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Should the build process emit declaration files
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue `true`
|
|
62
|
+
*/
|
|
22
63
|
emitTypes?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Override the loader options used in the build process
|
|
66
|
+
*/
|
|
67
|
+
loaders?: Loaders | ((ctx: BuildContext, entry: MkdistBuildEntry, opts: MkdistOptions) => Loaders | Promise<Loaders>);
|
|
23
68
|
};
|
|
24
69
|
type UnbuildResolvedOptions = Omit<TypeScriptBuildResolvedOptions, "entryPoints" | "external" | "emitTypes"> & BuildConfig & {
|
|
25
70
|
/**
|
|
@@ -33,4 +78,4 @@ type UnbuildResolvedOptions = Omit<TypeScriptBuildResolvedOptions, "entryPoints"
|
|
|
33
78
|
};
|
|
34
79
|
type UnbuildCLIOptions = AdditionalCLIOptions & Pick<UnbuildOptions, "name" | "outputPath" | "platform" | "bundle" | "target" | "watch" | "clean" | "debug" | "banner" | "footer" | "splitting" | "treeShaking" | "generatePackageJson" | "metafile" | "minify" | "includeSrc" | "verbose" | "emitTypes">;
|
|
35
80
|
|
|
36
|
-
export type { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions };
|
|
81
|
+
export type { DeepPartial, LoadFile, Loader, LoaderContext, LoaderInputFile, LoaderOptions, LoaderOutputFile, LoaderResult, Loaders, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
import { TypeScriptBuildOptions, TypeScriptBuildResolvedOptions, AdditionalCLIOptions } from '@storm-software/build-tools';
|
|
2
|
-
import {
|
|
2
|
+
import { CommonOptions } from 'esbuild';
|
|
3
|
+
import { MkdistOptions } from 'mkdist';
|
|
4
|
+
import { BuildOptions, RollupBuildOptions, BuildContext, MkdistBuildEntry, BuildConfig } from 'unbuild';
|
|
3
5
|
|
|
4
6
|
type DeepPartial<T> = T extends object ? {
|
|
5
7
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
6
8
|
} : T;
|
|
9
|
+
interface LoaderInputFile {
|
|
10
|
+
path: string;
|
|
11
|
+
extension: string;
|
|
12
|
+
srcPath?: string;
|
|
13
|
+
getContents: () => Promise<string> | string;
|
|
14
|
+
}
|
|
15
|
+
interface LoaderOutputFile {
|
|
16
|
+
/**
|
|
17
|
+
* relative to distDir
|
|
18
|
+
*/
|
|
19
|
+
path: string;
|
|
20
|
+
srcPath?: string;
|
|
21
|
+
extension?: string;
|
|
22
|
+
contents?: string;
|
|
23
|
+
declaration?: boolean;
|
|
24
|
+
errors?: Error[];
|
|
25
|
+
raw?: boolean;
|
|
26
|
+
skip?: boolean;
|
|
27
|
+
}
|
|
28
|
+
type LoaderResult = LoaderOutputFile[] | undefined;
|
|
29
|
+
type LoadFile = (input: LoaderInputFile) => LoaderResult | Promise<LoaderResult>;
|
|
30
|
+
interface LoaderOptions {
|
|
31
|
+
ext?: "js" | "mjs" | "cjs" | "ts" | "mts" | "cts";
|
|
32
|
+
format?: "cjs" | "esm";
|
|
33
|
+
declaration?: boolean;
|
|
34
|
+
esbuild?: CommonOptions;
|
|
35
|
+
postcss?: false | Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
interface LoaderContext {
|
|
38
|
+
loadFile: LoadFile;
|
|
39
|
+
options: LoaderOptions;
|
|
40
|
+
}
|
|
41
|
+
type Loader = (input: LoaderInputFile, context: LoaderContext) => LoaderResult | Promise<LoaderResult>;
|
|
42
|
+
type Loaders = ("js" | "vue" | "sass" | "postcss" | Loader)[];
|
|
7
43
|
type UnbuildOptions = Omit<Partial<BuildOptions>, "entries" | "rootDir" | "externals" | "rollupConfig" | "outDir" | "declaration" | "format" | "parallel"> & Omit<TypeScriptBuildOptions, "entry" | "format"> & {
|
|
8
44
|
/**
|
|
9
45
|
* The directories to run the build process out of
|
|
@@ -19,7 +55,16 @@ type UnbuildOptions = Omit<Partial<BuildOptions>, "entries" | "rootDir" | "exter
|
|
|
19
55
|
* Path to a unbuild configuration file relative to the project root
|
|
20
56
|
*/
|
|
21
57
|
configPath?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Should the build process emit declaration files
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue `true`
|
|
62
|
+
*/
|
|
22
63
|
emitTypes?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Override the loader options used in the build process
|
|
66
|
+
*/
|
|
67
|
+
loaders?: Loaders | ((ctx: BuildContext, entry: MkdistBuildEntry, opts: MkdistOptions) => Loaders | Promise<Loaders>);
|
|
23
68
|
};
|
|
24
69
|
type UnbuildResolvedOptions = Omit<TypeScriptBuildResolvedOptions, "entryPoints" | "external" | "emitTypes"> & BuildConfig & {
|
|
25
70
|
/**
|
|
@@ -33,4 +78,4 @@ type UnbuildResolvedOptions = Omit<TypeScriptBuildResolvedOptions, "entryPoints"
|
|
|
33
78
|
};
|
|
34
79
|
type UnbuildCLIOptions = AdditionalCLIOptions & Pick<UnbuildOptions, "name" | "outputPath" | "platform" | "bundle" | "target" | "watch" | "clean" | "debug" | "banner" | "footer" | "splitting" | "treeShaking" | "generatePackageJson" | "metafile" | "minify" | "includeSrc" | "verbose" | "emitTypes">;
|
|
35
80
|
|
|
36
|
-
export type { DeepPartial, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions };
|
|
81
|
+
export type { DeepPartial, LoadFile, Loader, LoaderContext, LoaderInputFile, LoaderOptions, LoaderOutputFile, LoaderResult, Loaders, UnbuildCLIOptions, UnbuildOptions, UnbuildResolvedOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/unbuild",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing `unbuild` utilities for building Storm Software libraries and applications",
|
|
6
6
|
"repository": {
|
|
@@ -162,8 +162,10 @@
|
|
|
162
162
|
"@swc/core": "1.7.26",
|
|
163
163
|
"commander": "^12.1.0",
|
|
164
164
|
"defu": "6.1.4",
|
|
165
|
+
"esbuild": "^0.24.0",
|
|
165
166
|
"glob": "^11.0.1",
|
|
166
167
|
"jiti": "^2.4.2",
|
|
168
|
+
"mkdist": "^2.2.0",
|
|
167
169
|
"rollup": "^4.29.1",
|
|
168
170
|
"rollup-plugin-typescript2": "0.36.0",
|
|
169
171
|
"unbuild": "^3.2.0"
|