enact-cli 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.
- package/LICENSE +19 -0
- package/README.md +154 -0
- package/dist/enact +0 -0
- package/dist/index.js +1250 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) {{ year }} {{ organization }}
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
14
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
15
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
16
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
17
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
18
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
19
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
## Development
|
|
2
|
+
|
|
3
|
+
This section provides instructions for setting up your development environment and contributing to the Enact CLI.
|
|
4
|
+
|
|
5
|
+
### Prerequisites
|
|
6
|
+
|
|
7
|
+
* **Bun:** This project is built using Bun. Ensure you have Bun installed on your system. You can find installation instructions on the [official Bun website](https://bun.sh/).
|
|
8
|
+
* **Node.js (optional):** While Bun is the primary runtime, having Node.js installed can be helpful for certain development tools. You can download it from [nodejs.org](https://nodejs.org/).
|
|
9
|
+
|
|
10
|
+
### Getting Started
|
|
11
|
+
|
|
12
|
+
1. **Clone the repository:**
|
|
13
|
+
```bash
|
|
14
|
+
git clone <repository-url>
|
|
15
|
+
cd enact-cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. **Install dependencies:**
|
|
19
|
+
```bash
|
|
20
|
+
bun install
|
|
21
|
+
```
|
|
22
|
+
This command will install all the necessary dependencies listed in your `package.json` file.
|
|
23
|
+
|
|
24
|
+
3. **Build and install locally:**
|
|
25
|
+
```bash
|
|
26
|
+
chmod +x deploy
|
|
27
|
+
./deploy
|
|
28
|
+
```
|
|
29
|
+
This creates a standalone binary and installs it to your PATH so you can use `enact` commands globally.
|
|
30
|
+
|
|
31
|
+
### Development Workflow
|
|
32
|
+
|
|
33
|
+
1. **Make changes:** Create a new branch for your feature or bug fix:
|
|
34
|
+
```bash
|
|
35
|
+
git checkout -b feature/your-feature-name
|
|
36
|
+
# or
|
|
37
|
+
git checkout -b bugfix/your-bug-fix
|
|
38
|
+
```
|
|
39
|
+
Make your code changes in the `src/` directory.
|
|
40
|
+
|
|
41
|
+
2. **Test during development:** You can run the CLI directly without building:
|
|
42
|
+
```bash
|
|
43
|
+
bun src/index.ts <command> [arguments] [options]
|
|
44
|
+
|
|
45
|
+
# Examples:
|
|
46
|
+
bun src/index.ts --help
|
|
47
|
+
bun src/index.ts publish
|
|
48
|
+
bun src/index.ts create my-tool
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. **Build and test the binary:** After making changes, rebuild and test:
|
|
52
|
+
```bash
|
|
53
|
+
./deploy
|
|
54
|
+
enact --version # Test the installed binary
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
4. **Run tests (when available):**
|
|
58
|
+
```bash
|
|
59
|
+
bun test
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. **Lint and format your code:**
|
|
63
|
+
```bash
|
|
64
|
+
bun run lint # Check for issues
|
|
65
|
+
bun run format # Format code
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
6. **Commit your changes:**
|
|
69
|
+
```bash
|
|
70
|
+
git add .
|
|
71
|
+
git commit -m "feat: Add your feature description"
|
|
72
|
+
```
|
|
73
|
+
Follow [conventional commit](https://conventionalcommits.org/) guidelines for better collaboration.
|
|
74
|
+
|
|
75
|
+
7. **Push and create PR:**
|
|
76
|
+
```bash
|
|
77
|
+
git push origin feature/your-feature-name
|
|
78
|
+
```
|
|
79
|
+
Then create a pull request on GitHub.
|
|
80
|
+
|
|
81
|
+
### Development Commands
|
|
82
|
+
|
|
83
|
+
| Command | Description |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| `bun src/index.ts` | Run CLI directly from source |
|
|
86
|
+
| `./deploy` | Build and install binary to PATH |
|
|
87
|
+
| `bun test` | Run test suite |
|
|
88
|
+
| `bun run lint` | Check code style |
|
|
89
|
+
| `bun run format` | Format code |
|
|
90
|
+
|
|
91
|
+
### Project Structure
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
src/
|
|
95
|
+
├── index.ts # CLI entry point
|
|
96
|
+
├── commands/ # Command implementations
|
|
97
|
+
│ ├── publish.ts # Publish command
|
|
98
|
+
│ ├── create.ts # Create command
|
|
99
|
+
│ └── remote.ts # Remote management
|
|
100
|
+
└── utils/ # Shared utilities
|
|
101
|
+
├── help.ts # Help system
|
|
102
|
+
├── logger.ts # Logging utilities
|
|
103
|
+
├── config.ts # Configuration management
|
|
104
|
+
└── version.ts # Version display
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Building for Release
|
|
108
|
+
|
|
109
|
+
To build standalone binaries for distribution:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Single platform (current system)
|
|
113
|
+
bun build src/index.ts --compile --outfile=dist/enact
|
|
114
|
+
|
|
115
|
+
# Multiple platforms
|
|
116
|
+
bun build src/index.ts --compile --target=bun-linux-x64 --outfile=dist/enact-linux
|
|
117
|
+
bun build src/index.ts --compile --target=bun-darwin-x64 --outfile=dist/enact-macos
|
|
118
|
+
bun build src/index.ts --compile --target=bun-windows-x64 --outfile=dist/enact.exe
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Debugging
|
|
122
|
+
|
|
123
|
+
For debugging during development:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Run with debug output
|
|
127
|
+
DEBUG=* bun src/index.ts <command>
|
|
128
|
+
|
|
129
|
+
# Or set log level in code
|
|
130
|
+
# See src/utils/logger.ts for LogLevel options
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Contributing Guidelines
|
|
134
|
+
|
|
135
|
+
- Follow TypeScript best practices
|
|
136
|
+
- Add tests for new features
|
|
137
|
+
- Update documentation for any CLI changes
|
|
138
|
+
- Use conventional commit messages
|
|
139
|
+
- Ensure the binary builds successfully before submitting PRs
|
|
140
|
+
|
|
141
|
+
### Troubleshooting
|
|
142
|
+
|
|
143
|
+
**Binary not found after build:**
|
|
144
|
+
- Ensure `~/.local/bin` is in your PATH
|
|
145
|
+
- Try restarting your terminal
|
|
146
|
+
- Run `source ~/.bashrc` (or your shell profile)
|
|
147
|
+
|
|
148
|
+
**Permission denied:**
|
|
149
|
+
- Make sure deploy script is executable: `chmod +x deploy`
|
|
150
|
+
- Check that `~/.local/bin` has write permissions
|
|
151
|
+
|
|
152
|
+
**Bun build fails:**
|
|
153
|
+
- Ensure you're using a recent version of Bun (`bun --version`)
|
|
154
|
+
- Check for TypeScript errors: `bun check src/index.ts`
|
package/dist/enact
ADDED
|
Binary file
|