Skip to content

Commit ca1f396

Browse files
committed
Additional cleanup, better landing page, removed deps
1 parent b15de86 commit ca1f396

8 files changed

Lines changed: 156 additions & 23 deletions

File tree

app/library/language-switcher/LanguageSwitcher.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ const LanguageSwitcher = () => {
1818
const to = constructTo(location.pathname, i18n.language);
1919

2020
return (
21-
<>
21+
<div className="flex gap-2 p-2 fixed top-0 right-0 w-min z-10">
2222
{supportedLanguages.map((language) => (
2323
<Link
24+
className="text-blue-500 hover:underline transition-all"
2425
key={language}
2526
to={`/${language}${to}`}
2627
onClick={() => i18n.changeLanguage(language)}
2728
>
2829
{language}
2930
</Link>
3031
))}
31-
</>
32+
</div>
3233
);
3334
};
3435

app/library/language-switcher/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a simple language switcher for your website. It uses a simple JavaScript to switch between languages.
44

5-
It comes unstyled so you can style it however you want.
5+
It comes with minimal styling so you can style it however you want.
66

77
## How to use
88

app/root.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ export default function App() {
4040
useChangeLanguage(locale);
4141

4242
return (
43-
<html lang={locale} dir={i18n.dir()}>
43+
<html
44+
className="overflow-y-auto overflow-x-hidden"
45+
lang={locale}
46+
dir={i18n.dir()}
47+
>
4448
<head>
4549
<meta charSet="utf-8" />
4650
<meta name="viewport" content="width=device-width, initial-scale=1" />
4751
<Meta />
4852
<Links />
4953
</head>
50-
<body>
54+
<body className="w-full h-full">
5155
<LanguageSwitcher />
5256
<Outlet />
5357
<ScrollRestoration />

app/routes/_index.tsx

Lines changed: 102 additions & 5 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"prepare": "husky"
2323
},
2424
"dependencies": {
25-
"@prisma/client": "^5.12.1",
2625
"@remix-run/node": "^2.8.1",
2726
"@remix-run/react": "^2.8.1",
2827
"@remix-run/serve": "^2.8.1",
@@ -40,30 +39,25 @@
4039
"tailwind-merge": "^2.2.2"
4140
},
4241
"devDependencies": {
43-
"@faker-js/faker": "^8.4.1",
4442
"@remix-run/dev": "^2.8.1",
4543
"@types/node": "^20.12.4",
4644
"@types/prompt": "^1.1.8",
4745
"@types/react": "^18.2.74",
4846
"@types/react-dom": "^18.2.24",
4947
"@typescript-eslint/eslint-plugin": "^7.5.0",
50-
"@vercel/remix": "^2.8.1",
5148
"@vitest/coverage-v8": "^1.4.0",
5249
"@vitest/ui": "^1.4.0",
5350
"autoprefixer": "^10.4.19",
5451
"chalk": "^5.3.0",
5552
"eslint": "^8.57.0",
56-
"eslint-config-prettier": "^9.1.0",
5753
"eslint-import-resolver-typescript": "^3.6.1",
5854
"eslint-plugin-import": "^2.29.1",
5955
"eslint-plugin-jsx-a11y": "^6.8.0",
6056
"eslint-plugin-react": "^7.34.1",
6157
"eslint-plugin-react-hooks": "^4.6.0",
6258
"happy-dom": "^14.4.0",
6359
"husky": "^9.0.11",
64-
"node-html-parser": "^6.1.13",
6560
"postcss": "^8.4.38",
66-
"prisma": "^5.12.1",
6761
"prompt": "^1.3.0",
6862
"remix-development-tools": "^4.1.4",
6963
"tailwindcss": "^3.4.3",

public/banner.png

320 KB
Loading

public/logo.png

4.43 KB
Loading

scripts/cleanup.ts

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,48 @@ const removeTheCleanupFromPackageJsonAndScripts = async () => {
3636
await fs.unlink("scripts/cleanup.ts");
3737
};
3838

39-
removeAllReadmeFromApp(appDirectory).then(async () => {
40-
await fs.unlink("scripts/README.md");
41-
await fs.unlink("remix/README.md");
42-
console.log(
43-
chalk.green("All README.md files are removed from app directory")
39+
const revertIndexRoute = async () => {
40+
const file = `import type { MetaFunction } from "@remix-run/node";
41+
import { useTranslation } from "react-i18next";
42+
43+
export const meta: MetaFunction = () => {
44+
return [
45+
{ title: "New Remix App" },
46+
{ name: "description", content: "Welcome to Remix!" },
47+
];
48+
};
49+
50+
export default function Index() {
51+
const { t } = useTranslation();
52+
return (
53+
<div>
54+
<h1>{t("hi")}</h1>
55+
<p>{t("welcome")}</p>
56+
</div>
4457
);
45-
});
46-
removeTheCleanupFromPackageJsonAndScripts();
58+
}
59+
`;
60+
await fs.writeFile("app/routes/_index.tsx", file, "utf-8");
61+
console.log(chalk.green("Index route is reverted to empty state"));
62+
};
63+
64+
const removeForgeAssets = async () => {
65+
await fs.unlink("public/logo.png");
66+
await fs.unlink("public/banner.png");
67+
console.log(chalk.green("Forge assets are removed from public directory"));
68+
};
69+
70+
const runCleanup = async () => {
71+
await removeForgeAssets();
72+
await revertIndexRoute();
73+
await removeAllReadmeFromApp(appDirectory).then(async () => {
74+
await fs.unlink("scripts/README.md");
75+
await fs.unlink("remix/README.md");
76+
console.log(
77+
chalk.green("All README.md files are removed from app directory")
78+
);
79+
});
80+
removeTheCleanupFromPackageJsonAndScripts();
81+
};
82+
83+
runCleanup();

0 commit comments

Comments
 (0)