@quilted/create 0.1.5 → 0.1.8

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @quilted/create
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f4069df8`](https://github.com/lemonmade/quilt/commit/f4069df83ce5166056c7605144333445311427e1) Thanks [@lemonmade](https://github.com/lemonmade)! - Add reportOnly ContentSecurityPolicy prop
8
+
9
+ ## 0.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [`64008ce5`](https://github.com/lemonmade/quilt/commit/64008ce54c91178001fac29c80e0afa55c185ae3) Thanks [@lemonmade](https://github.com/lemonmade)! - Add a server to the default app template
14
+
15
+ ## 0.1.6
16
+
17
+ ### Patch Changes
18
+
19
+ - [#265](https://github.com/lemonmade/quilt/pull/265) [`6b523901`](https://github.com/lemonmade/quilt/commit/6b52390142a0d075d6ce75e014e45cb02f5c6d9a) Thanks [@lemonmade](https://github.com/lemonmade)! - Simpler AppContext component
20
+
3
21
  ## 0.1.5
4
22
 
5
23
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quilted/create",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.1.8",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,4 +1,4 @@
1
- import {App as QuiltApp} from '@quilted/quilt';
1
+ import {AppContext, Router} from '@quilted/quilt';
2
2
 
3
3
  import {Head} from './foundation/Head';
4
4
  import {Http} from './foundation/Http';
@@ -6,10 +6,12 @@ import {Routes} from './foundation/Routes';
6
6
 
7
7
  export default function App() {
8
8
  return (
9
- <QuiltApp>
10
- <Http />
11
- <Head />
12
- <Routes />
13
- </QuiltApp>
9
+ <AppContext>
10
+ <Router>
11
+ <Http />
12
+ <Head />
13
+ <Routes />
14
+ </Router>
15
+ </AppContext>
14
16
  );
15
17
  }
@@ -1,3 +1,4 @@
1
+ import Env from '@quilted/quilt/env';
1
2
  import {useCurrentUrl} from '@quilted/quilt';
2
3
  import {
3
4
  CacheControl,
@@ -32,6 +33,7 @@ export function Http() {
32
33
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
33
34
  */}
34
35
  <ContentSecurityPolicy
36
+ reportOnly={Env.MODE === 'development'}
35
37
  // By default, only allow sources from the page’s origin.
36
38
  defaultSources={["'self'"]}
37
39
  // Includes `'unsafe-inline'` because CSS is often necessary in development,
@@ -2,5 +2,11 @@ import {createApp, quiltApp} from '@quilted/craft';
2
2
 
3
3
  export default createApp((app) => {
4
4
  app.entry('./App');
5
- app.use(quiltApp());
5
+ app.use(
6
+ quiltApp({
7
+ server: {
8
+ entry: './server',
9
+ },
10
+ }),
11
+ );
6
12
  });
@@ -0,0 +1,17 @@
1
+ import {
2
+ createHttpHandler,
3
+ createServerRenderingRequestHandler,
4
+ } from '@quilted/quilt/server';
5
+ import assets from '@quilted/quilt/magic/asset-loader';
6
+
7
+ import App from './App';
8
+
9
+ const httpHandler = createHttpHandler();
10
+ const requestHandler = createServerRenderingRequestHandler(App, {
11
+ assets,
12
+ });
13
+
14
+ // For all GET requests, render our React application.
15
+ httpHandler.get(requestHandler);
16
+
17
+ export default httpHandler;