Skip to content

Commit 764b57c

Browse files
chore(*): Rename npm package from ui-router-ng2 to @uirouter/angular its just angular
1 parent 9d11cb4 commit 764b57c

15 files changed

+68
-41
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ matrix:
1313

1414
env:
1515
matrix:
16-
# CORE_BRANCH env variable specifies the branch of ui-router-core to use during build/test
16+
# CORE_BRANCH env variable specifies the branch of @uirouter/core to use during build/test
1717
# Each CORE_BRANCH listed here will trigger a SEPARATE job in travis
1818
- CORE_BRANCH=master
1919

20-
# If CORE_BRANCH is empty, it will use the ui-router-core from npm dependencies
20+
# If CORE_BRANCH is empty, it will use the @uirouter/core from npm dependencies
2121
# (as specified in package.json)
2222
- CORE_BRANCH=
2323

2424
script:
2525
- echo "CORE_BRANCH = x${CORE_BRANCH}x";
2626
- >
2727
if [ "x${CORE_BRANCH}x" != "xx" ] ; then
28-
echo "Installing ui-router-core from ${CORE_BRANCH}" && \
28+
echo "Installing @uirouter/core from ${CORE_BRANCH}" && \
2929
git clone --depth=10 --branch="${CORE_BRANCH}" https://github.com/ui-router/core.git ui-router-core && \
3030
pushd ui-router-core && \
3131
npm install && \

CONTRIBUTING.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Report an Issue
33

44
Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure
5-
it hasn't already been reported. You can [search through existing ui-router-ng2 issues](https://github.com/ui-router/ng2?search?q=wat%3F&type=Issues) and [ui-router-core issues](https://github.com/ui-router/core?search?q=wat%3F&type=Issues)
5+
it hasn't already been reported. You can [search through existing @uirouter/angular issues](https://github.com/ui-router/ng2?search?q=wat%3F&type=Issues) and [@uirouter/core issues](https://github.com/ui-router/core?search?q=wat%3F&type=Issues)
66
to see if someone's reported one similar to yours.
77

88
If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code
@@ -14,7 +14,7 @@ that plunkr you created!
1414

