From 0e0470fb81f1799f2ed7b1df24f35096bf0db705 Mon Sep 17 00:00:00 2001 From: Ivan Demchenko Date: Mon, 6 Feb 2023 08:01:00 +0000 Subject: [PATCH 1/4] First draft of the language service plugin --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ .gitignore | 1 + .vscode/extensions.json | 5 +++-- CONTRIBUTING.md | 10 +++++++++- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..29ea431 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:0-18", + "features": { + "ghcr.io/devcontainers-contrib/features/pnpm:2": {} + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [3000], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "npm i -g turbo && pnpm install && git config --global core.editor 'code --wait'", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.gitignore b/.gitignore index 2efcf37..b697d6c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node_modules .pnp .pnp.js +.pnpm-store/ # testing coverage diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3ac9aeb..44e52ad 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "dbaeumer.vscode-eslint" - ] + "dbaeumer.vscode-eslint", + "ms-vscode-remote.remote-containers" + ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dae635d..0fbeb58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,14 @@ Your contributions will eventually help save countless hours for people struggli 1. Node.js version installed, [latest LTS is recommended](https://nodejs.org/en/about/releases/) 2. Install pnpm +### Using [devcontainer](https://code.visualstudio.com/docs/devcontainers/create-dev-container) + +Devcontainers is an easy way to avoid "works on my machine" situations. Essentially, the development happens in a Docker container. + +1. Make sure you've got Docker installed on your machine +2. Do install the recommended by VSCode extensions +3. Click "Reopen in Container" button in a popup + ## How to start developing? Clone the repo and install the needed dependencies for all the packages by following these steps: @@ -19,7 +27,7 @@ Clone the repo and install the needed dependencies for all the packages by follo ```sh git clone https://github.com/mattpocock/ts-error-translator.git cd ts-error-translator -pnpm +pnpm install pnpm dev # This will run the next app ``` From 7fa3534e89ddcd423edb826f1c36758921558455 Mon Sep 17 00:00:00 2001 From: Ivan Demchenko Date: Mon, 6 Feb 2023 20:46:48 +0000 Subject: [PATCH 2/4] Set up the plugin --- .vscode/settings.json | 3 +- packages/language-service-plugin/CHANGELOG.md | 0 packages/language-service-plugin/README.MD | 11 ++ .../example/.vscode/settings.json | 4 + .../language-service-plugin/example/index.ts | 9 ++ .../example/package.json | 8 ++ .../example/tsconfig.json | 7 ++ packages/language-service-plugin/package.json | 16 +++ packages/language-service-plugin/src/index.ts | 32 +++++ .../language-service-plugin/tsconfig.json | 19 +++ pnpm-lock.yaml | 118 +++++++++++------- pnpm-workspace.yaml | 1 + 12 files changed, 179 insertions(+), 49 deletions(-) create mode 100644 packages/language-service-plugin/CHANGELOG.md create mode 100644 packages/language-service-plugin/README.MD create mode 100644 packages/language-service-plugin/example/.vscode/settings.json create mode 100644 packages/language-service-plugin/example/index.ts create mode 100644 packages/language-service-plugin/example/package.json create mode 100644 packages/language-service-plugin/example/tsconfig.json create mode 100644 packages/language-service-plugin/package.json create mode 100644 packages/language-service-plugin/src/index.ts create mode 100644 packages/language-service-plugin/tsconfig.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 30bf8c2..d6b96bc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "out": true // set this to false to include "out" folder in search results }, // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off" + "typescript.tsc.autoDetect": "off", + "typescript.tsserver.log": "normal" } \ No newline at end of file diff --git a/packages/language-service-plugin/CHANGELOG.md b/packages/language-service-plugin/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/language-service-plugin/README.MD b/packages/language-service-plugin/README.MD new file mode 100644 index 0000000..1381a66 --- /dev/null +++ b/packages/language-service-plugin/README.MD @@ -0,0 +1,11 @@ +# Language Service Plugin + +[Reference](https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin) + +To test this plugin out, compile the code and open the `example` folder in a VSCode instance: + +``` +code ./example +``` + +Also, please, make sure the workspace version of TypeScript is used. Use the `TypeScript: Select TypeScript version` command for this. diff --git a/packages/language-service-plugin/example/.vscode/settings.json b/packages/language-service-plugin/example/.vscode/settings.json new file mode 100644 index 0000000..faee71a --- /dev/null +++ b/packages/language-service-plugin/example/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsserver.log": "normal", + "typescript.tsdk": "node_modules/typescript/lib" +} \ No newline at end of file diff --git a/packages/language-service-plugin/example/index.ts b/packages/language-service-plugin/example/index.ts new file mode 100644 index 0000000..98cefcb --- /dev/null +++ b/packages/language-service-plugin/example/index.ts @@ -0,0 +1,9 @@ +let a; + +export function A(b: number): number { + if (true) { + return 1; + } { + 3; + } +} \ No newline at end of file diff --git a/packages/language-service-plugin/example/package.json b/packages/language-service-plugin/example/package.json new file mode 100644 index 0000000..a26badb --- /dev/null +++ b/packages/language-service-plugin/example/package.json @@ -0,0 +1,8 @@ +{ + "name": "@total-typescript/language-service-plugin-example", + "version": "0.1.0", + "dependencies": { + "ts-error-translator-tssplugin": "file:..", + "typescript": "^4.8.3" + } +} diff --git a/packages/language-service-plugin/example/tsconfig.json b/packages/language-service-plugin/example/tsconfig.json new file mode 100644 index 0000000..1fd32df --- /dev/null +++ b/packages/language-service-plugin/example/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "plugins": [{ + "name": "ts-error-translator-tssplugin" + }] + } +} \ No newline at end of file diff --git a/packages/language-service-plugin/package.json b/packages/language-service-plugin/package.json new file mode 100644 index 0000000..4db30d3 --- /dev/null +++ b/packages/language-service-plugin/package.json @@ -0,0 +1,16 @@ +{ + "name": "ts-error-translator-tssplugin", + "version": "0.1.0", + "license": "MIT", + "main": "./out/index.js", + "private": true, + "files": ["./out/**"], + "scripts": { + "dev": "tsc --watch", + "build": "tsc" + }, + "devDependencies": { + "tsconfig": "workspace:*", + "typescript": "^4.5.3" + } +} diff --git a/packages/language-service-plugin/src/index.ts b/packages/language-service-plugin/src/index.ts new file mode 100644 index 0000000..cbca70f --- /dev/null +++ b/packages/language-service-plugin/src/index.ts @@ -0,0 +1,32 @@ +function init(modules: { typescript: typeof import("typescript/lib/tsserverlibrary") }) { + const ts = modules.typescript; + + function enrichDiagnostic(diagnostic: ts.Diagnostic): ts.Diagnostic { + // diagnostic.code: number + // diagnostic.category === ts.DiagnosticCategory (Error, Message, Suggestion, Warning) + diagnostic.messageText = `${diagnostic.messageText}\n\nHello from plugin!\n` + return diagnostic; + } + + function create(info: ts.server.PluginCreateInfo) { + // Set up decorator object + const proxy: ts.LanguageService = Object.create(null); + + for (let k of Object.keys(info.languageService) as Array) { + const x = info.languageService[k]!; + // @ts-expect-error - JS runtime trickery which is tricky to type tersely + proxy[k] = (...args: Array<{}>) => x.apply(info.languageService, args); + } + + proxy.getSemanticDiagnostics = (filename) => { + return info.languageService.getSemanticDiagnostics(filename).map(enrichDiagnostic); + } + + return proxy; + } + + return { create }; + +} + +export = init; \ No newline at end of file diff --git a/packages/language-service-plugin/tsconfig.json b/packages/language-service-plugin/tsconfig.json new file mode 100644 index 0000000..fa85a06 --- /dev/null +++ b/packages/language-service-plugin/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "tsconfig/base.json", + "compilerOptions": { + "module": "commonjs", + "target": "ES2019", + "outDir": "./out", + "rootDir": "src", + "strict": true, + "declaration": true, + "sourceMap": true, + "skipLibCheck": true + }, + "include": [ + "src" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32c5e92..46cd6b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,7 +92,7 @@ importers: dependencies: '@types/lz-string': 1.3.34 lz-string: 1.4.4 - next: 13.0.7_sfoxds7t5ydpegc3knd667wn6m + next: 13.1.6_sfoxds7t5ydpegc3knd667wn6m react: 17.0.2 react-dom: 17.0.2_react@17.0.2 react-markdown: 8.0.3_pxzommwrsowkd4kgag6q3sluym @@ -143,6 +143,22 @@ importers: typescript: 4.8.3 vitest: 0.10.5 + packages/language-service-plugin: + specifiers: + tsconfig: workspace:* + typescript: ^4.5.3 + devDependencies: + tsconfig: link:../tsconfig + typescript: 4.8.3 + + packages/language-service-plugin/example: + specifiers: + ts-error-translator-tssplugin: file:.. + typescript: ^4.8.3 + dependencies: + ts-error-translator-tssplugin: file:packages/language-service-plugin + typescript: 4.8.3 + packages/parser: specifiers: '@babel/core': ^7.19.1 @@ -767,8 +783,8 @@ packages: read-yaml-file: 1.1.0 dev: false - /@next/env/13.0.7: - resolution: {integrity: sha512-ZBclBRB7DbkSswXgbJ+muF5RxfgmAuQKAWL8tcm86aZmoiL1ZainxQK0hMcMYdh+IYG8UObAKV2wKB5O+6P4ng==} + /@next/env/13.1.6: + resolution: {integrity: sha512-s+W9Fdqh5MFk6ECrbnVmmAOwxKQuhGMT7xXHrkYIBMBcTiOqNWhv5KbJIboKR5STXxNXl32hllnvKaffzFaWQg==} dev: false /@next/eslint-plugin-next/12.3.0: @@ -777,8 +793,8 @@ packages: glob: 7.1.7 dev: false - /@next/swc-android-arm-eabi/13.0.7: - resolution: {integrity: sha512-QTEamOK/LCwBf05GZ261rULMbZEpE3TYdjHlXfznV+nXwTztzkBNFXwP67gv2wW44BROzgi/vrR9H8oP+J5jxg==} + /@next/swc-android-arm-eabi/13.1.6: + resolution: {integrity: sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==} engines: {node: '>= 10'} cpu: [arm] os: [android] @@ -786,8 +802,8 @@ packages: dev: false optional: true - /@next/swc-android-arm64/13.0.7: - resolution: {integrity: sha512-wcy2H0Tl9ME8vKy2GnJZ7Mybwys+43F/Eh2Pvph7mSDpMbYBJ6iA0zeY62iYYXxlZhnAID3+h79FUqUEakkClw==} + /@next/swc-android-arm64/13.1.6: + resolution: {integrity: sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==} engines: {node: '>= 10'} cpu: [arm64] os: [android] @@ -795,8 +811,8 @@ packages: dev: false optional: true - /@next/swc-darwin-arm64/13.0.7: - resolution: {integrity: sha512-F/mU7csN1/J2cqXJPMgTQ6MwAbc1pJ6sp6W+X0z5JEY4IFDzxKd3wRc3pCiNF7j8xW381JlNpWxhjCctnNmfaw==} + /@next/swc-darwin-arm64/13.1.6: + resolution: {integrity: sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -804,8 +820,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64/13.0.7: - resolution: {integrity: sha512-636AuRQynCPnIPRVzcCk5B7OMq9XjaYam2T0HeWUCE6y7EqEO3kxiuZ4QmN81T7A6Ydb+JnivYrLelHXmgdj6A==} + /@next/swc-darwin-x64/13.1.6: + resolution: {integrity: sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -813,8 +829,8 @@ packages: dev: false optional: true - /@next/swc-freebsd-x64/13.0.7: - resolution: {integrity: sha512-92XAMzNgQazowZ9t7uZmHRA5VdBl/SwEdrf5UybdfRovsxB4r3+yJWEvFaqYpSEp0gwndbwLokJdpz7OwFdL3Q==} + /@next/swc-freebsd-x64/13.1.6: + resolution: {integrity: sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] @@ -822,8 +838,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm-gnueabihf/13.0.7: - resolution: {integrity: sha512-3r1CWl5P6I5n5Yxip8EXv/Rfu2Cp6wVmIOpvmczyUR82j+bcMkwPAcUjNkG/vMCagS4xV7NElrcdGb39iFmfLg==} + /@next/swc-linux-arm-gnueabihf/13.1.6: + resolution: {integrity: sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] @@ -831,8 +847,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu/13.0.7: - resolution: {integrity: sha512-RXo8tt6ppiwyS6hpDw3JdAjKcdVewsefxnxk9xOH4mRhMyq9V2lQx0e24X/dRiZqkx3jnWReR2WRrUlgN1UkSQ==} + /@next/swc-linux-arm64-gnu/13.1.6: + resolution: {integrity: sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -840,8 +856,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl/13.0.7: - resolution: {integrity: sha512-RWpnW+bmfXyxyY7iARbueYDGuIF+BEp3etLeYh/RUNHb9PhOHLDgJOG8haGSykud3a6CcyBI8hEjqOhoObaDpw==} + /@next/swc-linux-arm64-musl/13.1.6: + resolution: {integrity: sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -849,8 +865,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu/13.0.7: - resolution: {integrity: sha512-/ygUIiMMTYnbKlFs5Ba9J5k/tNxFWy8eI1bBF8UuMTvV8QJHl/aLDiA5dwsei2kk99/cu3eay62JnJXkSk3RSQ==} + /@next/swc-linux-x64-gnu/13.1.6: + resolution: {integrity: sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -858,8 +874,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl/13.0.7: - resolution: {integrity: sha512-dLzr6AL77USJN0ejgx5AS8O8SbFlbYTzs0XwAWag4oQpUG2p3ARvxwQgYQ0Z+6EP0zIRZ/XfLkN/mhsyi3m4PA==} + /@next/swc-linux-x64-musl/13.1.6: + resolution: {integrity: sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -867,8 +883,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc/13.0.7: - resolution: {integrity: sha512-+vFIVa82AwqFkpFClKT+n73fGxrhAZ2u1u3mDYEBdxO6c9U4Pj3S5tZFsGFK9kLT/bFvf/eeVOICSLCC7MSgJQ==} + /@next/swc-win32-arm64-msvc/13.1.6: + resolution: {integrity: sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -876,8 +892,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc/13.0.7: - resolution: {integrity: sha512-RNLXIhp+assD39dQY9oHhDxw+/qSJRARKhOFsHfOtf8yEfCHqcKkn3X/L+ih60ntaEqK294y1WkMk6ylotsxwA==} + /@next/swc-win32-ia32-msvc/13.1.6: + resolution: {integrity: sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -885,8 +901,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc/13.0.7: - resolution: {integrity: sha512-kvdnlLcrnEq72ZP0lqe2Z5NqvB9N5uSCvtXJ0PhKvNncWWd0fEG9Ec9erXgwCmVlM2ytw41k9/uuQ+SVw4Pihw==} + /@next/swc-win32-x64-msvc/13.1.6: + resolution: {integrity: sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -4337,8 +4353,8 @@ packages: escalade: 3.1.1 dev: true - /next/13.0.7_sfoxds7t5ydpegc3knd667wn6m: - resolution: {integrity: sha512-YfTifqX9vfHm+rSU/H/3xvzOHDkYuMuh4wsvTjiqj9h7qHEF7KHB66X4qrH96Po+ohdid4JY8YVGPziDwdXL0A==} + /next/13.1.6_sfoxds7t5ydpegc3knd667wn6m: + resolution: {integrity: sha512-hHlbhKPj9pW+Cymvfzc15lvhaOZ54l+8sXDXJWm3OBNBzgrVj6hwGPmqqsXg40xO1Leq+kXpllzRPuncpC0Phw==} engines: {node: '>=14.6.0'} hasBin: true peerDependencies: @@ -4355,27 +4371,27 @@ packages: sass: optional: true dependencies: - '@next/env': 13.0.7 + '@next/env': 13.1.6 '@swc/helpers': 0.4.14 caniuse-lite: 1.0.30001435 postcss: 8.4.14 react: 17.0.2 react-dom: 17.0.2_react@17.0.2 - styled-jsx: 5.1.0_react@17.0.2 + styled-jsx: 5.1.1_react@17.0.2 optionalDependencies: - '@next/swc-android-arm-eabi': 13.0.7 - '@next/swc-android-arm64': 13.0.7 - '@next/swc-darwin-arm64': 13.0.7 - '@next/swc-darwin-x64': 13.0.7 - '@next/swc-freebsd-x64': 13.0.7 - '@next/swc-linux-arm-gnueabihf': 13.0.7 - '@next/swc-linux-arm64-gnu': 13.0.7 - '@next/swc-linux-arm64-musl': 13.0.7 - '@next/swc-linux-x64-gnu': 13.0.7 - '@next/swc-linux-x64-musl': 13.0.7 - '@next/swc-win32-arm64-msvc': 13.0.7 - '@next/swc-win32-ia32-msvc': 13.0.7 - '@next/swc-win32-x64-msvc': 13.0.7 + '@next/swc-android-arm-eabi': 13.1.6 + '@next/swc-android-arm64': 13.1.6 + '@next/swc-darwin-arm64': 13.1.6 + '@next/swc-darwin-x64': 13.1.6 + '@next/swc-freebsd-x64': 13.1.6 + '@next/swc-linux-arm-gnueabihf': 13.1.6 + '@next/swc-linux-arm64-gnu': 13.1.6 + '@next/swc-linux-arm64-musl': 13.1.6 + '@next/swc-linux-x64-gnu': 13.1.6 + '@next/swc-linux-x64-musl': 13.1.6 + '@next/swc-win32-arm64-msvc': 13.1.6 + '@next/swc-win32-ia32-msvc': 13.1.6 + '@next/swc-win32-x64-msvc': 13.1.6 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -5405,8 +5421,8 @@ packages: inline-style-parser: 0.1.1 dev: false - /styled-jsx/5.1.0_react@17.0.2: - resolution: {integrity: sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==} + /styled-jsx/5.1.1_react@17.0.2: + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: '@babel/core': '*' @@ -6217,3 +6233,9 @@ packages: /zod/3.19.1: resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} dev: false + + file:packages/language-service-plugin: + resolution: {directory: packages/language-service-plugin, type: directory} + name: ts-error-translator-tssplugin + version: 0.1.0 + dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4e708bd..0162815 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - 'packages/*' + - 'packages/language-service-plugin/*' - 'apps/*' From 128b67d436ce08ee7f4cd0ee0490e825fe889431 Mon Sep 17 00:00:00 2001 From: Ivan Demchenko Date: Tue, 7 Feb 2023 17:21:52 +0000 Subject: [PATCH 3/4] build engine to be used with the plugin --- packages/engine/package.json | 7 ++++--- packages/engine/tsconfig.json | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/engine/package.json b/packages/engine/package.json index d82bb79..f26e2be 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -2,11 +2,12 @@ "name": "@total-typescript/error-translation-engine", "version": "1.0.3", "license": "MIT", - "main": "./src/index.ts", - "types": "./src/index.ts", + "main": "./out/index.js", + "types": "./out/index.d.ts", "private": true, "scripts": { - "test": "vitest run" + "test": "vitest run", + "build": "tsc" }, "dependencies": { "front-matter": "^4.0.2" diff --git a/packages/engine/tsconfig.json b/packages/engine/tsconfig.json index 6fe3d8e..4d7534f 100644 --- a/packages/engine/tsconfig.json +++ b/packages/engine/tsconfig.json @@ -1,9 +1,13 @@ { "extends": "tsconfig/base.json", + "compilerOptions": { + "outDir": "out" + }, "include": [ "src" ], "exclude": [ - "node_modules" + "node_modules", + "src/__tests__" ] } \ No newline at end of file From fc27b02938f6c057cf40dcccac760eda42a9a8fe Mon Sep 17 00:00:00 2001 From: Ivan Demchenko Date: Tue, 7 Feb 2023 17:22:26 +0000 Subject: [PATCH 4/4] package the plugin for distribution --- .../language-service-plugin/example/index.ts | 26 ++- .../example/package.json | 2 +- packages/language-service-plugin/package.json | 14 +- .../language-service-plugin/rollup.config.mjs | 21 ++ packages/language-service-plugin/src/index.ts | 31 ++- .../language-service-plugin/tsconfig.json | 11 +- pnpm-lock.yaml | 182 +++++++++++++++++- turbo.json | 4 +- 8 files changed, 267 insertions(+), 24 deletions(-) create mode 100644 packages/language-service-plugin/rollup.config.mjs diff --git a/packages/language-service-plugin/example/index.ts b/packages/language-service-plugin/example/index.ts index 98cefcb..554275b 100644 --- a/packages/language-service-plugin/example/index.ts +++ b/packages/language-service-plugin/example/index.ts @@ -1,9 +1,19 @@ -let a; - export function A(b: number): number { - if (true) { - return 1; - } { - 3; - } -} \ No newline at end of file + return b; +} +A("test") + + +let a: { m: number[] }; +let b = { m: [""] }; +a = b; + +// Extra Properties + +type A = { m: number }; +const w: A = { m: 10, n: "" }; + +// Union Assignments + +type Thing = "none" | { name: string }; +const e: Thing = { name: 0 }; \ No newline at end of file diff --git a/packages/language-service-plugin/example/package.json b/packages/language-service-plugin/example/package.json index a26badb..4cf9be7 100644 --- a/packages/language-service-plugin/example/package.json +++ b/packages/language-service-plugin/example/package.json @@ -3,6 +3,6 @@ "version": "0.1.0", "dependencies": { "ts-error-translator-tssplugin": "file:..", - "typescript": "^4.8.3" + "typescript": "^4.5.3" } } diff --git a/packages/language-service-plugin/package.json b/packages/language-service-plugin/package.json index 4db30d3..56ee26d 100644 --- a/packages/language-service-plugin/package.json +++ b/packages/language-service-plugin/package.json @@ -4,13 +4,23 @@ "license": "MIT", "main": "./out/index.js", "private": true, - "files": ["./out/**"], + "files": [ + "./out/**" + ], "scripts": { "dev": "tsc --watch", - "build": "tsc" + "build": "rollup -c rollup.config.mjs" }, "devDependencies": { + "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-typescript": "^11.0.0", + "rollup": "^3.14.0", "tsconfig": "workspace:*", "typescript": "^4.5.3" + }, + "dependencies": { + "@total-typescript/error-translation-engine": "workspace:*" } } diff --git a/packages/language-service-plugin/rollup.config.mjs b/packages/language-service-plugin/rollup.config.mjs new file mode 100644 index 0000000..c6ca8bd --- /dev/null +++ b/packages/language-service-plugin/rollup.config.mjs @@ -0,0 +1,21 @@ +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import typescript from '@rollup/plugin-typescript'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; + +export default { + input: 'src/index.ts', + output: { + file: 'out/index.js', + sourcemap: true, + format: 'cjs' + }, + plugins: [ + nodeResolve({ + extensions: ['.mjs', '.js', '.json', '.node', '.ts'] + }), + commonjs({ extensions: ['.js', '.ts'] }), + typescript(), + json() + ] +}; \ No newline at end of file diff --git a/packages/language-service-plugin/src/index.ts b/packages/language-service-plugin/src/index.ts index cbca70f..5e70762 100644 --- a/packages/language-service-plugin/src/index.ts +++ b/packages/language-service-plugin/src/index.ts @@ -1,10 +1,31 @@ -function init(modules: { typescript: typeof import("typescript/lib/tsserverlibrary") }) { +import { parseErrors } from '@total-typescript/error-translation-engine'; + +export default function init(modules: { typescript: typeof import("typescript/lib/tsserverlibrary") }) { const ts = modules.typescript; + function withParsedError(messageText: string): string { + const parsed = parseErrors(messageText); + const allMessages = parsed.map(err => err.error).join('\n\n'); + return `${messageText}\n\nIn other words,\n${allMessages}\n`; + } + function enrichDiagnostic(diagnostic: ts.Diagnostic): ts.Diagnostic { - // diagnostic.code: number - // diagnostic.category === ts.DiagnosticCategory (Error, Message, Suggestion, Warning) - diagnostic.messageText = `${diagnostic.messageText}\n\nHello from plugin!\n` + if (typeof diagnostic.messageText === 'string') { + diagnostic.messageText = withParsedError(diagnostic.messageText); + return diagnostic; + } + if (diagnostic.messageText.category === ts.DiagnosticCategory.Error) { + const msg = withParsedError(diagnostic.messageText.messageText); + diagnostic.messageText.messageText = msg; + + const nextMesgs = diagnostic.messageText.next; + if (nextMesgs) { + for (let i = 0; i < nextMesgs.length; i++) { + let nextMsg = nextMesgs[i]; + nextMesgs[i].messageText = withParsedError(nextMsg.messageText); + } + } + } return diagnostic; } @@ -29,4 +50,4 @@ function init(modules: { typescript: typeof import("typescript/lib/tsserverlibra } -export = init; \ No newline at end of file +// export = init; \ No newline at end of file diff --git a/packages/language-service-plugin/tsconfig.json b/packages/language-service-plugin/tsconfig.json index fa85a06..21ea21c 100644 --- a/packages/language-service-plugin/tsconfig.json +++ b/packages/language-service-plugin/tsconfig.json @@ -1,19 +1,18 @@ { "extends": "tsconfig/base.json", "compilerOptions": { - "module": "commonjs", - "target": "ES2019", + "module": "ESNext", + "target": "ESNext", "outDir": "./out", "rootDir": "src", "strict": true, "declaration": true, - "sourceMap": true, - "skipLibCheck": true + "sourceMap": true }, "include": [ - "src" + "src/**/*" ], "exclude": [ - "node_modules" + "node_modules", "out" ] } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46cd6b4..3143bcc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -145,16 +145,29 @@ importers: packages/language-service-plugin: specifiers: + '@rollup/plugin-commonjs': ^24.0.1 + '@rollup/plugin-json': ^6.0.0 + '@rollup/plugin-node-resolve': ^15.0.1 + '@rollup/plugin-typescript': ^11.0.0 + '@total-typescript/error-translation-engine': workspace:* + rollup: ^3.14.0 tsconfig: workspace:* typescript: ^4.5.3 + dependencies: + '@total-typescript/error-translation-engine': link:../engine devDependencies: + '@rollup/plugin-commonjs': 24.0.1_rollup@3.14.0 + '@rollup/plugin-json': 6.0.0_rollup@3.14.0 + '@rollup/plugin-node-resolve': 15.0.1_rollup@3.14.0 + '@rollup/plugin-typescript': 11.0.0_walnrepgnsnjste2p4nf5mbxja + rollup: 3.14.0 tsconfig: link:../tsconfig typescript: 4.8.3 packages/language-service-plugin/example: specifiers: ts-error-translator-tssplugin: file:.. - typescript: ^4.8.3 + typescript: ^4.5.3 dependencies: ts-error-translator-tssplugin: file:packages/language-service-plugin typescript: 4.8.3 @@ -928,6 +941,89 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.13.0 + /@rollup/plugin-commonjs/24.0.1_rollup@3.14.0: + resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.68.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.14.0 + commondir: 1.0.1 + estree-walker: 2.0.2 + glob: 8.1.0 + is-reference: 1.2.1 + magic-string: 0.27.0 + rollup: 3.14.0 + dev: true + + /@rollup/plugin-json/6.0.0_rollup@3.14.0: + resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.14.0 + rollup: 3.14.0 + dev: true + + /@rollup/plugin-node-resolve/15.0.1_rollup@3.14.0: + resolution: {integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.14.0 + '@types/resolve': 1.20.2 + deepmerge: 4.3.0 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.1 + rollup: 3.14.0 + dev: true + + /@rollup/plugin-typescript/11.0.0_walnrepgnsnjste2p4nf5mbxja: + resolution: {integrity: sha512-goPyCWBiimk1iJgSTgsehFD5OOFHiAknrRJjqFCudcW8JtWiBlK284Xnn4flqMqg6YAjVG/EE+3aVzrL5qNSzQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.14.0||^3.0.0 + tslib: '*' + typescript: '>=3.7.0' + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.14.0 + resolve: 1.22.1 + rollup: 3.14.0 + typescript: 4.8.3 + dev: true + + /@rollup/pluginutils/5.0.2_rollup@3.14.0: + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.0 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.14.0 + dev: true + /@rushstack/eslint-patch/1.2.0: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: false @@ -993,6 +1089,10 @@ packages: '@types/ms': 0.7.31 dev: false + /@types/estree/1.0.0: + resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} + dev: true + /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: @@ -1092,6 +1192,10 @@ packages: '@types/scheduler': 0.16.2 csstype: 3.1.1 + /@types/resolve/1.20.2: + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + dev: true + /@types/scheduler/0.16.2: resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} @@ -1548,6 +1652,12 @@ packages: balanced-match: 1.0.2 concat-map: 0.0.1 + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -1584,6 +1694,11 @@ packages: engines: {node: '>=0.2.0'} dev: true + /builtin-modules/3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + /bytes/3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -1782,6 +1897,10 @@ packages: engines: {node: ^12.20.0 || >=14} dev: true + /commondir/1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: true + /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} @@ -1959,6 +2078,11 @@ packages: /deep-is/0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + /deepmerge/4.3.0: + resolution: {integrity: sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==} + engines: {node: '>=0.10.0'} + dev: true + /defaults/1.0.3: resolution: {integrity: sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==} dependencies: @@ -2976,6 +3100,10 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + /estree-walker/2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -3301,6 +3429,17 @@ packages: once: 1.4.0 path-is-absolute: 1.0.1 + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: true + /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -3521,6 +3660,13 @@ packages: engines: {node: '>=4'} dev: false + /is-builtin-module/3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + /is-callable/1.2.6: resolution: {integrity: sha512-krO72EO2NptOGAX2KYyqbP9vYMlNAXdB53rq6f8LXY6RY7JdSR/3BD6wLUlPHSAesmY9vstNrjvqGaCiRK/91Q==} engines: {node: '>= 0.4'} @@ -3564,6 +3710,10 @@ packages: dependencies: is-extglob: 2.1.1 + /is-module/1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + dev: true + /is-negative-zero/2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -3595,6 +3745,12 @@ packages: engines: {node: '>=12'} dev: false + /is-reference/1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + dependencies: + '@types/estree': 1.0.0 + dev: true + /is-regex/1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -3912,6 +4068,13 @@ packages: hasBin: true dev: false + /magic-string/0.27.0: + resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + /make-error/1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -4244,6 +4407,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch/5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -5091,6 +5261,14 @@ packages: fsevents: 2.3.2 dev: true + /rollup/3.14.0: + resolution: {integrity: sha512-o23sdgCLcLSe3zIplT9nQ1+r97okuaiR+vmAPZPTDYB7/f3tgWIYNyiQveMsZwshBT0is4eGax/HH83Q7CG+/Q==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -6238,4 +6416,6 @@ packages: resolution: {directory: packages/language-service-plugin, type: directory} name: ts-error-translator-tssplugin version: 0.1.0 + dependencies: + '@total-typescript/error-translation-engine': link:packages/engine dev: false diff --git a/turbo.json b/turbo.json index 335a6ba..01ea7a9 100644 --- a/turbo.json +++ b/turbo.json @@ -1,11 +1,13 @@ { + "$schema": "https://turbo.build/schema.json", "pipeline": { "vscode:build": { "dependsOn": ["bundle-errors"], "cache": false }, "build": { - "cache": false + "cache": false, + "dependsOn": ["^build"] }, "lint": { "outputs": []