Adds bower to node dependencies, uses bower to get the typeahead dependency, gets bower dependencies on npm install
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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/*
|
||||
|
||||
@@ -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%
|
||||
|
||||
21
src/Umbraco.Web.UI.Client/bower.json
Normal file
21
src/Umbraco.Web.UI.Client/bower.json
Normal 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"
|
||||
}
|
||||
}
|
||||
@@ -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/' }]
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user