Skip to content
This repository was archived by the owner on Nov 5, 2021. It is now read-only.

Allow error messages to contain references to require in their strings #59

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.6",
"terser": "^4.6.3",
"typescript": "^3.8.2"
"typescript": "^3.9.0-dev.20200407"
}
}
8 changes: 6 additions & 2 deletions scripts/importTypescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
// \/[*/] matches the start of a comment (single or multi-line).
// ^\s+\*[^/] matches (presumably) a later line of a multi-line comment.
const tsServicesNoCommentedRequire = tsServices.replace(/(\/[*/]|^\s+\*[^/]).*\brequire\(.*/gm, '');
const linesWithRequire = tsServicesNoCommentedRequire.match(/^.*?\brequire\(.*$/gm);
if (linesWithRequire && linesWithRequire.length) {
const linesWithRequire = tsServicesNoCommentedRequire.match(/^.*?\brequire\(.*$/gm)

// Allow error messages to include references to require() in their strings
const runtimeRequires = linesWithRequire && linesWithRequire.filter(l => !l.includes(": diag("))

if (runtimeRequires && runtimeRequires.length) {
console.error('Found new require() calls on the following lines. These should be removed to avoid breaking webpack builds.\n');
console.error(linesWithRequire.join('\n'));
process.exit(1);
Expand Down
30 changes: 15 additions & 15 deletions src/lib/lib.ts

Large diffs are not rendered by default.

10,077 changes: 6,431 additions & 3,646 deletions src/lib/typescriptServices-amd.js

Large diffs are not rendered by default.

216 changes: 155 additions & 61 deletions src/lib/typescriptServices.d.ts

Large diffs are not rendered by default.

10,077 changes: 6,431 additions & 3,646 deletions src/lib/typescriptServices.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/lib/typescriptServicesMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
//

export const typescriptVersion = "3.8.3";
export const typescriptVersion = "3.9.0-dev.20200407";