Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 98257c0

Browse files
author
Brian Muenzenmeyer
authored
Merge pull request #4 from pattern-lab/dev
v1.0.0
2 parents 68a8605 + e075c39 commit 98257c0

File tree

98 files changed

+4838
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+4838
-4
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
tab_width = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.eslintrc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"builtin": true
5+
},
6+
"globals": {},
7+
"rules": {
8+
"block-scoped-var": 0,
9+
"camelcase": 0,
10+
"comma-spacing": [1, {"before": false, "after": true}],
11+
"consistent-return": 2,
12+
"curly": [2, "all"],
13+
"dot-notation": [1, { "allowKeywords": true }],
14+
"eqeqeq": [2, "allow-null"],
15+
"global-strict": [0, "never"],
16+
"guard-for-in": 2,
17+
"indent": [1, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
18+
"lines-around-comment": [1, {
19+
"beforeBlockComment": true,
20+
"beforeLineComment": true,
21+
"allowBlockStart": true,
22+
"allowObjectStart": true,
23+
"allowArrayStart": true
24+
}],
25+
"key-spacing": 0,
26+
"keyword-spacing": 1,
27+
"new-cap": 0,
28+
"no-alert": 2,
29+
"no-bitwise": 2,
30+
"no-caller": 2,
31+
"no-cond-assign": [2, "except-parens"],
32+
"no-debugger": 2,
33+
"no-dupe-args": 2,
34+
"no-dupe-keys": 2,
35+
"no-empty": 2,
36+
"no-eval": 2,
37+
"no-extend-native": 2,
38+
"no-extra-bind": 2,
39+
"no-extra-parens": 0,
40+
"no-extra-semi": 2,
41+
"no-func-assign": 2,
42+
"no-implied-eval": 2,
43+
"no-invalid-regexp": 2,
44+
"no-irregular-whitespace": 1,
45+
"no-iterator": 2,
46+
"no-loop-func": 2,
47+
"no-mixed-requires": 0,
48+
"no-multi-str": 2,
49+
"no-multi-spaces": 1,
50+
"no-native-reassign": 2,
51+
"no-new": 2,
52+
"no-param-reassign": 1,
53+
"no-proto": 2,
54+
"no-redeclare": 0,
55+
"no-script-url": 2,
56+
"no-self-assign": 2,
57+
"no-self-compare": 2,
58+
"no-sequences": 2,
59+
"no-shadow": 2,
60+
"no-undef": 2,
61+
"no-underscore-dangle": 0,
62+
"no-unreachable": 1,
63+
"no-unused-vars": 1,
64+
"no-use-before-define": 1,
65+
"no-useless-call": 2,
66+
"no-useless-concat": 2,
67+
"no-with": 2,
68+
"quotes": [0, "single"],
69+
"radix": 2,
70+
"semi": [0, "never"],
71+
"strict": 0,
72+
"space-before-blocks": 1,
73+
"space-before-function-paren": [1, {
74+
"anonymous": "always",
75+
"named": "never"
76+
}],
77+
"space-in-parens": [1, "never"],
78+
"space-infix-ops": 1,
79+
"valid-typeof": 2,
80+
"vars-on-top": 0,
81+
"wrap-iife": [2, "inside"]
82+
}
83+
}

