pkgbld 1.28.0 → 1.28.2

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/index.js CHANGED
@@ -326,7 +326,7 @@ async function externals (provider, config, inputs, inputsExt) {
326
326
  const curry = (await provider.import('lodash/curry.js'));
327
327
  for (const currentInput of config.umdInputs) {
328
328
  const isExternal = curry((currentInput, id, external, importer) => includeExternals(importer, external, id, config) || isExternalInput(currentInput, inputs, inputsExt, id, config))(currentInput);
329
- provider.provide(() => pluginExternals(isExternal), 2000 /* Priority.externals */, { format: 'umd', inputs: [`./${config.sourceDir}/${currentInput}.${inputsExt.get('currentInput')}`] });
329
+ provider.provide(() => pluginExternals(isExternal), 2000 /* Priority.externals */, { format: 'umd', inputs: [`./${config.sourceDir}/${currentInput}.${inputsExt.get(currentInput)}`] });
330
330
  }
331
331
  // for eject config
332
332
  if (config.formats.length === 0) {
@@ -825,7 +825,7 @@ async function processPackage(pkg, config, plugins) {
825
825
  const file = sourceFileWithoutSuffix + suffix;
826
826
  if (await isExists(file)) {
827
827
  inputs.push(file);
828
- inputsExt.set(file, suffix);
828
+ inputsExt.set(basename, suffix);
829
829
  break;
830
830
  }
831
831
  }
@@ -870,7 +870,7 @@ async function writeJson(path, json) {
870
870
  await fs.writeFile(path, toFormattedJson(json));
871
871
  }
872
872
 
873
- var version = "1.28.0";
873
+ var version = "1.28.2";
874
874
  var name = "pkgbld";
875
875
  var license = "MIT";
876
876
  var author = "Konstantin Shutkin";
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.0",
2
+ "version": "1.28.2",
3
3
  "name": "pkgbld",
4
4
  "license": "MIT",
5
5
  "author": "Konstantin Shutkin",
@@ -1,2 +0,0 @@
1
- import { CliOptions, Provider } from '../types';
2
- export default function (provider: Provider, config: CliOptions): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { Provider } from '../types';
2
- export default function (provider: Provider): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { Provider } from '../types';
2
- export default function (provider: Provider): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CliOptions, Provider } from '../types';
2
- export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CliOptions, Provider } from '../types';
2
- export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { Provider } from '../types';
2
- export default function (provider: Provider): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CliOptions, Provider } from '../types';
2
- export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CliOptions, Provider } from '../types';
2
- export default function (provider: Provider, config: CliOptions, inputs: string[]): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CliOptions } from './types';
2
- export declare function createSubpackages(inputs: string[], config: CliOptions): Promise<void>;
@@ -1,6 +0,0 @@
1
- import type { CliOptions, PkgbldRollupPlugin, Provider } from './types';
2
- import type { PackageJson } from 'options';
3
- import type { RollupOptions } from 'rollup';
4
- import { getHelpers } from './helpers';
5
- export declare function createEjectProvider(preimportMap: Map<string, Promise<never>>): Promise<[Provider, PkgbldRollupPlugin[]]>;
6
- export declare function ejectConfig(config: RollupOptions[], pkgPath: string, options: CliOptions, inputs: string[], inputsExt: Map<string, string>, helpers: ReturnType<typeof getHelpers>, pkg: PackageJson): Promise<void>;
@@ -1,27 +0,0 @@
1
- import { PkgbldPlugin } from './types';
2
- import { PackageJson } from 'options';
3
- export declare function getCliOptions(plugins: Partial<PkgbldPlugin>[], pkg: PackageJson): {
4
- kind: 'build';
5
- umdInputs: string[];
6
- compressFormats: string[];
7
- sourcemapFormats: string[];
8
- formats: string[];
9
- formatsOverridden: boolean;
10
- preprocess: string[];
11
- dir: string;
12
- sourceDir: string;
13
- bin?: string[] | undefined;
14
- includeExternals: boolean | string[];
15
- eject: boolean;
16
- noTsConfig: boolean;
17
- noUpdatePackageJson: boolean;
18
- commonjsPattern: string;
19
- esPattern: string;
20
- umdPattern: string;
21
- formatPackageJson: boolean;
22
- noPack: boolean;
23
- } | {
24
- readonly kind: "prune";
25
- readonly profile: string;
26
- readonly flatten: string | boolean;
27
- };
@@ -1,2 +0,0 @@
1
- import { Json } from './types';
2
- export declare function getJson(fileName: string): Promise<[string, Json]>;
@@ -1,4 +0,0 @@
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(preimportMap: Map<string, Promise<never>>): [Provider, PkgbldRollupPlugin[]];
@@ -1,54 +0,0 @@
1
- import type { getHelpers } from './helpers';
2
- import type { CliOptions, PkgbldPlugin, PkgbldRollupPlugin, Provider } from './types';
3
- export declare function getRollupConfigs([provider, plugins]: [Provider, PkgbldRollupPlugin[]], inputs: string[], inputsExt: Map<string, string>, config: CliOptions, helpers: ReturnType<typeof getHelpers>, externalPlugins: Partial<PkgbldPlugin>[]): 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
- dynamicImportInCjs?: boolean | undefined;
13
- entryFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
14
- esModule?: boolean | "if-default-prop" | undefined;
15
- experimentalMinChunkSize?: number | undefined;
16
- exports?: "default" | "named" | "none" | "auto" | undefined;
17
- extend?: boolean | undefined;
18
- externalImportAssertions?: boolean | undefined;
19
- externalImportAttributes?: boolean | undefined;
20
- externalLiveBindings?: boolean | undefined;
21
- file?: string | undefined;
22
- footer?: string | import("rollup").AddonFunction | undefined;
23
- format: "umd" | "amd" | "cjs" | "es" | "iife" | "system" | "commonjs" | "esm" | "module" | "systemjs";
24
- freeze?: boolean | undefined;
25
- generatedCode?: import("rollup").GeneratedCodePreset | import("rollup").GeneratedCodeOptions | undefined;
26
- globals?: import("rollup").GlobalsOption | undefined;
27
- hoistTransitiveImports?: boolean | undefined;
28
- indent?: string | boolean | undefined;
29
- inlineDynamicImports?: boolean | undefined;
30
- interop?: import("rollup").InteropType | import("rollup").GetInterop | undefined;
31
- intro?: string | import("rollup").AddonFunction | undefined;
32
- manualChunks?: import("rollup").ManualChunksOption | undefined;
33
- minifyInternalExports?: boolean | undefined;
34
- name?: string | undefined;
35
- noConflict?: boolean | undefined;
36
- outro?: string | import("rollup").AddonFunction | undefined;
37
- paths?: import("rollup").OptionsPaths | undefined;
38
- plugins: false | import("rollup").OutputPlugin | import("rollup").OutputPluginOption[] | Promise<false | import("rollup").OutputPlugin | import("rollup").NullValue | import("rollup").OutputPluginOption[]> | null;
39
- preserveModules?: boolean | undefined;
40
- preserveModulesRoot?: string | undefined;
41
- sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
42
- sourcemap: boolean | "inline" | "hidden";
43
- sourcemapBaseUrl?: string | undefined;
44
- sourcemapExcludeSources?: boolean | undefined;
45
- sourcemapFile?: string | undefined;
46
- sourcemapFileNames?: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string) | undefined;
47
- sourcemapIgnoreList?: boolean | import("rollup").SourcemapIgnoreListOption | undefined;
48
- sourcemapPathTransform?: import("rollup").SourcemapPathTransformOption | undefined;
49
- strict?: boolean | undefined;
50
- systemNullSetters?: boolean | undefined;
51
- validate?: boolean | undefined;
52
- }[];
53
- plugins: import("rollup").Plugin<any>[];
54
- }[]>;
@@ -1,13 +0,0 @@
1
- import { OutputOptions } from 'rollup';
2
- import { PackageJson } from 'options';
3
- export declare function getHelpers(pkgName: string): {
4
- getGlobalName: (anInput: string) => string;
5
- getExternalGlobalName: (id: string) => string;
6
- };
7
- export declare function toArray<T>(object: T | T[] | undefined): T[];
8
- export declare function formatInput(input: string[] | string): string;
9
- export declare function formatOutput(output: OutputOptions | OutputOptions[] | undefined, field: 'dir' | 'format'): string;
10
- export declare function getTimeDiff(starting: number): string;
11
- export declare const areSetsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
12
- export declare function formatPackageJson(pkg: PackageJson): PackageJson;
13
- export declare function isExists(file: string): Promise<string | false>;
@@ -1 +0,0 @@
1
- import '@niceties/draftlog-appender';
@@ -1,3 +0,0 @@
1
- import { PackageJson } from 'options';
2
- import { PkgbldPlugin } from './types';
3
- export declare function loadPlugins(pkg: PackageJson): Promise<Partial<PkgbldPlugin>[]>;
@@ -1 +0,0 @@
1
- export declare const mainLoggerText: (sourceDir: string, dir: string, configsCount: number, startingTime: number, finishedCount?: number) => (final?: boolean) => string;
@@ -1,4 +0,0 @@
1
- import { CliOptions, Json, PkgbldPlugin } from './types';
2
- declare const sourceFileSuffixes: readonly ["ts", "tsx", "js", "jsx"];
3
- export declare function processPackage(pkg: Json, config: CliOptions, plugins: Partial<PkgbldPlugin>[]): Promise<[string[], Map<string, typeof sourceFileSuffixes[number]>]>;
4
- export {};
@@ -1,3 +0,0 @@
1
- import { Logger } from '@niceties/logger';
2
- import { CliOptions, PkgbldPlugin } from './types';
3
- export declare function checkTsConfig(options: CliOptions, mainLogger: Logger, plugins: Partial<PkgbldPlugin>[]): Promise<void>;
@@ -1,7 +0,0 @@
1
- import { Logger } from '@niceties/logger';
2
- import { PackageJson } from 'options';
3
- export declare function prunePkg(pkg: PackageJson, options: {
4
- kind: 'prune';
5
- profile: string;
6
- flatten: string | boolean;
7
- }, logger: Logger): Promise<void>;
@@ -1,47 +0,0 @@
1
- import type { Plugin, InternalModuleFormat, OutputOptions } from 'rollup';
2
- import type { getCliOptions } from './get-cli-options';
3
- import { Logger } from '@niceties/logger';
4
- import { PackageJson } from 'options';
5
- export type Json = null | string | number | boolean | Json[] | {
6
- [name: string]: Json;
7
- };
8
- export declare const enum Priority {
9
- preprocess = 1000,
10
- cleanup = 1000,
11
- externals = 2000,
12
- resolve = 3000,
13
- commonjs = 4000,
14
- transpile = 6000,
15
- compress = 10000,
16
- finalize = 20000
17
- }
18
- export type ProvideFunction = (factory: () => Plugin, priority: Priority, options?: {
19
- format?: InternalModuleFormat | InternalModuleFormat[];
20
- inputs?: string[];
21
- outputPlugin?: true;
22
- }) => void;
23
- export type Provider = {
24
- provide: ProvideFunction;
25
- import: (module: string, exportName?: string) => Promise<((...args: unknown[]) => Plugin)>;
26
- globalImport: (module: string, exportName?: string | string[]) => void;
27
- globalSetup: (code: Function | string) => void;
28
- };
29
- export type PkgbldRollupPlugin = {
30
- plugin: () => Plugin;
31
- priority: Priority;
32
- format?: InternalModuleFormat | InternalModuleFormat[];
33
- inputs?: string[];
34
- outputPlugin?: true;
35
- };
36
- export type CliOptions = NonNullable<Extract<ReturnType<typeof getCliOptions>, {
37
- kind: 'build';
38
- }>>;
39
- export type ParsedOptions = Record<string, string | number | string[] | number[] | boolean | undefined>;
40
- export interface PkgbldPlugin {
41
- options(parsedArgs: ParsedOptions, options: CliOptions): void;
42
- processPackageJson(packageJson: PackageJson, inputs: string[], logger: Logger): void;
43
- processTsConfig(config: Json): void;
44
- providePlugins(provider: Provider, config: ParsedOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
45
- getExtraOutputSettings(format: InternalModuleFormat, inputs: string[]): Partial<OutputOptions>;
46
- buildEnd(): Promise<void>;
47
- }
@@ -1,2 +0,0 @@
1
- import { Json } from './types';
2
- export declare function writeJson(path: string, json: Json): Promise<void>;