@microsoft/fast-router 1.0.0-alpha.29 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": ["../../../.eslintrc.js"],
2
+ "extends": ["../../.eslintrc.js"],
3
3
  "rules": {
4
4
  "@typescript-eslint/no-non-null-assertion": "off",
5
5
  "@typescript-eslint/ban-types": [
package/CHANGELOG.json CHANGED
@@ -2,7 +2,304 @@
2
2
  "name": "@microsoft/fast-router",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 11 Dec 2024 19:52:58 GMT",
5
+ "date": "Tue, 27 Jan 2026 17:28:54 GMT",
6
+ "version": "1.0.0-alpha.30",
7
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.30",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "863023+radium-v@users.noreply.github.com",
12
+ "package": "@microsoft/fast-router",
13
+ "commit": "d1cd327a6d37cea742b1b1df48f807fe9a1da4f7",
14
+ "comment": "chore: hoist devDependencies"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@microsoft/fast-router",
19
+ "comment": "Bump @microsoft/fast-element to v2.9.2",
20
+ "commit": "not available"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Tue, 16 Dec 2025 21:27:19 GMT",
27
+ "version": "1.0.0-alpha.29",
28
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
29
+ "comments": {
30
+ "none": [
31
+ {
32
+ "author": "beachball",
33
+ "package": "@microsoft/fast-router",
34
+ "comment": "Bump @microsoft/fast-element to v2.9.1",
35
+ "commit": "not available"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "date": "Mon, 08 Dec 2025 19:47:51 GMT",
42
+ "version": "1.0.0-alpha.29",
43
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
44
+ "comments": {
45
+ "none": [
46
+ {
47
+ "author": "beachball",
48
+ "package": "@microsoft/fast-router",
49
+ "comment": "Bump @microsoft/fast-element to v2.9.0",
50
+ "commit": "not available"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Tue, 02 Dec 2025 21:47:00 GMT",
57
+ "version": "1.0.0-alpha.29",
58
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
59
+ "comments": {
60
+ "none": [
61
+ {
62
+ "author": "beachball",
63
+ "package": "@microsoft/fast-router",
64
+ "comment": "Bump @microsoft/fast-element to v2.8.5",
65
+ "commit": "not available"
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "date": "Mon, 01 Dec 2025 18:46:00 GMT",
72
+ "version": "1.0.0-alpha.29",
73
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
74
+ "comments": {
75
+ "none": [
76
+ {
77
+ "author": "beachball",
78
+ "package": "@microsoft/fast-router",
79
+ "comment": "Bump @microsoft/fast-element to v2.8.4",
80
+ "commit": "not available"
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ "date": "Sun, 16 Nov 2025 07:14:25 GMT",
87
+ "version": "1.0.0-alpha.29",
88
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
89
+ "comments": {
90
+ "none": [
91
+ {
92
+ "author": "13071055+chrisdholt@users.noreply.github.com",
93
+ "package": "@microsoft/fast-router",
94
+ "commit": "acbdd78666f70b0b49dc99f61b71af7c0b3e259e",
95
+ "comment": "chore: flatten repository package structure"
96
+ }
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ "date": "Wed, 12 Nov 2025 20:41:54 GMT",
102
+ "version": "1.0.0-alpha.29",
103
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
104
+ "comments": {
105
+ "none": [
106
+ {
107
+ "author": "beachball",
108
+ "package": "@microsoft/fast-router",
109
+ "comment": "Bump @microsoft/fast-element to v2.8.3",
110
+ "commit": "not available"
111
+ }
112
+ ]
113
+ }
114
+ },
115
+ {
116
+ "date": "Fri, 31 Oct 2025 20:45:55 GMT",
117
+ "version": "1.0.0-alpha.29",
118
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
119
+ "comments": {
120
+ "none": [
121
+ {
122
+ "author": "beachball",
123
+ "package": "@microsoft/fast-router",
124
+ "comment": "Bump @microsoft/fast-element to v2.8.2",
125
+ "commit": "not available"
126
+ }
127
+ ]
128
+ }
129
+ },
130
+ {
131
+ "date": "Tue, 21 Oct 2025 16:17:27 GMT",
132
+ "version": "1.0.0-alpha.29",
133
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
134
+ "comments": {
135
+ "none": [
136
+ {
137
+ "author": "beachball",
138
+ "package": "@microsoft/fast-router",
139
+ "comment": "Bump @microsoft/fast-element to v2.8.1",
140
+ "commit": "not available"
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ {
146
+ "date": "Mon, 13 Oct 2025 00:37:08 GMT",
147
+ "version": "1.0.0-alpha.29",
148
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
149
+ "comments": {
150
+ "none": [
151
+ {
152
+ "author": "beachball",
153
+ "package": "@microsoft/fast-router",
154
+ "comment": "Bump @microsoft/fast-element to v2.8.0",
155
+ "commit": "not available"
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ {
161
+ "date": "Wed, 20 Aug 2025 20:57:02 GMT",
162
+ "version": "1.0.0-alpha.29",
163
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
164
+ "comments": {
165
+ "none": [
166
+ {
167
+ "author": "beachball",
168
+ "package": "@microsoft/fast-router",
169
+ "comment": "Bump @microsoft/fast-element to v2.7.0",
170
+ "commit": "not available"
171
+ }
172
+ ]
173
+ }
174
+ },
175
+ {
176
+ "date": "Wed, 06 Aug 2025 07:15:14 GMT",
177
+ "version": "1.0.0-alpha.29",
178
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
179
+ "comments": {
180
+ "none": [
181
+ {
182
+ "author": "beachball",
183
+ "package": "@microsoft/fast-router",
184
+ "comment": "Bump @microsoft/fast-element to v2.6.0",
185
+ "commit": "not available"
186
+ }
187
+ ]
188
+ }
189
+ },
190
+ {
191
+ "date": "Wed, 16 Jul 2025 22:43:52 GMT",
192
+ "version": "1.0.0-alpha.29",
193
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
194
+ "comments": {
195
+ "none": [
196
+ {
197
+ "author": "beachball",
198
+ "package": "@microsoft/fast-router",
199
+ "comment": "Bump @microsoft/fast-element to v2.5.0",
200
+ "commit": "not available"
201
+ }
202
+ ]
203
+ }
204
+ },
205
+ {
206
+ "date": "Fri, 30 May 2025 05:02:03 GMT",
207
+ "version": "1.0.0-alpha.29",
208
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
209
+ "comments": {
210
+ "none": [
211
+ {
212
+ "author": "beachball",
213
+ "package": "@microsoft/fast-router",
214
+ "comment": "Bump @microsoft/fast-element to v2.4.1",
215
+ "commit": "not available"
216
+ }
217
+ ]
218
+ }
219
+ },
220
+ {
221
+ "date": "Fri, 23 May 2025 23:52:29 GMT",
222
+ "version": "1.0.0-alpha.29",
223
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
224
+ "comments": {
225
+ "none": [
226
+ {
227
+ "author": "beachball",
228
+ "package": "@microsoft/fast-router",
229
+ "comment": "Bump @microsoft/fast-element to v2.4.0",
230
+ "commit": "not available"
231
+ }
232
+ ]
233
+ }
234
+ },
235
+ {
236
+ "date": "Mon, 05 May 2025 00:33:41 GMT",
237
+ "version": "1.0.0-alpha.29",
238
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
239
+ "comments": {
240
+ "none": [
241
+ {
242
+ "author": "beachball",
243
+ "package": "@microsoft/fast-router",
244
+ "comment": "Bump @microsoft/fast-element to v2.3.0",
245
+ "commit": "not available"
246
+ }
247
+ ]
248
+ }
249
+ },
250
+ {
251
+ "date": "Wed, 16 Apr 2025 15:53:12 GMT",
252
+ "version": "1.0.0-alpha.29",
253
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
254
+ "comments": {
255
+ "none": [
256
+ {
257
+ "author": "beachball",
258
+ "package": "@microsoft/fast-router",
259
+ "comment": "Bump @microsoft/fast-element to v2.2.1",
260
+ "commit": "not available"
261
+ }
262
+ ]
263
+ }
264
+ },
265
+ {
266
+ "date": "Mon, 24 Mar 2025 18:26:13 GMT",
267
+ "version": "1.0.0-alpha.29",
268
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
269
+ "comments": {
270
+ "none": [
271
+ {
272
+ "author": "beachball",
273
+ "package": "@microsoft/fast-router",
274
+ "comment": "Bump @microsoft/fast-element to v2.2.0",
275
+ "commit": "not available"
276
+ }
277
+ ]
278
+ }
279
+ },
280
+ {
281
+ "date": "Thu, 13 Feb 2025 17:34:08 GMT",
282
+ "version": "1.0.0-alpha.29",
283
+ "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
284
+ "comments": {
285
+ "none": [
286
+ {
287
+ "author": "7559015+janechu@users.noreply.github.com",
288
+ "package": "@microsoft/fast-router",
289
+ "commit": "7bbe060abd0ca4b9f7bd7aba3937b604e476eaca",
290
+ "comment": "Specify prereleasePrefix, allow bumpDeps"
291
+ },
292
+ {
293
+ "author": "beachball",
294
+ "package": "@microsoft/fast-router",
295
+ "comment": "Bump @microsoft/fast-element to v2.1.0",
296
+ "commit": "not available"
297
+ }
298
+ ]
299
+ }
300
+ },
301
+ {
302
+ "date": "Wed, 11 Dec 2024 19:53:31 GMT",
6
303
  "version": "1.0.0-alpha.29",
7
304
  "tag": "@microsoft/fast-router_v1.0.0-alpha.29",
8
305
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @microsoft/fast-router
2
2
 
3
- This log was last generated on Wed, 11 Dec 2024 19:52:58 GMT and should not be manually modified.
3
+ <!-- This log was last generated on Tue, 27 Jan 2026 17:28:54 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.0.0-alpha.30
8
+
9
+ Tue, 27 Jan 2026 17:28:54 GMT
10
+
11
+ ### Changes
12
+
13
+ - chore: hoist devDependencies (863023+radium-v@users.noreply.github.com)
14
+ - Bump @microsoft/fast-element to v2.9.2
15
+
7
16
  ## 1.0.0-alpha.29
8
17
 
9
- Wed, 11 Dec 2024 19:52:58 GMT
18
+ Wed, 11 Dec 2024 19:53:31 GMT
10
19
 
11
20
  ### Changes
12
21
 
@@ -3,7 +3,7 @@ import { NavigationCommitPhaseHook, NavigationPhaseHook, NavigationPhaseName } f
3
3
  /**
4
4
  * @beta
5
5
  */
6
- export declare type NavigationContributor<TSettings = any> = Partial<Record<Exclude<NavigationPhaseName, "commit">, NavigationPhaseHook<TSettings>>> & {
6
+ export type NavigationContributor<TSettings = any> = Partial<Record<Exclude<NavigationPhaseName, "commit">, NavigationPhaseHook<TSettings>>> & {
7
7
  commit?: NavigationCommitPhaseHook<TSettings>;
8
8
  };
9
9
  /**
@@ -13,7 +13,7 @@ export declare function isNavigationPhaseContributor<T extends NavigationPhaseNa
13
13
  /**
14
14
  * @beta
15
15
  */
16
- export declare type ContributorOptions = {
16
+ export type ContributorOptions = {
17
17
  lifecycle?: boolean;
18
18
  parameters?: boolean;
19
19
  };
@@ -3,19 +3,19 @@ import { Router } from "./router.js";
3
3
  /**
4
4
  * @beta
5
5
  */
6
- export declare type NavigationPhaseName = "navigate" | "leave" | "construct" | "enter" | "commit";
6
+ export type NavigationPhaseName = "navigate" | "leave" | "construct" | "enter" | "commit";
7
7
  /**
8
8
  * @beta
9
9
  */
10
- export declare type NavigationPhaseHook<TSettings = any> = (phase: NavigationPhase<TSettings>) => Promise<any> | any;
10
+ export type NavigationPhaseHook<TSettings = any> = (phase: NavigationPhase<TSettings>) => Promise<any> | any;
11
11
  /**
12
12
  * @beta
13
13
  */
14
- export declare type NavigationCommitPhaseHook<TSettings = any> = (phase: NavigationCommitPhase<TSettings>) => Promise<any> | any;
14
+ export type NavigationCommitPhaseHook<TSettings = any> = (phase: NavigationCommitPhase<TSettings>) => Promise<any> | any;
15
15
  /**
16
16
  * @beta
17
17
  */
18
- export declare type NavigationPhaseFollowupAction = () => Promise<any> | any;
18
+ export type NavigationPhaseFollowupAction = () => Promise<any> | any;
19
19
  /**
20
20
  * @beta
21
21
  */
@@ -11,7 +11,7 @@ export interface RouteParameterConverterContext<TSettings = any> {
11
11
  /**
12
12
  * @beta
13
13
  */
14
- export declare type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;
14
+ export type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;
15
15
  /**
16
16
  * @beta
17
17
  */
@@ -11,127 +11,127 @@ export declare const childRouteParameter = "fast-child-route";
11
11
  /**
12
12
  * @beta
13
13
  */
14
- export declare type SupportsSettings<TSettings = any> = {
14
+ export type SupportsSettings<TSettings = any> = {
15
15
  settings?: TSettings;
16
16
  };
17
17
  /**
18
18
  * @beta
19
19
  */
20
- export declare type PathedRouteDefinition<TSettings = any> = SupportsSettings<TSettings> & Route;
20
+ export type PathedRouteDefinition<TSettings = any> = SupportsSettings<TSettings> & Route;
21
21
  /**
22
22
  * @beta
23
23
  */
24
- export declare type IgnorableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings>;
24
+ export type IgnorableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings>;
25
25
  /**
26
26
  * @beta
27
27
  */
28
- export declare type LayoutAndTransitionRouteDefinition = {
28
+ export type LayoutAndTransitionRouteDefinition = {
29
29
  layout?: Layout | ViewTemplate;
30
30
  transition?: Transition;
31
31
  };
32
32
  /**
33
33
  * @beta
34
34
  */
35
- export declare type RedirectRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & {
35
+ export type RedirectRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & {
36
36
  redirect: string;
37
37
  };
38
38
  /**
39
39
  * @beta
40
40
  */
41
- export declare type HasTitle = {
41
+ export type HasTitle = {
42
42
  title?: string;
43
43
  };
44
44
  /**
45
45
  * @beta
46
46
  */
47
- export declare type NavigableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & HasTitle & {
47
+ export type NavigableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & HasTitle & {
48
48
  childRouters?: boolean;
49
49
  };
50
50
  /**
51
51
  * @beta
52
52
  */
53
- export declare type FASTElementConstructor = new () => FASTElement;
53
+ export type FASTElementConstructor = new () => FASTElement;
54
54
  /**
55
55
  * @beta
56
56
  */
57
- export declare type HasElement = {
57
+ export type HasElement = {
58
58
  element: string | FASTElementConstructor | HTMLElement | (() => Promise<string | FASTElementConstructor | HTMLElement>);
59
59
  };
60
60
  /**
61
61
  * @beta
62
62
  */
63
- export declare type ElementFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasElement & SupportsSettings<TSettings> & HasTitle;
63
+ export type ElementFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasElement & SupportsSettings<TSettings> & HasTitle;
64
64
  /**
65
65
  * @beta
66
66
  */
67
- export declare type ElementRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasElement;
67
+ export type ElementRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasElement;
68
68
  /**
69
69
  * @beta
70
70
  */
71
- export declare type HasTemplate = {
71
+ export type HasTemplate = {
72
72
  template: ViewTemplate | (() => Promise<ViewTemplate>);
73
73
  };
74
74
  /**
75
75
  * @beta
76
76
  */
77
- export declare type TemplateFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasTemplate & SupportsSettings<TSettings> & HasTitle;
77
+ export type TemplateFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasTemplate & SupportsSettings<TSettings> & HasTitle;
78
78
  /**
79
79
  * @beta
80
80
  */
81
- export declare type TemplateRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasTemplate;
81
+ export type TemplateRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasTemplate;
82
82
  /**
83
83
  * @beta
84
84
  */
85
- export declare type HasCommand = {
85
+ export type HasCommand = {
86
86
  command: NavigationCommand;
87
87
  };
88
88
  /**
89
89
  * @beta
90
90
  */
91
- export declare type CommandRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & HasCommand & HasTitle;
91
+ export type CommandRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & HasCommand & HasTitle;
92
92
  /**
93
93
  * @beta
94
94
  */
95
- export declare type CommandFallbackRouteDefinition<TSettings = any> = HasCommand & SupportsSettings<TSettings> & HasTitle;
95
+ export type CommandFallbackRouteDefinition<TSettings = any> = HasCommand & SupportsSettings<TSettings> & HasTitle;
96
96
  /**
97
97
  * @beta
98
98
  */
99
- export declare type FallbackRouteDefinition<TSettings = any> = ElementFallbackRouteDefinition<TSettings> | TemplateFallbackRouteDefinition<TSettings> | Pick<RedirectRouteDefinition<TSettings>, "redirect"> | CommandFallbackRouteDefinition<TSettings>;
99
+ export type FallbackRouteDefinition<TSettings = any> = ElementFallbackRouteDefinition<TSettings> | TemplateFallbackRouteDefinition<TSettings> | Pick<RedirectRouteDefinition<TSettings>, "redirect"> | CommandFallbackRouteDefinition<TSettings>;
100
100
  /**
101
101
  * @beta
102
102
  */
103
- export declare type DefinitionCallback = () => Promise<FallbackRouteDefinition> | FallbackRouteDefinition;
103
+ export type DefinitionCallback = () => Promise<FallbackRouteDefinition> | FallbackRouteDefinition;
104
104
  /**
105
105
  * @beta
106
106
  */
107
- export declare type RenderableRouteDefinition<TSettings = any> = ElementRouteDefinition<TSettings> | TemplateRouteDefinition<TSettings>;
107
+ export type RenderableRouteDefinition<TSettings = any> = ElementRouteDefinition<TSettings> | TemplateRouteDefinition<TSettings>;
108
108
  /**
109
109
  * @beta
110
110
  */
111
- export declare type MappableRouteDefinition<TSettings = any> = RenderableRouteDefinition<TSettings> | RedirectRouteDefinition<TSettings> | CommandRouteDefinition<TSettings> | ParentRouteDefinition<TSettings>;
111
+ export type MappableRouteDefinition<TSettings = any> = RenderableRouteDefinition<TSettings> | RedirectRouteDefinition<TSettings> | CommandRouteDefinition<TSettings> | ParentRouteDefinition<TSettings>;
112
112
  /**
113
113
  * @beta
114
114
  */
115
- export declare type ParentRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & {
115
+ export type ParentRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & {
116
116
  children: MappableRouteDefinition<TSettings>[];
117
117
  };
118
118
  /**
119
119
  * @beta
120
120
  */
121
- export declare type RouteMatch<TSettings = any> = {
121
+ export type RouteMatch<TSettings = any> = {
122
122
  route: RecognizedRoute<TSettings>;
123
123
  command: NavigationCommand;
124
124
  };
125
125
  /**
126
126
  * @beta
127
127
  */
128
- export declare type RouteParameterConverterObject = {
128
+ export type RouteParameterConverterObject = {
129
129
  convert: RouteParameterConverter;
130
130
  };
131
131
  /**
132
132
  * @beta
133
133
  */
134
- export declare type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;
134
+ export type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;
135
135
  /**
136
136
  * @beta
137
137
  */
@@ -3,7 +3,7 @@ import { Router } from "./router.js";
3
3
  /**
4
4
  * @beta
5
5
  */
6
- export declare type RouterExecutionContext = ExecutionContext & {
6
+ export type RouterExecutionContext = ExecutionContext & {
7
7
  router?: Router;
8
8
  };
9
9
  /**
@@ -1,6 +1,12 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { isNavigationPhaseContributor } from "./contributors.js";
3
3
  class NavigationPhaseImpl {
4
+ get route() {
5
+ return this.routes[this.routes.length - 1];
6
+ }
7
+ get router() {
8
+ return this.routers[this.routers.length - 1];
9
+ }
4
10
  constructor(name, route, router, commitActions, cancelActions) {
5
11
  this.name = name;
6
12
  this.commitActions = commitActions;
@@ -12,12 +18,6 @@ class NavigationPhaseImpl {
12
18
  this.routes.push(route);
13
19
  this.routers.push(router);
14
20
  }
15
- get route() {
16
- return this.routes[this.routes.length - 1];
17
- }
18
- get router() {
19
- return this.routers[this.routers.length - 1];
20
- }
21
21
  cancel(callback) {
22
22
  this.canceled = true;
23
23
  if (callback) {
@@ -249,13 +249,13 @@ function compareChains(a, b) {
249
249
  return a.compareTo(b);
250
250
  }
251
251
  class RecognizeResult {
252
+ get isEmpty() {
253
+ return this.candidates.length === 0;
254
+ }
252
255
  constructor(rootState) {
253
256
  this.candidates = [];
254
257
  this.candidates = [new Candidate([""], [rootState], [], this)];
255
258
  }
256
- get isEmpty() {
257
- return this.candidates.length === 0;
258
- }
259
259
  getSolution() {
260
260
  const candidates = this.candidates.filter(hasEndpoint);
261
261
  if (candidates.length === 0) {
@@ -539,13 +539,13 @@ function isNotEmpty(segment) {
539
539
  return segment.length > 0;
540
540
  }
541
541
  class StaticSegment {
542
+ get kind() {
543
+ return 3 /* SegmentKind.static */;
544
+ }
542
545
  constructor(value, caseSensitive) {
543
546
  this.value = value;
544
547
  this.caseSensitive = caseSensitive;
545
548
  }
546
- get kind() {
547
- return 3 /* SegmentKind.static */;
548
- }
549
549
  appendTo(state) {
550
550
  const { value, value: { length }, } = this;
551
551
  if (this.caseSensitive) {
@@ -573,13 +573,13 @@ class StaticSegment {
573
573
  }
574
574
  }
575
575
  class DynamicSegment {
576
+ get kind() {
577
+ return 2 /* SegmentKind.dynamic */;
578
+ }
576
579
  constructor(name, optional) {
577
580
  this.name = name;
578
581
  this.optional = optional;
579
582
  }
580
- get kind() {
581
- return 2 /* SegmentKind.dynamic */;
582
- }
583
583
  appendTo(state) {
584
584
  state = state.append(/* segment */ this, /* value */ "/");
585
585
  return state;
@@ -595,12 +595,12 @@ class DynamicSegment {
595
595
  }
596
596
  }
597
597
  class StarSegment {
598
- constructor(name) {
599
- this.name = name;
600
- }
601
598
  get kind() {
602
599
  return 1 /* SegmentKind.star */;
603
600
  }
601
+ constructor(name) {
602
+ this.name = name;
603
+ }
604
604
  appendTo(state) {
605
605
  state = state.append(/* segment */ this, /* value */ "");
606
606
  return state;
@@ -141,7 +141,7 @@
141
141
  "excerptTokens": [
142
142
  {
143
143
  "kind": "Content",
144
- "text": "export declare type CommandFallbackRouteDefinition<TSettings = "
144
+ "text": "export type CommandFallbackRouteDefinition<TSettings = "
145
145
  },
146
146
  {
147
147
  "kind": "Content",
@@ -207,7 +207,7 @@
207
207
  "excerptTokens": [
208
208
  {
209
209
  "kind": "Content",
210
- "text": "export declare type CommandRouteDefinition<TSettings = "
210
+ "text": "export type CommandRouteDefinition<TSettings = "
211
211
  },
212
212
  {
213
213
  "kind": "Content",
@@ -460,7 +460,7 @@
460
460
  "excerptTokens": [
461
461
  {
462
462
  "kind": "Content",
463
- "text": "export declare type ContributorOptions = "
463
+ "text": "export type ContributorOptions = "
464
464
  },
465
465
  {
466
466
  "kind": "Content",
@@ -1862,7 +1862,7 @@
1862
1862
  "excerptTokens": [
1863
1863
  {
1864
1864
  "kind": "Content",
1865
- "text": "export declare type DefinitionCallback = "
1865
+ "text": "export type DefinitionCallback = "
1866
1866
  },
1867
1867
  {
1868
1868
  "kind": "Content",
@@ -1911,7 +1911,7 @@
1911
1911
  "excerptTokens": [
1912
1912
  {
1913
1913
  "kind": "Content",
1914
- "text": "export declare type ElementFallbackRouteDefinition<TSettings = "
1914
+ "text": "export type ElementFallbackRouteDefinition<TSettings = "
1915
1915
  },
1916
1916
  {
1917
1917
  "kind": "Content",
@@ -1986,7 +1986,7 @@
1986
1986
  "excerptTokens": [
1987
1987
  {
1988
1988
  "kind": "Content",
1989
- "text": "export declare type ElementRouteDefinition<TSettings = "
1989
+ "text": "export type ElementRouteDefinition<TSettings = "
1990
1990
  },
1991
1991
  {
1992
1992
  "kind": "Content",
@@ -2315,7 +2315,7 @@
2315
2315
  "excerptTokens": [
2316
2316
  {
2317
2317
  "kind": "Content",
2318
- "text": "export declare type FallbackRouteDefinition<TSettings = "
2318
+ "text": "export type FallbackRouteDefinition<TSettings = "
2319
2319
  },
2320
2320
  {
2321
2321
  "kind": "Content",
@@ -2403,7 +2403,7 @@
2403
2403
  "excerptTokens": [
2404
2404
  {
2405
2405
  "kind": "Content",
2406
- "text": "export declare type FASTElementConstructor = "
2406
+ "text": "export type FASTElementConstructor = "
2407
2407
  },
2408
2408
  {
2409
2409
  "kind": "Content",
@@ -2689,7 +2689,7 @@
2689
2689
  "excerptTokens": [
2690
2690
  {
2691
2691
  "kind": "Content",
2692
- "text": "export declare type HasCommand = "
2692
+ "text": "export type HasCommand = "
2693
2693
  },
2694
2694
  {
2695
2695
  "kind": "Content",
@@ -2724,7 +2724,7 @@
2724
2724
  "excerptTokens": [
2725
2725
  {
2726
2726
  "kind": "Content",
2727
- "text": "export declare type HasElement = "
2727
+ "text": "export type HasElement = "
2728
2728
  },
2729
2729
  {
2730
2730
  "kind": "Content",
@@ -2795,7 +2795,7 @@
2795
2795
  "excerptTokens": [
2796
2796
  {
2797
2797
  "kind": "Content",
2798
- "text": "export declare type HasTemplate = "
2798
+ "text": "export type HasTemplate = "
2799
2799
  },
2800
2800
  {
2801
2801
  "kind": "Content",
@@ -2848,7 +2848,7 @@
2848
2848
  "excerptTokens": [
2849
2849
  {
2850
2850
  "kind": "Content",
2851
- "text": "export declare type HasTitle = "
2851
+ "text": "export type HasTitle = "
2852
2852
  },
2853
2853
  {
2854
2854
  "kind": "Content",
@@ -2874,7 +2874,7 @@
2874
2874
  "excerptTokens": [
2875
2875
  {
2876
2876
  "kind": "Content",
2877
- "text": "export declare type IgnorableRouteDefinition<TSettings = "
2877
+ "text": "export type IgnorableRouteDefinition<TSettings = "
2878
2878
  },
2879
2879
  {
2880
2880
  "kind": "Content",
@@ -3350,7 +3350,7 @@
3350
3350
  "excerptTokens": [
3351
3351
  {
3352
3352
  "kind": "Content",
3353
- "text": "export declare type LayoutAndTransitionRouteDefinition = "
3353
+ "text": "export type LayoutAndTransitionRouteDefinition = "
3354
3354
  },
3355
3355
  {
3356
3356
  "kind": "Content",
@@ -3477,7 +3477,7 @@
3477
3477
  "excerptTokens": [
3478
3478
  {
3479
3479
  "kind": "Content",
3480
- "text": "export declare type MappableRouteDefinition<TSettings = "
3480
+ "text": "export type MappableRouteDefinition<TSettings = "
3481
3481
  },
3482
3482
  {
3483
3483
  "kind": "Content",
@@ -3556,7 +3556,7 @@
3556
3556
  "excerptTokens": [
3557
3557
  {
3558
3558
  "kind": "Content",
3559
- "text": "export declare type NavigableRouteDefinition<TSettings = "
3559
+ "text": "export type NavigableRouteDefinition<TSettings = "
3560
3560
  },
3561
3561
  {
3562
3562
  "kind": "Content",
@@ -3832,7 +3832,7 @@
3832
3832
  "excerptTokens": [
3833
3833
  {
3834
3834
  "kind": "Content",
3835
- "text": "export declare type NavigationCommitPhaseHook<TSettings = "
3835
+ "text": "export type NavigationCommitPhaseHook<TSettings = "
3836
3836
  },
3837
3837
  {
3838
3838
  "kind": "Content",
@@ -3944,7 +3944,7 @@
3944
3944
  "excerptTokens": [
3945
3945
  {
3946
3946
  "kind": "Content",
3947
- "text": "export declare type NavigationContributor<TSettings = "
3947
+ "text": "export type NavigationContributor<TSettings = "
3948
3948
  },
3949
3949
  {
3950
3950
  "kind": "Content",
@@ -4620,7 +4620,7 @@
4620
4620
  "excerptTokens": [
4621
4621
  {
4622
4622
  "kind": "Content",
4623
- "text": "export declare type NavigationPhaseFollowupAction = "
4623
+ "text": "export type NavigationPhaseFollowupAction = "
4624
4624
  },
4625
4625
  {
4626
4626
  "kind": "Content",
@@ -4655,7 +4655,7 @@
4655
4655
  "excerptTokens": [
4656
4656
  {
4657
4657
  "kind": "Content",
4658
- "text": "export declare type NavigationPhaseHook<TSettings = "
4658
+ "text": "export type NavigationPhaseHook<TSettings = "
4659
4659
  },
4660
4660
  {
4661
4661
  "kind": "Content",
@@ -4720,7 +4720,7 @@
4720
4720
  "excerptTokens": [
4721
4721
  {
4722
4722
  "kind": "Content",
4723
- "text": "export declare type NavigationPhaseName = "
4723
+ "text": "export type NavigationPhaseName = "
4724
4724
  },
4725
4725
  {
4726
4726
  "kind": "Content",
@@ -4948,7 +4948,7 @@
4948
4948
  "excerptTokens": [
4949
4949
  {
4950
4950
  "kind": "Content",
4951
- "text": "export declare type ParameterConverter = "
4951
+ "text": "export type ParameterConverter = "
4952
4952
  },
4953
4953
  {
4954
4954
  "kind": "Reference",
@@ -5006,7 +5006,7 @@
5006
5006
  "excerptTokens": [
5007
5007
  {
5008
5008
  "kind": "Content",
5009
- "text": "export declare type ParentRouteDefinition<TSettings = "
5009
+ "text": "export type ParentRouteDefinition<TSettings = "
5010
5010
  },
5011
5011
  {
5012
5012
  "kind": "Content",
@@ -5076,7 +5076,7 @@
5076
5076
  "excerptTokens": [
5077
5077
  {
5078
5078
  "kind": "Content",
5079
- "text": "export declare type PathedRouteDefinition<TSettings = "
5079
+ "text": "export type PathedRouteDefinition<TSettings = "
5080
5080
  },
5081
5081
  {
5082
5082
  "kind": "Content",
@@ -5768,7 +5768,7 @@
5768
5768
  "excerptTokens": [
5769
5769
  {
5770
5770
  "kind": "Content",
5771
- "text": "export declare type RedirectRouteDefinition<TSettings = "
5771
+ "text": "export type RedirectRouteDefinition<TSettings = "
5772
5772
  },
5773
5773
  {
5774
5774
  "kind": "Content",
@@ -6252,7 +6252,7 @@
6252
6252
  "excerptTokens": [
6253
6253
  {
6254
6254
  "kind": "Content",
6255
- "text": "export declare type RenderableRouteDefinition<TSettings = "
6255
+ "text": "export type RenderableRouteDefinition<TSettings = "
6256
6256
  },
6257
6257
  {
6258
6258
  "kind": "Content",
@@ -7344,7 +7344,7 @@
7344
7344
  "excerptTokens": [
7345
7345
  {
7346
7346
  "kind": "Content",
7347
- "text": "export declare type RouteMatch<TSettings = "
7347
+ "text": "export type RouteMatch<TSettings = "
7348
7348
  },
7349
7349
  {
7350
7350
  "kind": "Content",
@@ -7409,7 +7409,7 @@
7409
7409
  "excerptTokens": [
7410
7410
  {
7411
7411
  "kind": "Content",
7412
- "text": "export declare type RouteParameterConverter = "
7412
+ "text": "export type RouteParameterConverter = "
7413
7413
  },
7414
7414
  {
7415
7415
  "kind": "Content",
@@ -7629,7 +7629,7 @@
7629
7629
  "excerptTokens": [
7630
7630
  {
7631
7631
  "kind": "Content",
7632
- "text": "export declare type RouteParameterConverterObject = "
7632
+ "text": "export type RouteParameterConverterObject = "
7633
7633
  },
7634
7634
  {
7635
7635
  "kind": "Content",
@@ -9600,7 +9600,7 @@
9600
9600
  "excerptTokens": [
9601
9601
  {
9602
9602
  "kind": "Content",
9603
- "text": "export declare type RouterExecutionContext = "
9603
+ "text": "export type RouterExecutionContext = "
9604
9604
  },
9605
9605
  {
9606
9606
  "kind": "Reference",
@@ -9819,7 +9819,7 @@
9819
9819
  "excerptTokens": [
9820
9820
  {
9821
9821
  "kind": "Content",
9822
- "text": "export declare type SupportsSettings<TSettings = "
9822
+ "text": "export type SupportsSettings<TSettings = "
9823
9823
  },
9824
9824
  {
9825
9825
  "kind": "Content",
@@ -9866,7 +9866,7 @@
9866
9866
  "excerptTokens": [
9867
9867
  {
9868
9868
  "kind": "Content",
9869
- "text": "export declare type TemplateFallbackRouteDefinition<TSettings = "
9869
+ "text": "export type TemplateFallbackRouteDefinition<TSettings = "
9870
9870
  },
9871
9871
  {
9872
9872
  "kind": "Content",
@@ -9941,7 +9941,7 @@
9941
9941
  "excerptTokens": [
9942
9942
  {
9943
9943
  "kind": "Content",
9944
- "text": "export declare type TemplateRouteDefinition<TSettings = "
9944
+ "text": "export type TemplateRouteDefinition<TSettings = "
9945
9945
  },
9946
9946
  {
9947
9947
  "kind": "Content",
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-istanbul-reporter"),
42
+ require("karma-coverage"),
43
43
  require("karma-chrome-launcher"),
44
44
  require("karma-firefox-launcher"),
45
45
  ],
@@ -125,10 +125,17 @@ module.exports = function (config) {
125
125
  options: { esModules: true },
126
126
  test: /\.[tj]s$/,
127
127
  });
128
- options.reporters = ["coverage-istanbul", ...options.reporters];
129
- options.coverageIstanbulReporter = {
130
- reports: ["html", "text-summary", "json", "lcovonly", "cobertura"],
131
- dir: "coverage",
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.29",
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/web-components/fast-router"
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 ../../../build/clean.js dist",
25
+ "clean:dist": "node ../../build/clean.js dist",
26
26
  "doc": "api-extractor run --local",
27
27
  "doc:ci": "api-extractor run",
28
28
  "build": "tsc -p ./tsconfig.json && npm run doc",
29
29
  "dev": "tsc -p ./tsconfig.json -w",
30
30
  "tdd": "npm run dev & npm run test-chrome:watch",
31
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",
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
36
  "test": "npm run eslint && npm run test-chrome:verbose && npm run doc:ci",
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'",
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,44 +45,14 @@
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
- "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
50
- "@microsoft/api-extractor": "^7.47.0",
51
- "@microsoft/fast-element": "^2.0.1",
52
- "@types/chai": "^4.2.11",
53
- "@types/karma": "^6.3.3",
54
- "@types/mocha": "^7.0.2",
55
- "@types/webpack-env": "^1.15.2",
56
- "chai": "^4.2.0",
57
- "esm": "^3.2.25",
58
- "ignore-loader": "^0.1.2",
59
- "istanbul": "^0.4.5",
60
- "jsdom": "^16.2.2",
61
- "jsdom-global": "3.0.2",
62
- "karma": "^6.4.1",
63
- "karma-chrome-launcher": "^3.1.0",
64
- "karma-coverage": "^2.0.2",
65
- "karma-coverage-istanbul-reporter": "^3.0.0",
66
- "karma-firefox-launcher": "^2.1.0",
67
- "karma-mocha": "^2.0.1",
68
- "karma-mocha-reporter": "^2.2.5",
69
- "karma-source-map-support": "^1.4.0",
70
- "karma-sourcemap-loader": "^0.3.7",
71
- "karma-webpack": "^5.0.1",
72
- "mocha": "^10.5.2",
73
- "prettier": "2.8.8",
74
- "source-map": "^0.7.3",
75
- "source-map-loader": "^5.0.0",
76
- "ts-loader": "^9.3.0",
77
- "ts-node": "^10.9.2",
78
- "tsconfig-paths": "^3.9.0",
79
- "tslib": "^2.6.3",
80
- "typescript": "~4.7.0",
81
- "webpack": "^5.92.1",
82
- "webpack-cli": "^5.1.4"
52
+ "@microsoft/fast-element": "^2.9.2"
83
53
  },
84
54
  "peerDependencies": {
85
- "@microsoft/fast-element": "^2.0.1"
55
+ "@microsoft/fast-element": "^2.9.2"
86
56
  },
87
57
  "beachball": {
88
58
  "disallowedChangeTypes": [
@@ -90,6 +60,7 @@
90
60
  "minor",
91
61
  "patch"
92
62
  ],
93
- "tag": "alpha"
63
+ "tag": "alpha",
64
+ "prereleasePrefix": "alpha"
94
65
  }
95
66
  }