create-ton 0.6.0 → 0.8.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 +12 -0
- package/README.md +16 -1
- package/dist/cli.js +10 -6
- package/dist/template/package.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ 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.8.0] - 2023-08-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added flag `--path` to specify where the project should be initialized, defaults to the project name
|
|
13
|
+
|
|
14
|
+
## [0.7.0] - 2023-08-20
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Changed template ton-core dependency to ^0.51.0, ton to ~13.6.0, which fixes dependency tree problems
|
|
19
|
+
|
|
8
20
|
## [0.6.0] - 2023-08-08
|
|
9
21
|
|
|
10
22
|
### Added
|
package/README.md
CHANGED
|
@@ -2,4 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This is an entry point script for the Blueprint development tool
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create ton
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
(or using other package managers)
|
|
12
|
+
|
|
13
|
+
If you want to input data non-interactively (for example, in scripts), do:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm create ton -- project-dir --type first-contract-type --contractName FirstContractName
|
|
17
|
+
```
|
|
18
|
+
where `first-contract-type` can currently be one of `func-empty`, `func-counter`, `tact-empty`, `tact-counter`
|
|
19
|
+
|
|
20
|
+
For more details please go to https://github.com/ton-org/blueprint
|
package/dist/cli.js
CHANGED
|
@@ -35,6 +35,7 @@ async function main() {
|
|
|
35
35
|
const localArgs = (0, arg_1.default)({
|
|
36
36
|
'--type': String,
|
|
37
37
|
'--contractName': String,
|
|
38
|
+
'--path': String,
|
|
38
39
|
});
|
|
39
40
|
const name = localArgs._[0] ||
|
|
40
41
|
(await inquirer_1.default.prompt({
|
|
@@ -64,26 +65,29 @@ async function main() {
|
|
|
64
65
|
choices: VARIANT_CHOICES,
|
|
65
66
|
},
|
|
66
67
|
])).variant;
|
|
67
|
-
|
|
68
|
+
const projectPath = localArgs['--path'] || name;
|
|
69
|
+
await fs_extra_1.default.mkdir(projectPath, {
|
|
70
|
+
recursive: true,
|
|
71
|
+
});
|
|
68
72
|
const steps = 3;
|
|
69
73
|
console.log(`\n[1/${steps}] Copying files...`);
|
|
70
74
|
const basePath = path_1.default.join(__dirname, 'template');
|
|
71
75
|
for (const file of await fs_extra_1.default.readdir(basePath)) {
|
|
72
76
|
if (FILES_WITH_NAME_TEMPLATE.includes(file))
|
|
73
77
|
continue;
|
|
74
|
-
await fs_extra_1.default.copy(path_1.default.join(basePath, file), path_1.default.join(
|
|
78
|
+
await fs_extra_1.default.copy(path_1.default.join(basePath, file), path_1.default.join(projectPath, file));
|
|
75
79
|
}
|
|
76
|
-
await fs_extra_1.default.writeFile(path_1.default.join(
|
|
80
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, '.gitignore'), `node_modules
|
|
77
81
|
temp
|
|
78
82
|
build
|
|
79
83
|
`);
|
|
80
84
|
for (const file of FILES_WITH_NAME_TEMPLATE) {
|
|
81
|
-
await fs_extra_1.default.writeFile(path_1.default.join(
|
|
85
|
+
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));
|
|
82
86
|
}
|
|
83
87
|
console.log(`[2/${steps}] Installing dependencies...\n`);
|
|
84
88
|
const execOpts = {
|
|
85
89
|
stdio: 'inherit',
|
|
86
|
-
cwd:
|
|
90
|
+
cwd: projectPath,
|
|
87
91
|
};
|
|
88
92
|
const pkgManager = (process.env.npm_config_user_agent ?? 'npm/').split(' ')[0].split('/')[0];
|
|
89
93
|
switch (pkgManager) {
|
|
@@ -125,7 +129,7 @@ build
|
|
|
125
129
|
console.log(``);
|
|
126
130
|
console.log(`Your new project is ready, available commands:`);
|
|
127
131
|
console.log(``);
|
|
128
|
-
console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`cd ${
|
|
132
|
+
console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`cd ${projectPath}`));
|
|
129
133
|
console.log(` change directory to your new project`);
|
|
130
134
|
console.log(``);
|
|
131
135
|
console.log(chalk_1.default.greenBright(` > `) + chalk_1.default.cyanBright(`npx blueprint build`));
|