@analogjs/router 3.0.0-alpha.3 → 3.0.0-alpha.31
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/content/package.json +4 -0
- package/fesm2022/analogjs-router-content.mjs +63 -0
- package/fesm2022/analogjs-router-content.mjs.map +1 -0
- package/fesm2022/analogjs-router-server-actions.mjs +309 -1
- package/fesm2022/analogjs-router-server-actions.mjs.map +1 -0
- package/fesm2022/analogjs-router-server.mjs +41 -3
- package/fesm2022/analogjs-router-server.mjs.map +1 -0
- package/fesm2022/analogjs-router-tanstack-query-server.mjs +22 -0
- package/fesm2022/analogjs-router-tanstack-query-server.mjs.map +1 -0
- package/fesm2022/analogjs-router-tanstack-query.mjs +39 -0
- package/fesm2022/analogjs-router-tanstack-query.mjs.map +1 -0
- package/fesm2022/analogjs-router-tokens.mjs +7 -2
- package/fesm2022/analogjs-router-tokens.mjs.map +1 -0
- package/fesm2022/analogjs-router.mjs +559 -61
- package/fesm2022/analogjs-router.mjs.map +1 -0
- package/fesm2022/debug.page.mjs +53 -31
- package/fesm2022/debug.page.mjs.map +1 -0
- package/fesm2022/provide-analog-query.mjs +23 -0
- package/fesm2022/provide-analog-query.mjs.map +1 -0
- package/fesm2022/route-files.mjs +361 -0
- package/fesm2022/route-files.mjs.map +1 -0
- package/fesm2022/routes.mjs +5 -278
- package/fesm2022/routes.mjs.map +1 -0
- package/package.json +73 -26
- package/tanstack-query/package.json +4 -0
- package/tanstack-query/server/package.json +4 -0
- package/types/content/src/index.d.ts +4 -0
- package/types/content/src/lib/debug/routes.d.ts +10 -0
- package/types/{src → content/src}/lib/markdown-helpers.d.ts +1 -1
- package/types/content/src/lib/routes.d.ts +8 -0
- package/types/content/src/lib/with-content-routes.d.ts +2 -0
- package/types/server/actions/src/define-action.d.ts +54 -0
- package/types/server/actions/src/define-api-route.d.ts +57 -0
- package/types/server/actions/src/define-page-load.d.ts +55 -0
- package/types/server/actions/src/define-server-route.d.ts +68 -0
- package/types/server/actions/src/index.d.ts +9 -1
- package/types/server/actions/src/parse-request-data.d.ts +9 -0
- package/types/server/actions/src/validate.d.ts +8 -0
- package/types/server/src/provide-server-context.d.ts +15 -1
- package/types/server/src/render.d.ts +1 -1
- package/types/server/src/server-component-render.d.ts +1 -1
- package/types/src/index.d.ts +16 -5
- package/types/src/lib/cache-key.d.ts +1 -1
- package/types/src/lib/cookie-interceptor.d.ts +1 -1
- package/types/src/lib/debug/debug.page.d.ts +4 -2
- package/types/src/lib/define-route.d.ts +6 -1
- package/types/src/lib/endpoints.d.ts +1 -1
- package/types/src/lib/experimental.d.ts +140 -0
- package/types/src/lib/form-action.directive.d.ts +12 -5
- package/types/src/lib/i18n/provide-i18n.d.ts +98 -0
- package/types/src/lib/inject-load.d.ts +5 -2
- package/types/src/lib/inject-navigate.d.ts +23 -0
- package/types/src/lib/inject-route-context.d.ts +32 -0
- package/types/src/lib/inject-typed-params.d.ts +63 -0
- package/types/src/lib/json-ld.d.ts +32 -0
- package/types/src/lib/meta-tags.d.ts +3 -1
- package/types/src/lib/models.d.ts +3 -0
- package/types/src/lib/provide-file-router-base.d.ts +4 -0
- package/types/src/lib/provide-file-router.d.ts +2 -8
- package/types/src/lib/route-builder.d.ts +5 -0
- package/types/src/lib/route-files.d.ts +18 -0
- package/types/src/lib/route-path.d.ts +124 -0
- package/types/src/lib/route-types.d.ts +2 -1
- package/types/src/lib/routes.d.ts +2 -10
- package/types/src/lib/validation-errors.d.ts +7 -0
- package/types/tanstack-query/server/src/index.d.ts +1 -0
- package/types/tanstack-query/src/index.d.ts +2 -0
- package/types/tanstack-query/src/provide-analog-query.d.ts +4 -0
- package/types/tanstack-query/src/provide-server-analog-query.d.ts +2 -0
- package/types/tanstack-query/src/server-query.d.ts +16 -0
- package/types/tokens/src/index.d.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, inject } from "@angular/core";
|
|
1
|
+
import { InjectionToken, assertInInjectionContext, inject } from "@angular/core";
|
|
2
2
|
//#region packages/router/tokens/src/index.ts
|
|
3
3
|
var REQUEST = new InjectionToken("@analogjs/router Server Request");
|
|
4
4
|
var RESPONSE = new InjectionToken("@analogjs/router Server Response");
|
|
@@ -20,7 +20,12 @@ function injectInternalServerFetch() {
|
|
|
20
20
|
function injectAPIPrefix() {
|
|
21
21
|
return inject(API_PREFIX);
|
|
22
22
|
}
|
|
23
|
+
var LOCALE = new InjectionToken("@analogjs/router Locale");
|
|
24
|
+
function injectLocale() {
|
|
25
|
+
assertInInjectionContext(injectLocale);
|
|
26
|
+
return inject(LOCALE, { optional: true });
|
|
27
|
+
}
|
|
23
28
|
//#endregion
|
|
24
|
-
export { API_PREFIX, BASE_URL, INTERNAL_FETCH, REQUEST, RESPONSE, injectAPIPrefix, injectBaseURL, injectInternalServerFetch, injectRequest, injectResponse };
|
|
29
|
+
export { API_PREFIX, BASE_URL, INTERNAL_FETCH, LOCALE, REQUEST, RESPONSE, injectAPIPrefix, injectBaseURL, injectInternalServerFetch, injectLocale, injectRequest, injectResponse };
|
|
25
30
|
|
|
26
31
|
//# sourceMappingURL=analogjs-router-tokens.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analogjs-router-tokens.mjs","names":[],"sources":["../../tokens/src/index.ts"],"sourcesContent":["import {\n InjectionToken,\n assertInInjectionContext,\n inject,\n} from '@angular/core';\nimport type { $Fetch } from 'nitro/types';\nimport type {\n IncomingMessage,\n ServerResponse as NodeServerResponse,\n} from 'node:http';\n\nexport type ServerRequest = IncomingMessage & { originalUrl: string };\nexport type ServerResponse = NodeServerResponse;\nexport type ServerInternalFetch = $Fetch;\nexport type ServerContext = {\n req: ServerRequest;\n res: ServerResponse;\n fetch?: ServerInternalFetch;\n};\n\nexport const REQUEST: InjectionToken<ServerRequest> =\n new InjectionToken<ServerRequest>('@analogjs/router Server Request');\nexport const RESPONSE: InjectionToken<ServerResponse> =\n new InjectionToken<ServerResponse>('@analogjs/router Server Response');\nexport const BASE_URL: InjectionToken<string> = new InjectionToken<string>(\n '@analogjs/router Base URL',\n);\nexport const INTERNAL_FETCH: InjectionToken<ServerInternalFetch> =\n new InjectionToken<ServerInternalFetch>(\n '@analogjs/router Internal Server Fetch',\n );\n\nexport const API_PREFIX: InjectionToken<string> = new InjectionToken<string>(\n '@analogjs/router API Prefix',\n);\n\nexport function injectRequest(): ServerRequest | null {\n return inject(REQUEST, { optional: true });\n}\n\nexport function injectResponse(): ServerResponse | null {\n return inject(RESPONSE, { optional: true });\n}\n\nexport function injectBaseURL(): string | null {\n return inject(BASE_URL, { optional: true });\n}\n\nexport function injectInternalServerFetch(): ServerInternalFetch | null {\n return inject(INTERNAL_FETCH, { optional: true });\n}\n\nexport function injectAPIPrefix(): string {\n return inject(API_PREFIX);\n}\n\nexport const LOCALE: InjectionToken<string> = new InjectionToken<string>(\n '@analogjs/router Locale',\n);\n\nexport function injectLocale(): string | null {\n assertInInjectionContext(injectLocale);\n return inject(LOCALE, { optional: true });\n}\n"],"mappings":";;AAoBA,IAAa,UACX,IAAI,eAA8B,kCAAkC;AACtE,IAAa,WACX,IAAI,eAA+B,mCAAmC;AACxE,IAAa,WAAmC,IAAI,eAClD,4BACD;AACD,IAAa,iBACX,IAAI,eACF,yCACD;AAEH,IAAa,aAAqC,IAAI,eACpD,8BACD;AAED,SAAgB,gBAAsC;AACpD,QAAO,OAAO,SAAW,EAAA,UAAU,MAAO,CAAA;;AAG5C,SAAgB,iBAAwC;AACtD,QAAO,OAAO,UAAY,EAAA,UAAU,MAAO,CAAA;;AAG7C,SAAgB,gBAA+B;AAC7C,QAAO,OAAO,UAAY,EAAA,UAAU,MAAO,CAAA;;AAG7C,SAAgB,4BAAwD;AACtE,QAAO,OAAO,gBAAkB,EAAA,UAAU,MAAO,CAAA;;AAGnD,SAAgB,kBAA0B;AACxC,QAAO,OAAO,WAAW;;AAG3B,IAAa,SAAiC,IAAI,eAChD,0BACD;AAED,SAAgB,eAA8B;AAC5C,0BAAyB,aAAa;AACtC,QAAO,OAAO,QAAU,EAAA,UAAU,MAAO,CAAA"}
|