Remove all submodules - just force clone and reset on run instead (#33425)
This commit is contained in:
parent
99229f88dd
commit
038d95144d
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -81,4 +81,14 @@ tests/cases/user/*/**/*.d.ts
|
|||
tests/baselines/reference/dt
|
||||
.failed-tests
|
||||
TEST-results.xml
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
|
||||
tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
|
||||
tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
|
||||
tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
|
||||
tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
|
||||
tests/cases/user/create-react-app/create-react-app
|
||||
tests/cases/user/webpack/webpack
|
||||
tests/cases/user/puppeteer/puppeteer
|
||||
tests/cases/user/axios-src/axios-src
|
||||
tests/cases/user/prettier/prettier
|
40
.gitmodules
vendored
40
.gitmodules
vendored
|
@ -1,40 +0,0 @@
|
|||
[submodule "tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter"]
|
||||
path = tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
|
||||
url = https://github.com/Microsoft/TypeScript-React-Starter
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter"]
|
||||
path = tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
|
||||
url = https://github.com/Microsoft/TypeScript-Node-Starter.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter"]
|
||||
path = tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
|
||||
url = https://github.com/Microsoft/TypeScript-React-Native-Starter.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter"]
|
||||
path = tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
|
||||
url = https://github.com/Microsoft/TypeScript-Vue-Starter.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter"]
|
||||
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
|
||||
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/create-react-app/create-react-app"]
|
||||
path = tests/cases/user/create-react-app/create-react-app
|
||||
url = https://github.com/facebook/create-react-app.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/webpack/webpack"]
|
||||
path = tests/cases/user/webpack/webpack
|
||||
url = https://github.com/webpack/webpack.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/puppeteer/puppeteer"]
|
||||
path = tests/cases/user/puppeteer/puppeteer
|
||||
url = https://github.com/GoogleChrome/puppeteer.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/axios-src/axios-src"]
|
||||
path = tests/cases/user/axios-src/axios-src
|
||||
url = https://github.com/axios/axios.git
|
||||
ignore = all
|
||||
[submodule "tests/cases/user/prettier/prettier"]
|
||||
path = tests/cases/user/prettier/prettier
|
||||
url = https://github.com/prettier/prettier.git
|
||||
ignore = all
|
|
@ -10,6 +10,7 @@ interface ExecResult {
|
|||
|
||||
interface UserConfig {
|
||||
types: string[];
|
||||
cloneUrl: string;
|
||||
path?: string;
|
||||
}
|
||||
|
||||
|
@ -49,13 +50,17 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
|
|||
const stdio = isWorker ? "pipe" : "inherit";
|
||||
let types: string[] | undefined;
|
||||
if (fs.existsSync(path.join(cwd, "test.json"))) {
|
||||
const submoduleDir = path.join(cwd, directoryName);
|
||||
exec("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir });
|
||||
exec("git", ["clean", "-f"], { cwd: submoduleDir });
|
||||
exec("git", ["submodule", "update", "--init", "--remote", "."], { cwd: originalCwd });
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(path.join(cwd, "test.json"), { encoding: "utf8" })) as UserConfig;
|
||||
ts.Debug.assert(!!config.types, "Bad format from test.json: Types field must be present.");
|
||||
ts.Debug.assert(!!config.cloneUrl, "Bad format from test.json: cloneUrl field must be present.");
|
||||
const submoduleDir = path.join(cwd, directoryName);
|
||||
if (!fs.existsSync(submoduleDir)) {
|
||||
exec("git", ["clone", config.cloneUrl, directoryName], { cwd });
|
||||
}
|
||||
exec("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir });
|
||||
exec("git", ["clean", "-f"], { cwd: submoduleDir });
|
||||
exec("git", ["pull", "-f"], { cwd: submoduleDir });
|
||||
|
||||
types = config.types;
|
||||
|
||||
cwd = config.path ? path.join(cwd, config.path) : submoduleDir;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit ca14e7ccbca8a821d3b860ebb6f3c81c68ccbd06
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/Microsoft/TypeScript-Node-Starter.git",
|
||||
"types": ["jquery"]
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 30acce5e136e86bcf4eff1df151742f78142aa1a
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Native-Starter.git",
|
||||
"types": ["jest"],
|
||||
"path": "TypeScript-React-Native-Starter/ExampleProject"
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 19c71f2c6a2b874b1b2bb28a8526b19185b8eece
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
|
||||
"types": ["jest", "node"]
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 56024cfe414491a9097e9dd33661a5ad5d51d975
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/Microsoft/TypeScript-Vue-Starter.git",
|
||||
"types": []
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 3fb8b4601022f7e2df899eb0ac0178f531e6f027
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
|
||||
"types": []
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit d74385f1c8f944a6d94ae0680d3841859a2fcb38
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/axios/axios.git",
|
||||
"types": ["node"]
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 74eb65a46269d5c2cc5483841e271281477c650e
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/facebook/create-react-app.git",
|
||||
"types": []
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit e83b4537feaa6c063a1598b8d3972b6ad600f2a7
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/prettier/prettier.git",
|
||||
"types": ["node"]
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a5f03ce1c85c2630739f2a894a303c68632aa250
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/GoogleChrome/puppeteer.git",
|
||||
"types": []
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"cloneUrl": "https://github.com/webpack/webpack.git",
|
||||
"types": []
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit e4c7d8c0ae0c93306f07920bc28fe72119bc098a
|
Loading…
Reference in a new issue