~solomon/typescript-library-template

68e9d405c19214cae8c741bf90ed9566513abb5a — Solomon Victorino 3 months ago main
initial commit
4 files changed, 59 insertions(+), 0 deletions(-)

A .gitignore
A README.md
A package.json
A tsconfig.json
A  => .gitignore +5 -0
@@ 1,5 @@
dist/
node_modules/
tsconfig.tsbuildinfo

.DS_Store
\ No newline at end of file

A  => README.md +7 -0
@@ 1,7 @@
This is my TypeScript library config template.

-   Uses [ava](https://github.com/avajs/ava) for testing.
-   All TS code is under `src/`.
-   Tests are named \*.spec.ts.
-   The entry point is src/index.ts, or `dist/index.js` after compilation.
-   The module is compiled on installation, so it can be installed via git.

A  => package.json +34 -0
@@ 1,34 @@
{
    "name": "",
    "version": "0.0.0",
    "description": "",
    "main": "dist/index.js",
    "scripts": {
        "build": "tsc --incremental",
        "test": "npm run build && ava",
        "clean": "rm -rf dist/ tsconfig.tsbuildinfo",
        "prepare": "tsc"
    },
    "ava": {
        "files": [
            "src/**/*.spec.ts"
        ],
        "typescript": {
            "compile": false,
            "rewritePaths": {
                "src/": "dist/"
            }
        }
    },
    "repository": {
        "type": "git",
        "url": ""
    },
    "author": "",
    "license": "",
    "devDependencies": {
        "@ava/typescript": "^2.0.0",
        "ava": "^3.15.0",
        "typescript": "^4.4.4"
    }
}

A  => tsconfig.json +13 -0
@@ 1,13 @@
{
    "compilerOptions": {
        "target": "es2019",
        "module": "commonjs",
        "outDir": "dist/",
        "rootDir": "src/",
        "strict": true,
        "noFallthroughCasesInSwitch": true,
        "moduleResolution": "node",
        "esModuleInterop": true,
        "declaration": true
    }
}