forked from tools/josh
1
0
Fork 0

Update dependencies, fix compatibility issues

This commit is contained in:
Florine W. Dekker 2022-02-17 15:58:40 +01:00
parent ec6e5b01a1
commit 1c5927815a
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
10 changed files with 41 additions and 32 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 F.W. Dekker
Copyright (c) 2018 Florine W. Dekker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,8 +1,8 @@
{
"name": "fwdekker.com",
"version": "0.40.11",
"version": "0.40.12",
"description": "The source code of [my personal website](https://fwdekker.com/).",
"author": "F.W. Dekker",
"author": "Florine W. Dekker",
"browser": "dist/bundle.js",
"repository": {
"type": "git",
@ -18,17 +18,17 @@
"coverage": "nyc npm run test"
},
"dependencies": {
"js-cookie": "^2.2.1",
"js-cookie": "^3.0.1",
"js-sha256": "^0.9.0",
"semver": "^6.3.0"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/chai": "^4.2.21",
"@types/js-cookie": "^2.2.7",
"@types/mocha": "^9.0.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.0",
"@types/js-cookie": "^3.0.1",
"@types/mocha": "^9.1.0",
"@types/semver": "^6.2.1",
"chai": "^4.3.4",
"chai": "^4.3.6",
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"grunt-contrib-clean": "^2.0.0",
@ -36,15 +36,15 @@
"grunt-contrib-watch": "^1.1.0",
"grunt-focus": "^1.0.0",
"grunt-text-replace": "^0.4.0",
"grunt-webpack": "^4.0.3",
"jsdom": "^17.0.0",
"grunt-webpack": "^5.0.0",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^9.1.0",
"mocha": "^9.2.0",
"nyc": "^15.1.0",
"ts-loader": "^9.2.5",
"ts-node": "^10.2.1",
"typescript": "^4.3.5",
"webpack": "^5.51.1",
"webpack-cli": "^4.8.0"
"ts-loader": "^9.2.6",
"ts-node": "^10.5.0",
"typescript": "^4.5.5",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
}
}

View File

@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="F.W. Dekker" />
<meta name="author" content="Florine W. Dekker" />
<meta name="application-name" content="FWDekker" />
<meta name="description" content="F.W. Dekker's personal website" />
<meta name="description" content="Florine W. Dekker's personal website" />
<meta name="theme-color" content="#0033cc" />
<meta property="og:url" content="https://fwdekker.com/" />
<meta property="og:title" content="FWDekker" />
<meta property="og:description" content="F.W. Dekker's personal website">
<meta property="og:description" content="Florine W. Dekker's personal website">
<meta property="og:locale" content="en_GB" />
<title>FWDekker</title>

View File

@ -57,6 +57,9 @@ export class Commands {
localStreams.out = this.toStream(input.redirectTargets[1]) ?? localStreams.out;
localStreams.err = this.toStream(input.redirectTargets[2]) ?? localStreams.err;
} catch (error) {
if (!(error instanceof Error))
throw Error(`Error while processing redirection error:\n${error}`);
streams.err.writeLine(`Error while redirecting output:\n${error.message}`);
return ExitCode.MISC;
}
@ -136,9 +139,12 @@ export class Commands {
} else {
return this.interpretBinary(code, this.environment, this.userList, this.fileSystem);
}
} catch (e) {
console.error(`Failed to interpret script '${targetName}'.`, code, e);
return e;
} catch (error) {
if (!(error instanceof Error))
throw Error(`Error while processing interpretation error:\n${error}`);
console.error(`Failed to interpret script '${targetName}'.`, code, error);
return error;
}
}

View File

@ -39,13 +39,13 @@ export class FileSystem {
[
new User("root", HashProvider.default.hashPassword("g9PjKu"), "/root",
"You're a hacker, Harry!"),
new User("f", HashProvider.default.hashPassword("password"), undefined,
new User("florine", HashProvider.default.hashPassword("password"), undefined,
"Who are <i>you</i>?")
].map(it => User.toString(it)).join("\n") + "\n"
),
}),
"home": new Directory({
"f": new Directory({
"florine": new Directory({
"pgp-key.pub": new File("https://fwdkr.co/pgp", "lnk"),
"privacy-policy.lnk": new File("https://fwdekker.com/privacy/"),
"resume.pdf": new File("https://fwdkr.co/cv", "lnk"),

View File

@ -32,7 +32,7 @@ doAfterLoad(() => {
if (semver.lt(userVersion, latestVersion)) {
Persistence.reset();
Persistence.setWasUpdated(true); // Message is displayed after reload
location.reload(true);
location.reload();
throw new ExpectedGoodbyeError("Goodbye");
}

View File

@ -1,4 +1,4 @@
import * as Cookies from "js-cookie";
import Cookies from "js-cookie";
import {Environment} from "./Environment";
import {Directory, FileSystem, Node} from "./FileSystem";
import {InputHistory} from "./InputHistory";
@ -161,10 +161,10 @@ export class Persistence {
// Check user in environment
if (!environment.has("user")) {
environment.set("user", "f");
environment.set("user", "florine");
} else if (environment.get("user") !== "" && !userList.has(environment.get("user"))) {
console.warn(`Invalid user '${environment.get("user")}' in environment.`);
environment.set("user", "f");
environment.set("user", "florine");
}
// Set home directory

View File

@ -126,7 +126,7 @@ export class Shell {
const inputString = streams.ins.readLine().replace("\n", "");
if (inputString === "factory-reset") {
Persistence.reset();
location.reload(true);
location.reload();
throw new ExpectedGoodbyeError("Goodbye");
}
@ -163,6 +163,9 @@ export class Shell {
try {
inputs = InputParser.create(this.environment, this.fileSystem).parseCommands(inputString);
} catch (error) {
if (!(error instanceof Error))
throw Error(`Error while processing parsing error:\n${error}`);
streams.err.writeLine(`Could not parse input: ${error.message}`);
this.environment.set("status", "" + ExitCode.USAGE);
return;

View File

@ -2,9 +2,9 @@
"compilerOptions": {
"target": "es2019",
"strict": true,
// "noUncheckedIndexedAccess": true,
"allowSyntheticDefaultImports": true,
"rootDir": "./src/main/js/",
"outDir": "./dist/js/"
"outDir": "./dist/js/",
},
"include": [
"src/main/js/**/*.ts"