@analogjs/router 3.0.0-alpha.1 → 3.0.0-alpha.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router-server-actions.mjs","sources":["../../../../packages/router/server/actions/src/actions.ts","../../../../packages/router/server/actions/src/analogjs-router-server-actions.ts"],"sourcesContent":["import type { H3Event, H3EventContext } from 'h3';\nimport type { $Fetch } from 'nitro/types';\n\n// Preserve the existing Node req/res public contract while accommodating h3\n// v2's nullable `event.node` typing.\ntype NodeContext = NonNullable<H3Event['node']>;\n\nexport type PageServerAction = {\n params: H3EventContext['params'];\n req: NodeContext['req'];\n res: NonNullable<NodeContext['res']>;\n fetch: $Fetch;\n event: H3Event;\n};\n\nexport function fail<T = object>(status: number, errors: T) {\n return new Response(JSON.stringify(errors), {\n status,\n headers: {\n 'X-Analog-Errors': 'true',\n },\n });\n}\n\nexport function json<T = object>(data: T, config?: ResponseInit) {\n return new Response(JSON.stringify(data), {\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n },\n ...config,\n });\n}\n\nexport function redirect(url: string, config: number | ResponseInit = 302) {\n if (typeof config === 'number') {\n return new Response(null, {\n status: config,\n headers: {\n Location: `${url}`,\n },\n });\n }\n\n return new Response(null, {\n headers: {\n Location: `${url}`,\n },\n ...config,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAeM,SAAU,IAAI,CAAa,MAAc,EAAE,MAAS,EAAA;IACxD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC1C,MAAM;AACN,QAAA,OAAO,EAAE;AACP,YAAA,iBAAiB,EAAE,MAAM;AAC1B,SAAA;AACF,KAAA,CAAC;AACJ;AAEM,SAAU,IAAI,CAAa,IAAO,EAAE,MAAqB,EAAA;IAC7D,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;AACxC,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,iCAAiC;AAClD,SAAA;AACD,QAAA,GAAG,MAAM;AACV,KAAA,CAAC;AACJ;SAEgB,QAAQ,CAAC,GAAW,EAAE,SAAgC,GAAG,EAAA;AACvE,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AACxB,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE;gBACP,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAA,CAAE;AACnB,aAAA;AACF,SAAA,CAAC;IACJ;AAEA,IAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AACxB,QAAA,OAAO,EAAE;YACP,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAA,CAAE;AACnB,SAAA;AACD,QAAA,GAAG,MAAM;AACV,KAAA,CAAC;AACJ;;ACjDA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"analogjs-router-server-actions.mjs","sources":["../../../../packages/router/server/actions/src/actions.ts","../../../../packages/router/server/actions/src/analogjs-router-server-actions.ts"],"sourcesContent":["import type { H3Event, H3EventContext } from 'nitro/h3';\nimport type { $Fetch } from 'nitro/types';\n\n// Preserve the existing Node req/res public contract while accommodating h3\n// v2's nullable `event.node` typing.\ntype NodeContext = NonNullable<H3Event['node']>;\n\nexport type PageServerAction = {\n params: H3EventContext['params'];\n req: NodeContext['req'];\n res: NonNullable<NodeContext['res']>;\n fetch: $Fetch;\n event: H3Event;\n};\n\nexport function fail<T = object>(status: number, errors: T) {\n return new Response(JSON.stringify(errors), {\n status,\n headers: {\n 'X-Analog-Errors': 'true',\n },\n });\n}\n\nexport function json<T = object>(data: T, config?: ResponseInit) {\n return new Response(JSON.stringify(data), {\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n },\n ...config,\n });\n}\n\nexport function redirect(url: string, config: number | ResponseInit = 302) {\n if (typeof config === 'number') {\n return new Response(null, {\n status: config,\n headers: {\n Location: `${url}`,\n },\n });\n }\n\n return new Response(null, {\n headers: {\n Location: `${url}`,\n },\n ...config,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAeM,SAAU,IAAI,CAAa,MAAc,EAAE,MAAS,EAAA;IACxD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC1C,MAAM;AACN,QAAA,OAAO,EAAE;AACP,YAAA,iBAAiB,EAAE,MAAM;AAC1B,SAAA;AACF,KAAA,CAAC;AACJ;AAEM,SAAU,IAAI,CAAa,IAAO,EAAE,MAAqB,EAAA;IAC7D,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;AACxC,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,iCAAiC;AAClD,SAAA;AACD,QAAA,GAAG,MAAM;AACV,KAAA,CAAC;AACJ;SAEgB,QAAQ,CAAC,GAAW,EAAE,SAAgC,GAAG,EAAA;AACvE,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AACxB,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE;gBACP,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAA,CAAE;AACnB,aAAA;AACF,SAAA,CAAC;IACJ;AAEA,IAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AACxB,QAAA,OAAO,EAAE;YACP,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAA,CAAE;AACnB,SAAA;AACD,QAAA,GAAG,MAAM;AACV,KAAA,CAAC;AACJ;;ACjDA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/router",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "Filesystem-based routing for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@analogjs/content": "^3.0.0-alpha.
|
|
27
|
+
"@analogjs/content": "^3.0.0-alpha.2",
|
|
28
28
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
29
29
|
"@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0"
|
|
30
30
|
},
|
|
@@ -2,7 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { Type, EnvironmentProviders, Injector } from '@angular/core';
|
|
3
3
|
import * as _angular_router from '@angular/router';
|
|
4
4
|
import { Route, ActivatedRoute, Router, CanActivateFn, DeprecatedGuard, CanActivateChildFn, CanDeactivateFn, CanMatchFn, ResolveFn, RouterFeatures, Routes, ActivatedRouteSnapshot } from '@angular/router';
|
|
5
|
-
import { H3EventContext, H3Event } from 'h3';
|
|
5
|
+
import { H3EventContext, H3Event } from 'nitro/h3';
|
|
6
6
|
import { $Fetch } from 'nitro/types';
|
|
7
7
|
import * as rxjs from 'rxjs';
|
|
8
8
|
import { Observable } from 'rxjs';
|