Skip to content

Commit adb97d0

Browse files
committed
chore(auto-install): update dependencies
1 parent b3b8efd commit adb97d0

File tree

9 files changed

+48
-39
lines changed

9 files changed

+48
-39
lines changed

packages/auto-install/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
"homepage": "https://github.com/rollup/plugins/tree/master/packages/auto-install/#readme",
1212
"bugs": "https://github.com/rollup/plugins/issues",
1313
"main": "dist/index.js",
14+
"module": "dist/index.es.js",
1415
"scripts": {
1516
"build": "rollup -c",
1617
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
1718
"ci:lint": "pnpm run build && pnpm run lint",
1819
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
1920
"ci:test": "pnpm run test -- --verbose",
2021
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
21-
"lint:docs": "prettier --single-quote --write README.md",
22+
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
2223
"lint:js": "eslint --fix --cache src test --ext .js,.ts",
2324
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
2425
"prebuild": "del-cli dist",
@@ -45,14 +46,17 @@
4546
"rollup": "^1.20.0||^2.0.0"
4647
},
4748
"devDependencies": {
48-
"@rollup/plugin-node-resolve": "^7.0.0",
49-
"@rollup/plugin-typescript": "^3.0.0",
49+
"@rollup/plugin-node-resolve": "^8.4.0",
50+
"@rollup/plugin-typescript": "^5.0.2",
5051
"del": "^5.1.0",
5152
"node-noop": "^1.0.0",
52-
"rollup": "^2.0.0"
53+
"rollup": "^2.23.0"
5354
},
55+
"types": "types/index.d.ts",
5456
"ava": {
55-
"compileEnhancements": false,
57+
"babel": {
58+
"compileEnhancements": false
59+
},
5660
"extensions": [
5761
"ts"
5862
],
@@ -66,7 +70,5 @@
6670
"!**/recipes/**",
6771
"!**/types.ts"
6872
]
69-
},
70-
"module": "dist/index.es.js",
71-
"types": "types/index.d.ts"
73+
}
7274
}

packages/auto-install/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import pkg from './package.json';
44

