Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit dd29617

Browse files
committed
update project configuration
1 parent 4090665 commit dd29617

File tree

4 files changed

+52
-7
lines changed

4 files changed

+52
-7
lines changed

.rollup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import pkg from './package.json'
22

33
export default {
44
...pkg.rollup,
5-
plugins: pkg.rollup.plugins.map(plugin => require(plugin)()),
5+
plugins: pkg.rollup.plugins.map(plugin => ((plugin = [].concat(plugin)), require(plugin[0])(...plugin.slice(1)))),
66
onwarn(warning, warn) {
77
if (warning.code !== 'UNRESOLVED_IMPORT') warn(warning)
88
}

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes to PostCSS Focus Within
22

3+
### 5.0.1 (September 22, 2021)
4+
5+
- Added missing `dist` to bundle.
6+
- Added missing `exports` to `package.json`
7+
- Added missing `types` to `package.json`
8+
- Added bundling & testing as prepublish step.
9+
310
### 5.0.0 (September 17, 2021)
411

512
- Updated: Support for PostCS 8+ (major).

package.json

+27-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"repository": "csstools/postcss-focus-within",
88
"homepage": "https://github.com/csstools/postcss-focus-within#readme",
99
"bugs": "https://github.com/csstools/postcss-focus-within/issues",
10-
"main": "dist/index.cjs.js",
11-
"module": "dist/index.esm.mjs",
10+
"main": "dist/index.cjs",
11+
"module": "dist/index.mjs",
12+
"types": "./dist/index.d.ts",
13+
"exports": {
14+
".": {
15+
"import": "./dist/index.mjs",
16+
"require": "./dist/index.cjs",
17+
"types": "./dist/index.d.ts"
18+
}
19+
},
1220
"files": [
1321
"dist"
1422
],
@@ -17,6 +25,7 @@
1725
"build:watch": "npx rollup -c .rollup.js --watch",
1826
"lint": "npx eslint --cache src",
1927
"lint:fix": "npx eslint --cache --fix",
28+
"prepublishOnly": "npm test",
2029
"pretest": "npm install && npm run build",
2130
"test": "npm run lint && npm run tape",
2231
"tape": "npx postcss-tape"
@@ -35,7 +44,8 @@
3544
"postcss-tape": "6.0.1",
3645
"pre-commit": "1.2.2",
3746
"rollup": "2.56.3",
38-
"rollup-plugin-babel": "4.4.0"
47+
"rollup-plugin-babel": "4.4.0",
48+
"rollup-plugin-copy": "^3.4.0"
3949
},
4050
"babel": {
4151
"presets": [
@@ -61,16 +71,27 @@
6171
"rollup": {
6272
"input": "src/index.js",
6373
"plugins": [
64-
"rollup-plugin-babel"
74+
"rollup-plugin-babel",
75+
[
76+
"rollup-plugin-copy",
77+
{
78+
"targets": [
79+
{
80+
"src": "./src/index.d.ts",
81+
"dest": "./dist"
82+
}
83+
]
84+
}
85+
]
6586
],
6687
"output": [
6788
{
6889
"exports": "default",
69-
"file": "dist/index.cjs.js",
90+
"file": "dist/index.cjs",
7091
"format": "cjs"
7192
},
7293
{
73-
"file": "dist/index.esm.js",
94+
"file": "dist/index.mjs",
7495
"format": "esm"
7596
}
7697
]

src/index.d.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export type PluginOptions = {
2+
/** Defines whether the original selector should remain. */
3+
preserve?: boolean
4+
/** Defines the selector to replace `:focus-within`. */
5+
replaceWith?: string
6+
}
7+
8+
export type Plugin = {
9+
(pluginOptions?: PluginOptions): {
10+
postcssPlugin: 'postcss-focus-within'
11+
}
12+
postcss: true
13+
}
14+
15+
declare const plugin: Plugin
16+
17+
export default plugin

0 commit comments

Comments
 (0)