pkgbld 1.27.0 → 1.28.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/dist/index.js +80 -39
- package/dist/src/builtin-plugins/externals.d.ts +1 -1
- package/dist/src/builtin-plugins/preprocess.d.ts +1 -1
- package/dist/src/builtin-plugins/terser.d.ts +1 -1
- package/dist/src/builtin-plugins/typescript.d.ts +2 -2
- package/dist/src/eject.d.ts +1 -1
- package/dist/src/get-rollup-configs.d.ts +1 -1
- package/dist/src/helpers.d.ts +1 -0
- package/dist/src/process-pkg.d.ts +3 -1
- package/dist/src/types.d.ts +1 -1
- package/package.json +1 -1
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.0";
|
|
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,
|
|
@@ -1176,6 +1205,23 @@ async function flatten(pkg, flatten, logger) {
|
|
|
1176
1205
|
});
|
|
1177
1206
|
files.push(...newFiles);
|
|
1178
1207
|
pkg.files = [...files];
|
|
1208
|
+
// remove extra directories with package.json
|
|
1209
|
+
const exports = pkg.exports ? Object.keys(pkg.exports) : [];
|
|
1210
|
+
for (const key of exports) {
|
|
1211
|
+
if (key === '.') {
|
|
1212
|
+
continue;
|
|
1213
|
+
}
|
|
1214
|
+
const isDir = await isDirectory(key);
|
|
1215
|
+
if (isDir) {
|
|
1216
|
+
const pkgPath = path.join(key, 'package.json');
|
|
1217
|
+
const pkgExists = await isExists(pkgPath);
|
|
1218
|
+
// ensure nothing else is in the directory
|
|
1219
|
+
const files = await fs.readdir(key);
|
|
1220
|
+
if (files.length === 1 && pkgExists) {
|
|
1221
|
+
await fs.rm(key, { recursive: true, force: true });
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1179
1225
|
}
|
|
1180
1226
|
function cloneAndUpdate(pkg, updater) {
|
|
1181
1227
|
if (typeof pkg === 'string') {
|
|
@@ -1193,17 +1239,12 @@ function cloneAndUpdate(pkg, updater) {
|
|
|
1193
1239
|
}
|
|
1194
1240
|
return pkg;
|
|
1195
1241
|
}
|
|
1196
|
-
async function
|
|
1242
|
+
async function isDirectory(file) {
|
|
1197
1243
|
try {
|
|
1198
|
-
await fs.
|
|
1244
|
+
const fileStat = await fs.stat(file);
|
|
1245
|
+
return fileStat.isDirectory();
|
|
1199
1246
|
}
|
|
1200
|
-
catch (e) {
|
|
1201
|
-
if (typeof e === 'object' && e != null && 'code' in e && e.code === 'ENOENT') {
|
|
1202
|
-
return false;
|
|
1203
|
-
}
|
|
1204
|
-
throw e;
|
|
1205
|
-
}
|
|
1206
|
-
return file;
|
|
1247
|
+
catch (e) { /**/ }
|
|
1207
1248
|
}
|
|
1208
1249
|
async function walkDir(dir) {
|
|
1209
1250
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
@@ -1275,16 +1316,16 @@ async function execute() {
|
|
|
1275
1316
|
process.stdout.moveCursor?.(0, 1);
|
|
1276
1317
|
mainLogger.update('preparing...');
|
|
1277
1318
|
checkTsConfig(options, mainLogger, plugins);
|
|
1278
|
-
const inputs = processPackage(pkg, options, plugins);
|
|
1319
|
+
const [inputs, inputsExt] = await processPackage(pkg, options, plugins);
|
|
1279
1320
|
if (options.formatPackageJson) {
|
|
1280
1321
|
pkg = formatPackageJson(pkg);
|
|
1281
1322
|
}
|
|
1282
1323
|
const helpers = getHelpers(pkg.name);
|
|
1283
1324
|
const preimportMap = preimport();
|
|
1284
1325
|
const provider = options.eject ? await createEjectProvider(preimportMap) : createProvider(preimportMap);
|
|
1285
|
-
const rollupConfigs = await getRollupConfigs(provider, inputs, options, helpers, plugins);
|
|
1326
|
+
const rollupConfigs = await getRollupConfigs(provider, inputs, inputsExt, options, helpers, plugins);
|
|
1286
1327
|
if (options.eject) {
|
|
1287
|
-
await ejectConfig(rollupConfigs, pkgPath, options, inputs, helpers, pkg);
|
|
1328
|
+
await ejectConfig(rollupConfigs, pkgPath, options, inputs, inputsExt, helpers, pkg);
|
|
1288
1329
|
mainLogger.finish(`ejected config in ${getTimeDiff(time)}`);
|
|
1289
1330
|
if (!options.noUpdatePackageJson) {
|
|
1290
1331
|
await writeJson(pkgPath, pkg);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CliOptions, Provider } from '../types';
|
|
2
|
-
export default function (provider: Provider, config: CliOptions, inputs: string[]): Promise<void>;
|
|
2
|
+
export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CliOptions, Provider } from '../types';
|
|
2
|
-
export default function (provider: Provider, config: CliOptions): Promise<void>;
|
|
2
|
+
export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CliOptions, Provider } from '../types';
|
|
2
|
-
export default function (provider: Provider, config: CliOptions): Promise<void>;
|
|
2
|
+
export default function (provider: Provider, config: CliOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Provider } from '../types';
|
|
2
|
-
export default function (provider: Provider): Promise<void>;
|
|
1
|
+
import { CliOptions, Provider } from '../types';
|
|
2
|
+
export default function (provider: Provider, config: CliOptions, inputs: string[]): Promise<void>;
|
package/dist/src/eject.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import type { PackageJson } from 'options';
|
|
|
3
3
|
import type { RollupOptions } from 'rollup';
|
|
4
4
|
import { getHelpers } from './helpers';
|
|
5
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>;
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import type { getHelpers } from './helpers';
|
|
2
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<{
|
|
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
4
|
input: string[];
|
|
5
5
|
output: {
|
|
6
6
|
amd?: import("rollup").AmdOptions | undefined;
|
package/dist/src/helpers.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export declare function formatOutput(output: OutputOptions | OutputOptions[] | u
|
|
|
10
10
|
export declare function getTimeDiff(starting: number): string;
|
|
11
11
|
export declare const areSetsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
|
|
12
12
|
export declare function formatPackageJson(pkg: PackageJson): PackageJson;
|
|
13
|
+
export declare function isExists(file: string): Promise<string | false>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { CliOptions, Json, PkgbldPlugin } from './types';
|
|
2
|
-
|
|
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 {};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface PkgbldPlugin {
|
|
|
41
41
|
options(parsedArgs: ParsedOptions, options: CliOptions): void;
|
|
42
42
|
processPackageJson(packageJson: PackageJson, inputs: string[], logger: Logger): void;
|
|
43
43
|
processTsConfig(config: Json): void;
|
|
44
|
-
providePlugins(provider: Provider, config: ParsedOptions, inputs: string[]): Promise<void>;
|
|
44
|
+
providePlugins(provider: Provider, config: ParsedOptions, inputs: string[], inputsExt: Map<string, string>): Promise<void>;
|
|
45
45
|
getExtraOutputSettings(format: InternalModuleFormat, inputs: string[]): Partial<OutputOptions>;
|
|
46
46
|
buildEnd(): Promise<void>;
|
|
47
47
|
}
|
package/package.json
CHANGED