From 09d9e2aaf03aa3af031f1ecffc7e4ce472c5307c Mon Sep 17 00:00:00 2001 From: Tal Kol Date: Fri, 29 Apr 2022 19:13:35 +0100 Subject: [PATCH] Renamed lib directory to imports --- README.md | 2 +- build/build.ts | 4 ++-- contracts/{lib => imports}/stdlib.fc | 0 contracts/{lib => imports}/utils.fc | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename contracts/{lib => imports}/stdlib.fc (100%) rename contracts/{lib => imports}/utils.fc (100%) diff --git a/README.md b/README.md index 6d6b50d..bc648bd 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ To setup your machine for development, please make sure you have the following: * Develop * FunC contracts are located in `contracts/*.fc` * Standalone root contracts are located in `contracts/*.fc` - * Imported utility code (when breaking code to multiple files) in `contracts/lib/*.fc` + * Imported utility code (when breaking code to multiple files) in `contracts/imports/*.fc` * This structure assists with build and deployment and assumed by the included scripts * Tests are located in `test/*.spec.ts` diff --git a/build/build.ts b/build/build.ts index bd3936d..954c4e1 100644 --- a/build/build.ts +++ b/build/build.ts @@ -2,7 +2,7 @@ // It assumes that it is running from the repo root, and the directories are organized this way: // ./build/ - directory for build artifacts exists // ./contracts/*.fc - root contracts that are deployed separately are here -// ./contracts/lib/*.fc - utility code that should be imported as compilation dependency is here +// ./contracts/imports/*.fc - utility code that should be imported as compilation dependency is here import * as fs from "fs"; import * as path from "path"; @@ -43,7 +43,7 @@ for (const rootContract of rootContracts) { // create one string with all source code from all merged files let sourceToCompile = ""; - const importFiles = fg.sync(["contracts/lib/**/*.fc", "contracts/lib/**/*.func"]); + const importFiles = fg.sync(["contracts/imports/**/*.fc", "contracts/imports/**/*.func"]); for (const importFile of importFiles) { console.log(` - Adding import '${importFile}'`); sourceToCompile += `${fs.readFileSync(importFile).toString()}\n`; diff --git a/contracts/lib/stdlib.fc b/contracts/imports/stdlib.fc similarity index 100% rename from contracts/lib/stdlib.fc rename to contracts/imports/stdlib.fc diff --git a/contracts/lib/utils.fc b/contracts/imports/utils.fc similarity index 100% rename from contracts/lib/utils.fc rename to contracts/imports/utils.fc