Skip to content

Commit

Permalink
fix(auto-install): prepare for Rollup 3
Browse files Browse the repository at this point in the history
BREAKING CHANGES: Requires Node 14
  • Loading branch information
lukastaegert committed Sep 30, 2022
1 parent 32aa6d2 commit 4392334
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 44 deletions.
2 changes: 1 addition & 1 deletion packages/auto-install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Expand Down
38 changes: 22 additions & 16 deletions packages/auto-install/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@
"author": "Rich Harris",
"homepage": "https://github.com/rollup/plugins/tree/master/packages/auto-install/#readme",
"bugs": "https://github.com/rollup/plugins/issues",
"main": "dist/index.js",
"module": "dist/index.es.js",
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/es/index.js"
},
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"build": "rollup -c",
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
Expand All @@ -30,7 +37,7 @@
"test:ts": "tsc --noEmit"
},
"files": [
"dist",
"dist/**/*.{js,json}",
"types",
"README.md",
"LICENSE"
Expand All @@ -44,25 +51,24 @@
"modules"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-typescript": "^5.0.2",
"del": "^5.1.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-typescript": "^8.5.0",
"del": "^6.1.1",
"node-noop": "^1.0.0",
"rollup": "^2.67.3",
"typescript": "^4.1.2"
"rollup": "^3.0.0-7",
"typescript": "^4.8.3"
},
"types": "types/index.d.ts",
"ava": {
"babel": true,
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"workerThreads": false,
"files": [
"!**/fixtures/**",
"!**/output/**",
Expand Down
13 changes: 0 additions & 13 deletions packages/auto-install/rollup.config.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/auto-install/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { readFileSync } from 'fs';

import { createConfig } from '../../shared/rollup.config.mjs';

export default createConfig({
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
});
2 changes: 1 addition & 1 deletion packages/auto-install/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { promisify } from 'util';

import { Plugin } from 'rollup';

import { RollupAutoInstallOptions } from '../types';
import type { RollupAutoInstallOptions } from '../types';

const execAsync = promisify(exec);

Expand Down
Binary file modified packages/auto-install/test/snapshots/npm-bare.js.snap
Binary file not shown.
Binary file modified packages/auto-install/test/snapshots/npm.js.snap
Binary file not shown.
77 changes: 67 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions shared/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export function createConfig({ pkg, external = [] }) {
output: [
{
format: 'cjs',
file: pkg.main,
file: pkg.exports.require,
exports: 'named',
footer: 'module.exports = Object.assign(exports.default, exports);',
sourcemap: true
},
{
format: 'es',
file: pkg.module,
file: pkg.exports.import,
plugins: [emitModulePackageFile()],
sourcemap: true
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"pretty": true,
"sourceMap": true,
"strict": true,
"target": "es2017"
"target": "es2019"
},
"exclude": ["dist", "node_modules", "test/types"]
}

0 comments on commit 4392334

Please sign in to comment.