@pauloevpr/solid-router 0.16.2-vt.1

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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1097 -0
  3. package/dist/components.d.ts +31 -0
  4. package/dist/components.jsx +40 -0
  5. package/dist/data/action.d.ts +17 -0
  6. package/dist/data/action.js +166 -0
  7. package/dist/data/createAsync.d.ts +32 -0
  8. package/dist/data/createAsync.js +96 -0
  9. package/dist/data/events.d.ts +9 -0
  10. package/dist/data/events.js +123 -0
  11. package/dist/data/index.d.ts +4 -0
  12. package/dist/data/index.js +4 -0
  13. package/dist/data/query.d.ts +23 -0
  14. package/dist/data/query.js +232 -0
  15. package/dist/data/response.d.ts +4 -0
  16. package/dist/data/response.js +42 -0
  17. package/dist/index.d.ts +8 -0
  18. package/dist/index.js +2055 -0
  19. package/dist/index.jsx +7 -0
  20. package/dist/lifecycle.d.ts +5 -0
  21. package/dist/lifecycle.js +76 -0
  22. package/dist/routers/HashRouter.d.ts +9 -0
  23. package/dist/routers/HashRouter.js +41 -0
  24. package/dist/routers/MemoryRouter.d.ts +24 -0
  25. package/dist/routers/MemoryRouter.js +57 -0
  26. package/dist/routers/Router.d.ts +9 -0
  27. package/dist/routers/Router.js +45 -0
  28. package/dist/routers/StaticRouter.d.ts +6 -0
  29. package/dist/routers/StaticRouter.js +15 -0
  30. package/dist/routers/components.d.ts +29 -0
  31. package/dist/routers/components.jsx +122 -0
  32. package/dist/routers/createRouter.d.ts +10 -0
  33. package/dist/routers/createRouter.js +41 -0
  34. package/dist/routers/index.d.ts +11 -0
  35. package/dist/routers/index.js +6 -0
  36. package/dist/routing.d.ts +176 -0
  37. package/dist/routing.js +608 -0
  38. package/dist/types.d.ts +203 -0
  39. package/dist/types.js +1 -0
  40. package/dist/utils.d.ts +13 -0
  41. package/dist/utils.js +193 -0
  42. package/dist/viewTransitions.d.ts +20 -0
  43. package/dist/viewTransitions.js +118 -0
  44. package/package.json +71 -0
