Skip to content

Commit 1b190cb

Browse files
committed
[chore] init commit 🔥
0 parents  commit 1b190cb

34 files changed

+1553
-0
lines changed

.circleci/config.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+
#
5+
6+
version: 2
7+
8+
defaults: &defaults
9+
working_directory: ~/fabrix
10+
docker:
11+
- image: circleci/node:10.0.0
12+
environment:
13+
POSTGRES_USER: root
14+
POSTGRES_PASSWORD: ""
15+
- image: circleci/postgres:9.6.2-alpine
16+
environment:
17+
POSTGRES_DB: Sequelize
18+
POSTGRES_USER: root
19+
POSTGRES_PASSWORD: ""
20+
21+
jobs:
22+
test:
23+
<<: *defaults
24+
steps:
25+
- checkout
26+
- run:
27+
name: update-npm
28+
command: 'sudo npm install -g npm@5'
29+
- restore_cache:
30+
key: dependency-cache-{{ checksum "package.json" }}
31+
- run:
32+
name: install-npm-wee
33+
command: npm install
34+
- run:
35+
name: install-npm-sqlite
36+
command: npm install [email protected]
37+
- save_cache:
38+
key: dependency-cache-{{ checksum "package.json" }}
39+
paths:
40+
- ./node_modules
41+
- run:
42+
name: test
43+
command: npm test
44+
- run:
45+
name: code-coverage
46+
command: './node_modules/.bin/nyc report --reporter=text-lcov'
47+
- store_artifacts:
48+
path: test-results.xml
49+
prefix: tests
50+
- store_artifacts:
51+
path: coverage
52+
prefix: coverage
53+
- store_test_results:
54+
path: test-results.xml
55+
- persist_to_workspace:
56+
root: ~/fabrix
57+
paths: .
58+
deploy:
59+
<<: *defaults
60+
steps:
61+
- attach_workspace:
62+
at: ~/fabrix
63+
- run:
64+
name: Authenticate with registry
65+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/fabrix/.npmrc
66+
- run:
67+
name: Publish package
68+
command: npm publish
69+
70+
workflows:
71+
version: 2
72+
test-deploy:
73+
jobs:
74+
- test:
75+
filters:
76+
tags:
77+
only: /^v.*/
78+
- deploy:
79+
requires:
80+
- test
81+
filters:
82+
tags:
83+
only: /^v.*/
84+
branches:
85+
ignore: /.*/

