Skip to content

Commit

Permalink
Merge 229f1a3 into 12b6414
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinkl committed Mar 18, 2019
2 parents 12b6414 + 229f1a3 commit b371fb2
Show file tree
Hide file tree
Showing 95 changed files with 4,000 additions and 1,055 deletions.
37 changes: 8 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: 2

jobs:
lint:
build:
working_directory: ~/tmp
docker:
- image: circleci/node:10.11.0
Expand All @@ -25,35 +24,15 @@ jobs:
- run:
name: Lint
command: yarn lint

build:
working_directory: ~/tmp
docker:
- image: circleci/node:10.11.0
steps:
- checkout
- run:
name: Install Latest Yarn
command: 'sudo npm install --global yarn@latest'
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Build Test
name: Run Build
command: yarn build


- run:
name: Run Unit Test
command: yarn test

workflows:
version: 2
install_and_lint:
lint-build:
jobs:
- lint
- build
38 changes: 38 additions & 0 deletions .github/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration for Lock Threads - https://github.com/dessant/lock-threads

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 365

# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false

# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []

# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: 'outdated'

# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false

# Limit to only `issues` or `pulls`
# only: issues

# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated

# pulls:
# daysUntilLock: 30

# Repository to extend settings from
# _extends: repo
8 changes: 5 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Maleo.JS Pull Request Template -->
<!-- Maleo.js Pull Request Template -->

