Skip to content

Commit 92ec6b5

Browse files
Jest Framework + Some clean up and fixes (#6)
* Update package scripts * Update tsconfig.json * Update .gitignore * Create .npmignore * Delete .prettierignore * Update .prettierrc * Update .eslintrc * Create .eslintignore * Update README.md * Update build.yml - Renamed to Build - Changed matrix to use node 16.x * Update dependabot.yml - Removed target-branch * Update description * Added jest framework * Fixed prettier not fixing during linting. * Update build.yml to tests.yml The yarn command was already running the build script, so there was no need to call it twice.
1 parent d494ebc commit 92ec6b5

File tree

15 files changed

+2559
-180
lines changed

15 files changed

+2559
-180
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
2-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended"
5+
],
36
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint"],
7+
"plugins": [
8+
"@typescript-eslint",
9+
"prettier"
10+
],
11+
"rules": {
12+
"prettier/prettier": "warn"
13+
},
514
"root": true
6-
}
15+
}

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12-
target-branch: "dev"
1312
labels:
1413
- "npm dependencies"
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: CI
4+
name: Tests
55

66
on: ["push", "pull_request"]
77

88
jobs:
9-
build:
9+
tests:
1010

1111
runs-on: ubuntu-latest
1212

1313
strategy:
1414
matrix:
15-
node-version: [12.x, 14.x, 16.x]
15+
node-version: [16.x]
1616
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1717

1818
steps:
@@ -22,6 +22,5 @@ jobs:
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
cache: 'yarn'
25-
- run: yarn install --frozen-lockfile
26-
- run: yarn build
25+
- run: yarn --frozen-lockfile
2726
- run: yarn test

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# NPM
12
node_modules/
2-
dist/
3+
4+
# Sources
5+
dist/
6+
types/
7+
8+
# Archives
9+
*.tgz
10+
*.zip
11+
*.rar

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Github
2+
.git/
3+
.github/
4+
5+
# NPM
6+
node_modules/
7+
8+
# Sources
9+
src/
10+
tests/
11+
12+
# Files
13+
jest.config.ts
14+
tsconfig.json
15+
.eslintignore
16+
.eslintrc
17+
.prettierrc
18+
19+
# Archives
20+
*.tgz
21+
*.zip
22+
*.rar

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
23
"tabWidth": 4,
34
"singleQuote": true,
45
"trailingComma": "all",
5-
"printWidth": 120
6+
"printWidth": 120,
7+
"endOfLine": "auto",
8+
"bracketSpacing": true
69
}

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
# Typescript Base Project
22

3-
[![CI](https://github.com/MathieuGermain/ts-base-project/actions/workflows/build.yml/badge.svg)](https://github.com/MathieuGermain/ts-base-project/actions/workflows/build.yml)
3+
[![CI](https://github.com/MathieuGermain/ts-base-project/actions/workflows/tests.yml/badge.svg)](https://github.com/MathieuGermain/ts-base-project/actions/workflows/tests.yml)
44

5-
**Basic TypeScript template using yarn.**
6-
Includes: `ES6`, `Github Workflows`, `linting & prettier`.
5+
Strict TypeScript template using yarn / CommonJS / TypeScript / Jest / ESLint / Prettier / Github Actions
76

87
<br>
98

10-
## Create a repository
9+
## Create repository
1110

1211
Create repository from template using [GitHub CLI](https://cli.github.com/).
1312
```bash
14-
# Replace <new-repo-name> for your repository name.
13+
# Replace <new-repo-name> for your new repository name.
1514
gh repo create <new-repo-name> --template="MathieuGermain/ts-base-project"
1615
```
1716

1817
<br>
1918

20-
## Usages
19+
## Usage
2120

2221
Make sure you have **yarn** installed globally.
22+
> To learn more about **yarn** visit https://classic.yarnpkg.com/en/docs/getting-started
2323
```bash
2424
npm install --global yarn
2525
```
26-
> To learn more about **yarn** visit https://classic.yarnpkg.com/en/docs/getting-started
2726

28-
Install project dependencies.
27+
Install and build project.
2928
```bash
3029
yarn
3130
```
32-
33-
Build your project.
34-
```bash
35-
yarn build
36-
```

jest.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { Config } from '@jest/types';
2+
3+
// Sync object
4+
const config: Config.InitialOptions = {
5+
verbose: true,
6+
transform: {
7+
"^.+\\.tsx?$": "ts-jest",
8+
},
9+
};
10+
11+
export default config;

0 commit comments

Comments
 (0)