diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index 84d38efa..80111079 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -10,16 +10,17 @@ import { FilesStore, type FileMap } from './files'; import { PreviewsStore } from './previews'; import { TerminalStore } from './terminal'; import JSZip from 'jszip'; -import pkg from 'file-saver'; -const { saveAs } = pkg; +import fileSaver from 'file-saver'; import { Octokit, type RestEndpointMethodTypes } from '@octokit/rest'; -import * as nodePath from 'node:path'; +import { path } from '~/utils/path'; import { extractRelativePath } from '~/utils/diff'; import { description } from '~/lib/persistence'; import Cookies from 'js-cookie'; import { createSampler } from '~/utils/sampler'; import type { ActionAlert } from '~/types/actions'; +const { saveAs } = fileSaver; + export interface ArtifactState { id: string; title: string; @@ -330,7 +331,7 @@ export class WorkbenchStore { if (data.action.type === 'file') { const wc = await webcontainer; - const fullPath = nodePath.join(wc.workdir, data.action.filePath); + const fullPath = path.join(wc.workdir, data.action.filePath); if (this.selectedFile.value !== fullPath) { this.setSelectedFile(fullPath); diff --git a/package.json b/package.json index d7dc2b5b..d8ed37e3 100644 --- a/package.json +++ b/package.json @@ -104,9 +104,7 @@ "js-cookie": "^3.0.5", "jspdf": "^2.5.2", "jszip": "^3.10.1", - "lucide-react": "^0.474.0", "nanostores": "^0.10.3", - "next-themes": "^0.4.4", "ollama-ai-provider": "^0.15.2", "path-browserify": "^1.0.1", "react": "^18.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2ee571c..fc491791 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -230,15 +230,9 @@ importers: jszip: specifier: ^3.10.1 version: 3.10.1 - lucide-react: - specifier: ^0.474.0 - version: 0.474.0(react@18.3.1) nanostores: specifier: ^0.10.3 version: 0.10.3 - next-themes: - specifier: ^0.4.4 - version: 0.4.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) ollama-ai-provider: specifier: ^0.15.2 version: 0.15.2(zod@3.24.1) @@ -4733,11 +4727,6 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} - lucide-react@0.474.0: - resolution: {integrity: sha512-CmghgHkh0OJNmxGKWc0qfPJCYHASPMVSyGY8fj3xgk4v84ItqDg64JNKFZn5hC6E0vHi6gxnbCgwhyVB09wQtA==} - peerDependencies: - react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 - lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true @@ -5196,12 +5185,6 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} - next-themes@0.4.4: - resolution: {integrity: sha512-LDQ2qIOJF0VnuVrrMSMLrWGjRMkq+0mpgl6e0juCLqdJ+oo8Q84JRWT6Wh11VDQKkMMe+dVzDKLWs5n87T+PkQ==} - peerDependencies: - react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -11982,10 +11965,6 @@ snapshots: lru-cache@7.18.3: {} - lucide-react@0.474.0(react@18.3.1): - dependencies: - react: 18.3.1 - lz-string@1.5.0: {} magic-string@0.25.9: @@ -12819,11 +12798,6 @@ snapshots: negotiator@0.6.3: {} - next-themes@0.4.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - node-domexception@1.0.0: {} node-fetch-native@1.6.6: {} diff --git a/vite.config.ts b/vite.config.ts index 59ac01cd..01fb3b2e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -89,7 +89,6 @@ export default defineConfig((config) => { __PKG_DEV_DEPENDENCIES: JSON.stringify(pkg.devDependencies), __PKG_PEER_DEPENDENCIES: JSON.stringify(pkg.peerDependencies), __PKG_OPTIONAL_DEPENDENCIES: JSON.stringify(pkg.optionalDependencies), - module: {}, }, build: { target: 'esnext',