launchts 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/.husky/pre-commit +4 -0
- package/.prettierrc +6 -0
- package/CHANGELOG.md +56 -0
- package/CONTRIBUTING.md +280 -0
- package/LICENSE +18 -0
- package/README.md +304 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +269 -0
- package/dist/cli.js.map +1 -0
- package/dist/configs.d.ts +51 -0
- package/dist/configs.js +97 -0
- package/dist/configs.js.map +1 -0
- package/dist/generator.d.ts +3 -0
- package/dist/generator.js +302 -0
- package/dist/generator.js.map +1 -0
- package/dist/messages.d.ts +16 -0
- package/dist/messages.js +23 -0
- package/dist/messages.js.map +1 -0
- package/dist/types.d.ts +69 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/eslint.config.mjs +36 -0
- package/package.json +53 -0
- package/tsconfig.json +19 -0
package/.prettierrc
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2025-12-01
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Interactive CLI** with prompts for tool selection
|
|
13
|
+
- **Quick modes**: `--yes` (all tools) and `--default` (sensible defaults)
|
|
14
|
+
- **Modern TypeScript config**: ESNext target, NodeNext modules with ESM
|
|
15
|
+
- **Tool integrations**:
|
|
16
|
+
- ESLint with flat config (modern, non-deprecated)
|
|
17
|
+
- TypeScript ESLint v8+ (unified `typescript-eslint` package)
|
|
18
|
+
- Prettier with latest defaults (trailingComma: "all", printWidth: 80)
|
|
19
|
+
- Husky pre-commit hooks with lint-staged
|
|
20
|
+
- nodemon for dev auto-reload
|
|
21
|
+
- **Auto-generated README.md**: Adapts to selected tools with usage instructions
|
|
22
|
+
- **Git initialization** with optional first commit
|
|
23
|
+
- **Package manager detection**: npm, yarn, pnpm
|
|
24
|
+
- **Comprehensive test suite**: 39 tests with Vitest (unit, integration, e2e, messages)
|
|
25
|
+
- **Complete documentation**: README and CONTRIBUTING guides
|
|
26
|
+
- **CI/CD workflows**: GitHub Actions for quality checks and publishing
|
|
27
|
+
- **Dynamic version resolution**: No hardcoded dependency versions
|
|
28
|
+
- **Centralized messages**: All user-facing messages in `src/messages.ts` for maintainability
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
- Project scaffolding with configurable options
|
|
33
|
+
- Smart defaults for rapid prototyping
|
|
34
|
+
- Auto-format and lint staged files before commits
|
|
35
|
+
- Type-safe configuration with strict TypeScript
|
|
36
|
+
- Cross-platform support (Windows, macOS, Linux)
|
|
37
|
+
- Parallel file I/O for optimal performance
|
|
38
|
+
- Silent mode for check commands (no false error logs)
|
|
39
|
+
|
|
40
|
+
### Developer Experience
|
|
41
|
+
|
|
42
|
+
- Zero configuration needed to start
|
|
43
|
+
- Sensible defaults that just work
|
|
44
|
+
- Clear error messages and helpful tips
|
|
45
|
+
- Fully tested and production-ready
|
|
46
|
+
- Modern tooling and best practices (2024-2025)
|
|
47
|
+
|
|
48
|
+
### Code Quality
|
|
49
|
+
|
|
50
|
+
- **Modular architecture**: README generation split into 6 focused functions
|
|
51
|
+
- **Type safety**: Strict TypeScript with no implicit `any` types
|
|
52
|
+
- **Performance optimized**: Parallel I/O operations (Promise.all)
|
|
53
|
+
- **Clean codebase**: No dead code, all imports used
|
|
54
|
+
- **Comprehensive testing**: Unit tests for messages, E2E workflows, edge cases
|
|
55
|
+
|
|
56
|
+
[1.0.0]: https://github.com/Jszigeti/launchts/releases/tag/v1.0.0
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Contributing to launchts
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing!
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. **Fork and clone** the repository:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/Jszigeti/launchts.git
|
|
11
|
+
cd launchts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. **Install dependencies:**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. **Run tests:**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm test
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
4. **Try the CLI locally:**
|
|
27
|
+
```bash
|
|
28
|
+
npm run dev -- my-test-project
|
|
29
|
+
# or build and link
|
|
30
|
+
npm run build
|
|
31
|
+
npm link
|
|
32
|
+
launchts my-test-project
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Development Workflow
|
|
38
|
+
|
|
39
|
+
### Project Structure
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
src/
|
|
43
|
+
├── cli.ts # CLI entry point, command parsing, prompts
|
|
44
|
+
├── generator.ts # Core project generation logic
|
|
45
|
+
├── configs.ts # Tool configurations (ESLint, Prettier, etc.)
|
|
46
|
+
├── messages.ts # Centralized user-facing messages
|
|
47
|
+
└── types.ts # TypeScript type definitions
|
|
48
|
+
|
|
49
|
+
tests/
|
|
50
|
+
├── cli.integration.test.ts # CLI integration tests
|
|
51
|
+
├── flags.test.ts # Flag parsing tests
|
|
52
|
+
├── generator.test.ts # Generator unit tests
|
|
53
|
+
├── generator.error.test.ts # Error handling tests
|
|
54
|
+
├── options.test.ts # Tool injection tests
|
|
55
|
+
└── validation.test.ts # Input validation tests
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Available Scripts
|
|
59
|
+
|
|
60
|
+
| Command | Description |
|
|
61
|
+
| ------------------- | ----------------------------- |
|
|
62
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
63
|
+
| `npm run dev` | Run CLI directly with ts-node |
|
|
64
|
+
| `npm test` | Run tests in watch mode |
|
|
65
|
+
| `npm test -- --run` | Run tests once (CI mode) |
|
|
66
|
+
| `npm run lint` | Check for linting errors |
|
|
67
|
+
| `npm run format` | Format code with Prettier |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Testing Guidelines
|
|
72
|
+
|
|
73
|
+
### Writing Tests
|
|
74
|
+
|
|
75
|
+
All new features **must** include tests. We use [Vitest](https://vitest.dev/) for testing.
|
|
76
|
+
|
|
77
|
+
**Test categories:**
|
|
78
|
+
|
|
79
|
+
- **Unit tests** — Test individual functions in isolation
|
|
80
|
+
- **Integration tests** — Test CLI flows end-to-end
|
|
81
|
+
- **Error tests** — Verify error handling and edge cases
|
|
82
|
+
|
|
83
|
+
**Example test:**
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { describe, it, expect } from 'vitest';
|
|
87
|
+
import { createProject } from '../src/generator';
|
|
88
|
+
|
|
89
|
+
describe('myFeature', () => {
|
|
90
|
+
it('should do something specific', async () => {
|
|
91
|
+
// Arrange
|
|
92
|
+
const options = { name: 'test-project' };
|
|
93
|
+
|
|
94
|
+
// Act
|
|
95
|
+
await createProject(options);
|
|
96
|
+
|
|
97
|
+
// Assert
|
|
98
|
+
expect(result).toBe(expected);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Running Tests
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Watch mode (default)
|
|
107
|
+
npm test
|
|
108
|
+
|
|
109
|
+
# Run once (CI)
|
|
110
|
+
npm test -- --run
|
|
111
|
+
|
|
112
|
+
# Run specific test file
|
|
113
|
+
npm test -- generator.test.ts
|
|
114
|
+
|
|
115
|
+
# Run with coverage
|
|
116
|
+
npm test -- --coverage
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Code Style
|
|
122
|
+
|
|
123
|
+
We use **ESLint** and **Prettier** to maintain consistent code style.
|
|
124
|
+
|
|
125
|
+
### Before Committing
|
|
126
|
+
|
|
127
|
+
Run these commands to ensure your code passes CI:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm run lint # Check for linting errors
|
|
131
|
+
npm run format # Auto-format code
|
|
132
|
+
npm test -- --run # Run all tests
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Pre-commit Hooks
|
|
136
|
+
|
|
137
|
+
If you have Husky installed, these checks run automatically on commit. If not:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npm run prepare # Install Git hooks
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Style Guidelines
|
|
144
|
+
|
|
145
|
+
- **TypeScript:** Strict mode enabled, no `any` types
|
|
146
|
+
- **Imports:** Use absolute paths from `src/`
|
|
147
|
+
- **Functions:** Prefer named exports
|
|
148
|
+
- **Comments:** Use JSDoc for public APIs
|
|
149
|
+
- **Errors:** Use descriptive error messages with actionable tips
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Contribution Ideas
|
|
154
|
+
|
|
155
|
+
### Good First Issues
|
|
156
|
+
|
|
157
|
+
Look for issues labeled [`good first issue`](https://github.com/Jszigeti/launchts/labels/good%20first%20issue) — these are great for newcomers!
|
|
158
|
+
|
|
159
|
+
### Areas to Improve
|
|
160
|
+
|
|
161
|
+
- **New tools:** Add support for more dev tools (Jest, Vitest, etc.)
|
|
162
|
+
- **Templates:** Add project templates (Express, CLI, library)
|
|
163
|
+
- **Config options:** Expose more customization options
|
|
164
|
+
- **Documentation:** Improve examples, add tutorials
|
|
165
|
+
- **Performance:** Optimize file I/O, parallel operations
|
|
166
|
+
- **Error messages:** Better error handling with helpful tips
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Pull Request Process
|
|
171
|
+
|
|
172
|
+
1. **Create a branch:**
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
git checkout -b feature/my-awesome-feature
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. **Make your changes:**
|
|
179
|
+
- Write code
|
|
180
|
+
- Add/update tests
|
|
181
|
+
- Update documentation if needed
|
|
182
|
+
|
|
183
|
+
3. **Verify everything works:**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm run lint
|
|
187
|
+
npm run format
|
|
188
|
+
npm test -- --run
|
|
189
|
+
npm run build
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
4. **Commit with a clear message:**
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
git commit -m "feat: add support for Jest"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Use [conventional commits](https://www.conventionalcommits.org/):
|
|
199
|
+
- `feat:` New feature
|
|
200
|
+
- `fix:` Bug fix
|
|
201
|
+
- `docs:` Documentation changes
|
|
202
|
+
- `test:` Test changes
|
|
203
|
+
- `refactor:` Code refactoring
|
|
204
|
+
- `chore:` Maintenance tasks
|
|
205
|
+
|
|
206
|
+
5. **Push and create PR:**
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
git push origin feature/my-awesome-feature
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Then open a Pull Request on GitHub with:
|
|
213
|
+
- Clear description of changes
|
|
214
|
+
- Link to related issues
|
|
215
|
+
- Screenshots/examples if applicable
|
|
216
|
+
|
|
217
|
+
6. **Respond to feedback:**
|
|
218
|
+
- Address review comments
|
|
219
|
+
- Keep the PR focused and small
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Reporting Bugs
|
|
224
|
+
|
|
225
|
+
Found a bug? [Open an issue](https://github.com/Jszigeti/launchts/issues/new) with:
|
|
226
|
+
|
|
227
|
+
- **Title:** Clear, descriptive summary
|
|
228
|
+
- **Description:** What happened vs. what you expected
|
|
229
|
+
- **Steps to reproduce:** Minimal example to trigger the bug
|
|
230
|
+
- **Environment:** Node version, OS, package manager
|
|
231
|
+
- **Logs:** Any error messages or stack traces
|
|
232
|
+
|
|
233
|
+
**Example:**
|
|
234
|
+
|
|
235
|
+
```markdown
|
|
236
|
+
**Bug:** ESLint config not created when using --eslint
|
|
237
|
+
|
|
238
|
+
**Steps:**
|
|
239
|
+
|
|
240
|
+
1. Run `npx launchts my-app --eslint`
|
|
241
|
+
2. Check for `.eslintrc.json`
|
|
242
|
+
|
|
243
|
+
**Expected:** `.eslintrc.json` should exist
|
|
244
|
+
**Actual:** File is missing
|
|
245
|
+
|
|
246
|
+
**Environment:**
|
|
247
|
+
|
|
248
|
+
- Node: v20.10.0
|
|
249
|
+
- npm: 10.2.3
|
|
250
|
+
- OS: macOS 14.1
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Feature Requests
|
|
256
|
+
|
|
257
|
+
Have an idea? [Open a discussion](https://github.com/Jszigeti/launchts/discussions/new) or issue with:
|
|
258
|
+
|
|
259
|
+
- **Use case:** What problem does it solve?
|
|
260
|
+
- **Proposed solution:** How should it work?
|
|
261
|
+
- **Alternatives:** Other approaches you considered
|
|
262
|
+
- **Examples:** Similar features in other tools
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Code of Conduct
|
|
267
|
+
|
|
268
|
+
Be respectful, inclusive, and constructive. We're all here to build something great together!
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Recognition
|
|
273
|
+
|
|
274
|
+
Contributors are recognized in:
|
|
275
|
+
|
|
276
|
+
- Release notes
|
|
277
|
+
- GitHub contributors page
|
|
278
|
+
- Special shoutouts for significant contributions
|
|
279
|
+
|
|
280
|
+
Thank you for making `launchts` better! ❤️
|
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jonas Szigeti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# launchts
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/launchts)
|
|
4
|
+
[](https://www.npmjs.com/package/launchts)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/Jszigeti/launchts/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
**Fast, interactive CLI to scaffold production-ready TypeScript projects.**
|
|
9
|
+
|
|
10
|
+
Inspired by Vite's developer experience, `launchts` gets you from zero to coding in seconds with optional tooling, sensible defaults, and zero configuration.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Interactive mode (recommended)
|
|
18
|
+
npx launchts my-app
|
|
19
|
+
|
|
20
|
+
# Skip all prompts with sensible defaults
|
|
21
|
+
npx launchts my-app --default
|
|
22
|
+
|
|
23
|
+
# Enable everything instantly
|
|
24
|
+
npx launchts my-app --yes
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
That's it! Your TypeScript project is ready. Run `cd my-app && npm run dev` to start coding.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- **Zero Config** — Start coding immediately with TypeScript configured
|
|
34
|
+
- **Interactive Prompts** — Choose what you need (ESLint, Prettier, Husky, nodemon)
|
|
35
|
+
- **Smart Detection** — Auto-detects your package manager (npm/yarn/pnpm)
|
|
36
|
+
- **Optional Tooling** — Add linting, formatting, and git hooks on demand
|
|
37
|
+
- **Git Ready** — Optional git initialization with first commit
|
|
38
|
+
- **Battle Tested** — Comprehensive test suite with 39 passing tests
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### Interactive Mode
|
|
45
|
+
|
|
46
|
+
Simply run the command and answer the prompts:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx launchts my-project
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
You'll be asked about:
|
|
53
|
+
|
|
54
|
+
- **ESLint** — TypeScript linting with recommended rules
|
|
55
|
+
- **Prettier** — Code formatting with opinionated defaults
|
|
56
|
+
- **Husky** — Pre-commit hooks with lint-staged
|
|
57
|
+
- **nodemon** — Auto-reload dev script with ts-node
|
|
58
|
+
- **Git** — Initialize repository with .gitignore
|
|
59
|
+
- **Install** — Run `npm install` automatically
|
|
60
|
+
|
|
61
|
+
### Quick Modes
|
|
62
|
+
|
|
63
|
+
**Use sensible defaults** (Prettier only, git + install):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx launchts my-app --default
|
|
67
|
+
# or
|
|
68
|
+
npx launchts my-app -d
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Enable everything** (all tools: ESLint + Prettier + Husky + nodemon + git + install):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx launchts my-app --yes
|
|
75
|
+
# or
|
|
76
|
+
npx launchts my-app -y
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Custom Configuration
|
|
80
|
+
|
|
81
|
+
Mix and match options for your perfect setup:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Minimal: just TypeScript
|
|
85
|
+
npx launchts my-app --no-git --no-install
|
|
86
|
+
|
|
87
|
+
# Linting only
|
|
88
|
+
npx launchts my-app --eslint --prettier
|
|
89
|
+
|
|
90
|
+
# Full stack with specific package manager
|
|
91
|
+
npx launchts my-app --eslint --prettier --husky --nodemon --pm pnpm
|
|
92
|
+
|
|
93
|
+
# Git without initial commit
|
|
94
|
+
npx launchts my-app --git --no-commit
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## CLI Options
|
|
100
|
+
|
|
101
|
+
### Flags
|
|
102
|
+
|
|
103
|
+
| Flag | Alias | Description | Default |
|
|
104
|
+
| -------------- | ----- | -------------------------------------------------------------------- | ----------- |
|
|
105
|
+
| `--yes` | `-y` | Enable all tools (ESLint + Prettier + Husky + nodemon), skip prompts | `false` |
|
|
106
|
+
| `--default` | `-d` | Use sensible defaults (Prettier only), skip prompts | `false` |
|
|
107
|
+
| `--eslint` | | Add ESLint with TypeScript config | interactive |
|
|
108
|
+
| `--prettier` | | Add Prettier code formatter | interactive |
|
|
109
|
+
| `--husky` | | Add Husky pre-commit hooks | interactive |
|
|
110
|
+
| `--nodemon` | | Add nodemon dev script | interactive |
|
|
111
|
+
| `--git` | | Initialize git repository | `true`\* |
|
|
112
|
+
| `--no-git` | | Skip git initialization | |
|
|
113
|
+
| `--install` | | Install dependencies | `true`\* |
|
|
114
|
+
| `--no-install` | | Skip dependency installation | |
|
|
115
|
+
| `--no-commit` | | Skip initial git commit (when git enabled) | `false` |
|
|
116
|
+
| `--pm <name>` | | Package manager: npm, yarn, or pnpm | auto-detect |
|
|
117
|
+
| `--verbose` | | Show detailed command output | `false` |
|
|
118
|
+
|
|
119
|
+
\* _In interactive mode, you'll be asked. In non-interactive mode (`--yes`/`--default`), defaults to `true`._
|
|
120
|
+
|
|
121
|
+
### Package Manager
|
|
122
|
+
|
|
123
|
+
The CLI auto-detects your package manager based on:
|
|
124
|
+
|
|
125
|
+
1. The `npm_config_user_agent` environment variable
|
|
126
|
+
2. Lockfiles in the current directory (`pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`)
|
|
127
|
+
3. Falls back to `npm`
|
|
128
|
+
|
|
129
|
+
Override detection:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npx launchts my-app --pm yarn
|
|
133
|
+
npx launchts my-app --pm pnpm
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## What You Get
|
|
139
|
+
|
|
140
|
+
### Base Project Structure
|
|
141
|
+
|
|
142
|
+
Every project includes:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
my-app/
|
|
146
|
+
├── src/
|
|
147
|
+
│ └── index.ts # Entry point with "Hello TypeScript"
|
|
148
|
+
├── package.json # With scripts and metadata
|
|
149
|
+
├── tsconfig.json # Sensible TypeScript config (ESNext, strict)
|
|
150
|
+
└── .gitignore # (if --git) Ignores node_modules, dist, .env
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Scripts included:**
|
|
154
|
+
|
|
155
|
+
- `npm run build` — Compile TypeScript to `dist/`
|
|
156
|
+
- `npm start` — Run compiled code from `dist/index.js`
|
|
157
|
+
|
|
158
|
+
### With ESLint (`--eslint`)
|
|
159
|
+
|
|
160
|
+
Adds TypeScript linting with best practices:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
my-app/
|
|
164
|
+
├── eslint.config.js # Modern flat config with TypeScript support
|
|
165
|
+
└── package.json # + eslint dependencies
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Additional scripts:**
|
|
169
|
+
|
|
170
|
+
- `npm run lint` — Check for linting errors
|
|
171
|
+
|
|
172
|
+
**Packages:**
|
|
173
|
+
|
|
174
|
+
- `eslint`
|
|
175
|
+
- `@eslint/js`
|
|
176
|
+
- `typescript-eslint` (unified package)
|
|
177
|
+
- `globals`
|
|
178
|
+
- `eslint-config-prettier` (if Prettier also enabled)
|
|
179
|
+
|
|
180
|
+
### With Prettier (`--prettier`)
|
|
181
|
+
|
|
182
|
+
Adds code formatting with opinionated defaults:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
my-app/
|
|
186
|
+
├── .prettierrc # Config: semi, singleQuote, trailingComma
|
|
187
|
+
└── package.json # + prettier dependency
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Additional scripts:**
|
|
191
|
+
|
|
192
|
+
- `npm run format` — Format all files
|
|
193
|
+
|
|
194
|
+
**Configuration:**
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"semi": true,
|
|
199
|
+
"singleQuote": true,
|
|
200
|
+
"trailingComma": "all",
|
|
201
|
+
"printWidth": 80
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### With Husky (`--husky`)
|
|
206
|
+
|
|
207
|
+
Adds Git hooks for quality control:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
my-app/
|
|
211
|
+
├── .husky/
|
|
212
|
+
│ └── pre-commit # Runs lint-staged before commits
|
|
213
|
+
└── package.json # + husky, lint-staged config
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Additional scripts:**
|
|
217
|
+
|
|
218
|
+
- `npm run prepare` — Install Git hooks
|
|
219
|
+
|
|
220
|
+
**Behavior:**
|
|
221
|
+
|
|
222
|
+
- Automatically runs `eslint --fix` and `prettier --write` on staged `.ts` files
|
|
223
|
+
- Formats staged `.json` files with Prettier
|
|
224
|
+
|
|
225
|
+
### With nodemon (`--nodemon`)
|
|
226
|
+
|
|
227
|
+
Adds development auto-reload:
|
|
228
|
+
|
|
229
|
+
**Additional scripts:**
|
|
230
|
+
|
|
231
|
+
- `npm run dev` — Watch `src/` and auto-restart on changes
|
|
232
|
+
|
|
233
|
+
**Packages:**
|
|
234
|
+
|
|
235
|
+
- `nodemon`
|
|
236
|
+
- `ts-node`
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Requirements
|
|
241
|
+
|
|
242
|
+
- **Node.js** 18.0.0 or higher
|
|
243
|
+
- **npm** 7+ (or **yarn** 1.22+, **pnpm** 7+)
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Examples
|
|
248
|
+
|
|
249
|
+
### Minimal TypeScript Project
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npx launchts my-app --no-git --no-install
|
|
253
|
+
cd my-app
|
|
254
|
+
npm install
|
|
255
|
+
npm run build
|
|
256
|
+
npm start
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Full Stack with Code Quality
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
npx launchts my-api --eslint --prettier --husky --nodemon
|
|
263
|
+
cd my-api
|
|
264
|
+
npm run dev # Start coding with auto-reload
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Quick Prototype
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
npx launchts prototype -y
|
|
271
|
+
cd prototype
|
|
272
|
+
npm run dev
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Monorepo Package
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
cd my-monorepo/packages
|
|
279
|
+
npx launchts new-package --no-git --pm pnpm
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Contributing
|
|
285
|
+
|
|
286
|
+
Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## License
|
|
291
|
+
|
|
292
|
+
MIT © [Jonas](https://github.com/Jszigeti)
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Issues & Support
|
|
297
|
+
|
|
298
|
+
- **Bug reports:** [Open an issue](https://github.com/Jszigeti/launchts/issues)
|
|
299
|
+
- **Questions:** [GitHub Discussions](https://github.com/Jszigeti/launchts/discussions)
|
|
300
|
+
- **Star the repo** if you find it useful!
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**Made with ❤️ for the TypeScript community**
|
package/dist/cli.d.ts
ADDED