docs: setup format/lint
This commit is contained in:
1
packages/docs/.gitignore
vendored
1
packages/docs/.gitignore
vendored
@@ -4,3 +4,4 @@ node_modules
|
||||
/build
|
||||
/public/build
|
||||
.env
|
||||
.vscode
|
||||
|
||||
5
packages/docs/.prettierignore
Normal file
5
packages/docs/.prettierignore
Normal file
@@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
pnpm-lock.yaml
|
||||
|
||||
build
|
||||
public/build
|
||||
@@ -1,53 +0,0 @@
|
||||
# Welcome to Remix!
|
||||
|
||||
- [Remix Docs](https://remix.run/docs)
|
||||
|
||||
## Development
|
||||
|
||||
From your terminal:
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This starts your app in development mode, rebuilding assets on file changes.
|
||||
|
||||
## Deployment
|
||||
|
||||
First, build your app for production:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
Then run the app in production mode:
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
Now you'll need to pick a host to deploy it to.
|
||||
|
||||
### DIY
|
||||
|
||||
If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
|
||||
|
||||
Make sure to deploy the output of `remix build`
|
||||
|
||||
- `build/`
|
||||
- `public/build/`
|
||||
|
||||
### Using a Template
|
||||
|
||||
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.
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
# create a new project, and pick a pre-configured host
|
||||
npx create-remix@latest
|
||||
cd my-new-remix-app
|
||||
# remove the new project's app (not the old one!)
|
||||
rm -rf app
|
||||
# copy your app over
|
||||
cp -R ../my-old-remix-app/app app
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
import { hydrate } from "react-dom";
|
||||
import { RemixBrowser } from "remix";
|
||||
import { hydrate } from "react-dom"
|
||||
import { RemixBrowser } from "remix"
|
||||
|
||||
hydrate(<RemixBrowser />, document);
|
||||
hydrate(<RemixBrowser />, document)
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { renderToString } from "react-dom/server";
|
||||
import { RemixServer } from "remix";
|
||||
import type { EntryContext } from "remix";
|
||||
import { renderToString } from "react-dom/server"
|
||||
import { RemixServer } from "remix"
|
||||
import type { EntryContext } from "remix"
|
||||
|
||||
export default function handleRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
remixContext: EntryContext,
|
||||
) {
|
||||
const markup = renderToString(
|
||||
<RemixServer context={remixContext} url={request.url} />
|
||||
);
|
||||
<RemixServer context={remixContext} url={request.url} />,
|
||||
)
|
||||
|
||||
responseHeaders.set("Content-Type", "text/html");
|
||||
responseHeaders.set("Content-Type", "text/html")
|
||||
|
||||
return new Response("<!DOCTYPE html>" + markup, {
|
||||
status: responseStatusCode,
|
||||
headers: responseHeaders
|
||||
});
|
||||
headers: responseHeaders,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ import {
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
ScrollRestoration
|
||||
} from "remix";
|
||||
import type { MetaFunction } from "remix";
|
||||
ScrollRestoration,
|
||||
} from "remix"
|
||||
import type { MetaFunction } from "remix"
|
||||
|
||||
export const meta: MetaFunction = () => {
|
||||
return { title: "New Remix App" };
|
||||
};
|
||||
return { title: "New Remix App" }
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -28,5 +28,5 @@ export default function App() {
|
||||
{process.env.NODE_ENV === "development" && <LiveReload />}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
@@ -7,23 +7,48 @@
|
||||
"prepare": "remix setup node",
|
||||
"build": "remix build",
|
||||
"dev": "remix dev",
|
||||
"start": "remix-serve build"
|
||||
"start": "remix-serve build",
|
||||
"lint": "eslint --ext js,ts,tsx .",
|
||||
"lint-fix": "pnpm lint -- --fix",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/react": "^1.1.1",
|
||||
"@remix-run/serve": "^1.1.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"remix": "^1.1.1",
|
||||
"@remix-run/serve": "^1.1.1"
|
||||
"remix": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@itsmapleleaf/configs": "^1.1.2",
|
||||
"@remix-run/dev": "^1.1.1",
|
||||
"@types/react": "^17.0.24",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||
"@typescript-eslint/parser": "^5.8.1",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-import-resolver-typescript": "^2.5.0",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"eslint-plugin-unicorn": "^39.0.0",
|
||||
"prettier": "^2.5.1",
|
||||
"typescript": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"sideEffects": false
|
||||
"sideEffects": false,
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"./node_modules/@itsmapleleaf/configs/eslint"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"**/node_modules/**",
|
||||
"**/.vscode/**"
|
||||
]
|
||||
},
|
||||
"prettier": "@itsmapleleaf/configs/prettier"
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ module.exports = {
|
||||
publicPath: "/build/",
|
||||
serverBuildDirectory: "build",
|
||||
devServerPort: 8002,
|
||||
ignoredRouteFiles: [".*"]
|
||||
};
|
||||
ignoredRouteFiles: [".*"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user