Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 17 additions & 6 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ runs:
node-version: "22.x"
cache: "pnpm"

- name: Setup Compact Compiler
if: ${{ inputs.skip-compact != 'true' }}
uses: midnightntwrk/setup-compact-action@4130145456ad3f45934788dd4a65647eb283e658
with:
compact-version: "0.26.0"

- name: Verify Compact Compiler Installation
if: ${{ inputs.skip-compact != 'true' }}
shell: bash
run: |
if ! command -v compact >/dev/null 2>&1; then
echo "::error::Compact CLI not found in PATH"
exit 1
fi
echo "✅ Compact CLI is available"
compact --version || true

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --prefer-offline
Expand All @@ -41,9 +58,3 @@ runs:
TURBO_MAJOR_VERSION: 2
TURBO_TELEMETRY_DISABLED: 1
run: pnpm install turbo@${{ env.TURBO_MAJOR_VERSION }} -g

- name: Setup Compact Compiler
if: ${{ inputs.skip-compact != 'true' }}
uses: midnightntwrk/setup-compact-action@4130145456ad3f45934788dd4a65647eb283e658
with:
compact-version: "0.26.0"
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
skip-compact: "true"

- name: Lint and Format
run: pnpm lint && pnpm fmt
run: pnpm lint:ci
timeout-minutes: 10

- name: Commitlint
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:

- name: Run tests
run: pnpm test:contracts
timeout-minutes: 10
env:
SKIP_ZK: "true"

- name: Check types
run: pnpm exec turbo run types --filter './contracts/*'
run: pnpm types:contracts
timeout-minutes: 5
env:
SKIP_ZK: "true"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ Turbo manages tasks across the monorepo, defined in `turbo.json`. Key tasks:
- Checks TypeScript types without emitting files.
- Run: `pnpm types`.

- **`fmt`**, **`lint`**, **`lint:fix`**:
- `pnpm fmt`: Formats TypeScript/JavaScript code with Biome and `.compact` files with Compact CLI.
- `pnpm lint`: Lints code with Biome.
- `pnpm lint:fix`: Auto-fixes linting issues with Biome.
- **`lint`**, **`lint:fix`**, **`lint:ci`**:
- `pnpm lint`: Checks formatting and linting of all TypeScript/JavaScript code with Biome, and `.compact` files with Compact CLI.
- `pnpm lint:fix`: Auto-fixes formatting and linting issues with Biome for all files, and formats `.compact` files with Compact CLI.
- `pnpm lint:ci`: CI-specific check that only checks changed files (compared to `main` branch) for faster CI runs. Doesn't fail on unmatched files.

### Commit Workflow
Commits are linted with `commitlint` and staged files are processed with `lint-staged` and Biome.
Expand Down
10 changes: 10 additions & 0 deletions apps/lunarswap-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Next.js build output
.next
out
dist

# TypeScript
*.tsbuildinfo

# Dependencies
node_modules
6 changes: 4 additions & 2 deletions apps/lunarswap-ui/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import Script from 'next/script';
// layout.tsx
import type React from 'react';
import './globals.css';
import { ThemeProvider } from 'next-themes';
import { Toaster } from '@/components/ui/hot-toast';
import { NetworkProvider } from '@/lib/network-context';
import { VersionProvider } from '@/lib/version-context';
import { WalletProvider } from '@/lib/wallet-context';
import { ThemeProvider } from 'next-themes';

const inter = Inter({ subsets: ['latin'] });

