@microsoft/fast-router 1.0.0-alpha.3 → 1.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.json +779 -0
- package/CHANGELOG.md +226 -1
- package/README.md +1 -5
- package/dist/dts/contributors.d.ts +12 -14
- package/dist/dts/phases.d.ts +5 -5
- package/dist/dts/query-string.d.ts +1 -1
- package/dist/dts/recognizer.d.ts +10 -1
- package/dist/dts/router.d.ts +2 -2
- package/dist/dts/routes.d.ts +25 -25
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/dts/view.d.ts +5 -10
- package/dist/esm/commands.js +9 -6
- package/dist/esm/contributors.js +18 -14
- package/dist/esm/links.js +1 -1
- package/dist/esm/process.js +6 -6
- package/dist/esm/query-string.js +8 -7
- package/dist/esm/recognizer.js +25 -18
- package/dist/esm/router.js +18 -11
- package/dist/esm/routes.js +8 -8
- package/dist/esm/view.js +6 -24
- package/dist/fast-router.api.json +753 -259
- package/dist/fast-router.d.ts +39 -36
- package/dist/fast-router.untrimmed.d.ts +39 -36
- package/docs/{api-report.md → api-report.api.md} +31 -22
- package/karma.conf.cjs +13 -6
- package/package.json +26 -45
package/dist/fast-router.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
2
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
3
2
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
4
3
|
import { Constructable } from '@microsoft/fast-element';
|
|
5
4
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
6
5
|
import { FASTElement } from '@microsoft/fast-element';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
7
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
9
9
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
10
10
|
|
|
11
11
|
/* Excluded from this release type: childRouteParameter */
|
|
@@ -38,13 +38,6 @@ export declare type ContributorOptions = {
|
|
|
38
38
|
parameters?: boolean;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* @beta
|
|
43
|
-
*/
|
|
44
|
-
export declare type ConverterObject = {
|
|
45
|
-
convert: RouteParameterConverter;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
41
|
/**
|
|
49
42
|
* @beta
|
|
50
43
|
*/
|
|
@@ -199,7 +192,7 @@ export declare class FASTElementLayout implements Layout {
|
|
|
199
192
|
private readonly template;
|
|
200
193
|
private runBeforeCommit;
|
|
201
194
|
private styles;
|
|
202
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
195
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
203
196
|
beforeCommit(routerElement: HTMLElement): Promise<void>;
|
|
204
197
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
205
198
|
private apply;
|
|
@@ -319,7 +312,7 @@ export declare interface NavigationCommand {
|
|
|
319
312
|
* @beta
|
|
320
313
|
*/
|
|
321
314
|
export declare interface NavigationCommitPhase<TSettings = any> extends Omit<NavigationPhase<TSettings>, "cancel" | "canceled" | "onCancel"> {
|
|
322
|
-
setTitle(title: string):
|
|
315
|
+
setTitle(title: string): void;
|
|
323
316
|
}
|
|
324
317
|
|
|
325
318
|
/**
|
|
@@ -339,22 +332,21 @@ export declare type NavigationContributor<TSettings = any> = Partial<Record<Excl
|
|
|
339
332
|
*/
|
|
340
333
|
export declare function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;
|
|
341
334
|
|
|
342
|
-
declare class NavigationContributorBehavior implements
|
|
343
|
-
private
|
|
344
|
-
private options;
|
|
335
|
+
declare class NavigationContributorBehavior implements ViewBehavior {
|
|
336
|
+
private directive;
|
|
345
337
|
private router;
|
|
346
|
-
|
|
347
|
-
|
|
338
|
+
private contributor;
|
|
339
|
+
constructor(directive: NavigationContributorDirective);
|
|
340
|
+
bind(controller: ViewController): void;
|
|
348
341
|
unbind(source: unknown): void;
|
|
349
342
|
}
|
|
350
343
|
|
|
351
|
-
declare class NavigationContributorDirective implements
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
nodeId: string;
|
|
344
|
+
declare class NavigationContributorDirective implements ViewBehaviorFactory {
|
|
345
|
+
readonly options: Required<ContributorOptions>;
|
|
346
|
+
targetNodeId: string;
|
|
355
347
|
constructor(options: Required<ContributorOptions>);
|
|
356
348
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
357
|
-
createBehavior(
|
|
349
|
+
createBehavior(): NavigationContributorBehavior;
|
|
358
350
|
}
|
|
359
351
|
|
|
360
352
|
/**
|
|
@@ -446,7 +438,7 @@ export declare interface NavigationQueue {
|
|
|
446
438
|
/**
|
|
447
439
|
* @beta
|
|
448
440
|
*/
|
|
449
|
-
export declare type ParameterConverter = RouteParameterConverter |
|
|
441
|
+
export declare type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;
|
|
450
442
|
|
|
451
443
|
/**
|
|
452
444
|
* @beta
|
|
@@ -472,7 +464,7 @@ export declare const QueryString: Readonly<{
|
|
|
472
464
|
* @param traditional - Boolean Use the old URI template standard (RFC6570)
|
|
473
465
|
* @returns The generated query string, excluding leading '?'.
|
|
474
466
|
*/
|
|
475
|
-
build(params:
|
|
467
|
+
build(params: Record<string, string>, traditional?: boolean): string;
|
|
476
468
|
/**
|
|
477
469
|
* Separate the query string from the path and returns the two parts.
|
|
478
470
|
* @param path - The path to separate.
|
|
@@ -649,7 +641,24 @@ export declare type RouteMatch<TSettings = any> = {
|
|
|
649
641
|
/**
|
|
650
642
|
* @beta
|
|
651
643
|
*/
|
|
652
|
-
export declare type RouteParameterConverter = (value: string | undefined) => any | Promise<any>;
|
|
644
|
+
export declare type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* @beta
|
|
648
|
+
*/
|
|
649
|
+
export declare interface RouteParameterConverterContext<TSettings = any> {
|
|
650
|
+
readonly endpoint: Endpoint<TSettings>;
|
|
651
|
+
readonly params: Readonly<Record<string, string | undefined>>;
|
|
652
|
+
readonly typedParams: Record<string, any>;
|
|
653
|
+
readonly queryParams: Record<string, string>;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* @beta
|
|
658
|
+
*/
|
|
659
|
+
export declare type RouteParameterConverterObject = {
|
|
660
|
+
convert: RouteParameterConverter;
|
|
661
|
+
};
|
|
653
662
|
|
|
654
663
|
/**
|
|
655
664
|
* @beta
|
|
@@ -738,31 +747,25 @@ export declare interface RouteRecognizer<TSettings> {
|
|
|
738
747
|
export declare interface RouterElement extends HTMLElement {
|
|
739
748
|
readonly [routerProperty]: Router;
|
|
740
749
|
config: RouterConfiguration | null;
|
|
741
|
-
connectedCallback():
|
|
742
|
-
disconnectedCallback():
|
|
750
|
+
connectedCallback(): void;
|
|
751
|
+
disconnectedCallback(): void;
|
|
743
752
|
}
|
|
744
753
|
|
|
745
754
|
/**
|
|
746
755
|
* @beta
|
|
747
756
|
*/
|
|
748
757
|
export declare type RouterExecutionContext = ExecutionContext & {
|
|
749
|
-
router
|
|
758
|
+
router?: Router;
|
|
750
759
|
};
|
|
751
760
|
|
|
752
|
-
/**
|
|
753
|
-
* @beta
|
|
754
|
-
*/
|
|
755
|
-
export declare const RouterExecutionContext: Readonly<{
|
|
756
|
-
create(router: Router): any;
|
|
757
|
-
}>;
|
|
758
|
-
|
|
759
761
|
declare const routerProperty = "$router";
|
|
760
762
|
|
|
761
763
|
/**
|
|
762
764
|
* @beta
|
|
763
765
|
*/
|
|
764
766
|
export declare interface RouteView {
|
|
765
|
-
|
|
767
|
+
context: RouterExecutionContext;
|
|
768
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
766
769
|
appendTo(host: HTMLElement): void;
|
|
767
770
|
dispose(): void;
|
|
768
771
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
2
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
3
2
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
4
3
|
import { Constructable } from '@microsoft/fast-element';
|
|
5
4
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
6
5
|
import { FASTElement } from '@microsoft/fast-element';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
7
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
9
9
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -41,13 +41,6 @@ export declare type ContributorOptions = {
|
|
|
41
41
|
parameters?: boolean;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* @beta
|
|
46
|
-
*/
|
|
47
|
-
export declare type ConverterObject = {
|
|
48
|
-
convert: RouteParameterConverter;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
44
|
/**
|
|
52
45
|
* @beta
|
|
53
46
|
*/
|
|
@@ -202,7 +195,7 @@ export declare class FASTElementLayout implements Layout {
|
|
|
202
195
|
private readonly template;
|
|
203
196
|
private runBeforeCommit;
|
|
204
197
|
private styles;
|
|
205
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
198
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
206
199
|
beforeCommit(routerElement: HTMLElement): Promise<void>;
|
|
207
200
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
208
201
|
private apply;
|
|
@@ -322,7 +315,7 @@ export declare interface NavigationCommand {
|
|
|
322
315
|
* @beta
|
|
323
316
|
*/
|
|
324
317
|
export declare interface NavigationCommitPhase<TSettings = any> extends Omit<NavigationPhase<TSettings>, "cancel" | "canceled" | "onCancel"> {
|
|
325
|
-
setTitle(title: string):
|
|
318
|
+
setTitle(title: string): void;
|
|
326
319
|
}
|
|
327
320
|
|
|
328
321
|
/**
|
|
@@ -342,22 +335,21 @@ export declare type NavigationContributor<TSettings = any> = Partial<Record<Excl
|
|
|
342
335
|
*/
|
|
343
336
|
export declare function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;
|
|
344
337
|
|
|
345
|
-
declare class NavigationContributorBehavior implements
|
|
346
|
-
private
|
|
347
|
-
private options;
|
|
338
|
+
declare class NavigationContributorBehavior implements ViewBehavior {
|
|
339
|
+
private directive;
|
|
348
340
|
private router;
|
|
349
|
-
|
|
350
|
-
|
|
341
|
+
private contributor;
|
|
342
|
+
constructor(directive: NavigationContributorDirective);
|
|
343
|
+
bind(controller: ViewController): void;
|
|
351
344
|
unbind(source: unknown): void;
|
|
352
345
|
}
|
|
353
346
|
|
|
354
|
-
declare class NavigationContributorDirective implements
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
nodeId: string;
|
|
347
|
+
declare class NavigationContributorDirective implements ViewBehaviorFactory {
|
|
348
|
+
readonly options: Required<ContributorOptions>;
|
|
349
|
+
targetNodeId: string;
|
|
358
350
|
constructor(options: Required<ContributorOptions>);
|
|
359
351
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
360
|
-
createBehavior(
|
|
352
|
+
createBehavior(): NavigationContributorBehavior;
|
|
361
353
|
}
|
|
362
354
|
|
|
363
355
|
/**
|
|
@@ -449,7 +441,7 @@ export declare interface NavigationQueue {
|
|
|
449
441
|
/**
|
|
450
442
|
* @beta
|
|
451
443
|
*/
|
|
452
|
-
export declare type ParameterConverter = RouteParameterConverter |
|
|
444
|
+
export declare type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;
|
|
453
445
|
|
|
454
446
|
/**
|
|
455
447
|
* @beta
|
|
@@ -475,7 +467,7 @@ export declare const QueryString: Readonly<{
|
|
|
475
467
|
* @param traditional - Boolean Use the old URI template standard (RFC6570)
|
|
476
468
|
* @returns The generated query string, excluding leading '?'.
|
|
477
469
|
*/
|
|
478
|
-
build(params:
|
|
470
|
+
build(params: Record<string, string>, traditional?: boolean): string;
|
|
479
471
|
/**
|
|
480
472
|
* Separate the query string from the path and returns the two parts.
|
|
481
473
|
* @param path - The path to separate.
|
|
@@ -652,7 +644,24 @@ export declare type RouteMatch<TSettings = any> = {
|
|
|
652
644
|
/**
|
|
653
645
|
* @beta
|
|
654
646
|
*/
|
|
655
|
-
export declare type RouteParameterConverter = (value: string | undefined) => any | Promise<any>;
|
|
647
|
+
export declare type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @beta
|
|
651
|
+
*/
|
|
652
|
+
export declare interface RouteParameterConverterContext<TSettings = any> {
|
|
653
|
+
readonly endpoint: Endpoint<TSettings>;
|
|
654
|
+
readonly params: Readonly<Record<string, string | undefined>>;
|
|
655
|
+
readonly typedParams: Record<string, any>;
|
|
656
|
+
readonly queryParams: Record<string, string>;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @beta
|
|
661
|
+
*/
|
|
662
|
+
export declare type RouteParameterConverterObject = {
|
|
663
|
+
convert: RouteParameterConverter;
|
|
664
|
+
};
|
|
656
665
|
|
|
657
666
|
/**
|
|
658
667
|
* @beta
|
|
@@ -741,31 +750,25 @@ export declare interface RouteRecognizer<TSettings> {
|
|
|
741
750
|
export declare interface RouterElement extends HTMLElement {
|
|
742
751
|
readonly [routerProperty]: Router;
|
|
743
752
|
config: RouterConfiguration | null;
|
|
744
|
-
connectedCallback():
|
|
745
|
-
disconnectedCallback():
|
|
753
|
+
connectedCallback(): void;
|
|
754
|
+
disconnectedCallback(): void;
|
|
746
755
|
}
|
|
747
756
|
|
|
748
757
|
/**
|
|
749
758
|
* @beta
|
|
750
759
|
*/
|
|
751
760
|
export declare type RouterExecutionContext = ExecutionContext & {
|
|
752
|
-
router
|
|
761
|
+
router?: Router;
|
|
753
762
|
};
|
|
754
763
|
|
|
755
|
-
/**
|
|
756
|
-
* @beta
|
|
757
|
-
*/
|
|
758
|
-
export declare const RouterExecutionContext: Readonly<{
|
|
759
|
-
create(router: Router): any;
|
|
760
|
-
}>;
|
|
761
|
-
|
|
762
764
|
declare const routerProperty = "$router";
|
|
763
765
|
|
|
764
766
|
/**
|
|
765
767
|
* @beta
|
|
766
768
|
*/
|
|
767
769
|
export declare interface RouteView {
|
|
768
|
-
|
|
770
|
+
context: RouterExecutionContext;
|
|
771
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
769
772
|
appendTo(host: HTMLElement): void;
|
|
770
773
|
dispose(): void;
|
|
771
774
|
}
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
9
8
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
10
9
|
import { Constructable } from '@microsoft/fast-element';
|
|
11
10
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
12
11
|
import { FASTElement } from '@microsoft/fast-element';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
13
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
14
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
15
15
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
16
16
|
|
|
17
17
|
// Warning: (ae-internal-missing-underscore) The name "childRouteParameter" should be prefixed with an underscore because the declaration is marked as @internal
|
|
@@ -42,11 +42,6 @@ export type ContributorOptions = {
|
|
|
42
42
|
parameters?: boolean;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// @beta (undocumented)
|
|
46
|
-
export type ConverterObject = {
|
|
47
|
-
convert: RouteParameterConverter;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
45
|
// @beta (undocumented)
|
|
51
46
|
export class DefaultLinkHandler implements LinkHandler {
|
|
52
47
|
// (undocumented)
|
|
@@ -152,7 +147,7 @@ export type FASTElementConstructor = new () => FASTElement;
|
|
|
152
147
|
|
|
153
148
|
// @beta (undocumented)
|
|
154
149
|
export class FASTElementLayout implements Layout {
|
|
155
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
150
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
156
151
|
// (undocumented)
|
|
157
152
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
158
153
|
// (undocumented)
|
|
@@ -246,7 +241,7 @@ export interface NavigationCommand {
|
|
|
246
241
|
// @beta (undocumented)
|
|
247
242
|
export interface NavigationCommitPhase<TSettings = any> extends Omit<NavigationPhase<TSettings>, "cancel" | "canceled" | "onCancel"> {
|
|
248
243
|
// (undocumented)
|
|
249
|
-
setTitle(title: string):
|
|
244
|
+
setTitle(title: string): void;
|
|
250
245
|
}
|
|
251
246
|
|
|
252
247
|
// @beta (undocumented)
|
|
@@ -327,7 +322,7 @@ export interface NavigationQueue {
|
|
|
327
322
|
}
|
|
328
323
|
|
|
329
324
|
// @beta (undocumented)
|
|
330
|
-
export type ParameterConverter = RouteParameterConverter |
|
|
325
|
+
export type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;
|
|
331
326
|
|
|
332
327
|
// @beta (undocumented)
|
|
333
328
|
export type ParentRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & {
|
|
@@ -340,7 +335,7 @@ export type PathedRouteDefinition<TSettings = any> = SupportsSettings<TSettings>
|
|
|
340
335
|
// @beta (undocumented)
|
|
341
336
|
export const QueryString: Readonly<{
|
|
342
337
|
readonly current: string;
|
|
343
|
-
build(params:
|
|
338
|
+
build(params: Record<string, string>, traditional?: boolean): string;
|
|
344
339
|
separate(path: string): Readonly<{
|
|
345
340
|
path: string;
|
|
346
341
|
queryString: string;
|
|
@@ -474,7 +469,24 @@ export type RouteMatch<TSettings = any> = {
|
|
|
474
469
|
};
|
|
475
470
|
|
|
476
471
|
// @beta (undocumented)
|
|
477
|
-
export type RouteParameterConverter = (value: string | undefined) => any | Promise<any>;
|
|
472
|
+
export type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;
|
|
473
|
+
|
|
474
|
+
// @beta (undocumented)
|
|
475
|
+
export interface RouteParameterConverterContext<TSettings = any> {
|
|
476
|
+
// (undocumented)
|
|
477
|
+
readonly endpoint: Endpoint<TSettings>;
|
|
478
|
+
// (undocumented)
|
|
479
|
+
readonly params: Readonly<Record<string, string | undefined>>;
|
|
480
|
+
// (undocumented)
|
|
481
|
+
readonly queryParams: Record<string, string>;
|
|
482
|
+
// (undocumented)
|
|
483
|
+
readonly typedParams: Record<string, any>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// @beta (undocumented)
|
|
487
|
+
export type RouteParameterConverterObject = {
|
|
488
|
+
convert: RouteParameterConverter;
|
|
489
|
+
};
|
|
478
490
|
|
|
479
491
|
// @beta (undocumented)
|
|
480
492
|
export interface Router<TSettings = any> {
|
|
@@ -575,27 +587,24 @@ export interface RouterElement extends HTMLElement {
|
|
|
575
587
|
// (undocumented)
|
|
576
588
|
config: RouterConfiguration | null;
|
|
577
589
|
// (undocumented)
|
|
578
|
-
connectedCallback():
|
|
590
|
+
connectedCallback(): void;
|
|
579
591
|
// (undocumented)
|
|
580
|
-
disconnectedCallback():
|
|
592
|
+
disconnectedCallback(): void;
|
|
581
593
|
}
|
|
582
594
|
|
|
583
595
|
// @beta (undocumented)
|
|
584
596
|
export type RouterExecutionContext = ExecutionContext & {
|
|
585
|
-
router
|
|
597
|
+
router?: Router;
|
|
586
598
|
};
|
|
587
599
|
|
|
588
|
-
// @beta (undocumented)
|
|
589
|
-
export const RouterExecutionContext: Readonly<{
|
|
590
|
-
create(router: Router): any;
|
|
591
|
-
}>;
|
|
592
|
-
|
|
593
600
|
// @beta (undocumented)
|
|
594
601
|
export interface RouteView {
|
|
595
602
|
// (undocumented)
|
|
596
603
|
appendTo(host: HTMLElement): void;
|
|
597
604
|
// (undocumented)
|
|
598
|
-
bind(allTypedParams: Readonly<Record<string, any
|
|
605
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
606
|
+
// (undocumented)
|
|
607
|
+
context: RouterExecutionContext;
|
|
599
608
|
// (undocumented)
|
|
600
609
|
dispose(): void;
|
|
601
610
|
}
|
package/karma.conf.cjs
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = function (config) {
|
|
|
39
39
|
require("karma-webpack"),
|
|
40
40
|
require("karma-source-map-support"),
|
|
41
41
|
require("karma-sourcemap-loader"),
|
|
42
|
-
require("karma-coverage
|
|
42
|
+
require("karma-coverage"),
|
|
43
43
|
require("karma-chrome-launcher"),
|
|
44
44
|
require("karma-firefox-launcher"),
|
|
45
45
|
],
|
|
@@ -121,14 +121,21 @@ module.exports = function (config) {
|
|
|
121
121
|
options.webpack.module.rules.push({
|
|
122
122
|
enforce: "post",
|
|
123
123
|
exclude: /(__tests__|testing|node_modules|\.spec\.[tj]s$)/,
|
|
124
|
-
loader:
|
|
124
|
+
loader: '@jsdevtools/coverage-istanbul-loader',
|
|
125
125
|
options: { esModules: true },
|
|
126
126
|
test: /\.[tj]s$/,
|
|
127
127
|
});
|
|
128
|
-
options.reporters = ["coverage
|
|
129
|
-
options.
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
options.reporters = ["coverage", ...options.reporters];
|
|
129
|
+
options.coverageReporter = {
|
|
130
|
+
dir: path.join(basePath, "coverage"),
|
|
131
|
+
reporters: [
|
|
132
|
+
{ type: "html", subdir: "html" },
|
|
133
|
+
{ type: "text-summary" },
|
|
134
|
+
{ type: "json", subdir: ".", file: "coverage.json" },
|
|
135
|
+
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
|
|
136
|
+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
|
|
137
|
+
],
|
|
138
|
+
fixWebpackSourcePaths: true,
|
|
132
139
|
};
|
|
133
140
|
options.junitReporter = {
|
|
134
141
|
outputDir: "coverage",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@microsoft/fast-router",
|
|
3
3
|
"description": "A web-components-based router.",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.30",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Microsoft",
|
|
8
8
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/Microsoft/fast.git",
|
|
15
|
-
"directory": "packages/
|
|
15
|
+
"directory": "packages/fast-router"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/Microsoft/fast/issues/new/choose"
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"unpkg": "dist/fast-router.min.js",
|
|
24
24
|
"scripts": {
|
|
25
|
-
"clean:dist": "node
|
|
25
|
+
"clean:dist": "node ../../build/clean.js dist",
|
|
26
26
|
"doc": "api-extractor run --local",
|
|
27
27
|
"doc:ci": "api-extractor run",
|
|
28
|
-
"build": "tsc -p ./tsconfig.json &&
|
|
28
|
+
"build": "tsc -p ./tsconfig.json && npm run doc",
|
|
29
29
|
"dev": "tsc -p ./tsconfig.json -w",
|
|
30
|
-
"tdd": "
|
|
31
|
-
"
|
|
32
|
-
"prettier": "prettier --config
|
|
33
|
-
"prettier:diff": "prettier --config
|
|
30
|
+
"tdd": "npm run dev & npm run test-chrome:watch",
|
|
31
|
+
"prepublishOnly": "npm run clean:dist && npm run build",
|
|
32
|
+
"prettier": "prettier --config ../../.prettierrc --write \"**/*.ts\"",
|
|
33
|
+
"prettier:diff": "prettier --config ../../.prettierrc \"**/*.ts\" --list-different",
|
|
34
34
|
"eslint": "eslint . --ext .ts",
|
|
35
35
|
"eslint:fix": "eslint . --ext .ts --fix",
|
|
36
|
-
"test": "
|
|
37
|
-
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
38
|
-
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
36
|
+
"test": "npm run eslint && npm run test-chrome:verbose && npm run doc:ci",
|
|
37
|
+
"test-node": "nyc --reporter=lcov --reporter=text-summary --report-dir=coverage/node --temp-dir=coverage/.nyc_output mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
38
|
+
"test-node:verbose": "nyc --reporter=lcov --reporter=text-summary --report-dir=coverage/node --temp-dir=coverage/.nyc_output mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
39
39
|
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
|
|
40
40
|
"test-chrome:verbose": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha",
|
|
41
41
|
"test-chrome:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js",
|
|
@@ -45,41 +45,22 @@
|
|
|
45
45
|
"test-firefox": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage",
|
|
46
46
|
"test-firefox:verbose": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha"
|
|
47
47
|
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"tslib": "^2.6.3"
|
|
50
|
+
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@microsoft/
|
|
50
|
-
"@types/chai": "^4.2.11",
|
|
51
|
-
"@types/karma": "^5.0.0",
|
|
52
|
-
"@types/mocha": "^7.0.2",
|
|
53
|
-
"@types/webpack-env": "^1.15.2",
|
|
54
|
-
"chai": "^4.2.0",
|
|
55
|
-
"esm": "^3.2.25",
|
|
56
|
-
"ignore-loader": "^0.1.2",
|
|
57
|
-
"istanbul": "^0.4.5",
|
|
58
|
-
"istanbul-instrumenter-loader": "^3.0.1",
|
|
59
|
-
"jsdom": "^16.2.2",
|
|
60
|
-
"jsdom-global": "3.0.2",
|
|
61
|
-
"karma": "^5.0.4",
|
|
62
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
63
|
-
"karma-coverage": "^2.0.2",
|
|
64
|
-
"karma-coverage-istanbul-reporter": "^3.0.0",
|
|
65
|
-
"karma-firefox-launcher": "^2.1.0",
|
|
66
|
-
"karma-mocha": "^2.0.1",
|
|
67
|
-
"karma-mocha-reporter": "^2.2.5",
|
|
68
|
-
"karma-source-map-support": "^1.4.0",
|
|
69
|
-
"karma-sourcemap-loader": "^0.3.7",
|
|
70
|
-
"karma-webpack": "^5.0.0",
|
|
71
|
-
"mocha": "^7.1.2",
|
|
72
|
-
"prettier": "2.0.2",
|
|
73
|
-
"source-map": "^0.7.3",
|
|
74
|
-
"source-map-loader": "^0.2.4",
|
|
75
|
-
"ts-loader": "^7.0.2",
|
|
76
|
-
"ts-node": "^8.9.1",
|
|
77
|
-
"tsconfig-paths": "^3.9.0",
|
|
78
|
-
"typescript": "^4.7.0",
|
|
79
|
-
"webpack": "^5.72.0",
|
|
80
|
-
"webpack-cli": "^4.9.2"
|
|
52
|
+
"@microsoft/fast-element": "^2.9.2"
|
|
81
53
|
},
|
|
82
|
-
"
|
|
83
|
-
"@microsoft/fast-element": "^2.
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@microsoft/fast-element": "^2.9.2"
|
|
56
|
+
},
|
|
57
|
+
"beachball": {
|
|
58
|
+
"disallowedChangeTypes": [
|
|
59
|
+
"major",
|
|
60
|
+
"minor",
|
|
61
|
+
"patch"
|
|
62
|
+
],
|
|
63
|
+
"tag": "alpha",
|
|
64
|
+
"prereleasePrefix": "alpha"
|
|
84
65
|
}
|
|
85
66
|
}
|