axe-api 1.4.0-beta-2 → 1.4.0-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bin/axe ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require("../cli/index").cli(process.argv);
@@ -0,0 +1,33 @@
1
+ const shell = require("shelljs");
2
+ const rimraf = require("rimraf");
3
+ const fs = require("fs");
4
+ require("colors");
5
+
6
+ module.exports = async function (name, options) {
7
+ let errors = null;
8
+
9
+ console.log(`Directory name would be: ${name}`.green);
10
+
11
+ console.log("Pulling example Axe API project...".yellow);
12
+ await shell.exec(
13
+ `git clone https://github.com/axe-api/axe-api-template.git ${name}`
14
+ );
15
+
16
+ errors = shell.error();
17
+ if (errors !== null) {
18
+ console.log("Some errors have occured!".red);
19
+ shell.exit(0);
20
+ }
21
+
22
+ console.log("Creating .env file");
23
+
24
+ await fs.renameSync(`${name}/.env.example`, `${name}/.env`);
25
+ await rimraf.sync(`${name}/.git`);
26
+ console.log(`The project has been created!`.green);
27
+ console.log(`
28
+ Usage:
29
+
30
+ $ cd ${name}
31
+ $ npm install & npm run start:dev
32
+ `);
33
+ };
@@ -0,0 +1,15 @@
1
+ const { Command } = require("commander");
2
+ const program = new Command();
3
+ const newCommand = require("./Commands/NewCommand");
4
+
5
+ program.name("axe-magic").description("AXE API CLI tool").version("2.0.0");
6
+
7
+ program
8
+ .command("new")
9
+ .description("Create a new Axe API project.")
10
+ .argument("<project-name>", "The name of the project")
11
+ .action(newCommand);
12
+
13
+ module.exports = {
14
+ cli: () => program.parse(),
15
+ };
@@ -0,0 +1,3 @@
1
+ const { cli } = require("./index");
2
+
3
+ cli(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "1.4.0-beta-2",
3
+ "version": "1.4.0-beta-3",
4
4
  "description": "AXE API is a simple tool to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "access": "public"
34
34
  },
35
35
  "scripts": {
36
- "build": "rm -rf build && tsc && rm -rf build/dev-kit",
36
+ "build": "rm -rf build && tsc && rm -rf build/dev-kit && cp -r ./cli ./build/cli && cp -r ./bin ./build/bin",
37
37
  "build:watch": "tsc -w",
38
38
  "dev-kit": "tsx watch dev-kit.ts",
39
39
  "dev-kit:install": "node ./scripts/dev-kit-install.js",