Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbgt committed Nov 27, 2024
1 parent 9377ac5 commit 7c4c318
Show file tree
Hide file tree
Showing 10 changed files with 1,683 additions and 327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ export function deleteCollection(id: number) {
export function getRandomCollection(): Collection {
const randomIndex = Math.floor(Math.random() * collections.length)
return collections[randomIndex]
}
}

const def = [1]

export default def
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Injectable } from '@nestjs/common';
import { create, getAll, getByUserId, update, deleteCollection, getRandomCollection, CollectionPartial } from './collections.data';
import def, { create, getAll, getByUserId, update, deleteCollection, getRandomCollection, CollectionPartial } from './collections.data';
// import def from './collections.data';
import { Collection } from './collections.data';

console.log(def)
@Injectable()
export class CollectionsService {
createCollection(data: CollectionPartial): Collection {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/service/dagree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getNodeHeight(node: Node, isHorizontal: boolean) {
if (node.type === "groupNode") {
return 80;
} else if (node.type === "endpointNode") {
return 150;
return 200;
}

return 100;
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/helper/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export function removeIndexesFromSourceCode(
// sort to start removing from the of the file end
indexesToRemove.sort((a, b) => b.startIndex - a.startIndex);

// TODO improve this method by implementing merging of indexes to prevent accidental deletion of code

indexesToRemove.forEach(({ startIndex, endIndex }) => {
newSourceCode =
newSourceCode.slice(0, startIndex) + newSourceCode.slice(endIndex);
Expand Down
11 changes: 5 additions & 6 deletions packages/cli/src/languagesPlugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import JavascriptPlugin from "./javascript";
import PythonPlugin from "./python";
// import PythonPlugin from "./python";
import { LanguagePlugin } from "./types";
import TypescriptPlugin from "./typescript";

export function getLanguagePlugin(
entryPointPath: string,
Expand All @@ -11,11 +10,11 @@ export function getLanguagePlugin(

switch (ext) {
case "js":
return new JavascriptPlugin(entryPointPath);
return new JavascriptPlugin(entryPointPath, false);
case "ts":
return new TypescriptPlugin(entryPointPath);
case "py":
return new PythonPlugin(entryPointPath);
return new JavascriptPlugin(entryPointPath, true);
// case "py":
// return new PythonPlugin(entryPointPath);
default:
throw new Error(`Unsupported file type: ${ext}`);
}
Expand Down
Loading

0 comments on commit 7c4c318

Please sign in to comment.