Tidy and improve dev scripts (#25978)
This commit is contained in:
parent
96c652ef08
commit
062e93a5d2
5 changed files with 180 additions and 33 deletions
|
@ -1,13 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
const fs = require("fs");
|
||||
const { exec } = require("node:child_process");
|
||||
import * as fs from "node:fs";
|
||||
import { exec } from "node:child_process";
|
||||
|
||||
const includeJSSDK = process.argv.includes("--include-js-sdk");
|
||||
const ignore = [];
|
||||
const ignore: string[] = [];
|
||||
|
||||
ignore.push(...Object.values(JSON.parse(fs.readFileSync(`${__dirname}/../components.json`))));
|
||||
ignore.push(...Object.values<string>(JSON.parse(fs.readFileSync(`${__dirname}/../components.json`, "utf-8"))));
|
||||
ignore.push("/index.ts");
|
||||
// We ignore js-sdk by default as it may export for other non element-web projects
|
||||
if (!includeJSSDK) ignore.push("matrix-js-sdk");
|
||||
|
@ -31,7 +30,7 @@ exec(command, (error, stdout, stderr) => {
|
|||
// won't have an "/" character at the start, so we try to fix that for
|
||||
// better UX
|
||||
// TODO: This might break on Windows
|
||||
lines = lines.reduce((newLines, line) => {
|
||||
lines = lines.reduce<string[]>((newLines, line) => {
|
||||
if (!line.startsWith("/")) newLines.push("/" + line);
|
||||
else newLines.push(line);
|
||||
return newLines;
|
|
@ -3,11 +3,11 @@
|
|||
// due to file associations in Windows.
|
||||
// Sorry.
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { mkdirpSync } = require("mkdirp");
|
||||
const fetch = require("node-fetch");
|
||||
const ProxyAgent = require("simple-proxy-agent");
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
import { mkdirpSync } from "mkdirp";
|
||||
import fetch from "node-fetch";
|
||||
import { ProxyAgent } from "proxy-agent";
|
||||
|
||||
console.log("Making webapp directory");
|
||||
mkdirpSync("webapp");
|
||||
|
@ -16,15 +16,12 @@ mkdirpSync("webapp");
|
|||
console.log("Downloading Jitsi script");
|
||||
const fname = path.join("webapp", "jitsi_external_api.min.js");
|
||||
|
||||
const options = {};
|
||||
if (process.env.HTTPS_PROXY) {
|
||||
options.agent = new ProxyAgent(process.env.HTTPS_PROXY, { tunnel: true });
|
||||
}
|
||||
|
||||
fetch("https://meet.element.io/libs/external_api.min.js", options)
|
||||
fetch("https://meet.element.io/libs/external_api.min.js", {
|
||||
agent: new ProxyAgent(),
|
||||
})
|
||||
.then((res) => {
|
||||
const stream = fs.createWriteStream(fname);
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
res.body.pipe(stream);
|
||||
res.body.on("error", (err) => reject(err));
|
||||
res.body.on("finish", () => resolve());
|
|
@ -1 +0,0 @@
|
|||
../../matrix-react-sdk/scripts/check-i18n.pl
|
Loading…
Add table
Add a link
Reference in a new issue