-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2440 from IDEMSInternational/fix/generator-chaine…
…d-flows Fix: generator chained flows
- Loading branch information
Showing
16 changed files
with
277 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ cache | |
tasks | ||
config.json | ||
sheets/ | ||
!sheets/demo.xlsx | ||
!sheets/demo.xlsx | ||
reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/scripts/src/commands/app-data/convert/cacheStrategy/jsonFile.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { TimeLike } from "fs"; | ||
import { JsonFileCache } from "./jsonFile"; | ||
import type { IContentsEntry } from "shared"; | ||
|
||
interface IContentsEntryWithValue extends IContentsEntry { | ||
value?: any; | ||
} | ||
|
||
/** | ||
* Mock implementation of JsonFileCache that only uses in-memory caching | ||
* instead of persisting files to disk | ||
*/ | ||
export class MockJsonFileCache extends JsonFileCache { | ||
private mockContents: Record<string, IContentsEntryWithValue> = {}; | ||
|
||
constructor() { | ||
super("", 0); | ||
} | ||
|
||
public add(data: any, entryName?: string, stats?: { mtime: TimeLike }) { | ||
if (data) { | ||
if (!entryName) { | ||
entryName = this.generateCacheEntryName(data); | ||
} | ||
if (!this.mockContents[entryName]) { | ||
this.mockContents[entryName] = {} as any; | ||
} | ||
this.mockContents[entryName].value = data; | ||
return { filePath: entryName, entryName, data }; | ||
} | ||
} | ||
|
||
public clear() { | ||
this.mockContents = {}; | ||
} | ||
|
||
public remove(entryName: string) { | ||
if (this.mockContents.hasOwnProperty(entryName)) { | ||
delete this.mockContents[entryName]; | ||
} | ||
} | ||
|
||
public get<T = any>(entryName: string) { | ||
return this.mockContents[entryName] as T; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.