Add configuration and dependencies to support Typescript (#37)

This change adds basic, non-optimal support for Typescript with
webpack. It functions well in development mode and deployment boots
ProDOS. There are probably many ways this configuration can be sped
up, but I haven't investigated that yet.

Note that no Typescript files are added in this change; it is merely a
configuration change.
This commit is contained in:
Ian Flanigan 2020-10-18 01:53:33 +02:00 committed by GitHub
parent f5ad2cca16
commit e8cd85f54a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2790 additions and 539 deletions

13
jest.config.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
"roots": [
"js/",
"test/",
],
"testMatch": [
"**/?(*.)+(spec|test).+(ts|js)"
],
"transform": {
"^.+\\.js$": "babel-jest",
"^.+\\.ts$": "ts-jest"
},
}

3274
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,13 +26,17 @@
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@types/jest": "^26.0.14",
"ajv": "^6.12.0",
"babel-jest": "^25.1.0",
"eslint": "^6.8.0",
"file-loader": "^6.0.0",
"jest": "^25.1.0",
"jest": "^25.5.4",
"node-forge": "^0.10.0",
"raw-loader": "^4.0.0",
"ts-jest": "^26.4.1",
"ts-loader": "^8.0.5",
"typescript": "^4.0.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"

24
tsconfig.json Normal file
View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"strictNullChecks": true,
"outDir": "dist",
"baseUrl": ".",
"allowJs": true,
"paths": {
"*": [
"node_modules/*",
"src/types/*"
]
}
},
"include": [
"js/**/*"
]
}

View File

@ -39,6 +39,18 @@ module.exports =
},
],
},
{
test: /\.ts$/i,
use: [
{
loader: 'ts-loader'
},
],
exclude: /node_modules/,
}
],
},
resolve: {
extensions: ['.ts', '.js'],
},
};