forked from nowarp/misti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(idx): Generate unique idx for each element * chore(cli): Refactor * fix(dumpCfg): Options description * feat(imports): Initial version of imports graph Closes nowarp#60 * fix(changelog) * chore(changelog): Update * chore: Update expected outputs of `tactIR.spec.t` * feat(imports): Improve stdlib handling * fix(warnings): Path in warnings for multi-contracts configs * feat(dumpImports): Improve coloring
- Loading branch information
Showing
100 changed files
with
4,235 additions
and
3,216 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { unreachable } from "../internals/util"; | ||
import path from "path"; | ||
|
||
/** | ||
* Path to a Tact contract or configuration provided by the user. | ||
*/ | ||
export type MistiTactPath = | ||
| { | ||
kind: "config"; | ||
/** | ||
* Absolute path to the tact.config.json. | ||
*/ | ||
path: string; | ||
} | ||
| { | ||
kind: "contract"; | ||
/** | ||
* A path to a temporary configuration file generated internally in Misti (absolute). | ||
*/ | ||
tempConfigPath: string; | ||
/** | ||
* A path to the contract as it was specified by the user (absolute). | ||
*/ | ||
originalPath: string; | ||
}; | ||
|
||
/** | ||
* Returns path to a contract or configuration file as it is provided by the user. | ||
*/ | ||
export function getOriginalPath(path: MistiTactPath): string { | ||
switch (path.kind) { | ||
case "config": | ||
return path.path; | ||
case "contract": | ||
return path.originalPath; | ||
default: | ||
unreachable(path); | ||
} | ||
} | ||
|
||
/** | ||
* Returns an actual path to a configuration file used in Misti. | ||
*/ | ||
export function getActualPath(path: MistiTactPath): string { | ||
switch (path.kind) { | ||
case "config": | ||
return path.path; | ||
case "contract": | ||
return path.tempConfigPath; | ||
default: | ||
unreachable(path); | ||
} | ||
} | ||
|
||
/** | ||
* Returns an absolute path to an actual project directory used by Misti. | ||
*/ | ||
export function getProjectDirectory(tactPath: MistiTactPath): string { | ||
return path.dirname(getActualPath(tactPath)); | ||
} |
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.