.github/CONTRIBUTING.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Contributing to Fabrix and Spools
2+
3+
This guide is designed to help you get off the ground quickly contributing to Fabrix, Spools and the Fabrix ecosystem. The goal of our community is to make it easy for members of all skill levels to contribute. This guide will help you write useful issues, propose eloquent feature requests, and submit top-notch code that can be merged quickly.
4+
5+
Maintaining a open source project is a labor of love, meaning the core maintainers of Fabrix or Spools are volunteering their time. Respecting the guidelines laid out below helps the maintainers be efficient and make the most of the time they spend working on the project. This, in turn, creates a better experience of working with Fabrix more enjoyable for the community at large.
6+
7+
8+
## Submitting Issues
9+
10+
> Fabrix is composed of a core library, [Fabrix](https://github.com/fabrix-app/fabrix), and a number of [Spools](https://github.com/fabrix-app), which have their own dedicated repositories. These repositories may also live outside the Fabrix-app official Github organization and NPM scope @fabrix.
11+
>
12+
> _*Please open issues with spools, generators, etc. in the relevant repository.*_
13+
>
14+
> This helps us stay on top of issues and keep organized.
15+
16+
When submitting an issue, please follow these simple instructions:
17+
18+
1. Search for issues similar to yours in [GitHub search](https://github.com/fabrix-app/fabrix/search?type=Issues) and [Google](https://www.google.nl/search?q=fabrix+app).
19+
2. Feature requests are welcome; see [Requesting Features](#requesting-features) below for submission guidelines.
20+
3. If there's an open issue, please contribute to that issue.
21+
4. If there's a closed issue, open a new issue and link the url of the already closed issue(s).
22+
5. If there is no issue, open a new issue and specify the following:
23+
- A short description of your issue in the title
24+
- The fabrix version (find this with in the package.json file)
25+
- Detailed explanation of how to recreate the issue, including necessary setup setps
26+
6. If you are experiencing more than one problem, create a separate issue for each one. If you think they might be related, please reference the other issues you've created.
27+
28+
## Submitting Features
29+
30+
> New feature requests should be made as pull requests to the `backlog` section of [ROADMAP.MD](https://github.com/fabrix-app/fabrix/blob/master/ROADMAP.md) or as issues on the `Backlog` milestone in the [issue queue](https://github.com/fabrix-app/fabrix/milestones/Backlog). We will monitor community discussion on these PRs and issues and if they are wanted by the community/fabrix devs, they will be merged. Further discussion is welcome even after a PR has been merged.
31+
32+
##### Submitting a new feature request
33+
1. First, look at the `backlog` table in [ROADMAP.MD](https://github.com/fabrix-app/fabrix/blob/master/ROADMAP.md) or the [Backlog Milestone](https://github.com/fabrix-app/fabrix/milestones/Backlog) in the issue queue and also search open pull requests in that file to make sure your change hasn't already been proposed. If it has, join the discussion.
34+
2. If it doesn't already exist, create a pull request editing the `backlog` table of [ROADMAP.MD](https://github.com/fabrix-app/fabrix/blob/master/ROADMAP.md).
35+
3. Start a discussion about why your feature should be built (or better yet, build it). Get feedback in the [Fabrix-app Gitter](https://gitter.im/fabrix-app/Lobby) Channel. The more feedback we get from our community, the better we are able to build the framework of your dreams :evergreen_tree:
36+
37+
## Writing Tests
38+
39+
Ideally, all code contributions should be accompanied by functional and/or unit tests (as appropriate).
40+
41+
Test Coverage:
42+
43+
| Edge (master branch) |
44+
|----------------------|
45+
| [![Coverage Status](https://coveralls.io/repos/fabrix-app/fabrix/badge.png)](https://coveralls.io/r/fabrix-app/fabrix) |
46+
47+
48+
## Code Submission Guidelines
49+
50+
The community is what makes Fabrix great, without you we wouldn't have come so far. But to help us keep our sanity and reach code-nirvana together, please follow these quick rules whenever contributing.
51+
52+
> Note: This section is based on the [Node.js contribution guide](https://github.com/joyent/node/blob/master/CONTRIBUTING.md#contributing).
53+
54+
###### Contributing to an Spool
55+
56+
If the Spool is in the Fabrix Github organization, please send feature requests, patches and pull requests to that organization. Other Spools may have their own contribution guidelines. Please follow the guidelines of the Spool you are contributing to.
57+
58+
###### Authoring a new Spool
59+
60+
You are welcome to author a new Spool at any time. Spools must inherit from the main [Spool](https://github.com/fabrix-app/fabrix) interface to inherit the API. Feel free to start work on a new spool, just make sure and do a thorough search on npm, Google and Github to make sure someone else hasn't already started working on the same thing.
61+
62+
It is recommended that you maintain your Spool in your own Github repository. If you would like to submit your Spool to be listed in the [Fabrix-app Github Organization](https://github.com/fabrix-app) and @fabrix NPM scope, please submit an issue to the [Fabrix Issue queue](https://github.com/fabrix-app/fabrix/issues).
63+
64+
###### Contributing to a generator
65+
66+
Fabrix generators are based upon a cli. Please follow the core best practices for contributing to generators. If it is located in a different repo, please send feature requests, patches, and issues there.
67+
68+
###### Contributing to core
69+
70+
Fabrix has several dependencies referenced in the `package.json` file that are not part of the project proper. Any proposed changes to those dependencies or _their_ dependencies should be sent to their respective projects (i.e. Sequelize etc.) Please do not send your patch or feature request to this repository, we cannot accept or fulfill it.
71+
72+
In case of doubt, open an issue in the [issue tracker](https://github.com/fabrix-app/fabrix/issues), ask your question in the [Gitter room](http://gitter.im/fabrix-app/Lobby). Especially if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with a project's roadmap. At the end of the day, we just want to be able to merge your code.
73+
74+
###### Submitting Pull Requests
75+
76+
0. If you don't know how to fork and PR, [Github has some great documentation](https://help.github.com/articles/using-pull-requests/). Here's the quick version:
77+
1. Fork the repo.
78+
2. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test!
79+
4. Make the tests pass and make sure you follow our syntax guidelines.
80+
5. Add a line of what you did to CHANGELOG.md (right under `master`).
81+
6. Push to your fork and submit a pull request to the appropriate branch
82+
83+
## Publishing Releases
84+
85+
All releases are tagged and published by the [Fabrix Maintainers](https://github.com/orgs/fabrix-app/teams) automatically via [Cicle-CI](https://circleci.com/gh/fabrix-app/fabrix). For a patch release, the deployment process is as follows:
86+
87+
1. Tag a release
88+
```sh
89+
$ npm version patch
90+
```
91+
92+
2. Push the tag upstream (the "fabrix-app" org)
93+
```sh
94+
$ git push upstream --tags
95+
```
96+
97+
3. Circle-CI will publish the release to npm.

.github/ISSUE_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#### Issue Description
2+
???
3+
4+
#### Environment
5+
- node version: ???
6+
- fabrix version: ???
7+
- operating system: ???

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#### Description
2+
???
3+
4+
#### Issues
5+
- resolves #???

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/.idea
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
7+
.nyc_output
8+
9+
dist
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
.grunt
24+
25+
# node-waf configuration
26+
.lock-wscript
27+
28+
# Compiled binary addons (http://nodejs.org/api/addons.html)
29+
build/Release
30+
31+
# Dependency directory
32+
/.tmp
33+
/test/*.sqlite
34+
node_modules
35+
36+
# Optional npm cache directory
37+
.npm
38+
39+
# Optional REPL history
40+
.node_repl_history

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 fabrix
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.
22+

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# spool-waterline
2+
3+
[![Gitter][gitter-image]][gitter-url]
4+
[![NPM version][npm-image]][npm-url]
5+
[![Build Status][ci-image]][ci-url]
6+
[![Test Coverage][coverage-image]][coverage-url]
7+
[![Dependency Status][daviddm-image]][daviddm-url]
8+
[![Follow @FabrixApp on Twitter][twitter-image]][twitter-url]
9+
10+
Loads Application Models (in `api/models`) into the Waterline ORM; Integrates with [spool-router](https://github.com/fabrix-app/spool-router) to
11+
generate Tapestries for routes.
12+
13+
## Usage
14+
15+
### Configure
16+
17+
```js
18+
// config/main.ts
19+
import { WaterlineSpool } from '@fabrix/spool-waterline'
20+
export const main = {
21+
// ...
22+
spools: [
23+
// ...other spools
24+
WaterlineSpool
25+
]
26+
}
27+
```
28+
29+
### Query
30+
31+
```js
32+
// api/services/BirthdayService.ts
33+
export class BirthdayService extends Service {
34+
/**
35+
* Finds people with the given birthday.
36+
* @return Promise
37+
* @example {
38+
* name: 'Ludwig Beethoven',
39+
* birthday: Sun Dec 16 1770 00:00:00 GMT-0500 (EST),
40+
* favoriteColors: [
41+
* { name: 'yellow', hex: 'ffff00' },
42+
* { name: 'black', hex: '000000' }
43+
* ]
44+
* }
45+
*/
46+
findPeopleWithBirthday (birthday) {
47+
return this.orm.Person.find({ birthday: birthday })
48+
.populate('favoriteColors')
49+
}
50+
}
51+
```
52+
53+
## Contributing
54+
We love contributions! Please check out our [Contributor's Guide](https://github.com/fabrix-app/fabrix/blob/master/CONTRIBUTING.md) for more
55+
information on how our projects are organized and how to get started.
56+
57+
58+
## License
59+
[MIT](https://github.com/fabrix-app/spool-waterline/blob/master/LICENSE)
60+
61+
[npm-image]: https://img.shields.io/npm/v/@fabrix/spool-waterline.svg?style=flat-square
62+
[npm-url]: https://npmjs.org/package/@fabrix/spool-waterline
63+
[ci-image]: https://img.shields.io/circleci/project/github/fabrix-app/spool-waterline/master.svg
64+
[ci-url]: https://circleci.com/gh/fabrix-app/spool-waterline/tree/master
65+
[daviddm-image]: http://img.shields.io/david/fabrix-app/spool-waterline.svg?style=flat-square
66+
[daviddm-url]: https://david-dm.org/fabrix-app/spool-waterline
67+
[gitter-image]: http://img.shields.io/badge/+%20GITTER-JOIN%20CHAT%20%E2%86%92-1DCE73.svg?style=flat-square
68+
[gitter-url]: https://gitter.im/fabrix-app/Lobby
69+
[twitter-image]: https://img.shields.io/twitter/follow/FabrixApp.svg?style=social
70+
[twitter-url]: https://twitter.com/FabrixApp
71+
[coverage-image]: https://img.shields.io/codeclimate/coverage/github/fabrix-app/spool-waterline.svg?style=flat-square
72+
[coverage-url]: https://codeclimate.com/github/fabrix-app/spool-waterline/coverage

0 commit comments

Comments
 (0)