@@ -0,0 +1,203 @@
1
+ import type { Component, JSX, Signal } from "solid-js";
2
+ declare module "solid-js/web" {
3
+ interface RequestEvent {
4
+ response: {
5
+ status?: number;
6
+ statusText?: string;
7
+ headers: Headers;
8
+ };
9
+ router?: {
10
+ matches?: OutputMatch[];
11
+ cache?: Map<string, CacheEntry>;
12
+ submission?: {
13
+ input: any;
14
+ result: any;
15
+ url: string;
16
+ };
17
+ dataOnly?: boolean | string[];
18
+ data?: Record<string, any>;
19
+ previousUrl?: string;
20
+ };
21
+ serverOnly?: boolean;
22
+ }
23
+ }
24
+ export type Params = Record<string, string | undefined>;
25
+ export type SearchParams = Record<string, string | string[] | undefined>;
26
+ export type SetParams = Record<string, string | number | boolean | null | undefined>;
27
+ export type SetSearchParams = Record<string, string | string[] | number | number[] | boolean | boolean[] | null | undefined>;
28
+ export interface Path {
29
+ pathname: string;
30
+ search: string;
31
+ hash: string;
32
+ }
33
+ export interface Location<S = unknown> extends Path {
34
+ query: SearchParams;
35
+ state: Readonly<Partial<S>> | null;
36
+ key: string;
37
+ }
38
+ export interface NavigateOptions<S = unknown> {
39
+ resolve: boolean;
40
+ replace: boolean;
41
+ scroll: boolean;
42
+ state: S;
43
+ }
44
+ export interface Navigator {
45
+ (to: string | number, options?: Partial<NavigateOptions>): void;
46
+ (delta: number): void;
47
+ }
48
+ export type NavigatorFactory = (route?: RouteContext) => Navigator;
49
+ export interface LocationChange<S = unknown> {
50
+ value: string;
51
+ replace?: boolean;
52
+ scroll?: boolean;
53
+ state?: S;
54
+ rawPath?: string;
55
+ }
56
+ export interface RouterIntegration {
57
+ signal: Signal<LocationChange>;
58
+ create?: (router: RouterContext) => void;
59
+ utils?: Partial<RouterUtils>;
60
+ }
61
+ export type Intent = "initial" | "native" | "navigate" | "preload";
62
+ export interface RoutePreloadFuncArgs {
63
+ params: Params;
64
+ location: Location;
65
+ intent: Intent;
66
+ }
67
+ export type RoutePreloadFunc<T = unknown> = (args: RoutePreloadFuncArgs) => T;
68
+ export interface RouteSectionProps<T = unknown> {
69
+ params: Params;
70
+ location: Location;
71
+ data: T;
72
+ children?: JSX.Element;
73
+ }
74
+ export type RouteSectionComponent<T = unknown> = Component<RouteSectionProps<T>> | Component<Omit<RouteSectionProps<T>, "children">> | Component<{}>;
75
+ export type RouteDefinition<S extends string | string[] = any, T = any> = {
76
+ path?: S;
77
+ matchFilters?: MatchFilters<S>;
78
+ preload?: RoutePreloadFunc<T>;
79
+ children?: RouteDefinition | RouteDefinition[];
80
+ component?: RouteSectionComponent<T>;
81
+ info?: Record<string, any>;
82
+ /** @deprecated use preload */
83
+ load?: RoutePreloadFunc;
84
+ };
85
+ export type MatchFilter = readonly string[] | RegExp | ((s: string) => boolean);
86
+ export type PathParams<P extends string | readonly string[]> = P extends `${infer Head}/${infer Tail}` ? [...PathParams<Head>, ...PathParams<Tail>] : P extends `:${infer S}?` ? [S] : P extends `:${infer S}` ? [S] : P extends `*${infer S}` ? [S] : [];
87
+ export type MatchFilters<P extends string | readonly string[] = any> = P extends string ? {
88
+ [K in PathParams<P>[number]]?: MatchFilter;
89
+ } : Record<string, MatchFilter>;
90
+ export interface PathMatch {
91
+ params: Params;
92
+ path: string;
93
+ }
94
+ export interface RouteMatch extends PathMatch {
95
+ route: RouteDescription;
96
+ }
97
+ export interface OutputMatch {
98
+ path: string;
99
+ pattern: string;
100
+ match: string;
101
+ params: Params;
102
+ info?: Record<string, any>;
103
+ }
104
+ export interface RouteDescription {
105
+ key: unknown;
106
+ originalPath: string;
107
+ pattern: string;
108
+ component?: Component<RouteSectionProps>;
109
+ preload?: RoutePreloadFunc;
110
+ matcher: (location: string) => PathMatch | null;
111
+ matchFilters?: MatchFilters;
112
+ info?: Record<string, any>;
113
+ }
114
+ export interface Branch {
115
+ routes: RouteDescription[];
116
+ score: number;
117
+ matcher: (location: string) => RouteMatch[] | null;
118
+ }
119
+ export interface RouteContext {
120
+ parent?: RouteContext;
121
+ child?: RouteContext;
122
+ pattern: string;
123
+ path: () => string;
124
+ outlet: () => JSX.Element;
125
+ resolvePath(to: string): string | undefined;
126
+ }
127
+ export interface RouterUtils {
128
+ renderPath(path: string): string;
129
+ parsePath(str: string): string;
130
+ go(delta: number): void;
131
+ beforeLeave: BeforeLeaveLifecycle;
132
+ paramsWrapper: (getParams: () => Params, branches: () => Branch[]) => Params;
133
+ queryWrapper: (getQuery: () => SearchParams) => SearchParams;
134
+ }
135
+ export interface RouterContext {
136
+ base: RouteContext;
137
+ location: Location;
138
+ params: Params;
139
+ navigatorFactory: NavigatorFactory;
140
+ isRouting: () => boolean;
141
+ /** The target of the in-flight navigation transition, if any. Not reactive. */
142
+ readonly pendingTarget?: LocationChange;
143
+ matches: () => RouteMatch[];
144
+ renderPath(path: string): string;
145
+ parsePath(str: string): string;
146
+ beforeLeave: BeforeLeaveLifecycle;
147
+ preloadRoute: (url: URL, preloadData?: boolean) => void;
148
+ singleFlight: boolean;
149
+ submissions: Signal<Submission<any, any>[]>;
150
+ }
151
+ export interface BeforeLeaveEventArgs {
152
+ from: Location;
153
+ to: string | number;
154
+ options?: Partial<NavigateOptions>;
155
+ readonly defaultPrevented: boolean;
156
+ preventDefault(): void;
157
+ retry(force?: boolean): void;
158
+ }
159
+ export interface BeforeLeaveListener {
160
+ listener(e: BeforeLeaveEventArgs): void;
161
+ location: Location;
162
+ navigate: Navigator;
163
+ }
164
+ export interface BeforeLeaveLifecycle {
165
+ subscribe(listener: BeforeLeaveListener): () => void;
166
+ confirm(to: string | number, options?: Partial<NavigateOptions>): boolean;
167
+ }
168
+ export type Submission<T, U> = {
169
+ readonly input: T;
170
+ readonly result?: U;
171
+ readonly error: any;
172
+ readonly pending: boolean;
173
+ readonly url: string;
174
+ clear: () => void;
175
+ retry: () => void;
176
+ };
177
+ export type SubmissionStub = {
178
+ readonly input: undefined;
179
+ readonly result: undefined;
180
+ readonly error: undefined;
181
+ readonly pending: undefined;
182
+ readonly url: undefined;
183
+ clear: () => void;
184
+ retry: () => void;
185
+ };
186
+ export interface MaybePreloadableComponent extends Component {
187
+ preload?: () => void;
188
+ }
189
+ export type CacheEntry = [number, Promise<any>, any, Intent | undefined, Signal<number> & {
190
+ count: number;
191
+ }];
192
+ export type NarrowResponse<T> = T extends CustomResponse<infer U> ? U : Exclude<T, Response>;
193
+ export type RouterResponseInit = Omit<ResponseInit, "body"> & {
194
+ revalidate?: string | string[];
195
+ };
196
+ export type CustomResponse<T> = Omit<Response, "clone"> & {
197
+ customBody: () => T;
198
+ clone(...args: readonly unknown[]): CustomResponse<T>;
199
+ };
200
+ /** @deprecated */
201
+ export type RouteLoadFunc = RoutePreloadFunc;
202
+ /** @deprecated */
203
+ export type RouteLoadFuncArgs = RoutePreloadFuncArgs;
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { MatchFilters, PathMatch, RouteDescription, SearchParams, SetSearchParams } from "./types.js";
2
+ export declare const mockBase = "http://sr";
3
+ export declare function normalizePath(path: string, omitSlash?: boolean): string;
4
+ export declare function resolvePath(base: string, path: string, from?: string): string | undefined;
5
+ export declare function invariant<T>(value: T | null | undefined, message: string): T;
6
+ export declare function joinPaths(from: string, to: string): string;
7
+ export declare function extractSearchParams(url: URL): SearchParams;
8
+ export declare function createMatcher<S extends string>(path: S, partial?: boolean, matchFilters?: MatchFilters<S>): (location: string) => PathMatch | null;
9
+ export declare function scoreRoute(route: RouteDescription): number;
10
+ export declare function createMemoObject<T extends Record<string | symbol, unknown>>(fn: () => T): T;
11
+ export declare function mergeSearchString(search: string, params: SetSearchParams): string;
12
+ export declare function expandOptionals(pattern: string): string[];
13
+ export declare function setFunctionName<T>(obj: T, value: string): T;
package/dist/utils.js ADDED
@@ -0,0 +1,193 @@
1
+ import { createMemo, getOwner, runWithOwner } from "solid-js";
2
+ const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
3
+ const trimPathRegex = /^\/+|(\/)\/+$/g;
4
+ export const mockBase = "http://sr";
5
+ export function normalizePath(path, omitSlash = false) {
6
+ const s = path.replace(trimPathRegex, "$1");
7
+ return s ? (omitSlash || /^[?#]/.test(s) ? s : "/" + s) : "";
8
+ }
9
+ export function resolvePath(base, path, from) {
10
+ if (hasSchemeRegex.test(path)) {
11
+ return undefined;
12
+ }
13
+ const basePath = normalizePath(base);
14
+ const fromPath = from && normalizePath(from);
15
+ let result = "";
16
+ if (!fromPath || path.startsWith("/")) {
17
+ result = basePath;
18
+ }
19
+ else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {
20
+ result = basePath + fromPath;
21
+ }
22
+ else {
23
+ result = fromPath;
24
+ }
25
+ return (result || "/") + normalizePath(path, !result);
26
+ }
27
+ export function invariant(value, message) {
28
+ if (value == null) {
29
+ throw new Error(message);
30
+ }
31
+ return value;
32
+ }
33
+ export function joinPaths(from, to) {
34
+ return normalizePath(from).replace(/\/*(\*.*)?$/g, "") + normalizePath(to);
35
+ }
36
+ export function extractSearchParams(url) {
37
+ const params = {};
38
+ url.searchParams.forEach((value, key) => {
39
+ if (key in params) {
40
+ if (Array.isArray(params[key]))
41
+ params[key].push(value);
42
+ else
43
+ params[key] = [params[key], value];
44
+ }
45
+ else
46
+ params[key] = value;
47
+ });
48
+ return params;
49
+ }
50
+ export function createMatcher(path, partial, matchFilters) {
51
+ const [pattern, splat] = path.split("/*", 2);
52
+ const segments = pattern.split("/").filter(Boolean);
53
+ const len = segments.length;
54
+ return (location) => {
55
+ const locSegments = location.split("/");
56
+ // tolerate a single leading and trailing slash, but reject empty interior
57
+ // segments so `/foo//bar` doesn't silently match `/foo/bar` (#567)
58
+ if (locSegments[0] === "")
59
+ locSegments.shift();
60
+ if (locSegments.length && locSegments[locSegments.length - 1] === "")
61
+ locSegments.pop();
62
+ if (locSegments.includes(""))
63
+ return null;
64
+ const lenDiff = locSegments.length - len;
65
+ if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {
66
+ return null;
67
+ }
68
+ const match = {
69
+ path: len ? "" : "/",
70
+ params: {}
71
+ };
72
+ const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];
73
+ for (let i = 0; i < len; i++) {
74
+ const segment = segments[i];
75
+ const dynamic = segment[0] === ":";
76
+ const locSegment = dynamic ? locSegments[i] : locSegments[i].toLowerCase();
77
+ const key = dynamic ? segment.slice(1) : segment.toLowerCase();
78
+ if (dynamic && matchSegment(locSegment, matchFilter(key))) {
79
+ match.params[key] = locSegment;
80
+ }
81
+ else if (dynamic || !matchSegment(locSegment, key)) {
82
+ return null;
83
+ }
84
+ match.path += `/${locSegment}`;
85
+ }
86
+ if (splat) {
87
+ const remainder = lenDiff ? locSegments.slice(-lenDiff).join("/") : "";
88
+ if (matchSegment(remainder, matchFilter(splat))) {
89
+ match.params[splat] = remainder;
90
+ }
91
+ else {
92
+ return null;
93
+ }
94
+ }
95
+ return match;
96
+ };
97
+ }
98
+ function matchSegment(input, filter) {
99
+ const isEqual = (s) => s === input;
100
+ if (filter === undefined) {
101
+ return true;
102
+ }
103
+ else if (typeof filter === "string") {
104
+ return isEqual(filter);
105
+ }
106
+ else if (typeof filter === "function") {
107
+ return filter(input);
108
+ }
109
+ else if (Array.isArray(filter)) {
110
+ return filter.some(isEqual);
111
+ }
112
+ else if (filter instanceof RegExp) {
113
+ return filter.test(input);
114
+ }
115
+ return false;
116
+ }
117
+ export function scoreRoute(route) {
118
+ const [pattern, splat] = route.pattern.split("/*", 2);
119
+ const segments = pattern.split("/").filter(Boolean);
120
+ return segments.reduce((score, segment) => score + (segment.startsWith(":") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));
121
+ }
122
+ export function createMemoObject(fn) {
123
+ const map = new Map();
124
+ const owner = getOwner();
125
+ return new Proxy({}, {
126
+ get(_, property) {
127
+ if (!map.has(property)) {
128
+ runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));
129
+ }
130
+ return map.get(property)();
131
+ },
132
+ getOwnPropertyDescriptor() {
133
+ return {
134
+ enumerable: true,
135
+ configurable: true
136
+ };
137
+ },
138
+ ownKeys() {
139
+ return Reflect.ownKeys(fn());
140
+ },
141
+ has(_, property) {
142
+ return property in fn();
143
+ }
144
+ });
145
+ }
146
+ export function mergeSearchString(search, params) {
147
+ const merged = new URLSearchParams(search);
148
+ Object.entries(params).forEach(([key, value]) => {
149
+ if (value == null || value === "" || (value instanceof Array && !value.length)) {
150
+ merged.delete(key);
151
+ }
152
+ else {
153
+ if (value instanceof Array) {
154
+ // Delete all instances of the key before appending
155
+ merged.delete(key);
156
+ value.forEach(v => {
157
+ merged.append(key, String(v));
158
+ });
159
+ }
160
+ else {
161
+ merged.set(key, String(value));
162
+ }
163
+ }
164
+ });
165
+ const s = merged.toString();
166
+ return s ? `?${s}` : "";
167
+ }
168
+ export function expandOptionals(pattern) {
169
+ let match = /(\/?\:[^\/]+)\?/.exec(pattern);
170
+ if (!match)
171
+ return [pattern];
172
+ let prefix = pattern.slice(0, match.index);
173
+ let suffix = pattern.slice(match.index + match[0].length);
174
+ const prefixes = [prefix, (prefix += match[1])];
175
+ // This section handles adjacent optional params. We don't actually want all permuations since
176
+ // that will lead to equivalent routes which have the same number of params. For example
177
+ // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can
178
+ // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps
179
+ // ensure predictability where earlier params have precidence.
180
+ while ((match = /^(\/\:[^\/]+)\?/.exec(suffix))) {
181
+ prefixes.push((prefix += match[1]));
182
+ suffix = suffix.slice(match[0].length);
183
+ }
184
+ return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);
185
+ }
186
+ export function setFunctionName(obj, value) {
187
+ Object.defineProperty(obj, "name", {
188
+ value,
189
+ writable: false,
190
+ configurable: false
191
+ });
192
+ return obj;
193
+ }
@@ -0,0 +1,20 @@
1
+ import { type Accessor } from "solid-js";
2
+ export type ViewTransitionAnimation = "exponential-smooth";
3
+ export type ViewTransitionOptions = {
4
+ name: string;
5
+ animation?: ViewTransitionAnimation;
6
+ };
7
+ export type ViewTransitionSourceOptions = string | (ViewTransitionOptions & {
8
+ include?: string[];
9
+ });
10
+ export type ViewTransitionTargetOptions = string | ViewTransitionOptions;
11
+ export declare function viewTransitionSource(element: HTMLElement, options: Accessor<ViewTransitionSourceOptions>): void;
12
+ export declare function viewTransitionTarget(element: HTMLElement, options: Accessor<ViewTransitionTargetOptions>): void;
13
+ declare module "solid-js" {
14
+ namespace JSX {
15
+ interface Directives {
16
+ viewTransitionSource: ViewTransitionSourceOptions;
17
+ viewTransitionTarget: ViewTransitionTargetOptions;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,118 @@
1
+ import { createEffect, createSignal, onCleanup } from "solid-js";
2
+ export function viewTransitionSource(element, options) {
3
+ function select() {
4
+ const source = options();
5
+ setActiveNames(typeof source === "string" ? [source] : [source.name, ...(source.include ?? [])]);
6
+ }
7
+ element.addEventListener("click", select);
8
+ createEffect(() => {
9
+ const source = options();
10
+ const name = getName(source);
11
+ registerAnimation(name, getAnimation(source));
12
+ element.style.setProperty("view-transition-name", activeNames().includes(name) ? name : "none");
13
+ });
14
+ onCleanup(() => {
15
+ element.removeEventListener("click", select);
16
+ element.style.removeProperty("view-transition-name");
17
+ });
18
+ }
19
+ export function viewTransitionTarget(element, options) {
20
+ createEffect(() => {
21
+ const target = options();
22
+ const name = getName(target);
23
+ registerAnimation(name, getAnimation(target));
24
+ element.style.setProperty("view-transition-name", name);
25
+ });
26
+ onCleanup(() => element.style.removeProperty("view-transition-name"));
27
+ }
28
+ const [activeNames, setActiveNames] = createSignal([]);
29
+ const animationNames = new Set();
30
+ let style;
31
+ function getName(options) {
32
+ return typeof options === "string" ? options : options.name;
33
+ }
34
+ function getAnimation(options) {
35
+ return typeof options === "string" ? undefined : options.animation;
36
+ }
37
+ function registerAnimation(name, animation) {
38
+ if (!animation)
39
+ return;
40
+ animationNames.add(name);
41
+ updateAnimationStyles();
42
+ }
43
+ function updateAnimationStyles() {
44
+ if (typeof document === "undefined" || animationNames.size === 0)
45
+ return;
46
+ style ??= document.createElement("style");
47
+ style.id = "solid-view-transition-animations";
48
+ if (!style.parentNode)
49
+ document.head.append(style);
50
+ const animations = Array.from(animationNames, name => {
51
+ const transitionName = CSS.escape(name);
52
+ return `
53
+ ::view-transition-group(${transitionName}) {
54
+ animation-duration: var(--solid-vt-exponential-duration);
55
+ animation-timing-function: var(--solid-vt-exponential-ease);
56
+ }
57
+
58
+ ::view-transition-old(${transitionName}) {
59
+ animation: solid-vt-exponential-fade-out var(--solid-vt-exponential-duration) var(--solid-vt-exponential-ease) both;
60
+ }
61
+
62
+ ::view-transition-new(${transitionName}) {
63
+ animation: solid-vt-exponential-fade-in var(--solid-vt-exponential-duration) var(--solid-vt-exponential-ease) both;
64
+ }`;
65
+ }).join("\n");
66
+ style.textContent = `
67
+ :root {
68
+ --solid-vt-exponential-duration: 320ms;
69
+ --solid-vt-exponential-ease: cubic-bezier(0.16, 1, 0.3, 1);
70
+ }
71
+
72
+ @supports (animation-timing-function: linear(0, 1)) {
73
+ :root {
74
+ --solid-vt-exponential-ease: linear(
75
+ 0,
76
+ 0.336 10%,
77
+ 0.561 20%,
78
+ 0.711 30%,
79
+ 0.813 40%,
80
+ 0.881 50%,
81
+ 0.927 60%,
82
+ 0.956 70%,
83
+ 0.976 80%,
84
+ 0.991 90%,
85
+ 1
86
+ );
87
+ }
88
+ }
89
+
90
+ ::view-transition-group(root),
91
+ ::view-transition-old(root),
92
+ ::view-transition-new(root) {
93
+ animation: none;
94
+ }
95
+
96
+ @keyframes solid-vt-exponential-fade-out {
97
+ from {
98
+ opacity: 1;
99
+ }
100
+
101
+ to {
102
+ opacity: 0;
103
+ }
104
+ }
105
+
106
+ @keyframes solid-vt-exponential-fade-in {
107
+ from {
108
+ opacity: 0;
109
+ }
110
+
111
+ to {
112
+ opacity: 1;
113
+ }
114
+ }
115
+
116
+ ${animations}
117
+ `;
118
+ }
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@pauloevpr/solid-router",
3
+ "description": "Solid Router with native View Transitions API support",
4
+ "keywords": [
5
+ "solid",
6
+ "router",
7
+ "view-transitions"
8
+ ],
9
+ "author": "Ryan Carniato",
10
+ "contributors": [
11
+ "Ryan Turnquist"
12
+ ],
13
+ "license": "MIT",
14
+ "version": "0.16.2-vt.1",
15
+ "homepage": "https://github.com/pauloevpr/solid-router#readme",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/pauloevpr/solid-router"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/pauloevpr/solid-router/issues"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "type": "module",
27
+ "main": "dist/index.js",
28
+ "types": "dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "solid": "./dist/index.jsx",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "sideEffects": false,
39
+ "scripts": {
40
+ "build": "rm -rf dist && tsc && rollup -c",
41
+ "prepublishOnly": "npm test && npm run build",
42
+ "test": "vitest run && npm run test:types",
43
+ "test:watch": "vitest",
44
+ "test:types": "tsc --project tsconfig.test.json",
45
+ "pretty": "prettier --write \"{src,test}/**/*.{ts,tsx}\"",
46
+ "release": "pnpm build && changeset publish"
47
+ },
48
+ "devDependencies": {
49
+ "@babel/core": "^7.26.0",
50
+ "@babel/preset-typescript": "^7.26.0",
51
+ "@changesets/cli": "^2.27.10",
52
+ "@rollup/plugin-babel": "6.0.4",
53
+ "@rollup/plugin-node-resolve": "15.3.0",
54
+ "@rollup/plugin-terser": "0.4.4",
55
+ "@types/jest": "^29.5.14",
56
+ "@types/node": "^22.10.0",
57
+ "babel-preset-solid": "^1.9.3",
58
+ "jsdom": "^25.0.1",
59
+ "prettier": "^3.4.1",
60
+ "rollup": "^4.27.4",
61
+ "solid-js": "^1.9.3",
62
+ "typescript": "^5.7.2",
63
+ "vite": "^6.0.0",
64
+ "vite-plugin-solid": "^2.11.0",
65
+ "vitest": "^2.1.6"
66
+ },
67
+ "peerDependencies": {
68
+ "solid-js": "^1.8.6"
69
+ },
70
+ "packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8"
71
+ }