@ton/blueprint 0.32.1 → 0.33.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/build.js +16 -10
  3. package/dist/cli/build.js +1 -2
  4. package/dist/cli/create.js +45 -15
  5. package/dist/compile/CompilerConfig.d.ts +6 -25
  6. package/dist/compile/CompilerConfig.js +4 -0
  7. package/dist/compile/SourceSnapshot.d.ts +4 -0
  8. package/dist/compile/SourceSnapshot.js +2 -0
  9. package/dist/compile/compile.d.ts +6 -30
  10. package/dist/compile/compile.js +47 -159
  11. package/dist/compile/func/compile.func.d.ts +14 -0
  12. package/dist/compile/func/compile.func.js +29 -0
  13. package/dist/compile/func/config.d.ts +11 -0
  14. package/dist/compile/func/config.js +2 -0
  15. package/dist/compile/tact/compile.tact.d.ts +13 -0
  16. package/dist/compile/tact/compile.tact.js +123 -0
  17. package/dist/compile/tact/config.d.ts +7 -0
  18. package/dist/compile/tact/config.js +2 -0
  19. package/dist/compile/tolk/compile.tolk.d.ts +13 -0
  20. package/dist/compile/tolk/compile.tolk.js +25 -0
  21. package/dist/compile/tolk/config.d.ts +8 -0
  22. package/dist/compile/tolk/config.js +2 -0
  23. package/dist/config/tact.config.d.ts +5 -0
  24. package/dist/config/tact.config.js +21 -0
  25. package/dist/index.d.ts +2 -1
  26. package/dist/templates/tact/counter/scripts/deploy.ts.template +1 -1
  27. package/dist/templates/tact/counter/tests/spec.ts.template +1 -1
  28. package/dist/templates/tact/empty/tests/spec.ts.template +1 -1
  29. package/dist/templates/tolk/common/compilables/compile.ts.template +1 -0
  30. package/dist/templates/tolk/counter/contracts/contract.tolk.template +4 -4
  31. package/dist/templates/tolk/not-separated-common/wrappers/compile.ts.template +1 -0
  32. package/dist/utils/object.utils.d.ts +1 -0
  33. package/dist/utils/object.utils.js +4 -0
  34. package/dist/utils/selection.utils.d.ts +1 -0
  35. package/dist/utils/selection.utils.js +14 -3
  36. package/package.json +3 -3
  37. package/dist/templates/tact/common/compilables/compile.ts.template +0 -10
  38. package/dist/templates/tact/common/wrappers/wrapper.ts.template +0 -2
  39. package/dist/templates/tact/not-separated-common/wrappers/compile.ts.template +0 -10
  40. package/dist/templates/tact/not-separated-common/wrappers/wrapper.ts.template +0 -2
  41. /package/dist/compile/{OverwritableVirtualFileSystem.d.ts → tact/OverwritableVirtualFileSystem.d.ts} +0 -0
  42. /package/dist/compile/{OverwritableVirtualFileSystem.js → tact/OverwritableVirtualFileSystem.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ 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.33.0] - 2025-05-16
9
+
10
+ ### Added
11
+
12
+ - Added `tact.config.json` support
13
+ - Added tolk v0.12 support
14
+
15
+ ### Fixed
16
+
17
+ - Fixed tact counter deploy script error
18
+
8
19
  ## [0.32.1] - 2025-05-06
9
20
 
10
21
  ### Fixed
package/dist/build.js CHANGED
@@ -11,6 +11,7 @@ const promises_1 = __importDefault(require("fs/promises"));
11
11
  const compile_1 = require("./compile/compile");
12
12
  const paths_1 = require("./paths");
13
13
  const utils_1 = require("./utils");
14
+ const tact_config_1 = require("./config/tact.config");
14
15
  async function buildOne(contract, ui) {
15
16
  ui?.write(`Build script running, compiling ${contract}`);
16
17
  const buildArtifactPath = path_1.default.join(paths_1.BUILD_DIR, `${contract}.compiled.json`);
@@ -69,17 +70,22 @@ async function buildOne(contract, ui) {
69
70
  }
70
71
  }
71
72
  }
