generated from dustin-jw/cohort-project-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8f20ca5
Showing
60 changed files
with
20,485 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
version: "2" # required to adjust maintainability checks | ||
|
||
checks: | ||
argument-count: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
complex-logic: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
file-lines: | ||
enabled: true | ||
config: | ||
threshold: 250 | ||
method-complexity: | ||
enabled: true | ||
config: | ||
threshold: 5 | ||
method-count: | ||
enabled: true | ||
config: | ||
threshold: 20 | ||
method-lines: | ||
enabled: true | ||
config: | ||
threshold: 25 | ||
nested-control-flow: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
return-statements: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
similar-code: | ||
enabled: true | ||
config: | ||
threshold: #language-specific defaults. overrides affect all languages. | ||
identical-code: | ||
enabled: true | ||
config: | ||
threshold: #language-specific defaults. overrides affect all languages. | ||
|
||
engines: | ||
duplication: | ||
enabled: true | ||
exclude_paths: | ||
- "**/*.test.*" | ||
|
||
# plugins: | ||
# eslint: | ||
# enabled: true | ||
# channel: "eslint-6" | ||
# rubocop: | ||
# enabled: true | ||
# channel: "rubocop-0-79" | ||
|
||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "Tests/" | ||
- "**/vendor/" | ||
- "**/*_test.go" | ||
- "**/*.d.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# get this from rollbar.com | ||
ROLLBAR_ACCESS_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"tsconfigRootDir": ".", | ||
"project": [ | ||
"./tsconfig.json" | ||
] | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"airbnb-base", | ||
"airbnb-typescript/base" | ||
], | ||
"rules": { | ||
"import/prefer-default-export": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Create and publish a Docker image | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Notify deploy to Rollbar | ||
uses: rollbar/[email protected] | ||
id: rollbar_deploy | ||
with: | ||
environment: 'development' | ||
version: ${{ github.sha }} | ||
env: | ||
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }} | ||
ROLLBAR_USERNAME: ${{ github.actor }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Code Quality | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install npm dependencies | ||
run: npm ci | ||
- name: lint | ||
run: npm run lint | ||
- name: test | ||
run: npm run test:ci | ||
- name: report coverage | ||
run: ./scripts/test-cc-report.sh | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Notify deploy to Rollbar | ||
uses: rollbar/[email protected] | ||
id: rollbar_deploy | ||
with: | ||
environment: 'production' | ||
version: ${{ github.sha }} | ||
env: | ||
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }} | ||
LOCAL_USERNAME: ${{ github.actor }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
dist | ||
coverage | ||
.env | ||
|
||
# stryker temp files | ||
.stryker-tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": [ | ||
"stylelint-config-recommended", | ||
"stylelint-config-recommended-scss" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM node:16 | ||
|
||
WORKDIR /var/www/html | ||
|
||
COPY . /var/www/html | ||
|
||
RUN npm ci | ||
RUN npm run clean | ||
RUN npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Cohort Project Starter | ||
|
||
Use this template for projects using Express to serve up basic content. | ||
|
||
## Getting Started | ||
|
||
Clone this repo or [generate a new repo using this template](https://github.com/dustin-jw/cohort-project-starter/generate). Then, install dependencies and choose whether to run in development or production mode. | ||
|
||
```sh | ||
npm ci | ||
``` | ||
|
||
To run in development mode: | ||
|
||
```sh | ||
npm start | ||
``` | ||
|
||
To run in production mode: | ||
```sh | ||
docker-compose up | ||
|
||
# or to run it in detached mode | ||
|
||
docker-compose up -d | ||
``` | ||
|
||
To lint and run tests: | ||
|
||
```sh | ||
npm run lint | ||
|
||
npm run test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.7" | ||
|
||
services: | ||
web: | ||
build: . | ||
container_name: starter-web | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- .:/var/www/html | ||
command: npm run dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.7" | ||
|
||
services: | ||
web: | ||
build: . | ||
container_name: starter-web | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- .:/var/www/html | ||
command: npm run serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build: | ||
docker: | ||
web: Dockerfile | ||
run: | ||
web: npm run serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
setupFiles: [ | ||
'<rootDir>/jest.setEnvVars.js', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
process.env.NODE_ENV = 'test'; | ||
process.env.ROLLBAR_ACCESS_TOKEN = 'mustBe32CharacterLongAccessToken'; |
Oops, something went wrong.