chore(package.json): kill version.yaml in favor of package.json

all versioning info is now in package.json and that's where the build scripts read it from
This commit is contained in:
Igor Minar
2013-05-20 16:37:28 -07:00
parent eb21eb5a06
commit d458d7350b
5 changed files with 13 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
headEl = document.head, headEl = document.head,
angularVersion = { angularVersion = {
current: '"NG_VERSION_FULL"', // rewrite during build current: '"NG_VERSION_FULL"', // rewrite during build
stable: '"NG_VERSION_STABLE"' cdn: '"NG_VERSION_CDN"'
}; };
addTag('script', {src: path('angular-scenario.js')}, function() { addTag('script', {src: path('angular-scenario.js')}, function() {
@@ -34,7 +34,7 @@
function path(name) { function path(name) {
return production return production
? 'http://code.angularjs.org/' + angularVersion.stable + '/' + name ? 'http://code.angularjs.org/' + angularVersion.cdn + '/' + name
: '../' + name; : '../' + name;
} }
</script> </script>

View File

@@ -27,7 +27,7 @@
sync = true, sync = true,
angularVersion = { angularVersion = {
current: '"NG_VERSION_FULL"', // rewrite during build current: '"NG_VERSION_FULL"', // rewrite during build
stable: '"NG_VERSION_STABLE"' cdn: '"NG_VERSION_CDN"'
}; };
addTag('base', {href: baseUrl}); addTag('base', {href: baseUrl});
@@ -51,12 +51,12 @@
if (production) { if (production) {
if (name.match(/^angular(-\w+)?\.js/) && !name.match(/bootstrap/)) { if (name.match(/^angular(-\w+)?\.js/) && !name.match(/bootstrap/)) {
name = '//ajax.googleapis.com/ajax/libs/angularjs/' + name = '//ajax.googleapis.com/ajax/libs/angularjs/' +
angularVersion.stable + angularVersion.cdn +
'/' + '/' +
name.replace(/\.js$/, '.min.js'); name.replace(/\.js$/, '.min.js');
} else { } else {
name = 'http://code.angularjs.org/' + name = 'http://code.angularjs.org/' +
angularVersion.stable + angularVersion.cdn +
'/' + '/' +
name.replace(/\.js$/, '.min.js'); name.replace(/\.js$/, '.min.js');
} }

View File

@@ -1,6 +1,5 @@
var fs = require('fs'); var fs = require('fs');
var shell = require('shelljs'); var shell = require('shelljs');
var yaml = require('yaml-js');
var grunt = require('grunt'); var grunt = require('grunt');
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
@@ -12,8 +11,8 @@ module.exports = {
getVersion: function(){ getVersion: function(){
var versionYaml = yaml.load(fs.readFileSync('version.yaml', 'UTF-8')); var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
var match = versionYaml.version.match(/^([^\-]*)(-snapshot)?$/); var match = package.version.match(/^([^\-]*)(-snapshot)?$/);
var semver = match[1].split('.'); var semver = match[1].split('.');
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', ''); var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
@@ -22,8 +21,8 @@ module.exports = {
major: semver[0], major: semver[0],
minor: semver[1], minor: semver[1],
dot: semver[2], dot: semver[2],
codename: versionYaml.codename, codename: package.codename,
stable: versionYaml.stable cdn: package.cdnVersion
}; };
return version; return version;
@@ -89,7 +88,7 @@ module.exports = {
.replace(/"NG_VERSION_MAJOR"/, NG_VERSION.major) .replace(/"NG_VERSION_MAJOR"/, NG_VERSION.major)
.replace(/"NG_VERSION_MINOR"/, NG_VERSION.minor) .replace(/"NG_VERSION_MINOR"/, NG_VERSION.minor)
.replace(/"NG_VERSION_DOT"/, NG_VERSION.dot) .replace(/"NG_VERSION_DOT"/, NG_VERSION.dot)
.replace(/"NG_VERSION_STABLE"/, NG_VERSION.stable) .replace(/"NG_VERSION_CDN"/, NG_VERSION.cdn)
.replace(/"NG_VERSION_CODENAME"/, NG_VERSION.codename); .replace(/"NG_VERSION_CODENAME"/, NG_VERSION.codename);
if (strict !== false) processed = this.singleStrict(processed, '\n\n', true); if (strict !== false) processed = this.singleStrict(processed, '\n\n', true);
return processed; return processed;

View File

@@ -1,6 +1,8 @@
{ {
"name": "AngularJS", "name": "AngularJS",
"version": "0.0.0", "version": "1.1.5-snapshot",
"cdnVersion": "1.1.4",
"codename": "triangle-squarification",
"devDependencies": { "devDependencies": {
"grunt": "0.4.0", "grunt": "0.4.0",
"grunt-contrib-clean": "0.4.0", "grunt-contrib-clean": "0.4.0",

View File

@@ -1,5 +0,0 @@
# AngularJS build config file
---
version: 1.1.5-snapshot
codename: triangle-squarification
stable: 1.1.4