Skip to content

Commit 875928c

Browse files
authored
fix: automated deployment! (#44)
fix: automated deployment!
2 parents dbebf03 + 493df27 commit 875928c

File tree

5 files changed

+733
-270
lines changed

5 files changed

+733
-270
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,21 @@ node_js:
33
- '10'
44

55
stages:
6-
- compile
76
- test
87
- name: deploy
98
if: branch = master
109

1110
jobs:
1211
include:
13-
- stage: compile
14-
script: yarn build
15-
1612
- stage: test
1713
script:
1814
- yarn lint
15+
# - commitlint-travis
1916
- yarn test
2017

2118
- stage: deploy
2219
script:
2320
- yarn build
2421
- yarn semantic-release
25-
- yarn deploy:documentation
2622

2723
cache: yarn

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import * as fireorm from 'fireorm';
2929
const serviceAccount = require('../firestore.creds.json');
3030

3131
admin.initializeApp({
32-
credential: admin.credential.cert(serviceAccount),
33-
databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`,
32+
credential: admin.credential.cert(serviceAccount),
33+
databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`,
3434
});
3535

3636
const firestore = admin.firestore();
3737
firestore.settings({
38-
timestampsInSnapshots: true,
38+
timestampsInSnapshots: true,
3939
});
4040
fireorm.Initialize(firestore);
4141
```
@@ -47,9 +47,9 @@ import { Collection } from 'fireorm';
4747

4848
@Collection()
4949
class Todo {
50-
id: string;
51-
text: string;
52-
done: Boolean;
50+
id: string;
51+
text: string;
52+
done: Boolean;
5353
}
5454
```
5555

@@ -60,9 +60,9 @@ import { Collection, getRepository } from 'fireorm';
6060

6161
@Collection()
6262
class Todo {
63-
id: string;
64-
text: string;
65-
done: Boolean;
63+
id: string;
64+
text: string;
65+
done: Boolean;
6666
}
6767

6868
const todoRepository = getRepository(Todo, firestore);
@@ -103,6 +103,10 @@ yarn test # or npm test
103103

104104
Test files must follow the naming convention `*.test.ts` and use [mocha](https://mochajs.org/) as the test runner.
105105

106+
### Committing
107+
108+
This repo uses [Conventional Commits](https://www.conventionalcommits.org/) as the commit messages convention.
109+
106110
### Release a new version
107111

108112
This repo uses [Sematic Release](https://github.com/semantic-release/semantic-release) to automatically release new versions as soon as they land on master.

package.json

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
11
{
22
"name": "fireorm",
3-
"version": "0.4.0",
43
"description": "ORM for Firestore",
4+
"version": "0.0.0-development",
5+
"author": "Willy Ovalle <[email protected]>",
6+
"homepage": "https://wovalle.github.io/fireorm/",
7+
"license": "ISC",
58
"main": "lib/src/index.js",
69
"types": "lib/src/index.d.ts",
10+
"bugs": {
11+
"url": "https://github.com/wovalle/fireorm/issues"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/wovalle/fireorm.git"
16+
},
17+
"keywords": [
18+
"firebase",
19+
"firestore",
20+
"orm"
21+
],
22+
"scripts": {
23+
"build": "tsc",
24+
"build:documentation": "typedoc --out docs --name fireorm --readme README.md --mode file --gaID UA-133856278-1 --excludeNotExported --exclude examples --exclude test",
25+
"build:watch": "tsc -w",
26+
"lint": "tslint --project tsconfig.json",
27+
"lint:md": "remark README.md -o README.md",
28+
"release": "semantic-release",
29+
"test": "mocha --require ts-node/register src/*.spec.ts --recursively",
30+
"test:watch": "mocha --require ts-node/register src/*.spec.ts --watch-extensions ts --recursively -w"
31+
},
732
"dependencies": {
833
"class-transformer": "^0.2.0",
934
"pluralize": "^7.0.0"
1035
},
1136
"devDependencies": {
37+
"@commitlint/cli": "^7.6.1",
38+
"@commitlint/config-conventional": "^7.6.0",
39+
"@commitlint/travis-cli": "^7.6.1",
1240
"@google-cloud/firestore": "^0.19.0",
41+
"@qiwi/semantic-release-gh-pages-plugin": "^1.9.1",
1342
"@types/chai": "^4.1.7",
1443
"@types/mocha": "^5.2.5",
1544
"@types/pluralize": "^0.0.29",
1645
"@types/sinon": "^7.0.6",
1746
"chai": "^4.2.0",
1847
"firebase-admin": "^6.5.0",
19-
"gh-pages-deploy": "^0.5.1",
48+
"husky": "^2.3.0",
2049
"mocha": "^5.2.0",
2150
"mock-cloud-firestore": "^0.9.0",
2251
"reflect-metadata": "^0.1.13",
@@ -28,40 +57,34 @@
2857
"typedoc": "^0.14.2",
2958
"typescript": "^3.2.2"
3059
},
31-
"scripts": {
32-
"lint": "tslint --project tsconfig.json",
33-
"lint:md": "remark README.md -o README.md",
34-
"build": "tsc",
35-
"build:watch": "tsc -w",
36-
"test": "mocha --require ts-node/register src/*.spec.ts --recursively",
37-
"test:watch": "mocha --require ts-node/register src/*.spec.ts --watch-extensions ts --recursively -w",
38-
"build:documentation": "typedoc --out docs --name fireorm --readme README.md --mode file --gaID UA-133856278-1 --excludeNotExported --exclude examples --exclude test",
39-
"deploy:documentation": "gh-pages-deploy"
40-
},
41-
"repository": {
42-
"type": "git",
43-
"url": "git+https://github.com/wovalle/fireorm.git"
60+
"peerDependencies": {
61+
"reflect-metadata": "^0.1.13"
4462
},
45-
"keywords": [
46-
"orm",
47-
"firestore",
48-
"firebase"
63+
"files": [
64+
"/lib",
65+
"!**/*.map",
66+
"!**/*.spec.*",
67+
"!**/examples/**",
68+
"!**/test/**"
4969
],
50-
"author": "Willy Ovalle <[email protected]>",
51-
"license": "ISC",
52-
"bugs": {
53-
"url": "https://github.com/wovalle/fireorm/issues"
70+
"commitlint": {
71+
"extends": [
72+
"@commitlint/config-conventional"
73+
]
5474
},
55-
"homepage": "https://wovalle.github.io/fireorm/",
56-
"gh-pages-deploy": {
57-
"staticpath": "docs",
58-
"prep": [
59-
"build:documentation"
60-
],
61-
"commit": "Releasing version",
62-
"noprompt": true
75+
"husky": {
76+
"hooks": {
77+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
78+
}
6379
},
64-
"peerDependencies": {
65-
"reflect-metadata": "^0.1.13"
80+
"release": {
81+
"branch": "master",
82+
"plugins": [
83+
"@semantic-release/npm",
84+
"@semantic-release/github",
85+
"@semantic-release/commit-analyzer",
86+
"@semantic-release/release-notes-generator",
87+
"@qiwi/semantic-release-gh-pages-plugin"
88+
]
6689
}
6790
}

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import QueryBuilder from './QueryBuilder';
22

33
// TODO: separate Read/Write interfaces to achieve readonly?
44
export interface IRepository<T extends { id: string }> {
5-
limit(limit: number): QueryBuilder<T>;
5+
limit(limitVal: number): QueryBuilder<T>;
66
findById(id: string): Promise<T>;
77
create(item: T): Promise<T>;
88
update(item: T): Promise<T>;

0 commit comments

Comments
 (0)