.github/CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing to Patternlab Node
2+
If you'd like to contribute to Pattern Lab Node, please do so! There is always a lot of ground to cover and something for your wheelhouse.
3+
4+
No pull request is too small. Check out any [up for grabs issues](https://github.com/pattern-lab/patternlab-node/labels/up%20for%20grabs) as a good way to get your feet wet, or add some more unit tests.
5+
6+
## Guidelines
7+
1. Please keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier.
8+
2. _ALWAYS_ submit pull requests against the [dev branch](https://github.com/pattern-lab/patternlab-node/tree/dev). If this does not occur, I will first, try to redirect you gently, second, port over your contribution manually if time allows, and/or third, close your pull request. If you have a major feature to stabilize over time, talk to @bmuenzenmeyer about making a dedicated `feature-branch`
9+
3. If you can, add some unit tests using the existing patterns in the `./test` directory
10+
11+
##Coding style
12+
Two files combine within the project to define and maintain our coding style.
13+
14+
* The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/).
15+
* The `.eslintrc` defines our javascript standards. Some editors will evaluate this real-time - otherwise it's run using `grunt|gulp build`

.github/ISSUE_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- before posting an issue, try chatting on https://gitter.im/pattern-lab/node -->
2+
<!-- before posting an issue, verify you are running at least Node 4 or 5 AND Gulp 4 -->
3+
4+
I am using Edition Node Gulp `vX.X.X` on `Windows | Mac | Linux`, with Node `vX.X.X`, Gulp-CLI `vX.X.X` and Gulp `vX.X.X`.
5+
6+
##### Expected Behavior
7+
8+
9+
##### Actual Behavior
10+
11+
12+
##### Steps to Reproduce

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- **Please read the contribution guidelines first, and target the `dev` branch!** -->
2+
3+
Addresses #
4+
5+
Summary of changes:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
.DS_Store
3+
patternlab.json
4+
.sass-cache/*
5+
/sass-cache
6+
Thumbs.db
7+
.idea/
8+
public

Gruntfile.js

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/******************************************************
2+
* PATTERN LAB NODE
3+
* EDITION-NODE-GRUNT
4+
* The grunt wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.
5+
******************************************************/
6+
7+
module.exports = function (grunt) {
8+
9+
var path = require('path'),
10+
argv = require('minimist')(process.argv.slice(2));
11+
12+
// load all grunt tasks
13+
grunt.loadNpmTasks('grunt-contrib-copy');
14+
grunt.loadNpmTasks('grunt-contrib-watch');
15+
grunt.loadNpmTasks('grunt-browser-sync');
16+
17+
/******************************************************
18+
* PATTERN LAB CONFIGURATION
19+
******************************************************/
20+
21+
//read all paths from our namespaced config file
22+
var config = require('./patternlab-config.json'),
23+
pl = require('patternlab-node')(config);
24+
25+
function paths() {
26+
return config.paths;
27+
}
28+
29+
function getConfiguredCleanOption() {
30+
return config.cleanPublic;
31+
}
32+
33+
grunt.registerTask('patternlab', 'create design systems with atomic design', function (arg) {
34+
35+
if (arguments.length === 0) {
36+
pl.build(function(){}, getConfiguredCleanOption());
37+
}
38+
39+
if (arg && arg === 'version') {
40+
pl.version();
41+
}
42+
43+
if (arg && arg === "patternsonly") {
44+
pl.patternsonly(function(){},getConfiguredCleanOption());
45+
}
46+
47+
if (arg && arg === "help") {
48+
pl.help();
49+
}
50+
51+
if (arg && arg === "starterkit-list") {
52+
pl.liststarterkits();
53+
}
54+
55+
if (arg && arg === "starterkit-load") {
56+
pl.loadstarterkit(argv.kit);
57+
}
58+
59+
if (arg && (arg !== "version" && arg !== "patternsonly" && arg !== "help" && arg !== "starterkit-list" && arg !== "starterkit-load")) {
60+
pl.help();
61+
}
62+
});
63+
64+
65+
grunt.initConfig({
66+
67+
/******************************************************
68+
* COPY TASKS
69+
******************************************************/
70+
copy: {
71+
main: {
72+
files: [
73+
{ expand: true, cwd: path.resolve(paths().source.js), src: '**/*.js', dest: path.resolve(paths().public.js) },
74+
{ expand: true, cwd: path.resolve(paths().source.css), src: '*.css', dest: path.resolve(paths().public.css) },
75+
{ expand: true, cwd: path.resolve(paths().source.images), src: '*', dest: path.resolve(paths().public.images) },
76+
{ expand: true, cwd: path.resolve(paths().source.fonts), src: '*', dest: path.resolve(paths().public.fonts) },
77+
{ expand: true, cwd: path.resolve(paths().source.root), src: 'favicon.ico', dest: path.resolve(paths().public.root) },
78+
{ expand: true, cwd: path.resolve(paths().source.styleguide), src: ['*', '**'], dest: path.resolve(paths().public.root) },
79+
// slightly inefficient to do this again - I am not a grunt glob master. someone fix
80+
{ expand: true, flatten: true, cwd: path.resolve(paths().source.styleguide, 'styleguide', 'css', 'custom'), src: '*.css)', dest: path.resolve(paths().public.styleguide, 'css') }
81+
]
82+
}
83+
},
84+
/******************************************************
85+
* SERVER AND WATCH TASKS
86+
******************************************************/
87+
watch: {
88+
all: {
89+
files: [
90+
path.resolve(paths().source.css + '**/*.css'),
91+
path.resolve(paths().source.styleguide + 'css/*.css'),
92+
path.resolve(paths().source.patterns + '**/*'),
93+
path.resolve(paths().source.fonts + '/*'),
94+
path.resolve(paths().source.images + '/*'),
95+
path.resolve(paths().source.data + '*.json'),
96+
path.resolve(paths().source.js + '/*.js'),
97+
path.resolve(paths().source.root + '/*.ico')
98+
],
99+
tasks: ['default', 'bsReload:css']
100+
}
101+
},
102+
browserSync: {
103+
dev: {
104+
options: {
105+
server: path.resolve(paths().public.root),
106+
watchTask: true,
107+
watchOptions: {
108+
ignoreInitial: true,
109+
ignored: '*.html'
110+
},
111+
snippetOptions: {
112+
// Ignore all HTML files within the templates folder
113+
blacklist: ['/index.html', '/', '/?*']
114+
},
115+
plugins: [
116+
{
117+
module: 'bs-html-injector',
118+
options: {
119+
files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
120+
}
121+
}
122+
],
123+
notify: {
124+
styles: [
125+
'display: none',
126+
'padding: 15px',
127+
'font-family: sans-serif',
128+
'position: fixed',
129+
'font-size: 1em',
130+
'z-index: 9999',
131+
'bottom: 0px',
132+
'right: 0px',
133+
'border-top-left-radius: 5px',
134+
'background-color: #1B2032',
135+
'opacity: 0.4',
136+
'margin: 0',
137+
'color: white',
138+
'text-align: center'
139+
]
140+
}
141+
}
142+
}
143+
},
144+
bsReload: {
145+
css: path.resolve(paths().public.root + '**/*.css')
146+
}
147+
});
148+
149+
/******************************************************
150+
* COMPOUND TASKS
151+
******************************************************/
152+
153+
grunt.registerTask('default', ['patternlab', 'copy:main']);
154+
grunt.registerTask('patternlab:watch', ['patternlab', 'copy:main', 'watch:all']);
155+
grunt.registerTask('patternlab:serve', ['patternlab', 'copy:main', 'browserSync', 'watch:all']);
156+
157+
};

LICENSE

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

0 commit comments

Comments
 (0)