@quilted/create 0.2.24 โ 0.2.26
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 +1 -1
- package/templates/app-basic/browser.tsx +7 -1
- package/templates/app-basic/foundation/frame/Frame.tsx +6 -1
- package/templates/app-basic/foundation/html/HTML.tsx +1 -1
- package/templates/app-graphql/browser.tsx +12 -2
- package/templates/app-graphql/foundation/frame/Frame.tsx +6 -1
- package/templates/app-graphql/foundation/html/HTML.tsx +1 -0
- package/templates/app-trpc/browser.tsx +10 -1
- package/templates/app-trpc/foundation/frame/Frame.tsx +6 -1
- package/templates/app-trpc/foundation/html/HTML.tsx +1 -0
- package/templates/github/_github/workflows/ci.yml +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @quilted/create
|
|
2
2
|
|
|
3
|
+
## 0.2.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5c32e10`](https://github.com/lemonmade/quilt/commit/5c32e1022e5330a209817f7bfb49b09b301b36b7) Thanks [@lemonmade](https://github.com/lemonmade)! - Expose app context on browser console in template apps
|
|
8
|
+
|
|
9
|
+
## 0.2.25
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`fb45f13`](https://github.com/lemonmade/quilt/commit/fb45f13ef3d4be82f7edde567ed3247931957701) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix usage of magic "env" module
|
|
14
|
+
|
|
3
15
|
## 0.2.24
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,14 +2,20 @@ import '@quilted/quilt/globals';
|
|
|
2
2
|
import {hydrate} from 'preact';
|
|
3
3
|
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
4
4
|
|
|
5
|
+
import type {AppContext} from '~/shared/context.ts';
|
|
5
6
|
import {App} from './App.tsx';
|
|
6
7
|
|
|
7
8
|
const element = document.querySelector('#app')!;
|
|
8
9
|
const browser = new Browser();
|
|
9
10
|
|
|
11
|
+
const context = {} satisfies AppContext;
|
|
12
|
+
|
|
13
|
+
// Makes key parts of the app available in the browser console
|
|
14
|
+
Object.assign(globalThis, {app: context});
|
|
15
|
+
|
|
10
16
|
hydrate(
|
|
11
17
|
<BrowserContext browser={browser}>
|
|
12
|
-
<App />
|
|
18
|
+
<App context={context} />
|
|
13
19
|
</BrowserContext>,
|
|
14
20
|
element,
|
|
15
21
|
);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type {RenderableProps} from 'preact';
|
|
2
|
+
import {Suspense} from 'preact/compat';
|
|
2
3
|
|
|
3
4
|
import styles from './Frame.module.css';
|
|
4
5
|
|
|
5
6
|
export function Frame({children}: RenderableProps<{}>) {
|
|
6
|
-
return
|
|
7
|
+
return (
|
|
8
|
+
<div className={styles.Frame}>
|
|
9
|
+
<Suspense fallback={null}>{children}</Suspense>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
7
12
|
}
|
|
@@ -5,17 +5,27 @@ import {QueryClient} from '@tanstack/react-query';
|
|
|
5
5
|
import {createGraphQLFetch} from '@quilted/quilt/graphql';
|
|
6
6
|
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
7
7
|
|
|
8
|
+
import type {AppContext} from '~/shared/context.ts';
|
|
9
|
+
|
|
8
10
|
import {App} from './App.tsx';
|
|
9
11
|
|
|
10
12
|
const element = document.querySelector('#app')!;
|
|
11
13
|
const browser = new Browser();
|
|
12
14
|
|
|
13
|
-
const queryClient = new QueryClient();
|
|
14
15
|
const fetchGraphQL = createGraphQLFetch({url: '/api/graphql'});
|
|
16
|
+
const queryClient = new QueryClient();
|
|
17
|
+
|
|
18
|
+
const context = {
|
|
19
|
+
fetchGraphQL,
|
|
20
|
+
queryClient,
|
|
21
|
+
} satisfies AppContext;
|
|
22
|
+
|
|
23
|
+
// Makes key parts of the app available in the browser console
|
|
24
|
+
Object.assign(globalThis, {app: context});
|
|
15
25
|
|
|
16
26
|
hydrate(
|
|
17
27
|
<BrowserContext browser={browser}>
|
|
18
|
-
<App context={
|
|
28
|
+
<App context={context} />
|
|
19
29
|
</BrowserContext>,
|
|
20
30
|
element,
|
|
21
31
|
);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type {RenderableProps} from 'preact';
|
|
2
|
+
import {Suspense} from 'preact/compat';
|
|
2
3
|
|
|
3
4
|
import styles from './Frame.module.css';
|
|
4
5
|
|
|
5
6
|
export function Frame({children}: RenderableProps<{}>) {
|
|
6
|
-
return
|
|
7
|
+
return (
|
|
8
|
+
<div className={styles.Frame}>
|
|
9
|
+
<Suspense fallback={null}>{children}</Suspense>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
7
12
|
}
|
|
@@ -5,6 +5,7 @@ import {httpBatchLink} from '@trpc/client';
|
|
|
5
5
|
import {QueryClient} from '@tanstack/react-query';
|
|
6
6
|
import {Browser, BrowserContext} from '@quilted/quilt/browser';
|
|
7
7
|
|
|
8
|
+
import type {AppContext} from '~/shared/context.ts';
|
|
8
9
|
import {trpc} from '~/shared/trpc.ts';
|
|
9
10
|
|
|
10
11
|
import {App} from './App.tsx';
|
|
@@ -17,9 +18,17 @@ const trpcClient = trpc.createClient({
|
|
|
17
18
|
links: [httpBatchLink({url: new URL('/api', window.location.href).href})],
|
|
18
19
|
});
|
|
19
20
|
|
|
21
|
+
const context = {
|
|
22
|
+
trpc: trpcClient,
|
|
23
|
+
queryClient,
|
|
24
|
+
} satisfies AppContext;
|
|
25
|
+
|
|
26
|
+
// Makes key parts of the app available in the browser console
|
|
27
|
+
Object.assign(globalThis, {app: context});
|
|
28
|
+
|
|
20
29
|
hydrate(
|
|
21
30
|
<BrowserContext browser={browser}>
|
|
22
|
-
<App context={
|
|
31
|
+
<App context={context} />
|
|
23
32
|
</BrowserContext>,
|
|
24
33
|
element,
|
|
25
34
|
);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type {RenderableProps} from 'preact';
|
|
2
|
+
import {Suspense} from 'preact/compat';
|
|
2
3
|
|
|
3
4
|
import styles from './Frame.module.css';
|
|
4
5
|
|
|
5
6
|
export function Frame({children}: RenderableProps<{}>) {
|
|
6
|
-
return
|
|
7
|
+
return (
|
|
8
|
+
<div className={styles.Frame}>
|
|
9
|
+
<Suspense fallback={null}>{children}</Suspense>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
7
12
|
}
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
name: Lint ๐
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
21
|
- uses: ./.github/workflows/actions/prepare
|
|
22
22
|
- run: pnpm run lint
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
name: Type check ๐งฎ
|
|
26
26
|
runs-on: ubuntu-latest
|
|
27
27
|
steps:
|
|
28
|
-
- uses: actions/checkout@
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
29
|
- uses: ./.github/workflows/actions/prepare
|
|
30
30
|
- run: pnpm run type-check
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
name: Unit tests ๐งช
|
|
34
34
|
runs-on: ubuntu-latest
|
|
35
35
|
steps:
|
|
36
|
-
- uses: actions/checkout@
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
37
|
- uses: ./.github/workflows/actions/prepare
|
|
38
38
|
- run: pnpm run test
|
|
39
39
|
|
|
@@ -42,6 +42,6 @@ jobs:
|
|
|
42
42
|
if: ${{ inputs.build || github.event_name == 'push' }}
|
|
43
43
|
runs-on: ubuntu-latest
|
|
44
44
|
steps:
|
|
45
|
-
- uses: actions/checkout@
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
46
|
- uses: ./.github/workflows/actions/prepare
|
|
47
47
|
- run: pnpm run build
|