@ton/blueprint 0.31.1 → 0.32.1

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 CHANGED
@@ -5,6 +5,28 @@ 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.32.1] - 2025-05-06
9
+
10
+ ### Fixed
11
+
12
+ - Fix unexpected code duplication on parralel compile
13
+
14
+ ## [0.32.0] - 2025-05-02
15
+
16
+ ### Added
17
+
18
+ - Compiler version is now shown during contract build
19
+ - Added 'All Contracts' option to build wizard
20
+ - Added function to build all tact contracts, required for rebuilding before tests
21
+
22
+ ### Changed
23
+
24
+ - Made error of non-PascalCase contract names nicer
25
+
26
+ ### Fixed
27
+
28
+ - `blueprint build --all` now exits with a non-zero exit code on failure
29
+
8
30
  ## [0.31.1] - 2025-04-24
9
31
 
10
32
  ### Fixed
package/README.md CHANGED
@@ -122,6 +122,10 @@ export async function run(provider: NetworkProvider) {
122
122
 
123
123
  FunC version can be updated using `npx/yarn blueprint set func` command
124
124
 
125
+ ### Updating Tact version
126
+
127
+ Tact version can be updated to the latest using `npm update/yarn upgrade @tact-lang/compiler` command
128
+
125
129
  ### Help and additional commands
126
130
 
127
131
  Run in terminal:   `npx blueprint help`   or   `yarn blueprint help`
package/dist/build.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { UIProvider } from './ui/UIProvider';
2
2
  export declare function buildOne(contract: string, ui?: UIProvider): Promise<void>;
3
3
  export declare function buildAll(ui?: UIProvider): Promise<void>;
4
+ export declare function buildAllTact(ui?: UIProvider): Promise<void>;
package/dist/build.js CHANGED
@@ -3,7 +3,9 @@ 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.buildAll = exports.buildOne = void 0;
6
+ exports.buildOne = buildOne;
7
+ exports.buildAll = buildAll;
8
+ exports.buildAllTact = buildAllTact;
7
9
  const path_1 = __importDefault(require("path"));
8
10
  const promises_1 = __importDefault(require("fs/promises"));
9
11
  const compile_1 = require("./compile/compile");
@@ -18,6 +20,9 @@ async function buildOne(contract, ui) {
18
20
  catch (e) { }
19
21
  ui?.setActionPrompt('⏳ Compiling...');
20
22
  try {
23
+ const config = await (0, compile_1.getCompilerConfigForContract)(contract);
24
+ const compilerOptions = await (0, compile_1.getCompilerOptions)(config);
25
+ ui?.write(`🔧 Using ${compilerOptions.lang} version ${compilerOptions.version}...`);
21
26
  const result = await (0, compile_1.doCompile)(contract);
22
27
  if (result.lang === 'tact') {
23
28
  for (const [k, v] of result.fs) {
@@ -64,10 +69,17 @@ async function buildOne(contract, ui) {
64
69
  }
65
70
  }
66
71
  }
67
- exports.buildOne = buildOne;
68
72
  async function buildAll(ui) {
69
73
  for (const file of await (0, utils_1.findCompiles)()) {
70
74
  await buildOne(file.name, ui);
71
75
  }
72
76
  }
73
- exports.buildAll = buildAll;
77
+ 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
+ }
85
+ }
@@ -3,6 +3,7 @@ import { UIProvider } from '../ui/UIProvider';
3
3
  import { Config } from '../config/Config';
4
4
  export declare const argSpec: {};
5
5
  export type Args = arg.Result<typeof argSpec>;
6
+ export declare function extractFirstArg(args: Args): string | undefined;
6
7
  export type RunnerContext = {
7
8
  config?: Config;
8
9
  };
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.argSpec = void 0;
4
+ exports.extractFirstArg = extractFirstArg;
4
5
  exports.argSpec = {};
6
+ function extractFirstArg(args) {
7
+ return args._.length > 1 && args._[1].trim().length > 0 ? args._[1].trim() : undefined;
8
+ }
@@ -1,8 +1,6 @@
1
1
  import { Args, Runner } from './Runner';
2
2
  import { UIProvider } from '../ui/UIProvider';
3
- export declare function selectCompile(ui: UIProvider, args: Args): Promise<{
4
- module: any;
5
- name: string;
6
- path: string;
7
- }>;
3
+ export declare function extractBuildFile(args: Args): string | undefined;
4
+ export declare function selectContract(ui: UIProvider, hint?: string): Promise<string>;
5
+ export declare function selectContract(ui: UIProvider, hint?: string, withAllOption?: boolean): Promise<string | string[]>;
8
6
  export declare const build: Runner;
package/dist/cli/build.js CHANGED
@@ -3,19 +3,38 @@ 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.build = exports.selectCompile = void 0;
6
+ exports.build = void 0;
7
+ exports.extractBuildFile = extractBuildFile;
8
+ exports.selectContract = selectContract;
7
9
  const utils_1 = require("../utils");
8
10
  const arg_1 = __importDefault(require("arg"));
9
11
  const build_1 = require("../build");
10
12
  const constants_1 = require("./constants");
11
- async function selectCompile(ui, args) {
12
- return await (0, utils_1.selectFile)(await (0, utils_1.findCompiles)(), {
13
+ function extractBuildFile(args) {
14
+ return args._.length > 1 && args._[1].length > 0 ? args._[1] : undefined;
15
+ }
16
+ async function selectContract(ui, hint, withAllOption = false) {
17
+ const compiles = await (0, utils_1.findCompiles)();
18
+ const contracts = compiles.map(compile => compile.name);
19
+ const options = contracts.map((contract) => ({ name: contract, value: contract }));
20
+ const allContractsValue = 'all_contracts';
21
+ if (withAllOption) {
22
+ const allContractsOption = {
23
+ name: 'All Contracts',
24
+ value: allContractsValue,
25
+ };
26
+ options.push(allContractsOption);
27
+ }
28
+ const selectedOption = await (0, utils_1.selectOption)(options, {
29
+ msg: 'Select contract to use',
13
30
  ui,
14
- hint: args._.length > 1 && args._[1].length > 0 ? args._[1] : undefined,
15
- import: false,
31
+ hint,
16
32
  });
33
+ if (selectedOption.value === allContractsValue) {
34
+ return contracts;
35
+ }
36
+ return selectedOption.value;
17
37
  }
18
- exports.selectCompile = selectCompile;
19
38
  const build = async (args, ui) => {
20
39
  const localArgs = (0, arg_1.default)({
21
40
  '--all': Boolean,
@@ -26,11 +45,16 @@ const build = async (args, ui) => {
26
45
  return;
27
46
  }
28
47
  if (localArgs['--all']) {
29
- await (0, build_1.buildAll)();
48
+ await (0, build_1.buildAll)(ui);
30
49
  }
31
50
  else {
32
- const sel = await selectCompile(ui, localArgs);
33
- await (0, build_1.buildOne)(sel.name, ui);
51
+ const selected = await selectContract(ui, extractBuildFile(args), true);
52
+ if (typeof selected === 'string') {
53
+ await (0, build_1.buildOne)(selected, ui);
54
+ }
55
+ else {
56
+ await (0, build_1.buildAll)(ui);
57
+ }
34
58
  }
35
59
  };
36
60
  exports.build = build;
package/dist/cli/cli.js CHANGED
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
26
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
38
  };
@@ -4,6 +4,7 @@ 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");
7
8
  const promises_1 = require("fs/promises");
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const template_1 = require("../template");
@@ -56,13 +57,16 @@ const create = async (args, ui) => {
56
57
  ui.write(constants_1.helpMessages['create']);
57
58
  return;
58
59
  }
59
- const name = localArgs._.length > 1 && localArgs._[1].trim().length > 0
60
- ? localArgs._[1].trim()
61
- : await ui.input('Contract name (PascalCase)');
60
+ const name = (0, Runner_1.extractFirstArg)(localArgs)
61
+ ?? await ui.input('Contract name (PascalCase)');
62
62
  if (name.length === 0)
63
63
  throw new Error(`Cannot create a contract with an empty name`);
64
- if (name.toLowerCase() === 'contract' || !/^[A-Z][a-zA-Z0-9]*$/.test(name))
65
- throw new Error(`Cannot create a contract with the name '${name}'`);
64
+ if (name.toLowerCase() === 'contract') {
65
+ throw new Error(`Cannot create a contract with the reserved name 'contract'. Please choose a different name.`);
66
+ }
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)}.`);
69
+ }
66
70
  const which = (await (0, utils_1.selectOption)(constants_1.templateTypes, {
67
71
  ui,
68
72
  msg: 'What type of contract do you want to create?',
package/dist/cli/help.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.help = exports.buildHelpMessage = exports.additionalHelpMessages = void 0;
3
+ exports.help = exports.additionalHelpMessages = void 0;
4
+ exports.buildHelpMessage = buildHelpMessage;
4
5
  const constants_1 = require("./constants");
5
6
  exports.additionalHelpMessages = {};
6
7
  function buildHelpMessage(cmd = '') {
@@ -13,7 +14,6 @@ function buildHelpMessage(cmd = '') {
13
14
  }
14
15
  return cmd in effectiveHelpMessages ? effectiveHelpMessages[cmd] : effectiveHelpMessages['help'];
15
16
  }
16
- exports.buildHelpMessage = buildHelpMessage;
17
17
  const help = async (args, ui) => {
18
18
  const cmd = args._.length >= 2 ? args._[1].toLowerCase() : '';
19
19
  const helpMessage = buildHelpMessage(cmd);
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.verify = void 0;
7
7
  const core_1 = require("@ton/core");
8
8
  const compile_1 = require("../compile/compile");
9
+ const Runner_1 = require("./Runner");
9
10
  const path_1 = __importDefault(require("path"));
10
11
  const createNetworkProvider_1 = require("../network/createNetworkProvider");
11
12
  const build_1 = require("./build");
@@ -126,7 +127,7 @@ const verify = async (args, ui, context) => {
126
127
  ui.write(constants_1.helpMessages['verify']);
127
128
  return;
128
129
  }
129
- const sel = await (0, build_1.selectCompile)(ui, localArgs);
130
+ const selectedContract = await (0, build_1.selectContract)(ui, (0, Runner_1.extractFirstArg)(localArgs));
130
131
  const networkProvider = await (0, createNetworkProvider_1.createNetworkProvider)(ui, localArgs, context.config, false);
131
132
  const sender = networkProvider.sender();
132
133
  const senderAddress = sender.address;
@@ -137,7 +138,7 @@ const verify = async (args, ui, context) => {
137
138
  if (network === 'custom') {
138
139
  throw new Error('Cannot use custom network');
139
140
  }
140
- const result = await (0, compile_1.doCompile)(sel.name);
141
+ const result = await (0, compile_1.doCompile)(selectedContract);
141
142
  const resHash = result.code.hash();
142
143
  ui.write(`Compiled code hash hex: ${resHash.toString('hex')}`);
143
144
  ui.write('We can look up the address with such code hash in the blockchain automatically');
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { VirtualFileSystem } from '@tact-lang/compiler';
3
2
  export declare class OverwritableVirtualFileSystem implements VirtualFileSystem {
4
3
  root: string;
@@ -1,8 +1,9 @@
1
- /// <reference types="node" />
2
1
  import { Cell } from '@ton/core';
3
- import { TactCompilerConfig } from './CompilerConfig';
2
+ import { CompilerConfig, TactCompilerConfig } from './CompilerConfig';
4
3
  export declare function getCompilablesDirectory(): Promise<string>;
5
4
  export declare const COMPILE_END = ".compile.ts";
5
+ export declare function extractCompileConfig(path: string): CompilerConfig;
6
+ export declare function getCompilerConfigForContract(name: string): Promise<CompilerConfig>;
6
7
  export type SourceSnapshot = {
7
8
  filename: string;
8
9
  content: string;
@@ -28,8 +29,14 @@ export type TactCompileResult = {
28
29
  fs: Map<string, Buffer>;
29
30
  code: Cell;
30
31
  options?: TactCompilerConfig['options'];
32
+ version: string;
31
33
  };
34
+ export declare function getTactVersion(): Promise<any>;
32
35
  export type CompileResult = TactCompileResult | FuncCompileResult | TolkCompileResult;
36
+ export declare function getCompilerOptions(config: CompilerConfig): Promise<{
37
+ lang: 'tact' | 'tolk' | 'func';
38
+ version: string;
39
+ }>;
33
40
  export declare function doCompile(name: string, opts?: CompileOpts): Promise<CompileResult>;
34
41
  /**
35
42
  * Optional compilation settings, including user data passed to hooks
@@ -15,18 +15,35 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.compile = exports.doCompile = exports.COMPILE_END = exports.getCompilablesDirectory = void 0;
39
+ exports.COMPILE_END = void 0;
40
+ exports.getCompilablesDirectory = getCompilablesDirectory;
41
+ exports.extractCompileConfig = extractCompileConfig;
42
+ exports.getCompilerConfigForContract = getCompilerConfigForContract;
43
+ exports.getTactVersion = getTactVersion;
44
+ exports.getCompilerOptions = getCompilerOptions;
45
+ exports.doCompile = doCompile;
46
+ exports.compile = compile;
30
47
  const func_js_1 = require("@ton-community/func-js");
31
48
  const fs_1 = require("fs");
32
49
  const path_1 = __importDefault(require("path"));
@@ -43,17 +60,18 @@ async function getCompilablesDirectory() {
43
60
  }
44
61
  return paths_1.WRAPPERS_DIR;
45
62
  }
46
- exports.getCompilablesDirectory = getCompilablesDirectory;
47
63
  exports.COMPILE_END = '.compile.ts';
48
- async function getCompilerConfigForContract(name) {
49
- var _a;
50
- const compilablesDirectory = await getCompilablesDirectory();
51
- const mod = await (_a = path_1.default.join(compilablesDirectory, name + exports.COMPILE_END), Promise.resolve().then(() => __importStar(require(_a))));
64
+ function extractCompileConfig(path) {
65
+ const mod = require(path);
52
66
  if (typeof mod.compile !== 'object') {
53
67
  throw new Error(`Object 'compile' is missing`);
54
68
  }
55
69
  return mod.compile;
56
70
  }
71
+ async function getCompilerConfigForContract(name) {
72
+ const compilablesDirectory = await getCompilablesDirectory();
73
+ return extractCompileConfig(path_1.default.join(compilablesDirectory, name + exports.COMPILE_END));
74
+ }
57
75
  async function doCompileTolk(config) {
58
76
  const res = await (0, tolk_js_1.runTolkCompiler)(config);
59
77
  if (res.status === 'error') {
@@ -116,6 +134,11 @@ function getRootTactConfigOptionsForContract(name) {
116
134
  }
117
135
  return undefined;
118
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
+ }
119
142
  async function doCompileTact(config, name) {
120
143
  const rootConfigOptions = getRootTactConfigOptionsForContract(name);
121
144
  const fs = new OverwritableVirtualFileSystem_1.OverwritableVirtualFileSystem(process.cwd());
@@ -139,6 +162,7 @@ async function doCompileTact(config, name) {
139
162
  fs: fs.overwrites,
140
163
  code,
141
164
  options: buildConfig.config.options,
165
+ version: await getTactVersion(),
142
166
  };
143
167
  }
144
168
  async function doCompileInner(name, config) {
@@ -160,6 +184,24 @@ async function doCompileInner(name, config) {
160
184
  optLevel: config.optLevel,
161
185
  });
162
186
  }
187
+ function getCompilerName(config) {
188
+ return config.lang ?? 'func';
189
+ }
190
+ 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)();
196
+ }
197
+ return (await (0, func_js_1.compilerVersion)()).funcVersion;
198
+ }
199
+ async function getCompilerOptions(config) {
200
+ return {
201
+ lang: getCompilerName(config),
202
+ version: await getCompilerVersion(config),
203
+ };
204
+ }
163
205
  async function doCompile(name, opts) {
164
206
  const config = await getCompilerConfigForContract(name);
165
207
  if (config.preCompileHook !== undefined) {
@@ -175,7 +217,6 @@ async function doCompile(name, opts) {
175
217
  }
176
218
  return res;
177
219
  }
178
- exports.doCompile = doCompile;
179
220
  /**
180
221
  * Compiles a contract using the specified configuration for `tact`, `func`, or `tolk` languages.
181
222
  *
@@ -203,4 +244,3 @@ async function compile(name, opts) {
203
244
  const result = await doCompile(name, opts);
204
245
  return result.code;
205
246
  }
206
- exports.compile = compile;
@@ -15,16 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var _a;
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
+ })();
26
35
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.getConfig = void 0;
36
+ exports.getConfig = getConfig;
28
37
  const paths_1 = require("../paths");
29
38
  let config;
30
39
  async function getConfig() {
@@ -32,7 +41,7 @@ async function getConfig() {
32
41
  return config;
33
42
  }
34
43
  try {
35
- const configModule = await (_a = paths_1.BLUEPRINT_CONFIG, Promise.resolve().then(() => __importStar(require(_a))));
44
+ const configModule = await Promise.resolve(`${paths_1.BLUEPRINT_CONFIG}`).then(s => __importStar(require(s)));
36
45
  if (!('config' in configModule) || typeof configModule.config !== 'object') {
37
46
  return undefined;
38
47
  }
@@ -43,4 +52,3 @@ async function getConfig() {
43
52
  return undefined;
44
53
  }
45
54
  }
46
- exports.getConfig = getConfig;
package/dist/index.d.ts CHANGED
@@ -8,4 +8,4 @@ export { Config } from './config/Config';
8
8
  export { Args, Runner, RunnerContext } from './cli/Runner';
9
9
  export { PluginRunner, Plugin } from './config/Plugin';
10
10
  export { CustomNetwork } from './config/CustomNetwork';
11
- export { buildOne, buildAll } from './build';
11
+ export { buildOne, buildAll, buildAllTact } from './build';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildAll = exports.buildOne = exports.compile = exports.createNetworkProvider = exports.sleep = exports.tonDeepLink = void 0;
3
+ exports.buildAllTact = exports.buildAll = exports.buildOne = exports.compile = exports.createNetworkProvider = exports.sleep = exports.tonDeepLink = void 0;
4
4
  var utils_1 = require("./utils");
5
5
  Object.defineProperty(exports, "tonDeepLink", { enumerable: true, get: function () { return utils_1.tonDeepLink; } });
6
6
  Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return utils_1.sleep; } });
@@ -11,3 +11,4 @@ Object.defineProperty(exports, "compile", { enumerable: true, get: function () {
11
11
  var build_1 = require("./build");
12
12
  Object.defineProperty(exports, "buildOne", { enumerable: true, get: function () { return build_1.buildOne; } });
13
13
  Object.defineProperty(exports, "buildAll", { enumerable: true, get: function () { return build_1.buildAll; } });
14
+ Object.defineProperty(exports, "buildAllTact", { enumerable: true, get: function () { return build_1.buildAllTact; } });
@@ -15,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  var _SendProviderSender_provider, _WrappedContractProvider_address, _WrappedContractProvider_provider, _WrappedContractProvider_init, _WrappedContractProvider_factory, _NetworkProviderImpl_tc, _NetworkProviderImpl_sender, _NetworkProviderImpl_network, _NetworkProviderImpl_explorer, _NetworkProviderImpl_ui;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.createNetworkProvider = exports.argSpec = void 0;
18
+ exports.argSpec = void 0;
19
+ exports.createNetworkProvider = createNetworkProvider;
19
20
  const utils_1 = require("../utils");
20
21
  const DeeplinkProvider_1 = require("./send/DeeplinkProvider");
21
22
  const TonConnectProvider_1 = require("./send/TonConnectProvider");
@@ -396,4 +397,3 @@ class NetworkProviderBuilder {
396
397
  async function createNetworkProvider(ui, args, config, allowCustom = true) {
397
398
  return await new NetworkProviderBuilder(args, ui, config, allowCustom).build();
398
399
  }
399
- exports.createNetworkProvider = createNetworkProvider;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Address, Cell, StateInit } from '@ton/core';
3
2
  import { SendProvider } from './SendProvider';
4
3
  import { UIProvider } from '../../ui/UIProvider';
package/dist/template.js CHANGED
@@ -3,7 +3,8 @@ 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.executeTemplate = exports.TEMPLATES_DIR = void 0;
6
+ exports.TEMPLATES_DIR = void 0;
7
+ exports.executeTemplate = executeTemplate;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  exports.TEMPLATES_DIR = path_1.default.join(__dirname, 'templates');
9
10
  function executeTemplate(contents, replaces) {
@@ -12,4 +13,3 @@ function executeTemplate(contents, replaces) {
12
13
  }
13
14
  return contents;
14
15
  }
15
- exports.executeTemplate = executeTemplate;
@@ -2,3 +2,4 @@ export * from './object.utils';
2
2
  export * from './timer.utils';
3
3
  export * from './ton.utils';
4
4
  export * from './selection.utils';
5
+ export * from './string.utils';
@@ -18,3 +18,4 @@ __exportStar(require("./object.utils"), exports);
18
18
  __exportStar(require("./timer.utils"), exports);
19
19
  __exportStar(require("./ton.utils"), exports);
20
20
  __exportStar(require("./selection.utils"), exports);
21
+ __exportStar(require("./string.utils"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oneOrZeroOf = void 0;
3
+ exports.oneOrZeroOf = oneOrZeroOf;
4
4
  function oneOrZeroOf(options) {
5
5
  let opt = undefined;
6
6
  for (const k in options) {
@@ -15,4 +15,3 @@ function oneOrZeroOf(options) {
15
15
  }
16
16
  return opt;
17
17
  }
18
- exports.oneOrZeroOf = oneOrZeroOf;
@@ -15,19 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
- var _a;
29
38
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.selectFile = exports.selectOption = exports.findScripts = exports.findCompiles = void 0;
39
+ exports.findScripts = exports.findCompiles = void 0;
40
+ exports.selectOption = selectOption;
41
+ exports.selectFile = selectFile;
31
42
  const path_1 = __importDefault(require("path"));
32
43
  const promises_1 = __importDefault(require("fs/promises"));
33
44
  const paths_1 = require("../paths");
@@ -65,7 +76,6 @@ async function selectOption(options, opts) {
65
76
  return await opts.ui.choose(opts.msg, options, (o) => o.name);
66
77
  }
67
78
  }
68
- exports.selectOption = selectOption;
69
79
  async function selectFile(files, opts) {
70
80
  let selected;
71
81
  if (opts.hint) {
@@ -87,7 +97,6 @@ async function selectFile(files, opts) {
87
97
  }
88
98
  return {
89
99
  ...selected,
90
- module: opts.import !== false ? await (_a = selected.path, Promise.resolve().then(() => __importStar(require(_a)))) : undefined,
100
+ module: opts.import !== false ? await Promise.resolve(`${selected.path}`).then(s => __importStar(require(s))) : undefined,
91
101
  };
92
102
  }
93
- exports.selectFile = selectFile;
@@ -0,0 +1,2 @@
1
+ export declare function isPascalCase(str: string): boolean;
2
+ export declare function toPascalCase(str: string): string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPascalCase = isPascalCase;
4
+ exports.toPascalCase = toPascalCase;
5
+ function isPascalCase(str) {
6
+ return /^[A-Z][a-zA-Z0-9]*$/.test(str);
7
+ }
8
+ function toPascalCase(str) {
9
+ return str
10
+ .replace(/([a-z])([A-Z])/g, '$1 $2') // Splits camelCase words into separate words
11
+ .replace(/[^a-zA-Z0-9]+/g, ' ') // Replaces all characters that are not allowed with spaces
12
+ .toLowerCase() // Converts the entire string to lowercase
13
+ .replace(/(?:^|\s)(\p{L})/gu, (_, letter) => letter.toUpperCase()) // Capitalizes the first letter of each word
14
+ .replace(/\s+/g, ''); // Removes all spaces
15
+ }
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sleep = void 0;
3
+ exports.sleep = sleep;
4
4
  function sleep(ms) {
5
5
  return new Promise((resolve) => {
6
6
  setTimeout(resolve, ms);
7
7
  });
8
8
  }
9
- exports.sleep = sleep;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getExplorerLink = exports.tonDeepLink = void 0;
3
+ exports.tonDeepLink = void 0;
4
+ exports.getExplorerLink = getExplorerLink;
4
5
  /**
5
6
  * Generates a TON deep link for transfer.
6
7
  *
@@ -49,4 +50,3 @@ function getExplorerLink(address, network, explorer) {
49
50
  return `https://${networkPrefix}tonviewer.com/${address}`;
50
51
  }
51
52
  }
52
- exports.getExplorerLink = getExplorerLink;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/blueprint",
3
- "version": "0.31.1",
3
+ "version": "0.32.1",
4
4
  "description": "Framework for development of TON smart contracts",
5
5
  "main": "dist/index.js",
6
6
  "bin": "./dist/cli/cli.js",
@@ -29,7 +29,7 @@
29
29
  "@types/node": "^20.2.5",
30
30
  "@types/qrcode-terminal": "^0.12.0",
31
31
  "prettier": "^3.0.3",
32
- "typescript": "^4.9.5"
32
+ "typescript": "^5.8.3"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@tact-lang/compiler": ">=1.6.5",