Skip to content

Commit 9af1814

Browse files
committed
moved styleguide to from public into the core directory
1 parent 2a449d2 commit 9af1814

33 files changed

+2702
-31
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ public/styleguide/css/static.css.map
1818
public/styleguide/css/styleguide-specific.css.map
1919
public/styleguide/css/styleguide.css.map
2020
source/css/style.css.map
21+
.idea/
22+
public/styleguide/

Gruntfile.js

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = function(grunt) {
22

3+
var path = require('path');
4+
35
// Project configuration.
46
grunt.initConfig({
57
pkg: grunt.file.readJSON('package.json'),
@@ -60,40 +62,46 @@ module.exports = function(grunt) {
6062
copy: {
6163
main: {
6264
files: [
63-
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
64-
{ expand: true, cwd: './source/css/', src: '*.css', dest: './public/css/' },
65-
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
66-
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
67-
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
68-
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
65+
{ expand: true, cwd: paths().source.js, src: '*', dest: paths().public.js},
66+
{ expand: true, cwd: paths().source.css, src: '*.css', dest: paths().public.css },
67+
{ expand: true, cwd: paths().source.images, src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'], dest: paths().public.images },
68+
{ expand: true, cwd: paths().source.fonts, src: '*', dest: paths().public.fonts},
69+
{ expand: true, cwd: paths().source.data, src: 'annotations.js', dest: paths().public.data}
6970
]
7071
},
7172
css: {
7273
files: [
73-
{ expand: true, cwd: './source/css/', src: '*.css', dest: './public/css/' }
74+
{ expand: true, cwd: paths().source.css, src: '*.css', dest: paths().public.css }
75+
]
76+
},
77+
styleguide: {
78+
files: [
79+
{
80+
expand: true, cwd: paths().source.styleguide, src: ['*.*', '**/*.*'], dest: paths().public.styleguide
81+
}
7482
]
7583
}
7684
},
7785
watch: {
7886
all: {
7987
files: [
80-
'source/css/**/*.css',
81-
'public/styleguide/css/*.css',
82-
'source/_patterns/**/*.mustache',
83-
'source/_patterns/**/*.json',
84-
'source/_data/*.json'
88+
paths().source.css + '**/*.css',
89+
paths().source.styleguide + 'css/*.css',
90+
paths().source.patterns + '**/*.mustache',
91+
paths().source.patterns + '**/*.json',
92+
paths().source.data + '*.json'
8593
],
8694
tasks: ['default']
8795
},
8896
// scss: {
89-
// files: ['source/css/**/*.scss', 'public/styleguide/css/*.scss'],
97+
// files: [paths().source.css + '**/*.scss', paths().source.styleguide + 'css/*.scss'],
9098
// tasks: ['sass', 'copy:css','bsReload:css']
9199
// },
92100
patterns: {
93101
files: [
94-
'source/_patterns/**/*.mustache',
95-
'source/_patterns/**/*.json',
96-
'source/_data/*.json'
102+
paths().source.patterns + '*.mustache',
103+
paths().source.patterns + '*.json',
104+
paths().source.data + '*.json'
97105
],
98106
tasks: ['default']
99107
}
@@ -105,10 +113,10 @@ module.exports = function(grunt) {
105113
// precision: 8
106114
// },
107115
// files: {
108-
// './source/css/style.css': './source/css/style.scss',
109-
// './public/styleguide/css/static.css': './public/styleguide/css/static.scss',
110-
// './public/styleguide/css/styleguide.css': './public/styleguide/css/styleguide.scss',
111-
// './public/styleguide/css/styleguide-specific.css': './public/styleguide/css/styleguide-specific.scss'
116+
// paths().source.css + 'style.css': paths().source.css + 'style.scss',
117+
// paths().source.styleguide + 'css/static.css': paths().source.styleguide + 'css/static.scss',
118+
// paths().source.styleguide + 'css/styleguide.css': paths().source.styleguide + 'css/styleguide.scss',
119+
// paths().source.styleguide + 'css/styleguide-specific.css': paths().source.styleguide + 'css/styleguide-specific.scss'
112120
// }
113121
// }
114122
// },
@@ -118,24 +126,28 @@ module.exports = function(grunt) {
118126
browserSync: {
119127
dev: {
120128
options: {
121-
server: './public',
129+
server: paths().public.root,
122130
watchTask: true,
123131
plugins: [
124132
{
125133
module: 'bs-html-injector',
126134
options: {
127-
files: './public/index.html'
135+
files: paths().public + 'index.html'
128136
}
129137
}
130138
]
131139
}
132140
}
133141
},
134142
bsReload: {
135-
css: './public/**/*.css'
143+
css: paths().public + '**/*.css'
136144
}
137145
});
138146

147+
function paths () {
148+
return require('./config.json').paths;
149+
}
150+
139151
// load all grunt tasks
140152
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
141153

@@ -149,8 +161,8 @@ module.exports = function(grunt) {
149161
grunt.registerTask('travis', ['nodeunit', 'patternlab']);
150162

151163
//TODO: this line is more efficient, but you cannot run concurrent watch tasks without another dependency.
152-
//grunt.registerTask('serve', ['patternlab', /*'sass',*/ 'copy:main', 'browserSync', 'watch:patterns', 'watch:scss']);
153-
grunt.registerTask('serve', ['patternlab', /*'sass',*/ 'copy:main', 'browserSync', 'watch:all']);
164+
//grunt.registerTask('serve', ['patternlab', /*'sass',*/ 'copy:main', 'copy:styleguide', 'browserSync', 'watch:patterns', 'watch:scss']);
165+
grunt.registerTask('serve', ['patternlab', /*'sass',*/ 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);
154166

155167
grunt.registerTask('build', ['nodeunit', 'concat']);
156168

config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"root": "./source/",
55
"patterns" : "./source/_patterns/",
66
"data" : "./source/_data/",
7+
"styleguide" : "./core/styleguide/",
78
"patternlabFiles" : "./source/_patternlab-files/",
89
"js" : "./source/js",
910
"images" : "./source/images",
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)