[chore] Introduce TypeScript; Tested out with HelpText.

This commit is contained in:
Steven Evans 2018-06-13 23:38:35 -04:00
parent ec862ec747
commit 3e1ec388e0
6 changed files with 922 additions and 1082 deletions

1961
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -62,6 +62,8 @@
"sinon": "^2.3.2", "sinon": "^2.3.2",
"source-map": "^0.7.3", "source-map": "^0.7.3",
"style-loader": "^0.21.0", "style-loader": "^0.21.0",
"ts-loader": "^4.4.1",
"typescript": "^2.9.2",
"url-loader": "^1.0.1", "url-loader": "^1.0.1",
"watchpack": "^1.6.0", "watchpack": "^1.6.0",
"webpack": "^4.12.0", "webpack": "^4.12.0",
@ -84,7 +86,7 @@
"start:dev": "webpack-dev-server", "start:dev": "webpack-dev-server",
"build": "webpack --mode production", "build": "webpack --mode production",
"build:dev": "webpack --mode development", "build:dev": "webpack --mode development",
"watch" : "webpack --watch --mode production", "watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development" "watch:dev": "webpack --watch --mode development"
}, },
"version": "0.35.1" "version": "0.35.1"

@ -1,5 +1,4 @@
/* HelpText.js */ export const TerminalHelpText =
let TerminalHelpText =
"Type 'help name' to learn more about the command 'name'<br><br>" + "Type 'help name' to learn more about the command 'name'<br><br>" +
'alias [-g] [name="value"] Create or display Terminal aliases<br>' + 'alias [-g] [name="value"] Create or display Terminal aliases<br>' +
"analyze Get information about the current machine <br>" + "analyze Get information about the current machine <br>" +
@ -34,7 +33,7 @@ let TerminalHelpText =
"top Displays all running scripts and their RAM usage<br>" + "top Displays all running scripts and their RAM usage<br>" +
'unalias "[alias name]" Deletes the specified alias<br>'; 'unalias "[alias name]" Deletes the specified alias<br>';
let HelpTexts = { export const HelpTexts = {
alias: 'alias [-g] [name="value"] <br>' + alias: 'alias [-g] [name="value"] <br>' +
"Create or display aliases. An alias enables a replacement of a word with another string. " + "Create or display aliases. An alias enables a replacement of a word with another string. " +
"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME " + "It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME " +
@ -213,5 +212,3 @@ let HelpTexts = {
"It is not necessary to differentiate between global and non-global aliases when using 'unalias'", "It is not necessary to differentiate between global and non-global aliases when using 'unalias'",
} }
export {TerminalHelpText, HelpTexts};

@ -9,7 +9,7 @@ import {executeDarkwebTerminalCommand,
import {Engine} from "./engine.js"; import {Engine} from "./engine.js";
import {FconfSettings, parseFconfSettings, import {FconfSettings, parseFconfSettings,
createFconf} from "./Fconf.js"; createFconf} from "./Fconf.js";
import {TerminalHelpText, HelpTexts} from "./HelpText.js"; import {TerminalHelpText, HelpTexts} from "./HelpText";
import {iTutorialNextStep, iTutorialSteps, import {iTutorialNextStep, iTutorialSteps,
iTutorialIsRunning, iTutorialIsRunning,
currITutorialStep} from "./InteractiveTutorial.js"; currITutorialStep} from "./InteractiveTutorial.js";

10
tsconfig.json Normal file

@ -0,0 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true
},
"exclude": [
"node_modules"
]
}

@ -2,7 +2,6 @@ var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
module.exports = (env, argv) => ({ module.exports = (env, argv) => ({
//mode: "development",
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.NODE_ENV': argv.mode === 'development' ? "\"development\"" : "\"production\"" 'process.env.NODE_ENV': argv.mode === 'development' ? "\"development\"" : "\"production\""
@ -28,7 +27,13 @@ module.exports = (env, argv) => ({
filename: "[name].bundle.js" filename: "[name].bundle.js"
}, },
module: { module: {
rules: [] rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/
}
]
}, },
optimization: { optimization: {
removeAvailableModules: true, removeAvailableModules: true,
@ -47,5 +52,12 @@ module.exports = (env, argv) => ({
}, },
devServer: { devServer: {
publicPath: "/dist", publicPath: "/dist",
},
resolve: {
extensions: [
".tsx",
".ts",
".js"
]
} }
}); });