create-web3-dapp-dev
Version:
<p align="center"> <br /> <a href="https://createweb3dapp.alchemy.com"> <img src=".github/images/cw3d-logo.png" width="200" alt=""/></a> <br /> </p>
44 lines ⢠2.44 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import path from "path";
import { installDependencies } from "./dependenciesInstaller.js";
import { mkdir } from "../utils/mkdir.js";
import { getProjectFiles } from "./getProjectFiles.js";
import context from "./context.js";
import { LogLevel, selfDestroy } from "./selfDestroy.js";
import chalk from "chalk";
import { buildSmartContract } from "../smartContractsWizard/smartContractBuilder.js";
export const generateDapp = () => __awaiter(void 0, void 0, void 0, function* () {
try {
const steps = context.dappInfo.hasSmartContract ? 4 : 3;
let currentStep = 1;
console.log(`[0/${steps}] š Creating your dapp boilerplates`);
console.log(`[${currentStep}/${steps}] š Setting up the directory...`);
if (context.resolvedProjectPath)
mkdir(context.resolvedProjectPath);
currentStep++;
console.log(`[${currentStep}/${steps}] š¾ Dowloading project files...`);
getProjectFiles(context);
currentStep++;
if (context.dappInfo.hasSmartContract && context.contractInfo) {
console.log(`[${currentStep}/${steps}] š Creating the smart contract`);
currentStep++;
buildSmartContract(context.contractInfo, path.join(process.cwd(), "backend"));
}
console.log(`[${currentStep}/${steps}] š§ Installing the dependencies - this might take a while, in the meantime:`);
console.log(chalk.blue(`\nš Visit the docs: https://docs.alchemy.com/docs/create-web3-dapp\nšØ Check out the components: https://createweb3dapp.alchemy.com/\n`));
currentStep++;
yield installDependencies(context);
}
catch (e) {
selfDestroy(e, LogLevel.ERROR);
}
});
//# sourceMappingURL=generateDapp.js.map