pkgbld 1.14.6 → 1.15.1

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 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. Add `tsconfig.json` file into root project directory
27
- ```json
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 (provide: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
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 (provide: Provider): Promise<void>;
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 (provide: Provider): Promise<void>;
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 (provide: Provider, config: ReturnType<typeof getCliOptions>, inputs: string[]): Promise<void>;
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 (provide: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
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 (provide: Provider): Promise<void>;
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 (provide: Provider, config: ReturnType<typeof getCliOptions>): Promise<void>;
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 (provide: Provider): Promise<void>;
1
+ import { Provider } from '../types';
2
+ export default function (provider: Provider): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { Logger } from '@niceties/logger';
2
+ import { getCliOptions } from './get-cli-options';
3
+ export declare function checkTsConfig(options: ReturnType<typeof getCliOptions>, mainLogger: Logger): 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>;
@@ -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(preimporMap: Map<string, Promise<never>>): 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]>;
@@ -1,11 +1,4 @@
1
- import { Plugin, InternalModuleFormat } from 'rollup';
2
- import { Priotiry, Provider } from './types';
3
- import externals from './builtin-plugins/externals';
4
- export declare const plugins: (typeof externals)[];
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(preimporMap: Map<string, Promise<never>>): [Provider, PkgbldRollupPlugin[]];
@@ -1,56 +1,57 @@
1
- import type { getCliOptions } from './get-cli-options';
2
- import type { getHelpers } from './helpers';
3
- export declare function getRollupConfigs(inputs: string[], config: ReturnType<typeof getCliOptions>, helpers: ReturnType<typeof getHelpers>): Promise<{
4
- input: string[];
5
- output: {
6
- amd?: import("rollup").AmdOptions | undefined;
7
- assetFileNames?: string | ((chunkInfo: import("rollup").PreRenderedAsset) => string) | undefined;
8
- banner?: string | import("rollup").AddonFunction | undefined;
9
- chunkFileNames?: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string) | undefined;
10
- compact?: boolean | undefined;
11
- dir: string;
12
- dynamicImportFunction?: string | undefined;
13
- dynamicImportInCjs?: boolean | undefined;
14
- entryFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
15
- esModule?: boolean | "if-default-prop" | undefined;
16
- experimentalDeepDynamicChunkOptimization?: boolean | undefined;
17
- experimentalMinChunkSize?: number | undefined;
18
- exports?: "default" | "named" | "none" | "auto" | undefined;
19
- extend?: boolean | undefined;
20
- externalImportAssertions?: boolean | undefined;
21
- externalLiveBindings?: boolean | undefined;
22
- file?: string | undefined;
23
- footer?: string | import("rollup").AddonFunction | undefined;
24
- format: "amd" | "cjs" | "es" | "iife" | "system" | "umd" | "commonjs" | "esm" | "module" | "systemjs";
25
- freeze?: boolean | undefined;
26
- generatedCode?: import("rollup").GeneratedCodePreset | import("rollup").GeneratedCodeOptions | undefined;
27
- globals?: import("rollup").GlobalsOption | undefined;
28
- hoistTransitiveImports?: boolean | undefined;
29
- indent?: string | boolean | undefined;
30
- inlineDynamicImports?: boolean | undefined;
31
- interop?: import("rollup").InteropType | import("rollup").GetInterop | undefined;
32
- intro?: string | import("rollup").AddonFunction | undefined;
33
- manualChunks?: import("rollup").ManualChunksOption | undefined;
34
- minifyInternalExports?: boolean | undefined;
35
- name?: string | undefined;
36
- namespaceToStringTag?: boolean | undefined;
37
- noConflict?: boolean | undefined;
38
- outro?: string | import("rollup").AddonFunction | undefined;
39
- paths?: import("rollup").OptionsPaths | undefined;
40
- plugins: false | import("rollup").OutputPlugin | import("rollup").OutputPluginOption[] | Promise<false | import("rollup").OutputPlugin | import("rollup").NullValue | import("rollup").OutputPluginOption[]> | null;
41
- preferConst?: boolean | undefined;
42
- preserveModules?: boolean | undefined;
43
- preserveModulesRoot?: string | undefined;
44
- sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
45
- sourcemap: boolean | "inline" | "hidden";
46
- sourcemapBaseUrl?: string | undefined;
47
- sourcemapExcludeSources?: boolean | undefined;
48
- sourcemapFile?: string | undefined;
49
- sourcemapIgnoreList?: import("rollup").SourcemapIgnoreListOption | undefined;
50
- sourcemapPathTransform?: import("rollup").SourcemapPathTransformOption | undefined;
51
- strict?: boolean | undefined;
52
- systemNullSetters?: boolean | undefined;
53
- validate?: boolean | undefined;
54
- }[];
55
- plugins: import("rollup").Plugin[];
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(name: 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 function getDefaultExport<T extends {
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';