Permalink
Browse files

fix(5776): Fixing bower.json and package.json configuration.

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.
1 parent 5f15eab commit 84b4f3284e5d928e6dc713f4c33a29d0d233ae52 Portugal, Marcelo committed with mportuga Dec 29, 2016
Showing with 24 additions and 34 deletions.
  1. +1 −1 grunt/aliases.js
  2. +0 −28 grunt/copy.js
  3. +0 −1 grunt/cut-release.js
  4. +17 −4 lib/grunt/plugins.js
  5. +5 −0 misc/tutorial/101_intro.ngdoc
  6. +1 −0 package.json
View
@@ -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;
View
@@ -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: [
{
@@ -3,7 +3,6 @@ module.exports = {
cleanup: true,
keepUnstable: false,
stableTasks: [
- 'copy:font_cut_release',
'copy:less_cut_release'
]
},
View
@@ -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) {
@@ -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() );
@@ -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'
@@ -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));
@@ -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>
View
@@ -5,6 +5,7 @@
"directories": {
"test": "test"
},
+ "main": "index.js",
"scripts": {
"init": "validate-commit-msg",
"test": "grunt",

0 comments on commit 84b4f32

Please sign in to comment.