diff --git a/apps/vscode/package.json b/apps/vscode/package.json index ba2c724..07f6615 100644 --- a/apps/vscode/package.json +++ b/apps/vscode/package.json @@ -68,10 +68,17 @@ "publish:ovsx": "npx ovsx publish --no-dependencies $(find . -iname *.vsix)" }, "dependencies": { - "front-matter": "^4.0.2" + "front-matter": "^4.0.2", + "lz-string": "^1.5.0", + "prettier": "^2.8.8", + "ts-dedent": "^2.2.0", + "vscode-languageserver-types": "^3.17.3", + "vscode-uri": "^3.0.7" }, "devDependencies": { + "@types/prettier": "^2.7.3", "@total-typescript/error-translation-engine": "workspace:*", + "@total-typescript/tips-parser": "workspace:*", "@types/glob": "^7.2.0", "@types/mocha": "^9.1.0", "@types/node": "14.x", @@ -84,7 +91,6 @@ "eslint": "^8.46.0", "glob": "^7.2.0", "mocha": "^9.2.2", - "typescript": "^5.1.6", - "@total-typescript/tips-parser": "workspace:*" + "typescript": "^5.1.6" } } diff --git a/apps/vscode/src/bundleErrors.json b/apps/vscode/src/bundleErrors.json index 5cad420..0e1a1fe 100644 --- a/apps/vscode/src/bundleErrors.json +++ b/apps/vscode/src/bundleErrors.json @@ -48,7 +48,7 @@ "code": "1313" }, "2304": { - "body": "I can't find the variable you're trying to access.\n", + "body": "I can't find the variable you're trying to access, '{0}', in the current scope.\n\n\n", "code": "2304" }, "2307": { @@ -60,7 +60,7 @@ "code": "2314" }, "2322": { - "body": "I was expecting a type matching A, but instead you passed B.\n", + "body": "I was expecting a type matching '{1}' but instead you passed '{0}'.\n", "code": "2322" }, "2324": { @@ -135,6 +135,10 @@ "body": "You've created a union type that's too complex for me to handle! 🤯 I can only represent 100,000 combinations in the same union, and you've gone over that limit.\n", "code": "2590" }, + "2739": { + "body": "Type '{0}' is missing the following properties from type '{1}': {2}", + "code": "2739" + }, "2741": { "body": "You haven't passed all the required properties to '{2}' - '{1}' is missing the '{0}' property\n", "code": "2741" diff --git a/apps/vscode/src/components/codeBlock.ts b/apps/vscode/src/components/codeBlock.ts new file mode 100644 index 0000000..4374a3d --- /dev/null +++ b/apps/vscode/src/components/codeBlock.ts @@ -0,0 +1,42 @@ +import { d } from "../utils"; +import { miniLine } from "./miniLine"; +import { spanBreak } from "./spanBreak"; + +/** + * @returns markdown string that will be rendered as a code block (`supportHtml` required) + * We're using codicon here since it's the only thing that can be `inline-block` + * and have a background color in hovers due to strict sanitization of markdown on + * VSCode [code](https://github.com/microsoft/vscode/blob/735aff6d962db49423e02c2344e60d418273ae39/src/vs/base/browser/markdownRenderer.ts#L372) + */ +const codeBlock = (code: string, language: string) => + spanBreak(d/*html*/ ` + + + \`\`\`${language} + ${code} + \`\`\` + + +`); + +export const inlineCodeBlock = (code: string, language: string) => + codeBlock(` ${code} `, language); + +export const multiLineCodeBlock = (code: string, language: string) => { + const codeLines = code.split("\n"); + //this line is finding the longest line + const maxLineChars = codeLines.reduce( + (acc, curr) => (curr.length > acc ? curr.length : acc), + 0 + ); + // codicon class align the code to the center, so we must pad it with spaces + const paddedCode = codeLines + .map((line) => line.padEnd(maxLineChars + 2)) + .join("\n"); + + return d/*html*/ ` + ${miniLine} + ${codeBlock(paddedCode, language)} + ${miniLine} + `; +}; diff --git a/apps/vscode/src/components/consts/knownErrorNumbers.ts b/apps/vscode/src/components/consts/knownErrorNumbers.ts new file mode 100644 index 0000000..539d1cf --- /dev/null +++ b/apps/vscode/src/components/consts/knownErrorNumbers.ts @@ -0,0 +1,31 @@ +import { Diagnostic } from "vscode-languageserver-types"; + +/** Should be updated from: + * https://typescript.tv/errors + * Just run this in the console: + * ```javascript + * $$('h2') + * .filter(node => node.textContent.match(/TS[0-9]{1,5}/)) + * .map(node => Number(node.textContent.match(/TS([0-9]+)/)[1])) + * ``` + */ +export const KNOWN_ERROR_NUMBERS: Set = new Set([ + 1002, 1005, 1006, 1015, 1016, 1029, 1036, 1038, 1039, 1046, 1055, 1056, 1064, + 1066, 1068, 1070, 1095, 1103, 1109, 1117, 1127, 1128, 1149, 1155, 1160, 1183, + 1192, 1196, 1202, 1208, 1218, 1219, 1225, 1228, 1243, 1244, 1254, 1259, 1308, + 1337, 1357, 1361, 1363, 1371, 1375, 1378, 1385, 1389, 1431, 1432, 1434, 1471, + 2300, 2304, 2305, 2306, 2307, 2314, 2315, 2322, 2335, 2339, 2344, 2345, 2348, + 2349, 2351, 2352, 2355, 2361, 2362, 2364, 2365, 2366, 2367, 2368, 2369, 2370, + 2371, 2372, 2377, 2378, 2390, 2391, 2394, 2395, 2403, 2411, 2420, 2428, 2430, + 2440, 2445, 2448, 2451, 2454, 2456, 2459, 2475, 2476, 2488, 2497, 2503, 2507, + 2511, 2512, 2515, 2528, 2531, 2532, 2533, 2538, 2550, 2551, 2552, 2554, 2556, + 2558, 2559, 2564, 2567, 2571, 2574, 2577, 2580, 2582, 2583, 2584, 2588, 2595, + 2611, 2613, 2616, 2652, 2654, 2656, 2661, 2663, 2664, 2665, 2668, 2669, 2677, + 2678, 2680, 2683, 2684, 2686, 2687, 2689, 2691, 2693, 2694, 2695, 2706, 2709, + 2715, 2717, 2720, 2722, 2724, 2730, 2732, 2739, 2740, 2741, 2742, 2749, 2769, + 2774, 2779, 2786, 2792, 2794, 2813, 2814, 4020, 4025, 4060, 4063, 4075, 4081, + 4104, 4112, 4113, 4114, 5023, 5024, 5025, 5054, 5055, 5058, 5069, 5070, 5083, + 5087, 5101, 6053, 6059, 6133, 6138, 6196, 6198, 6504, 7006, 7008, 7009, 7010, + 7016, 7017, 7022, 7023, 7026, 7027, 7030, 7031, 7034, 7041, 7044, 7053, 8020, + 17000, 17004, 17009, 18004, 18016, 80005, +]); diff --git a/apps/vscode/src/components/index.ts b/apps/vscode/src/components/index.ts new file mode 100644 index 0000000..66aec08 --- /dev/null +++ b/apps/vscode/src/components/index.ts @@ -0,0 +1,4 @@ +export * from "./codeBlock"; +export * from "./miniLine"; +export * from "./spanBreak"; +export * from "./unStyledCodeBlock"; diff --git a/apps/vscode/src/components/miniLine.ts b/apps/vscode/src/components/miniLine.ts new file mode 100644 index 0000000..2b3ef09 --- /dev/null +++ b/apps/vscode/src/components/miniLine.ts @@ -0,0 +1,4 @@ +import { spanBreak } from "./spanBreak"; + +/** May be useful for line separations */ +export const miniLine = spanBreak(/*html*/ `

`); diff --git a/apps/vscode/src/components/spanBreak.ts b/apps/vscode/src/components/spanBreak.ts new file mode 100644 index 0000000..80ced06 --- /dev/null +++ b/apps/vscode/src/components/spanBreak.ts @@ -0,0 +1,12 @@ +import { d } from "../utils"; + +/** + * Since every thing in the extension hover split into spans, + * we need to close the previous span before we're opening a new one + * Note: the line breaks is important here + */ +export const spanBreak = (children: string) => d/*html*/ ` + + ${children} + +`; diff --git a/apps/vscode/src/components/unStyledCodeBlock.ts b/apps/vscode/src/components/unStyledCodeBlock.ts new file mode 100644 index 0000000..19eac6e --- /dev/null +++ b/apps/vscode/src/components/unStyledCodeBlock.ts @@ -0,0 +1,10 @@ +import { inlineCodeBlock, multiLineCodeBlock } from "./codeBlock"; +import { d } from "../utils"; + +/** + * Code block without syntax highlighting like. + * For syntax highlighting, use {@link inlineCodeBlock} or {@link multiLineCodeBlock} + */ +export const unStyledCodeBlock = (content: string) => d/*html*/ ` + \`${content}\` +`; diff --git a/apps/vscode/src/format/addMissingParentheses.ts b/apps/vscode/src/format/addMissingParentheses.ts new file mode 100644 index 0000000..7b4927b --- /dev/null +++ b/apps/vscode/src/format/addMissingParentheses.ts @@ -0,0 +1,56 @@ +import { has, invert, keys, values } from "../utils"; + +const parentheses = { + "(": ")", + "{": "}", + "[": "]", +} as const; + +const openParentheses = keys(parentheses); +const closeParentheses = values(parentheses); + +export function addMissingParentheses(type: string): string { + let openStack: (typeof openParentheses)[number][] = []; + let missingClosingChars = ""; + + for (const char of type) { + if (has(openParentheses, char)) { + openStack.push(char); + } else if (has(closeParentheses, char)) { + if ( + openStack.length === 0 || + parentheses[openStack[openStack.length - 1]] !== char + ) { + // Add the correct opening character before the current closing character + openStack.push(invert(parentheses)[char]); + } else { + openStack.pop(); + } + } + } + + // Add the missing closing characters at the end of the string + while (openStack.length > 0) { + const openChar = openStack.pop()!; + const closingChar = parentheses[openChar]; + missingClosingChars += closingChar; + } + + let validType = type; + + // Close the last string if it's not closed + if ((validType.match(/\"/g) ?? []).length % 2 === 1) { + validType = validType + '..."'; + } + if ((validType.match(/\'/g) ?? []).length % 2 === 1) { + validType = validType + "...'"; + } + + validType = (validType + missingClosingChars).replace( + // Change (param: ...) to (param) => __RETURN_TYPE__ if needed + /(\([a-zA-Z0-9]*\:.*\))/, + (p1) => `${p1} => ...` + ); + + return validType; +} diff --git a/apps/vscode/src/format/formatDiagnosticMessage.ts b/apps/vscode/src/format/formatDiagnosticMessage.ts new file mode 100644 index 0000000..b07267f --- /dev/null +++ b/apps/vscode/src/format/formatDiagnosticMessage.ts @@ -0,0 +1,82 @@ +import { inlineCodeBlock, unStyledCodeBlock } from '../components'; +import { formatTypeBlock } from './formatTypeBlock'; + +const formatTypeScriptBlock = (_: string, code: string) => + inlineCodeBlock(code, 'typescript'); + +const formatSimpleTypeBlock = (_: string, code: string) => + inlineCodeBlock(code, 'type'); + +export const formatDiagnosticMessage = (message: string) => + message + // format declare module snippet + .replaceAll( + /['“](declare module )['”](.*)['“];['”]/g, + (_: string, p1: string, p2: string) => + formatTypeScriptBlock(_, `${p1} "${p2}"`), + ) + // format missing props error + .replaceAll( + /(is missing the following properties from type )'(.*)': (.+?)(?=and|$)/g, + (_, pre, type, post) => + `${pre}${formatTypeBlock('', type)}: `, + ) + // Format type pairs + .replaceAll( + /(types) ['“](.*?)['”] and ['“](.*?)['”][\.]?/gi, + (_: string, p1: string, p2: string, p3: string) => + `${formatTypeBlock(p1, p2)} and ${formatTypeBlock('', p3)}`, + ) + // Format type annotation options + .replaceAll( + /type annotation must be ['“](.*?)['”] or ['“](.*?)['”][\.]?/gi, + (_: string, p1: string, p2: string, p3: string) => + `${formatTypeBlock(p1, p2)} or ${formatTypeBlock('', p3)}`, + ) + .replaceAll( + /(Overload \d of \d), ['“](.*?)['”], /gi, + (_, p1: string, p2: string) => `${p1}${formatTypeBlock('', p2)}`, + ) + // format simple strings + .replaceAll(/^['“]"[^"]*"['”]$/g, formatTypeScriptBlock) + // Format string types + .replaceAll( + /(module|file|file name) "(.*?)"(?=[\s(.|,)])/gi, + (_, p1: string, p2: string) => formatTypeBlock(p1, `"${p2}"`), + ) + // Format types + .replaceAll( + /(type|type alias|interface|module|file|file name|method's|subtype of constraint) ['“](.*?)['“](?=[\s(.|,)])/gi, + (_, p1: string, p2: string) => formatTypeBlock(p1, p2), + ) + // Format reversed types + .replaceAll( + /(.*)['“]([^>]*)['”] (type|interface|return type|file|module|is (not )?assignable)/gi, + (_: string, p1: string, p2: string, p3: string) => + `${p1}${formatTypeBlock('', p2)} ${p3}`, + ) + // Format simple types that didn't captured before + .replaceAll( + /['“]((void|null|undefined|any|boolean|string|number|bigint|symbol)(\[\])?)['”]/g, + formatSimpleTypeBlock, + ) + // Format some typescript key words + .replaceAll( + /['“](import|export|require|in|continue|break|let|false|true|const|new|throw|await|for await|[0-9]+)( ?.*?)['”]/g, + (_: string, p1: string, p2: string) => + formatTypeScriptBlock(_, `${p1}${p2}`), + ) + // Format return values + .replaceAll( + /(return|operator) ['“](.*?)['”]/gi, + (_, p1: string, p2: string) => `${p1} ${formatTypeScriptBlock('', p2)}`, + ) + // Format regular code blocks + .replaceAll( + /['“]((?:(?!:\s*}).)*?)['“] (?!\s*:)/g, + (_: string, p1: string) => `${unStyledCodeBlock(p1)} `, + ); diff --git a/apps/vscode/src/format/formatTypeBlock.ts b/apps/vscode/src/format/formatTypeBlock.ts new file mode 100644 index 0000000..1f0509a --- /dev/null +++ b/apps/vscode/src/format/formatTypeBlock.ts @@ -0,0 +1,75 @@ +import { + inlineCodeBlock, + multiLineCodeBlock, + unStyledCodeBlock, +} from "../components"; +import { addMissingParentheses } from "./addMissingParentheses"; +import { prettify } from "./prettify"; + +export function formatTypeBlock( + prefix: string, + type: string, +) { + // Return a simple code block if it's just a parenthesis + if (type.match(/^(\[\]|\{\})$/)) { + return `${prefix} ${unStyledCodeBlock(type)}`; + } + + if ( + // Skip formatting if it's a simple type + type.match( + /^((void|null|undefined|any|number|string|bigint|symbol|readonly|typeof)(\[\])?)$/ + ) + ) { + return `${prefix} ${inlineCodeBlock(type, "type")}`; + } + + const prettyType = prettifyType(type); + + if (prettyType.includes("\n")) { + return `${prefix}: ${multiLineCodeBlock(prettyType, "type")}`; + } else { + return `${prefix} ${inlineCodeBlock(prettyType, "type")}`; + } +} +/** + * Try to make type prettier with prettier + */ +export function prettifyType( + type: string, + options?: { throwOnError?: boolean } +) { + try { + // Wrap type with valid statement, format it and extract the type back + return convertToOriginalType(prettify(convertToValidType(type))); + } catch (e) { + if (options?.throwOnError) { + throw e; + } + return type; + } +} + +const convertToValidType = (type: string) => + `type x = ${type + // Add missing parentheses when the type ends with "..."" + .replace(/(.*)\.\.\.$/, (_, p1) => addMissingParentheses(p1)) + // Replace single parameter function destructuring because it's not a valid type + // .replaceAll(/\((\{.*\})\:/g, (_, p1) => `(param: /* ${p1} */`) + // Change `(...): return` which is invalid to `(...) => return` + .replace(/^(\(.*\)): /, (_, p1) => `${p1} =>`) + .replaceAll(/... (\d{0,}) more .../g, (_, p1) => `___${p1}MORE___`) + .replaceAll(/... (\d{0,}) more ...;/g, (_, p1) => `___MORE___: ${p1};`) + .replaceAll("...;", "___KEY___: ___THREE_DOTS___;") + .replaceAll("...", "__THREE_DOTS__")};`; + +const convertToOriginalType = (type: string) => + type + .replaceAll("___KEY___: ___THREE_DOTS___", "...;") + .replaceAll("__THREE_DOTS__", "...") + .replaceAll(/___MORE___: (\d{0,});/g, (_, p1) => `... ${p1} more ...;`) + .replaceAll(/___(\d{0,})MORE___/g, (_, p1) => `... ${p1} more ...`) + .replaceAll(/... (\d{0,}) more .../g, (_, p1) => `/* ${p1} more */`) // ... x more ... not shown sell + // .replaceAll(/\(param\: \/\* (\{ .* \}) \*\//g, (_, p1) => `(${p1}: `) + .replace(/type x =[ ]?((.|\n)*);.*/g, "$1") + .trim(); diff --git a/apps/vscode/src/format/identSentences.ts b/apps/vscode/src/format/identSentences.ts new file mode 100644 index 0000000..5847f21 --- /dev/null +++ b/apps/vscode/src/format/identSentences.ts @@ -0,0 +1,34 @@ +import { d } from "../utils"; + +export const identSentences = (message: string): string => + message + .split("\n") + .map((line) => { + let whiteSpacesCount = line.search(/\S/); + if (whiteSpacesCount === -1) { + whiteSpacesCount = 0; + } + if (whiteSpacesCount === 0) { + return line; + } + if (whiteSpacesCount >= 2) { + whiteSpacesCount -= 2; + } + + return d/*html*/ ` + +

+ + + + + + +
+ ${" ".repeat(3).repeat(whiteSpacesCount)} + +    + ${line}
+ `; + }) + .join(""); diff --git a/apps/vscode/src/format/prettify.ts b/apps/vscode/src/format/prettify.ts new file mode 100644 index 0000000..81d0fe6 --- /dev/null +++ b/apps/vscode/src/format/prettify.ts @@ -0,0 +1,10 @@ +import { format } from "prettier"; + +export function prettify(text: string) { + return format(text, { + parser: "typescript", + printWidth: 60, + singleAttributePerLine: false, + arrowParens: "avoid", + }); +} diff --git a/apps/vscode/src/humaniseDiagnostic.ts b/apps/vscode/src/humaniseDiagnostic.ts index c1dc1e0..cc39260 100644 --- a/apps/vscode/src/humaniseDiagnostic.ts +++ b/apps/vscode/src/humaniseDiagnostic.ts @@ -1,9 +1,21 @@ +import { parseErrors } from '@total-typescript/error-translation-engine'; import * as vscode from 'vscode'; -import { - fillBodyWithItems, - parseErrors, -} from '@total-typescript/error-translation-engine'; import * as bundleErrors from './bundleErrors.json'; +import { formatTypeBlock } from './format/formatTypeBlock'; +import { formatDiagnosticMessage } from './format/formatDiagnosticMessage'; + +// TODO +export const fillBodyWithItems = (body: string, items: (string | number)[]) => { + items.forEach((item, index) => { + const bodyRegex = new RegExp(`'?\\\{${index}\\\}'?`, 'g'); + console.log(item); + body = body.replace(bodyRegex, formatTypeBlock('', String(item).trim())); + }); + + return { + body, + }; +}; type GHIssueURLParams = { title: string; @@ -28,13 +40,13 @@ export const humaniseDiagnostic = ( error.code ]; - errorBodies.push(['```txt', error.parseInfo.rawError, '```'].join('\n')); - if (fullError) { const { body } = fillBodyWithItems(fullError.body, error.parseInfo.items); - errorBodies.push('---', body); + errorBodies.push(body); } else { + console.log(error.parseInfo.rawError); + errorBodies.push(formatDiagnosticMessage(error.parseInfo.rawError)); errorBodies.push( `[Request a translation for \`#${ error.code @@ -54,7 +66,12 @@ export const humaniseDiagnostic = ( ); } - markdownStrings.push(new vscode.MarkdownString(errorBodies.join('\n\n'))); + const formattedString = new vscode.MarkdownString(errorBodies.join('\n\n')); + + formattedString.isTrusted = true; + formattedString.supportHtml = true; + + markdownStrings.push(formattedString); }); return markdownStrings; diff --git a/apps/vscode/src/utils.ts b/apps/vscode/src/utils.ts new file mode 100644 index 0000000..c479af6 --- /dev/null +++ b/apps/vscode/src/utils.ts @@ -0,0 +1,50 @@ +// We re-export modules to be able to replace/change them easily across all the usages +export { compressToEncodedURIComponent } from 'lz-string'; +import dedent from 'ts-dedent'; + +/** + * d stands for dedent. + * it allow us to indent html in template literals without affecting the output + */ +export const d = dedent; + +/** Similar to `Object.keys` but with stricter types */ +export const keys = (object: T): Array => + >Object.keys(object); + +/** Similar to `Object.values` but with stricter types */ +export const values = (object: T): Array => + >Object.values(object); + +/** + * Check if an array contains a string. + * Type guard the string if it does. + */ +export const has = ( + array: unknown[], + item: string, +): item is Extract<(typeof array)[number], string> => array.includes(item); + +/** + * Copied from radash library + * Returns an object with { [keys]: value } + * inverted as { [value]: key } + */ +export const invert = < + TKey extends string | number | symbol, + TValue extends string | number | symbol, +>( + obj: Record, +): Record => { + if (!obj) { + return {} as Record; + } + const keys = Object.keys(obj) as TKey[]; + return keys.reduce( + (acc, key) => { + acc[obj[key]] = key; + return acc; + }, + {} as Record, + ); +}; diff --git a/apps/vscode/tsconfig.json b/apps/vscode/tsconfig.json index 6154715..9f4add9 100644 --- a/apps/vscode/tsconfig.json +++ b/apps/vscode/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES2020", + "target": "ES2021", "outDir": "out", "lib": [ - "ES2020" + "ES2021" ], "noEmit": true, "sourceMap": true, diff --git a/package.json b/package.json index 21680d3..84d94bb 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "devDependencies": { "husky": ">=6", "lint-staged": ">=10", - "prettier": "^3.0.0", + "prettier": "^2.8.8", "ts-node": "^10.7.0", "turbo": "^1.2.6", "typescript": "^4.8.3", diff --git a/packages/engine/errors/2304.md b/packages/engine/errors/2304.md index 46d168e..eda359f 100644 --- a/packages/engine/errors/2304.md +++ b/packages/engine/errors/2304.md @@ -2,4 +2,6 @@ original: "Cannot find name '{0}'." --- -I can't find the variable you're trying to access. +I can't find the variable you're trying to access, '{0}', in the current scope. + + diff --git a/packages/engine/errors/2322.md b/packages/engine/errors/2322.md index c1964f0..f001092 100644 --- a/packages/engine/errors/2322.md +++ b/packages/engine/errors/2322.md @@ -2,4 +2,4 @@ original: "Type '{0}' is not assignable to type '{1}'." --- -I was expecting a type matching A, but instead you passed B. +I was expecting a type matching '{1}' but instead you passed '{0}'. diff --git a/packages/engine/errors/2739.md b/packages/engine/errors/2739.md new file mode 100644 index 0000000..335ad14 --- /dev/null +++ b/packages/engine/errors/2739.md @@ -0,0 +1,5 @@ +--- +original: "Type '{0}' is missing the following properties from type '{1}': {2}" +--- + +Type '{0}' is missing the following properties from type '{1}': {2} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36b7e87..5078954 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ importers: '@types/node': ^18.7.18 husky: '>=6' lint-staged: '>=10' - prettier: ^3.0.0 + prettier: ^2.8.8 ts-node: ^10.7.0 turbo: ^1.2.6 typescript: ^4.8.3 @@ -20,7 +20,7 @@ importers: '@types/node': 18.7.18 husky: 8.0.1 lint-staged: 13.0.3 - prettier: 3.0.0 + prettier: 2.8.8 ts-node: 10.9.1_bidgzm5cq2du6gnjtweqqjrrn4 turbo: 1.4.7 typescript: 4.8.3 @@ -32,6 +32,7 @@ importers: '@types/glob': ^7.2.0 '@types/mocha': ^9.1.0 '@types/node': 14.x + '@types/prettier': ^2.7.3 '@types/vscode': ^1.50.0 '@typescript-eslint/eslint-plugin': ^6.2.1 '@typescript-eslint/parser': ^6.2.1 @@ -41,16 +42,27 @@ importers: eslint: ^8.46.0 front-matter: ^4.0.2 glob: ^7.2.0 + lz-string: ^1.5.0 mocha: ^9.2.2 + prettier: ^2.8.8 + ts-dedent: ^2.2.0 typescript: ^5.1.6 + vscode-languageserver-types: ^3.17.3 + vscode-uri: ^3.0.7 dependencies: front-matter: 4.0.2 + lz-string: 1.5.0 + prettier: 2.8.8 + ts-dedent: 2.2.0 + vscode-languageserver-types: 3.17.3 + vscode-uri: 3.0.7 devDependencies: '@total-typescript/error-translation-engine': link:../../packages/engine '@total-typescript/tips-parser': link:../../packages/parser '@types/glob': 7.2.0 '@types/mocha': 9.1.1 '@types/node': 14.18.29 + '@types/prettier': 2.7.3 '@types/vscode': 1.71.0 '@typescript-eslint/eslint-plugin': 6.2.1_j6xx3z2bnxhrxzjhzeomjwp6aa '@typescript-eslint/parser': 6.2.1_7haavtekmro7ptbnqmctjaodju @@ -382,7 +394,7 @@ packages: fs-extra: 7.0.1 lodash.startcase: 4.4.0 outdent: 0.5.0 - prettier: 2.7.1 + prettier: 2.8.8 resolve-from: 5.0.0 semver: 7.5.4 dev: false @@ -569,7 +581,7 @@ packages: '@changesets/types': 5.2.1 fs-extra: 7.0.1 human-id: 1.0.2 - prettier: 2.7.1 + prettier: 2.8.8 dev: false /@cspotcode/source-map-support/0.8.1: @@ -1060,6 +1072,10 @@ packages: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: false + /@types/prettier/2.7.3: + resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} + dev: true + /@types/prompts/2.4.1: resolution: {integrity: sha512-1Mqzhzi9W5KlooNE4o0JwSXGUDeQXKldbGn9NO4tpxwZbHXYd+WcKpCksG2lbhH7U9I9LigfsdVsP2QAY0lNPA==} dependencies: @@ -3679,6 +3695,11 @@ packages: dependencies: yallist: 4.0.0 + /lz-string/1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + dev: false + /make-error/1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -4125,17 +4146,10 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - /prettier/2.7.1: - resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + /prettier/2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true - dev: false - - /prettier/3.0.0: - resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} - engines: {node: '>=14'} - hasBin: true - dev: true /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -4694,6 +4708,11 @@ packages: typescript: 5.1.6 dev: true + /ts-dedent/2.2.0: + resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} + engines: {node: '>=6.10'} + dev: false + /ts-node/10.9.1_bidgzm5cq2du6gnjtweqqjrrn4: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -5061,6 +5080,14 @@ packages: - stylus dev: true + /vscode-languageserver-types/3.17.3: + resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==} + dev: false + + /vscode-uri/3.0.7: + resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==} + dev: false + /wcwidth/1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: diff --git a/turbo.json b/turbo.json index c5e1c09..65edc6b 100644 --- a/turbo.json +++ b/turbo.json @@ -17,7 +17,7 @@ "cache": false }, "bundle-errors": { - "outputs": ["src/bundleErrors.json"] + "cache": false }, "vscode:package": { "dependsOn": ["vscode:build"],