@quilted/create 0.1.79 → 0.1.81
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 +14 -0
- package/package.json +1 -1
- package/templates/app-basic/foundation/html/Head.test.tsx +1 -1
- package/templates/app-basic/foundation/http/Headers.test.tsx +1 -1
- package/templates/app-basic/tsconfig.json +1 -1
- package/templates/app-empty/tsconfig.json +1 -1
- package/templates/app-graphql/browser.tsx +1 -1
- package/templates/app-graphql/features/start/Start/Start.test.tsx +2 -1
- package/templates/app-graphql/foundation/html/Head.test.tsx +1 -1
- package/templates/app-graphql/foundation/http/Headers.test.tsx +1 -1
- package/templates/app-graphql/graphql/schema.graphql +4 -2
- package/templates/app-graphql/server/graphql.ts +8 -2
- package/templates/app-graphql/tests/render/types.ts +6 -5
- package/templates/app-graphql/tests/render.ts +0 -1
- package/templates/app-graphql/tsconfig.json +1 -1
- package/templates/app-trpc/browser.tsx +1 -1
- package/templates/app-trpc/foundation/html/Head.test.tsx +1 -1
- package/templates/app-trpc/foundation/http/Headers.test.tsx +1 -1
- package/templates/app-trpc/server.tsx +19 -12
- package/templates/app-trpc/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @quilted/create
|
|
2
2
|
|
|
3
|
+
## 0.1.81
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`31ae8b4a`](https://github.com/lemonmade/quilt/commit/31ae8b4af5591bde24eb839060db6a63ddc30a6d) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix GraphQL template test imports
|
|
8
|
+
|
|
9
|
+
## 0.1.80
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`97d00dd5`](https://github.com/lemonmade/quilt/commit/97d00dd5455958ba63e5cd2027f5b59af05ca9c4) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix GraphQL template schema
|
|
14
|
+
|
|
15
|
+
- [`99cea8fd`](https://github.com/lemonmade/quilt/commit/99cea8fd544f44b6377785a61bb760bc12263661) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix template TypeScript issues
|
|
16
|
+
|
|
3
17
|
## 0.1.79
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {describe, it, expect} from '@quilted/quilt/testing';
|
|
2
2
|
import {CacheControl, ContentSecurityPolicy} from '@quilted/quilt/http';
|
|
3
3
|
|
|
4
|
-
import {renderApp} from '~/tests/render.
|
|
4
|
+
import {renderApp} from '~/tests/render.ts';
|
|
5
5
|
|
|
6
6
|
import {Headers} from './Headers.tsx';
|
|
7
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {describe, it, expect} from '@quilted/quilt/testing';
|
|
2
2
|
|
|
3
|
-
import {renderApp
|
|
3
|
+
import {renderApp} from '~/tests/render.ts';
|
|
4
|
+
import {fillGraphQL, GraphQLController} from '~/tests/graphql.ts';
|
|
4
5
|
|
|
5
6
|
import Start from './Start.tsx';
|
|
6
7
|
import startQuery from './StartQuery.graphql';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {describe, it, expect} from '@quilted/quilt/testing';
|
|
2
2
|
import {CacheControl, ContentSecurityPolicy} from '@quilted/quilt/http';
|
|
3
3
|
|
|
4
|
-
import {renderApp} from '~/tests/render.
|
|
4
|
+
import {renderApp} from '~/tests/render.ts';
|
|
5
5
|
|
|
6
6
|
import {Headers} from './Headers.tsx';
|
|
7
7
|
|
|
@@ -7,8 +7,14 @@ import type {GraphQLResult, GraphQLSource} from '@quilted/quilt/graphql';
|
|
|
7
7
|
|
|
8
8
|
import schemaSource, {type Schema} from '../graphql/schema.ts';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
interface GraphQLValues {
|
|
11
|
+
Person: {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {createResolver, createQueryResolver} = createGraphQLResolverBuilder<
|
|
15
|
+
Schema,
|
|
16
|
+
GraphQLValues
|
|
17
|
+
>();
|
|
12
18
|
|
|
13
19
|
const Person = createResolver('Person', {
|
|
14
20
|
name: async () => 'Winston',
|
|
@@ -21,15 +21,16 @@ export interface RenderOptions {
|
|
|
21
21
|
* by this module.
|
|
22
22
|
*
|
|
23
23
|
* ```tsx
|
|
24
|
-
* import {
|
|
24
|
+
* import {renderApp} from '~/tests/render.ts';
|
|
25
|
+
* import {fillGraphQL, GraphQLController} from '~/tests/graphql.ts';
|
|
25
26
|
*
|
|
26
27
|
* import {MyComponent} from './MyComponent.tsx';
|
|
27
28
|
* import myComponentQuery from './MyComponentQuery.graphql';
|
|
28
29
|
*
|
|
29
|
-
* const myComponent = await
|
|
30
|
-
* graphql:
|
|
31
|
-
* fillGraphQL(myComponentQuery, {
|
|
32
|
-
* ),
|
|
30
|
+
* const myComponent = await renderApp(<MyComponent />, {
|
|
31
|
+
* graphql: new GraphQLController([
|
|
32
|
+
* fillGraphQL(myComponentQuery, {me: {name: 'Winston'}}),
|
|
33
|
+
* ]),
|
|
33
34
|
* });
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {describe, it, expect} from '@quilted/quilt/testing';
|
|
2
2
|
import {CacheControl, ContentSecurityPolicy} from '@quilted/quilt/http';
|
|
3
3
|
|
|
4
|
-
import {renderApp} from '~/tests/render.
|
|
4
|
+
import {renderApp} from '~/tests/render.ts';
|
|
5
5
|
|
|
6
6
|
import {Headers} from './Headers.tsx';
|
|
7
7
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import '@quilted/quilt/globals';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {RequestRouter} from '@quilted/quilt/request-router';
|
|
3
|
+
import {BrowserAssets} from '@quilted/quilt/magic/assets';
|
|
4
|
+
|
|
4
5
|
import {createDirectClient} from '@quilted/trpc/server';
|
|
5
6
|
import {fetchRequestHandler} from '@trpc/server/adapters/fetch';
|
|
6
7
|
|
|
7
8
|
import {appRouter} from './trpc.ts';
|
|
8
9
|
|
|
9
|
-
const router =
|
|
10
|
+
const router = new RequestRouter();
|
|
11
|
+
const assets = new BrowserAssets();
|
|
10
12
|
|
|
11
13
|
router.any(
|
|
12
14
|
'api',
|
|
@@ -22,16 +24,21 @@ router.any(
|
|
|
22
24
|
);
|
|
23
25
|
|
|
24
26
|
// For all GET requests, render our React application.
|
|
25
|
-
router.get(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
router.get(async (request) => {
|
|
28
|
+
const [{App}, {renderToResponse}] = await Promise.all([
|
|
29
|
+
import('./App.tsx'),
|
|
30
|
+
import('@quilted/quilt/server'),
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const response = await renderToResponse(
|
|
34
|
+
<App trpc={createDirectClient(appRouter)} />,
|
|
31
35
|
{
|
|
32
|
-
|
|
36
|
+
request,
|
|
37
|
+
assets,
|
|
33
38
|
},
|
|
34
|
-
)
|
|
35
|
-
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return response;
|
|
42
|
+
});
|
|
36
43
|
|
|
37
44
|
export default router;
|