@quilted/create 0.2.40 → 0.2.42
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/CHANGELOG.md +12 -0
- package/package.json +6 -2
- package/templates/app-basic/browser.tsx +3 -12
- package/templates/app-basic/tests/render/render.tsx +6 -3
- package/templates/app-graphql/browser.tsx +4 -13
- package/templates/app-graphql/tests/render/render.tsx +6 -3
- package/templates/app-trpc/browser.tsx +5 -13
- package/templates/app-trpc/shared/trpc.ts +3 -3
- package/templates/app-trpc/tests/render/render.tsx +6 -3
- package/templates/app-trpc/trpc.ts +2 -0
- package/templates/workspace/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @quilted/create
|
|
2
2
|
|
|
3
|
+
## 0.2.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#843](https://github.com/lemonmade/quilt/pull/843) [`5a8036d`](https://github.com/lemonmade/quilt/commit/5a8036d39d93c576812428ecc8fe537a30696dba) Thanks [@lemonmade](https://github.com/lemonmade)! - Make browser context creation implicit on the client
|
|
8
|
+
|
|
9
|
+
## 0.2.41
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#832](https://github.com/lemonmade/quilt/pull/832) [`f0105b4`](https://github.com/lemonmade/quilt/commit/f0105b41db07ebdf21d131d664c1a909659a5142) Thanks [@lemonmade](https://github.com/lemonmade)! - Update template dependencies
|
|
14
|
+
|
|
3
15
|
## 0.2.40
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quilted/create",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.42",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@quilted/cli-kit": "^0.2.0",
|
|
28
28
|
"@types/common-tags": "^1.8.0",
|
|
29
|
+
"@trpc/client": "next",
|
|
30
|
+
"@trpc/react-query": "next",
|
|
31
|
+
"@trpc/server": "next",
|
|
29
32
|
"@types/fs-extra": "^9.0.11",
|
|
30
33
|
"@types/minimatch": "^3.0.5",
|
|
31
34
|
"@types/prompts": "^2.0.13",
|
|
@@ -38,7 +41,8 @@
|
|
|
38
41
|
"pkg-dir": "^6.0.0",
|
|
39
42
|
"prettier": "^3.0.0",
|
|
40
43
|
"prompts": "^2.4.0",
|
|
41
|
-
"yaml": "^2.1.0"
|
|
44
|
+
"yaml": "^2.1.0",
|
|
45
|
+
"zod": "^3.23.8"
|
|
42
46
|
},
|
|
43
47
|
"scripts": {
|
|
44
48
|
"build": "rollup --config configuration/rollup.config.js"
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import '@quilted/quilt/globals';
|
|
2
|
-
import {hydrate} from '
|
|
3
|
-
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
2
|
+
import {hydrate} from '@quilted/quilt/browser';
|
|
4
3
|
import {Router} from '@quilted/quilt/navigation';
|
|
5
4
|
|
|
6
5
|
import type {AppContext} from '~/shared/context.ts';
|
|
7
6
|
import {App} from './App.tsx';
|
|
8
7
|
|
|
9
|
-
const element = document.querySelector('#app')!;
|
|
10
|
-
const browser = new Browser();
|
|
11
|
-
|
|
12
8
|
const context = {
|
|
13
|
-
router: new Router(
|
|
9
|
+
router: new Router(),
|
|
14
10
|
} satisfies AppContext;
|
|
15
11
|
|
|
16
12
|
// Makes key parts of the app available in the browser console
|
|
17
13
|
Object.assign(globalThis, {app: context});
|
|
18
14
|
|
|
19
|
-
hydrate(
|
|
20
|
-
<BrowserContext browser={browser}>
|
|
21
|
-
<App context={context} />
|
|
22
|
-
</BrowserContext>,
|
|
23
|
-
element,
|
|
24
|
-
);
|
|
15
|
+
hydrate(<App context={context} />);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {createRender} from '@quilted/quilt/testing';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BrowserDetailsContext,
|
|
4
|
+
BrowserTestMock,
|
|
5
|
+
} from '@quilted/quilt/browser/testing';
|
|
3
6
|
import {Navigation, TestRouter} from '@quilted/quilt/navigation/testing';
|
|
4
7
|
import {Localization} from '@quilted/quilt/localize';
|
|
5
8
|
|
|
@@ -29,11 +32,11 @@ export const renderApp = createRender<
|
|
|
29
32
|
|
|
30
33
|
return (
|
|
31
34
|
<AppContextReact.Provider value={context}>
|
|
32
|
-
<
|
|
35
|
+
<BrowserDetailsContext.Provider value={browser}>
|
|
33
36
|
<Localization locale={locale}>
|
|
34
37
|
<Navigation router={router}>{element}</Navigation>
|
|
35
38
|
</Localization>
|
|
36
|
-
</
|
|
39
|
+
</BrowserDetailsContext.Provider>
|
|
37
40
|
</AppContextReact.Provider>
|
|
38
41
|
);
|
|
39
42
|
},
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import '@quilted/quilt/globals';
|
|
2
2
|
|
|
3
|
-
import {hydrate} from '
|
|
4
|
-
import {createGraphQLFetch, GraphQLCache} from '@quilted/quilt/graphql';
|
|
5
|
-
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
3
|
+
import {hydrate} from '@quilted/quilt/browser';
|
|
6
4
|
import {Router} from '@quilted/quilt/navigation';
|
|
5
|
+
import {createGraphQLFetch, GraphQLCache} from '@quilted/quilt/graphql';
|
|
7
6
|
|
|
8
7
|
import type {AppContext} from '~/shared/context.ts';
|
|
9
8
|
|
|
10
9
|
import {App} from './App.tsx';
|
|
11
10
|
|
|
12
|
-
const element = document.querySelector('#app')!;
|
|
13
|
-
const browser = new Browser();
|
|
14
|
-
|
|
15
11
|
const graphQLFetch = createGraphQLFetch({url: '/api/graphql'});
|
|
16
12
|
const graphQLCache = new GraphQLCache({fetch: graphQLFetch});
|
|
17
13
|
|
|
18
14
|
const context = {
|
|
19
|
-
router: new Router(
|
|
15
|
+
router: new Router(),
|
|
20
16
|
graphql: {
|
|
21
17
|
fetch: graphQLFetch,
|
|
22
18
|
cache: graphQLCache,
|
|
@@ -26,9 +22,4 @@ const context = {
|
|
|
26
22
|
// Makes key parts of the app available in the browser console
|
|
27
23
|
Object.assign(globalThis, {app: context});
|
|
28
24
|
|
|
29
|
-
hydrate(
|
|
30
|
-
<BrowserContext browser={browser}>
|
|
31
|
-
<App context={context} />
|
|
32
|
-
</BrowserContext>,
|
|
33
|
-
element,
|
|
34
|
-
);
|
|
25
|
+
hydrate(<App context={context} />);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {Suspense} from 'preact/compat';
|
|
2
2
|
|
|
3
3
|
import {createRender} from '@quilted/quilt/testing';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
BrowserDetailsContext,
|
|
6
|
+
BrowserTestMock,
|
|
7
|
+
} from '@quilted/quilt/browser/testing';
|
|
5
8
|
import {Navigation, TestRouter} from '@quilted/quilt/navigation/testing';
|
|
6
9
|
import {Localization} from '@quilted/quilt/localize';
|
|
7
10
|
import {GraphQLCache} from '@quilted/quilt/graphql';
|
|
@@ -44,7 +47,7 @@ export const renderApp = createRender<
|
|
|
44
47
|
|
|
45
48
|
return (
|
|
46
49
|
<AppContextReact.Provider value={context}>
|
|
47
|
-
<
|
|
50
|
+
<BrowserDetailsContext.Provider value={browser}>
|
|
48
51
|
<Localization locale={locale}>
|
|
49
52
|
<Navigation router={router}>
|
|
50
53
|
<GraphQLTesting
|
|
@@ -55,7 +58,7 @@ export const renderApp = createRender<
|
|
|
55
58
|
</GraphQLTesting>
|
|
56
59
|
</Navigation>
|
|
57
60
|
</Localization>
|
|
58
|
-
</
|
|
61
|
+
</BrowserDetailsContext.Provider>
|
|
59
62
|
</AppContextReact.Provider>
|
|
60
63
|
);
|
|
61
64
|
},
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import '@quilted/quilt/globals';
|
|
2
2
|
|
|
3
|
-
import {hydrate} from '
|
|
3
|
+
import {hydrate} from '@quilted/quilt/browser';
|
|
4
|
+
import {Router} from '@quilted/quilt/navigation';
|
|
5
|
+
|
|
4
6
|
import {httpBatchLink} from '@trpc/client';
|
|
5
7
|
import {QueryClient} from '@tanstack/react-query';
|
|
6
|
-
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
7
|
-
import {Router} from '@quilted/quilt/navigation';
|
|
8
8
|
|
|
9
9
|
import type {AppContext} from '~/shared/context.ts';
|
|
10
10
|
import {trpc} from '~/shared/trpc.ts';
|
|
11
11
|
|
|
12
12
|
import {App} from './App.tsx';
|
|
13
13
|
|
|
14
|
-
const element = document.querySelector('#app')!;
|
|
15
|
-
const browser = new Browser();
|
|
16
|
-
|
|
17
14
|
const queryClient = new QueryClient();
|
|
18
15
|
const trpcClient = trpc.createClient({
|
|
19
16
|
links: [httpBatchLink({url: new URL('/api', window.location.href).href})],
|
|
20
17
|
});
|
|
21
18
|
|
|
22
19
|
const context = {
|
|
23
|
-
router: new Router(
|
|
20
|
+
router: new Router(),
|
|
24
21
|
trpc: trpcClient,
|
|
25
22
|
queryClient,
|
|
26
23
|
} satisfies AppContext;
|
|
@@ -28,9 +25,4 @@ const context = {
|
|
|
28
25
|
// Makes key parts of the app available in the browser console
|
|
29
26
|
Object.assign(globalThis, {app: context});
|
|
30
27
|
|
|
31
|
-
hydrate(
|
|
32
|
-
<BrowserContext browser={browser}>
|
|
33
|
-
<App context={context} />
|
|
34
|
-
</BrowserContext>,
|
|
35
|
-
element,
|
|
36
|
-
);
|
|
28
|
+
hydrate(<App context={context} />);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {TRPCUntypedClient} from '@trpc/client';
|
|
2
2
|
import {createTRPCReact, type CreateTRPCReact} from '@trpc/react-query';
|
|
3
3
|
import type {QueryClient} from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -7,12 +7,12 @@ import type {QueryClient} from '@tanstack/react-query';
|
|
|
7
7
|
// perform.
|
|
8
8
|
import type {AppRouter} from '../trpc.ts';
|
|
9
9
|
|
|
10
|
-
export const trpc: CreateTRPCReact<AppRouter,
|
|
10
|
+
export const trpc: CreateTRPCReact<AppRouter, {}> =
|
|
11
11
|
createTRPCReact<AppRouter>();
|
|
12
12
|
|
|
13
13
|
declare module '~/shared/context.ts' {
|
|
14
14
|
interface AppContext {
|
|
15
|
-
trpc:
|
|
15
|
+
trpc: TRPCUntypedClient<AppRouter>;
|
|
16
16
|
queryClient: QueryClient;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {createRender} from '@quilted/quilt/testing';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BrowserDetailsContext,
|
|
4
|
+
BrowserTestMock,
|
|
5
|
+
} from '@quilted/quilt/browser/testing';
|
|
3
6
|
import {Navigation, TestRouter} from '@quilted/quilt/navigation/testing';
|
|
4
7
|
import {Localization} from '@quilted/quilt/localize';
|
|
5
8
|
|
|
@@ -37,7 +40,7 @@ export const renderApp = createRender<
|
|
|
37
40
|
|
|
38
41
|
return (
|
|
39
42
|
<AppContextReact.Provider value={context}>
|
|
40
|
-
<
|
|
43
|
+
<BrowserDetailsContext.Provider value={browser}>
|
|
41
44
|
<Localization locale={locale}>
|
|
42
45
|
<Navigation router={router}>
|
|
43
46
|
<trpc.Provider client={trpcClient} queryClient={queryClient}>
|
|
@@ -47,7 +50,7 @@ export const renderApp = createRender<
|
|
|
47
50
|
</trpc.Provider>
|
|
48
51
|
</Navigation>
|
|
49
52
|
</Localization>
|
|
50
|
-
</
|
|
53
|
+
</BrowserDetailsContext.Provider>
|
|
51
54
|
</AppContextReact.Provider>
|
|
52
55
|
);
|
|
53
56
|
},
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"@quilted/rollup": "^0.2.0",
|
|
17
17
|
"@quilted/vite": "^0.1.0",
|
|
18
18
|
"@quilted/typescript": "^0.4.0",
|
|
19
|
-
"rollup": "^4.
|
|
20
|
-
"prettier": "^3.
|
|
21
|
-
"tsx": "^4.
|
|
19
|
+
"rollup": "^4.21.0",
|
|
20
|
+
"prettier": "^3.3.0",
|
|
21
|
+
"tsx": "^4.19.0",
|
|
22
22
|
"typescript": "^5.5.0",
|
|
23
|
-
"vite": "^5.
|
|
23
|
+
"vite": "^5.4.0",
|
|
24
24
|
"vitest": "^2.0.0"
|
|
25
25
|
},
|
|
26
26
|
"prettier": {
|