Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: setup tailwind and ui package for console #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions apps/console-electron/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -2,9 +2,7 @@ import Link from 'next/link';

export default function Another() {
return (
<div
className={`grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]`}
>
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans">
<Link href="/">Go back</Link>
<p>Dashboard Page</p>
</div>
5 changes: 4 additions & 1 deletion apps/console-electron/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from '@dicedb/ui/button';
import Link from 'next/link';

export default function Home() {
@@ -7,13 +8,15 @@
>
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<h1 className="lg">DiceDB</h1>
<img

Check warning on line 11 in apps/console-electron/app/page.tsx

GitHub Actions / Build and Test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
width={48}
height={48}
src="https://avatars.githubusercontent.com/u/112580013?s=48&v=4"
alt="logo"
/>
<Link href="/dashboard">Home</Link>
<Button variant="default">
<Link href="/dashboard">Home</Link>
</Button>
</main>
</div>
);
4 changes: 3 additions & 1 deletion apps/console-electron/package.json
Original file line number Diff line number Diff line change
@@ -14,11 +14,13 @@
"dependencies": {
"next": "14.2.15",
"react": "^18",
"react-dom": "^18"
"react-dom": "^18",
"@dicedb/ui": "workspace:*"
},
"devDependencies": {
"@dicedb/eslint-config": "workspace:*",
"@dicedb/typescript-config": "workspace:*",
"@dicedb/tailwind-config": "workspace:*",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
10 changes: 5 additions & 5 deletions apps/console-electron/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Config } from 'tailwindcss';
import baseConfig from '@dicedb/tailwind-config/base';

const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
...baseConfig,
theme: {
extend: {
fontFamily: {
Assistant: ['Assistant'],
},
colors: {
background: 'var(--background)',
foreground: 'var(--foreground)',
5 changes: 0 additions & 5 deletions apps/playground-web/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -3,11 +3,6 @@ import baseConfig from '@dicedb/tailwind-config/base';

const config: Config = {
...baseConfig,
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
fontFamily: {
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -4,8 +4,10 @@
"scripts": {
"build": "turbo build",
"build:playground": "turbo build --filter=@dicedb/playground-web --ui stream",
"build:console": "turbo build --filter=@dicedb/console-electron --ui stream",
"dev": "turbo dev",
"dev:playground": "turbo dev --filter=@dicedb/playground-web --ui stream",
"dev:console": "turbo dev --filter=@dicedb/console-electron --ui stream",
"lint": "turbo lint",
"format": "prettier -c ./.prettierrc --write \"**/*.{js,jsx,ts,tsx,json,css}\"",
"check:format": "prettier -c ./.prettierrc \"**/*.{js,jsx,ts,tsx,json,css}\"",
30 changes: 18 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tooling/tailwind-config/base.tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ const config: Config = {
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
'../../packages/ui/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {

Unchanged files with check annotations Beta

playgroundElement,
playgroundHeaderElement,
playgroundMainElement,
terminalContainerElement,

Check warning on line 32 in apps/playground-web/components/Playground/__tests__/Playground.test.tsx

GitHub Actions / Build and Test

'terminalContainerElement' is assigned a value but never used
searchBoxContainerElement,
searchBoxWrapperElement,
} = setupTest();
body: MonoResponse; // MonoResponse for body
};
newOutput: string;
setOutput: (prevOutput: any) => any; // Adjust type as necessary

Check warning on line 15 in apps/playground-web/shared/utils/commonUtils.ts

GitHub Actions / Build and Test

Unexpected any. Specify a different type

Check warning on line 15 in apps/playground-web/shared/utils/commonUtils.ts

GitHub Actions / Build and Test

Unexpected any. Specify a different type
onCommandExecuted: (commandsLeft: number, cleanupTimeLeft: number) => void; // Allow undefined
}
onCommandExecuted,
}: HandleResultProps) => {
if (result?.body?.data) {
setOutput((prevOutput: any) => [

Check warning on line 26 in apps/playground-web/shared/utils/commonUtils.ts

GitHub Actions / Build and Test

Unexpected any. Specify a different type
...prevOutput,
newOutput,
result?.body?.data,
]);
} else if (result?.body?.error) {
setOutput((prevOutput: any) => [

Check warning on line 32 in apps/playground-web/shared/utils/commonUtils.ts

GitHub Actions / Build and Test

Unexpected any. Specify a different type
...prevOutput,
newOutput,
result?.body?.error,
onCommandExecuted,
}: CommandHandler) => {
const newOutput = `dice > ${command}`;
let result: any;

Check warning on line 13 in apps/playground-web/shared/utils/shellUtils.ts

GitHub Actions / Build and Test

Unexpected any. Specify a different type
const { cmd, args } = parseCommand(command);