New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-ton-project

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-ton-project - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

dist/template/variants/counter/contracts/counter.fc

62

dist/cli.js

@@ -11,2 +11,3 @@ #!/usr/bin/env node

const readline_1 = __importDefault(require("readline"));
const inquirer_1 = __importDefault(require("inquirer"));
const PACKAGE_JSON = 'package.json';

@@ -23,17 +24,66 @@ function question(q) {

async function main() {
const defaultName = path_1.default.basename(process.cwd());
let name = (await question(`Project name? (${defaultName}) `)).trim();
const { name, variant } = await inquirer_1.default.prompt([
{
name: 'name',
message: 'Project name',
},
{
name: 'variant',
message: 'Choose the project template',
type: 'list',
choices: [
{
name: 'An empty contract',
value: 'empty',
},
{
name: 'A simple counter contract',
value: 'counter',
},
]
}
]);
if (name.length === 0)
name = defaultName;
throw new Error('Cannot initialize a project with an empty name');
await fs_extra_1.default.mkdir(name);
const steps = 2;
console.log(`[1/${steps}] Copying files...`);
const basePath = path_1.default.join(__dirname, 'template');
for (const file of await fs_extra_1.default.readdir(basePath)) {
if (file === PACKAGE_JSON)
if (file === PACKAGE_JSON || file === 'variants')
continue;
await fs_extra_1.default.copy(path_1.default.join(basePath, file), file);
await fs_extra_1.default.copy(path_1.default.join(basePath, file), path_1.default.join(name, file));
}
await fs_extra_1.default.writeFile(PACKAGE_JSON, (await fs_extra_1.default.readFile(path_1.default.join(basePath, PACKAGE_JSON))).toString().replace('{{name}}', name));
const variantPath = path_1.default.join(basePath, 'variants', variant);
for (const file of await fs_extra_1.default.readdir(variantPath)) {
await fs_extra_1.default.copy(path_1.default.join(variantPath, file), path_1.default.join(name, file));
}
await fs_extra_1.default.writeFile(path_1.default.join(name, PACKAGE_JSON), (await fs_extra_1.default.readFile(path_1.default.join(basePath, PACKAGE_JSON))).toString().replace('{{name}}', name));
console.log(`[2/${steps}] Installing dependencies...`);
(0, child_process_1.execSync)('npm i', {
stdio: 'inherit',
cwd: name,
});
(0, child_process_1.execSync)('git init', {
stdio: 'inherit',
cwd: name,
});
console.log('\nInitialized git repository.\n');
console.log(`Success!
Now you can run the following to run the default tests:
cd ${name}
npm run test
You can also run the following commands in your project's directory:
npx blueprint create MyContract
creates all the necessary files for a new contract
npx blueprint build
asks you to choose a contract and builds it
npx blueprint run
asks you to choose a script and runs it
`);
}
main().catch(console.error);

2

dist/template/package.json

@@ -9,3 +9,3 @@ {

"devDependencies": {
"@ton-community/blueprint": "^0.0.1-alpha.3",
"@ton-community/blueprint": "^0.0.1",
"@ton-community/sandbox": "^0.2.0",

@@ -12,0 +12,0 @@ "@ton-community/test-utils": "^0.0.2",

{
"name": "create-ton-project",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -21,9 +21,11 @@ "description": "Tool to quickly create TON projects",

"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.11.18",
"typescript": "^4.9.5",
"@types/fs-extra": "^11.0.1"
"@types/inquirer": "^8.0.0"
},
"dependencies": {
"fs-extra": "^11.1.0"
"fs-extra": "^11.1.0",
"inquirer": "^8.0.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc