Skip to content

Commit

Permalink
Update deps and project config
Browse files Browse the repository at this point in the history
  • Loading branch information
HorusGoul committed Mar 16, 2024
1 parent 42a514c commit 1af812d
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 219 deletions.
10 changes: 6 additions & 4 deletions apps/remix-demo/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
Expand All @@ -9,7 +8,7 @@ import {

import "./stylex.css";

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -19,11 +18,14 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
20 changes: 10 additions & 10 deletions apps/remix-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@
"sideEffects": false,
"type": "module",
"scripts": {
"build": "vite build && vite build --ssr",
"dev": "vite dev",
"start": "remix-serve ./build/index.js",
"build": "remix vite:build",
"dev": "remix vite:dev",
"start": "remix-serve ./build/server/index.js",
"typecheck": "tsc",
"test": "tsx --test test/*.test.ts"
},
"dependencies": {
"@remix-run/node": "^2.4.0",
"@remix-run/react": "^2.4.0",
"@remix-run/serve": "^2.4.0",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
"@remix-run/serve": "^2.8.1",
"@stylexjs/stylex": "^0.5.1",
"isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@internal/test-utils": "workspace:*",
"@remix-run/dev": "^2.4.0",
"@remix-run/eslint-config": "^2.4.0",
"@remix-run/dev": "^2.8.1",
"@remix-run/eslint-config": "^2.8.1",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"eslint": "^8.38.0",
"tsx": "^4.6.2",
"typescript": "^5.1.6",
"vite": "^5.0.0",
"vite": "^5.1.6",
"vite-plugin-stylex": "workspace:*",
"vite-tsconfig-paths": "^4.2.1"
"vite-tsconfig-paths": "^4.3.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-demo/test/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe("build", () => {
});

test("builds without crashing", async () => {
process.env.ASSETS_BUILD_DIRECTORY = path.join(tempPublicDir, "build");
process.env.SERVER_BUILD_PATH = path.join(tempDir, "index.mjs");
process.env.OVERRIDE_BUILD_DIRECTORY = path.join(tempPublicDir, "build");
process.env.OVERRIDE_SERVER_BUILD_FILE = path.join(tempDir, "index.mjs");

const result = cp.spawnSync("pnpm", ["build"], {
cwd: VITE_ROOT,
Expand Down
13 changes: 8 additions & 5 deletions apps/remix-demo/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { unstable_vitePlugin as remix } from "@remix-run/dev";
import { vitePlugin as remix } from "@remix-run/dev";
import { installGlobals } from "@remix-run/node";
import { Plugin, defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import styleX from "vite-plugin-stylex";

const OVERRIDE_ASSETS_BUILD_DIRECTORY = process.env.ASSETS_BUILD_DIRECTORY;
const OVERRIDE_SERVER_BUILD_PATH = process.env.SERVER_BUILD_PATH;
installGlobals();

const OVERRIDE_BUILD_DIRECTORY = process.env.OVERRIDE_BUILD_DIRECTORY;
const OVERRIDE_SERVER_BUILD_FILE = process.env.OVERRIDE_SERVER_BUILD_FILE;

export default defineConfig({
plugins: [
remix({
assetsBuildDirectory: OVERRIDE_ASSETS_BUILD_DIRECTORY,
serverBuildPath: OVERRIDE_SERVER_BUILD_PATH,
buildDirectory: OVERRIDE_BUILD_DIRECTORY || "build",
serverBuildFile: OVERRIDE_SERVER_BUILD_FILE || "build/server/index.mjs",
}),
tsconfigPaths(),
styleX() as Plugin,
Expand Down
Loading

0 comments on commit 1af812d

Please sign in to comment.