From bb2d3f9527b3996126dfd3d78855686c4fd95cae Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Fri, 12 Mar 2021 17:38:11 +0500 Subject: [PATCH 1/5] FIX: set stdlib hack version to 0.1.0 --- src/controllers/solidity/components.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controllers/solidity/components.ts b/src/controllers/solidity/components.ts index 03cba21..fa9d4e6 100644 --- a/src/controllers/solidity/components.ts +++ b/src/controllers/solidity/components.ts @@ -9,6 +9,9 @@ function solidityHome() { return path.resolve(tondevHome(), "solidity"); } +//TODO: Remove this when stdlib will be under versioning. +const STDLIB_HACK_VERSION = "0.1.0"; + export const components = { compiler: new Component(solidityHome(), "solc", { executable: true, @@ -22,17 +25,17 @@ export const components = { stdlib: new class extends Component { // TODO: support versioning getSourceName(_version: string): string { - return `${this.name}.gz` ; + return `${this.name}.gz`; } // TODO: support versioning async getCurrentVersion(): Promise { - return fs.existsSync(this.path) ? "1.0.0" : ""; + return fs.existsSync(this.path) ? STDLIB_HACK_VERSION : ""; } // TODO: support versioning async loadAvailableVersions(): Promise { - return ["1.0.0"]; + return [STDLIB_HACK_VERSION]; } }(solidityHome(), "stdlib_sol", { targetName: "stdlib_sol.tvm", From f106d37bf920b65a07f9c9bb58eb2f1dfdd9eb95 Mon Sep 17 00:00:00 2001 From: ArtemZ Date: Fri, 12 Mar 2021 17:45:57 +0500 Subject: [PATCH 2/5] Set PATH --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index af242c0..ce7a707 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,8 @@ This command installs the latest tonos-cli ```shell tondev tonos-cli install ``` +The installer requires NPM to be installed, so it can install packages globally without using sudo. +In case of error, manually set environment variable `PATH=$PATH:$HOME./tondev/solidity` #### Version From a502776c0b74db0c07bad46c378abe5ff8291122 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Fri, 12 Mar 2021 17:55:29 +0500 Subject: [PATCH 3/5] FIX: set stdlib version to compiler's version --- src/controllers/solidity/components.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/controllers/solidity/components.ts b/src/controllers/solidity/components.ts index fa9d4e6..9e8223c 100644 --- a/src/controllers/solidity/components.ts +++ b/src/controllers/solidity/components.ts @@ -1,5 +1,5 @@ -import path from "path"; import fs from "fs"; +import path from "path"; import { Component, tondevHome, @@ -9,9 +9,6 @@ function solidityHome() { return path.resolve(tondevHome(), "solidity"); } -//TODO: Remove this when stdlib will be under versioning. -const STDLIB_HACK_VERSION = "0.1.0"; - export const components = { compiler: new Component(solidityHome(), "solc", { executable: true, @@ -23,19 +20,20 @@ export const components = { }), stdlib: new class extends Component { - // TODO: support versioning - getSourceName(_version: string): string { - return `${this.name}.gz`; + getSourceName(version: string): string { + return `${this.name}_${version.split(".").join("_")}.tvm.gz`; } - // TODO: support versioning async getCurrentVersion(): Promise { - return fs.existsSync(this.path) ? STDLIB_HACK_VERSION : ""; + if (fs.existsSync(this.path)) { + return components.compiler.getCurrentVersion(); + } else { + return ""; + } } - // TODO: support versioning async loadAvailableVersions(): Promise { - return [STDLIB_HACK_VERSION]; + return components.compiler.loadAvailableVersions(); } }(solidityHome(), "stdlib_sol", { targetName: "stdlib_sol.tvm", From 87b62b545bd0373961a657482e7df7bfe14a0b28 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Fri, 12 Mar 2021 17:57:24 +0500 Subject: [PATCH 4/5] FIX: set package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 652e76a..fb25ddb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tondev", - "version": "0.3.1", + "version": "0.3.2", "description": "TON Dev Environment", "main": "dist/index.js", "types": "dist/index.d.ts", From e28e9995e961c3fe44cad7bce4e4e37353680cdd Mon Sep 17 00:00:00 2001 From: Sergei Voronezhskii Date: Fri, 12 Mar 2021 17:30:50 +0300 Subject: [PATCH 5/5] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ea0c4..e07b224 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [0.3.2] - 2021-03-12 + +### Fixed +- Support versioning at solidity components + ## [0.3.0] - 2021-03-11 ### New