Skip to content
Permalink
Browse files

feat(bower.json location): move bower.json from project root to src/c…

…lient/ root

BREAKING CHANGE:
This is completely an architectural design decision. Seems more natural to place bower.json inside of src/client/ root and not the project's root.

This only applies to people using rapid-build to install bower_components.

To migrate, move bower.json from project root to src/client/ root.

Before:
bower.json

Now:
src/client/bower.json
  • Loading branch information
jyounce committed Jan 19, 2017
1 parent 49f6509 commit 5b20a5674f6dc8672114554a7c84166947262f3f
@@ -98,13 +98,13 @@ src/
│ │ └── coffee, es6 or js
│ ├── views/
│ │ └── html
│ ├── bower.json (for bower components)
│ └── spa.html (see options.spa.src.filePath)
└── server/
├── test/
│ └── coffee, es6 or js
├── package.json (for server node modules)
└── routes.{coffee,es6,js,ts} (see options.dist.server.fileName)
bower.json (for client bower components)
package.json (required - must have name and version)
rapid-build.json (build options - can be cson, json or js file)
```
@@ -17,10 +17,11 @@ module.exports = (config, options) ->
# add info
# ========
addInfo = ->
['app', 'rb'].forEach (v) ->
bower[v].file = defaults.file
bower[v].dir = if v is 'rb' then config.generated.pkg.path else config[v].dir
bower[v].path = path.join bower[v].dir, bower[v].file
['app','rb'].forEach (appOrRb) ->
bower[appOrRb].file = defaults.file
bower[appOrRb].dir = config.src[appOrRb].client.dir
bower[appOrRb].path = path.join bower[appOrRb].dir, bower[appOrRb].file

addInfo()

# add bower to config
@@ -24,7 +24,6 @@ module.exports = (config) ->
generated.pkg.relPath = join generated.dir, generated.pkg.dir
generated.pkg.path = join generated.path, generated.pkg.dir
addHashToDir generated.pkg # avoid naming collisions, ensure unique dir name
generated.pkg.bower = join generated.pkg.path, 'bower.json'
generated.pkg.config = join generated.pkg.path, 'config.json'
generated.pkg.files = {}
generated.pkg.src = {}
@@ -0,0 +1 @@
{}
@@ -6,7 +6,7 @@ module.exports = (config, gulp) ->
# helpers
# =======
getData = ->
version = '0.0.0'
version = config.rb.version
name = config.rb.name
dependencies = config.angular.bowerDeps
{ name, version, dependencies }
@@ -18,7 +18,7 @@ module.exports = (config, gulp) ->
defer = q.defer()
format = spaces: '\t'
json = getData()
jsonFile = config.generated.pkg.bower
jsonFile = config.bower.rb.path
fse.writeJson jsonFile, json, format, (e) ->
# log.task 'built bower.json', 'minor'
defer.resolve()
@@ -59,26 +59,31 @@ module.exports = (config) ->

create:
dirs: ->
defer = q.defer()
q.all([
createDir 'files'
createDir 'temp'
])
.done ->
dir = config.generated.pkg.dir
# log.task "generated #{dir} directory", 'minor'
# log.task "generated #{config.generated.pkg.dir} directory", 'minor'
defer.resolve()
defer.promise

jsonFiles: ->
defer = q.defer()
pkg = config.generated.pkg
files = pkg.files
q.all([
createJson pkg.config
createJson pkg.bower
createJson files.files
createJson files.testFiles
createJson files.prodFiles
createJson files.prodFilesBlueprint
])
# .done -> log.task "generated #{config.generated.pkg.dir} json files", 'minor'
.done ->
# log.task "generated #{config.generated.pkg.dir} json files", 'minor'
defer.resolve()
defer.promise

copy:
src: ->
@@ -6,7 +6,8 @@ await = require 'asyncawait/await'
Promise = require 'bluebird'
fs = Promise.promisifyAll require 'fs'
config = require "#{process.cwd()}/extra/temp/config.json"
genPath = config.paths.abs.generated.testApp
path = require 'path'
genPath = path.join config.paths.abs.generated.testApp, 'src', 'client'

# tests
# =====

0 comments on commit 5b20a56

Please sign in to comment.
You can’t perform that action at this time.