create-ton 0.8.0 → 0.9.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,16 @@ 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.9.0] - 2023-08-28
9
+
10
+ ### Removed
11
+
12
+ - Removed flag `--path`
13
+
14
+ ### Changed
15
+
16
+ - The project name (asked interactively or passed in CLI non-interactively) is now resolved as a path to get the full project path, and the basename (last segment) of that path is taken as the actual project name. For example, running `create-ton .` in a directory named `test-project` will create the project in that very directory (without creating any subdirectories) with the name `test-project`
17
+
8
18
  ## [0.8.0] - 2023-08-28
9
19
 
10
20
  ### Added
package/dist/cli.js CHANGED
@@ -35,13 +35,14 @@ async function main() {
35
35
  const localArgs = (0, arg_1.default)({
36
36
  '--type': String,
37
37
  '--contractName': String,
38
- '--path': String,
39
38
  });
40
- const name = localArgs._[0] ||
39
+ const desiredProjectName = localArgs._[0] ||
41
40
  (await inquirer_1.default.prompt({
42
41
  name: 'name',
43
42
  message: 'Project name',
44
43
  })).name.trim();
44
+ const projectPath = path_1.default.resolve(desiredProjectName);
45
+ const name = path_1.default.basename(projectPath);
45
46
  if (name.length === 0)
46
47
  throw new Error('Cannot initialize a project with an empty name');
47
48
  const contractName = localArgs['--contractName'] ||
@@ -65,7 +66,6 @@ async function main() {
65
66
  choices: VARIANT_CHOICES,
66
67
  },
67
68
  ])).variant;
68
- const projectPath = localArgs['--path'] || name;
69
69
  await fs_extra_1.default.mkdir(projectPath, {
70
70
  recursive: true,
71
71
  });
@@ -129,7 +129,7 @@ build
129
129
  console.log(``);
130
130
  console.log(`Your new project is ready, available commands:`);
131
131
  console.log(``);
132
- console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`cd ${projectPath}`));
132
+ console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`cd ${desiredProjectName}`));
133
133
  console.log(` change directory to your new project`);
134
134
  console.log(``);
135
135
  console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`npx blueprint build`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ton",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "description": "Tool to quickly create TON projects",
6
6
  "author": "TonTech",