chore(code): fix more js & ts files

This commit is contained in:
Elian Doran
2024-12-22 15:45:54 +02:00
parent b321d99076
commit 7a2b5e731e
44 changed files with 574 additions and 574 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ async function copyNodeModuleFileOrFolder(source: string) {
}
const copy = async () => {
for (const srcFile of fs.readdirSync("build")) {
for (const srcFile of fs.readdirSync("build")) {
const destFile = path.join(DEST_DIR, path.basename(srcFile));
log(`Copying source ${srcFile} -> ${destFile}.`);
fs.copySync(path.join("build", srcFile), destFile, { recursive: true });
@@ -45,11 +45,11 @@ const copy = async () => {
for (const dir of srcDirsToCopy) {
log(`Copying ${dir}`);
await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir)));
}
}
/**
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
*/
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
*/
const publicDirsToCopy = [ "./src/public/app/doc_notes" ];
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
for (const dir of publicDirsToCopy) {
+1 -1
View File
@@ -22,4 +22,4 @@ export default {
};
`;
fs.writeFileSync("src/services/build.ts", output);
fs.writeFileSync("src/services/build.ts", output);
+5 -5
View File
@@ -1,14 +1,14 @@
/**
* @module
*
*
* The nightly version works uses the version described in `package.json`, just like any release.
* The problem with this approach is that production builds have a very aggressive cache, and
* usually running the nightly with this cached version of the application will mean that the
* user might run into module not found errors or styling errors caused by an old cache.
*
*
* This script is supposed to be run in the CI, which will update locally the version field of
* `package.json` to contain the date. For example, `0.90.9-beta` will become `0.90.9-test-YYMMDD-HHMMSS`.
*
*
*/
import { fileURLToPath } from "url";
@@ -33,7 +33,7 @@ function processVersion(version) {
function main() {
const scriptDir = dirname(fileURLToPath(import.meta.url));
const packageJsonPath = join(scriptDir, "..", "package.json");
// Read the version from package.json and process it.
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
const currentVersion = packageJson.version;
@@ -43,7 +43,7 @@ function main() {
// Write the adjusted version back in.
packageJson.version = adjustedVersion;
const formattedJson = JSON.stringify(packageJson, null, 4);
const formattedJson = JSON.stringify(packageJson, null, 4);
fs.writeFileSync(packageJsonPath, formattedJson);
}
+1 -1
View File
@@ -15,4 +15,4 @@ const sourceDir = "src/public";
chokidar
.watch(sourceDir)
.on("change", onFileChanged);
console.log(`Watching for changes to ${sourceDir}...`);
console.log(`Watching for changes to ${sourceDir}...`);