@quilted/create 0.1.6 → 0.1.9

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,27 @@
1
1
  # @quilted/create
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#283](https://github.com/lemonmade/quilt/pull/283) [`daf06328`](https://github.com/lemonmade/quilt/commit/daf06328f242ac621b70942aa063a6138a12f62f) Thanks [@lemonmade](https://github.com/lemonmade)! - Rework asset manifest
8
+
9
+ * [`590e790b`](https://github.com/lemonmade/quilt/commit/590e790bebffcf367e00fe7248f83208e92a6eb5) Thanks [@lemonmade](https://github.com/lemonmade)! - Add missing global import
10
+
11
+ - [`cdecff17`](https://github.com/lemonmade/quilt/commit/cdecff1728876a8b9849f74ef1219220a3f60835) Thanks [@lemonmade](https://github.com/lemonmade)! - Simply Routes component in template apps
12
+
13
+ ## 0.1.8
14
+
15
+ ### Patch Changes
16
+
17
+ - [`f4069df8`](https://github.com/lemonmade/quilt/commit/f4069df83ce5166056c7605144333445311427e1) Thanks [@lemonmade](https://github.com/lemonmade)! - Add reportOnly ContentSecurityPolicy prop
18
+
19
+ ## 0.1.7
20
+
21
+ ### Patch Changes
22
+
23
+ - [`64008ce5`](https://github.com/lemonmade/quilt/commit/64008ce54c91178001fac29c80e0afa55c185ae3) Thanks [@lemonmade](https://github.com/lemonmade)! - Add a server to the default app template
24
+
3
25
  ## 0.1.6
4
26
 
5
27
  ### 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.6",
4
+ "version": "0.1.9",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,9 +1,13 @@
1
- import {AppContext, Router} from '@quilted/quilt';
1
+ import {Router, useRoutes, AppContext} from '@quilted/quilt';
2
2
 
3
- import {Head} from './foundation/Head';
4
3
  import {Http} from './foundation/Http';
5
- import {Routes} from './foundation/Routes';
4
+ import {Head} from './foundation/Head';
5
+
6
+ import {Start} from './features/Start';
6
7
 
8
+ /**
9
+ * The root component for your application.
10
+ */
7
11
  export default function App() {
8
12
  return (
9
13
  <AppContext>
@@ -15,3 +19,11 @@ export default function App() {
15
19
  </AppContext>
16
20
  );
17
21
  }
22
+
23
+ /**
24
+ * This component renders the routes for your application. If you have a lot
25
+ * of routes, you may want to split this component into its own file.
26
+ */
27
+ function Routes() {
28
+ return useRoutes([{match: '/', render: () => <Start />}]);
29
+ }
@@ -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,19 @@
1
+ import '@quilted/quilt/global';
2
+ import {
3
+ createHttpHandler,
4
+ createServerRenderingRequestHandler,
5
+ } from '@quilted/quilt/server';
6
+ import createAssetManifest from '@quilted/quilt/magic/app/asset-manifest';
7
+
8
+ import App from './App';
9
+
10
+ const httpHandler = createHttpHandler();
11
+
12
+ // For all GET requests, render our React application.
13
+ httpHandler.get(
14
+ createServerRenderingRequestHandler(App, {
15
+ assets: createAssetManifest(),
16
+ }),
17
+ );
18
+
19
+ export default httpHandler;
@@ -1,7 +0,0 @@
1
- import {useRoutes} from '@quilted/quilt';
2
-
3
- import {Start} from '../features/Start';
4
-
5
- export function Routes() {
6
- return useRoutes([{match: '/', render: () => <Start />}]);
7
- }