@ton/blueprint 0.19.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/build.js +5 -1
- package/dist/compile/compile.d.ts +2 -0
- package/dist/compile/compile.js +19 -4
- package/dist/network/send/TonConnectProvider.js +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.js +2 -1
- package/dist/templates/tact/common/wrappers/compile.ts.template +3 -0
- package/dist/templates/tact/counter/contracts/contract.tact.template +3 -0
- package/dist/templates/tact/empty/contracts/contract.tact.template +4 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.21.0] - 2024-05-27
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Changed `contract.tact.template` counter template to return remaining value from the message
|
|
13
|
+
- Updated TON Connect manifest
|
|
14
|
+
|
|
15
|
+
## [0.20.0] - 2024-05-07
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added auto-sourcing of root `tact.config.json` files for merging compilation options with `wrappers/*.compile.ts`
|
|
20
|
+
- Added a warning for disabling `debug` in contract wrappers of Tact before doing production deployments
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Changed `@tact-lang/compiler` dependency to be `^1.3.0` instead of `^1.2.0`
|
|
25
|
+
- Changed `compile.ts.template` template for Tact to have `debug` set to `true` by default
|
|
26
|
+
- Changed `contract.tact.template` empty template for Tact to mention implicit empty `init()` function
|
|
27
|
+
|
|
8
28
|
## [0.19.1] - 2024-04-12
|
|
9
29
|
|
|
10
30
|
### Fixed
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ npm create ton@latest
|
|
|
30
30
|
### Requirements
|
|
31
31
|
|
|
32
32
|
* [Node.js](https://nodejs.org) with a recent version like v18, verify version with `node -v`
|
|
33
|
-
* IDE with TypeScript and FunC support like [Visual Studio Code](https://code.visualstudio.com/) with the [FunC plugin](https://marketplace.visualstudio.com/items?itemName=tonwhales.func-vscode) or [IntelliJ
|
|
33
|
+
* IDE with TypeScript and FunC support like [Visual Studio Code](https://code.visualstudio.com/) with the [FunC plugin](https://marketplace.visualstudio.com/items?itemName=tonwhales.func-vscode) or [IntelliJ IDEA](https://www.jetbrains.com/idea/) with the [TON Development plugin](https://plugins.jetbrains.com/plugin/23382-ton)
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
package/dist/build.js
CHANGED
|
@@ -26,13 +26,17 @@ async function buildOne(contract, ui) {
|
|
|
26
26
|
});
|
|
27
27
|
await promises_1.default.writeFile(k, v);
|
|
28
28
|
}
|
|
29
|
+
if (result.options !== undefined && result.options?.debug === true) {
|
|
30
|
+
ui?.clearActionPrompt();
|
|
31
|
+
ui?.write('\n⚠️ Make sure to disable debug mode in contract wrappers before doing production deployments!');
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
const cell = result.code;
|
|
31
35
|
const rHash = cell.hash();
|
|
32
36
|
const res = {
|
|
33
37
|
hash: rHash.toString('hex'),
|
|
34
38
|
hashBase64: rHash.toString('base64'),
|
|
35
|
-
hex: cell.toBoc().toString('hex')
|
|
39
|
+
hex: cell.toBoc().toString('hex'),
|
|
36
40
|
};
|
|
37
41
|
ui?.clearActionPrompt();
|
|
38
42
|
ui?.write('\n✅ Compiled successfully! Cell BOC result:\n\n');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { SourcesArray } from '@ton-community/func-js';
|
|
3
3
|
import { Cell } from '@ton/core';
|
|
4
|
+
import { TactCompilerConfig } from './CompilerConfig';
|
|
4
5
|
export type FuncCompileResult = {
|
|
5
6
|
lang: 'func';
|
|
6
7
|
code: Cell;
|
|
@@ -12,6 +13,7 @@ export type TactCompileResult = {
|
|
|
12
13
|
lang: 'tact';
|
|
13
14
|
fs: Map<string, Buffer>;
|
|
14
15
|
code: Cell;
|
|
16
|
+
options?: TactCompilerConfig['options'];
|
|
15
17
|
};
|
|
16
18
|
export type CompileResult = TactCompileResult | FuncCompileResult;
|
|
17
19
|
export declare function doCompile(name: string, opts?: CompileOpts): Promise<CompileResult>;
|
package/dist/compile/compile.js
CHANGED
|
@@ -32,7 +32,7 @@ const fs_1 = require("fs");
|
|
|
32
32
|
const path_1 = __importDefault(require("path"));
|
|
33
33
|
const core_1 = require("@ton/core");
|
|
34
34
|
const paths_1 = require("../paths");
|
|
35
|
-
const
|
|
35
|
+
const Tact = __importStar(require("@tact-lang/compiler"));
|
|
36
36
|
const OverwritableVirtualFileSystem_1 = require("./OverwritableVirtualFileSystem");
|
|
37
37
|
async function getCompilerConfigForContract(name) {
|
|
38
38
|
var _a;
|
|
@@ -74,18 +74,32 @@ function findTactBoc(fs) {
|
|
|
74
74
|
}
|
|
75
75
|
return core_1.Cell.fromBoc(buf)[0];
|
|
76
76
|
}
|
|
77
|
+
function getRootTactConfigOptionsForContract(name) {
|
|
78
|
+
if (!(0, fs_1.existsSync)(paths_1.TACT_ROOT_CONFIG)) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const config = Tact.parseConfig((0, fs_1.readFileSync)(paths_1.TACT_ROOT_CONFIG).toString());
|
|
82
|
+
for (const project of config.projects) {
|
|
83
|
+
if (project.name === name) {
|
|
84
|
+
return project.options;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
77
89
|
async function doCompileTact(config, name) {
|
|
90
|
+
const rootConfigOptions = getRootTactConfigOptionsForContract(name);
|
|
78
91
|
const fs = new OverwritableVirtualFileSystem_1.OverwritableVirtualFileSystem(process.cwd());
|
|
79
|
-
const
|
|
92
|
+
const buildConfig = {
|
|
80
93
|
config: {
|
|
81
94
|
name: 'tact',
|
|
82
95
|
path: config.target,
|
|
83
96
|
output: path_1.default.join(paths_1.BUILD_DIR, name),
|
|
84
|
-
options: config.options,
|
|
97
|
+
options: { ...rootConfigOptions, ...config.options },
|
|
85
98
|
},
|
|
86
99
|
stdlib: '/stdlib',
|
|
87
100
|
project: fs,
|
|
88
|
-
}
|
|
101
|
+
};
|
|
102
|
+
const res = await Tact.build(buildConfig);
|
|
89
103
|
if (!res) {
|
|
90
104
|
throw new Error('Could not compile tact');
|
|
91
105
|
}
|
|
@@ -94,6 +108,7 @@ async function doCompileTact(config, name) {
|
|
|
94
108
|
lang: 'tact',
|
|
95
109
|
fs: fs.overwrites,
|
|
96
110
|
code,
|
|
111
|
+
options: buildConfig.config.options,
|
|
97
112
|
};
|
|
98
113
|
}
|
|
99
114
|
async function doCompileInner(name, config) {
|
|
@@ -44,7 +44,7 @@ class TonConnectProvider {
|
|
|
44
44
|
_TonConnectProvider_ui.set(this, void 0);
|
|
45
45
|
__classPrivateFieldSet(this, _TonConnectProvider_connector, new sdk_1.default({
|
|
46
46
|
storage: new TonConnectStorage(storage),
|
|
47
|
-
manifestUrl: 'https://raw.githubusercontent.com/ton-
|
|
47
|
+
manifestUrl: 'https://raw.githubusercontent.com/ton-org/blueprint/main/tonconnect/manifest.json',
|
|
48
48
|
}), "f");
|
|
49
49
|
__classPrivateFieldSet(this, _TonConnectProvider_ui, ui, "f");
|
|
50
50
|
}
|
package/dist/paths.d.ts
CHANGED
package/dist/paths.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TESTS_DIR = exports.CONTRACTS_DIR = exports.TEMP_DIR = exports.BUILD_DIR = exports.SCRIPTS_DIR = exports.WRAPPERS_DIR = exports.BUILD = exports.TEMP = exports.SCRIPTS = exports.WRAPPERS = exports.TESTS = exports.CONTRACTS = void 0;
|
|
6
|
+
exports.TACT_ROOT_CONFIG = exports.TESTS_DIR = exports.CONTRACTS_DIR = exports.TEMP_DIR = exports.BUILD_DIR = exports.SCRIPTS_DIR = exports.WRAPPERS_DIR = exports.BUILD = exports.TEMP = exports.SCRIPTS = exports.WRAPPERS = exports.TESTS = exports.CONTRACTS = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
exports.CONTRACTS = 'contracts';
|
|
9
9
|
exports.TESTS = 'tests';
|
|
@@ -17,3 +17,4 @@ exports.BUILD_DIR = path_1.default.join(process.cwd(), exports.BUILD);
|
|
|
17
17
|
exports.TEMP_DIR = path_1.default.join(process.cwd(), exports.TEMP);
|
|
18
18
|
exports.CONTRACTS_DIR = path_1.default.join(process.cwd(), exports.CONTRACTS);
|
|
19
19
|
exports.TESTS_DIR = path_1.default.join(process.cwd(), exports.TESTS);
|
|
20
|
+
exports.TACT_ROOT_CONFIG = path_1.default.join(process.cwd(), 'tact.config.json');
|
|
@@ -17,6 +17,9 @@ contract {{name}} with Deployable {
|
|
|
17
17
|
|
|
18
18
|
receive(msg: Add) {
|
|
19
19
|
self.counter += msg.amount;
|
|
20
|
+
|
|
21
|
+
// Notify the caller that the receiver was executed and forward remaining value back
|
|
22
|
+
self.notify("Cashback".asComment());
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
get fun counter(): Int {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/blueprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Framework for development of TON smart contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli/cli.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@orbs-network/ton-access": "^2.3.3",
|
|
38
|
-
"@tact-lang/compiler": "^1.
|
|
38
|
+
"@tact-lang/compiler": "^1.3.0",
|
|
39
39
|
"@ton-community/func-js": "^0.7.0",
|
|
40
40
|
"@tonconnect/sdk": "^2.2.0",
|
|
41
41
|
"arg": "^5.0.2",
|