Expand All @@ -32,7 +32,9 @@ export const metadata: Metadata = {

export default function RootLayout({
children,
}: { children: React.ReactNode }) {
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<head>
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/app/pool/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChevronRight } from 'lucide-react';
import Link from 'next/link';
import { Header } from '@/components/header';
import { NewPositionWizard } from '@/components/pool/new-position-wizard';
import { StarsBackground } from '@/components/stars-background';
import { ChevronRight } from 'lucide-react';
import Link from 'next/link';

export const metadata = {
title: 'LunarSwap | New Position',
Expand Down
6 changes: 4 additions & 2 deletions apps/lunarswap-ui/biome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"root": false,
"extends": ["@openzeppelin/midnight-apps-biome-config"]
"extends": ["@openzeppelin/midnight-apps-biome-config"],
"vcs": {
"useIgnoreFile": true
}
}
3 changes: 2 additions & 1 deletion apps/lunarswap-ui/components/account-details-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Button } from '@/components/ui/button';
import type { DAppConnectorWalletState } from '@midnight-ntwrk/dapp-connector-api';
import { X } from 'lucide-react';
import { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { Button } from '@/components/ui/button';
import { Identicon } from './identicon';

interface AccountDetailsModalProps {
Expand Down Expand Up @@ -194,6 +194,7 @@ export function AccountDetailsModal({
data-modal-portal
>
<div
role="dialog"
className="bg-background rounded-xl shadow-2xl w-full max-w-4xl max-h-[80vh] overflow-hidden relative pointer-events-auto"
style={{
zIndex: 100000,
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/account-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { ChevronLeft, ChevronsRight, LogOut, Settings } from 'lucide-react';
import { useEffect, useState } from 'react';
import { useWallet } from '@/hooks/use-wallet';
import { useWalletRx } from '@/hooks/use-wallet-rx';
import { formatAddress } from '@/lib/wallet-utils';
import { ChevronLeft, ChevronsRight, LogOut, Settings } from 'lucide-react';
import { useEffect, useState } from 'react';
import { AccountDetailsModal } from './account-details-modal';
import { BalanceDisplay } from './balance-display';
import { Identicon } from './identicon';
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Button } from '@/components/ui/button';
import { Menu } from 'lucide-react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import { Logo } from './logo';
import { VersionSwitcher } from './version-switcher';
import { WalletConnect } from './wallet-connect';
Expand Down
5 changes: 4 additions & 1 deletion apps/lunarswap-ui/components/identicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import Avatar from 'boring-avatars';
export function Identicon({
address,
size,
}: { address: string; size: number }) {
}: {
address: string;
size: number;
}) {
return (
<Avatar
size={size}
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/network-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client';

import { Check, ChevronDown, Wifi, WifiOff } from 'lucide-react';
import { useEffect, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
Expand All @@ -9,8 +11,6 @@ import {
} from '@/components/ui/dropdown-menu';
import { useNetwork } from '@/hooks/use-network';
import { useWallet } from '@/hooks/use-wallet';
import { Check, ChevronDown, Wifi, WifiOff } from 'lucide-react';
import { useEffect, useState } from 'react';

export function NetworkSelector() {
const {
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/pool/new-position-wizard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { Button } from '@/components/ui/button';
import { Card } from '@/components/ui/card';
import { RotateCcw, Settings } from 'lucide-react';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { Card } from '@/components/ui/card';
import { SelectPairStep } from './steps/select-pair-step';
import { SetDepositStep } from './steps/set-deposit-step';

Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/pool/pool-creation-wizard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Card } from '@/components/ui/card';
import { useState } from 'react';
import { Card } from '@/components/ui/card';
import { SelectPairStep } from './steps/select-pair-step';

type Step = 'select-pair' | 'set-range';
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/pool/pool-positions.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Plus } from 'lucide-react';
import Link from 'next/link';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

export function PoolPositions() {
const [positions, _] = useState<any[]>([]);
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/pool/steps/select-pair-step.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { Button } from '@/components/ui/button';
import { CardContent, CardFooter } from '@/components/ui/card';
import { HelpCircle } from 'lucide-react';
import { useRef, useState } from 'react';
import { Button } from '@/components/ui/button';
import { CardContent, CardFooter } from '@/components/ui/card';
import { TokenSelector } from '../token-selector';

interface SelectPairStepProps {
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/pool/steps/set-deposit-step.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import Image from 'next/image';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import { CardContent, CardFooter } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import Image from 'next/image';
import { useState } from 'react';

interface SetDepositStepProps {
pairData: any;
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/pool/token-rewards.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HelpCircle } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { HelpCircle } from 'lucide-react';

export function TokenRewards() {
return (
Expand Down
6 changes: 3 additions & 3 deletions apps/lunarswap-ui/components/pool/token-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use client';

import { ChevronDown, Search } from 'lucide-react';
import Image from 'next/image';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Dialog,
Expand All @@ -8,9 +11,6 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { ChevronDown, Search } from 'lucide-react';
import Image from 'next/image';
import { useState } from 'react';

// Sample token list - in a real app, this would come from an API
const popularTokens = [
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/pool/top-pools-list.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { ArrowUpRight } from 'lucide-react';
import Image from 'next/image';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

// Sample data for top pools
const topPools = [
Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/swap-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client';

import { ArrowDown, Fuel, Info, Settings } from 'lucide-react';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Card,
Expand All @@ -13,8 +15,6 @@ import {
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/tooltip';
import { ArrowDown, Fuel, Info, Settings } from 'lucide-react';
import { useState } from 'react';
import { TokenInput } from './token-input';
import { TokenSelectModal } from './token-select-modal';

Expand Down
4 changes: 2 additions & 2 deletions apps/lunarswap-ui/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { Moon, Sun } from 'lucide-react';
import { useTheme } from 'next-themes';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';

export function ThemeToggle() {
const { theme, setTheme } = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/token-input.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import { Input } from '@/components/ui/input';
import { ChevronDown } from 'lucide-react';
import Image from 'next/image';
import { Input } from '@/components/ui/input';

interface TokenInputProps {
token: {
Expand Down
6 changes: 3 additions & 3 deletions apps/lunarswap-ui/components/token-select-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use client';
import { Search } from 'lucide-react';
import Image from 'next/image';
import { useState } from 'react';
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { Search } from 'lucide-react';
import Image from 'next/image';
import { useState } from 'react';

const popularTokens = [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/token-stats.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card, CardContent } from '@/components/ui/card';
import { ArrowDown, ArrowUp } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';

export function TokenStats() {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type VariantProps, cva } from 'class-variance-authority';
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';

import { cn } from '@/lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/ui/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type VariantProps, cva } from 'class-variance-authority';
import { cva, type VariantProps } from 'class-variance-authority';
import type * as React from 'react';

import { cn } from '@/lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion apps/lunarswap-ui/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot } from '@radix-ui/react-slot';
import { type VariantProps, cva } from 'class-variance-authority';
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';

import { cn } from '@/lib/utils';
Expand Down
Loading