55
export default {
66
input: 'src/index.ts',
7-
plugins: [typescript()],
7+
plugins: [typescript({ sourceMap: false })],
88
external: ['path', 'fs', 'child_process', 'module', 'util'],
99
output: [
10-
{ format: 'cjs', file: pkg.main },
10+
{ format: 'cjs', file: pkg.main, exports: 'auto' },
1111
{ format: 'esm', file: pkg.module }
1212
]
1313
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import noop from 'node-noop'; // eslint-disable-line
1+
import 'node-noop'; // eslint-disable-line

packages/auto-install/test/npm-bare.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { join } = require('path');
33

44
const test = require('ava');
55
const del = require('del');
6-
const resolve = require('@rollup/plugin-node-resolve');
6+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
77
const { rollup } = require('rollup');
88

99
const autoInstall = require('..');
@@ -15,13 +15,14 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('npm, bare', async (t) => {
18+
t.timeout(30000);
1819
await rollup({
1920
input,
2021
output: {
2122
file,
2223
format: 'cjs'
2324
},
24-
plugins: [autoInstall(), resolve()]
25+
plugins: [autoInstall(), nodeResolve()]
2526
});
2627
t.snapshot(readFileSync('package.json', 'utf-8'));
2728
t.snapshot(readFileSync('package-lock.json', 'utf-8'));

packages/auto-install/test/npm.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { join } = require('path');
33

44
const test = require('ava');
55
const del = require('del');
6-
const resolve = require('@rollup/plugin-node-resolve');
6+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
77
const { rollup } = require('rollup');
88

99
const autoInstall = require('..');
@@ -17,6 +17,7 @@ const pkgFile = join(cwd, 'package.json');
1717
process.chdir(cwd);
1818

1919
test('invalid manager', (t) => {
20+
t.timeout(30000);
2021
const error = t.throws(
2122
() =>
2223
rollup({
@@ -25,21 +26,24 @@ test('invalid manager', (t) => {
2526
file,
2627
format: 'cjs'
2728
},
28-
plugins: [autoInstall({ pkgFile, manager: 'foo' }), resolve()]
29+
plugins: [autoInstall({ pkgFile, manager: 'foo' }), nodeResolve()]
2930
}),
30-
RangeError
31+
{
32+
instanceOf: RangeError
33+
}
3134
);
3235
t.snapshot(error.message);
3336
});
3437

3538
test('npm', async (t) => {
39+
t.timeout(30000);
3640
await rollup({
3741
input,
3842
output: {
3943
file,
4044
format: 'cjs'
4145
},
42-
plugins: [autoInstall({ pkgFile, manager }), resolve()]
46+
plugins: [autoInstall({ pkgFile, manager }), nodeResolve()]
4347
});
4448
t.snapshot(readFileSync('package-lock.json', 'utf-8'));
4549
});

packages/auto-install/test/yarn-bare.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { join } = require('path');
33

44
const test = require('ava');
55
const del = require('del');
6-
const resolve = require('@rollup/plugin-node-resolve');
6+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
77
const { rollup } = require('rollup');
88

99
const autoInstall = require('..');
@@ -15,6 +15,7 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('yarn, bare', async (t) => {
18+
t.timeout(30000);
1819
await rollup({
1920
input,
2021
output: {
@@ -24,7 +25,7 @@ test('yarn, bare', async (t) => {
2425
plugins: [
2526
// mock the call to yarn here. yarn has had consistent issues in this test env
2627
autoInstall({ manager: 'yarn', commands: { yarn: 'echo yarn.bare > yarn.lock' } }),
27-
resolve()
28+
nodeResolve()
2829
]
2930
});
3031
const lockFile = readFileSync('yarn.lock', 'utf-8');

packages/auto-install/test/yarn.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { join } = require('path');
33

44
const test = require('ava');
55
const del = require('del');
6-
const resolve = require('@rollup/plugin-node-resolve');
6+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
77
const { rollup } = require('rollup');
88

99
const autoInstall = require('..');
@@ -15,14 +15,15 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('yarn', async (t) => {
18+
t.timeout(30000);
1819
await rollup({
1920
input,
2021
output: {
2122
file,
2223
format: 'cjs'
2324
},
2425
// mock the call to yarn here. yarn has had consistent issues in this test env
25-
plugins: [autoInstall({ commands: { yarn: 'echo yarn > yarn.lock' } }), resolve()]
26+
plugins: [autoInstall({ commands: { yarn: 'echo yarn > yarn.lock' } }), nodeResolve()]
2627
});
2728
const lockFile = readFileSync('yarn.lock', 'utf-8');
2829
// snapshots for this are a nightmare cross-platform

packages/auto-install/types/index.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { Plugin } from 'rollup';
22

33
export interface RollupAutoInstallOptions {
4-
/**
5-
* Specifies the location on disk of the target `package.json` file.
6-
* If the file doesn't exist, it will be created by the plugin,
7-
* as package managers need to populate the `dependencies` property.
8-
* @default '{cwd}/package.json'
9-
*/
10-
pkgFile?: string;
4+
/**
5+
* Specifies the location on disk of the target `package.json` file.
6+
* If the file doesn't exist, it will be created by the plugin,
7+
* as package managers need to populate the `dependencies` property.
8+
* @default '{cwd}/package.json'
9+
*/
10+
pkgFile?: string;
1111

12-
/**
13-
* Specifies the package manager to use; `npm` or `yarn`.
14-
* If not specified, the plugin will default to `yarn` if `yarn.lock` exists, or `npm` otherwise.
15-
*/
16-
manager?: 'npm' | 'yarn';
12+
/**
13+
* Specifies the package manager to use; `npm` or `yarn`.
14+
* If not specified, the plugin will default to `yarn` if `yarn.lock` exists, or `npm` otherwise.
15+
*/
16+
manager?: 'npm' | 'yarn';
1717
}
1818

1919
/**

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)