Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"dotenv": "^17.0.0",
"ethers": "^6.13.4",
"fs-extra": "^11.3.0",
"giget": "^2.0.0",
"genlayer-js": "^0.18.9",
"inquirer": "^12.0.0",
"keytar": "^7.9.0",
Expand Down
19 changes: 9 additions & 10 deletions src/commands/scaffold/new.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import fs from "fs-extra";
import path from "path";
import { fileURLToPath } from "url";
import { downloadTemplate } from "giget";
import { BaseAction } from "../../lib/actions/BaseAction";

export class NewAction extends BaseAction {
private templatePath: string;

constructor() {
super();
const __filename = fileURLToPath(import.meta.url);
const basePath = path.resolve(path.dirname(__filename), "..");
this.templatePath = path.join(basePath, "templates", "default");
}
private readonly templateSource = "github:genlayerlabs/genlayer-project-boilerplate#v0.2.0";

async createProject(projectName: string, options: { path: string; overwrite: boolean }) {
const targetPath = path.resolve(options.path, projectName);
Expand All @@ -25,7 +18,13 @@ export class NewAction extends BaseAction {
this.startSpinner(`Creating new GenLayer project: ${projectName}`);

try {
fs.copySync(this.templatePath, targetPath);
await downloadTemplate(this.templateSource, {
dir: targetPath,
force: options.overwrite,
offline: false,
install: false,
});

this.succeedSpinner(`Project "${projectName}" created successfully at ${targetPath}`);
} catch (error) {
this.failSpinner(`Error creating project "${projectName}"`, error);
Expand Down
21 changes: 0 additions & 21 deletions templates/default/LICENSE

This file was deleted.

101 changes: 0 additions & 101 deletions templates/default/README.md

This file was deleted.

Empty file removed templates/default/__init__.py
Empty file.
2 changes: 0 additions & 2 deletions templates/default/app/.env.example

This file was deleted.

24 changes: 0 additions & 24 deletions templates/default/app/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions templates/default/app/.vscode/extensions.json

This file was deleted.

5 changes: 0 additions & 5 deletions templates/default/app/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions templates/default/app/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions templates/default/app/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions templates/default/app/postcss.config.js

This file was deleted.

Binary file removed templates/default/app/public/favicon.png
Binary file not shown.
16 changes: 0 additions & 16 deletions templates/default/app/src/App.vue

This file was deleted.

Loading