Skip to content

Commit 1fa95e5

Browse files
AndrewKushnirthePunderWoman
authored andcommitted
refactor(router): switching to relative imports within the router package (angular#60674)
This commit updates scripts within `packages/router` to relative imports as a prep work to the upcoming infra updates. PR Close angular#60674
1 parent 1f02cb7 commit 1fa95e5

34 files changed

+65
-45
lines changed

goldens/public-api/router/testing/index.api.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@
44
55
```ts
66

7+
import { AfterContentInit } from '@angular/core';
78
import * as _angular_router from '@angular/router';
9+
import { ChangeDetectorRef } from '@angular/core';
810
import { ComponentFixture } from '@angular/core/testing';
11+
import { ComponentRef } from '@angular/core';
912
import { DebugElement } from '@angular/core';
10-
import { ExtraOptions } from '@angular/router';
13+
import { ElementRef } from '@angular/core';
14+
import { EnvironmentInjector } from '@angular/core';
15+
import { EnvironmentProviders } from '@angular/core';
16+
import { EventEmitter } from '@angular/core';
1117
import * as i0 from '@angular/core';
18+
import { LocationStrategy } from '@angular/common';
1219
import { ModuleWithProviders } from '@angular/core';
13-
import { Routes } from '@angular/router';
20+
import { NgModuleFactory } from '@angular/core';
21+
import { Observable } from 'rxjs';
22+
import { OnChanges } from '@angular/core';
23+
import { OnDestroy } from '@angular/core';
24+
import { OnInit } from '@angular/core';
25+
import { Provider } from '@angular/core';
26+
import { ProviderToken } from '@angular/core';
27+
import { QueryList } from '@angular/core';
28+
import { Renderer2 } from '@angular/core';
29+
import { SimpleChanges } from '@angular/core';
1430
import { Type } from '@angular/core';
1531
import { WritableSignal } from '@angular/core';
1632

@@ -36,7 +52,7 @@ export class RouterTestingModule {
3652
// (undocumented)
3753
static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
3854
// (undocumented)
39-
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof _angular_router.RouterModule]>;
55+
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof RouterModule]>;
4056
}
4157

4258
// (No @packageDocumentation comment for this package)

packages/router/test/bootstrap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
RouterModule,
3232
RouterOutlet,
3333
withEnabledBlockingInitialNavigation,
34-
} from '@angular/router';
34+
} from '../index';
3535

3636
// This is needed, because all files under `packages/` are compiled together as part of the
3737
// [legacy-unit-tests-saucelabs][1] CI job, including the `lib.webworker.d.ts` typings brought in by

packages/router/test/computed_state_restoration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {provideLocationMocks, SpyLocation} from '@angular/common/testing';
1111
import {Component, Injectable, NgModule, Type} from '@angular/core';
1212
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
1313
import {expect} from '@angular/platform-browser/testing/src/matchers';
14-
import {Router, RouterModule, RouterOutlet, UrlTree, withRouterConfig} from '@angular/router';
14+
import {Router, RouterModule, RouterOutlet, UrlTree, withRouterConfig} from '../index';
1515
import {EMPTY, of} from 'rxjs';
1616

1717
import {provideRouter} from '../src/provide_router';

packages/router/test/default_export_routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {Component} from '@angular/core';
10-
import {Routes} from '@angular/router';
10+
import {Routes} from '../index';
1111

1212
@Component({
1313
template: 'default exported',

packages/router/test/directives/router_outlet.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import {
2424
RouterOutlet,
2525
withComponentInputBinding,
2626
ROUTER_OUTLET_DATA,
27-
} from '@angular/router/src';
28-
import {RouterTestingHarness} from '@angular/router/testing';
27+
} from '../../index';
28+
import {RouterTestingHarness} from '../../testing';
2929
import {InjectionToken} from '../../../core/src/di';
3030

3131
describe('router outlet name', () => {

packages/router/test/integration/duplicate_in_flight_navigations.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
withRouterConfig,
1818
NavigationStart,
1919
GuardsCheckEnd,
20-
} from '@angular/router/src';
20+
} from '../../index';
2121
import {createRoot, SimpleCmp, advance, RootCmp, BlankCmp} from './integration_helpers';
2222

2323
export function duplicateInFlightNavigationsIntegrationSuite() {

packages/router/test/integration/integration.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import {
3636
Router,
3737
RouterModule,
3838
RoutesRecognized,
39-
} from '@angular/router';
40-
import {RouterTestingHarness} from '@angular/router/testing';
39+
} from '../../index';
40+
import {RouterTestingHarness} from '../../testing';
4141

4242
import {RedirectCommand} from '../../src/models';
4343
import {

packages/router/test/integration/integration_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
RouterModule,
2222
RouterOutlet,
2323
UrlSegment,
24-
} from '@angular/router';
24+
} from '../../index';
2525
import {Observable} from 'rxjs';
2626
import {map} from 'rxjs/operators';
2727

packages/router/test/integration/lazy_loading.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ import {
4545
provideRouter,
4646
withRouterConfig,
4747
RouterLink,
48-
} from '@angular/router/src';
49-
import {getLoadedRoutes} from '@angular/router/src/router_devtools';
48+
} from '../../index';
49+
import {getLoadedRoutes} from '../../src/router_devtools';
5050
import {
5151
createRoot,
5252
RootCmp,

packages/router/test/integration/navigation_errors.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
NavigationCancel,
3333
NavigationCancellationCode,
3434
} from '../../src';
35-
import {RouterTestingHarness} from '@angular/router/testing';
35+
import {RouterTestingHarness} from '../../testing';
3636
import {
3737
createRoot,
3838
RootCmp,

0 commit comments

Comments
 (0)