Skip to content

Commit

Permalink
Better project initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
skymen committed Jan 19, 2025
1 parent 2e47e78 commit bc850cf
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 3 deletions.
21 changes: 21 additions & 0 deletions build/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import fs from "fs";
import open from "open";
import { execSync } from "child_process";
import * as chalkUtils from "./chalkUtils";
import fromConsole from "./fromConsole";

export default function initialiseProject() {
console.log(execSync("npm install"));
console.log(execSync("npm run updateProjectData"));
if (!fs.existsSync(".git")) {
console.log(execSync("git init"));
console.log(execSync("git add -A"));
console.log(execSync('git commit -m "Initial commit"'));
open("https://github.com/new");
}
}

if (fromConsole(import.meta.url)) {
chalkUtils.fromCommandLine();
initialiseProject();
}
143 changes: 143 additions & 0 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"joi": "^17.13.3",
"vite": "^6.0.7",
"webpack-cli": "^6.0.1",
"yocto-spinner": "^0.1.2"
"yocto-spinner": "^0.1.2",
"open": "^10.1.0"
},
"type": "module",
"scripts": {
Expand All @@ -21,8 +22,9 @@
"build": "cd build && node build.js",
"dev": "cd build && node dev.js",
"updateProjectData": "cd build && node updateProjectData.js",
"init": "npm install && npm run updateProjectData",
"init": "npm install && cd build && node init.js",
"generateDocs": "cd build && node generateDocumentation.js",
"publish": "cd build && node publish.js"
}
},
"dependencies": {}
}

0 comments on commit bc850cf

Please sign in to comment.