72
- async function buildAll(ui) {
73
- for (const file of await (0, utils_1.findCompiles)()) {
74
- await buildOne(file.name, ui);
73
+ async function buildContracts(contracts, ui) {
74
+ for (const contract of contracts) {
75
+ await buildOne(contract, ui);
75
76
  }
76
77
  }
78
+ async function buildAll(ui) {
79
+ await buildContracts(await (0, utils_1.findContracts)(), ui);
80
+ }
77
81
  async function buildAllTact(ui) {
78
- // TODO: when tact config introduced rewrite to use it
79
- for (const file of await (0, utils_1.findCompiles)()) {
80
- const config = (0, compile_1.extractCompileConfig)(file.path);
81
- if (config.lang === 'tact') {
82
- await buildOne(file.name, ui);
83
- }
84
- }
82
+ const legacyTactContract = (await (0, utils_1.findCompiles)())
83
+ .filter((file) => (0, compile_1.extractCompilableConfig)(file.path).lang === 'tact')
84
+ .map((file) => file.name);
85
+ const tactConfig = (0, tact_config_1.getRootTactConfig)();
86
+ const tactContracts = [
87
+ ...legacyTactContract,
88
+ ...tactConfig.projects.map((project) => project.name),
89
+ ];
90
+ await buildContracts(tactContracts, ui);
85
91
  }
package/dist/cli/build.js CHANGED
@@ -14,8 +14,7 @@ function extractBuildFile(args) {
14
14
  return args._.length > 1 && args._[1].length > 0 ? args._[1] : undefined;
15
15
  }
16
16
  async function selectContract(ui, hint, withAllOption = false) {
17
- const compiles = await (0, utils_1.findCompiles)();
18
- const contracts = compiles.map(compile => compile.name);
17
+ const contracts = await (0, utils_1.findContracts)();
19
18
  const options = contracts.map((contract) => ({ name: contract, value: contract }));
20
19
  const allContractsValue = 'all_contracts';
21
20
  if (withAllOption) {
@@ -4,14 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.create = void 0;
7
- const Runner_1 = require("./Runner");
8
- const promises_1 = require("fs/promises");
9
7
  const path_1 = __importDefault(require("path"));
10
- const template_1 = require("../template");
11
- const utils_1 = require("../utils");
8
+ const promises_1 = require("fs/promises");
12
9
  const arg_1 = __importDefault(require("arg"));
10
+ const utils_1 = require("../config/utils");
11
+ const tact_config_1 = require("../config/tact.config");
12
+ const Runner_1 = require("./Runner");
13
+ const template_1 = require("../template");
14
+ const utils_2 = require("../utils");
13
15
  const build_1 = require("../build");
14
- const utils_2 = require("../config/utils");
15
16
  const constants_1 = require("./constants");
16
17
  function toSnakeCase(v) {
17
18
  const r = v.replace(/[A-Z]/g, (sub) => '_' + sub.toLowerCase());
@@ -48,6 +49,31 @@ async function createFiles(templatePath, realPath, replaces) {
48
49
  }
49
50
  }
50
51
  }
52
+ function getFileExtension(lang) {
53
+ if (lang === 'func')
54
+ return 'fc';
55
+ if (lang === 'tolk')
56
+ return 'tolk';
57
+ return 'tact';
58
+ }
59
+ function addToTactConfig(contractName, contractPath) {
60
+ const tactConfig = (0, tact_config_1.getRootTactConfig)();
61
+ const projectConfig = {
62
+ name: contractName,
63
+ path: contractPath,
64
+ output: path_1.default.join('build', contractName),
65
+ options: {
66
+ debug: false,
67
+ external: false,
68
+ },
69
+ mode: 'full',
70
+ };
71
+ const newConfig = {
72
+ ...tactConfig,
73
+ projects: [...tactConfig.projects, projectConfig],
74
+ };
75
+ (0, tact_config_1.updateRootTactConfig)(newConfig);
76
+ }
51
77
  const create = async (args, ui) => {
52
78
  const localArgs = (0, arg_1.default)({
53
79
  '--type': String,
@@ -57,35 +83,39 @@ const create = async (args, ui) => {
57
83
  ui.write(constants_1.helpMessages['create']);
58
84
  return;
59
85
  }
60
- const name = (0, Runner_1.extractFirstArg)(localArgs)
61
- ?? await ui.input('Contract name (PascalCase)');
86
+ const name = (0, Runner_1.extractFirstArg)(localArgs) ?? (await ui.input('Contract name (PascalCase)'));
62
87
  if (name.length === 0)
63
88
  throw new Error(`Cannot create a contract with an empty name`);
64
89
  if (name.toLowerCase() === 'contract') {
65
90
  throw new Error(`Cannot create a contract with the reserved name 'contract'. Please choose a different name.`);
66
91
  }
67
- if (!(0, utils_1.isPascalCase)(name)) {
68
- throw new Error(`Contract name '${name}' is not in PascalCase. Please try ${(0, utils_1.toPascalCase)(name)}.`);
92
+ if (!(0, utils_2.isPascalCase)(name)) {
93
+ throw new Error(`Contract name '${name}' is not in PascalCase. Please try ${(0, utils_2.toPascalCase)(name)}.`);
69
94
  }
70
- const which = (await (0, utils_1.selectOption)(constants_1.templateTypes, {
95
+ const which = (await (0, utils_2.selectOption)(constants_1.templateTypes, {
71
96
  ui,
72
97
  msg: 'What type of contract do you want to create?',
73
98
  hint: localArgs['--type'],
74
99
  })).value;
75
100
  const [lang, template] = which.split('-');
76
101
  const snakeName = toSnakeCase(name);
102
+ const contractPath = path_1.default.join('contracts', snakeName + '.' + getFileExtension(lang));
77
103
  const replaces = {
78
104
  name,
79
105
  loweredName: name.substring(0, 1).toLowerCase() + name.substring(1),
80
106
  snakeName,
81
- contractPath: 'contracts/' + snakeName + '.' + (lang === 'func' ? 'fc' : (lang === 'tolk' ? 'tolk' : 'tact')),
107
+ contractPath,
82
108
  };
83
- const config = await (0, utils_2.getConfig)();
84
- const commonPath = config?.separateCompilables ? 'common' : 'not-separated-common';
85
- await createFiles(path_1.default.join(template_1.TEMPLATES_DIR, lang, commonPath), process.cwd(), replaces);
86
- await createFiles(path_1.default.join(template_1.TEMPLATES_DIR, lang, template), process.cwd(), replaces);
109
+ const config = await (0, utils_1.getConfig)();
87
110
  if (lang === 'tact') {
111
+ await createFiles(path_1.default.join(template_1.TEMPLATES_DIR, lang, template), process.cwd(), replaces);
112
+ addToTactConfig(name, contractPath);
88
113
  await (0, build_1.buildOne)(name, ui);
89
114
  }
115
+ else {
116
+ const commonPath = config?.separateCompilables ? 'common' : 'not-separated-common';
117
+ await createFiles(path_1.default.join(template_1.TEMPLATES_DIR, lang, commonPath), process.cwd(), replaces);
118
+ await createFiles(path_1.default.join(template_1.TEMPLATES_DIR, lang, template), process.cwd(), replaces);
119
+ }
90
120
  };
91
121
  exports.create = create;
@@ -1,6 +1,7 @@
1
- import { SourceResolver, SourcesMap, SourcesArray } from '@ton-community/func-js';
2
1
  import { Cell } from '@ton/core';
3
- import { Options } from '@tact-lang/compiler';
2
+ import { TolkCompilerConfig } from './tolk/config';
3
+ import { FuncCompilerConfig } from './func/config';
4
+ import { TactCompilerConfig, TactLegacyCompilerConfig } from './tact/config';
4
5
  export type HookParams = {
5
6
  userData?: any;
6
7
  };
@@ -33,26 +34,6 @@ export type CommonCompilerConfig = {
33
34
  */
34
35
  postCompileHook?: (code: Cell, params: HookParams) => Promise<void>;
35
36
  };
36
- export type TactCompilerConfig = {
37
- lang: 'tact';
38
- target: string;
39
- options?: Options;
40
- };
41
- export type FuncCompilerConfig = {
42
- lang?: 'func';
43
- optLevel?: number;
44
- } & ({
45
- targets: string[];
46
- sources?: SourceResolver | SourcesMap;
47
- } | {
48
- targets?: string[];
49
- sources: SourcesArray;
50
- });
51
- export type TolkCompilerConfig = {
52
- lang: 'tolk';
53
- entrypoint: string;
54
- optimizationLevel?: number;
55
- withStackComments?: boolean;
56
- experimentalOptions?: string;
57
- };
58
- export type CompilerConfig = (TactCompilerConfig | FuncCompilerConfig | TolkCompilerConfig) & CommonCompilerConfig;
37
+ export type CompilableConfig = (TactLegacyCompilerConfig | FuncCompilerConfig | TolkCompilerConfig) & CommonCompilerConfig;
38
+ export type CompilerConfig = TactCompilerConfig | CompilableConfig;
39
+ export declare function isCompilableConfig(config: CompilerConfig): config is CompilableConfig;
@@ -1,2 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCompilableConfig = isCompilableConfig;
4
+ function isCompilableConfig(config) {
5
+ return 'lang' in config;
6
+ }
@@ -0,0 +1,4 @@
1
+ export type SourceSnapshot = {
2
+ filename: string;
3
+ content: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,37 +1,12 @@
1
1
  import { Cell } from '@ton/core';
2
- import { CompilerConfig, TactCompilerConfig } from './CompilerConfig';
2
+ import { CompilableConfig, CompilerConfig } from './CompilerConfig';
3
+ import { FuncCompileResult } from './func/compile.func';
4
+ import { TactCompileResult } from './tact/compile.tact';
5
+ import { TolkCompileResult } from './tolk/compile.tolk';
3
6
  export declare function getCompilablesDirectory(): Promise<string>;
7
+ export declare function extractCompilableConfig(path: string): CompilableConfig;
4
8
  export declare const COMPILE_END = ".compile.ts";
5
- export declare function extractCompileConfig(path: string): CompilerConfig;
6
9
  export declare function getCompilerConfigForContract(name: string): Promise<CompilerConfig>;
7
- export type SourceSnapshot = {
8
- filename: string;
9
- content: string;
10
- };
11
- export type TolkCompileResult = {
12
- lang: 'tolk';
13
- stderr: string;
14
- fiftCode: string;
15
- code: Cell;
16
- snapshot: SourceSnapshot[];
17
- version: string;
18
- };
19
- export type FuncCompileResult = {
20
- lang: 'func';
21
- fiftCode: string;
22
- code: Cell;
23
- targets: string[];
24
- snapshot: SourceSnapshot[];
25
- version: string;
26
- };
27
- export type TactCompileResult = {
28
- lang: 'tact';
29
- fs: Map<string, Buffer>;
30
- code: Cell;
31
- options?: TactCompilerConfig['options'];
32
- version: string;
33
- };
34
- export declare function getTactVersion(): Promise<any>;
35
10
  export type CompileResult = TactCompileResult | FuncCompileResult | TolkCompileResult;
36
11
  export declare function getCompilerOptions(config: CompilerConfig): Promise<{
37
12
  lang: 'tact' | 'tolk' | 'func';
@@ -71,3 +46,4 @@ export type CompileOpts = {
71
46
  * main();
72
47
  */
73
48
  export declare function compile(name: string, opts?: CompileOpts): Promise<Cell>;
49
+ export type { TactCompileResult, TolkCompileResult, FuncCompileResult };
@@ -1,58 +1,23 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.COMPILE_END = void 0;
40
7
  exports.getCompilablesDirectory = getCompilablesDirectory;
41
- exports.extractCompileConfig = extractCompileConfig;
8
+ exports.extractCompilableConfig = extractCompilableConfig;
42
9
  exports.getCompilerConfigForContract = getCompilerConfigForContract;
43
- exports.getTactVersion = getTactVersion;
44
10
  exports.getCompilerOptions = getCompilerOptions;
45
11
  exports.doCompile = doCompile;
46
12
  exports.compile = compile;
47
- const func_js_1 = require("@ton-community/func-js");
48
13
  const fs_1 = require("fs");
49
14
  const path_1 = __importDefault(require("path"));
50
- const core_1 = require("@ton/core");
51
15
  const paths_1 = require("../paths");
52
- const Tact = __importStar(require("@tact-lang/compiler"));
53
- const OverwritableVirtualFileSystem_1 = require("./OverwritableVirtualFileSystem");
16
+ const CompilerConfig_1 = require("./CompilerConfig");
54
17
  const utils_1 = require("../config/utils");
55
- const tolk_js_1 = require("@ton/tolk-js");
18
+ const compile_func_1 = require("./func/compile.func");
19
+ const compile_tact_1 = require("./tact/compile.tact");
20
+ const compile_tolk_1 = require("./tolk/compile.tolk");
56
21
  async function getCompilablesDirectory() {
57
22
  const config = await (0, utils_1.getConfig)();
58
23
  if (config?.separateCompilables) {
@@ -60,141 +25,64 @@ async function getCompilablesDirectory() {
60
25
  }
61
26
  return paths_1.WRAPPERS_DIR;
62
27
  }
63
- exports.COMPILE_END = '.compile.ts';
64
- function extractCompileConfig(path) {
28
+ function extractCompilableConfig(path) {
65
29
  const mod = require(path);
66
30
  if (typeof mod.compile !== 'object') {
67
31
  throw new Error(`Object 'compile' is missing`);
68
32
  }
33
+ mod.compile.lang ??= 'func';
69
34
  return mod.compile;
70
35
  }
36
+ exports.COMPILE_END = '.compile.ts';
37
+ // contracts in tact.config.json and .compile.ts may overlap. In this case configuration from tact.config.json would be taken
71
38
  async function getCompilerConfigForContract(name) {
72
- const compilablesDirectory = await getCompilablesDirectory();
73
- return extractCompileConfig(path_1.default.join(compilablesDirectory, name + exports.COMPILE_END));
74
- }
75
- async function doCompileTolk(config) {
76
- const res = await (0, tolk_js_1.runTolkCompiler)(config);
77
- if (res.status === 'error') {
78
- throw new Error(res.message);
39
+ const tactConfig = (0, compile_tact_1.getTactConfigForContract)(name);
40
+ if (tactConfig) {
41
+ return tactConfig;
79
42
  }
80
- return {
81
- lang: 'tolk',
82
- stderr: res.stderr,
83
- fiftCode: res.fiftCode,
84
- code: core_1.Cell.fromBase64(res.codeBoc64),
85
- snapshot: res.sourcesSnapshot.map((e) => ({
86
- filename: e.filename,
87
- content: e.contents,
88
- })),
89
- version: await (0, tolk_js_1.getTolkCompilerVersion)(),
90
- };
91
- }
92
- async function doCompileFunc(config) {
93
- const cr = await (0, func_js_1.compileFunc)(config);
94
- if (cr.status === 'error')
95
- throw new Error(cr.message);
96
- let targets = [];
97
- if (config.targets) {
98
- targets = config.targets;
99
- }
100
- else if (Array.isArray(config.sources)) {
101
- targets = config.sources.map((s) => s.filename);
102
- }
103
- return {
104
- lang: 'func',
105
- fiftCode: cr.fiftCode,
106
- code: core_1.Cell.fromBase64(cr.codeBoc),
107
- targets,
108
- snapshot: cr.snapshot,
109
- version: (await (0, func_js_1.compilerVersion)()).funcVersion,
110
- };
43
+ const compilablesDirectory = await getCompilablesDirectory();
44
+ return extractCompilableConfig(path_1.default.join(compilablesDirectory, name + exports.COMPILE_END));
111
45
  }
112
- function findTactBoc(fs) {
113
- let buf = undefined;
114
- for (const [k, v] of fs) {
115
- if (k.endsWith('.code.boc')) {
116
- buf = v;
117
- break;
46
+ async function doCompileInner(name, config) {
47
+ if ((0, CompilerConfig_1.isCompilableConfig)(config)) {
48
+ if (config.lang === 'tact') {
49
+ return await (0, compile_tact_1.doCompileTact)(config, name);
118
50
  }
119
- }
120
- if (buf === undefined) {
121
- throw new Error('Could not find boc in tact compilation result');
122
- }
123
- return core_1.Cell.fromBoc(buf)[0];
124
- }
125
- function getRootTactConfigOptionsForContract(name) {
126
- if (!(0, fs_1.existsSync)(paths_1.TACT_ROOT_CONFIG)) {
127
- return undefined;
128
- }
129
- const config = Tact.parseConfig((0, fs_1.readFileSync)(paths_1.TACT_ROOT_CONFIG).toString());
130
- for (const project of config.projects) {
131
- if (project.name === name) {
132
- return project.options;
51
+ if (config.lang === 'tolk') {
52
+ return await (0, compile_tolk_1.doCompileTolk)({
53
+ entrypointFileName: config.entrypoint,
54
+ fsReadCallback: (path) => (0, fs_1.readFileSync)(path).toString(),
55
+ optimizationLevel: config.optimizationLevel,
56
+ withStackComments: config.withStackComments,
57
+ withSrcLineComments: config.withSrcLineComments,
58
+ experimentalOptions: config.experimentalOptions,
59
+ });
133
60
  }
134
- }
135
- return undefined;
136
- }
137
- async function getTactVersion() {
138
- const packageJsonPath = require.resolve('@tact-lang/compiler/package.json');
139
- const { version } = await Promise.resolve(`${packageJsonPath}`).then(s => __importStar(require(s)));
140
- return version;
141
- }
142
- async function doCompileTact(config, name) {
143
- const rootConfigOptions = getRootTactConfigOptionsForContract(name);
144
- const fs = new OverwritableVirtualFileSystem_1.OverwritableVirtualFileSystem(process.cwd());
145
- const buildConfig = {
146
- config: {
147
- name: 'tact',
148
- path: config.target,
149
- output: path_1.default.join(paths_1.BUILD_DIR, name),
150
- options: { ...rootConfigOptions, ...config.options },
151
- },
152
- stdlib: Tact.createVirtualFileSystem("@stdlib", Tact.stdLibFiles),
153
- project: fs,
154
- };
155
- const res = await Tact.build(buildConfig);
156
- if (!res.ok) {
157
- throw new Error('Could not compile tact');
158
- }
159
- const code = findTactBoc(fs.overwrites);
160
- return {
161
- lang: 'tact',
162
- fs: fs.overwrites,
163
- code,
164
- options: buildConfig.config.options,
165
- version: await getTactVersion(),
166
- };
167
- }
168
- async function doCompileInner(name, config) {
169
- if (config.lang === 'tact') {
170
- return await doCompileTact(config, name);
171
- }
172
- if (config.lang === 'tolk') {
173
- return await doCompileTolk({
174
- entrypointFileName: config.entrypoint,
175
- fsReadCallback: (path) => (0, fs_1.readFileSync)(path).toString(),
176
- optimizationLevel: config.optimizationLevel,
177
- withStackComments: config.withStackComments,
178
- experimentalOptions: config.experimentalOptions,
61
+ return await (0, compile_func_1.doCompileFunc)({
62
+ targets: config.targets,
63
+ sources: config.sources ?? ((path) => (0, fs_1.readFileSync)(path).toString()),
64
+ optLevel: config.optLevel,
179
65
  });
180
66
  }
181
- return await doCompileFunc({
182
- targets: config.targets,
183
- sources: config.sources ?? ((path) => (0, fs_1.readFileSync)(path).toString()),
184
- optLevel: config.optLevel,
185
- });
67
+ return await (0, compile_tact_1.doCompileTact)(config, name);
186
68
  }
187
69
  function getCompilerName(config) {
188
- return config.lang ?? 'func';
70
+ if ((0, CompilerConfig_1.isCompilableConfig)(config)) {
71
+ return config.lang ?? 'func';
72
+ }
73
+ return 'tact';
189
74
  }
190
75
  async function getCompilerVersion(config) {
191
- if (config.lang === 'tact') {
192
- return getTactVersion();
193
- }
194
- if (config.lang === 'tolk') {
195
- return (0, tolk_js_1.getTolkCompilerVersion)();
76
+ if ((0, CompilerConfig_1.isCompilableConfig)(config)) {
77
+ if (config.lang === 'tact') {
78
+ return (0, compile_tact_1.getTactVersion)();
79
+ }
80
+ if (config.lang === 'tolk') {
81
+ return (0, compile_tolk_1.getTolkVersion)();
82
+ }
83
+ return (0, compile_func_1.getFuncVersion)();
196
84
  }
197
- return (await (0, func_js_1.compilerVersion)()).funcVersion;
85
+ return (0, compile_tact_1.getTactVersion)();
198
86
  }
199
87
  async function getCompilerOptions(config) {
200
88
  return {
@@ -204,13 +92,13 @@ async function getCompilerOptions(config) {
204
92
  }
205
93
  async function doCompile(name, opts) {
206
94
  const config = await getCompilerConfigForContract(name);
207
- if (config.preCompileHook !== undefined) {
95
+ if ('preCompileHook' in config && config.preCompileHook !== undefined) {
208
96
  await config.preCompileHook({
209
97
  userData: opts?.hookUserData,
210
98
  });
211
99
  }
212
100
  const res = await doCompileInner(name, config);
213
- if (config.postCompileHook !== undefined) {
101
+ if ('postCompileHook' in config && config.postCompileHook !== undefined) {
214
102
  await config.postCompileHook(res.code, {
215
103
  userData: opts?.hookUserData,
216
104
  });
@@ -0,0 +1,14 @@
1
+ import { Cell } from '@ton/core';
2
+ import { CompilerConfig } from '@ton-community/func-js';
3
+ import { SourceSnapshot } from '../SourceSnapshot';
4
+ export type FuncCompileResult = {
5
+ lang: 'func';
6
+ fiftCode: string;
7
+ code: Cell;
8
+ targets: string[];
9
+ snapshot: SourceSnapshot[];
10
+ version: string;
11
+ };
12
+ export declare function getFuncVersion(): Promise<string>;
13
+ export declare function doCompileFunc(config: CompilerConfig): Promise<FuncCompileResult>;
14
+ export { CompilerConfig as DoCompileFuncConfig } from '@ton-community/func-js';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFuncVersion = getFuncVersion;
4
+ exports.doCompileFunc = doCompileFunc;
5
+ const core_1 = require("@ton/core");
6
+ const func_js_1 = require("@ton-community/func-js");
7
+ async function getFuncVersion() {
8
+ return (await (0, func_js_1.compilerVersion)()).funcVersion;
9
+ }
10
+ async function doCompileFunc(config) {
11
+ const cr = await (0, func_js_1.compileFunc)(config);
12
+ if (cr.status === 'error')
13
+ throw new Error(cr.message);
14
+ let targets = [];
15
+ if (config.targets) {
16
+ targets = config.targets;
17
+ }
18
+ else if (Array.isArray(config.sources)) {
19
+ targets = config.sources.map((s) => s.filename);
20
+ }
21
+ return {
22
+ lang: 'func',
23
+ fiftCode: cr.fiftCode,
24
+ code: core_1.Cell.fromBase64(cr.codeBoc),
25
+ targets,
26
+ snapshot: cr.snapshot,
27
+ version: await getFuncVersion(),
28
+ };
29
+ }
@@ -0,0 +1,11 @@
1
+ import { SourceResolver, SourcesArray, SourcesMap } from '@ton-community/func-js';
2
+ export type FuncCompilerConfig = {
3
+ lang?: 'func';
4
+ optLevel?: number;
5
+ } & ({
6
+ targets: string[];
7
+ sources?: SourceResolver | SourcesMap;
8
+ } | {
9
+ targets?: string[];
10
+ sources: SourcesArray;
11
+ });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { Options } from '@tact-lang/compiler';
2
+ import { Cell } from '@ton/core';
3
+ import { TactCompilerConfig, TactLegacyCompilerConfig } from './config';
4
+ export type TactCompileResult = {
5
+ lang: 'tact';
6
+ fs: Map<string, Buffer>;
7
+ code: Cell;
8
+ options?: Options;
9
+ version: string;
10
+ };
11
+ export declare function getTactConfigForContract(name: string): TactCompilerConfig | undefined;
12
+ export declare function getTactVersion(): Promise<any>;
13
+ export declare function doCompileTact(config: TactLegacyCompilerConfig | TactCompilerConfig, name: string): Promise<TactCompileResult>;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getTactConfigForContract = getTactConfigForContract;
40
+ exports.getTactVersion = getTactVersion;
41
+ exports.doCompileTact = doCompileTact;
42
+ const path_1 = __importDefault(require("path"));
43
+ const compiler_1 = require("@tact-lang/compiler");
44
+ const core_1 = require("@ton/core");
45
+ const paths_1 = require("../../paths");
46
+ const OverwritableVirtualFileSystem_1 = require("./OverwritableVirtualFileSystem");
47
+ const tact_config_1 = require("../../config/tact.config");
48
+ function findTactBoc(fs) {
49
+ let buf = undefined;
50
+ for (const [k, v] of fs) {
51
+ if (k.endsWith('.code.boc')) {
52
+ buf = v;
53
+ break;
54
+ }
55
+ }
56
+ if (buf === undefined) {
57
+ throw new Error('Could not find boc in tact compilation result');
58
+ }
59
+ return core_1.Cell.fromBoc(buf)[0];
60
+ }
61
+ function getTactConfigForContract(name) {
62
+ const config = (0, tact_config_1.getRootTactConfig)();
63
+ const projects = config.projects.filter((project) => project.name === name);
64
+ if (!projects.length) {
65
+ return;
66
+ }
67
+ return {
68
+ ...config,
69
+ projects,
70
+ };
71
+ }
72
+ function getRootTactConfigOptionsForContract(name) {
73
+ const filteredTactConfig = getTactConfigForContract(name);
74
+ if (!filteredTactConfig) {
75
+ return;
76
+ }
77
+ const [project] = filteredTactConfig.projects;
78
+ return project?.options;
79
+ }
80
+ async function getTactVersion() {
81
+ const packageJsonPath = require.resolve('@tact-lang/compiler/package.json');
82
+ const { version } = await Promise.resolve(`${packageJsonPath}`).then(s => __importStar(require(s)));
83
+ return version;
84
+ }
85
+ function isLegacyTactConfig(config) {
86
+ return 'lang' in config;
87
+ }
88
+ function getTactBuildProject(config, name) {
89
+ if (isLegacyTactConfig(config)) {
90
+ const rootConfigOptions = getRootTactConfigOptionsForContract(name);
91
+ return {
92
+ name: 'tact',
93
+ path: config.target,
94
+ output: path_1.default.join(paths_1.BUILD_DIR, name),
95
+ options: { ...rootConfigOptions, ...config.options },
96
+ };
97
+ }
98
+ const project = config.projects.find((p) => p.name === name);
99
+ if (!project) {
100
+ throw new Error(`Config for project ${name} not found`);
101
+ }
102
+ return project;
103
+ }
104
+ async function doCompileTact(config, name) {
105
+ const fs = new OverwritableVirtualFileSystem_1.OverwritableVirtualFileSystem(process.cwd());
106
+ const buildConfig = {
107
+ config: getTactBuildProject(config, name),
108
+ stdlib: (0, compiler_1.createVirtualFileSystem)('@stdlib', compiler_1.stdLibFiles),
109
+ project: fs,
110
+ };
111
+ const res = await (0, compiler_1.build)(buildConfig);
112
+ if (!res.ok) {
113
+ throw new Error('Could not compile tact');
114
+ }
115
+ const code = findTactBoc(fs.overwrites);
116
+ return {
117
+ lang: 'tact',
118
+ fs: fs.overwrites,
119
+ code,
120
+ options: buildConfig.config.options,
121
+ version: await getTactVersion(),
122
+ };
123
+ }
@@ -0,0 +1,7 @@
1
+ import { Config, Options } from '@tact-lang/compiler';
2
+ export type TactLegacyCompilerConfig = {
3
+ lang: 'tact';
4
+ target: string;
5
+ options?: Options;
6
+ };
7
+ export type TactCompilerConfig = Config;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { Cell } from '@ton/core';
2
+ import { TolkCompilerConfig } from '@ton/tolk-js';
3
+ import { SourceSnapshot } from '../SourceSnapshot';
4
+ export type TolkCompileResult = {
5
+ lang: 'tolk';
6
+ stderr: string;
7
+ fiftCode: string;
8
+ code: Cell;
9
+ snapshot: SourceSnapshot[];
10
+ version: string;
11
+ };
12
+ export declare function doCompileTolk(config: TolkCompilerConfig): Promise<TolkCompileResult>;
13
+ export { getTolkCompilerVersion as getTolkVersion } from '@ton/tolk-js';
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTolkVersion = void 0;
4
+ exports.doCompileTolk = doCompileTolk;
5
+ const core_1 = require("@ton/core");
6
+ const tolk_js_1 = require("@ton/tolk-js");
7
+ async function doCompileTolk(config) {
8
+ const res = await (0, tolk_js_1.runTolkCompiler)(config);
9
+ if (res.status === 'error') {
10
+ throw new Error(res.message);
11
+ }
12
+ return {
13
+ lang: 'tolk',
14
+ stderr: res.stderr,
15
+ fiftCode: res.fiftCode,
16
+ code: core_1.Cell.fromBase64(res.codeBoc64),
17
+ snapshot: res.sourcesSnapshot.map((e) => ({
18
+ filename: e.filename,
19
+ content: e.contents,
20
+ })),
21
+ version: await (0, tolk_js_1.getTolkCompilerVersion)(),
22
+ };
23
+ }
24
+ var tolk_js_2 = require("@ton/tolk-js");
25
+ Object.defineProperty(exports, "getTolkVersion", { enumerable: true, get: function () { return tolk_js_2.getTolkCompilerVersion; } });
@@ -0,0 +1,8 @@
1
+ export type TolkCompilerConfig = {
2
+ lang: 'tolk';
3
+ entrypoint: string;
4
+ optimizationLevel?: number;
5
+ withStackComments?: boolean;
6
+ withSrcLineComments?: boolean;
7
+ experimentalOptions?: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { Config as TactConfig } from '@tact-lang/compiler';
2
+ export declare const defaultConfig: TactConfig;
3
+ export declare function getRootTactConfig(): TactConfig;
4
+ export declare function updateRootTactConfig(config: TactConfig): void;
5
+ export { TactConfig };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultConfig = void 0;
4
+ exports.getRootTactConfig = getRootTactConfig;
5
+ exports.updateRootTactConfig = updateRootTactConfig;
6
+ const fs_1 = require("fs");
7
+ const compiler_1 = require("@tact-lang/compiler");
8
+ const paths_1 = require("../paths");
9
+ exports.defaultConfig = {
10
+ $schema: 'https://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json',
11
+ projects: [],
12
+ };
13
+ function getRootTactConfig() {
14
+ if (!(0, fs_1.existsSync)(paths_1.TACT_ROOT_CONFIG)) {
15
+ return exports.defaultConfig;
16
+ }
17
+ return (0, compiler_1.parseConfig)((0, fs_1.readFileSync)(paths_1.TACT_ROOT_CONFIG).toString());
18
+ }
19
+ function updateRootTactConfig(config) {
20
+ (0, fs_1.writeFileSync)(paths_1.TACT_ROOT_CONFIG, JSON.stringify(config, null, 2), 'utf-8');
21
+ }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { tonDeepLink, sleep } from './utils';
2
2
  export { NetworkProvider } from './network/NetworkProvider';
3
3
  export { createNetworkProvider } from './network/createNetworkProvider';
4
- export { compile, CompileOpts, SourceSnapshot, TolkCompileResult, FuncCompileResult, TactCompileResult, CompileResult } from './compile/compile';
4
+ export { compile, CompileOpts, TolkCompileResult, FuncCompileResult, TactCompileResult, CompileResult } from './compile/compile';
5
5
  export { CompilerConfig, HookParams } from './compile/CompilerConfig';
6
6
  export { UIProvider } from './ui/UIProvider';
7
7
  export { Config } from './config/Config';
@@ -9,3 +9,4 @@ export { Args, Runner, RunnerContext } from './cli/Runner';
9
9
  export { PluginRunner, Plugin } from './config/Plugin';
10
10
  export { CustomNetwork } from './config/CustomNetwork';
11
11
  export { buildOne, buildAll, buildAllTact } from './build';
12
+ export { SourceSnapshot } from "./compile/SourceSnapshot";
@@ -4,7 +4,7 @@ import { {{name}} } from '../wrappers/{{name}}';
4
4
  import { NetworkProvider } from '@ton/blueprint';
5
5
 
6
6
  export async function run(provider: NetworkProvider) {
7
- const {{loweredName}} = provider.open(await {{name}}.fromInit(BigInt(Math.floor(Math.random() * 10000))), 0n);
7
+ const {{loweredName}} = provider.open(await {{name}}.fromInit(BigInt(Math.floor(Math.random() * 10000)), 0n));
8
8
 
9
9
  await {{loweredName}}.send(
10
10
  provider.sender(),
@@ -1,7 +1,7 @@
1
1
  {{name}}.spec.ts
2
2
  import { Blockchain, SandboxContract, TreasuryContract } from '@ton/sandbox';
3
3
  import { toNano } from '@ton/core';
4
- import { {{name}} } from '../wrappers/{{name}}';
4
+ import { {{name}} } from '../build/{{name}}/{{name}}_{{name}}';
5
5
  import '@ton/test-utils';
6
6
 
7
7
  describe('{{name}}', () => {
@@ -1,7 +1,7 @@
1
1
  {{name}}.spec.ts
2
2
  import { Blockchain, SandboxContract, TreasuryContract } from '@ton/sandbox';
3
3
  import { toNano } from '@ton/core';
4
- import { {{name}} } from '../wrappers/{{name}}';
4
+ import { {{name}} } from '../build/{{name}}/{{name}}_{{name}}';
5
5
  import '@ton/test-utils';
6
6
 
7
7
  describe('{{name}}', () => {
@@ -5,5 +5,6 @@ export const compile: CompilerConfig = {
5
5
  lang: 'tolk',
6
6
  entrypoint: '{{contractPath}}',
7
7
  withStackComments: true, // Fift output will contain comments, if you wish to debug its output
8
+ withSrcLineComments: true, // Fift output will contain .tolk lines as comments
8
9
  experimentalOptions: '', // you can pass experimental compiler options here
9
10
  };
@@ -12,17 +12,17 @@ global ctxCounter: int;
12
12
 
13
13
  // loadData populates storage variables from persistent storage
14
14
  fun loadData() {
15
- var ds = getContractData().beginParse();
15
+ var ds = contract.getData().beginParse();
16
16
 
17
17
  ctxID = ds.loadUint(32);
18
18
  ctxCounter = ds.loadUint(32);
19
19
 
20
- ds.assertEndOfSlice();
20
+ ds.assertEnd();
21
21
  }
22
22
 
23
23
  // saveData stores storage variables as a cell into persistent storage
24
24
  fun saveData() {
25
- setContractData(
25
+ contract.setData(
26
26
  beginCell()
27
27
  .storeUint(ctxID, 32)
28
28
  .storeUint(ctxCounter, 32)
@@ -32,7 +32,7 @@ fun saveData() {
32
32
 
33
33
  // onInternalMessage is the main entrypoint; it's called when a contract receives an internal message from other contracts
34
34
  fun onInternalMessage(myBalance: int, msgValue: int, msgFull: cell, msgBody: slice) {
35
- if (msgBody.isEndOfSlice()) { // ignore all empty messages
35
+ if (msgBody.isEnd()) { // ignore all empty messages
36
36
  return;
37
37
  }
38
38
 
@@ -5,5 +5,6 @@ export const compile: CompilerConfig = {
5
5
  lang: 'tolk',
6
6
  entrypoint: '{{contractPath}}',
7
7
  withStackComments: true, // Fift output will contain comments, if you wish to debug its output
8
+ withSrcLineComments: true, // Fift output will contain .tolk lines as comments
8
9
  experimentalOptions: '', // you can pass experimental compiler options here
9
10
  };
@@ -1,3 +1,4 @@
1
1
  export declare function oneOrZeroOf<T extends {
2
2
  [k: string]: boolean | undefined;
3
3
  }>(options: T): keyof T | undefined;
4
+ export declare function distinct<T>(values: T[]): T[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.oneOrZeroOf = oneOrZeroOf;
4
+ exports.distinct = distinct;
4
5
  function oneOrZeroOf(options) {
5
6
  let opt = undefined;
6
7
  for (const k in options) {
@@ -15,3 +16,6 @@ function oneOrZeroOf(options) {
15
16
  }
16
17
  return opt;
17
18
  }
19
+ function distinct(values) {
20
+ return [...new Set(values)];
21
+ }
@@ -1,6 +1,7 @@
1
1
  import { UIProvider } from '../ui/UIProvider';
2
2
  import { File } from '../types/file';
3
3
  export declare const findCompiles: (directory?: string) => Promise<File[]>;
4
+ export declare const findContracts: () => Promise<string[]>;
4
5
  export declare const findScripts: () => Promise<File[]>;
5
6
  export declare function selectOption(options: {
6
7
  name: string;
@@ -36,15 +36,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.findScripts = exports.findCompiles = void 0;
39
+ exports.findScripts = exports.findContracts = exports.findCompiles = void 0;
40
40
  exports.selectOption = selectOption;
41
41
  exports.selectFile = selectFile;
42
42
  const path_1 = __importDefault(require("path"));
43
43
  const promises_1 = __importDefault(require("fs/promises"));
44
- const paths_1 = require("../paths");
44
+ const tact_config_1 = require("../config/tact.config");
45
45
  const compile_1 = require("../compile/compile");
46
+ const paths_1 = require("../paths");
47
+ const object_utils_1 = require("./object.utils");
46
48
  const findCompiles = async (directory) => {
47
- const dir = directory ?? await (0, compile_1.getCompilablesDirectory)();
49
+ const dir = directory ?? (await (0, compile_1.getCompilablesDirectory)());
48
50
  const files = await promises_1.default.readdir(dir);
49
51
  const compilables = files.filter((file) => file.endsWith(compile_1.COMPILE_END));
50
52
  return compilables.map((file) => ({
@@ -53,6 +55,15 @@ const findCompiles = async (directory) => {
53
55
  }));
54
56
  };
55
57
  exports.findCompiles = findCompiles;
58
+ const findContracts = async () => {
59
+ const compilables = await (0, exports.findCompiles)();
60
+ const tactRootConfig = (0, tact_config_1.getRootTactConfig)();
61
+ return (0, object_utils_1.distinct)([
62
+ ...compilables.map((file) => file.name),
63
+ ...(tactRootConfig?.projects.map((project) => project.name) ?? []),
64
+ ]);
65
+ };
66
+ exports.findContracts = findContracts;
56
67
  const findScripts = async () => {
57
68
  const dirents = await promises_1.default.readdir(paths_1.SCRIPTS_DIR, { recursive: true, withFileTypes: true });
58
69
  const scripts = dirents.filter((dirent) => dirent.isFile() && dirent.name.endsWith('.ts'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/blueprint",
3
- "version": "0.32.1",
3
+ "version": "0.33.0",
4
4
  "description": "Framework for development of TON smart contracts",
5
5
  "main": "dist/index.js",
6
6
  "bin": "./dist/cli/cli.js",
@@ -23,7 +23,7 @@
23
23
  "@ton-community/func-js": "^0.9.0",
24
24
  "@ton/core": "^0.59.0",
25
25
  "@ton/crypto": "^3.3.0",
26
- "@ton/tolk-js": "^0.6.0",
26
+ "@ton/tolk-js": "^0.12.0",
27
27
  "@ton/ton": "^15.0.0",
28
28
  "@types/inquirer": "^8.2.6",
29
29
  "@types/node": "^20.2.5",
@@ -36,7 +36,7 @@
36
36
  "@ton-community/func-js": ">=0.9.0",
37
37
  "@ton/core": ">=0.59.0",
38
38
  "@ton/crypto": ">=3.3.0",
39
- "@ton/tolk-js": ">=0.6.0",
39
+ "@ton/tolk-js": ">=0.12.0",
40
40
  "@ton/ton": ">=15.0.0"
41
41
  },
42
42
  "dependencies": {
@@ -1,10 +0,0 @@
1
- {{name}}.compile.ts
2
- import { CompilerConfig } from '@ton/blueprint';
3
-
4
- export const compile: CompilerConfig = {
5
- lang: 'tact',
6
- target: '{{contractPath}}',
7
- options: {
8
- debug: true,
9
- },
10
- };
@@ -1,2 +0,0 @@
1
- {{name}}.ts
2
- export * from '../build/{{name}}/tact_{{name}}';
@@ -1,10 +0,0 @@
1
- {{name}}.compile.ts
2
- import { CompilerConfig } from '@ton/blueprint';
3
-
4
- export const compile: CompilerConfig = {
5
- lang: 'tact',
6
- target: '{{contractPath}}',
7
- options: {
8
- debug: true,
9
- },
10
- };
@@ -1,2 +0,0 @@
1
- {{name}}.ts
2
- export * from '../build/{{name}}/tact_{{name}}';