Skip to content

Commit 3577049

Browse files
committed
fix(inject): prepare for Rollup 3
BREAKING CHANGES: Requires Node 14
1 parent 32aa6d2 commit 3577049

File tree

10 files changed

+96
-46
lines changed

10 files changed

+96
-46
lines changed

β€Ž.prettierignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ packages/json/test/fixtures/garbage/*
55
packages/yaml/test/fixtures/**/*
66
**/dist/
77
**/fixtures/
8+
**/snapshots/
89
pnpm-lock.yaml

β€Žpackages/inject/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## Requirements
1515

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

1818
## Install
1919

β€Žpackages/inject/package.jsonβ€Ž

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@
1313
"author": "Rich Harris <richard.a.harris@gmail.com>",
1414
"homepage": "https://github.com/rollup/plugins/tree/master/packages/inject#readme",
1515
"bugs": "https://github.com/rollup/plugins/issues",
16-
"main": "dist/index.js",
17-
"module": "dist/index.es.js",
16+
"main": "./dist/cjs/index.js",
17+
"module": "./dist/es/index.js",
18+
"exports": {
19+
"types": "./types/index.d.ts",
20+
"import": "./dist/es/index.js",
21+
"default": "./dist/cjs/index.js"
22+
},
23+
"engines": {
24+
"node": ">=14.0.0"
25+
},
1826
"scripts": {
1927
"build": "rollup -c",
2028
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
@@ -27,11 +35,12 @@
2735
"pretest": "pnpm build",
2836
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
2937
"test": "ava",
30-
"test:ts": "tsc index.d.ts test/types.ts --noEmit"
38+
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
3139
},
3240
"files": [
3341
"dist",
34-
"index.d.ts",
42+
"!dist/**/*.map",
43+
"types",
3544
"README.md",
3645
"LICENSE"
3746
],
@@ -44,25 +53,28 @@
4453
"modules"
4554
],
4655
"peerDependencies": {
47-
"rollup": "^1.20.0 || ^2.0.0"
56+
"rollup": "^1.20.0||^2.0.0||^3.0.0"
57+
},
58+
"peerDependenciesMeta": {
59+
"rollup": {
60+
"optional": true
61+
}
4862
},
4963
"dependencies": {
50-
"@rollup/pluginutils": "^3.1.0",
51-
"estree-walker": "^2.0.1",
52-
"magic-string": "^0.25.7"
64+
"@rollup/pluginutils": "^4.2.1",
65+
"estree-walker": "^2.0.2",
66+
"magic-string": "^0.26.4"
5367
},
5468
"devDependencies": {
5569
"@rollup/plugin-buble": "^0.21.3",
56-
"del-cli": "^3.0.1",
70+
"del-cli": "^5.0.0",
5771
"locate-character": "^2.0.5",
58-
"rollup": "^2.67.3",
59-
"source-map": "^0.7.3",
60-
"typescript": "^3.9.7"
72+
"rollup": "^3.0.0-7",
73+
"source-map": "^0.7.4",
74+
"typescript": "^4.8.3"
6175
},
76+
"types": "./types/index.d.ts",
6277
"ava": {
63-
"babel": {
64-
"compileEnhancements": false
65-
},
6678
"files": [
6779
"!**/fixtures/**",
6880
"!**/helpers/**",

β€Žpackages/inject/rollup.config.jsβ€Ž

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { readFileSync } from 'fs';
2+
3+
import buble from '@rollup/plugin-buble';
4+
5+
import { createConfig } from '../../shared/rollup.config.mjs';
6+
7+
export default {
8+
...createConfig({
9+
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
10+
}),
11+
input: 'src/index.js',
12+
plugins: [buble()]
13+
};

β€Žpackages/inject/test/snapshots/test.js.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Generated by [AVA](https://avajs.dev).
112112
$inject_Buffer_isBuffer('foo');␊
113113
`
114114

115-
## generates \* imports
115+
## generates * imports
116116

117117
> Snapshot 1
118118
-53 Bytes
Binary file not shown.

β€Žpnpm-lock.yamlβ€Ž

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

β€Žtsconfig.base.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"pretty": true,
1313
"sourceMap": true,
1414
"strict": true,
15-
"target": "es2017"
15+
"target": "es2019"
1616
},
1717
"exclude": ["dist", "node_modules", "test/types"]
1818
}

0 commit comments

Comments
Β (0)