Skip to content

Commit de00254

Browse files
committed
Initial commit
0 parents  commit de00254

11 files changed

+293
-0
lines changed

.gitignore

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
yarn.lock
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Microbundle cache
58+
.rpt2_cache/
59+
.rts2_cache_cjs/
60+
.rts2_cache_es/
61+
.rts2_cache_umd/
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
76+
# parcel-bundler cache (https://parceljs.org/)
77+
.cache
78+
79+
# Next.js build output
80+
.next
81+
82+
# Nuxt.js build / generate output
83+
.nuxt
84+
dist
85+
86+
# Gatsby files
87+
.cache/
88+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
89+
# https://nextjs.org/blog/next-9-1#public-directory-support
90+
# public
91+
92+
# vuepress build output
93+
.vuepress/dist
94+
95+
# Serverless directories
96+
.serverless/
97+
98+
# FuseBox cache
99+
.fusebox/
100+
101+
# DynamoDB Local files
102+
.dynamodb/
103+
104+
# TernJS port file
105+
.tern-port

.npmignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
src
2+
tsconfig.json
3+
*.spec*
4+
jest.config.js
5+
.vscode
6+
**/run*ts
7+
dist/run.*
8+
*.tgz

.vscode/launch.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Debug run",
9+
"type": "node",
10+
"request": "launch",
11+
"args": [
12+
"${workspaceRoot}/src/run.ts"
13+
],
14+
"runtimeArgs": [
15+
"-r",
16+
"ts-node/register"
17+
],
18+
"skipFiles": [
19+
"${workspaceFolder}/node_modules/**/*.js",
20+
"<node_internals>/**/*.js"
21+
],
22+
"smartStep": true,
23+
"cwd": "${workspaceRoot}",
24+
"protocol": "inspector",
25+
"internalConsoleOptions": "openOnSessionStart",
26+
"env": {
27+
"TS_NODE_IGNORE": "false"
28+
}
29+
},
30+
{
31+
"name": "Debug Jest",
32+
"type": "node",
33+
"request": "launch",
34+
"runtimeArgs": [
35+
"${workspaceRoot}/node_modules/.bin/jest",
36+
"--runInBand",
37+
"--coverage",
38+
"false"
39+
],
40+
"skipFiles": [
41+
"${workspaceFolder}/node_modules/**/*.js",
42+
"<node_internals>/**/*.js"
43+
],
44+
"smartStep": true,
45+
"console": "integratedTerminal",
46+
"internalConsoleOptions": "openOnSessionStart"
47+
}
48+
]
49+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 berhalak
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ts-template
2+
Typescript package template

jest.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
"roots": [
5+
"<rootDir>/src"
6+
]
7+
};

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@berhalak/ts-template",
3+
"private": false,
4+
"version": "0.0.1",
5+
"description": "Typescript template",
6+
"main": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"test": "jest",
10+
"build": "tsc",
11+
"compile": "tsc --noEmit",
12+
"watch": "jest --watch"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/berhalak/ts-template.git"
17+
},
18+
"author": "berhalak",
19+
"keywords": [],
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/berhalak/ts-template/issues"
23+
},
24+
"homepage": "https://github.com/berhalak/ts-template#readme",
25+
"devDependencies": {
26+
"@types/jest": "^25.1.2",
27+
"@types/node": "^13.7.1",
28+
"jest": "^25.1.0",
29+
"ts-jest": "^25.2.0",
30+
"ts-node": "^8.6.2",
31+
"typescript": "^3.7.5"
32+
}
33+
}

src/index.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test('sample test', () => {
2+
console.log("Hello from jest");
3+
})

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Works");

src/run.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Tests passed");

tsconfig.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"compilerOptions": {
3+
/* Basic Options */
4+
// "incremental": true, /* Enable incremental compilation */
5+
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
6+
"module": "CommonJS", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
7+
// "lib": [], /* Specify library files to be included in the compilation. */
8+
// "allowJs": true, /* Allow javascript files to be compiled. */
9+
// "checkJs": true, /* Report errors in .js files. */
10+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
11+
"declaration": true, /* Generates corresponding '.d.ts' file. */
12+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
13+
"sourceMap": true, /* Generates corresponding '.map' file. */
14+
// "outFile": "./", /* Concatenate and emit output to single file. */
15+
"outDir": "./dist", /* Redirect output structure to the directory. */
16+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
17+
// "composite": true, /* Enable project compilation */
18+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
19+
// "removeComments": true, /* Do not emit comments to output. */
20+
// "noEmit": true, /* Do not emit outputs. */
21+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
22+
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
24+
/* Strict Type-Checking Options */
25+
"strict": true, /* Enable all strict type-checking options. */
26+
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
27+
"strictNullChecks": false, /* Enable strict null checks. */
28+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
29+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
30+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
32+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
33+
/* Additional Checks */
34+
// "noUnusedLocals": true, /* Report errors on unused locals. */
35+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
36+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
37+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
38+
/* Module Resolution Options */
39+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
40+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
41+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
42+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
43+
// "typeRoots": [], /* List of folders to include type definitions from. */
44+
// "types": [], /* Type declaration files to be included in compilation. */
45+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
46+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
47+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
48+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
49+
/* Source Map Options */
50+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
51+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
52+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
53+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
54+
/* Experimental Options */
55+
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
56+
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
57+
/* Advanced Options */
58+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
59+
},
60+
"include": [
61+
"./src"
62+
]
63+
}

0 commit comments

Comments
 (0)