Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit a144e2f

Browse files
committed
feat(publisher): initial publisher use commit
1 parent 7d4c80c commit a144e2f

File tree

5 files changed

+72
-8
lines changed

5 files changed

+72
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bower_components/
22
node_modules/
3+
out/

bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
},
2727
"devDependencies": {
2828
"angular-mocks": ">=1.0.x",
29-
"angular-ui-bootstrap-bower": "~0.5.0",
30-
"angular-ui-docs": "angular-ui/angular-ui-docs"
29+
"angular-ui-bootstrap-bower": "~0.5.0"
3130
}
3231
}

gruntFile.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ module.exports = function (grunt) {
1010
grunt.registerTask('serve', ['connect:continuous', 'karma:continuous', 'watch']);
1111
grunt.registerTask('build-doc', ['uglify', 'copy']);
1212

13+
// HACK TO ACCESS TO THE COMPONENT-PUBLISHER
14+
function fakeTargetTask(prefix){
15+
return function(){
16+
17+
if (this.args.length !== 1) return grunt.log.fail('Just give the name of the ' + prefix + ' you want like :\ngrunt ' + prefix + ':bower');
18+
19+
var done = this.async();
20+
var spawn = require('child_process').spawn;
21+
spawn('./node_modules/.bin/gulp', [ prefix, '--branch='+this.args[0] ].concat(grunt.option.flags()), {
22+
cwd : './node_modules/component-publisher',
23+
stdio: 'inherit'
24+
}).on('close', done);
25+
};
26+
}
27+
28+
grunt.registerTask('build', fakeTargetTask('build'));
29+
grunt.registerTask('publish', fakeTargetTask('publish'));
30+
//
31+
1332
var testConfig = function (configFile, customOptions) {
1433
var options = { configFile: configFile, singleRun: true };
1534
var travisOptions = process.env.TRAVIS && { browsers: [ 'Firefox', 'PhantomJS'], reporters: ['dots'] };

package.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@
88
"main": "./ui-codemirror.js",
99
"dependencies": {},
1010
"devDependencies": {
11-
"grunt": "~0.4.1",
12-
"grunt-karma": "~0.7.1",
11+
"component-publisher": "douglasduteil/component-publisher",
12+
"grunt": "~0.4.2",
13+
"grunt-contrib-copy": "~0.4.1",
1314
"grunt-contrib-jshint": "~0.7.2",
1415
"grunt-contrib-uglify": "~0.2.7",
1516
"grunt-contrib-watch": "~0.5.3",
16-
"grunt-contrib-copy": "~0.4.1",
17-
"grunt-contrib-connect": "~0.5.0",
18-
"load-grunt-tasks": "~0.2.0",
1917
"grunt-conventional-changelog": "~1.0.0",
20-
"grunt-bump": "0.0.11"
18+
"grunt-karma": "~0.6.2",
19+
"karma": "~0.10.8",
20+
"karma-chrome-launcher": "~0.1.1",
21+
"karma-coffee-preprocessor": "~0.1.1",
22+
"karma-firefox-launcher": "~0.1.2",
23+
"karma-html2js-preprocessor": "~0.1.0",
24+
"karma-jasmine": "~0.1.4",
25+
"karma-phantomjs-launcher": "~0.1.1",
26+
"karma-requirejs": "~0.2.0",
27+
"karma-script-launcher": "~0.1.0",
28+
"load-grunt-tasks": "~0.2.0",
29+
"requirejs": "~2.1.9"
2130
},
2231
"scripts": {},
2332
"repository": {

publish.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* jshint node:true */
2+
3+
'use strict';
4+
5+
var fs = require('fs');
6+
var path = require('path');
7+
8+
module.exports = function() {
9+
10+
var js_dependencies =[
11+
'bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js',
12+
'bower_components/codemirror/lib/codemirror.js',
13+
'bower_components/codemirror/mode/scheme/scheme.js',
14+
'bower_components/codemirror/mode/javascript/javascript.js',
15+
'bower_components/codemirror/mode/xml/xml.js',
16+
];
17+
18+
var css_dependencies = [
19+
'bower_components/codemirror/lib/codemirror.css',
20+
'bower_components/codemirror/theme/twilight.css'
21+
];
22+
23+
function putThemInVendorDir (filepath) {
24+
return 'vendor/' + path.basename(filepath);
25+
}
26+
27+
return {
28+
humaName : 'UI.CodeMirror',
29+
repoName : 'ui-codemirror',
30+
inlineHTML : fs.readFileSync(__dirname + '/demo/demo.html'),
31+
inlineJS : fs.readFileSync(__dirname + '/demo/demo.js'),
32+
css: css_dependencies.map(putThemInVendorDir),
33+
js : js_dependencies.map(putThemInVendorDir).concat(['dist/ui-codemirror.js']),
34+
tocopy : css_dependencies.concat(js_dependencies)
35+
};
36+
};

0 commit comments

Comments
 (0)