mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
works!
This commit is contained in:
parent
799f6c2d16
commit
a974a5df69
3 changed files with 9 additions and 4 deletions
|
|
@ -1,8 +1,9 @@
|
|||
|
||||
import { Range } from 'vscode';
|
||||
import { diffLines, Change } from 'diff';
|
||||
import { Diff } from './registerInlineDiffs';
|
||||
|
||||
import { diffLines } from './react/out/util/diffLines.js'
|
||||
|
||||
type Fields =
|
||||
| 'type'
|
||||
| 'originalCode'
|
||||
|
|
@ -27,7 +28,7 @@ export type SuggestedEdit = {
|
|||
|
||||
export function findDiffs(oldStr: string, newStr: string) {
|
||||
// an ordered list of every original line, line added to the new file, and line removed from the old file (order is unambiguous, think about it)
|
||||
const lineByLineChanges: Change[] = diffLines(oldStr, newStr);
|
||||
const lineByLineChanges = diffLines(oldStr, newStr);
|
||||
lineByLineChanges.push({ value: '', added: false, removed: false }) // add a dummy so we flush any streaks we haven't yet at the very end (!line.added && !line.removed)
|
||||
|
||||
let oldFileLineNum: number = 0;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
import { diffLines, Change } from 'diff';
|
||||
|
||||
export { diffLines, Change }
|
||||
|
|
@ -5,6 +5,7 @@ export default defineConfig({
|
|||
'./src2/sidebar-tsx/Sidebar.tsx',
|
||||
'./src2/util/sendLLMMessage.tsx',
|
||||
'./src2/util/posthog.tsx',
|
||||
'./src2/util/diffLines.tsx',
|
||||
],
|
||||
outDir: './out',
|
||||
format: ['esm'],
|
||||
|
|
@ -14,10 +15,10 @@ export default defineConfig({
|
|||
clean: true,
|
||||
platform: 'browser',
|
||||
target: 'esnext',
|
||||
injectStyle: true, // bundle css into the output file
|
||||
// injectStyle: true, // bundle css into the output file
|
||||
outExtension: () => ({ js: '.js' }),
|
||||
// default behavior is to take local files and make them internal (bundle them) and take imports like 'react' and leave them external (don't bundle them), we want the opposite in many ways
|
||||
noExternal: [ // noExternal means we should take these things and make them not external (bundle them into the output file)
|
||||
noExternal: [ // noExternal means we should take these things and make them not external (bundle them into the output file) - anything that doesn't start with a "." needs to be force-flagged as not external
|
||||
/^(?!\.).*$/
|
||||
],
|
||||
external: [ // these imports should be kept external ../../../ are external (this is just an optimization so the output file doesn't re-implement functions)
|
||||
|
|
|
|||
Loading…
Reference in a new issue