flash-builder 1.0.0

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.
Files changed (3) hide show
  1. package/README.md +15 -0
  2. package/package.json +41 -0
  3. package/src/index.ts +71 -0
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # flash-builder
2
+
3
+ To install dependencies:
4
+
5
+ ```bash
6
+ bun install
7
+ ```
8
+
9
+ To run:
10
+
11
+ ```bash
12
+ bun run index.ts
13
+ ```
14
+
15
+ This project was created using `bun init` in bun v1.3.6. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "flash-builder",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "homepage": "https://github.com/jefripunza/flash-builder-cli#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/jefripunza/flash-builder-cli.git"
9
+ },
10
+ "bugs": "https://github.com/jefripunza/flash-builder-cli/issues",
11
+ "author": "Jefri Herdi Triyanto <jefripunza@gmail.com>",
12
+ "license": "MIT",
13
+ "types": "./src/index.d.ts",
14
+ "bin": {
15
+ "fbi": "./src/index.ts"
16
+ },
17
+ "type": "module",
18
+ "scripts": {
19
+ "start": "bun run src/index.ts",
20
+ "build": "bun build ./src/index.ts --compile --outfile fbi"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "keywords": [
27
+ "flash builder",
28
+ "cli",
29
+ "bun"
30
+ ],
31
+ "dependencies": {
32
+ "dotenv": "^17.2.4",
33
+ "meow": "^14.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/bun": "latest"
37
+ },
38
+ "peerDependencies": {
39
+ "typescript": "^5"
40
+ }
41
+ }
package/src/index.ts ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env bun
2
+
3
+ // third party
4
+ import meow from "meow";
5
+
6
+ // banner
7
+ import banner from "./banner";
8
+
9
+ // environment
10
+ import "./environment";
11
+
12
+ // commands
13
+ import { beCommand } from "./commands/be/index";
14
+ import { mcpCommand } from "./commands/mcp/index";
15
+ import { syncCommand } from "./commands/sync/index";
16
+
17
+ const cli = meow(
18
+ `
19
+ ${banner}
20
+ Usage
21
+ $ fbi <command> [options]
22
+
23
+ Commands
24
+ be <project-name> Initialize a new backend project
25
+ mcp <project-name> Initialize a new mcp server project
26
+ sync Sync the current backend interface with the application target
27
+
28
+ Options
29
+ --verbose, -v Enable verbose logging
30
+ --help, -h Show this help message
31
+ --version Show version number
32
+
33
+ Examples
34
+ $ fbi be my-app
35
+ $ fbi mcp my-mcp-server
36
+ $ fbi sync
37
+ `,
38
+ {
39
+ importMeta: import.meta,
40
+ flags: {
41
+ verbose: {
42
+ type: "boolean",
43
+ shortFlag: "v",
44
+ default: false,
45
+ },
46
+ },
47
+ },
48
+ );
49
+
50
+ const [command, ...args] = cli.input;
51
+
52
+ switch (command) {
53
+ case "be":
54
+ beCommand(args[0] || "", cli.flags.verbose);
55
+ break;
56
+
57
+ case "mcp":
58
+ mcpCommand(args[0] || "", cli.flags.verbose);
59
+ break;
60
+
61
+ case "sync":
62
+ syncCommand(cli.flags.verbose);
63
+ break;
64
+
65
+ default:
66
+ if (command) {
67
+ console.error(`❌ Unknown command: ${command}`);
68
+ }
69
+ cli.showHelp();
70
+ process.exit(command ? 1 : 0);
71
+ }