Skip to content

Commit

Permalink
build!: remove typing support for typescript<4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed May 19, 2024
1 parent 5842f84 commit f2f5956
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 617 deletions.
7 changes: 1 addition & 6 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ export default rsEslint(
markdown: true,
stylistic: true,
yaml: true,
ignores: [
"tests/modules",
"tests/types",
"types-legacy",
"benchmark/data.json",
],
ignores: ["tests/modules", "tests/types", "benchmark/data.json"],
},
{
files: ["tests/utils.ts"],
Expand Down
21 changes: 3 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -89,7 +75,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": {
Expand Down Expand Up @@ -148,7 +134,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",
Expand Down
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>;
Expand Down Expand Up @@ -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: {
Expand All @@ -68,11 +52,6 @@ const library = {
rollupPluginDeassert({
include: ["**/*.{js,ts}"],
}),
rollupPluginCopy({
targets: [
{ src: "types-legacy", dest: "dist/node/types", rename: "legacy" },
],
}),
],

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

0 comments on commit f2f5956

Please sign in to comment.