pkgbld 1.27.1 → 1.28.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/dist/index.js +59 -42
- package/package.json +1 -1
- package/dist/src/builtin-plugins/binify.d.ts +0 -2
- package/dist/src/builtin-plugins/clean.d.ts +0 -2
- package/dist/src/builtin-plugins/commonjs.d.ts +0 -2
- package/dist/src/builtin-plugins/externals.d.ts +0 -2
- package/dist/src/builtin-plugins/preprocess.d.ts +0 -2
- package/dist/src/builtin-plugins/resolve.d.ts +0 -2
- package/dist/src/builtin-plugins/terser.d.ts +0 -2
- package/dist/src/builtin-plugins/typescript.d.ts +0 -2
- package/dist/src/create-subpackages.d.ts +0 -2
- package/dist/src/eject.d.ts +0 -6
- package/dist/src/get-cli-options.d.ts +0 -27
- package/dist/src/get-json.d.ts +0 -2
- package/dist/src/get-plugins.d.ts +0 -4
- package/dist/src/get-rollup-configs.d.ts +0 -54
- package/dist/src/helpers.d.ts +0 -12
- package/dist/src/index.d.ts +0 -1
- package/dist/src/load-plugins.d.ts +0 -3
- package/dist/src/messages.d.ts +0 -1
- package/dist/src/process-pkg.d.ts +0 -2
- package/dist/src/process-ts-config.d.ts +0 -3
- package/dist/src/prune.d.ts +0 -7
- package/dist/src/types.d.ts +0 -47
- package/dist/src/write-json.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var isEqual = require('lodash/isEqual');
|
|
|
17
17
|
|
|
18
18
|
async function createSubpackages(inputs, config) {
|
|
19
19
|
for (const input of inputs) {
|
|
20
|
-
const basename = path.basename(input,
|
|
20
|
+
const basename = path.basename(input, path.extname(input));
|
|
21
21
|
if (basename !== 'index') {
|
|
22
22
|
const pkg = {
|
|
23
23
|
type: 'module',
|
|
@@ -307,7 +307,7 @@ async function commonjs (provider) {
|
|
|
307
307
|
provider.provide(() => pluginCommonjs(), 4000 /* Priority.commonjs */);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
async function externals (provider, config, inputs) {
|
|
310
|
+
async function externals (provider, config, inputs, inputsExt) {
|
|
311
311
|
if (config.includeExternals === true) {
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
@@ -325,8 +325,8 @@ async function externals (provider, config, inputs) {
|
|
|
325
325
|
if (!allowGenericUmd && config.umdInputs.length > 0) {
|
|
326
326
|
const curry = (await provider.import('lodash/curry.js'));
|
|
327
327
|
for (const currentInput of config.umdInputs) {
|
|
328
|
-
const isExternal = curry((currentInput, id, external, importer) => includeExternals(importer, external, id, config) || isExternalInput(currentInput, inputs, id, config))(currentInput);
|
|
329
|
-
provider.provide(() => pluginExternals(isExternal), 2000 /* Priority.externals */, { format: 'umd', inputs: [`./${config.sourceDir}/${currentInput}.
|
|
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)}`] });
|
|
330
330
|
}
|
|
331
331
|
// for eject config
|
|
332
332
|
if (config.formats.length === 0) {
|
|
@@ -354,13 +354,13 @@ function includeExternals(importer, external, id, config) {
|
|
|
354
354
|
}
|
|
355
355
|
return true;
|
|
356
356
|
}
|
|
357
|
-
function isExternalInput(currentInput, inputs, id, config) {
|
|
357
|
+
function isExternalInput(currentInput, inputs, inputsExt, id, config) {
|
|
358
358
|
let normalizedPath;
|
|
359
359
|
if (path.isAbsolute(currentInput)) {
|
|
360
|
-
normalizedPath = './' + path.relative(process.cwd(), currentInput);
|
|
360
|
+
normalizedPath = './' + path.relative(process.cwd(), `${currentInput}.${inputsExt.get(currentInput)}`);
|
|
361
361
|
}
|
|
362
362
|
else {
|
|
363
|
-
normalizedPath = './' + path.join(config.sourceDir, currentInput
|
|
363
|
+
normalizedPath = './' + path.join(config.sourceDir, `${currentInput}.${inputsExt.get(currentInput)}`);
|
|
364
364
|
}
|
|
365
365
|
if (path.isAbsolute(id)) {
|
|
366
366
|
id = './' + path.relative(process.cwd(), id);
|
|
@@ -368,17 +368,17 @@ function isExternalInput(currentInput, inputs, id, config) {
|
|
|
368
368
|
return normalizedPath !== id && inputs.includes(normalizedPath);
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
async function preprocess (provider, config) {
|
|
371
|
+
async function preprocess (provider, config, inputs, inputsExt) {
|
|
372
372
|
if (config.preprocess.length > 0) {
|
|
373
373
|
const pluginPreprocess = await provider.import('rollup-plugin-preprocess');
|
|
374
|
-
const include = config.preprocess.map(name => `${config.sourceDir}/${name}.
|
|
374
|
+
const include = config.preprocess.map(name => `${config.sourceDir}/${name}.${inputsExt.get(name)}`);
|
|
375
375
|
for (const format of config.formats) {
|
|
376
376
|
if (format !== 'umd') {
|
|
377
377
|
provider.provide(() => pluginPreprocess({ include, context: { [format]: true } }), 1000 /* Priority.preprocess */, { format });
|
|
378
378
|
}
|
|
379
379
|
else {
|
|
380
380
|
for (const currentInput of config.umdInputs) {
|
|
381
|
-
provider.provide(() => pluginPreprocess({ include, context: { umd: true } }), 1000 /* Priority.preprocess */, { format, inputs: [`./${config.sourceDir}/${currentInput}.
|
|
381
|
+
provider.provide(() => pluginPreprocess({ include, context: { umd: true } }), 1000 /* Priority.preprocess */, { format, inputs: [`./${config.sourceDir}/${currentInput}.${inputsExt.get(currentInput)}`] });
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -390,7 +390,7 @@ async function resolve (provider) {
|
|
|
390
390
|
provider.provide(() => pluginResolve(), 3000 /* Priority.resolve */);
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
async function terser (provider, config) {
|
|
393
|
+
async function terser (provider, config, inputs, inputsExt) {
|
|
394
394
|
const filteredFormats = config.compressFormats.filter(format => config.formats.includes(format));
|
|
395
395
|
if (filteredFormats.length > 0) {
|
|
396
396
|
const pluginTerser = await provider.import('@rollup/plugin-terser');
|
|
@@ -408,7 +408,7 @@ async function terser (provider, config) {
|
|
|
408
408
|
}
|
|
409
409
|
else {
|
|
410
410
|
for (const currentInput of config.umdInputs) {
|
|
411
|
-
provider.provide(() => pluginTerser(options), 10000 /* Priority.compress */, { format, outputPlugin: true, inputs: [`./${config.sourceDir}/${currentInput}.
|
|
411
|
+
provider.provide(() => pluginTerser(options), 10000 /* Priority.compress */, { format, outputPlugin: true, inputs: [`./${config.sourceDir}/${currentInput}.${inputsExt.get(currentInput)}`] });
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -416,9 +416,12 @@ async function terser (provider, config) {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
async function typescript (provider) {
|
|
420
|
-
const
|
|
421
|
-
|
|
419
|
+
async function typescript (provider, config, inputs) {
|
|
420
|
+
const typescriptInputs = inputs.filter(input => input.endsWith('.ts') || input.endsWith('.tsx'));
|
|
421
|
+
if (typescriptInputs.length > 0) {
|
|
422
|
+
const pluginTypescript = await provider.import('rollup-plugin-typescript2');
|
|
423
|
+
provider.provide(() => pluginTypescript(), 6000 /* Priority.transpile */, typescriptInputs.length === inputs.length ? undefined : { inputs: typescriptInputs });
|
|
424
|
+
}
|
|
422
425
|
}
|
|
423
426
|
|
|
424
427
|
async function binify (provider, config) {
|
|
@@ -462,7 +465,7 @@ function createProvider(preimportMap) {
|
|
|
462
465
|
|
|
463
466
|
function getHelpers(pkgName) {
|
|
464
467
|
function getGlobalName(anInput) {
|
|
465
|
-
return camelCase(path.join(pkgName, path.basename(anInput,
|
|
468
|
+
return camelCase(path.join(pkgName, path.basename(anInput, path.extname(anInput)) !== 'index' ? path.basename(anInput, path.extname(anInput)) : ''));
|
|
466
469
|
}
|
|
467
470
|
function getExternalGlobalName(id) {
|
|
468
471
|
if (path.isAbsolute(id)) {
|
|
@@ -485,7 +488,7 @@ function toArray(object) {
|
|
|
485
488
|
return [object];
|
|
486
489
|
}
|
|
487
490
|
function formatInput(input) {
|
|
488
|
-
return (Array.isArray(input) ? input : [input ?? '']).map(item => kleur.magenta(path.basename(item,
|
|
491
|
+
return (Array.isArray(input) ? input : [input ?? '']).map(item => kleur.magenta(path.basename(item, path.extname(item)))).join(', ');
|
|
489
492
|
}
|
|
490
493
|
function formatOutput(output, field) {
|
|
491
494
|
//? can we avoid it
|
|
@@ -505,8 +508,20 @@ const areSetsEqual = (a, b) => a.size === b.size ? [...a].every(value => b.has(v
|
|
|
505
508
|
function formatPackageJson(pkg) {
|
|
506
509
|
return processPackageJson(pkg, key => key in pkg, key => pkg[key]);
|
|
507
510
|
}
|
|
511
|
+
async function isExists(file) {
|
|
512
|
+
try {
|
|
513
|
+
await fs.access(file);
|
|
514
|
+
}
|
|
515
|
+
catch (e) {
|
|
516
|
+
if (typeof e === 'object' && e != null && 'code' in e && e.code === 'ENOENT') {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
throw e;
|
|
520
|
+
}
|
|
521
|
+
return file;
|
|
522
|
+
}
|
|
508
523
|
|
|
509
|
-
async function getRollupConfigs([provider, plugins$1], inputs, config, helpers, externalPlugins) {
|
|
524
|
+
async function getRollupConfigs([provider, plugins$1], inputs, inputsExt, config, helpers, externalPlugins) {
|
|
510
525
|
const factoryInProgress = [];
|
|
511
526
|
const fileNamePatterns = {
|
|
512
527
|
'es': config.esPattern,
|
|
@@ -514,10 +529,10 @@ async function getRollupConfigs([provider, plugins$1], inputs, config, helpers,
|
|
|
514
529
|
'umd': config.umdPattern
|
|
515
530
|
};
|
|
516
531
|
for (const factory of plugins) {
|
|
517
|
-
factoryInProgress.push(factory(provider, config, inputs));
|
|
532
|
+
factoryInProgress.push(factory(provider, config, inputs, inputsExt));
|
|
518
533
|
}
|
|
519
534
|
for (const ePlugin of externalPlugins) {
|
|
520
|
-
ePlugin.providePlugins && factoryInProgress.push(ePlugin.providePlugins(provider, config, inputs));
|
|
535
|
+
ePlugin.providePlugins && factoryInProgress.push(ePlugin.providePlugins(provider, config, inputs, inputsExt));
|
|
521
536
|
}
|
|
522
537
|
await Promise.all(factoryInProgress);
|
|
523
538
|
const expandInputs = new Set;
|
|
@@ -665,7 +680,7 @@ async function getRollupConfigs([provider, plugins$1], inputs, config, helpers,
|
|
|
665
680
|
}
|
|
666
681
|
else {
|
|
667
682
|
for (const input of config.umdInputs) {
|
|
668
|
-
expanded.push(`${format}../${config.sourceDir}/${input}.
|
|
683
|
+
expanded.push(`${format}../${config.sourceDir}/${input}.${inputsExt.get(input)}`);
|
|
669
684
|
}
|
|
670
685
|
}
|
|
671
686
|
}
|
|
@@ -680,7 +695,8 @@ async function getRollupConfigs([provider, plugins$1], inputs, config, helpers,
|
|
|
680
695
|
const mainLoggerText = (sourceDir, dir, configsCount, startingTime, finishedCount = 0) => (final = false) => `${sourceDir} → ${dir} ${final ? configsCount : finishedCount++} / ${configsCount}${final ? (' in ' + getTimeDiff(startingTime)) : ''}`;
|
|
681
696
|
|
|
682
697
|
const emptySet = new Set;
|
|
683
|
-
|
|
698
|
+
const sourceFileSuffixes = ['ts', 'tsx', 'js', 'jsx']; // svelte, vue, etc. are not supported yet
|
|
699
|
+
async function processPackage(pkg, config, plugins) {
|
|
684
700
|
const exportsFields = new Set([
|
|
685
701
|
'types',
|
|
686
702
|
'import',
|
|
@@ -692,6 +708,7 @@ function processPackage(pkg, config, plugins) {
|
|
|
692
708
|
const indexId = 'index';
|
|
693
709
|
const typesVersionsLastFields = new Set(['*']);
|
|
694
710
|
const inputs = [];
|
|
711
|
+
const inputsExt = new Map;
|
|
695
712
|
const logger$1 = logger.createLogger();
|
|
696
713
|
const allowEsm = (config.formatsOverridden && config.formats.includes('es') || !config.formatsOverridden);
|
|
697
714
|
const allowCjs = (config.formatsOverridden && config.formats.includes('cjs') || !config.formatsOverridden);
|
|
@@ -730,7 +747,7 @@ function processPackage(pkg, config, plugins) {
|
|
|
730
747
|
if (typeof pkg.typings === 'string') {
|
|
731
748
|
delete pkg.typings;
|
|
732
749
|
}
|
|
733
|
-
pkg.types = `./${config.dir}
|
|
750
|
+
pkg.types = `./${config.dir}/${patternToName(typingsFilePattern, 'index')}`;
|
|
734
751
|
if (allowUmd && typeof pkg.umd === 'string') {
|
|
735
752
|
pkg.umd = `./${config.dir}/${patternToName(config.umdPattern, indexId)}`;
|
|
736
753
|
if (!config.umdInputs.includes(indexId)) {
|
|
@@ -802,7 +819,16 @@ function processPackage(pkg, config, plugins) {
|
|
|
802
819
|
pkg.files.push(basename);
|
|
803
820
|
}
|
|
804
821
|
}
|
|
805
|
-
|
|
822
|
+
// check if source file exists
|
|
823
|
+
const sourceFileWithoutSuffix = `./${config.sourceDir}/${basename}.`;
|
|
824
|
+
for (const suffix of sourceFileSuffixes) {
|
|
825
|
+
const file = sourceFileWithoutSuffix + suffix;
|
|
826
|
+
if (await isExists(file)) {
|
|
827
|
+
inputs.push(file);
|
|
828
|
+
inputsExt.set(file, suffix);
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
806
832
|
}
|
|
807
833
|
pkg.typesVersions['*']['*'] = [
|
|
808
834
|
`${config.dir}/${patternToName(typingsFilePattern, indexId)}`,
|
|
@@ -815,7 +841,7 @@ function processPackage(pkg, config, plugins) {
|
|
|
815
841
|
for (const plugin of plugins) {
|
|
816
842
|
plugin.processPackageJson?.(pkg, inputs, logger$1);
|
|
817
843
|
}
|
|
818
|
-
return inputs;
|
|
844
|
+
return [inputs, inputsExt];
|
|
819
845
|
}
|
|
820
846
|
function patternToName(pattern, input) {
|
|
821
847
|
return pattern.replace('[name]', input);
|
|
@@ -844,7 +870,7 @@ async function writeJson(path, json) {
|
|
|
844
870
|
await fs.writeFile(path, toFormattedJson(json));
|
|
845
871
|
}
|
|
846
872
|
|
|
847
|
-
var version = "1.
|
|
873
|
+
var version = "1.28.1";
|
|
848
874
|
var name = "pkgbld";
|
|
849
875
|
var license = "MIT";
|
|
850
876
|
var author = "Konstantin Shutkin";
|
|
@@ -960,7 +986,7 @@ async function createEjectProvider(preimportMap) {
|
|
|
960
986
|
}
|
|
961
987
|
}, plugins];
|
|
962
988
|
}
|
|
963
|
-
async function ejectConfig(config, pkgPath, options, inputs, helpers, pkg) {
|
|
989
|
+
async function ejectConfig(config, pkgPath, options, inputs, inputsExt, helpers, pkg) {
|
|
964
990
|
const pkgName = pkg.name;
|
|
965
991
|
// generate from config
|
|
966
992
|
const text = generate(config);
|
|
@@ -968,6 +994,7 @@ async function ejectConfig(config, pkgPath, options, inputs, helpers, pkg) {
|
|
|
968
994
|
// generate globals for config functions
|
|
969
995
|
setup.add(`const config = ${generate(options)}`);
|
|
970
996
|
setup.add(`const inputs = ${generate(inputs)}`);
|
|
997
|
+
setup.add(`const inputsExt = new Map(${generate(Array.from(inputsExt))})`);
|
|
971
998
|
// generate helpers code
|
|
972
999
|
if (options.formats.includes('umd')) {
|
|
973
1000
|
imports.set('path', 'path');
|
|
@@ -1032,6 +1059,8 @@ const defaultTsConfig = {
|
|
|
1032
1059
|
target: 'esnext',
|
|
1033
1060
|
module: 'esnext',
|
|
1034
1061
|
esModuleInterop: true,
|
|
1062
|
+
allowJs: true,
|
|
1063
|
+
skipLibCheck: true,
|
|
1035
1064
|
strict: true,
|
|
1036
1065
|
noUncheckedIndexedAccess: true,
|
|
1037
1066
|
declaration: true,
|
|
@@ -1217,18 +1246,6 @@ async function isDirectory(file) {
|
|
|
1217
1246
|
}
|
|
1218
1247
|
catch (e) { /**/ }
|
|
1219
1248
|
}
|
|
1220
|
-
async function isExists(file) {
|
|
1221
|
-
try {
|
|
1222
|
-
await fs.access(file);
|
|
1223
|
-
}
|
|
1224
|
-
catch (e) {
|
|
1225
|
-
if (typeof e === 'object' && e != null && 'code' in e && e.code === 'ENOENT') {
|
|
1226
|
-
return false;
|
|
1227
|
-
}
|
|
1228
|
-
throw e;
|
|
1229
|
-
}
|
|
1230
|
-
return file;
|
|
1231
|
-
}
|
|
1232
1249
|
async function walkDir(dir) {
|
|
1233
1250
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
1234
1251
|
const files = [];
|
|
@@ -1299,16 +1316,16 @@ async function execute() {
|
|
|
1299
1316
|
process.stdout.moveCursor?.(0, 1);
|
|
1300
1317
|
mainLogger.update('preparing...');
|
|
1301
1318
|
checkTsConfig(options, mainLogger, plugins);
|
|
1302
|
-
const inputs = processPackage(pkg, options, plugins);
|
|
1319
|
+
const [inputs, inputsExt] = await processPackage(pkg, options, plugins);
|
|
1303
1320
|
if (options.formatPackageJson) {
|
|
1304
1321
|
pkg = formatPackageJson(pkg);
|
|
1305
1322
|
}
|
|
1306
1323
|
const helpers = getHelpers(pkg.name);
|
|
1307
1324
|
const preimportMap = preimport();
|
|
1308
1325
|
const provider = options.eject ? await createEjectProvider(preimportMap) : createProvider(preimportMap);
|
|
1309
|
-
const rollupConfigs = await getRollupConfigs(provider, inputs, options, helpers, plugins);
|
|
1326
|
+
const rollupConfigs = await getRollupConfigs(provider, inputs, inputsExt, options, helpers, plugins);
|
|
1310
1327
|
if (options.eject) {
|
|
1311
|
-
await ejectConfig(rollupConfigs, pkgPath, options, inputs, helpers, pkg);
|
|
1328
|
+
await ejectConfig(rollupConfigs, pkgPath, options, inputs, inputsExt, helpers, pkg);
|
|
1312
1329
|
mainLogger.finish(`ejected config in ${getTimeDiff(time)}`);
|
|
1313
1330
|
if (!options.noUpdatePackageJson) {
|
|
1314
1331
|
await writeJson(pkgPath, pkg);
|
package/package.json
CHANGED
package/dist/src/eject.d.ts
DELETED
|
@@ -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[], 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
|
-
};
|
package/dist/src/get-json.d.ts
DELETED
|
@@ -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[], 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
|
-
}[]>;
|
package/dist/src/helpers.d.ts
DELETED
|
@@ -1,12 +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;
|
package/dist/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@niceties/draftlog-appender';
|
package/dist/src/messages.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mainLoggerText: (sourceDir: string, dir: string, configsCount: number, startingTime: number, finishedCount?: number) => (final?: boolean) => string;
|
package/dist/src/prune.d.ts
DELETED
package/dist/src/types.d.ts
DELETED
|
@@ -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[]): Promise<void>;
|
|
45
|
-
getExtraOutputSettings(format: InternalModuleFormat, inputs: string[]): Partial<OutputOptions>;
|
|
46
|
-
buildEnd(): Promise<void>;
|
|
47
|
-
}
|
package/dist/src/write-json.d.ts
DELETED