Skip to content

Commit

Permalink
fix(5776): Fixing bower.json and package.json configuration.
Browse files Browse the repository at this point in the history
Fixing main section on bower.json and package.json. Adding index.js and CHANGELOG.md files to both,

and removing weird version folder with the font files.
  • Loading branch information
Portugal, Marcelo authored and mportuga committed Dec 30, 2016
1 parent 5f15eab commit 84b4f32
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion grunt/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function (grunt, options) {
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release', 'gh-pages:ui-grid-site', 'update-bower-json', 'gh-pages:bower', 'npm-publish'];
}
else {
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release', 'gh-pages:ui-grid-site'];
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release'];
}

return baseTasks;
Expand Down
28 changes: 0 additions & 28 deletions grunt/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,6 @@ module.exports = function ( grunt ) {
}
]
},
font_cut_release: {
files: [
{
expand: true,
cwd: '<%= dist %>/release/',
src: '**/*.eot',
dest: '<%= dist %>/release/' + currentTag
},
{
expand: true,
cwd: '<%= dist %>/release/',
src: '**/*.svg',
dest: '<%= dist %>/release/' + currentTag
},
{
expand: true,
cwd: '<%= dist %>/release/',
src: '**/*.ttf',
dest: '<%= dist %>/release/' + currentTag
},
{
expand: true,
cwd: '<%= dist %>/release/',
src: '**/*.woff',
dest: '<%= dist %>/release/' + currentTag
}
]
},
less_customizer: {
files: [
{
Expand Down
1 change: 0 additions & 1 deletion grunt/cut-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
cleanup: true,
keepUnstable: false,
stableTasks: [
'copy:font_cut_release',
'copy:less_cut_release'
]
},
Expand Down
21 changes: 17 additions & 4 deletions lib/grunt/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var reader = require('../../node_modules/grunt-ngdocs/src/reader.js');

var projectPath = path.resolve(__dirname, '../..');
var pkg = require(path.resolve(projectPath, 'package.json'));
var bwr = require(path.resolve(projectPath, 'bower.json'));

module.exports = function(grunt) {

Expand Down Expand Up @@ -289,6 +290,13 @@ module.exports = function(grunt) {
done();
});

// Copies a file into the release directory
function copyIntoRelease(taggedReleaseDir, filePath) {
var file = path.resolve(projectPath, filePath);

shell.cp('-f', file, taggedReleaseDir);
}

// Create the bower.json file
grunt.registerTask('update-bower-json', function () {
var currentTag = semver.clean( util.getVersion() );
Expand All @@ -304,16 +312,21 @@ module.exports = function(grunt) {
});

// Copy a README file
var readme = path.resolve(projectPath, 'misc/publish/README.md');
shell.cp('-f', readme, taggedReleaseDir);
copyIntoRelease(taggedReleaseDir, 'misc/publish/README.md');

// Copy a CHANGELOG file
copyIntoRelease(taggedReleaseDir, 'CHANGELOG.md');

// Copy a index.js file
copyIntoRelease(taggedReleaseDir, 'misc/publish/index.js');

var bowerJsonFile = path.join(taggedReleaseDir, 'bower.json');
var pkgJsonFile = path.join(taggedReleaseDir, 'package.json');

var json = {
'name': 'angular-ui-grid',
'description': pkg.description,
'main': releaseFiles,
'main': bwr.main,
'ignore': [],
'dependencies': {
'angular': '>=1.4.0 1.5.x'
Expand All @@ -329,7 +342,7 @@ module.exports = function(grunt) {

// For package.json
json.version = currentTag;
json.main = "ui-grid.js";
json.main = pkg.main;
json.files = releaseFiles;

fs.writeFileSync(pkgJsonFile, JSON.stringify(json, null, 2));
Expand Down
5 changes: 5 additions & 0 deletions misc/tutorial/101_intro.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ Steps:
var app = angular.module('app', ['ui.grid']);
</pre>
</li>
<li>Or using CommonJS
<pre>
var app = angular.module('app', [require('angular-ui-grid')]);
</pre>
</li>
<li>
Add a css style to your app css so the grid knows it's dimensions
<pre>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"directories": {
"test": "test"
},
"main": "index.js",
"scripts": {
"init": "validate-commit-msg",
"test": "grunt",
Expand Down

0 comments on commit 84b4f32

Please sign in to comment.