pkgbld 1.15.4 → 1.15.6

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -531,7 +531,7 @@ async function writeJson(path, json) {
531
531
  await fs.writeFile(path, JSON.stringify(json, null, 2) + '\n');
532
532
  }
533
533
 
534
- var version = "1.15.4";
534
+ var version = "1.15.6";
535
535
  var license = "MIT";
536
536
  var name = "pkgbld";
537
537
  var author = {
@@ -682,7 +682,9 @@ async function ejectConfig(config, pkgPath, options, inputs, helpers, pkg) {
682
682
  }
683
683
  });
684
684
  await fs.writeFile(path.join(path.dirname(pkgPath), 'rollup.config.mjs'), result.code);
685
- // this can be improved a lot
685
+ await updatePackageJson(pkg);
686
+ }
687
+ async function updatePackageJson(pkg) {
686
688
  if (typeof pkg.devDependencies !== 'object') {
687
689
  pkg.devDependencies = {};
688
690
  }
@@ -693,11 +695,15 @@ async function ejectConfig(config, pkgPath, options, inputs, helpers, pkg) {
693
695
  devDependencies['rollup'] = pkgbldPkg.dependencies['rollup'] ;
694
696
  const isBuiltin = (await import('is-builtin-module')).default;
695
697
  for (const key of imports.keys()) {
696
- if (!isBuiltin(key)) {
697
- devDependencies[key] = pkgbldPkg.dependencies[key] ?? '*';
698
+ const packageName = getPackageName(key);
699
+ if (!isBuiltin(packageName)) {
700
+ devDependencies[packageName] = pkgbldPkg.dependencies[packageName] ?? '*';
698
701
  }
699
702
  }
700
703
  }
704
+ function getPackageName(key) {
705
+ return key.split('/').slice(0, key.startsWith('@') ? 2 : 1).join('/');
706
+ }
701
707
 
702
708
  const defaultTsConfig = {
703
709
  include: ['src', 'types'],
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.15.4",
2
+ "version": "1.15.6",
3
3
  "license": "MIT",
4
4
  "name": "pkgbld",
5
5
  "author": {