Create a basic typescript app

This commit is contained in:
Savanni D'Gerinel 2024-05-23 13:02:50 -04:00
parent 15c4ae9bad
commit f76ae2052d
8 changed files with 4793 additions and 2 deletions

View File

@ -34,13 +34,14 @@
pkgs.libadwaita pkgs.libadwaita
pkgs.librsvg pkgs.librsvg
pkgs.nodejs pkgs.nodejs
pkgs.nodePackages.eslint
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
pkgs.openssl pkgs.openssl
pkgs.pipewire pkgs.pipewire
pkgs.pkg-config pkgs.pkg-config
pkgs.rustup pkgs.rustup
pkgs.sqlite pkgs.sqlite
pkgs.cargo-nextest
pkgs.wasm-pack
pkgs.sqlx-cli pkgs.sqlx-cli
pkgs.udev pkgs.udev
pkgs.wasm-pack pkgs.wasm-pack

10
otg/pwa/.eslintrc.js Normal file
View File

@ -0,0 +1,10 @@
module.exports = {
env: {
node: true,
jest: true,
},
extends: ['plugin:@typescript-eslint/recommended', 'eslint:recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
}

5
otg/pwa/jest.config.js Normal file
View File

@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

4726
otg/pwa/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
otg/pwa/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "otg-pwa",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"build": "tsc",
"lint": "eslint ./src/**/.ts",
"test": "jest",
"test:watch": "jest --watch"
},
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.1.3"
}
}

11
otg/pwa/src/index.test.ts Normal file
View File

@ -0,0 +1,11 @@
import { getMessage } from './index'
describe('getMessage()', () => {
it('should return the correct message when called', () => {
expect(getMessage()).toBe('Hello, world')
})
it('should be super smart', () => {
expect(true).toBe(true)
})
})

3
otg/pwa/src/index.ts Normal file
View File

@ -0,0 +1,3 @@
const message: string = 'Hello, world'
export const getMessage = () => message

12
otg/pwa/tsconfig.json Normal file
View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs"
},
"rootDir": "./src",
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}