Skip to content

Commit

Permalink
Fix/multi input is not a function (#80)
Browse files Browse the repository at this point in the history
* chore: added tests for rollup4

* chore: updated deps

* chore: use node 20 in CD/CI

* fix: declare as module for a correct node resolution of cjs files

---------

Co-authored-by: alfredosalzillo <a.salzillo@zakeke.com>
  • Loading branch information
alfredosalzillo and asalzillozakeke authored Jul 4, 2024
1 parent 6fb7530 commit 91a895c
Show file tree
Hide file tree
Showing 7 changed files with 342 additions and 121 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- uses: actions/checkout@v3
- name: build
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- uses: actions/checkout@v3
- name: build
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- uses: actions/checkout@v3
- name: build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- uses: actions/checkout@v3
- name: build
run: |
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- uses: actions/checkout@v3
- name: build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .swcrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "typescript",
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
coverageDirectory: './coverage/',
collectCoverage: true,
transform: {
Expand Down
25 changes: 17 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"name": "rollup-plugin-multi-input",
"version": "2.0.0",
"version": "3.0.0",
"description": "rollup plugin for bundling modular libraries",
"type": "commonjs",
"type": "module",
"main": "./dist/plugin.cjs",
"module": "./dist/plugin.mjs",
"types": "./dist/plugin.d.ts",
"exports": {
".": "./dist/plugin.cjs"
".": {
"import": "./dist/plugin.mjs",
"require": "./dist/plugin.cjs"
}
},
"engines": {
"node": ">=16"
},
"scripts": {
"lint": "eslint src/plugin.ts",
"build": "swc src/plugin.ts --out-file dist/plugin.cjs",
"build:mjs": "swc src/plugin.ts -o dist/plugin.mjs -C module.type=es6",
"build:cjs": "swc src/plugin.ts -o dist/plugin.cjs -C module.type=commonjs",
"build": "npm run build:mjs && npm run build:cjs",
"generate-declaration": "tsc src/plugin.ts --declaration --emitDeclarationOnly --esModuleInterop --lib esNext --outDir dist",
"prepare": "npm run lint && npm run build",
"prepublishOnly": "npm run generate-declaration",
Expand Down Expand Up @@ -43,9 +50,9 @@
"devDependencies": {
"@babel/runtime": "^7.14.0",
"@rollup/plugin-json": "^4.0.2",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.42",
"@swc/jest": "0.2.24",
"@swc/cli": "0.4.0",
"@swc/core": "1.6.7",
"@swc/jest": "0.2.36",
"@types/jest": "29.5.0",
"@typescript-eslint/eslint-plugin": "5.56.0",
"@typescript-eslint/parser": "5.56.0",
Expand All @@ -57,10 +64,12 @@
"jest": "29.5.0",
"rollup2": "npm:rollup@2.0.2",
"rollup3": "npm:rollup@3.20.2",
"rollup4": "npm:rollup@4.18.0",
"rollup": "4.18.0",
"tsc": "2.0.4",
"typescript": "5.0.2"
},
"dependencies": {
"fast-glob": "3.2.12"
"fast-glob": "3.3.2"
}
}
2 changes: 2 additions & 0 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { rollup as rollup2 } from 'rollup2';
import { rollup as rollup3 } from 'rollup3';
import { rollup as rollup4 } from 'rollup4';
import importJson from '@rollup/plugin-json';
import path from 'path';
import multiInput from '../src/plugin';
Expand All @@ -17,6 +18,7 @@ const externalDependencies = [
describe.each([
['rollup 2', rollup2],
['rollup 3', rollup3],
['rollup 4', rollup4],
])('rollup-plugin-multi-input using %s', (_, rollup) => {
const generateBundle = (options) => rollup(options)
.then((bundle) => bundle.generate({
Expand Down
Loading

0 comments on commit 91a895c

Please sign in to comment.