diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index f916fb685..918ca10d5 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,4 +1,4 @@ { "compilerOptions": { "rootDir": ".", "outDir": ".." }, - "files": [ "core.ts" ] + "files": [ "core.ts", "../typings/es6-shim/es6-shim.d.ts" ] } diff --git a/packages/core/webpack.config.js b/packages/core/webpack.config.js index 2d28ab186..aca1e920c 100644 --- a/packages/core/webpack.config.js +++ b/packages/core/webpack.config.js @@ -1,6 +1,12 @@ // /../../src/ is copied to /src // This config is then copied to /src/webpack.config.js +var pkg = require('../package.json'); +var banner = pkg.description + '\n' + + '@version v' + pkg.version + '\n' + + '@link ' + pkg.homepage + '\n' + + '@license MIT License, http://www.opensource.org/licenses/MIT'; + var webpack = require('webpack'); module.exports = { entry: { @@ -26,7 +32,8 @@ module.exports = { plugins: [ new webpack.optimize.UglifyJsPlugin({ include: /\.min\.js$/, minimize: true - }) + }), + new webpack.BannerPlugin(banner) ], module: { diff --git a/packages/ng1-bower/bower.json b/packages/ng1-bower/bower.json index f326aa61e..680f52b6b 100644 --- a/packages/ng1-bower/bower.json +++ b/packages/ng1-bower/bower.json @@ -1,10 +1,10 @@ { "name": "angular-ui-router", - "version": "1.0.0alpha0", + "description": "State-based routing for AngularJS", "license" : "MIT", "main": "./release/angular-ui-router.js", "dependencies": { - "angular": ">= 1.3.0" + "angular": ">= 1.2.0" }, "ignore": [ "**/.*", diff --git a/packages/ng1/tsconfig.json b/packages/ng1/tsconfig.json index 62303b136..aed791b41 100644 --- a/packages/ng1/tsconfig.json +++ b/packages/ng1/tsconfig.json @@ -1,4 +1,9 @@ { "compilerOptions": { "rootDir": ".", "outDir": "../commonjs" }, - "files": [ "ng1.ts", "ng1/stateEvents.ts" ] + "files": [ + "ng1.ts", + "ng1/stateEvents.ts", + "../typings/es6-shim/es6-shim.d.ts" , + "../typings/angularjs/angular.d.ts" + ] } diff --git a/packages/ng1/webpack.config.js b/packages/ng1/webpack.config.js index 01bd60b1f..ee4be99a2 100644 --- a/packages/ng1/webpack.config.js +++ b/packages/ng1/webpack.config.js @@ -1,6 +1,12 @@ // /../../src/ is copied to /src // This config is then copied to /src/webpack.config.js +var pkg = require('../package.json'); +var banner = pkg.description + '\n' + + '@version v' + pkg.version + '\n' + + '@link ' + pkg.homepage + '\n' + + '@license MIT License, http://www.opensource.org/licenses/MIT'; + var webpack = require('webpack'); module.exports = { entry: { @@ -26,7 +32,8 @@ module.exports = { plugins: [ new webpack.optimize.UglifyJsPlugin({ include: /\.min\.js$/, minimize: true - }) + }), + new webpack.BannerPlugin(banner) ], module: { diff --git a/packages/ng2/tsconfig.json b/packages/ng2/tsconfig.json index 65edc7988..e0c649c5a 100644 --- a/packages/ng2/tsconfig.json +++ b/packages/ng2/tsconfig.json @@ -11,6 +11,6 @@ "sourceMap": true }, "files": [ - "ng2.ts" + "ng2.ts", "../typings/es6-shim/es6-shim.d.ts" ] } diff --git a/packages/ng2/webpack.config.js b/packages/ng2/webpack.config.js index 5a6ed830a..528850a52 100644 --- a/packages/ng2/webpack.config.js +++ b/packages/ng2/webpack.config.js @@ -1,6 +1,12 @@ // /../../src/ is copied to /src // This config is then copied to /src/webpack.config.js +var pkg = require('../package.json'); +var banner = pkg.description + '\n' + + '@version v' + pkg.version + '\n' + + '@link ' + pkg.homepage + '\n' + + '@license MIT License, http://www.opensource.org/licenses/MIT'; + var webpack = require('webpack'); module.exports = { entry: { @@ -26,7 +32,8 @@ module.exports = { plugins: [ new webpack.optimize.UglifyJsPlugin({ include: /\.min\.js$/, minimize: true - }) + }), + new webpack.BannerPlugin(banner) ], module: { diff --git a/scripts/package.js b/scripts/package.js index ff0874da2..e19152747 100755 --- a/scripts/package.js +++ b/scripts/package.js @@ -29,6 +29,7 @@ function prepPackage(pkgName) { let files = {}; files.sources = path.resolve(paths.pkgsrc, "sources.json"); files.pkgfile = path.resolve(paths.pkgsrc, "package.json"); + files.bowerfile = path.resolve(paths.pkgsrc, "bower.json"); files.tsconfig = path.resolve(paths.pkgsrc, "tsconfig.json"); files.webpack = path.resolve(paths.pkgsrc, "webpack.config.js"); @@ -66,6 +67,21 @@ function prepPackage(pkgName) { fs.writeFileSync(packageJsonDest, asJson(packageJson)); } + // If the package definition contains a bower.json, merge it with specific fields from the package.json in + // the project root, and write it to the package build dir + if (test('-f', files.bowerfile)) { + let bowerJsonDest = `${paths.build}/bower.json`; + let pkg = require('../package.json'); + + echo(`Merging ${files.bowerfile} with ${paths.basedir}/package.json ...`); + echo(`... and writing to ${bowerJsonDest}`); + + let packageJson = JSON.parse(fs.readFileSync(files.bowerfile, 'utf8')); + packageJson.version = pkg.version; + packageJson.homepage = pkg.homepage; + fs.writeFileSync(bowerJsonDest, asJson(packageJson)); + } + echo(`Copying typescript sources to ${paths.srcCopy}`); cp('-R', `${paths.basedir}/src/`, paths.srcCopy); console.log("Excludes: " + sources.excludes); @@ -83,7 +99,7 @@ function prepPackage(pkgName) { // Copy any of these files from the packages dir // Override any baseFiles with the copy from the package dir. - let pkgFiles = ['bower.json', '.gitignore', '.npmignore']; + let pkgFiles = ['.gitignore', '.npmignore']; baseFiles.concat(pkgFiles).filter(file => test('-f', `${paths.pkgsrc}/${file}`)) .forEach(file => cp(`${paths.pkgsrc}/${file}`, paths.build)); diff --git a/scripts/show_changelog.js b/scripts/show_changelog.js index 5a8cbec90..6c6c218be 100755 --- a/scripts/show_changelog.js +++ b/scripts/show_changelog.js @@ -24,9 +24,5 @@ if(require.main === module) { } function showChangelog(context, gitOpts) { - console.log(context); - console.log(gitOpts); - conventionalChangelog(options, context, gitOpts) - .pipe(process.stdout); - + conventionalChangelog(options, context, gitOpts).pipe(process.stdout); }