1515
**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure
1616
is a bug, it's best to talk it out on
17-
[StackOverflow](http://stackoverflow.com/questions/ask?tags=angular2,ui-router-ng2) before reporting it. This
17+
[StackOverflow](http://stackoverflow.com/questions/ask?tags=angular2,@uirouter/angular) before reporting it. This
1818
keeps development streamlined, and helps us focus on building great software.
1919

2020

@@ -47,50 +47,53 @@ Please keep in mind that the issue tracker is for *issues*. Please do *not* post
4747

4848
The code for `ui-router-ng2` is split into two source repositories:
4949

50-
* [UI-Router Core](https://github.com/ui-router/core) (`ui-router-core` on npm)
50+
* [UI-Router Core](https://github.com/ui-router/core) (`@uirouter/core` on npm)
5151
* [UI-Router for Angular 2](https://github.com/ui-router/ng2) (`ui-router-ng2` on npm)
5252

5353
Clone both repositories into directories next to each other.
5454

5555
```
56-
git clone https://github.com/ui-router/ng2.git ui-router-ng2
57-
git clone https://github.com/ui-router/core.git ui-router-core
56+
mkdir uirouter
57+
cd uirouter
58+
git clone https://github.com/ui-router/ng2.git
59+
git clone https://github.com/ui-router/core.git
5860
```
5961

6062
## Install dependencies
6163

6264
Use `npm` to install the development dependencies for each repository.
6365

6466
```
65-
cd ui-router-core
67+
cd core
6668
npm install
67-
cd ../ui-router-ng2
69+
cd ../ng2
6870
npm install
6971
cd ..
7072
```
7173

7274
## Link the directories
7375

74-
This step is necessary if you need to modify any code in `ui-router-core`.
75-
Using `npm`, link `ui-router-core` into `ui-router-ng2`
76+
This step is necessary if you need to modify any code in `@uirouter/core`.
77+
Using `npm`, link `@uirouter/core` into `ui-router-ng2`
7678

7779
```
78-
cd ui-router-core
80+
cd core
7981
npm link
80-
cd ../ui-router-ng2
81-
npm link ui-router-core
82+
cd ../ng2
83+
npm link @uirouter/core
8284
cd ..
8385
```
8486

85-
After executing these steps, `ui-router-ng2` will be built using your local copy of `ui-router-core`.
87+
After executing these steps, your local copy of `@uirouter/angular` will be built using your local copy of `@uirouter/core`
88+
instead of the prebuilt version specified in `package.json`.
8689

8790
## Develop
8891

8992
* `npm run build`: Perform a full build.
9093
* `npm run watch`: Continuously builds and runs tests when source or tests change.
9194

92-
If you make changes in `ui-router-core`, run these scripts before rebuilding or re-testing `ui-router-ng2`:
95+
If you make changes in `@uirouter/core`, run these scripts before rebuilding or re-testing `@uirouter/angular`:
9396

94-
* `npm run build`: Compiles `ui-router-core` code
95-
* `npm run watch`: Continuously builds the `ui-router-core` code when sources change.
97+
* `npm run build`: Compiles `@uirouter/core` code
98+
* `npm run watch`: Continuously builds the `@uirouter/core` code when sources change.
9699

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# UI-Router for Angular  [![Build Status](https://travis-ci.org/ui-router/ng2.svg?branch=master)](https://travis-ci.org/ui-router/ng2)
22

3-
### ui-router-ng2: State based routing for Angular (v2+)
3+
### @uirouter/angular: State based routing for Angular (v2+)
44

55
---
66
**[Tutorials](https://ui-router.github.io/tutorials/)** |
@@ -9,11 +9,11 @@
99
**[Sample App](http://ui-router.github.io/resources/sampleapp/) |**
1010
**[Report an Issue](https://github.com/ui-router/ng2/blob/master/CONTRIBUTING.md#report-an-issue) |**
1111
**[Contribute](https://github.com/ui-router/ng2/blob/master/CONTRIBUTING.md#contribute) |**
12-
**[Help!](http://stackoverflow.com/questions/ask?tags=ui-router-ng2)**
12+
**[Help!](http://stackoverflow.com/questions/ask?tags=@uirouter/angular)**
1313

1414
---
1515

16-
ui-router-ng2 is a client-side [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application)
16+
@uirouter/angular is a client-side [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application)
1717
routing framework for [Angular](http://angular.io).
1818

1919
Routing frameworks for SPAs update the browser's URL as the user navigates through the app. Conversely, this allows

config/system.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ System.config({
1010
'rxjs': 'node_modules/rxjs/bundles/Rx.js',
1111
'@angular': 'node_modules/@angular',
1212

13-
'ui-router-ng2': 'src/index.ts'
13+
'@uirouter/angular': 'src/index.ts'
1414
},
1515
map: {
1616
'@uirouter/core': 'node_modules/@uirouter/core/lib',

migrate/migrate.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"old": "ui-router-ng2",
3+
"new": "@uirouter/angular"
4+
}

migrate/migratewarn.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!env node
2+
"use strict";
3+
4+
var pkg = require('../package.json');
5+
var migrate = require('./migrate.json');
6+
7+
if (pkg.name === migrate.old) {
8+
var warning = 'WARNING! this npm package "' + migrate.old + '" has moved to "' + migrate.new + '". Please update your package.json';
9+
console.log("\x1b[1m\x1b[37m\x1b[41m%s\x1b[0m", warning);
10+
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"compile": "npm run clean && ngc",
88
"bundle": "rollup -c && rollup -c --environment MINIFY",
99
"build": "npm run compile && npm run bundle",
10+
"install": "node ./migrate/migratewarn.js",
1011
"travis": "npm run build && npm run noimplicitany && npm run test",
1112
"test": "karma start",
1213
"noimplicitany": "tsc --noEmit --noImplicitAny --moduleResolution node --target es6 test/noimplicitany.ts",
1314
"debug": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1 --browsers=Chrome",
1415
"package": "npm run build",
15-
"docs": "typedoc --tsconfig tsconfig.typedoc.json --readme README.md --name 'ui-router-ng2' --theme node_modules/ui-router-typedoc-themes/bin/default --out _doc --internal-aliases internal,coreapi,ng2api --external-aliases internalapi,external --navigation-label-globals ui-router-ng2",
16+
"docs": "typedoc --tsconfig tsconfig.typedoc.json --readme README.md --name '@uirouter/angular' --theme node_modules/ui-router-typedoc-themes/bin/default --out _doc --internal-aliases internal,coreapi,ng2api --external-aliases internalapi,external --navigation-label-globals @uirouter/angular",
1617
"prepublish": "npm run build",
1718
"changelog": "node scripts/update_changelog.js",
1819
"release": "node scripts/release.js",

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function isExternal(id) {
5454
}
5555

5656
const CONFIG = {
57-
moduleName: 'ui-router-ng2',
57+
moduleName: '@uirouter/angular',
5858
entry: 'lib/index.js',
5959
dest: '_bundles/ui-router-ng2' + extension,
6060

scripts/show_core_changelog.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ var shelljs = require('shelljs');
55
var path = require('path');
66
var fs = require('fs');
77

8-
var CORE_PKG = 'ui-router-core';
9-
var CORE_DIR = path.join(__dirname, "..", "..", CORE_PKG);
8+
var CORE = `core`;
9+
var CORE_PKG = `@uirouter/${CORE}`;
10+
var CORE_DIR = path.join(__dirname, "..", "..", CORE);
1011
var SHOWCHANGELOG_SCRIPT = path.join(CORE_DIR, "scripts", "show_changelog.js");
1112

1213
var currentPackage = require('../package.json');
1314
if (!currentPackage.dependencies || !currentPackage.dependencies[CORE_PKG]) {
15+
console.error(stringify(currentPackage.dependencies));
1416
throw new Error("No dependency on " + CORE_PKG + " found in package.json.")
1517
}
1618

@@ -33,15 +35,17 @@ gitSemverTags(function (err, val) {
3335
try {
3436
prevPackage = JSON.parse(prevRaw);
3537
} catch (error) {
36-
console.error("Unable to parse previous package.json");
38+
console.error("Unable to parse previous package.json in ${val[0]}");
3739
console.error(prevRaw);
3840
throw error;
3941
}
4042

4143
if (!prevPackage.dependencies) {
42-
throw new Error("previous package.json has no `dependencies` key.");
44+
console.error(stringify(prevPackage));
45+
throw new Error(`previous package.json in ${val[0]} has no "dependencies" key.`);
4346
} else if (!prevPackage.dependencies[CORE_PKG]) {
44-
throw new Error("previous package.json has no `dependencies['ui-router-core']` key.");
47+
console.error(stringify(prevPackage.dependencies));
48+
throw new Error(`previous package.json in ${val[0]} has no "dependencies['${CORE_PKG}']" key.`);
4549
}
4650

4751
fromTag = prevPackage.dependencies[CORE_PKG].replace(/[=~^]/, "");
@@ -53,3 +57,8 @@ gitSemverTags(function (err, val) {
5357
shelljs.config.silent = false;
5458
shelljs.exec("node " + SHOWCHANGELOG_SCRIPT + " " + fromTag + " " + toTag)
5559
});
60+
61+
62+
function stringify(object) {
63+
return JSON.stringify(object, null, 2);
64+
}

src/providers.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/**
22
* # UI-Router for Angular (v2+)
33
*
4-
* - [ui-router-ng2 home page](https://ui-router.github.io/ng2)
4+
* - [@uirouter/angular home page](https://ui-router.github.io/ng2)
55
* - [tutorials](https://ui-router.github.io/tutorial/ng2/helloworld)
66
* - [quick start repository](http://github.com/ui-router/quickstart-ng2)
77
*
88
* Getting started:
99
*
10-
* - Use npm. Add a dependency on latest `ui-router-ng2`
11-
* - Import UI-Router classes directly from `"ui-router-ng2"`
10+
* - Use npm. Add a dependency on latest `@uirouter/angular`
11+
* - Import UI-Router classes directly from `"@uirouter/angular"`
1212
*
1313
* ```js
14-
* import {StateRegistry} from "ui-router-ng2";
14+
* import {StateRegistry} from "@uirouter/angular";
1515
* ```
1616
*
1717
* - Create application states (as defined by [[Ng2StateDeclaration]]).
@@ -71,7 +71,7 @@
7171
* Pass the class to [[UIRouterModule.forRoot]] or [[UIRouterModule.forChild]].
7272
*
7373
* ```js
74-
* import {UIRouter} from "ui-router-ng2";
74+
* import {UIRouter} from "@uirouter/angular";
7575
*
7676
* @ Injectable()
7777
* export class MyUIRouterConfig {

src/statebuilders/lazyLoad.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { loadNgModule } from "../lazyLoad/lazyLoadNgModule";
2222
* ```
2323
* would build a state with a `lazyLoad` function like:
2424
* ```js
25-
* import { loadNgModule } from "ui-router-ng2";
25+
* import { loadNgModule } from "@uirouter/angular";
2626
* var decl = {
2727
* lazyLoad: loadNgModule(() => System.import('./childModule.ts')
2828
* }
@@ -39,7 +39,7 @@ import { loadNgModule } from "../lazyLoad/lazyLoadNgModule";
3939
* ```
4040
* would build a state with a `lazyLoad` function like:
4141
* ```js
42-
* import { loadNgModule } from "ui-router-ng2";
42+
* import { loadNgModule } from "@uirouter/angular";
4343
* var decl = {
4444
* lazyLoad: () => System.import('third-party-library')
4545
* .then(() => loadNgModule(() => System.import('./childModule.ts'))

src/statebuilders/views.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {ViewService} from "@uirouter/core";
1111
* This is a [[StateBuilder.builder]] function for Angular `views`.
1212
*
1313
* When the [[StateBuilder]] builds a [[State]] object from a raw [[StateDeclaration]], this builder
14-
* handles the `views` property with logic specific to ui-router-ng2.
14+
* handles the `views` property with logic specific to @uirouter/angular.
1515
*
1616
* If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object and
1717
* applies the state-level configuration to a view named `$default`.

src/uiRouterNgModule.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export interface StatesModule {
197197
* #### Example:
198198
* ```js
199199
* import { Injector } from "@angular/core";
200-
* import { UIRouter } from "ui-router-ng2";
200+
* import { UIRouter } from "@uirouter/angular";
201201
* import { requireAuthHook } from "./requireAuthHook";
202202
* import { MyService } from "./myService";
203203
*

test/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require('zone.js/dist/fake-async-test');
1515
// Init testing harness
1616
require('./bootstrap');
1717

18-
// Add ui-router-ng2
18+
// Add @uirouter/angular
1919
require('../src/index');
2020

2121
var testsContext = require['context'](".", true, /\.spec$/);

tsconfig.typedoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"files": [
1313
"src/index.ts",
14-
"../ui-router-core/src/index.ts",
14+
"../core/src/index.ts",
1515
"node_modules/typescript/lib/lib.es6.d.ts"
1616
]
1717
}

0 commit comments

Comments
 (0)