Skip to content
This repository was archived by the owner on Jul 20, 2022. It is now read-only.

Commit 560222e

Browse files
first working version 🎉
package working version tag v0.0.13 remove next-example rename endpoints for remix-crash bump v0.1.0 add publish github workflow bump v0.1.1 update publish github workflow update build command add installation step on github workflow fix livereload update version to 0.1.0
1 parent d8dcf06 commit 560222e

28 files changed

+14345
-4
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
npm:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
# Setup .npmrc file to publish to npm
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: "14.x"
14+
registry-url: "https://registry.npmjs.org"
15+
- run: npm install
16+
- run: npm run build
17+
- run: npm publish
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.DS_Store
3+
*.local
4+
dist

example/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
3+
/.cache
4+
/build
5+
/public/build
6+
.env

example/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Welcome to Remix!
2+
3+
- [Remix Docs](https://remix.run/docs)
4+
5+
## Development
6+
7+
From your terminal:
8+
9+
```sh
10+
npm run dev
11+
```
12+
13+
This starts your app in development mode, rebuilding assets on file changes.
14+
15+
## Deployment
16+
17+
First, build your app for production:
18+
19+
```sh
20+
npm run build
21+
```
22+
23+
Then run the app in production mode:
24+
25+
```sh
26+
npm start
27+
```
28+
29+
Now you'll need to pick a host to deploy it to.
30+
31+
### DIY
32+
33+
If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
34+
35+
Make sure to deploy the output of `remix build`
36+
37+
- `build/`
38+
- `public/build/`
39+
40+
### Using a Template
41+
42+
When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server.
43+
44+
```sh
45+
cd ..
46+
# create a new project, and pick a pre-configured host
47+
npx create-remix@latest
48+
cd my-new-remix-app
49+
# remove the new project's app (not the old one!)
50+
rm -rf app
51+
# copy your app over
52+
cp -R ../my-old-remix-app/app app
53+
```

example/app/entry.client.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { hydrate } from "react-dom";
2+
import { RemixBrowser } from "remix";
3+
4+
hydrate(<RemixBrowser />, document);

example/app/entry.server.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { renderToString } from "react-dom/server";
2+
import { RemixServer } from "remix";
3+
import type { EntryContext } from "remix";
4+
5+
export default function handleRequest(
6+
request: Request,
7+
responseStatusCode: number,
8+
responseHeaders: Headers,
9+
remixContext: EntryContext
10+
) {
11+
const markup = renderToString(
12+
<RemixServer context={remixContext} url={request.url} />
13+
);
14+
15+
responseHeaders.set("Content-Type", "text/html");
16+
17+
return new Response("<!DOCTYPE html>" + markup, {
18+
status: responseStatusCode,
19+
headers: responseHeaders
20+
});
21+
}

example/app/root.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {
2+
Links,
3+
LiveReload,
4+
Meta,
5+
Outlet,
6+
Scripts,
7+
ScrollRestoration,
8+
} from "remix";
9+
import type { MetaFunction } from "remix";
10+
11+
export const meta: MetaFunction = () => {
12+
return { title: "New Remix App" };
13+
};
14+
15+
export default function App() {
16+
return (
17+
<html lang="en">
18+
<head>
19+
<meta charSet="utf-8" />
20+
<meta name="viewport" content="width=device-width,initial-scale=1" />
21+
<Meta />
22+
<Links />
23+
</head>
24+
<body>
25+
<Outlet />
26+
<ScrollRestoration />
27+
<Scripts />
28+
{process.env.NODE_ENV === "development" && <LiveReload />}
29+
</body>
30+
</html>
31+
);
32+
}
33+
34+
export { ErrorBoundary } from "remix-crash";

example/app/routes/_remix-crash.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { loader, action } from "remix-crash";

example/app/routes/index.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { LoaderFunction } from "remix";
2+
3+
export const loader: LoaderFunction = () => {
4+
user.test();
5+
return null;
6+
};
7+
8+
export default function Index() {
9+
return (
10+
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
11+
<h1>Welcome to Remix</h1>
12+
<ul>
13+
<li>
14+
<a
15+
target="_blank"
16+
href="https://remix.run/tutorials/blog"
17+
rel="noreferrer"
18+
>
19+
15m Quickstart Blog Tutorial
20+
</a>
21+
</li>
22+
<li>
23+
<a
24+
target="_blank"
25+
href="https://remix.run/tutorials/jokes"
26+
rel="noreferrer"
27+
>
28+
Deep Dive Jokes App Tutorial
29+
</a>
30+
</li>
31+
<li>
32+
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
33+
Remix Docs
34+
</a>
35+
</li>
36+
</ul>
37+
</div>
38+
);
39+
}

0 commit comments

Comments
 (0)