create-ton 0.20.0 → 0.22.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 CHANGED
@@ -5,6 +5,22 @@ 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.22.0] - 2025-04-09
9
+
10
+ ### Added
11
+
12
+ - Added flag `--no-ci` to skip installation of dependencies, git init and creation of the first contract via Blueprint
13
+
14
+ ### Changed
15
+
16
+ - Updated template dependencies
17
+
18
+ ## [0.21.0] - 2025-03-02
19
+
20
+ ### Changed
21
+
22
+ - Updated template dependencies
23
+
8
24
  ## [0.20.0] - 2025-01-17
9
25
 
10
26
  ### Changed
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ const VARIANT_CHOICES = [
22
22
  value: 'tolk-empty',
23
23
  },
24
24
  {
25
- name: 'An empty contract (TACT)',
25
+ name: 'An empty contract (Tact)',
26
26
  value: 'tact-empty',
27
27
  },
28
28
  {
@@ -34,7 +34,7 @@ const VARIANT_CHOICES = [
34
34
  value: 'tolk-counter',
35
35
  },
36
36
  {
37
- name: 'A simple counter contract (TACT)',
37
+ name: 'A simple counter contract (Tact)',
38
38
  value: 'tact-counter',
39
39
  },
40
40
  ];
@@ -43,6 +43,8 @@ async function main() {
43
43
  const localArgs = (0, arg_1.default)({
44
44
  '--type': String,
45
45
  '--contractName': String,
46
+ '--no-ci': Boolean, // whether to skip installation of dependendencies, git init
47
+ // and creation of the first contract via Blueprint
46
48
  });
47
49
  const desiredProjectName = localArgs._[0] ||
48
50
  (await inquirer_1.default.prompt({
@@ -53,19 +55,22 @@ async function main() {
53
55
  const name = path_1.default.basename(projectPath);
54
56
  if (name.length === 0)
55
57
  throw new Error('Cannot initialize a project with an empty name');
56
- const contractName = localArgs['--contractName'] ||
58
+ const noCi = localArgs['--no-ci'] ?? false;
59
+ const contractName = (noCi ? 'NonExistent' : localArgs['--contractName']) ||
57
60
  (await inquirer_1.default.prompt({
58
61
  name: 'contractName',
59
62
  message: 'First created contract name (PascalCase)',
60
63
  })).contractName.trim();
61
- if (contractName.length === 0)
62
- throw new Error(`Cannot create a contract with an empty name`);
63
- if (contractName.toLowerCase() === 'contract' || !/^[A-Z][a-zA-Z0-9]*$/.test(contractName))
64
- throw new Error(`Cannot create a contract with the name '${contractName}'`);
64
+ if (!noCi) {
65
+ if (contractName.length === 0)
66
+ throw new Error(`Cannot create a contract with an empty name`);
67
+ if (contractName.toLowerCase() === 'contract' || !/^[A-Z][a-zA-Z0-9]*$/.test(contractName))
68
+ throw new Error(`Cannot create a contract with the name '${contractName}'`);
69
+ }
65
70
  const argsVariant = VARIANT_CHOICES.map(e => e.value).indexOf(localArgs['--type'] || '') !== -1
66
71
  ? localArgs['--type']
67
72
  : undefined;
68
- const variant = argsVariant ||
73
+ const variant = (noCi ? 'none' : argsVariant) ||
69
74
  (await inquirer_1.default.prompt([
70
75
  {
71
76
  name: 'variant',
@@ -77,7 +82,7 @@ async function main() {
77
82
  await fs_extra_1.default.mkdir(projectPath, {
78
83
  recursive: true,
79
84
  });
80
- const steps = 3;
85
+ const steps = noCi ? 2 : 3;
81
86
  console.log(`\n[1/${steps}] Copying files...`);
82
87
  const basePath = path_1.default.join(__dirname, 'template');
83
88
  for (const file of await fs_extra_1.default.readdir(basePath)) {
@@ -101,11 +106,24 @@ dist
101
106
 
102
107
  # VIM
103
108
  Session.vim
109
+ .vim/
110
+
111
+ # Other private editor folders
112
+ .nvim/
113
+ .emacs/
114
+ .helix/
104
115
  `);
105
116
  for (const file of FILES_WITH_NAME_TEMPLATE) {
106
117
  await fs_extra_1.default.writeFile(path_1.default.join(projectPath, file), (await fs_extra_1.default.readFile(path_1.default.join(basePath, file))).toString().replace(NAME_TEMPLATE, name));
107
118
  }
108
- console.log(`[2/${steps}] Installing dependencies...\n`);
119
+ if (noCi) {
120
+ console.log(`[2/${steps}] Skipping dependencies, git init and contract creation...\n`);
121
+ printResultingUsageDetails(desiredProjectName, noCi);
122
+ return;
123
+ }
124
+ else {
125
+ console.log(`[2/${steps}] Installing dependencies...\n`);
126
+ }
109
127
  const execOpts = {
110
128
  stdio: 'inherit',
111
129
  cwd: projectPath,
@@ -145,6 +163,9 @@ Session.vim
145
163
  catch (e) {
146
164
  console.error('Failed to initialize git repository:', e.toString());
147
165
  }
166
+ printResultingUsageDetails(desiredProjectName, noCi);
167
+ }
168
+ function printResultingUsageDetails(desiredProjectName, noCi) {
148
169
  console.log(`Success!`);
149
170
  console.log(chalk_1.default.blueBright(`
150
171
  ____ _ _ _ _____ ____ ____ ___ _ _ _____
@@ -154,7 +175,13 @@ Session.vim
154
175
  |____/|_____\\___/|_____|_| |_| \\_\\___|_| \\_| |_| `));
155
176
  console.log(chalk_1.default.blue(` TON development for professionals`));
156
177
  console.log(``);
157
- console.log(`Your new project is ready, available commands:`);
178
+ if (noCi) {
179
+ console.log(`Your new project is almost ready!`);
180
+ console.log(`Install dependencies before running available commands:`);
181
+ }
182
+ else {
183
+ console.log(`Your new project is ready, available commands:`);
184
+ }
158
185
  console.log(``);
159
186
  console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`cd ${desiredProjectName}`));
160
187
  console.log(` change directory to your new project`);
@@ -166,10 +193,10 @@ Session.vim
166
193
  console.log(` run the default project test suite`);
167
194
  console.log(``);
168
195
  console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`npx blueprint run`));
169
- console.log(` choose a script and run it (eg. a deploy script)`);
196
+ console.log(` choose a script and run it (e.g., a deploy script)`);
170
197
  console.log(``);
171
198
  console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`npx blueprint create AnotherContract`));
172
- console.log(` create all the necessary files for another new contract`);
199
+ console.log(` create a new contract and all related necessary files`);
173
200
  console.log(``);
174
201
  console.log(`For help and docs visit https://github.com/ton-community/blueprint`);
175
202
  console.log(``);
@@ -2,26 +2,27 @@
2
2
  "name": "{{name}}",
3
3
  "version": "0.0.1",
4
4
  "scripts": {
5
+ "bp": "blueprint",
5
6
  "start": "blueprint run",
6
7
  "build": "blueprint build",
7
8
  "test": "jest --verbose"
8
9
  },
9
10
  "devDependencies": {
10
- "@ton/blueprint": "^0.28.0",
11
- "@ton/sandbox": "^0.24.0",
11
+ "@ton/blueprint": "^0.29.0",
12
+ "@ton/sandbox": "^0.28.0",
12
13
  "@ton/test-utils": "^0.5.0",
13
14
  "@types/jest": "^29.5.14",
14
- "@types/node": "^22.10.7",
15
+ "@types/node": "^22.14.0",
15
16
  "jest": "^29.7.0",
16
- "prettier": "^3.4.2",
17
- "@ton/ton": "^15.1.0",
17
+ "prettier": "^3.5.3",
18
+ "@ton/ton": "^15.2.1",
18
19
  "@ton/core": "~0",
19
20
  "@ton/crypto": "^3.3.0",
20
- "ts-jest": "^29.2.5",
21
+ "ts-jest": "^29.3.1",
21
22
  "ts-node": "^10.9.2",
22
- "typescript": "^5.7.3",
23
- "@ton/tolk-js": "^0.6.0",
24
- "@tact-lang/compiler": "^1.5.3",
25
- "@ton-community/func-js": "^0.9.0"
23
+ "typescript": "^5.8.3",
24
+ "@ton/tolk-js": "^0.10.0",
25
+ "@tact-lang/compiler": "^1.6.5",
26
+ "@ton-community/func-js": "^0.9.1"
26
27
  }
27
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ton",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "license": "MIT",
5
5
  "description": "Tool to quickly create TON projects",
6
6
  "author": "TonTech",