diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f086ded1..f3a61d669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +## `@uirouter/angularjs` 1.0.6 (2017-08-12) +[Compare `@uirouter/angularjs` versions 1.0.5 and 1.0.6](https://github.com/angular-ui/ui-router/compare/1.0.5...1.0.6) + +### Bug Fixes + +* **sourcemaps:** Embed sources inline into sourcemaps ([4baa430](https://github.com/angular-ui/ui-router/commit/4baa430)) + + + +## Changes in `@uirouter/core` between versions [5.0.5 and 5.0.6](https://github.com/ui-router/core/compare/5.0.5...5.0.6) (2017-08-12) + + +### Bug Fixes + +* **sourceMaps:** Embed typescript sources in sourcemaps ([10558a3](https://github.com/ui-router/core/commit/10558a3)) +* **typescript:** Fix strictNullCheck type error ([0ae585e](https://github.com/ui-router/core/commit/0ae585e)) +* **urlRouter:** Fix absolute 'href' generation by using location.hostname (not location.host) ([a28b68a](https://github.com/ui-router/core/commit/a28b68a)) +* **urlService:** Fix priority sorting of URL rules ([73a1fe0](https://github.com/ui-router/core/commit/73a1fe0)) + + + ## [1.0.5](https://github.com/angular-ui/ui-router/compare/1.0.4...1.0.5) (2017-06-29) diff --git a/README.md b/README.md index cdcfd6f87..a64087de9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ version 0.2.x, it can be found [here](https://github.com/angular-ui/ui-router/tr --- **[Tutorials](https://ui-router.github.io/tutorials/)** | **[API Docs](https://ui-router.github.io/docs/latest/)** | -**[Download stable](http://unpkg.com/@uirouter/angularjs@latest/release/angular-ui-router.js)** (or **[Minified](http://unpkg.com/angular-ui-router@latest/release/angular-ui-router.min.js)**) **|** +**[Download stable](http://unpkg.com/@uirouter/angularjs@latest/release/angular-ui-router.js)** (or **[Minified](http://unpkg.com/@uirouter/angularjs@latest/release/angular-ui-router.min.js)**) **|** **[Guide](https://github.com/angular-ui/ui-router/wiki) |** **[Sample App](http://ui-router.github.io/resources/sampleapp/) |** **[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |** diff --git a/artifacts.json b/artifacts.json new file mode 100644 index 000000000..efbce402f --- /dev/null +++ b/artifacts.json @@ -0,0 +1,8 @@ +{ + "ARTIFACTS": [ + "lib", + "lib-esm", + "release", + "package.json" + ] +} diff --git a/bower.json b/bower.json index 1b14c3497..b1eefe924 100644 --- a/bower.json +++ b/bower.json @@ -1 +1 @@ -{"name":"angular-ui-router","description":"State-based routing for AngularJS","license":"MIT","main":"./release/angular-ui-router.js","dependencies":{"angular":">= 1.2.0"},"ignore":["**/.*","**/tsconfig.json","**/tsconfig.typedoc.json","**/webpack.config.js","**/node_modules","package.json","scripts","test","src"],"version":"1.0.5"} \ No newline at end of file +{"name":"angular-ui-router","description":"State-based routing for AngularJS","license":"MIT","main":"./release/angular-ui-router.js","dependencies":{"angular":">= 1.2.0"},"ignore":["**/.*","**/tsconfig.json","**/tsconfig.typedoc.json","**/webpack.config.js","**/node_modules","package.json","scripts","test","src"],"version":"1.0.6"} \ No newline at end of file diff --git a/package.json b/package.json index 46643a59d..7fcb81921 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,21 @@ { "name": "@uirouter/angularjs", "description": "State-based routing for AngularJS 1.x", - "version": "1.0.5", + "version": "1.0.6", "scripts": { "clean": "shx rm -rf lib lib-esm _doc build release *.log", - "build": "tsc && tsc -m es6 --outDir lib-esm && npm run fixdts", + "compile": "tsc && tsc -m es6 --outDir lib-esm && npm run fixdts", "fixdts": "dts-downlevel 'lib/**/*.d.ts' 'lib-esm/**/*.d.ts'", - "package": "npm run clean && npm run build && npm run bundle", + "fixmaps": "modify_sourcemap_paths", + "build": "npm run clean && npm run compile && npm run bundle && npm run fixmaps", "bundle": "npm run bundle_router && npm run bundle_monolithic_router && npm run bundle_events && npm run bundle_resolve", "bundle_monolithic_router": "rollup -c --environment ROUTER,MONOLITHIC && rollup -c --environment ROUTER,MINIFY,MONOLITHIC", "bundle_router": "rollup -c --environment ROUTER && rollup -c --environment ROUTER,MINIFY", "bundle_events": "rollup -c --environment EVENTS && rollup -c --environment EVENTS,MINIFY", "bundle_resolve": "rollup -c --environment RESOLVE && rollup -c --environment RESOLVE,MINIFY", - "prepare": "npm run package", + "prepare": "npm run build", + "changelog": "update_changelog", + "release": "npm run noimplicitany && node ./scripts/release.js", "install": "node migrate/migratewarn.js", "noimplicitany": "tsc --noEmit --noImplicitAny --moduleResolution node --target es6 test/noimplicitany.ts", "test": "npm run test:integrate", @@ -26,7 +29,7 @@ "debug": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1 --browsers=Chrome", "docs": "./scripts/docs.js", "publishdocs": "node scripts/publishdocs.js", - "artifacts": "node scripts/artifact_tagging.js" + "artifacts": "artifact_tagging" }, "homepage": "https://ui-router.github.io/", "contributors": [ @@ -65,11 +68,11 @@ "node": ">=4.0.0" }, "license": "MIT", - "main": "lib/index.js", + "main": "release/ui-router-angularjs.js", "jsnext:main": "lib-esm/index.js", "typings": "lib/index.d.ts", "dependencies": { - "@uirouter/core": "5.0.5" + "@uirouter/core": "=5.0.6" }, "peerDependencies": { "angular": ">=1.2.0" @@ -80,6 +83,7 @@ "@types/angular-mocks": "^1.5.5", "@types/jasmine": "^2.2.34", "@types/jquery": "^1.10.31", + "@uirouter/publish-scripts": "^1.0.4", "awesome-typescript-loader": "3.0.0-beta.10", "babel-core": "^5.8.14", "clone": "^1.0.2", diff --git a/rollup.config.js b/rollup.config.js index ca793bf5d..3768a0874 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -19,7 +19,7 @@ if (ROUTER && MONOLITHIC) { * NOTICE: This monolithic bundle also bundles the @uirouter/core code. * This causes it to be incompatible with plugins that depend on @uirouter/core. * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead. - * For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles` + * For more information, see https://ui-router.github.io/blog/uirouter-for-angularjs-umd-bundles` } else if (ROUTER) { banner += ` * This bundle requires the ui-router-core.js bundle from the @uirouter/core package.` diff --git a/scripts/artifact_tagging.js b/scripts/artifact_tagging.js deleted file mode 100755 index 287b31a76..000000000 --- a/scripts/artifact_tagging.js +++ /dev/null @@ -1,66 +0,0 @@ -#!env node -"use strict"; - -let pkg = require('../package.json'); -let version = pkg.version; -let hybridVersion = require('../../angular-hybrid/package.json').version; - -let shx = require('shelljs'); -let readlineSync = require('readline-sync'); -let fs = require('fs'); -let path = require('path'); -let util = require('./util'); -let _exec = util._exec; - -shx.cd(path.join(__dirname, '..')); - -var widen = false; -var coreDep = pkg.dependencies['@uirouter/core']; -var isNarrow = /^[[=~]?(\d.*)/.exec(coreDep); -var widenedDep = isNarrow && '^' + isNarrow[1]; - -if (isNarrow && readlineSync.keyInYN('Widen @uirouter/core dependency from ' + coreDep + ' to ' + widenedDep + '?')) { - widen = false; -} - -const YYYYMMDD = (function() { - var date = new Date(); - var year = date.getFullYear(); - - var month = date.getMonth() + 1; - month = (month < 10 ? "0" : "") + month; - - var day = date.getDate(); - day = (day < 10 ? "0" : "") + day; - - return year + month + day; -})(); - -let tagname = `SNAPSHOT-${YYYYMMDD}`; -tagname += readlineSync.question(`Suffix for tag ${tagname} (optional)?`); - -if (!readlineSync.keyInYN(`Ready to publish ${tagname} tag?`)) { - process.exit(1); -} - -util.ensureCleanMaster('master'); - -// then tag and push tag -_exec(`git checkout -b ${tagname}-prep`); - -pkg.dependencies['@uirouter/core'] = widenedDep; -// pkg.version = tagname; - -fs.writeFileSync("package.json", JSON.stringify(pkg, undefined, 2)); -_exec('git commit -m "Widening @uirouter/core dependency range to ' + widenedDep + '" package.json'); - -_exec('npm run package'); - -_exec(`git add --force lib lib-esm release package.json`); -_exec(`git rm yarn.lock`); - -_exec(`git commit -m 'chore(*): commiting build files'`); -_exec(`git tag ${tagname}`); -_exec(`git push -u origin ${tagname}`); -_exec(`git checkout master`); -_exec(`git branch -D ${tagname}-prep`); diff --git a/scripts/ensure_clean_master.js b/scripts/ensure_clean_master.js deleted file mode 100755 index a0cfbcec0..000000000 --- a/scripts/ensure_clean_master.js +++ /dev/null @@ -1,5 +0,0 @@ -#!env node -if(require.main === module && process.argv[2]) - branch = process.argv[2]; - -require('./util').ensureCleanMaster(branch); diff --git a/scripts/release.js b/scripts/release.js index f8e0ed25a..4af9e81a3 100755 --- a/scripts/release.js +++ b/scripts/release.js @@ -7,7 +7,7 @@ require('shelljs/global'); let readlineSync = require('readline-sync'); let fs = require('fs'); let path = require('path'); -let util = require('./util'); +let util = require('@uirouter/publish-scripts/util'); let _exec = util._exec; cd(path.join(__dirname, '..')); @@ -30,7 +30,7 @@ if (!readlineSync.keyInYN('Ready to publish?')) { util.ensureCleanMaster('master'); -_exec('npm run package'); +_exec('npm run build'); _exec(`npm run docs`); console.log('Updating version in bower.json to ${version}'); diff --git a/scripts/show_changelog.js b/scripts/show_changelog.js deleted file mode 100755 index 6c6c218be..000000000 --- a/scripts/show_changelog.js +++ /dev/null @@ -1,28 +0,0 @@ -#!env node -"use strict"; -let conventionalChangelog = require('conventional-changelog'); - -let options = { - preset: 'angular' -}; - -if(require.main === module) { - let context, gitOpts; - - if (process.argv[2]) { - context = {}; - gitOpts = {}; - context.previousTag = process.argv[2]; - gitOpts.from = process.argv[2]; - } - - if (process.argv[3]) { - context.currentTag = process.argv[3]; - } - - showChangelog(context, gitOpts); -} - -function showChangelog(context, gitOpts) { - conventionalChangelog(options, context, gitOpts).pipe(process.stdout); -} diff --git a/scripts/show_core_changelog.js b/scripts/show_core_changelog.js deleted file mode 100755 index 78ef3b2d4..000000000 --- a/scripts/show_core_changelog.js +++ /dev/null @@ -1,69 +0,0 @@ -#!env node -"use strict"; - -var gitSemverTags = require('git-semver-tags'); -var shelljs = require('shelljs'); -var path = require('path'); -var fs = require('fs'); - -var CORE_PKG = `@uirouter/core`; -var ALT_CORE_PKG = `ui-router-core`; -var CORE_DIR = path.join(__dirname, "..", "..", 'core'); -var SHOWCHANGELOG_SCRIPT = path.join(CORE_DIR, "scripts", "show_changelog.js"); - -var currentPackage = require('../package.json'); -if (!currentPackage.dependencies || (!currentPackage.dependencies[CORE_PKG] && !currentPackage[ALT_CORE_PKG])) { - console.error(stringify(currentPackage.dependencies)); - throw new Error("No dependency on " + CORE_PKG + " found in package.json.") -} - -if (!fs.existsSync(CORE_DIR)) { - throw new Error(CORE_PKG + " not found at " + path.resolve(CORE_DIR)); -} - -if (!fs.existsSync(SHOWCHANGELOG_SCRIPT)) { - throw new Error("show_changelog.js not found at " + path.resolve(SHOWCHANGELOG_SCRIPT)); -} - -shelljs.config.silent = true; -gitSemverTags(function (err, val) { - var fromTag; - if (require.main === module && process.argv[2]) { - fromTag = process.argv[2]; - } else { - var prevRaw = shelljs.exec('git show ' + val[0] + ':package.json', {silent:true}).stdout; - var prevPackage; - try { - prevPackage = JSON.parse(prevRaw); - } catch (error) { - console.error("Unable to parse previous package.json in ${val[0]}"); - console.error(prevRaw); - throw error; - } - - if (!prevPackage.dependencies) { - console.error(stringify(prevPackage)); - throw new Error(`previous package.json in ${val[0]} has no "dependencies" key.`); - } else if (!prevPackage.dependencies[CORE_PKG] && !prevPackage.dependencies[ALT_CORE_PKG]) { - console.error(stringify(prevPackage.dependencies)); - throw new Error(`previous package.json in ${val[0]} has no "dependencies['${CORE_PKG}']" key.`); - } - - var prevDep = prevPackage.dependencies[CORE_PKG] || prevPackage.dependencies[ALT_CORE_PKG]; - fromTag = prevDep.replace(/[=~^]/, ""); - } - - let pkg = require("../package.json"); - let currentDep = pkg.dependencies[CORE_PKG] || pkg.dependencies[ALT_CORE_PKG]; - var toTag = currentDep.replace(/[=~^]/g, ""); - - shelljs.pushd(CORE_DIR); - // console.log("node " + SHOWCHANGELOG_SCRIPT + " " + fromTag + " " + toTag) - shelljs.config.silent = false; - shelljs.exec("node " + SHOWCHANGELOG_SCRIPT + " " + fromTag + " " + toTag) -}); - - -function stringify(object) { - return JSON.stringify(object, null, 2); -} \ No newline at end of file diff --git a/scripts/update_changelog.js b/scripts/update_changelog.js deleted file mode 100755 index ce6186443..000000000 --- a/scripts/update_changelog.js +++ /dev/null @@ -1,15 +0,0 @@ -#!env node -"use strict"; - -require('shelljs/global'); -let path = require('path'); -let _exec = require('./util')._exec; - -cd(path.resolve(__dirname, '..')); - -echo('Updating CHANGELOG...'); -cp('CHANGELOG.md', 'CHANGELOG.bak'); -_exec('node ./scripts/show_changelog.js >> CHANGELOG.new'); -_exec('node ./scripts/show_core_changelog.js >> CHANGELOG.new'); -_exec('cat CHANGELOG.new CHANGELOG.bak > CHANGELOG.md'); -rm('CHANGELOG.bak', 'CHANGELOG.new'); diff --git a/scripts/util.js b/scripts/util.js deleted file mode 100755 index 89b76f3cf..000000000 --- a/scripts/util.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -require('shelljs/global'); -let fs = require('fs'); - -function ensureCleanMaster(branch) { - branch = branch || 'master'; - if (exec('git symbolic-ref HEAD').stdout.trim() !== `refs/heads/${branch}`) - throw new Error(`Not on ${branch} branch, aborting`); - if (exec('git status --porcelain').stdout.trim() !== '') - throw new Error('Working copy is dirty, aborting'); -} - -function _exec(command) { - echo(command); - echo(); - var result = exec(command); - if (result.code === 0) return result; - echo(`Aborting; non-zero return value (${result.code}) from: ${command}`); - exit(result.code) -} - -function asJson (obj) { return JSON.stringify(obj, null, 2); } - -let ensure = (type) => (path) => { - let is = false; - try { is = fs.lstatSync(path)['is' + type](); } catch (e) { console.log(e); } - if (!is) echo(`Not a ${type}: ${path}`) && exit(-3); -}; -let assertDir = ensure('Directory'); -let assertFile = ensure('File'); - -module.exports = { - ensureCleanMaster: ensureCleanMaster, - _exec: _exec, - asJson: asJson, - assertDir: assertDir, - assertFile: assertFile -}; diff --git a/tsconfig.json b/tsconfig.json index ea8cf0bbb..3bfcd1afe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,8 +9,9 @@ "allowSyntheticDefaultImports": true, "outDir": "lib", "declaration": true, - "sourceMap": true, - "skipLibCheck": true + "skipLibCheck": true, + "inlineSourceMap": true, + "inlineSources": true }, "files": [ "src/index.ts", diff --git a/yarn.lock b/yarn.lock index 64bc241fd..aa3275f0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -62,9 +62,20 @@ dependencies: "@types/node" "*" -"@uirouter/core@5.0.5": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@uirouter/core/-/core-5.0.5.tgz#4fafae8b89e1bee321b0ed32e69ab66547c055c6" +"@uirouter/core@^5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@uirouter/core/-/core-5.0.6.tgz#251e1fc4d6ce8fe47e374bb86971e68a2ef1b323" + +"@uirouter/publish-scripts@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@uirouter/publish-scripts/-/publish-scripts-1.0.4.tgz#12de0110b88985cceb5ea0a020810ea8de8ecb38" + dependencies: + conventional-changelog "^1.1.4" + conventional-changelog-ui-router-core "file:../conventional-changelog-ui-router-core" + find-parent-dir "^0.3.0" + git-semver-tags "^1.2.1" + readline-sync "^1.4.7" + shelljs "^0.7.8" JSONStream@^1.0.4: version "1.3.1" @@ -868,6 +879,13 @@ conventional-changelog-jshint@^0.1.0: compare-func "^1.3.1" q "^1.4.1" +"conventional-changelog-ui-router-core@file:../conventional-changelog-ui-router-core": + version "1.4.2" + dependencies: + compare-func "^1.3.1" + github-url-from-git "^1.4.0" + q "^1.4.1" + conventional-changelog-writer@^1.1.0: version "1.4.1" resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-1.4.1.tgz#3f4cb4d003ebb56989d30d345893b52a43639c8e" @@ -883,7 +901,7 @@ conventional-changelog-writer@^1.1.0: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.0, conventional-changelog@^1.1.3: +conventional-changelog@^1.1.0, conventional-changelog@^1.1.3, conventional-changelog@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.4.tgz#108bc750c2a317e200e2f9b413caaa1f8c7efa3b" dependencies: @@ -1453,6 +1471,10 @@ finalhandler@1.0.3, finalhandler@~1.0.3: statuses "~1.3.1" unpipe "~1.0.0" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -1614,9 +1636,9 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.0.tgz#b31fd02c8ab578bd6c9b5cacca5e1c64c1177ac1" +git-semver-tags@^1.2.0, git-semver-tags@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.1.tgz#6ccd2a52e735b736748dc762444fcd9588e27490" dependencies: meow "^3.3.0" semver "^5.0.1" @@ -3191,7 +3213,7 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -readline-sync@^1.4.5: +readline-sync@^1.4.5, readline-sync@^1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.7.tgz#001bfdd4c06110c3c084c63bf7c6a56022213f30" @@ -3545,7 +3567,7 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shelljs@^0.7.0: +shelljs@^0.7.0, shelljs@^0.7.8: version "0.7.8" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" dependencies: