Remove legacy compatibility layer and enforce modular architecture
- Delete src/stores/market.ts compatibility re-export file - Update 15 files to import from proper module path @/modules/market/stores/market - Add necessary type exports to market store for external consumers - Remove empty src/stores/ directory completely - Enforce clean modular architecture without global store shortcuts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
4a3d2012be
commit
c284ad5778
16 changed files with 23 additions and 21 deletions
|
|
@ -14,7 +14,7 @@ import CurrencyDisplay from '@/components/ui/CurrencyDisplay.vue'
|
|||
import { LogoutConfirmDialog } from '@/components/ui/LogoutConfirmDialog'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import { useMarketPreloader } from '@/modules/market/composables/useMarketPreloader'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { tryInjectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
import { useModularNavigation } from '@/composables/useModularNavigation'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getApiUrl } from '@/lib/config/lnbits'
|
||||
import type { Order } from '@/stores/market'
|
||||
import type { Order } from '@/modules/market/stores/market'
|
||||
|
||||
export interface LightningInvoice {
|
||||
checking_id: string
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ import { ref, computed } from 'vue'
|
|||
import { useRouter } from 'vue-router'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Shield } from 'lucide-vue-next'
|
||||
import type { ShippingZone } from '@/stores/market'
|
||||
import type { ShippingZone } from '@/modules/market/stores/market'
|
||||
|
||||
interface Props {
|
||||
stallId: string
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import {
|
||||
|
|
@ -319,7 +319,7 @@ import {
|
|||
Settings,
|
||||
BarChart3
|
||||
} from 'lucide-vue-next'
|
||||
import type { OrderStatus } from '@/stores/market'
|
||||
import type { OrderStatus } from '@/modules/market/stores/market'
|
||||
import type { NostrmarketService } from '../services/nostrmarketService'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ import { Button } from '@/components/ui/button'
|
|||
import { Badge } from '@/components/ui/badge'
|
||||
import { Package, Store, Zap, Copy, QrCode, CheckCircle } from 'lucide-vue-next'
|
||||
import { toast } from 'vue-sonner'
|
||||
import type { OrderStatus } from '@/stores/market'
|
||||
import type { OrderStatus } from '@/modules/market/stores/market'
|
||||
// Order type no longer needed since we use any for readonly compatibility
|
||||
|
||||
const router = useRouter()
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ import {
|
|||
Info,
|
||||
CheckCircle
|
||||
} from 'lucide-vue-next'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { Card, CardContent, CardFooter, CardTitle } from '@/components/ui/card'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { ShoppingCart } from 'lucide-vue-next'
|
||||
import type { Product } from '@/stores/market'
|
||||
import type { Product } from '@/modules/market/stores/market'
|
||||
|
||||
interface Props {
|
||||
product: Product
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import {
|
||||
ShoppingCart,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { finalizeEvent, type EventTemplate, nip04 } from 'nostr-tools'
|
||||
import { BaseService } from '@/core/base/BaseService'
|
||||
import type { Stall, Product, Order } from '@/stores/market'
|
||||
import type { Stall, Product, Order } from '@/modules/market/stores/market'
|
||||
|
||||
export interface NostrmarketStall {
|
||||
id: string
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ref } from 'vue'
|
||||
import { BaseService } from '@/core/base/BaseService'
|
||||
import type { PaymentStatus, LightningInvoice } from '@/core/services/invoiceService'
|
||||
import type { Order } from '@/stores/market'
|
||||
import type { Order } from '@/modules/market/stores/market'
|
||||
|
||||
export interface PaymentMonitorState {
|
||||
isMonitoring: boolean
|
||||
|
|
|
|||
|
|
@ -12,7 +12,13 @@ import type {
|
|||
OrderStatus, StallCart, FilterData, SortOptions,
|
||||
PaymentRequest, PaymentStatus
|
||||
} from '../types/market'
|
||||
// Import types that are used in the store implementation
|
||||
|
||||
// Re-export types for external use
|
||||
export type {
|
||||
Market, Stall, Product, Order, ShippingZone,
|
||||
OrderStatus, StallCart, FilterData, SortOptions,
|
||||
PaymentRequest, PaymentStatus
|
||||
} from '../types/market'
|
||||
|
||||
export const useMarketStore = defineStore('market', () => {
|
||||
const auth = useAuth()
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import {
|
||||
BarChart3,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { useMarket } from '../composables/useMarket'
|
||||
import { useMarketPreloader } from '../composables/useMarketPreloader'
|
||||
import { config } from '@/lib/config'
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarketStore } from '@/modules/market/stores/market'
|
||||
import { CheckCircle } from 'lucide-vue-next'
|
||||
import ShoppingCart from '@/modules/market/components/ShoppingCart.vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
// Compatibility re-export for the moved market store
|
||||
export * from '@/modules/market/stores/market'
|
||||
export { useMarketStore } from '@/modules/market/stores/market'
|
||||
export type * from '@/modules/market/types/market'
|
||||
Loading…
Add table
Add a link
Reference in a new issue