<!-- IMPORTANT Please review https://github.com/airyrooms/maleo.js/blob/master/CONTRIBUTING.md for detailed contributing guidelines -->
<!-- Help with PRs can be found at (added soon) -->
Expand All @@ -8,8 +8,8 @@
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply. -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] Your pull request targets the `canary` branch of Maleo.JS.
- [ ] Branch starts with either `fix/`, `feature/`, `optimization/`, or `translate/` (e.g. `fix/build-issue`)
- [ ] Your pull request targets the `canary` branch of Maleo.js.
- [ ] Branch starts with either `fix/`, `feature/`, etc (e.g. `fix/build-issue`. [more info](https://github.com/airyrooms/maleo.js/blob/canary/CONTRIBUTING.md))
- [ ] You have only one commit (if not, [squash](http://forum.freecodecamp.org/t/how-to-squash-multiple-commits-into-one-with-git/13231) them into one commit).
- [ ] All new and existing tests pass the command `yarn test`. Use `git commit --amend` to amend any fixes.

Expand All @@ -20,6 +20,8 @@
- [ ] Optimization (non-breaking change which provides better optimization)
- [ ] Breaking change (fix or feature that would change existing functionality)
- [ ] Add new translation (feature adding new translations)
- [ ] Update Documentation (added new docs or doc updates)
- [ ] Other (<!-- Please write more info inside this parentheses --> )

#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply. -->
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,10 @@ package-lock.json
@types

.vscode

# ignore yarn lock on example
example/*/yarn.lock
example/*/package-lock.json

# OSX
.DS_Store
12 changes: 12 additions & 0 deletions .grenrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dataSource": "commits",
"groupBy": {
"Features:": ["feat"],
"Enhancements:": ["refactor", "perf", "build"],
"Bug Fixes:": ["fix"]
},
"ignoreIssuesWith": [
"wontfix",
"duplicate"
]
}
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: node_js
sudo: required
branches:
only:
- master
- canary
cache:
yarn: true

before_install:
- npm install --global yarn@1.10.1

script:
- yarn build
- yarn test:cov

before_deploy:
- echo "access=public" >> $HOME/.npmrc 2> /dev/null
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null

deploy:
- provider: script
skip_cleanup: true
script:
- bash publish-canary.sh
on:
branch: canary
- provider: script
skip_cleanup: true
script:
- echo "RELEASING STABLE"
on:
branch: master

# add post deploy to add git commit message and add tag
186 changes: 186 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Contributing Guidelines

Hello 👋!

Maleo.js is an un-opinionated framework to enable Universal Rendering in JavaScript using React with no hassle.

We are here to solve the time consuming setups Universal Rendering Required.

Feel free to contribute to this project. We are grateful for your contributions and we are excited to welcome you abroad!

Happy contributing 🎉!

### Setting Up Maleo.js in Local Environment

**Clone Repo to Local Machine**

[Fork](https://help.github.com/articles/fork-a-repo/) this repository to your GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local machine from forked repo.

```bash
$ git clone https://github.com/<username>/maleo.js.git
$ cd maleo.js
```

Add Maleo.js repo as upstream to keep your fork up to date

```bash
$ git remote add upstream https://github.com/airyrooms/maleo.js
```

Make sure you are currently on branch `canary`, if not you can run this command
```bash
$ git checkout canary
$ git pull upstream canary # sync with Maleo.js repo
```

**Setup**

Make sure you are using the same or higher version of [Node.js](https://nodejs.org/en/) from `.nvmrc` file. (more info about [nvm](https://github.com/creationix/nvm))

We are using [Yarn](https://yarnpkg.com/en/) as package manager

Install yarn as global dependency
```bash
$ npm install --global yarn
```
Should the install fails, use `sudo`

And then, install all the dependencies required by Maleo.js

```bash
$ yarn
```

After the installation finished, run `fix:bin` command to fix binary symlink issue
```bash
$ yarn fix:bin
```

---

***Before making any changes, please check our [issues list](https://github.com/airyrooms/maleo.js/issues), for issues that you want to solve.***

Create a new branch based on what kind of contribution you are going to do.

Here is the draft:
<!-- Do not translate this table -->
<table>
<tr>
<td> Contributing Type </td>
<td> Branch Prefix </td>
<td> Description </td>
</tr>
<tr>
<td> Fix </td>
<td> fix/< name > </td>
<td> Fixing current bug or issues </td>
</tr>
<tr>
<td> Feature </td>
<td> feature/< name > </td>
<td> Adding new feature </td>
</tr>
<tr>
<td> Optimization </td>
<td> optimization/< name > </td>
<td> Optimize current unoptimized code </td>
</tr>
<tr>
<td> Documentation </td>
<td> docs/< name > </td>
<td> Add or edit documentation related file </td>
</tr>
<tr>
<td> Translation </td>
<td> translate/< name > </td>
<td> Add or edit documentation's translation </td>
</tr>
</table>

For example if you want to contribute to fix bug in Maleo.js you need to create new branch with `fix/` as the prefix.

For example:
```bash
$ git checkout -b fix/webpack-bug
```

---

**Development**

You are now ready to contribute to Maleo.js. Yaay 🤓!

To build the module you can run this command:
```bash
$ yarn build
```

During development we are more likely watch our code changes, therefore we use this command:
```bash
$ yarn watch
```

The command above watches for every changes from folder `/packages/plugins` and `/packages/Maleo.js`

**Test**

For every new feature you are required to add unit test.

You can add the unit test on folder `test` with filename having `[feature-name].test.js` prefix.


Running test:
```bash
$ yarn test
```

**Commit and Push Changes**

Awesome 🎉!

You have arrived at this stage, you are almost ready to make your changes available for other people.

After you have made changes and tested, please don't commit the changes using `$ git commit`, instead use this command:
```bash
$ yarn commit
```

The command above will display a wizard for you to fill, it uses our standard commit message. After you have finished filling the answers, we will run [linting](https://stackoverflow.com/questions/8503559/what-is-linting) and `prettify` process to your code and stage those changes to the commit to make sure your code have the same formatting as the other.

If you have passed all the process above you can now push your changes! 😙

```bash
$ git push
```

**Making Pull Request**

YEAH!! 🎉🎉 You are ready to make your changes available for other people

Your code are now available in your repository, but it's time to make a [Pull Request](https://help.github.com/articles/about-pull-requests/) to Maleo.js

## FAQ
<details>
<summary>How to test Maleo.js on local development machine in the <code>example</code> directory?</summary>
Maleo.js is utilizing <a href="https://github.com/lerna/lerna">Lerna</a> and <a href="https://yarnpkg.com/lang/en/docs/workspaces/">Yarn Workspace</a> to manage the mono repo structure.
So you can use the Maleo.js inside <code>package</code> folder or <code>example</code> folder. Because Yarn Workspace and Lerna has hoisted all the dependencies into root directory. Therefore every app inside <code>example</code> able to add symlinked Maleo.js as dependency.
</details>

<br/>

<details>
<summary>How to test Maleo.js on your own app during development?</summary>
You can run this command inside <code>packages/Maleo.js</code> directory
<pre>
$ yarn link # if you are using yarn on your app
$ npm link # if you are using npm on your app</pre>
And then go to your app directory and add <code>@airy/maleo.js</code> to your own app's <code>package.json</code> and run this command:
<pre>$ yarn link @airy/maleo.js</pre>
And you are good to go! Maleo.js are now living in your <code>node_modules</code> directory as a symlinked module

more:
<ul>
<li><a href="https://yarnpkg.com/lang/en/docs/cli/link/">Yarn Link</a></li>
<li><a href="https://docs.npmjs.com/cli/link.html">NPM Link</a></li>
</ul>
</details>
1 change: 1 addition & 0 deletions README.md
6 changes: 3 additions & 3 deletions example/playground/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import { Document, Header, Main, Scripts } from '@airy/maleo/lib/render/_document';
import { ReduxScript } from '@airy/with-redux-plugin';
import { default as Document, Header, Main, Scripts } from '@airy/maleo/document';
import { ReduxScript } from '@airy/maleo-redux-plugin';

export class MyDocument extends Document {
export default class MyDocument extends Document {
static getInitialProps = async (ctx) => {
const initialProps = await Document.getInitialProps(ctx);

Expand Down
Loading

0 comments on commit b371fb2

Please sign in to comment.