Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpatoilo committed Dec 28, 2016
0 parents commit 3920b7d
Show file tree
Hide file tree
Showing 16 changed files with 489 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
environment:
matrix:
- nodejs_version: 7
- nodejs_version: 6
- nodejs_version: 5
- nodejs_version: 4
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- npm i -g npm
- set PATH=%APPDATA%\npm;%PATH%
- npm i
matrix:
fast_finish: true
build: off
version: '{build}'
shallow_clone: true
clone_depth: 1
test_script: npm t
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.yml}]
indent_style = space
indent_size = 2
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": 2,
"quotes": ["error", "single"]
}
}
96 changes: 96 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing

We would love for you to contribute to Milligram and help us make this even better! Start reading this document to see it is not difficult as you might have imagined.


## Table of Contents

- [Open an Issue](#open-an-issue)
- [Submit a Pull Request](#submit-a-pull-request)
- [Building](#building)
- [Style Guide](#style-guide)
- [Test](#test)
- [Code of Conduct](#code-of-conduct)
- [License](#license)


## Open an Issue

[Open an Issue](https://github.com/milligram/milligram/issues/new) to report any problems or improvements. When necessary, use [Codepen](http://codepen.io/) to show the problem. Be sure to include some description to explain the problem.


## Submit a Pull Request

To submit a new feature, make sure that changes are done to the source code. [Follow our style guide](#style-guide) and do not forget the tests and attach the link [Codepen](http://codepen.io/) along with the description.

Try to solve a problem for each pull request, this increases the chances of acceptance. When in doubt, open a [new issue](#open-an-issue) so we can answer you. Look existing issues for ideas or to see if a similar issue has already been submitted.

1. Fork the Github repo: `git clone https://github.com/milligram/milligram.git`
1. Create a new branch: `git checkout -b issuenumber-feature-name`
1. Commit your changes: `git commit -m 'issuenumber-feature-name'`
1. Push to the branch: `git push origin my-feature-name`
1. Submit a pull request!

*Note: For issues relating to the site, please use the [milligram.github.io](https://github.com/milligram/milligram.github.io)*


## Building

First install [Node.js](https://nodejs.org/en/download/) for the build process. Now install all the dependencies, run `npm install` from the project directory. Once you have the dependencies installed, run `npm start`. This will run the build task which compiles the Sass files into Milligram.css file in the expanded and compressed version.


## Style Guide

Milligram use [Sass](http://sass-lang.com/) to give super powers to CSS. Look at how the code is being maintained, we must always be consistent. We try to follow best practices as much as possible. In addition, here are some tips you should follow:

- Properties and selectors are sorted in alphabetical order
- Always use tab to indentation, no spaces
- Always use single quote, i.e. `content: ''`
- Quote attribute values in selectors, i.e. `input[type='checkbox']`
- Avoid specifying units for zero-values, i.e. `margin: 0`
- Use `rem` unit instead of `px`
- Use lowercase and shorthand hex values, i.e. `#fff`
- Use one discrete selector per line in multi-selector rulesets
- Include a single space after colon and after each comma
- Separate each ruleset by a blank line
- Don't use prefixes, there is a task to generate this automatically

```sass
.selector-a,
.selector-b,
.selector-c,
.selector-d[type='text']
box-sizing: border-box
color: #333
content: ''
display: inline-block
font-family: 'Helvetica-Neue', 'Helvetica', 'Arial', sans-serif
margin-bottom: 0
margin-left: 5.0rem
.other-selector-a
background: #fff
.other-selector-b
background: #fff
&.increasing-the-specificity
color: #000
```

*Note: This style guide was inspired by [Idiomatic.css](https://github.com/necolas/idiomatic-css). Milligram uses an `.editorconfig` file, which most editors support, to enforce these coding standards.*


## Test

Breaking CSS is easy. Checking every responsive page element is hard. That's why Milligram uses automated visual regression testing for responsive web UI by comparing DOM screenshots at various viewport sizes. To view the comparison run `npm test` after making changes to the source code.


## Code of Conduct

Help us keep Milligram open and inclusive. Please read and follow our thoughts on [Code of Conduct](http://confcodeofconduct.com/).


## License

By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/milligram/milligram#license).
47 changes: 47 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
We would love for you to contribute to Milligram and help us make this even better! Start reading this [document](https://github.com/milligram/milligram/blob/master/.github/contributing.md) to see it is not difficult as you might have imagined.
Open an Issue
==============================
[Open an Issue](https://github.com/milligram/milligram/issues/new) to report any problems or improvements. When necessary, use [Codepen](http://codepen.io/) to show the problem. Be sure to include some description to explain the problem.
Code of Conduct
==============================
Help us keep Milligram open and inclusive. Please read and follow our thoughts on [Code of Conduct](http://confcodeofconduct.com/).
License
==============================
By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/milligram/milligram#license).
-->


### Version info

<!-- What versions of the following libraries are you using? Note that your issue may already
be fixed in the latest versions. -->

**Milligram:**

**Other (e.g. normalize.css, node.js, npm, bower, browser, operating system) (if applicable):**


### Test case

<!-- Provide code samples on [Codepen](http://codepen.io/). -->


### Steps to reproduce

<!-- Provide the steps needed to reproduce the issue given the above test case. -->


### Expected behavior

<!-- What is the expected behavior? -->


### Actual behavior

<!-- What is the actual behavior? -->
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
We would love for you to contribute to Milligram and help us make this even better! Start reading this [document](https://github.com/milligram/milligram/blob/master/.github/contributing.md) to see it is not difficult as you might have imagined.
Submit a Pull Request
==============================
To submit a new feature, make sure that changes are done to the source code. [Follow our style guide](https://github.com/milligram/milligram/blob/master/.github/contributing.md#style-guide) and do not forget the tests and attach the link [Codepen](http://codepen.io/) along with the description.
Try to solve a problem for each pull request, this increases the chances of acceptance. When in doubt, open a [new issue](https://github.com/milligram/milligram/blob/master/.github/contributing.md#open-an-issue) so we can answer you. Look existing issues for ideas or to see if a similar issue has already been submitted.
1. Fork the Github repo: `git clone https://github.com/milligram/milligram.git`
1. Create a new branch: `git checkout -b issuenumber-feature-name`
1. Commit your changes: `git commit -m 'issuenumber-feature-name'`
1. Push to the branch: `git push origin my-feature-name`
1. Submit a pull request!
*Note: For issues relating to the site, please use the [milligram.github.io](https://github.com/milligram/milligram.github.io)*
Code of Conduct
==============================
Help us keep Milligram open and inclusive. Please read and follow our thoughts on [Code of Conduct](http://confcodeofconduct.com/).
License
==============================
By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/milligram/milligram#license).
-->


### Description

<!-- Are you fixing a bug? Implementing a new feature? Updating the documentation? Describe here something about your changes. Don't forget to add the link to the open issue, or to other pull request related. -->

### Code sample

<!-- Provide code samples on [Codepen](http://codepen.io/). -->
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$RECYCLE.BIN/
*.cab
*.lnk
*.log
*.msi
*.msm
*.msp
*.pid
*.seed
*~
.AppleDB
.AppleDesktop
.AppleDouble
.DS_Store
.DocumentRevisions-V100
.LSOverride
.Spotlight-V100
.TemporaryItems
.Trash-*
.Trashes
.VolumeIcon.icns
._*
.apdisk
.directory
.fseventsd
.lock-wscript
.node_repl_history
.npm
.nyc_output
Desktop.ini
Icon
Network Trash Folder
Temporary Items
Thumbs.db
build/Release
coverage
ehthumbs.db
lib-cov
logs
node_modules
npm-debug.log*
pids
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- 7
- 6
- 5
- 4
before_install:
- npm i -g npm
11 changes: 11 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env node
'use strict'
const cli = require('../src/index')
const help = require('../src/help')
const version = require('../src/version')
const argv = process.argv.slice(2)

if (argv.indexOf('--version') !== -1 || argv.indexOf('-v') !== -1) version.init()
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1) help.init()
if (argv.indexOf('init') !== -1 || argv.indexOf('i') !== -1) cli.init(argv)
else help.init()
21 changes: 21 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright © 2016 CJ Patoilo <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "milligram-cli",
"version": "0.0.0",
"description": "A cli tool for getting started with Milligram.",
"homepage": "http://milligram.github.io",
"repository": "milligram/milligram-cli",
"license": "MIT",
"author": "CJ Patoilo <[email protected]>",
"bin": {
"milligram": "bin/cli.js"
},
"files": [
"bin/cli.js",
"src/help.js",
"src/index.js",
"src/version.js"
],
"keywords": [
"automation",
"boilerplate",
"cli",
"css",
"framework",
"milligram",
"npm",
"package",
"starter"
],
"ignore": [
".appveyor.yml",
".editorconfig",
".github",
".gitignore",
".travis.yml"
],
"dependencies": {
"shelljs": "^0.7.5"
},
"devDependencies": {
"ava": "^0.17.0",
"eslint": "^3.12.1",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^2.0.1",
"eslint-plugin-standard": "^2.0.1",
"nyc": "^10.0.0"
},
"engines": {
"node": ">=4"
},
"scripts": {
"ava": "nyc ava",
"eslint": "eslint -c .eslintrc src",
"test": "eslint && ava"
}
}
Loading

0 comments on commit 3920b7d

Please sign in to comment.