pkgbld 1.14.5 → 1.15.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 +27 -14
- package/dist/builtin-plugins/binify.d.ts +3 -3
- package/dist/builtin-plugins/clean.d.ts +2 -2
- package/dist/builtin-plugins/commonjs.d.ts +2 -2
- package/dist/builtin-plugins/externals.d.ts +3 -3
- package/dist/builtin-plugins/preprocess.d.ts +3 -3
- package/dist/builtin-plugins/resolve.d.ts +2 -2
- package/dist/builtin-plugins/terser.d.ts +3 -3
- package/dist/builtin-plugins/typescript.d.ts +2 -2
- package/dist/check-ts-config.d.ts +3 -0
- package/dist/create-subpackages.d.ts +2 -2
- package/dist/eject.d.ts +6 -0
- package/dist/get-cli-options.d.ts +15 -12
- package/dist/get-pkg.d.ts +2 -2
- package/dist/get-plugins.d.ts +4 -11
- package/dist/get-rollup-configs.d.ts +57 -56
- package/dist/helpers.d.ts +10 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +642 -490
- package/dist/messages.d.ts +1 -1
- package/dist/process-pkg.d.ts +3 -3
- package/dist/types.d.ts +43 -24
- package/dist/write-json.d.ts +2 -0
- package/package.json +22 -19
- package/dist/write-pkg.d.ts +0 -2
package/README.md
CHANGED
|
@@ -23,20 +23,9 @@ npm install --save-dev pkgbld
|
|
|
23
23
|
|
|
24
24
|
1. Start from creating pcakage.json using `npm init`
|
|
25
25
|
2. Add pkgbld `npm install --save-dev pkgbld`
|
|
26
|
-
3.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"compilerOptions": {
|
|
30
|
-
"target": "esnext",
|
|
31
|
-
"module": "esnext",
|
|
32
|
-
"esModuleInterop": true,
|
|
33
|
-
"strict": true,
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
4. Create `src/index.ts`
|
|
39
|
-
5. Add pkgbld in scripts field of your package.json like:
|
|
26
|
+
3. Create `src/index.ts`
|
|
27
|
+
4. Add pkgbld in scripts field of your package.json like:
|
|
28
|
+
|
|
40
29
|
```json
|
|
41
30
|
"scripts": {
|
|
42
31
|
"build": "pkgbld"
|
|
@@ -127,6 +116,30 @@ pkgbld --include-externals
|
|
|
127
116
|
|
|
128
117
|
Bundles all externals into package.
|
|
129
118
|
|
|
119
|
+
### eject
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
pkgbld --eject
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Ejects Rollup config.
|
|
126
|
+
|
|
127
|
+
### no-ts-config
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
pkgbld --no-ts-config
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Do not check / write tsconfig.json.
|
|
134
|
+
|
|
135
|
+
### no-update-package-json
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
pkgbld --no-update-package-json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Do not write package.json.
|
|
142
|
+
|
|
130
143
|
# License
|
|
131
144
|
|
|
132
145
|
[MIT](https://github.com/kshutkin/package-build/blob/main/LICENSE)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getCliOptions } from '../get-cli-options';
|
|
2
|
-
import { Provider } from '../types';
|
|
3
|
-
export default function (
|
|
1
|
+
import { getCliOptions } from '../get-cli-options';
|
|
2
|
+
import { Provider } from '../types';
|
|
3
|
+
export default function (provider: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Provider } from '../types';
|
|
2
|
-
export default function (
|
|
1
|
+
import { Provider } from '../types';
|
|
2
|
+
export default function (provider: Provider): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Provider } from '../types';
|
|
2
|
-
export default function (
|
|
1
|
+
import { Provider } from '../types';
|
|
2
|
+
export default function (provider: Provider): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getCliOptions } from '../get-cli-options';
|
|
2
|
-
import { Provider } from '../types';
|
|
3
|
-
export default function (
|
|
1
|
+
import { getCliOptions } from '../get-cli-options';
|
|
2
|
+
import { Provider } from '../types';
|
|
3
|
+
export default function (provider: Provider, config: ReturnType<typeof getCliOptions>, inputs: string[]): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getCliOptions } from '../get-cli-options';
|
|
2
|
-
import { Provider } from '../types';
|
|
3
|
-
export default function (
|
|
1
|
+
import { getCliOptions } from '../get-cli-options';
|
|
2
|
+
import { Provider } from '../types';
|
|
3
|
+
export default function (provider: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Provider } from '../types';
|
|
2
|
-
export default function (
|
|
1
|
+
import { Provider } from '../types';
|
|
2
|
+
export default function (provider: Provider): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getCliOptions } from '../get-cli-options';
|
|
2
|
-
import { Provider } from '../types';
|
|
3
|
-
export default function (
|
|
1
|
+
import { getCliOptions } from '../get-cli-options';
|
|
2
|
+
import { Provider } from '../types';
|
|
3
|
+
export default function (provider: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Provider } from '../types';
|
|
2
|
-
export default function (
|
|
1
|
+
import { Provider } from '../types';
|
|
2
|
+
export default function (provider: Provider): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { getCliOptions } from './get-cli-options';
|
|
2
|
-
export declare function createSubpackages(inputs: string[], config: ReturnType<typeof getCliOptions>): Promise<void>;
|
|
1
|
+
import { getCliOptions } from './get-cli-options';
|
|
2
|
+
export declare function createSubpackages(inputs: string[], config: ReturnType<typeof getCliOptions>): Promise<void>;
|
package/dist/eject.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PackageJson, PkgbldRollupPlugin, Provider } from './types';
|
|
2
|
+
import type { RollupOptions } from 'rollup';
|
|
3
|
+
import { getCliOptions } from './get-cli-options';
|
|
4
|
+
import { getHelpers } from './helpers';
|
|
5
|
+
export declare function createEjectProvider(): Promise<[Provider, PkgbldRollupPlugin[]]>;
|
|
6
|
+
export declare function ejectConfig(config: RollupOptions[], pkgPath: string, options: ReturnType<typeof getCliOptions>, inputs: string[], helpers: ReturnType<typeof getHelpers>, pkg: PackageJson): Promise<void>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export declare function getCliOptions(): {
|
|
2
|
-
umdInputs: string[];
|
|
3
|
-
compressFormats: string[];
|
|
4
|
-
sourcemapFormats: string[];
|
|
5
|
-
formats: string[];
|
|
6
|
-
formatsOverriden: boolean;
|
|
7
|
-
preprocess: string[];
|
|
8
|
-
dir: string;
|
|
9
|
-
sourceDir: string;
|
|
10
|
-
bin?: string[] | undefined;
|
|
11
|
-
includeExternals: boolean;
|
|
12
|
-
|
|
1
|
+
export declare function getCliOptions(): {
|
|
2
|
+
umdInputs: string[];
|
|
3
|
+
compressFormats: string[];
|
|
4
|
+
sourcemapFormats: string[];
|
|
5
|
+
formats: string[];
|
|
6
|
+
formatsOverriden: boolean;
|
|
7
|
+
preprocess: string[];
|
|
8
|
+
dir: string;
|
|
9
|
+
sourceDir: string;
|
|
10
|
+
bin?: string[] | undefined;
|
|
11
|
+
includeExternals: boolean;
|
|
12
|
+
eject: boolean;
|
|
13
|
+
noTsConfig: boolean;
|
|
14
|
+
noUpdatePackageJson: boolean;
|
|
15
|
+
};
|
package/dist/get-pkg.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Json } from './types';
|
|
2
|
-
export declare function getPackage(): Promise<[string, Json]>;
|
|
1
|
+
import { Json } from './types';
|
|
2
|
+
export declare function getPackage(): Promise<[string, Json]>;
|
package/dist/get-plugins.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
export declare function createProvider(): [Provider, {
|
|
6
|
-
plugin: () => Plugin;
|
|
7
|
-
priority: Priotiry;
|
|
8
|
-
format?: InternalModuleFormat | InternalModuleFormat[];
|
|
9
|
-
inputs?: string[];
|
|
10
|
-
outputPlugin?: true;
|
|
11
|
-
}[]];
|
|
1
|
+
import type { PkgbldRollupPlugin, Provider } from './types';
|
|
2
|
+
import externals from './builtin-plugins/externals';
|
|
3
|
+
export declare const plugins: (typeof externals)[];
|
|
4
|
+
export declare function createProvider(): [Provider, PkgbldRollupPlugin[]];
|
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import type { getCliOptions } from './get-cli-options';
|
|
2
|
-
import type { getHelpers } from './helpers';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import type { getCliOptions } from './get-cli-options';
|
|
2
|
+
import type { getHelpers } from './helpers';
|
|
3
|
+
import type { PkgbldRollupPlugin, Provider } from './types';
|
|
4
|
+
export declare function getRollupConfigs([provider, plugins]: [Provider, PkgbldRollupPlugin[]], inputs: string[], config: ReturnType<typeof getCliOptions>, helpers: ReturnType<typeof getHelpers>): Promise<{
|
|
5
|
+
input: string[];
|
|
6
|
+
output: {
|
|
7
|
+
amd?: import("rollup").AmdOptions | undefined;
|
|
8
|
+
assetFileNames?: string | ((chunkInfo: import("rollup").PreRenderedAsset) => string) | undefined;
|
|
9
|
+
banner?: string | import("rollup").AddonFunction | undefined;
|
|
10
|
+
chunkFileNames?: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string) | undefined;
|
|
11
|
+
compact?: boolean | undefined;
|
|
12
|
+
dir: string;
|
|
13
|
+
dynamicImportFunction?: string | undefined;
|
|
14
|
+
dynamicImportInCjs?: boolean | undefined;
|
|
15
|
+
entryFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
|
|
16
|
+
esModule?: boolean | "if-default-prop" | undefined;
|
|
17
|
+
experimentalDeepDynamicChunkOptimization?: boolean | undefined;
|
|
18
|
+
experimentalMinChunkSize?: number | undefined;
|
|
19
|
+
exports?: "default" | "named" | "none" | "auto" | undefined;
|
|
20
|
+
extend?: boolean | undefined;
|
|
21
|
+
externalImportAssertions?: boolean | undefined;
|
|
22
|
+
externalLiveBindings?: boolean | undefined;
|
|
23
|
+
file?: string | undefined;
|
|
24
|
+
footer?: string | import("rollup").AddonFunction | undefined;
|
|
25
|
+
format: "amd" | "cjs" | "es" | "iife" | "system" | "umd" | "commonjs" | "esm" | "module" | "systemjs";
|
|
26
|
+
freeze?: boolean | undefined;
|
|
27
|
+
generatedCode?: import("rollup").GeneratedCodePreset | import("rollup").GeneratedCodeOptions | undefined;
|
|
28
|
+
globals?: import("rollup").GlobalsOption | undefined;
|
|
29
|
+
hoistTransitiveImports?: boolean | undefined;
|
|
30
|
+
indent?: string | boolean | undefined;
|
|
31
|
+
inlineDynamicImports?: boolean | undefined;
|
|
32
|
+
interop?: import("rollup").InteropType | import("rollup").GetInterop | undefined;
|
|
33
|
+
intro?: string | import("rollup").AddonFunction | undefined;
|
|
34
|
+
manualChunks?: import("rollup").ManualChunksOption | undefined;
|
|
35
|
+
minifyInternalExports?: boolean | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
namespaceToStringTag?: boolean | undefined;
|
|
38
|
+
noConflict?: boolean | undefined;
|
|
39
|
+
outro?: string | import("rollup").AddonFunction | undefined;
|
|
40
|
+
paths?: import("rollup").OptionsPaths | undefined;
|
|
41
|
+
plugins: false | import("rollup").OutputPlugin | import("rollup").OutputPluginOption[] | Promise<false | import("rollup").OutputPlugin | import("rollup").NullValue | import("rollup").OutputPluginOption[]> | null;
|
|
42
|
+
preferConst?: boolean | undefined;
|
|
43
|
+
preserveModules?: boolean | undefined;
|
|
44
|
+
preserveModulesRoot?: string | undefined;
|
|
45
|
+
sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
|
|
46
|
+
sourcemap: boolean | "inline" | "hidden";
|
|
47
|
+
sourcemapBaseUrl?: string | undefined;
|
|
48
|
+
sourcemapExcludeSources?: boolean | undefined;
|
|
49
|
+
sourcemapFile?: string | undefined;
|
|
50
|
+
sourcemapIgnoreList?: boolean | import("rollup").SourcemapIgnoreListOption | undefined;
|
|
51
|
+
sourcemapPathTransform?: import("rollup").SourcemapPathTransformOption | undefined;
|
|
52
|
+
strict?: boolean | undefined;
|
|
53
|
+
systemNullSetters?: boolean | undefined;
|
|
54
|
+
validate?: boolean | undefined;
|
|
55
|
+
}[];
|
|
56
|
+
plugins: import("rollup").Plugin[];
|
|
57
|
+
}[]>;
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { OutputOptions } from 'rollup';
|
|
2
|
-
export declare function getHelpers(
|
|
3
|
-
getGlobalName: (anInput: string) => string;
|
|
4
|
-
getExternalGlobalName: (id: string) => string;
|
|
5
|
-
};
|
|
6
|
-
export declare function toArray<T>(object: T | T[] | undefined): T[];
|
|
7
|
-
export declare function formatInput(input: string[] | string): string;
|
|
8
|
-
export declare function formatOutput(output: OutputOptions | OutputOptions[] | undefined, field: 'dir' | 'format'): string;
|
|
9
|
-
export declare function getTimeDiff(starting: number): string;
|
|
10
|
-
export declare
|
|
11
|
-
default?: unknown;
|
|
12
|
-
}>(importedModule: T): {};
|
|
13
|
-
export declare const areSetsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
|
|
1
|
+
import { OutputOptions } from 'rollup';
|
|
2
|
+
export declare function getHelpers(pkgName: string): {
|
|
3
|
+
getGlobalName: (anInput: string) => string;
|
|
4
|
+
getExternalGlobalName: (id: string) => string;
|
|
5
|
+
};
|
|
6
|
+
export declare function toArray<T>(object: T | T[] | undefined): T[];
|
|
7
|
+
export declare function formatInput(input: string[] | string): string;
|
|
8
|
+
export declare function formatOutput(output: OutputOptions | OutputOptions[] | undefined, field: 'dir' | 'format'): string;
|
|
9
|
+
export declare function getTimeDiff(starting: number): string;
|
|
10
|
+
export declare const areSetsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@niceties/draftlog-appender';
|
|
1
|
+
import '@niceties/draftlog-appender';
|