From 1d6e8abcca289070bf4b00f3c3a6979f0eb61548 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 9 Sep 2020 13:54:43 -0700 Subject: [PATCH] More other addons api tests into test project --- .eslintrc.json | 16 ++++++--- addons/xterm-addon-attach/package.json | 2 +- addons/xterm-addon-attach/src/tsconfig.json | 3 +- .../{src => test}/AttachAddon.api.ts | 0 addons/xterm-addon-attach/test/tsconfig.json | 23 ++++++++++++ .../tsconfig.json} | 0 addons/xterm-addon-fit/package.json | 2 +- addons/xterm-addon-fit/src/tsconfig.json | 3 +- .../{src => test}/FitAddon.api.ts | 0 addons/xterm-addon-fit/test/tsconfig.json | 23 ++++++++++++ addons/xterm-addon-fit/tsconfig.json | 8 +++++ addons/xterm-addon-ligatures/tsconfig.json | 7 ++++ addons/xterm-addon-search/package.json | 2 +- addons/xterm-addon-search/src/tsconfig.json | 3 +- .../{src => test}/SearchAddon.api.ts | 0 addons/xterm-addon-search/test/tsconfig.json | 23 ++++++++++++ addons/xterm-addon-search/tsconfig.json | 8 +++++ addons/xterm-addon-serialize/package.json | 2 +- .../xterm-addon-serialize/src/tsconfig.json | 3 +- .../{src => test}/SerializeAddon.api.ts | 0 .../xterm-addon-serialize/test/tsconfig.json | 34 ++++++++++++++++++ addons/xterm-addon-serialize/tsconfig.json | 9 +++++ addons/xterm-addon-unicode11/package.json | 2 +- .../xterm-addon-unicode11/src/tsconfig.json | 3 +- .../{src => test}/Unicode11Addon.api.ts | 0 .../xterm-addon-unicode11/test/tsconfig.json | 35 +++++++++++++++++++ addons/xterm-addon-unicode11/tsconfig.json | 8 +++++ addons/xterm-addon-web-links/package.json | 2 +- .../xterm-addon-web-links/src/tsconfig.json | 3 +- .../{src => test}/WebLinksAddon.api.ts | 0 .../xterm-addon-web-links/test/tsconfig.json | 23 ++++++++++++ addons/xterm-addon-web-links/tsconfig.json | 8 +++++ addons/xterm-addon-webgl/tsconfig.json | 8 +++++ bin/test_api.js | 1 - tsconfig.all.json | 17 +++++---- 35 files changed, 248 insertions(+), 33 deletions(-) rename addons/xterm-addon-attach/{src => test}/AttachAddon.api.ts (100%) create mode 100644 addons/xterm-addon-attach/test/tsconfig.json rename addons/{xterm-addon-webgl/tsconfig.all.json => xterm-addon-attach/tsconfig.json} (100%) rename addons/xterm-addon-fit/{src => test}/FitAddon.api.ts (100%) create mode 100644 addons/xterm-addon-fit/test/tsconfig.json create mode 100644 addons/xterm-addon-fit/tsconfig.json create mode 100644 addons/xterm-addon-ligatures/tsconfig.json rename addons/xterm-addon-search/{src => test}/SearchAddon.api.ts (100%) create mode 100644 addons/xterm-addon-search/test/tsconfig.json create mode 100644 addons/xterm-addon-search/tsconfig.json rename addons/xterm-addon-serialize/{src => test}/SerializeAddon.api.ts (100%) create mode 100644 addons/xterm-addon-serialize/test/tsconfig.json create mode 100644 addons/xterm-addon-serialize/tsconfig.json rename addons/xterm-addon-unicode11/{src => test}/Unicode11Addon.api.ts (100%) create mode 100644 addons/xterm-addon-unicode11/test/tsconfig.json create mode 100644 addons/xterm-addon-unicode11/tsconfig.json rename addons/xterm-addon-web-links/{src => test}/WebLinksAddon.api.ts (100%) create mode 100644 addons/xterm-addon-web-links/test/tsconfig.json create mode 100644 addons/xterm-addon-web-links/tsconfig.json create mode 100644 addons/xterm-addon-webgl/tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json index 76557365..8c416f15 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,15 +12,21 @@ "test/api/tsconfig.json", "test/benchmark/tsconfig.json", "addons/xterm-addon-attach/src/tsconfig.json", + "addons/xterm-addon-attach/test/tsconfig.json", "addons/xterm-addon-fit/src/tsconfig.json", + "addons/xterm-addon-fit/test/tsconfig.json", + "addons/xterm-addon-ligatures/src/tsconfig.json", "addons/xterm-addon-search/src/tsconfig.json", - "addons/xterm-addon-unicode11/src/tsconfig.json", - "addons/xterm-addon-web-links/src/tsconfig.json", - "addons/xterm-addon-webgl/src/tsconfig.json", - "addons/xterm-addon-webgl/test/tsconfig.json", + "addons/xterm-addon-search/test/tsconfig.json", "addons/xterm-addon-serialize/src/tsconfig.json", + "addons/xterm-addon-serialize/test/tsconfig.json", "addons/xterm-addon-serialize/benchmark/tsconfig.json", - "addons/xterm-addon-ligatures/src/tsconfig.json" + "addons/xterm-addon-unicode11/src/tsconfig.json", + "addons/xterm-addon-unicode11/test/tsconfig.json", + "addons/xterm-addon-web-links/src/tsconfig.json", + "addons/xterm-addon-web-links/test/tsconfig.json", + "addons/xterm-addon-webgl/src/tsconfig.json", + "addons/xterm-addon-webgl/test/tsconfig.json" ], "sourceType": "module" }, diff --git a/addons/xterm-addon-attach/package.json b/addons/xterm-addon-attach/package.json index 99629530..1c432aa0 100644 --- a/addons/xterm-addon-attach/package.json +++ b/addons/xterm-addon-attach/package.json @@ -10,7 +10,7 @@ "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" diff --git a/addons/xterm-addon-attach/src/tsconfig.json b/addons/xterm-addon-attach/src/tsconfig.json index caed69d9..54bfc38b 100644 --- a/addons/xterm-addon-attach/src/tsconfig.json +++ b/addons/xterm-addon-attach/src/tsconfig.json @@ -12,8 +12,7 @@ "removeComments": true, "strict": true, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-attach/src/AttachAddon.api.ts b/addons/xterm-addon-attach/test/AttachAddon.api.ts similarity index 100% rename from addons/xterm-addon-attach/src/AttachAddon.api.ts rename to addons/xterm-addon-attach/test/AttachAddon.api.ts diff --git a/addons/xterm-addon-attach/test/tsconfig.json b/addons/xterm-addon-attach/test/tsconfig.json new file mode 100644 index 00000000..1c772984 --- /dev/null +++ b/addons/xterm-addon-attach/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es2015" + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "strict": true, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ] +} diff --git a/addons/xterm-addon-webgl/tsconfig.all.json b/addons/xterm-addon-attach/tsconfig.json similarity index 100% rename from addons/xterm-addon-webgl/tsconfig.all.json rename to addons/xterm-addon-attach/tsconfig.json diff --git a/addons/xterm-addon-fit/package.json b/addons/xterm-addon-fit/package.json index 645578cd..859d6ebf 100644 --- a/addons/xterm-addon-fit/package.json +++ b/addons/xterm-addon-fit/package.json @@ -10,7 +10,7 @@ "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" diff --git a/addons/xterm-addon-fit/src/tsconfig.json b/addons/xterm-addon-fit/src/tsconfig.json index caed69d9..54bfc38b 100644 --- a/addons/xterm-addon-fit/src/tsconfig.json +++ b/addons/xterm-addon-fit/src/tsconfig.json @@ -12,8 +12,7 @@ "removeComments": true, "strict": true, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-fit/src/FitAddon.api.ts b/addons/xterm-addon-fit/test/FitAddon.api.ts similarity index 100% rename from addons/xterm-addon-fit/src/FitAddon.api.ts rename to addons/xterm-addon-fit/test/FitAddon.api.ts diff --git a/addons/xterm-addon-fit/test/tsconfig.json b/addons/xterm-addon-fit/test/tsconfig.json new file mode 100644 index 00000000..1c772984 --- /dev/null +++ b/addons/xterm-addon-fit/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es2015" + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "strict": true, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ] +} diff --git a/addons/xterm-addon-fit/tsconfig.json b/addons/xterm-addon-fit/tsconfig.json new file mode 100644 index 00000000..2d820dd1 --- /dev/null +++ b/addons/xterm-addon-fit/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" } + ] +} diff --git a/addons/xterm-addon-ligatures/tsconfig.json b/addons/xterm-addon-ligatures/tsconfig.json new file mode 100644 index 00000000..b711f30a --- /dev/null +++ b/addons/xterm-addon-ligatures/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" } + ] +} diff --git a/addons/xterm-addon-search/package.json b/addons/xterm-addon-search/package.json index 33459c09..711335cb 100644 --- a/addons/xterm-addon-search/package.json +++ b/addons/xterm-addon-search/package.json @@ -10,7 +10,7 @@ "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" diff --git a/addons/xterm-addon-search/src/tsconfig.json b/addons/xterm-addon-search/src/tsconfig.json index 620b14e3..d264abe0 100644 --- a/addons/xterm-addon-search/src/tsconfig.json +++ b/addons/xterm-addon-search/src/tsconfig.json @@ -12,8 +12,7 @@ "removeComments": true, "strict": true, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-search/src/SearchAddon.api.ts b/addons/xterm-addon-search/test/SearchAddon.api.ts similarity index 100% rename from addons/xterm-addon-search/src/SearchAddon.api.ts rename to addons/xterm-addon-search/test/SearchAddon.api.ts diff --git a/addons/xterm-addon-search/test/tsconfig.json b/addons/xterm-addon-search/test/tsconfig.json new file mode 100644 index 00000000..df82a457 --- /dev/null +++ b/addons/xterm-addon-search/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "strict": true, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ] +} diff --git a/addons/xterm-addon-search/tsconfig.json b/addons/xterm-addon-search/tsconfig.json new file mode 100644 index 00000000..2d820dd1 --- /dev/null +++ b/addons/xterm-addon-search/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" } + ] +} diff --git a/addons/xterm-addon-serialize/package.json b/addons/xterm-addon-serialize/package.json index e2b8cbb4..b42cf50f 100644 --- a/addons/xterm-addon-serialize/package.json +++ b/addons/xterm-addon-serialize/package.json @@ -9,7 +9,7 @@ "types": "typings/xterm-addon-serialize.d.ts", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package", diff --git a/addons/xterm-addon-serialize/src/tsconfig.json b/addons/xterm-addon-serialize/src/tsconfig.json index 19ade3c9..ef4a14ab 100644 --- a/addons/xterm-addon-serialize/src/tsconfig.json +++ b/addons/xterm-addon-serialize/src/tsconfig.json @@ -18,8 +18,7 @@ }, "strict": true, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-serialize/src/SerializeAddon.api.ts b/addons/xterm-addon-serialize/test/SerializeAddon.api.ts similarity index 100% rename from addons/xterm-addon-serialize/src/SerializeAddon.api.ts rename to addons/xterm-addon-serialize/test/SerializeAddon.api.ts diff --git a/addons/xterm-addon-serialize/test/tsconfig.json b/addons/xterm-addon-serialize/test/tsconfig.json new file mode 100644 index 00000000..7afbc858 --- /dev/null +++ b/addons/xterm-addon-serialize/test/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es2015" + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "baseUrl": ".", + "paths": { + "common/*": [ + "../../../src/common/*" + ] + }, + "strict": true, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ], + "references": [ + { + "path": "../../../src/common" + } + ] +} diff --git a/addons/xterm-addon-serialize/tsconfig.json b/addons/xterm-addon-serialize/tsconfig.json new file mode 100644 index 00000000..0e7b5c35 --- /dev/null +++ b/addons/xterm-addon-serialize/tsconfig.json @@ -0,0 +1,9 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" }, + { "path": "./benchmark" } + ] +} diff --git a/addons/xterm-addon-unicode11/package.json b/addons/xterm-addon-unicode11/package.json index 0de88352..397bf2b9 100644 --- a/addons/xterm-addon-unicode11/package.json +++ b/addons/xterm-addon-unicode11/package.json @@ -10,7 +10,7 @@ "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" diff --git a/addons/xterm-addon-unicode11/src/tsconfig.json b/addons/xterm-addon-unicode11/src/tsconfig.json index f9d0ab5f..f5489fcc 100644 --- a/addons/xterm-addon-unicode11/src/tsconfig.json +++ b/addons/xterm-addon-unicode11/src/tsconfig.json @@ -18,8 +18,7 @@ ] }, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts b/addons/xterm-addon-unicode11/test/Unicode11Addon.api.ts similarity index 100% rename from addons/xterm-addon-unicode11/src/Unicode11Addon.api.ts rename to addons/xterm-addon-unicode11/test/Unicode11Addon.api.ts diff --git a/addons/xterm-addon-unicode11/test/tsconfig.json b/addons/xterm-addon-unicode11/test/tsconfig.json new file mode 100644 index 00000000..4b3cb31c --- /dev/null +++ b/addons/xterm-addon-unicode11/test/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es2015", + "lib": [ + "dom", + "es2015" + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "strict": true, + "baseUrl": ".", + "paths": { + "common/*": [ + "../../../src/common/*" + ] + }, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ], + "references": [ + { + "path": "../../../src/common" + } + ] +} diff --git a/addons/xterm-addon-unicode11/tsconfig.json b/addons/xterm-addon-unicode11/tsconfig.json new file mode 100644 index 00000000..2d820dd1 --- /dev/null +++ b/addons/xterm-addon-unicode11/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" } + ] +} diff --git a/addons/xterm-addon-web-links/package.json b/addons/xterm-addon-web-links/package.json index e57876c7..81184b71 100644 --- a/addons/xterm-addon-web-links/package.json +++ b/addons/xterm-addon-web-links/package.json @@ -10,7 +10,7 @@ "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "scripts": { - "build": "../../node_modules/.bin/tsc -p src", + "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" diff --git a/addons/xterm-addon-web-links/src/tsconfig.json b/addons/xterm-addon-web-links/src/tsconfig.json index caed69d9..54bfc38b 100644 --- a/addons/xterm-addon-web-links/src/tsconfig.json +++ b/addons/xterm-addon-web-links/src/tsconfig.json @@ -12,8 +12,7 @@ "removeComments": true, "strict": true, "types": [ - "../../../node_modules/@types/mocha", - "../../../out-test/api/TestUtils" + "../../../node_modules/@types/mocha" ] }, "include": [ diff --git a/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts b/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts similarity index 100% rename from addons/xterm-addon-web-links/src/WebLinksAddon.api.ts rename to addons/xterm-addon-web-links/test/WebLinksAddon.api.ts diff --git a/addons/xterm-addon-web-links/test/tsconfig.json b/addons/xterm-addon-web-links/test/tsconfig.json new file mode 100644 index 00000000..1c772984 --- /dev/null +++ b/addons/xterm-addon-web-links/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es2015" + ], + "rootDir": ".", + "outDir": "../out-test", + "sourceMap": true, + "removeComments": true, + "strict": true, + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node", + "../../../out-test/api/TestUtils" + ] + }, + "include": [ + "./**/*", + "../../../typings/xterm.d.ts" + ] +} diff --git a/addons/xterm-addon-web-links/tsconfig.json b/addons/xterm-addon-web-links/tsconfig.json new file mode 100644 index 00000000..2d820dd1 --- /dev/null +++ b/addons/xterm-addon-web-links/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" } + ] +} diff --git a/addons/xterm-addon-webgl/tsconfig.json b/addons/xterm-addon-webgl/tsconfig.json new file mode 100644 index 00000000..2d820dd1 --- /dev/null +++ b/addons/xterm-addon-webgl/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./test" } + ] +} diff --git a/bin/test_api.js b/bin/test_api.js index 3889b697..7afb34bc 100644 --- a/bin/test_api.js +++ b/bin/test_api.js @@ -12,7 +12,6 @@ const env = { ...process.env }; env.NODE_PATH = path.resolve(__dirname, '../out'); let testFiles = [ - './addons/**/out/*api.js', './addons/**/out-test/*api.js', './out-test/**/*api.js', ]; diff --git a/tsconfig.all.json b/tsconfig.all.json index f5433aac..009cd498 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -5,14 +5,13 @@ { "path": "./src/browser" }, { "path": "./test/api" }, { "path": "./test/benchmark" }, - { "path": "./addons/xterm-addon-attach/src" }, - { "path": "./addons/xterm-addon-fit/src" }, - { "path": "./addons/xterm-addon-ligatures/src" }, - { "path": "./addons/xterm-addon-search/src" }, - { "path": "./addons/xterm-addon-serialize/src" }, - { "path": "./addons/xterm-addon-serialize/benchmark" }, - { "path": "./addons/xterm-addon-unicode11/src" }, - { "path": "./addons/xterm-addon-web-links/src" }, - { "path": "./addons/xterm-addon-webgl/tsconfig.all.json" } + { "path": "./addons/xterm-addon-attach" }, + { "path": "./addons/xterm-addon-fit" }, + { "path": "./addons/xterm-addon-ligatures" }, + { "path": "./addons/xterm-addon-search" }, + { "path": "./addons/xterm-addon-serialize" }, + { "path": "./addons/xterm-addon-unicode11" }, + { "path": "./addons/xterm-addon-web-links" }, + { "path": "./addons/xterm-addon-webgl" } ] }