-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
418 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,375 @@ | ||
From 092e070498d33ec799b3f4bd40315c3803a452e3 Mon Sep 17 00:00:00 2001 | ||
From: Eric Long <[email protected]> | ||
Date: Mon, 18 Nov 2024 11:35:05 +0800 | ||
Subject: [PATCH 1/3] Remove dprint | ||
|
||
--- | ||
Herebyfile.mjs | 4 +- | ||
package-lock.json | 223 ----------------------------------------- | ||
package.json | 5 +- | ||
scripts/dtsBundler.mjs | 26 +---- | ||
4 files changed, 5 insertions(+), 253 deletions(-) | ||
|
||
diff --git a/Herebyfile.mjs b/Herebyfile.mjs | ||
index 7939e5eafbd..bf1ac9693be 100644 | ||
--- a/Herebyfile.mjs | ||
+++ b/Herebyfile.mjs | ||
@@ -556,13 +556,13 @@ export const lint = task({ | ||
export const format = task({ | ||
name: "format", | ||
description: "Formats the codebase.", | ||
- run: () => exec(process.execPath, ["node_modules/dprint/bin.js", "fmt"]), | ||
+ run: () => {}, | ||
}); | ||
|
||
export const checkFormat = task({ | ||
name: "check-format", | ||
description: "Checks that the codebase is formatted.", | ||
- run: () => exec(process.execPath, ["node_modules/dprint/bin.js", "check"], { ignoreStdout: true }), | ||
+ run: () => {}, | ||
}); | ||
|
||
export const knip = task({ | ||
diff --git a/package-lock.json b/package-lock.json | ||
index 254a9502002..aced684a0b5 100644 | ||
--- a/package-lock.json | ||
+++ b/package-lock.json | ||
@@ -13,8 +13,6 @@ | ||
"tsserver": "bin/tsserver" | ||
}, | ||
"devDependencies": { | ||
- "@dprint/formatter": "^0.4.1", | ||
- "@dprint/typescript": "0.91.6", | ||
"@esfx/canceltoken": "^1.0.0", | ||
"@eslint/js": "^9.9.0", | ||
"@octokit/rest": "^21.0.1", | ||
@@ -35,7 +33,6 @@ | ||
"chalk": "^4.1.2", | ||
"chokidar": "^3.6.0", | ||
"diff": "^5.2.0", | ||
- "dprint": "^0.47.2", | ||
"esbuild": "^0.23.0", | ||
"eslint": "^9.9.0", | ||
"eslint-formatter-autolinkable-stylish": "^1.4.0", | ||
@@ -69,122 +66,6 @@ | ||
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", | ||
"dev": true | ||
}, | ||
- "node_modules/@dprint/darwin-arm64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.2.tgz", | ||
- "integrity": "sha512-mVPFBJsXxGDKHHCAY8wbqOyS4028g1bN15H9tivCnPAjwaZhkUimZHXWejXADjhGn+Xm2SlakugY9PY/68pH3Q==", | ||
- "cpu": [ | ||
- "arm64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "darwin" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/darwin-x64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.2.tgz", | ||
- "integrity": "sha512-T7wzlc+rBV+6BRRiBjoqoy5Hj4TR2Nv2p2s9+ycyPGs10Kj/JXOWD8dnEHeBgUr2r4qe/ZdcxmsFQ5Hf2n0WuA==", | ||
- "cpu": [ | ||
- "x64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "darwin" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/formatter": { | ||
- "version": "0.4.1", | ||
- "resolved": "https://registry.npmjs.org/@dprint/formatter/-/formatter-0.4.1.tgz", | ||
- "integrity": "sha512-IB/GXdlMOvi0UhQQ9mcY15Fxcrc2JPadmo6tqefCNV0bptFq7YBpggzpqYXldBXDa04CbKJ+rDwO2eNRPE2+/g==", | ||
- "dev": true | ||
- }, | ||
- "node_modules/@dprint/linux-arm64-glibc": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.2.tgz", | ||
- "integrity": "sha512-B0m1vT5LdVtrNOVdkqpLPrSxuCD+l5bTIgRzPaDoIB1ChWQkler9IlX8C+RStpujjPj6SYvwo5vTzjQSvRdQkA==", | ||
- "cpu": [ | ||
- "arm64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "linux" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/linux-arm64-musl": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.2.tgz", | ||
- "integrity": "sha512-zID6wZZqpg2/Q2Us+ERQkbhLwlW3p3xaeEr00MPf49bpydmEjMiPuSjWPkNv+slQSIyIsVovOxF4lbNZjsdtvw==", | ||
- "cpu": [ | ||
- "arm64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "linux" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/linux-x64-glibc": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.2.tgz", | ||
- "integrity": "sha512-rB3WXMdINnRd33DItIp7mObS7dzHW90ZzeJSsoKJLPp+Z7wXjjb27UUowfqVI4baa/1pd7sdbX54DPohMtfu/A==", | ||
- "cpu": [ | ||
- "x64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "linux" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/linux-x64-musl": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.2.tgz", | ||
- "integrity": "sha512-E0+TNbzYdTXJ/jCVjUctVxkda/faw++aDQLfyWGcmdMJnbM7NZz+W4fUpDXzMPsjy+zTWxXcPK7/q2DZz2gnbg==", | ||
- "cpu": [ | ||
- "x64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "linux" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/typescript": { | ||
- "version": "0.91.6", | ||
- "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.91.6.tgz", | ||
- "integrity": "sha512-rbgODMD0hsQJ6w32eMELqt+KnkzxVVLT4qRMcvlz8PsFwSPyIfBslpZcFhmJWdyurVKKNcUPNC6Aq9PcUIX13w==", | ||
- "dev": true | ||
- }, | ||
- "node_modules/@dprint/win32-arm64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.2.tgz", | ||
- "integrity": "sha512-K1EieTCFjfOCmyIhw9zFSduE6qVCNHEveupqZEfbSkVGw5T9MJQ1I9+n7MDb3RIDYEUk0enJ58/w82q8oDKCyA==", | ||
- "cpu": [ | ||
- "arm64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "win32" | ||
- ] | ||
- }, | ||
- "node_modules/@dprint/win32-x64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.2.tgz", | ||
- "integrity": "sha512-LhizWr8VrhHvq4ump8HwOERyFmdLiE8C6A42QSntGXzKdaa2nEOq20x/o56ZIiDcesiV+1TmosMKimPcOZHa+Q==", | ||
- "cpu": [ | ||
- "x64" | ||
- ], | ||
- "dev": true, | ||
- "optional": true, | ||
- "os": [ | ||
- "win32" | ||
- ] | ||
- }, | ||
"node_modules/@esbuild/aix-ppc64": { | ||
"version": "0.23.0", | ||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", | ||
@@ -2034,26 +1915,6 @@ | ||
"node": ">=8" | ||
} | ||
}, | ||
- "node_modules/dprint": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.2.tgz", | ||
- "integrity": "sha512-geUcVIIrmLaY+YtuOl4gD7J/QCjsXZa5gUqre9sO6cgH0X/Fa9heBN3l/AWVII6rKPw45ATuCSDWz1pyO+HkPQ==", | ||
- "dev": true, | ||
- "hasInstallScript": true, | ||
- "bin": { | ||
- "dprint": "bin.js" | ||
- }, | ||
- "optionalDependencies": { | ||
- "@dprint/darwin-arm64": "0.47.2", | ||
- "@dprint/darwin-x64": "0.47.2", | ||
- "@dprint/linux-arm64-glibc": "0.47.2", | ||
- "@dprint/linux-arm64-musl": "0.47.2", | ||
- "@dprint/linux-x64-glibc": "0.47.2", | ||
- "@dprint/linux-x64-musl": "0.47.2", | ||
- "@dprint/win32-arm64": "0.47.2", | ||
- "@dprint/win32-x64": "0.47.2" | ||
- } | ||
- }, | ||
"node_modules/eastasianwidth": { | ||
"version": "0.2.0", | ||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", | ||
@@ -4855,74 +4716,6 @@ | ||
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", | ||
"dev": true | ||
}, | ||
- "@dprint/darwin-arm64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.2.tgz", | ||
- "integrity": "sha512-mVPFBJsXxGDKHHCAY8wbqOyS4028g1bN15H9tivCnPAjwaZhkUimZHXWejXADjhGn+Xm2SlakugY9PY/68pH3Q==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/darwin-x64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.2.tgz", | ||
- "integrity": "sha512-T7wzlc+rBV+6BRRiBjoqoy5Hj4TR2Nv2p2s9+ycyPGs10Kj/JXOWD8dnEHeBgUr2r4qe/ZdcxmsFQ5Hf2n0WuA==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/formatter": { | ||
- "version": "0.4.1", | ||
- "resolved": "https://registry.npmjs.org/@dprint/formatter/-/formatter-0.4.1.tgz", | ||
- "integrity": "sha512-IB/GXdlMOvi0UhQQ9mcY15Fxcrc2JPadmo6tqefCNV0bptFq7YBpggzpqYXldBXDa04CbKJ+rDwO2eNRPE2+/g==", | ||
- "dev": true | ||
- }, | ||
- "@dprint/linux-arm64-glibc": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.2.tgz", | ||
- "integrity": "sha512-B0m1vT5LdVtrNOVdkqpLPrSxuCD+l5bTIgRzPaDoIB1ChWQkler9IlX8C+RStpujjPj6SYvwo5vTzjQSvRdQkA==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/linux-arm64-musl": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.2.tgz", | ||
- "integrity": "sha512-zID6wZZqpg2/Q2Us+ERQkbhLwlW3p3xaeEr00MPf49bpydmEjMiPuSjWPkNv+slQSIyIsVovOxF4lbNZjsdtvw==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/linux-x64-glibc": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.2.tgz", | ||
- "integrity": "sha512-rB3WXMdINnRd33DItIp7mObS7dzHW90ZzeJSsoKJLPp+Z7wXjjb27UUowfqVI4baa/1pd7sdbX54DPohMtfu/A==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/linux-x64-musl": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.2.tgz", | ||
- "integrity": "sha512-E0+TNbzYdTXJ/jCVjUctVxkda/faw++aDQLfyWGcmdMJnbM7NZz+W4fUpDXzMPsjy+zTWxXcPK7/q2DZz2gnbg==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/typescript": { | ||
- "version": "0.91.6", | ||
- "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.91.6.tgz", | ||
- "integrity": "sha512-rbgODMD0hsQJ6w32eMELqt+KnkzxVVLT4qRMcvlz8PsFwSPyIfBslpZcFhmJWdyurVKKNcUPNC6Aq9PcUIX13w==", | ||
- "dev": true | ||
- }, | ||
- "@dprint/win32-arm64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.2.tgz", | ||
- "integrity": "sha512-K1EieTCFjfOCmyIhw9zFSduE6qVCNHEveupqZEfbSkVGw5T9MJQ1I9+n7MDb3RIDYEUk0enJ58/w82q8oDKCyA==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
- "@dprint/win32-x64": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.2.tgz", | ||
- "integrity": "sha512-LhizWr8VrhHvq4ump8HwOERyFmdLiE8C6A42QSntGXzKdaa2nEOq20x/o56ZIiDcesiV+1TmosMKimPcOZHa+Q==", | ||
- "dev": true, | ||
- "optional": true | ||
- }, | ||
"@esbuild/aix-ppc64": { | ||
"version": "0.23.0", | ||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", | ||
@@ -6148,22 +5941,6 @@ | ||
"path-type": "^4.0.0" | ||
} | ||
}, | ||
- "dprint": { | ||
- "version": "0.47.2", | ||
- "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.2.tgz", | ||
- "integrity": "sha512-geUcVIIrmLaY+YtuOl4gD7J/QCjsXZa5gUqre9sO6cgH0X/Fa9heBN3l/AWVII6rKPw45ATuCSDWz1pyO+HkPQ==", | ||
- "dev": true, | ||
- "requires": { | ||
- "@dprint/darwin-arm64": "0.47.2", | ||
- "@dprint/darwin-x64": "0.47.2", | ||
- "@dprint/linux-arm64-glibc": "0.47.2", | ||
- "@dprint/linux-arm64-musl": "0.47.2", | ||
- "@dprint/linux-x64-glibc": "0.47.2", | ||
- "@dprint/linux-x64-musl": "0.47.2", | ||
- "@dprint/win32-arm64": "0.47.2", | ||
- "@dprint/win32-x64": "0.47.2" | ||
- } | ||
- }, | ||
"eastasianwidth": { | ||
"version": "0.2.0", | ||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", | ||
diff --git a/package.json b/package.json | ||
index 673cadfb05e..70c15434489 100644 | ||
--- a/package.json | ||
+++ b/package.json | ||
@@ -39,8 +39,6 @@ | ||
"!**/.gitattributes" | ||
], | ||
"devDependencies": { | ||
- "@dprint/formatter": "^0.4.1", | ||
- "@dprint/typescript": "0.91.6", | ||
"@esfx/canceltoken": "^1.0.0", | ||
"@eslint/js": "^9.9.0", | ||
"@octokit/rest": "^21.0.1", | ||
@@ -61,7 +59,6 @@ | ||
"chalk": "^4.1.2", | ||
"chokidar": "^3.6.0", | ||
"diff": "^5.2.0", | ||
- "dprint": "^0.47.2", | ||
"esbuild": "^0.23.0", | ||
"eslint": "^9.9.0", | ||
"eslint-formatter-autolinkable-stylish": "^1.4.0", | ||
@@ -99,7 +96,7 @@ | ||
"gulp": "hereby", | ||
"lint": "hereby lint", | ||
"knip": "hereby knip", | ||
- "format": "dprint fmt", | ||
+ "format": ":", | ||
"setup-hooks": "node scripts/link-hooks.mjs" | ||
}, | ||
"browser": { | ||
diff --git a/scripts/dtsBundler.mjs b/scripts/dtsBundler.mjs | ||
index ade134287fe..398aedf541a 100644 | ||
--- a/scripts/dtsBundler.mjs | ||
+++ b/scripts/dtsBundler.mjs | ||
@@ -5,8 +5,6 @@ | ||
* bundle as namespaces again, even though the project is modules. | ||
*/ | ||
|
||
-import * as dprintFormatter from "@dprint/formatter"; | ||
-import * as dprintTypeScript from "@dprint/typescript"; | ||
import assert, { fail } from "assert"; | ||
import fs from "fs"; | ||
import minimist from "minimist"; | ||
@@ -492,25 +490,5 @@ if (publicContents.includes("@internal")) { | ||
console.error("Output includes untrimmed @internal nodes!"); | ||
} | ||
|
||
-const buffer = fs.readFileSync(dprintTypeScript.getPath()); | ||
-const formatter = dprintFormatter.createFromBuffer(buffer); | ||
-formatter.setConfig({ | ||
- indentWidth: 4, | ||
- lineWidth: 1000, | ||
- newLineKind: "auto", | ||
- useTabs: false, | ||
-}, { | ||
- quoteStyle: "preferDouble", | ||
-}); | ||
- | ||
-/** | ||
- * @param {string} contents | ||
- * @returns {string} | ||
- */ | ||
-function dprint(contents) { | ||
- const result = formatter.formatText({ filePath: "dummy.d.ts", fileText: contents }); | ||
- return result.replace(/\r\n/g, "\n"); | ||
-} | ||
- | ||
-fs.writeFileSync(output, dprint(publicContents)); | ||
-fs.writeFileSync(internalOutput, dprint(internalContents)); | ||
+fs.writeFileSync(output, publicContents); | ||
+fs.writeFileSync(internalOutput, internalContents); | ||
-- | ||
2.47.0 | ||
|
Oops, something went wrong.