diff --git a/docs/app/root.tsx b/docs/app/root.tsx index 975edc1f18..eeee770520 100644 --- a/docs/app/root.tsx +++ b/docs/app/root.tsx @@ -1,24 +1,23 @@ -import type { MetaFunction, LinksFunction } from "@remix-run/node"; +import type { MetaFunction, LinksFunction } from '@vercel/remix' import { Links, - LiveReload, Meta, Outlet, Scripts, ScrollRestoration, -} from "@remix-run/react"; -import { Analytics } from "@vercel/analytics/react"; -import styles from "./styles.css"; +} from '@remix-run/react' +import { Analytics } from '@vercel/analytics/react' +import styles from './styles.css' export const meta: MetaFunction = () => [ { - charset: "utf-8", - title: "Blog | Kitchen Sink", - viewport: "width=device-width,initial-scale=1", + charset: 'utf-8', + title: 'Blog | Kitchen Sink', + viewport: 'width=device-width,initial-scale=1', }, -]; +] -export const links: LinksFunction = () => [{ rel: "stylesheet", href: styles }]; +export const links: LinksFunction = () => [{ rel: 'stylesheet', href: styles }] export default function App(): JSX.Element { return ( @@ -31,9 +30,8 @@ export default function App(): JSX.Element { - - ); + ) } diff --git a/docs/package.json b/docs/package.json index cf0afb5b09..fb12a96b75 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,26 +6,30 @@ "private": true, "sideEffects": false, "scripts": { - "dev": "remix dev", - "build": "remix build", + "build": "remix vite:build", + "dev": "remix vite:dev", "lint": "TIMING=1 eslint \"app/**/*.ts*\" \"scripts/**/*.ts*\"", + "start": "remix-serve ./build/server/index.js", "typecheck": "tsc --noEmit" }, "dependencies": { - "@remix-run/node": "^2.8.0", - "@remix-run/react": "^2.8.0", - "@remix-run/serve": "^2.8.0", - "@remix-run/server-runtime": "^2.8.0", + "@remix-run/node": "^2.9.2", + "@remix-run/react": "^2.9.2", + "@remix-run/serve": "^2.9.2", + "@remix-run/server-runtime": "^2.9.2", "@vercel/analytics": "^1.2.2", "@vercel/remix-entry-server": "^0.1.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@remix-run/dev": "^2.8.0", + "@remix-run/dev": "^2.9.2", "@types/react": "^18.2.62", "@types/react-dom": "^18.2.19", - "typescript": "^5.3.3" + "@vercel/remix": "^2.9.2-patch.2", + "typescript": "^5.3.3", + "vite": "^5.1.0", + "vite-tsconfig-paths": "^4.2.1" }, "engines": { "node": ">=18" diff --git a/docs/remix.config.js b/docs/remix.config.js deleted file mode 100644 index 5bdbfd787d..0000000000 --- a/docs/remix.config.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @type {import('@remix-run/dev').AppConfig} */ -module.exports = { - ignoredRouteFiles: ["**/.*"], - serverModuleFormat: "cjs", - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "build/index.js", - // publicPath: "/build/", -}; diff --git a/docs/vite.config.ts b/docs/vite.config.ts new file mode 100644 index 0000000000..fd6b102dc6 --- /dev/null +++ b/docs/vite.config.ts @@ -0,0 +1,18 @@ +import { vitePlugin as remix } from '@remix-run/dev' +import { installGlobals } from '@remix-run/node' +import { vercelPreset } from '@vercel/remix/vite' +import { defineConfig } from 'vite' +import tsconfigPaths from 'vite-tsconfig-paths' + +installGlobals() + +export default defineConfig({ + plugins: [ + remix({ + ignoredRouteFiles: ['**/.*'], + presets: [vercelPreset()], + serverModuleFormat: 'cjs', + }), + tsconfigPaths(), + ], +}) diff --git a/yarn.lock b/yarn.lock index 7dd2515bd4..e97be164bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3748,18 +3748,21 @@ __metadata: version: 0.0.0-use.local resolution: "@react-spring/docs@workspace:docs" dependencies: - "@remix-run/dev": ^2.8.0 - "@remix-run/node": ^2.8.0 - "@remix-run/react": ^2.8.0 - "@remix-run/serve": ^2.8.0 - "@remix-run/server-runtime": ^2.8.0 + "@remix-run/dev": ^2.9.2 + "@remix-run/node": ^2.9.2 + "@remix-run/react": ^2.9.2 + "@remix-run/serve": ^2.9.2 + "@remix-run/server-runtime": ^2.9.2 "@types/react": ^18.2.62 "@types/react-dom": ^18.2.19 "@vercel/analytics": ^1.2.2 + "@vercel/remix": ^2.9.2-patch.2 "@vercel/remix-entry-server": ^0.1.1 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^5.3.3 + vite: ^5.1.0 + vite-tsconfig-paths: ^4.2.1 languageName: unknown linkType: soft @@ -3984,7 +3987,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/dev@npm:^2.8.0, @remix-run/dev@npm:^2.9.2": +"@remix-run/dev@npm:^2.9.2": version: 2.9.2 resolution: "@remix-run/dev@npm:2.9.2" dependencies: @@ -4094,7 +4097,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/node@npm:2.9.2, @remix-run/node@npm:^2.8.0": +"@remix-run/node@npm:2.9.2, @remix-run/node@npm:^2.9.2": version: 2.9.2 resolution: "@remix-run/node@npm:2.9.2" dependencies: @@ -4114,7 +4117,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/react@npm:^2.8.0": +"@remix-run/react@npm:^2.9.2": version: 2.9.2 resolution: "@remix-run/react@npm:2.9.2" dependencies: @@ -4148,7 +4151,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/serve@npm:^2.8.0": +"@remix-run/serve@npm:^2.9.2": version: 2.9.2 resolution: "@remix-run/serve@npm:2.9.2" dependencies: @@ -4181,7 +4184,7 @@ __metadata: languageName: node linkType: hard -"@remix-run/server-runtime@npm:2.9.2, @remix-run/server-runtime@npm:^2.8.0": +"@remix-run/server-runtime@npm:2.9.2, @remix-run/server-runtime@npm:^2.9.2": version: 2.9.2 resolution: "@remix-run/server-runtime@npm:2.9.2" dependencies: @@ -4709,6 +4712,18 @@ __metadata: languageName: node linkType: hard +"@ts-morph/common@npm:~0.11.0": + version: 0.11.1 + resolution: "@ts-morph/common@npm:0.11.1" + dependencies: + fast-glob: ^3.2.7 + minimatch: ^3.0.4 + mkdirp: ^1.0.4 + path-browserify: ^1.0.1 + checksum: 2853215cfdfb9b65f96ceef91b15a73ab6591fd27d072801884ea5acc1a8f0becd5ac214d5f3d840f5d650b7654585a9b9df86fc4287872e7be1c6f566381bfd + languageName: node + linkType: hard + "@types/acorn@npm:^4.0.0": version: 4.0.6 resolution: "@types/acorn@npm:4.0.6" @@ -4917,7 +4932,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.12": +"@types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.6": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 @@ -5475,6 +5490,34 @@ __metadata: languageName: node linkType: hard +"@vercel/remix@npm:^2.9.2-patch.2": + version: 2.9.2 + resolution: "@vercel/remix@npm:2.9.2" + dependencies: + "@vercel/static-config": 3.0.0 + isbot: ^3.6.8 + ts-morph: 12.0.0 + peerDependencies: + "@remix-run/dev": 2.9.1 + "@remix-run/node": 2.9.1 + "@remix-run/server-runtime": 2.9.1 + react: "*" + react-dom: "*" + checksum: 26c5034b7aa5df4af208148e5af035b1cf5ad3c2a5bb25b523b81fb2132466e9e331a74e81af384d6bec3d72aab06936c39745ee62b86f50faa1231ce198d9a8 + languageName: node + linkType: hard + +"@vercel/static-config@npm:3.0.0": + version: 3.0.0 + resolution: "@vercel/static-config@npm:3.0.0" + dependencies: + ajv: 8.6.3 + json-schema-to-ts: 1.6.4 + ts-morph: 12.0.0 + checksum: aa69e98b31e5b0db416e4906a70ff7b9fe168146a1d9e67007a2e4514999f7ce0d02153b6314f0ea6fb3a7a0c2ccf841511d09873695e8623a4d95546461bfc9 + languageName: node + linkType: hard + "@vitejs/plugin-react-refresh@npm:^1.3.6": version: 1.3.6 resolution: "@vitejs/plugin-react-refresh@npm:1.3.6" @@ -5642,6 +5685,18 @@ __metadata: languageName: node linkType: hard +"ajv@npm:8.6.3": + version: 8.6.3 + resolution: "ajv@npm:8.6.3" + dependencies: + fast-deep-equal: ^3.1.1 + json-schema-traverse: ^1.0.0 + require-from-string: ^2.0.2 + uri-js: ^4.2.2 + checksum: 690ffb9408415fdab43686b3f92037ba0c8362f5d0709a123ba3fb546e6ad81414455f80a2b5cc432ce924afe9864671198f022bc331a19c072d4ede152ec3ca + languageName: node + linkType: hard + "ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -7089,6 +7144,13 @@ __metadata: languageName: node linkType: hard +"code-block-writer@npm:^10.1.1": + version: 10.1.1 + resolution: "code-block-writer@npm:10.1.1" + checksum: e048037acbcbda19fca62a3a63e4a64226ea6b5dc0fad7632d34a88c1165b29a357e5e19f0497811e9911472e824ab85f68176f40e439da87e051908956eb47c + languageName: node + linkType: hard + "collect-v8-coverage@npm:^1.0.0": version: 1.0.1 resolution: "collect-v8-coverage@npm:1.0.1" @@ -9324,29 +9386,29 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.9": - version: 3.2.12 - resolution: "fast-glob@npm:3.2.12" +"fast-glob@npm:^3.2.7, fast-glob@npm:^3.3.0": + version: 3.3.2 + resolution: "fast-glob@npm:3.3.2" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 + checksum: 900e4979f4dbc3313840078419245621259f349950411ca2fa445a2f9a1a6d98c3b5e7e0660c5ccd563aa61abe133a21765c6c0dec8e57da1ba71d8000b05ec1 languageName: node linkType: hard -"fast-glob@npm:^3.3.0": - version: 3.3.2 - resolution: "fast-glob@npm:3.3.2" +"fast-glob@npm:^3.2.9": + version: 3.2.12 + resolution: "fast-glob@npm:3.2.12" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 900e4979f4dbc3313840078419245621259f349950411ca2fa445a2f9a1a6d98c3b5e7e0660c5ccd563aa61abe133a21765c6c0dec8e57da1ba71d8000b05ec1 + checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 languageName: node linkType: hard @@ -10116,6 +10178,13 @@ __metadata: languageName: node linkType: hard +"globrex@npm:^0.1.2": + version: 0.1.2 + resolution: "globrex@npm:0.1.2" + checksum: adca162494a176ce9ecf4dd232f7b802956bb1966b37f60c15e49d2e7d961b66c60826366dc2649093cad5a0d69970cfa8875bd1695b5a1a2f33dcd2aa88da3c + languageName: node + linkType: hard + "glsl-noise@npm:^0.0.0": version: 0.0.0 resolution: "glsl-noise@npm:0.0.0" @@ -11367,6 +11436,13 @@ __metadata: languageName: node linkType: hard +"isbot@npm:^3.6.8": + version: 3.8.0 + resolution: "isbot@npm:3.8.0" + checksum: 50e75df265b6e1d590174061f37c435fee2e5d4ac7e82a978d1aa41c07c347a128fa340ef31b224ddeec1ee85a614f340ed5fcd8126639af1cbb0e98cac024bc + languageName: node + linkType: hard + "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -12341,6 +12417,16 @@ __metadata: languageName: node linkType: hard +"json-schema-to-ts@npm:1.6.4": + version: 1.6.4 + resolution: "json-schema-to-ts@npm:1.6.4" + dependencies: + "@types/json-schema": ^7.0.6 + ts-toolbelt: ^6.15.5 + checksum: 35399baff3167abafb44c926bf10755fcaa46fa52a52c5c4e467ae18add779c39ad7a998f624d96cb265c6c0f6ba45ff81bc85c8cdb58bb47ba8c4e8f79835df + languageName: node + linkType: hard + "json-schema-traverse@npm:^0.4.1": version: 0.4.1 resolution: "json-schema-traverse@npm:0.4.1" @@ -15120,6 +15206,13 @@ __metadata: languageName: node linkType: hard +"path-browserify@npm:^1.0.1": + version: 1.0.1 + resolution: "path-browserify@npm:1.0.1" + checksum: c6d7fa376423fe35b95b2d67990060c3ee304fc815ff0a2dc1c6c3cfaff2bd0d572ee67e18f19d0ea3bbe32e8add2a05021132ac40509416459fffee35200699 + languageName: node + linkType: hard + "path-exists@npm:^3.0.0": version: 3.0.0 resolution: "path-exists@npm:3.0.0" @@ -18483,6 +18576,37 @@ __metadata: languageName: node linkType: hard +"ts-morph@npm:12.0.0": + version: 12.0.0 + resolution: "ts-morph@npm:12.0.0" + dependencies: + "@ts-morph/common": ~0.11.0 + code-block-writer: ^10.1.1 + checksum: c033708c76448625380daa3b8c2eeea1306300fa4367804029635f0d911a3723e4315a6e0824e6dfb256df0b99aac0ea0478cb3f14ed6fae2339d43ec882a427 + languageName: node + linkType: hard + +"ts-toolbelt@npm:^6.15.5": + version: 6.15.5 + resolution: "ts-toolbelt@npm:6.15.5" + checksum: 24ad00cfd9ce735c76c873a9b1347eac475b94e39ebbdf100c9019dce88dd5f4babed52884cf82bb456a38c28edd0099ab6f704b84b2e5e034852b618472c1f3 + languageName: node + linkType: hard + +"tsconfck@npm:^3.0.3": + version: 3.0.3 + resolution: "tsconfck@npm:3.0.3" + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + bin: + tsconfck: bin/tsconfck.js + checksum: 8ee0d73f730c0747d4bfe569b1931e1b3848f2adfb86ee8f3dc9aedd123f155b363dec7f51dc165fc7938ce592af753aa513adf7753ffcbee1baf97017d919dd + languageName: node + linkType: hard + "tsconfig-paths@npm:^4.0.0": version: 4.1.0 resolution: "tsconfig-paths@npm:4.1.0" @@ -19328,6 +19452,22 @@ __metadata: languageName: node linkType: hard +"vite-tsconfig-paths@npm:^4.2.1": + version: 4.3.2 + resolution: "vite-tsconfig-paths@npm:4.3.2" + dependencies: + debug: ^4.1.1 + globrex: ^0.1.2 + tsconfck: ^3.0.3 + peerDependencies: + vite: "*" + peerDependenciesMeta: + vite: + optional: true + checksum: 7105ff641379f9f7055110f33067b236c8ee71b1390c0e6482412cdcc7a98c2e139c1c2a483d14fe9045d1977c14dc931e1ff302d6257ec919c70379db9d2419 + languageName: node + linkType: hard + "vite@npm:^3.0.0 || ^4.0.0, vite@npm:^4.1.4": version: 4.2.1 resolution: "vite@npm:4.2.1" @@ -19366,7 +19506,7 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.2.11": +"vite@npm:^5.1.0, vite@npm:^5.2.11": version: 5.2.11 resolution: "vite@npm:5.2.11" dependencies: