[MIRROR] Upgrade tgui dependencies, make yarn task skippable (#4578)

* Upgrade tgui dependencies, make yarn task skippable (#58081)

* Upgrade tgui dependencies, make yarn task skippable

* Use a phony target to avoid double rebuilds

* Upgrade tgui dependencies, make yarn task skippable

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
SkyratBot
2021-04-01 16:49:57 +02:00
committed by GitHub
parent 2a1a69503a
commit 70e256bd86
11 changed files with 406 additions and 363 deletions

View File

@@ -89,8 +89,9 @@ task-clean() {
rm -rf .yarn/cache
rm -rf .yarn/unplugged
rm -rf .yarn/webpack
rm -rf .yarn/build-state.yml
rm -rf .yarn/install-state.gz
rm -f .yarn/build-state.yml
rm -f .yarn/install-state.gz
rm -f .yarn/install-target
rm -f .pnp.js
## NPM artifacts
rm -rf **/node_modules

View File

@@ -72,8 +72,9 @@ function task-clean {
Remove-Quiet -Recurse -Force ".yarn\cache"
Remove-Quiet -Recurse -Force ".yarn\unplugged"
Remove-Quiet -Recurse -Force ".yarn\webpack"
Remove-Quiet -Recurse -Force ".yarn\build-state.yml"
Remove-Quiet -Recurse -Force ".yarn\install-state.gz"
Remove-Quiet -Force ".yarn\build-state.yml"
Remove-Quiet -Force ".yarn\install-state.gz"
Remove-Quiet -Force ".yarn\install-target"
Remove-Quiet -Force ".pnp.js"
## NPM artifacts
Get-ChildItem -Path "." -Include "node_modules" -Recurse -File:$false | Remove-Item -Recurse -Force

View File

@@ -6,39 +6,39 @@
"packages/*"
],
"dependencies": {
"@babel/core": "^7.13.8",
"@babel/eslint-parser": "^7.13.8",
"@babel/core": "^7.13.14",
"@babel/eslint-parser": "^7.13.14",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-transform-jscript": "^7.12.13",
"@babel/preset-env": "^7.13.9",
"@babel/preset-env": "^7.13.12",
"@babel/preset-typescript": "^7.13.0",
"@types/jest": "^26.0.20",
"@types/jsdom": "^16.2.6",
"@types/node": "^14.14.31",
"@typescript-eslint/parser": "^4.16.1",
"@types/jest": "^26.0.22",
"@types/jsdom": "^16.2.9",
"@types/node": "^14.14.37",
"@typescript-eslint/parser": "^4.20.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"babel-plugin-inferno": "^6.1.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"common": "workspace:*",
"css-loader": "^5.1.1",
"eslint": "^7.21.0",
"css-loader": "^5.2.0",
"eslint": "^7.23.0",
"eslint-plugin-radar": "^0.2.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react": "^7.23.1",
"file-loader": "^6.2.0",
"inferno": "^7.4.8",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"jsdom": "^16.4.0",
"mini-css-extract-plugin": "^1.3.9",
"jsdom": "^16.5.2",
"mini-css-extract-plugin": "^1.4.0",
"sass": "^1.32.8",
"sass-loader": "^11.0.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1",
"typescript": "^4.2.3",
"url-loader": "^4.1.1",
"webpack": "^5.24.3",
"webpack": "^5.28.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0"
"webpack-cli": "^4.6.0"
}
}

View File

@@ -3,7 +3,7 @@
"name": "tgfont",
"version": "1.0.0",
"dependencies": {
"fantasticon": "^1.1.1"
"fantasticon": "^1.1.3"
},
"scripts": {
"build": "node mkdist.cjs && fantasticon --config config.cjs"

View File

@@ -9,6 +9,6 @@
"glob": "^7.1.6",
"source-map": "^0.7.3",
"stacktrace-parser": "^0.1.10",
"ws": "^7.4.3"
"ws": "^7.4.4"
}
}

View File

@@ -4,7 +4,7 @@
"version": "4.3.0",
"dependencies": {
"common": "workspace:*",
"dompurify": "^2.2.6",
"dompurify": "^2.2.7",
"inferno": "^7.4.8",
"tgui": "workspace:*",
"tgui-dev-server": "workspace:*",

View File

@@ -4,7 +4,7 @@
"version": "4.3.0",
"dependencies": {
"core-js": "^3.9.1",
"regenerator-runtime": "^0.13.7",
"regenerator-runtime": "^0.13.8",
"whatwg-fetch": "^3.6.2"
}
}

View File

@@ -4,7 +4,7 @@
"version": "4.3.0",
"dependencies": {
"common": "workspace:*",
"dompurify": "^2.2.6",
"dompurify": "^2.2.7",
"inferno": "^7.4.8",
"inferno-vnode-flags": "^7.4.8",
"marked": "^2.0.1",

File diff suppressed because it is too large Load Diff

View File

@@ -64,13 +64,21 @@ const yarn = args => {
});
};
/// Installs all tgui dependencies
/** Installs all tgui dependencies */
const taskYarn = new Task('yarn')
// The following dependencies skip what could be considered an important
// step in Yarn: it verifies the integrity of cache. With this setup, if
// cache ever becomes corrupted, your only option is to clean build.
.depends('tgui/.yarn/+(cache|releases|plugins|sdks)/**/*')
.depends('tgui/**/package.json')
.depends('tgui/yarn.lock')
// Phony target (automatically created at the end of the task)
.provides('tgui/.yarn/install-target')
.build(() => yarn(['install']));
/// Builds svg fonts
/** Builds svg fonts */
const taskTgfont = new Task('tgfont')
.depends('tgui/.yarn/install-state.gz')
.depends('tgui/.yarn/install-target')
.depends('tgui/packages/tgfont/**/*.+(js|cjs|svg)')
.depends('tgui/packages/tgfont/package.json')
.provides('tgui/packages/tgfont/dist/tgfont.css')
@@ -78,9 +86,9 @@ const taskTgfont = new Task('tgfont')
.provides('tgui/packages/tgfont/dist/tgfont.woff2')
.build(() => yarn(['workspace', 'tgfont', 'build']));
/// Builds tgui
/** Builds tgui */
const taskTgui = new Task('tgui')
.depends('tgui/.yarn/install-state.gz')
.depends('tgui/.yarn/install-target')
.depends('tgui/webpack.config.js')
.depends('tgui/**/package.json')
.depends('tgui/packages/**/*.+(js|cjs|ts|tsx|scss)')
@@ -93,9 +101,11 @@ const taskTgui = new Task('tgui')
await yarn(['run', 'webpack-cli', '--mode=production']);
});
/// Prepends the defines to the .dme.
/// Does not clean them up, as this is intended for TGS which
/// clones new copies anyway.
/**
* Prepends the defines to the .dme.
* Does not clean them up, as this is intended for TGS which
* clones new copies anyway.
*/
const taskPrependDefines = (...defines) => new Task('prepend-defines')
.build(async () => {
const dmeContents = fs.readFileSync(`${DME_NAME}.dme`);
@@ -169,7 +179,6 @@ const taskDm = (...injectedDefines) => new Task('dm')
// Add the actual dme content
const dme_content = fs.readFileSync(`${DME_NAME}.dme`)
fs.appendFileSync(`${DME_NAME}.mdme`, dme_content)
await exec(dmPath, [`${DME_NAME}.mdme`]);
// Rename dmb
fs.renameSync(`${DME_NAME}.mdme.dmb`, `${DME_NAME}.dmb`)

View File

@@ -69,6 +69,9 @@ class Task {
if (!this.script) {
return;
}
if (process.env.DEBUG && needsRebuild) {
console.debug(` Reason: ${needsRebuild}`);
}
console.warn(` => Starting '${this.name}'`);
const startedAt = Date.now();
// Run the script