Skip to content

Commit f15ef42

Browse files
committed
BootstrapのコードをGit Submoduleからbowerに変更して
・Git Submoduleをやめてbowerに変更した ・bowerに変更するにあたってHonokaのコードの位置の変更 ・フォルダ位置変更に伴うGruntタスクの変更
1 parent 2db528e commit f15ef42

18 files changed

+89
-23
lines changed

.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#=============================================
2+
# bower
3+
#=============================================
4+
bower_components/
5+
16
#=============================================
27
# My Original Set
38
#=============================================

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "src/bootstrap"]
2-
path = src/bootstrap
3-
url = [email protected]:twbs/bootstrap-sass.git

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ git:
99
submodules: false
1010

1111
before_install:
12-
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
13-
- git submodule update --init src/bootstrap
12+
- bower install
1413
- gem install compass
1514

1615
script:

Gruntfile.js

+32-11
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ module.exports = function(grunt) {
3838
},
3939
// compassのコンパイル
4040
compass: {
41-
dist: {
41+
bootstrap: {
4242
options: {
43-
sassDir: 'src/compass',
44-
config: 'src/config.rb'
43+
config: 'config.rb'
44+
}
45+
},
46+
assets: {
47+
options: {
48+
config: 'src/scss/config.rb'
4549
}
4650
}
4751
},
@@ -50,28 +54,40 @@ module.exports = function(grunt) {
5054
src: ['dist/css/**/*', 'dist/js/**/*', 'dist/fonts/**/*']
5155
}
5256
},
57+
// bowerのインストール
58+
bower: {
59+
install: {
60+
options: {
61+
targetDir: 'dist/',
62+
layout: function(type, component, source) {
63+
return type;
64+
}
65+
}
66+
}
67+
},
5368
copy: {
5469
build: {
5570
files: [
5671
{
5772
expand: true,
58-
cwd: 'src/bootstrap/assets/fonts/bootstrap/',
73+
cwd: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/',
5974
src: ["**/*"],
6075
dest: 'dist/fonts'
6176
},
6277
{
6378
expand: true,
64-
cwd: "src/bootstrap/assets/javascripts/",
79+
cwd: "bower_components/bootstrap-sass-official/assets/javascripts/",
6580
src: ["bootstrap.**js"],
6681
dest: "dist/js"
6782
}
6883
]
6984
}
7085
},
86+
// バージョン情報の出力
7187
ect: {
7288
version: {
7389
options: {
74-
root: 'src/compass/css/honoka/',
90+
root: 'scss/honoka/',
7591
variables: {
7692
name: pkg.name,
7793
version: pkg.version,
@@ -87,10 +103,15 @@ module.exports = function(grunt) {
87103
},
88104
// ファイル更新監視
89105
watch: {
90-
// compassの自動コンパイル
91-
compass: {
92-
files: ['src/compass/**/*.scss'],
106+
// 自動コンパイル
107+
bootstrap: {
108+
files: ['scss/**/*.scss'],
93109
tasks: ['compass:dist'],
110+
},
111+
// 自動コンパイル
112+
assets: {
113+
files: ['src/scss/**/*.scss'],
114+
tasks: ['compass:assets'],
94115
}
95116
},
96117
// テストサーバ
@@ -155,10 +176,10 @@ module.exports = function(grunt) {
155176
}
156177

157178
// 通常 (compass/connect/watch)
158-
grunt.registerTask('server', ['ect:version', 'compass:dist', 'connect', 'watch']);
179+
grunt.registerTask('server', ['bower:install', 'ect:version', 'compass', 'connect', 'watch']);
159180

160181
// ミニファイ
161-
grunt.registerTask('build', ['clean:build', 'copy:build', 'ect:version', 'compass:dist', 'cssmin:minify', 'replace:banner']);
182+
grunt.registerTask('build', ['clean:build', 'bower:install', 'ect:version', 'compass:bootstrap', 'cssmin:minify', 'replace:banner']);
162183

163184
// 配布用パッケージ作成
164185
grunt.registerTask('package', ['build', 'compress:main']);

bower.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Honoka",
3+
"description": "Honoka is one of the Bootstrap original theme.",
4+
"author": "windyakin",
5+
"homepage": "http://honokak.osaka/",
6+
"repository": {
7+
"type": "git",
8+
"url": "git://github.com/windyakin/Honoka.git"
9+
},
10+
"license": "MIT",
11+
"devDependencies": {
12+
"bootstrap-sass-official": "~3.3.5"
13+
},
14+
"exportsOverride": {
15+
"bootstrap-sass-official": {
16+
"js": "assets/javascripts/bootstrap.**js",
17+
"fonts": "assets/fonts/bootstrap/**/*"
18+
},
19+
"jquery": {
20+
"assets/js": "dist/jquery.min.js"
21+
}
22+
}
23+
}

src/config.rb config.rb

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
# Set this to the root of your project when deployed:
44

55
http_path = "/"
6-
css_dir = "dist/"
7-
sass_dir = "src/compass/"
8-
images_dir = "dist/img/"
9-
javascripts_dir = "dist/js/"
6+
css_dir = "dist/css/"
7+
sass_dir = "scss/"
108
line_comments = false
119
output_style = :expanded
1210

1311
additional_import_paths = [
1412
# Bootstrap Core
15-
"src/bootstrap/assets/stylesheets/",
16-
"src/compass/css/"
13+
"bower_components/bootstrap-sass-official/assets/stylesheets/"
1714
]

dist/assets/js/jquery.min.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"url": "https://github.com/windyakin/honoka.git"
1818
},
1919
"devDependencies": {
20+
"bower": "^1.4.1",
2021
"grunt": "^0.4.5",
22+
"grunt-bower-task": "^0.4.0",
2123
"grunt-cli": "^0.1.13",
2224
"grunt-contrib-clean": "^0.6.0",
2325
"grunt-contrib-compass": "^0.9.1",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/bootstrap

-1
This file was deleted.

src/scss/config.rb

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Require any additional compass plugins here.
2+
3+
# Set this to the root of your project when deployed:
4+
5+
http_path = "/"
6+
css_dir = "dist/assets/css/"
7+
sass_dir = "src/scss/"
8+
line_comments = false
9+
output_style = :expanded
10+
11+
additional_import_paths = [
12+
# Bootstrap Core
13+
"bower_components/bootstrap-sass-official/assets/stylesheets/",
14+
"scss/"
15+
]
File renamed without changes.

0 commit comments

Comments
 (0)