bunchee 5.2.2 → 5.3.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/bin/cli.js CHANGED
@@ -470,7 +470,7 @@ function lint$1(pkg) {
470
470
  }
471
471
  }
472
472
 
473
- var version = "5.2.2";
473
+ var version = "5.3.0";
474
474
 
475
475
  function relativify(path) {
476
476
  return path.startsWith('.') ? path : `./${path}`;
@@ -580,7 +580,6 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
580
580
  const exportType = getExportTypeFromExportPath(exportPath);
581
581
  sourceFilesMap[exportType] = indexAbsoluteFile;
582
582
  exportsEntries.set(exportPath, sourceFilesMap);
583
- break;
584
583
  }
585
584
  }
586
585
  }
@@ -1054,6 +1053,7 @@ async function run(args) {
1054
1053
  if (watch) {
1055
1054
  logWatcherBuildTime(assetJobs, spinner);
1056
1055
  } else {
1056
+ stopSpinner();
1057
1057
  if (assetJobs.length === 0) {
1058
1058
  logger.warn('The "src" directory does not contain any entry files. ' + 'For proper usage, please refer to the following link: ' + 'https://github.com/huozhi/bunchee#usage');
1059
1059
  }
package/dist/index.js CHANGED
@@ -275,7 +275,9 @@ async function removeDir(dirPath) {
275
275
  const removedDirs = new Set();
276
276
  async function removeOutputDir(output, cwd) {
277
277
  const dir = output.dir;
278
- if (dir && dir !== cwd && !removedDirs.has(dir)) {
278
+ if (dir && // not equal to cwd
279
+ dir !== cwd && // not equal to src/ dir
280
+ dir !== path__default.default.resolve(cwd, SRC) && !removedDirs.has(dir)) {
279
281
  await removeDir(dir);
280
282
  removedDirs.add(dir);
281
283
  }
@@ -694,7 +696,6 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
694
696
  const exportType = getExportTypeFromExportPath(exportPath);
695
697
  sourceFilesMap[exportType] = indexAbsoluteFile;
696
698
  exportsEntries.set(exportPath, sourceFilesMap);
697
- break;
698
699
  }
699
700
  }
700
701
  }
@@ -1343,7 +1344,8 @@ async function buildInputConfig(entry, bundleConfig, exportCondition, buildConte
1343
1344
  const swcParserConfig = {
1344
1345
  syntax: useTypeScript ? 'typescript' : 'ecmascript',
1345
1346
  [useTypeScript ? 'tsx' : 'jsx']: true,
1346
- exportDefaultFrom: true
1347
+ exportDefaultFrom: true,
1348
+ decorators: true
1347
1349
  };
1348
1350
  const swcOptions = {
1349
1351
  jsc: {
@@ -1353,6 +1355,9 @@ async function buildInputConfig(entry, bundleConfig, exportCondition, buildConte
1353
1355
  loose: true,
1354
1356
  externalHelpers: false,
1355
1357
  parser: swcParserConfig,
1358
+ transform: {
1359
+ decoratorVersion: '2022-03'
1360
+ },
1356
1361
  ...shouldMinify && {
1357
1362
  minify: {
1358
1363
  ...swcMinifyOptions,
package/package.json CHANGED
@@ -1,10 +1,25 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "scripts": {
9
+ "test": "jest --env node",
10
+ "test:update": "TEST_UPDATE_SNAPSHOT=1 pnpm test",
11
+ "test:post": "POST_BUILD=1 pnpm jest test/compile.test.ts test/integration.test.ts",
12
+ "test:ci": "[ -z $CI ] || pnpm test",
13
+ "clean": "rm -rf ./dist",
14
+ "typecheck": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit",
15
+ "prepublishOnly": "pnpm clean && pnpm build && chmod +x ./dist/bin/cli.js && pnpm test:ci",
16
+ "tsx": "SWC_NODE_IGNORE_DYNAMIC=1 node -r @swc-node/register",
17
+ "ts-bunchee": "pnpm tsx ./src/bin/index.ts",
18
+ "build-dir": "pnpm ts-bunchee --cwd",
19
+ "build": "SWC_NODE_IGNORE_DYNAMIC=1 node -r @swc-node/register ./src/bin/index.ts --runtime node",
20
+ "format": "prettier --write .",
21
+ "prepare": "husky"
22
+ },
8
23
  "type": "commonjs",
9
24
  "keywords": [
10
25
  "bundler",
@@ -70,7 +85,7 @@
70
85
  "@huozhi/testing-package": "1.0.0",
71
86
  "@swc-node/register": "^1.9.0",
72
87
  "@swc/jest": "^0.2.31",
73
- "@swc/types": "^0.1.5",
88
+ "@swc/types": "^0.1.9",
74
89
  "@types/clean-css": "^4.2.11",
75
90
  "@types/jest": "29.0.0",
76
91
  "@types/node": "^20.4.1",
@@ -104,18 +119,5 @@
104
119
  ],
105
120
  "testTimeout": 60000
106
121
  },
107
- "packageManager": "pnpm@8.8.0",
108
- "scripts": {
109
- "test": "jest --env node",
110
- "test:update": "TEST_UPDATE_SNAPSHOT=1 pnpm test",
111
- "test:post": "POST_BUILD=1 pnpm jest test/compile.test.ts test/integration.test.ts",
112
- "test:ci": "[ -z $CI ] || pnpm test",
113
- "clean": "rm -rf ./dist",
114
- "typecheck": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit",
115
- "tsx": "SWC_NODE_IGNORE_DYNAMIC=1 node -r @swc-node/register",
116
- "ts-bunchee": "pnpm tsx ./src/bin/index.ts",
117
- "build-dir": "pnpm ts-bunchee --cwd",
118
- "build": "SWC_NODE_IGNORE_DYNAMIC=1 node -r @swc-node/register ./src/bin/index.ts --runtime node",
119
- "format": "prettier --write ."
120
- }
121
- }
122
+ "packageManager": "pnpm@9.4.0"
123
+ }