Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build!: remove typing support for typescript<4.7
Browse files Browse the repository at this point in the history
RebeccaStevens committed May 19, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 9fd2590 commit 10d0211
Showing 7 changed files with 5 additions and 612 deletions.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ export default rsEslint(
markdown: true,
stylistic: true,
yaml: true,
ignores: ["tests/modules", "tests/types", "types-legacy"],
ignores: ["tests/modules", "tests/types"],
},
{
files: ["tests/**/*.test.ts"],
21 changes: 3 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -35,26 +35,12 @@
"type": "module",
"exports": {
"types": {
"import": "./dist/node/types/current/index.d.mts",
"require": "./dist/node/types/current/index.d.cts"
"import": "./dist/node/index.d.mts",
"require": "./dist/node/index.d.cts"
},
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.cjs"
},
"main": "dist/node/index.cjs",
"module": "dist/node/index.mjs",
"types": "dist/node/types/legacy/v4_0.d.ts",
"typesVersions": {
"<4.1": {
"*": ["dist/node/types/legacy/v4_0.d.ts"]
},
"<4.7": {
"*": ["dist/node/types/legacy/v4_6.d.ts"]
},
">=4.7": {
"*": ["dist/node/types/current/index.d.mts"]
}
},
"files": [
"dist/node/",
"package.json",
@@ -87,7 +73,7 @@
"test": "pnpm run test:js && pnpm run test:types",
"test:js": "vitest --coverage --run",
"test:js:watch": "vitest",
"test:types": "pnpm run build:node && tsd -f 'tests/**/*.test-d.ts'",
"test:types": "pnpm run build:node && tsd -f 'tests/**/*.test-d.ts' -t 'dist/node/index.d.mts'",
"type-check": "tsc --noEmit -p tsconfig.build.json"
},
"devDependencies": {
@@ -147,7 +133,6 @@
"prettier-plugin-packagejson": "2.5.0",
"rimraf": "5.0.7",
"rollup": "4.17.2",
"rollup-plugin-copy": "3.5.0",
"rollup-plugin-ts": "3.4.5",
"semantic-release": "23.1.1",
"tsc-files": "1.1.4",
84 changes: 0 additions & 84 deletions pnpm-lock.yaml

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

21 changes: 0 additions & 21 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { dirname, join, relative } from "node:path";
import { fileURLToPath } from "node:url";

import rollupPluginReplace from "@rollup/plugin-replace";
import { rollupPlugin as rollupPluginDeassert } from "deassert";
import { type RollupOptions } from "rollup";
import rollupPluginCopy from "rollup-plugin-copy";
import rollupPluginTs from "rollup-plugin-ts";

import p from "./package.json" assert { type: "json" };

const root = dirname(fileURLToPath(import.meta.url));
const nodeDistPath = join(root, "dist/node");

const pkg = p as typeof p & {
dependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
@@ -49,15 +42,6 @@ const library = {
rollupPluginTs({
transpileOnly: true,
tsconfig: "tsconfig.build.json",
hook: {
outputPath: (path, kind) => {
if (kind === "declaration") {
const relativePathToNodeDist = relative(nodeDistPath, path);
return join(nodeDistPath, "types/current", relativePathToNodeDist);
}
return path;
},
},
}),
rollupPluginReplace({
values: {
@@ -68,11 +52,6 @@ const library = {
rollupPluginDeassert({
include: ["**/*.{js,ts}"],
}),
rollupPluginCopy({
targets: [
{ src: "types-legacy", dest: "dist/node/types", rename: "legacy" },
],
}),
],

treeshake,
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -31,5 +31,5 @@
"baseUrl": ".",
"paths": {}
},
"exclude": ["benchmark/", "dist/", "types-legacy/"]
"exclude": ["benchmark/", "dist/"]
}
Loading

0 comments on commit 10d0211

Please sign in to comment.