Skip to content

Commit 4266f81

Browse files
Merge pull request #122 from godspeedsystems/feat/gs-tools
Feat/gs tools
2 parents f8ad487 + 1733c2d commit 4266f81

6 files changed

Lines changed: 239 additions & 50 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ lib/*
55
dist-test/*
66
sandbox/*
77
.vscode/
8+
pnpm-lock.yaml
9+
pnpm-workspace.yaml
10+
.DS_Store

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Once installed, run godspeed from your terminal to see the available commands an
5858
| plugins | | manage eventsource and datasource plugins for godspeed. |
5959
| gen-crud-api | | scans your prisma datasources and generate CRUD APIs events and workflows |
6060
| gen-graphql-schema | | scans your graphql events and generate graphql schema . |
61+
| tools | | Extra godspeed tools. |
6162

6263

6364
## 📖 Documentation <a name="Documentation"></a>

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"glob": "10.3.4",
3535
"inquirer": "^8.2.5",
3636
"js-yaml": "^4.1.0",
37+
"json-schema": "^0.4.0",
3738
"lodash": "^4.17.21",
3839
"mocha": "^10.2.0",
3940
"path": "^0.12.7",
@@ -43,7 +44,8 @@
4344
"rimraf": "^6.0.1",
4445
"signale": "^1.4.0",
4546
"simple-git": "^3.7.1",
46-
"sinon": "^16.0.0"
47+
"sinon": "^16.0.0",
48+
"yaml": "^2.8.1"
4749
},
4850
"devDependencies": {
4951
"@types/chai": "^4.3.6",
@@ -55,6 +57,7 @@
5557
"@types/handlebars-helpers": "^0.5.3",
5658
"@types/inquirer": "^9.0.3",
5759
"@types/js-yaml": "^4.0.5",
60+
"@types/json-schema": "^7.0.15",
5861
"@types/mocha": "^10.0.1",
5962
"@types/node": "^18.17.14",
6063
"@types/proxyquire": "^1.3.29",

src/commands/create/index.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fsExtras = require("fs-extra");
2-
import path from "path"
2+
import path from "path";
33

44
// import interactiveMode from "../../utils/interactiveMode";
55
// import {
@@ -9,7 +9,8 @@ import path from "path"
99
// } from "../../utils/dockerUtility";
1010
// import checkPrerequisite from "../../utils/checkPrerequisite";
1111
import {
12-
installDependencies, installPackage,
12+
installDependencies,
13+
installPackage,
1314
validateAndCreateProjectDirectory,
1415
} from "../../utils/index";
1516
import { copyingLocalTemplate } from "../../utils";
@@ -77,30 +78,31 @@ export default async function create(
7778
const gitFilePath = path.join(process.cwd(), projectName, ".git");
7879
fsExtras.removeSync(gitFilePath);
7980

80-
81-
82-
if(options.fromExample === 'mongo-as-prisma'){
83-
await installPackage(projectDirPath,'@godspeedsystems/plugins-prisma-as-datastore')
84-
}
81+
if (options.fromExample === "mongo-as-prisma") {
82+
await installPackage(
83+
projectDirPath,
84+
"@godspeedsystems/plugins-prisma-as-datastore"
85+
);
86+
}
8587
await installDependencies(projectDirPath, projectName);
8688

89+
// Delete .template folder in project folder.
90+
const templateFilePath = path.join(process.cwd(), projectName, ".template");
91+
92+
if (fsExtras.existsSync(templateFilePath)) {
93+
fsExtras.removeSync(templateFilePath);
94+
}
8795

8896
try {
8997
// the NEW flow [without containers]
90-
91-
9298
// const composeOptions = await getComposeOptions();
93-
9499
// if (composeOptions.composeOptions) {
95100
// composeOptions.composeOptions.push(`${projectName}_devcontainer`);
96101
// }
97-
98102
// composeOptions.cwd = path.resolve(projectDirPath, ".devcontainer");
99103
// composeOptions.log = process.env.DEBUG ? Boolean(process.env.DEBUG) : false;
100-
101104
// // check if there are already running resources
102105
// await prepareToStartContainers(projectName, composeOptions);
103-
104106
// await buildContainers(
105107
// projectName,
106108
// godspeedOptions,

0 commit comments

Comments
 (0)