Skip to content

Commit 7a0ed54

Browse files
authored
Remove rimraf (#32618)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent a991509 commit 7a0ed54

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@
252252
"prettier": "3.8.1",
253253
"process": "^0.11.10",
254254
"raw-loader": "^4.0.2",
255-
"rimraf": "^6.0.0",
256255
"semver": "^7.5.2",
257256
"source-map-loader": "^5.0.0",
258257
"stylelint": "^17.0.0",

pnpm-lock.yaml

Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

project.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
"projectType": "application",
44
"implicitDependencies": ["@element-hq/web-shared-components"],
55
"targets": {
6-
"clean": {
7-
"command": "rimraf webapp",
8-
"outputs": ["{projectRoot}/webapp/"]
9-
},
106
"prebuild:i18n": {
117
"cache": true,
128
"command": "node scripts/copy-res.ts",
13-
"dependsOn": ["clean"],
149
"inputs": ["{projectRoot}/src/i18n/strings/*.json"],
1510
"outputs": ["{projectRoot}/webapp/i18n/"]
1611
},
@@ -35,12 +30,11 @@
3530
},
3631
"start:i18n": {
3732
"command": "node scripts/copy-res.ts -w",
38-
"dependsOn": ["clean"],
3933
"continuous": true
4034
},
4135
"start": {
4236
"command": "webpack-dev-server --disable-interpret --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
43-
"dependsOn": ["prebuild:*", "start:i18n", "^start"],
37+
"dependsOn": ["prebuild:module_system", "prebuild:rethemendex", "start:i18n", "^start"],
4438
"continuous": true
4539
},
4640
"lint:types": {

scripts/copy-res.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as chokidar from "chokidar";
77
import * as fs from "node:fs";
88
import _ from "lodash";
99
import webpack from "webpack";
10-
import type { Translations } from "matrix-web-i18n";
10+
import { type Translations } from "matrix-web-i18n";
1111

1212
const EW_I18N_BASE_PATH = "src/i18n/strings/";
1313
const SC_I18N_BASE_PATH = "packages/shared-components/src/i18n/strings/";
@@ -28,16 +28,13 @@ function errCheck(err: unknown): void {
2828
}
2929
}
3030

31-
// Check if webapp exists
32-
if (!fs.existsSync("webapp")) {
33-
fs.mkdirSync("webapp");
34-
}
35-
// Check if i18n exists
36-
if (!fs.existsSync("webapp/i18n/")) {
37-
fs.mkdirSync("webapp/i18n/");
31+
const I18N_DEST = "webapp/i18n/";
32+
// Check if webapp/i18n exists
33+
if (!fs.existsSync(I18N_DEST)) {
34+
fs.mkdirSync(I18N_DEST, { recursive: true });
3835
}
3936

40-
const logWatch = (path: string) => {
37+
const logWatch = (path: string): void => {
4138
if (verbose) {
4239
console.log(`Watching: ${path}`);
4340
}
@@ -72,7 +69,7 @@ function prepareLangFile(lang: string): [filename: string, json: string] {
7269
return [filename, json];
7370
}
7471

75-
function genLangFile(dest: string, filename: string, json: string) {
72+
function genLangFile(dest: string, filename: string, json: string): void {
7673
fs.writeFileSync(dest + filename, json);
7774
if (verbose) {
7875
console.log("Generated language file: " + filename);
@@ -139,7 +136,6 @@ function watchLanguage(lang: string, dest: string, langFileMap: Record<string, s
139136
}
140137

141138
// language resources
142-
const I18N_DEST = "webapp/i18n/";
143139
const I18N_FILENAME_MAP = INCLUDE_LANGS.reduce<Record<string, string>>((m, l) => {
144140
const [filename, json] = prepareLangFile(l);
145141
if (!watch) {

0 commit comments

Comments
 (0)