Adds bower to node dependencies, uses bower to get the typeahead dependency, gets bower dependencies on npm install

This commit is contained in:
Shannon
2014-05-05 15:55:48 +10:00
parent 956a92f5b4
commit 27e6b8c80c
5 changed files with 62 additions and 7 deletions

1
.gitignore vendored
View File

@@ -109,3 +109,4 @@ src/Umbraco.Web.UI/umbraco/plugins/*
src/Umbraco.Web.UI/umbraco/js/init.js
build/ApiDocs/*
build/ApiDocs/Output/*
src/Umbraco.Web.UI.Client/bower_components/*

View File

@@ -23,7 +23,8 @@ CD %CD%\..\src\Umbraco.Web.UI.Client\
ECHO Do npm install and the grunt build of Belle
call npm install
call npm install -g grunt-cli
call grunt build --buildversion=8.1.1
call npm install -g bower
call grunt build --buildversion=7.1.2
ECHO Reset path to what it was before
path=%oldPath%

View File

@@ -0,0 +1,21 @@
{
"name": "Umbraco",
"version": "7",
"homepage": "https://github.com/umbraco/Umbraco-CMS",
"authors": [
"Shannon <sdeminick@umbraco.com>"
],
"description": "Umbraco CMS",
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"typeahead.js": "~0.10.2"
}
}

View File

@@ -14,7 +14,7 @@ module.exports = function (grunt) {
grunt.registerTask('watch-test', ['jshint:dev', 'karma:unit']);
//triggered from grunt dev or grunt
grunt.registerTask('build', ['clean','concat','recess:min','recess:installer','copy']);
grunt.registerTask('build', ['clean','concat','recess:min','recess:installer','bower','copy']);
//utillity tasks
grunt.registerTask('docs', ['ngdocs']);
@@ -26,6 +26,28 @@ module.exports = function (grunt) {
grunt.log.subhead(Date());
});
// Custom task to run the bower dependency installer
// tried, a few other things but this seems to work the best.
// https://coderwall.com/p/xnkdqw
grunt.registerTask('bower', 'Get js packages listed in bower.json',
function () {
var bower = require('bower');
var done = this.async();
bower.commands.install(undefined, { offline: true }, { interactive: false, offline: true })
.on('log', function (data) {
grunt.log.write(data.message + "\n");
})
.on('error', function (data) {
grunt.log.write(data.message + "\n");
done(false);
})
.on('end', function (data) {
done();
});
}
);
// Project configuration.
grunt.initConfig({
@@ -58,7 +80,8 @@ module.exports = function (grunt) {
},
distdir: 'build/belle',
vsdir: '../Umbraco.Web.Ui/umbraco',
bowerfiles: 'bower_components',
vsdir: '../Umbraco.Web.UI/umbraco',
pkg: grunt.file.readJSON('package.json'),
banner:
'/*! <%= pkg.title || pkg.name %> - v<%= buildVersion %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
@@ -86,6 +109,14 @@ module.exports = function (grunt) {
clean: ['<%= distdir %>/*'],
copy: {
// Copies over the files downloaded by bower
bower: {
files: [
{ dest: '<%= distdir %>/lib/typeahead/typeahead.bundle.min.js', src: '<%= bowerfiles %>/typeahead.js/dist/typeahead.bundle.min.js' }
]
},
assets: {
files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'src/assets/' }]
},

View File

@@ -2,7 +2,7 @@
"author": "Umbraco HQ",
"name": "umbraco",
"homepage": "https://github.com/umbraco/umbraco-cms/",
"version": "7.1.1",
"version": "7.1.2",
"repository": {
"type": "git",
"url": "git@github.com:umbraco/umbraco-cms.git"
@@ -42,6 +42,7 @@
"karma-coffee-preprocessor": "0.0.1",
"karma": "~0.9",
"karma-phantomjs-launcher": "0.0.2",
"grunt-ngdocs": "~0.1.2"
"grunt-ngdocs": "~0.1.2",
"bower": "~1.3.3"
}
}