Skip to content

Commit

Permalink
feat: add rollup-plugin-dts (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Almanov <131481562+nikkeyl@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nikkeyl authored Feb 22, 2024
1 parent 2b14973 commit 089e05b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 22 deletions.
4 changes: 0 additions & 4 deletions .browserslistrc

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ jobs:
- name: Build
run: pnpm build

- name: Remove TS Build Info
run: rm -rf dist/tsconfig.tsbuildinfo
- name: Remove Dist
run: rm -rf dist

- name: Prettify Types
run: pnpm prettier index.d.ts --write

- name: Create Release
env:
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
Disallow property values that are ignored due to another
property value in the same rule.

> Use `.browserslistrc`.
- [`stylelint-gamut`](https://github.com/fpetrakov/stylelint-gamut):
Throw warning if color goes out of **sRGB**
color space and is not wrapped in `@media (color-gamut: p3) {}`
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
".": "./dist/index.js",
"./*": "./commitlint.config.ts"
},
"types": "index.d.ts",
"author": "Archoleat",
"name": "@archoleat/stylelint-config-extended-scss",
"description": "Extended config for Stylelint with property sorting",
Expand Down Expand Up @@ -40,7 +41,7 @@
},
"scripts": {
"init": "pnpm i && husky && git submodule update",
"build": "rollup -c rollup.config.js",
"build": "rollup -c",
"test": "mocha",
"release": "semantic-release",
"lint:formatting": "prettier . --check",
Expand All @@ -50,10 +51,6 @@
"prettify": "prettier . --write",
"commit": "cz"
},
"files": [
".browserslistrc",
"dist"
],
"engines": {
"node": ">=20.11.0",
"pnpm": ">=8.15.3"
Expand Down Expand Up @@ -110,6 +107,7 @@
"remark-preset-lint-markdown-style-guide": "^5.1.3",
"remark-preset-lint-recommended": "^6.1.3",
"rollup": "^4.12.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^23.0.2",
"ts-node": "^10.9.2",
Expand Down
26 changes: 26 additions & 0 deletions pnpm-lock.yaml

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

28 changes: 21 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
import { defineConfig } from 'rollup';

import { dts } from 'rollup-plugin-dts';
import { minify } from 'rollup-plugin-esbuild';

import typescript from '@rollup/plugin-typescript';

export default defineConfig({
plugins: [typescript(), minify()],
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'es',
const declarationFile = 'index.d.ts';

export default defineConfig([
{
plugins: [typescript(), minify()],
input: 'src/index.ts',
output: {
file: 'index.js',
format: 'es',
},
},
{
plugins: [dts()],
input: `dist/src/${declarationFile}`,
output: {
file: declarationFile,
},
},
});
]);
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"composite": true,
"declaration": true,
"disableReferencedProjectLoad": true,
"emitDeclarationOnly": true,
"exactOptionalPropertyTypes": true,
"lib": ["ES6"],
"lib": ["ESNext"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"noErrorTruncation": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"skipLibCheck": true,
"strict": true,
"target": "ESNext",
"types": ["chai", "mocha"]
Expand Down

0 comments on commit 089e05b

Please sign in to comment.