@pob/rollup 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.0](https://github.com/christophehurpeau/pob/compare/@pob/rollup@1.0.1...@pob/rollup@1.1.0) (2024-04-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * add rollup-esbuild ([a1085db](https://github.com/christophehurpeau/pob/commit/a1085dbe6ea69767596dd46813044b96fbf713dd))
12
+
13
+
14
+
15
+
16
+ ## [1.0.1](https://github.com/christophehurpeau/pob/compare/@pob/rollup@1.0.0...@pob/rollup@1.0.1) (2023-12-29)
17
+
18
+ Note: no notable changes
19
+
20
+
21
+
22
+
6
23
  ## 1.0.0 (2023-12-10)
7
24
 
8
25
 
package/lib/index.js ADDED
@@ -0,0 +1,33 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ export const nodeFormatToExt = (format, pkgType) => {
5
+ if (format === 'cjs' && pkgType === 'module') return '.cjs';
6
+ if (format === 'cjs') return '.cjs.js';
7
+ if (format === 'es') return '.mjs';
8
+ return `.${format}.js`;
9
+ };
10
+
11
+ export const resolveEntry = (cwd, entryName) => {
12
+ let entryPath;
13
+ ['ts', 'tsx', 'js', 'jsx'].some((extension) => {
14
+ const potentialEntryPath = path.resolve(
15
+ cwd,
16
+ 'src',
17
+ `${entryName}.${extension}`,
18
+ );
19
+
20
+ if (fs.existsSync(potentialEntryPath)) {
21
+ entryPath = potentialEntryPath;
22
+ return true;
23
+ }
24
+
25
+ return false;
26
+ });
27
+
28
+ if (!entryPath) {
29
+ throw new Error(`Could not find entry "src/${entryName}" in path "${cwd}"`);
30
+ }
31
+
32
+ return entryPath;
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/rollup",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "rollup configuration for pob",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
@@ -15,8 +15,10 @@
15
15
  "engines": {
16
16
  "node": ">=18.12.0"
17
17
  },
18
- "publishConfig": {
19
- "access": "public"
18
+ "sideEffects": false,
19
+ "bin": {
20
+ "pob-rollup-clean-out": "./bin/pob-rollup-clean-out.js",
21
+ "rollup": "./bin/rollup.cjs"
20
22
  },
21
23
  "main": "./lib/index.js",
22
24
  "exports": {
@@ -24,10 +26,8 @@
24
26
  "./bin/pob-rollup-clean-out.js": "./bin/pob-rollup-clean-out.js",
25
27
  "./package.json": "./package.json"
26
28
  },
27
- "sideEffects": false,
28
- "bin": {
29
- "pob-rollup-clean-out": "./bin/pob-rollup-clean-out.js",
30
- "rollup": "./bin/rollup.cjs"
29
+ "publishConfig": {
30
+ "access": "public"
31
31
  },
32
32
  "files": [
33
33
  "lib",
@@ -37,8 +37,8 @@
37
37
  "lint": "yarn run lint:eslint",
38
38
  "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet @pob/rollup"
39
39
  },
40
- "prettier": "@pob/root/prettier-config",
41
40
  "pob": {},
41
+ "prettier": "@pob/root/prettier-config",
42
42
  "dependencies": {
43
43
  "rollup": "3.29.4"
44
44
  }