Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bunchee

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunchee - npm Package Compare versions

Comparing version 3.0.0-beta.10 to 3.0.0-beta.11

43

dist/cli.js
#!/usr/bin/env node
var path = require('path');
var arg = require('arg');
require('fs');
var fs = require('fs');

@@ -11,2 +11,12 @@ function exit(err) {

const formatDuration = (duration)=>duration >= 1000 ? `${duration / 1000}s` : `${duration}ms`;
function getPackageMeta(cwd) {
const pkgFilePath = path.resolve(cwd, 'package.json');
let targetPackageJson = {};
try {
targetPackageJson = JSON.parse(fs.readFileSync(pkgFilePath, {
encoding: 'utf-8'
}));
} catch (_) {}
return targetPackageJson;
}
const logger = {

@@ -24,3 +34,3 @@ log (arg) {

var version = "3.0.0-beta.10";
var version = "3.0.0-beta.11";

@@ -76,2 +86,20 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {

}
function lintPackage(cwd) {
return _lintPackage.apply(this, arguments);
}
function _lintPackage() {
_lintPackage = _asyncToGenerator(function*(cwd) {
const { publint } = yield import('publint');
const { printMessage } = yield import('publint/utils');
const messages = yield publint({
pkgDir: cwd,
level: 'error'
});
const pkg = getPackageMeta(cwd);
for (const message of messages){
console.log(printMessage(message, pkg));
}
});
return _lintPackage.apply(this, arguments);
}
function parseCliArgs(argv) {

@@ -150,3 +178,3 @@ let args;

const entry = source ? path.resolve(cwd, source) : '';
const { bundle } = require('./lib');
const bundle = require('./lib').bundle;
let timeStart = Date.now();

@@ -165,5 +193,10 @@ let timeEnd;

const duration = timeEnd - timeStart;
if (!watch) {
logger.log(`✨ Finished in ${formatDuration(duration)}`);
// watching mode
if (watch) {
logger.log(`🔍 Watching assets in ${cwd}...`);
return;
}
// build mode
logger.log(`✨ Finished in ${formatDuration(duration)}`);
yield lintPackage(cwd);
});

@@ -170,0 +203,0 @@ return _run.apply(this, arguments);

5

dist/lib.js

@@ -472,2 +472,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

// Map './lite' -> './lite.[ext]'
// Return undefined if no match or if it's package.json exports
function getSourcePathFromExportPath(cwd, exportPath) {

@@ -513,3 +514,5 @@ const exts = [

if (isSingleEntry) {
entryPath = getSourcePathFromExportPath(config.rootDir, '.');
// Use specified string file path if possible, then fallback to the default behavior entry picking logic
// e.g. "exports": "./dist/index.js" -> use "./index.<ext>" as entry
entryPath = entryPath || getSourcePathFromExportPath(config.rootDir, '.') || '';
}

@@ -516,0 +519,0 @@ function buildEntryConfig(packageExports, dtsOnly) {

{
"name": "bunchee",
"version": "3.0.0-beta.10",
"version": "3.0.0-beta.11",
"description": "zero config bundler for js/ts/jsx libraries",

@@ -34,2 +34,5 @@ "bin": {

],
"engines": {
"node": ">= 16"
},
"author": "huozhi (github.com/huozhi)",

@@ -47,2 +50,3 @@ "repository": {

"arg": "5.0.2",
"publint": "0.1.11",
"rollup": "3.15.0",

@@ -67,3 +71,3 @@ "rollup-plugin-dts": "5.1.1",

"react": "18.2.0",
"tsx": "3.12.3",
"tsx": "3.12.6",
"typescript": "4.9.5"

@@ -70,0 +74,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc