Skip to content

Commit 5a0273a

Browse files
authored
Migrate from private to public repository (#1)
* Support of lint, prettier and circleci
1 parent 121265d commit 5a0273a

37 files changed

+6957
-25
lines changed

.circleci/config.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# .circleci/config.yml
2+
defaults: &defaults
3+
executor:
4+
name: node/default
5+
working_directory: ~/project
6+
7+
version: 2.1
8+
orbs:
9+
node: circleci/[email protected]
10+
coverage-reporter: codacy/[email protected]
11+
jobs:
12+
build:
13+
<<: *defaults
14+
steps:
15+
- checkout
16+
- node/with-cache:
17+
steps:
18+
- run: npm install
19+
- persist_to_workspace:
20+
root: /home/circleci
21+
paths:
22+
- project/*
23+
test:
24+
<<: *defaults
25+
steps:
26+
- attach_workspace:
27+
at: /home/circleci
28+
- run: npm test
29+
- coverage-reporter/send_report:
30+
coverage-reports: 'coverage/lcov.info'
31+
project-token: ${CODACY_PROJECT_TOKEN}
32+
package:
33+
<<: *defaults
34+
steps:
35+
- attach_workspace:
36+
at: /home/circleci
37+
- run: npm run compile
38+
- persist_to_workspace:
39+
root: /home/circleci
40+
paths:
41+
- project/dist
42+
registry-config:
43+
<<: *defaults
44+
steps:
45+
- attach_workspace:
46+
at: /home/circleci
47+
- run:
48+
name: Authenticate with registry
49+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
50+
- persist_to_workspace:
51+
root: /home/circleci
52+
paths:
53+
- project/.npmrc
54+
deploy:
55+
<<: *defaults
56+
steps:
57+
- attach_workspace:
58+
at: /home/circleci
59+
- run: npm publish --access public
60+
deploy-rc:
61+
<<: *defaults
62+
steps:
63+
- attach_workspace:
64+
at: /home/circleci
65+
- run: npm publish --tag rc --access public
66+
workflows:
67+
main-workflow:
68+
jobs:
69+
- build:
70+
filters:
71+
tags:
72+
only: /^v\d+\.{1}\d+.{1}\d.*+/
73+
branches:
74+
only: /.*/
75+
- test:
76+
requires:
77+
- build
78+
filters:
79+
tags:
80+
only: /^v\d+\.{1}\d+.{1}\d.*+/
81+
branches:
82+
only: /.*/
83+
- package:
84+
requires:
85+
- test
86+
filters:
87+
tags:
88+
only: /^v\d+\.{1}\d+.{1}\d.*+/
89+
branches:
90+
ignore: /.*/
91+
- registry-config:
92+
requires:
93+
- package
94+
filters:
95+
tags:
96+
only: /^v\d+\.{1}\d+.{1}\d.*+/
97+
branches:
98+
ignore: /.*/
99+
- deploy:
100+
requires:
101+
- registry-config
102+
filters:
103+
tags:
104+
only: /^v\d+\.{1}\d+.{1}\d+/
105+
branches:
106+
ignore: /.*/
107+
- deploy-rc:
108+
requires:
109+
- registry-config
110+
filters:
111+
tags:
112+
only: /^v\d+\.{1}\d+.{1}\d+-{1}.*/
113+
branches:
114+
ignore: /.*/

.codacy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
exclude_paths:
3+
- '**.md'
4+
- '**/*.test.ts'
5+
- 'examples/**'
6+
- '**.json'

.commitlintrc.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
rules:
4+
header-max-length: [1, 'always', 72]
5+
type-enum:
6+
- 2
7+
- always
8+
- - ci
9+
- feat
10+
- fix
11+
- docs
12+
- style
13+
- refactor
14+
- perf
15+
- test
16+
- revert
17+
- chore
18+
help: |
19+
**Possible types**:
20+
`ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle CI, BrowserStack, SauceLabs)
21+
`feat`: Adds a new feature.
22+
`fix`: Solves a bug.
23+
`docs`: Adds or alters documentation. (example scopes: readme, worker, code_of_conduct, contributors)
24+
`style`: Improves formatting, white-space.
25+
`refactor`: Rewrites code without feature, performance or bug changes.
26+
`perf`: Improves performance.
27+
`test`: Adds or modifies tests. (example scopes: functionals, unit-tests)
28+
`revert`: Changes that reverting other changes
29+
`chore`: No production code change. Updating grunt tasks etc;

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.test.ts

.eslintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"tsconfigRootDir": ".",
6+
"project": ["./tsconfig.json"],
7+
"es6": true
8+
},
9+
"plugins": ["@typescript-eslint"],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"prettier/@typescript-eslint"
14+
],
15+
"rules": {
16+
"@typescript-eslint/no-explicit-any": 0,
17+
"@typescript-eslint/ban-ts-comment": 0
18+
}
19+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
# Coverage reports and tests
3+
.nyc_output
4+
coverage
5+
6+
# Dependency directory
7+
node_modules
8+
bower_components
9+
10+
# OS metadata
11+
.DS_Store
12+
Thumbs.db
13+
14+
# Ignore built ts files
15+
dist/**/*
16+
17+
# ignore yarn.lock
18+
yarn.lock
19+
20+
# Temporary folders
21+
temp
22+
23+
# Test compilation
24+
.temp

.mocharc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Mocha configuration
2+
recursive: true
3+
require:
4+
- ts-node/register
5+
- source-map-support/register
6+
spec: 'src/**/*.test.ts'

.nycrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"all": true,
4+
"include": [
5+
"src/**/*.ts"
6+
],
7+
"reporter": "lcov"
8+
}

.prettierrc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trailingComma: 'es5'
2+
tabWidth: 4
3+
semi: true
4+
singleQuote: true
5+
endOfLine: 'lf'

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:lts-alpine
2+
3+
LABEL maintainer="Ville De Montreal"
4+
ARG ENV=unknown
5+
ARG GIT_COMMIT=unknown
6+
7+
# GIT label of the packaged code
8+
LABEL GIT_COMMIT=${GIT_COMMIT}
9+
10+
# Work dir
11+
WORKDIR /mtl/app
12+
13+
# Copies the project files
14+
COPY . /mtl/app
15+
16+
# Install dependencies and compile
17+
RUN npm install --unsafe-perm && \
18+
npm run compile

0 commit comments

Comments
 (0)