mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 21:54:56 +00:00
Generated by Spark: @johndoe6345789 ➜ /workspaces/low-code-react-app-b (main) $ npm run build
> spark-template@0.0.0 prebuild
> mkdir -p /tmp/dist || true
> spark-template@0.0.0 build
> tsc -b --noCheck && vite build
vite v7.3.1 building client environment for production...
<script src="/runtime-config.js"> in "/index.html" can't be bundled without type="module" attribute
✓ 37 modules transformed.
✗ Build failed in 1.07s
error during build:
[vite]: Rollup failed to resolve import "@github/spark/hooks" from "/workspaces/low-code-react-app-b/src/hooks/use-project-state.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at viteLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33635:57)
at file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33669:73
at onwarn (file:///workspaces/low-code-react-app-b/node_modules/@vitejs/plugin-react-swc/index.js:76:7)
at file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33669:28
at onRollupLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33664:63)
at onLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33467:4)
at file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:20961:32
at Object.logger [as onLog] (file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:22848:9)
at ModuleLoader.handleInvalidResolvedId (file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:21592:26)
at file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:21550:26
@johndoe6345789 ➜ /workspaces/low-code-react-app-b (main) $
This commit is contained in:
83
BUILD_FIX_COMPLETE.md
Normal file
83
BUILD_FIX_COMPLETE.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# Build Fix Complete
|
||||
|
||||
## Issue
|
||||
The build was failing with the error:
|
||||
```
|
||||
[vite]: Rollup failed to resolve import "@github/spark/hooks" from "/workspaces/low-code-react-app-b/src/hooks/use-project-state.ts".
|
||||
```
|
||||
|
||||
## Root Cause
|
||||
The codebase was importing from `@github/spark/hooks` which doesn't exist in the build environment. This was a leftover reference from when the packages folder existed.
|
||||
|
||||
## Solution
|
||||
Replaced all imports of `@github/spark/hooks` with the local `@/hooks/use-kv` implementation throughout the codebase.
|
||||
|
||||
## Files Modified
|
||||
|
||||
### Component Files
|
||||
- `src/App.refactored.tsx`
|
||||
- `src/App.simple.tsx`
|
||||
- `src/components/AtomicComponentDemo.tsx`
|
||||
- `src/components/ComprehensiveDemoPage.tsx`
|
||||
- `src/components/DockerBuildDebugger.tsx`
|
||||
- `src/components/FaviconDesigner.tsx`
|
||||
- `src/components/FeatureIdeaCloud.tsx`
|
||||
- `src/components/GlobalSearch.tsx`
|
||||
- `src/components/JSONDemoPage.tsx`
|
||||
- `src/components/JSONLambdaDesigner.tsx`
|
||||
|
||||
### Hook Files
|
||||
- `src/hooks/use-project-state.ts`
|
||||
- `src/hooks/data/use-array.ts`
|
||||
- `src/hooks/data/use-components.ts`
|
||||
- `src/hooks/data/use-data-source.ts`
|
||||
- `src/hooks/data/use-data-sources.ts`
|
||||
- `src/hooks/data/use-files.ts`
|
||||
- `src/hooks/data/use-json-data.ts`
|
||||
- `src/hooks/data/use-lambdas.ts`
|
||||
- `src/hooks/data/use-models.ts`
|
||||
- `src/hooks/data/use-workflows.ts`
|
||||
- `src/hooks/feature-ideas/use-feature-ideas.ts`
|
||||
- `src/hooks/feature-ideas/use-idea-connections.ts`
|
||||
- `src/hooks/feature-ideas/use-idea-groups.ts`
|
||||
- `src/hooks/feature-ideas/use-node-positions.ts`
|
||||
- `src/hooks/ui/use-schema-editor.ts`
|
||||
- `src/hooks/use-navigation-history.ts`
|
||||
|
||||
### Config Files
|
||||
- `src/config/orchestration/data-source-manager.ts`
|
||||
- `src/lib/json-ui/hooks.ts`
|
||||
|
||||
## Change Pattern
|
||||
All instances of:
|
||||
```typescript
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
```
|
||||
|
||||
Were replaced with:
|
||||
```typescript
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
```
|
||||
|
||||
## Storage Implementation
|
||||
The local `useKV` hook (`src/hooks/use-kv.ts`) uses the storage service (`@/lib/storage-service`) which:
|
||||
- Defaults to IndexedDB for client-side persistence
|
||||
- Can be configured to use a Flask API backend via environment variable or UI settings
|
||||
- Automatically falls back to IndexedDB if the Flask API fails
|
||||
|
||||
## TypeScript Definitions
|
||||
The `window.spark` global object is properly typed in `src/vite-env.d.ts` and includes:
|
||||
- `llmPrompt`: Template string function for creating prompts
|
||||
- `llm`: Function for calling LLM APIs
|
||||
- `user`: Function for getting current user info
|
||||
- `kv`: Key-value storage API (keys, get, set, delete)
|
||||
|
||||
## Build Status
|
||||
✅ All TypeScript import errors resolved
|
||||
✅ Build should now complete successfully
|
||||
✅ Docker multi-arch builds should work
|
||||
|
||||
## Next Steps
|
||||
1. Run `npm run build` to verify the build completes
|
||||
2. Test the Docker build process
|
||||
3. Verify the application works correctly in production
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Tabs, TabsContent } from '@/components/ui/tabs'
|
||||
import { AppHeader, PageHeader } from '@/components/organisms'
|
||||
import { ProjectDashboard } from '@/components/ProjectDashboard'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Tabs, TabsContent } from '@/components/ui/tabs'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCRUD, useSearchFilter } from '@/hooks/data'
|
||||
import { useToggle, useDialog } from '@/hooks/ui'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
|
||||
import { SearchInput, DataCard, ActionBar } from '@/components/molecules'
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Separator } from '@/components/ui/separator'
|
||||
import { Progress } from '@/components/ui/progress'
|
||||
import { useCRUD, useSearch } from '@/hooks/data'
|
||||
import { useDialog } from '@/hooks/ui'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { SearchBar } from '@/components/molecules/SearchBar'
|
||||
import { DataList, ActionButton, IconButton } from '@/components/atoms'
|
||||
import { Plus, Trash, Check, Clock } from '@phosphor-icons/react'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useRef, useEffect } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Input } from '@/components/ui/input'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useCallback, useRef, ReactElement } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import ReactFlow, {
|
||||
Node,
|
||||
Edge,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useMemo, useEffect } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import {
|
||||
CommandDialog,
|
||||
CommandEmpty,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { JSONUIRenderer } from '@/lib/json-ui'
|
||||
import { UIComponent } from '@/lib/json-ui/schema'
|
||||
import { toast } from 'sonner'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useState } from 'react'
|
||||
|
||||
export function JSONDemoPage() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PageRenderer } from '@/lib/schema-renderer'
|
||||
import lambdaDesignerSchema from '@/config/pages/lambda-designer.json'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Component as ComponentSchema } from '@/schemas/ui-schema'
|
||||
|
||||
export function JSONLambdaDesigner() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { DataSource } from './schema'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
export function useArray<T>(key: string, defaultValue: T[] = []) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
import { ComponentNode } from '@/types/project'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export type DataSourceType = 'kv' | 'static' | 'computed'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback, useEffect } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { DataSource } from '@/types/json-ui'
|
||||
|
||||
export function useDataSources(dataSources: DataSource[]) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
import { ProjectFile } from '@/types/project'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export interface UseJSONDataOptions {
|
||||
key: string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
import { Lambda } from '@/types/project'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
import { PrismaModel } from '@/types/project'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useCallback } from 'react'
|
||||
import { Workflow } from '@/types/project'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export interface FeatureIdea {
|
||||
id: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { Edge, MarkerType } from 'reactflow'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export interface IdeaGroup {
|
||||
id: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export function useNodePositions() {
|
||||
const [positions, setPositions] = useKV<Record<string, { x: number; y: number }>>('feature-idea-node-positions', {})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { toast } from 'sonner'
|
||||
import { UIComponent } from '@/types/json-ui'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import { useEffect } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
import {
|
||||
ProjectFile,
|
||||
PrismaModel,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import { useKV } from '@github/spark/hooks'
|
||||
import { useKV } from '@/hooks/use-kv'
|
||||
|
||||
export interface DataSourceConfig {
|
||||
type: 'kv' | 'api' | 'computed' | 'static'
|
||||
|
||||
Reference in New Issue
Block a user