Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="assets\client\readme.png" alt="JetStart Logo" width="400"/>
<img src="docs/static/img/socials/jetstart-social-card.png" alt="JetStart Social Card" width="800"/>

<h3>Launch Android apps at warp speed</h3>

Expand Down
6 changes: 6 additions & 0 deletions docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ See the [Kotlin installation section](#installing-kotlin-required-for-hot-reload

## Recommended Tools

### JetStart Kotlin & Compose Snippets (Recommended)

Speed up your development with our custom VS Code extension. It provides package-aware snippets and automatic imports for Kotlin and Compose.

[**Install JetStart Extension**](./vscode-extension.md)

### Kotlin Language Server for VS Code

If you are developing your Android client using VS Code, we highly recommend installing the **Kotlin Language Server** extension for syntax highlighting, code completion, and diagnostics.
Expand Down
119 changes: 119 additions & 0 deletions docs/docs/getting-started/vscode-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
sidebar_position: 6
title: VS Code Extension
description: Speed up your development with the JetStart Kotlin & Compose Snippets extension
---

# JetStart VS Code Extension

The **JetStart Kotlin & Compose Snippets** extension is designed to give Android developers a fast, React-like scaffolding experience directly in VS Code. It provides robust, package-aware, and import-aware snippets for Kotlin and Jetpack Compose.

## Features

- **🚀 Smart Snippets**: Quick templates for Classes, ViewModels, Composables, Room Entities, and more.
- **📦 Package Awareness**: Automatically detects and inserts the correct `package` declaration based on your folder structure.
- **📥 Auto-Imports**: Automatically adds required imports to the top of the file when you use a snippet.
- **🔍 Compose Import Helper**: Quick suggestions for missing Compose and AndroidX imports.

---

## Installation

Since the extension is currently in beta, you can install it directly by downloading the `.vsix` package.

### 1. Download the Extension
Download the latest version of the JetStart extension:

<a href="/downloads/jetstart-kotlin-snippets.vsix" download className="button button--primary button--lg">
📥 Download JetStart VS Code Extension (.vsix)
</a>

### 2. Install in VS Code
1. Open **Visual Studio Code**.
2. Go to the **Extensions** view (`Ctrl+Shift+X`).
3. Click the **More Actions** (...) menu in the top-right corner of the Extensions bar.
4. Select **Install from VSIX...**
5. Locate and select the `jetstart-kotlin-snippets.vsix` file you just downloaded.
6. Restart VS Code if prompted.

---

## Common Snippets

Type these prefixes in any `.kt` file to trigger the snippets:

| Prefix | What you get |
|--------|-------------|
| `ktc` | Class with auto-detected package name |
| `ktdc` | Data class |
| `ktsc` | Sealed class (Success/Error/Loading) |
| `ktec` | Enum class |
| `ktvm` | ViewModel + StateFlow + coroutine scope |
| `kthiltvm` | Hilt ViewModel + @Inject |
| `ktrep` | Repository class |
| `ktent` | Room @Entity |
| `ktdao` | Room @Dao |
| `ktdb` | Room Database singleton |
| `ktcf` | @Composable function |
| `ktcfs` | @Composable + remember state |
| `ktprev` | @Preview composable |
| `ktscaffold` | Full Scaffold + TopAppBar + FAB |
| `ktlazycol` | LazyColumn with items |
| `ktlazyr` | LazyRow with items |
| `ktlazysgrid` | LazyVerticalStaggeredGrid |
| `ktcard` | Material3 Card |
| `ktrow` / `ktcol` | Row / Column |
| `ktalertd` | AlertDialog |
| `ktbottomsheet` | ModalBottomSheet |
| `kttab` | TopAppBar |
| `ktnav` | NavHost setup |
| `ktstate` | `var x by remember { mutableStateOf(...) }` |
| `ktsflow` | MutableStateFlow + StateFlow pair |
| `ktcollect` | collectAsState() |
| `ktlaunch` / `ktsideef` / `ktdisposable` / `ktderived` | Effects |
| `ktcoro` / `ktio` / `ktasync` | Coroutines |
| `ktfun` / `ktsfun` / `ktef` / `ktlambda` | Functions |
| `ktwhen` / `ktwhenresult` | when expressions |

## Auto-features

- **Smart Package Insertion**: Open a new empty `.kt` file and the package name is auto-inserted based on the directory structure.
- **Instant Auto-Imports**: Type an identifier like `mutableStateOf` and the import suggestion appears immediately.
- **Deep Support**: Works for 150+ Compose/Kotlin identifiers across Room, Hilt, Navigation, Coroutines, and more.

---

## How it Works (and Automation)

A common question is: **Why use a manual import map instead of an official source?**

Unlike Android Studio, which builds a heavy local index of all your dependencies (often consuming significant RAM), JetStart's VS Code extension is designed for **instant, zero-latency feedback**.

1. **The "Official" Way**: Standard IDEs use the Language Server Protocol (LSP) to scan your Gradle dependencies. While powerful, this can be slow and often fails in complex environments.
2. **The JetStart Way**: We use a curated high-performance map of over 150 common Compose and Kotlin identifiers. This gives you *instant* suggestions the moment you type, without waiting for a background indexer.

### Automating Updates
To keep this map up-to-date without manual effort, we are working on a **Sync Runner** script that will:
- Automatically scan the `build.gradle` classpath.
- Extract public identifiers from AndroidX and Kotlin libraries.
- Regenerate the mapping files for the extension.

This ensures you always have the latest Material3 and Compose symbols without the performance cost of a full IDE indexer.

---

## Recommended Configuration

For the best experience, we recommend using this extension alongside other Kotlin tools for full IDE features like go-to-definition and linting.

### Complementary Extensions

JetStart's extension works perfectly alongside the following popular Kotlin extensions:

- **[Kotlin Language Server](https://github.com/Kotlin/kotlin-lsp)**: Provides the core IDE engine (diagnostics, formatting, etc.).
- **[Kotlin on VSCode (sethjones)](https://marketplace.visualstudio.com/items?itemName=sethjones.kotlin-on-vscode)**: A popular extension pack that bundles essential Kotlin tools.

**Why use JetStart's extension?**
While the extensions above provide great language support, JetStart's extension is uniquely focused on **Android/Compose speed**:
- **Instant Imports**: No waiting for the Language Server to index; imports are added instantly.
- **Android-First Snippets**: Tailored templates for M3 Scaffold, ViewModels, and Room that aren't available in generic Kotlin packs.
6 changes: 3 additions & 3 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'JetStart',
tagline: 'Build Android apps faster than ever with instant hot reload.',
title: 'JetStart | Instant Hot Reload for Android & Jetpack Compose',
tagline: 'The fastest way to develop Android apps with sub-100ms hot reload in any emulator.',
favicon: 'img/logos/logo.png',

// Set the production url of your site here
Expand Down Expand Up @@ -87,7 +87,7 @@ const config: Config = {
],

themeConfig: {
image: 'img/jetstart-social-card.png',
image: 'img/socials/jetstart-social-card.png',
navbar: {
title: 'JetStart',
logo: {
Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const sidebars: SidebarsConfig = {
'getting-started/installation',
'getting-started/quick-start',
'getting-started/system-requirements',
'getting-started/vscode-extension',
'getting-started/troubleshooting-setup',
],
},
Expand Down
3 changes: 3 additions & 0 deletions docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
--ifm-menu-color: #FFFFFF;
}

a{
text-decoration: none !important;
}
/* Specific override for Docusaurus dark footer style */
.footer--dark {
--ifm-footer-background-color: #222222;
Expand Down
Binary file not shown.
Binary file modified docs/static/img/logos/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/img/socials/jetstart-social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ function runGradle(gradle: string, args: string[], cwd: string): Promise<{ code:
return new Promise((resolve) => {
console.log();
log('[Gradle] ' + path.basename(gradle) + ' ' + args.join(' '));
const proc = spawn(gradle, args, { cwd, shell: true, env: process.env });

const isWin = process.platform === 'win32';
const spawnCmd = isWin ? 'cmd.exe' : gradle;
const spawnArgs = isWin ? ['/c', gradle, ...args] : args;

const proc = spawn(spawnCmd, spawnArgs, {
cwd,
shell: false,
env: process.env
});
proc.stdout.on('data', (d: Buffer) => process.stdout.write(d));
proc.stderr.on('data', (d: Buffer) => process.stderr.write(d));
proc.on('close', (code) => resolve({ code: code ?? 1 }));
Expand Down
22 changes: 14 additions & 8 deletions packages/cli/src/commands/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,20 @@ export async function cleanCommand(options: CleanOptions = {}) {
// Graceful Gradle daemon stop
const daemonSpinner = startSpinner('Stopping Gradle daemons gracefully...');
const gradle = findGradle(projectPath);
if (gradle) {
try {
spawnSync(gradle, ['--stop'], {
cwd: projectPath, shell: true,
encoding: 'utf8', timeout: 12000,
});
} catch { /* ignore */ }
}
if (gradle) {
try {
const isWin = process.platform === 'win32';
const spawnCmd = isWin ? 'cmd.exe' : gradle;
const spawnArgs = isWin ? ['/c', gradle, '--stop'] : ['--stop'];

spawnSync(spawnCmd, spawnArgs, {
cwd: projectPath,
shell: false,
encoding: 'utf8',
timeout: 12000,
});
} catch { /* ignore */ }
}
stopSpinner(daemonSpinner, true, 'Gradle daemons stopped');

// Kill ALL java.exe (Gradle + VS Code language servers)
Expand Down
13 changes: 8 additions & 5 deletions packages/cli/src/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,15 @@ async function generateGradleWrapper(projectPath: string): Promise<void> {
return new Promise<void>((resolve) => {
const gradleCmd = process.platform === 'win32' ? 'gradle.bat' : 'gradle';

const gradleProcess = spawn(gradleCmd, ['wrapper', '--gradle-version', '8.2'], {
const spawnArgs = process.platform === 'win32'
? ['/c', gradleCmd, 'wrapper', '--gradle-version', '8.2']
: ['wrapper', '--gradle-version', '8.2'];
const spawnCmd = process.platform === 'win32' ? 'cmd.exe' : gradleCmd;

const gradleProcess = spawn(spawnCmd, spawnArgs, {
cwd: projectPath,
// On Windows, .bat files need a shell. On other platforms, we can run 'gradle' directly.
// We use shell: true only on Windows to avoid the security warning on other platforms
// and ensure .bat files execute.
shell: process.platform === 'win32',
// Avoid shell: true to prevent [DEP0190] warning on newer Node versions
shell: false,
});

// Timeout after 30 seconds
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/template/base/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Gradle configuration
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dhttps.protocols=TLSv1.2,TLSv1.3
org.gradle.daemon=true
org.gradle.daemon.idletimeout=300000
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true

# Force TLS 1.2/1.3 for environments with older JDKs or restrictive proxies
systemProp.https.protocols=TLSv1.2,TLSv1.3

# Android
android.useAndroidX=true
android.enableJetifier=false
Expand Down
8 changes: 8 additions & 0 deletions packages/extension/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
tsconfig.json
**/*.map
node_modules/**
!node_modules/.bin
21 changes: 21 additions & 0 deletions packages/extension/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 JetStart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 49 additions & 0 deletions packages/extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# JetStart Kotlin & Compose Snippets

Robust, package-aware, and import-aware snippets for Kotlin and Jetpack Compose. Built specifically for Android developers looking for a fast, React-like scaffold experience.

![JetStart Social Card](images/social-card.png)


## Features

- **🚀 Instant Scaffolding**: Generate ViewModels, Repositories, Room Entities, and Composables in seconds.
- **📦 Package Aware**: Automatically detects the correct package name based on your project structure.
- **✨ Smart Imports**: Adds necessary imports to the top of the file automatically—no more manual importing!
- **🎨 Compose Optimized**: Includes Material3-ready snippets and common UI patterns.

## Available Snippets

### Classes & Core
- `ktc` → Kotlin Class
- `ktdc` → Data Class
- `ktsc` → Sealed Class
- `ktec` → Enum Class
- `ktobj` → Object
- `ktint` → Interface

### Android Architecture
- `ktvm` → ViewModel with StateFlow
- `ktrep` → Repository with Coroutines
- `kthiltvm` → Hilt-injected ViewModel

### Jetpack Compose
- `ktcf` → Composable Function
- `ktcfs` → Composable with local state
- `ktprev` → Composable Preview
- `ktscaffold` → Material3 Scaffold
- `ktlazycol` / `ktlazyr` → Lazy List layouts
- `ktcard`, `ktrow`, `ktcol` → Common UI components

### Room Database
- `ktent` → Room Entity
- `ktdao` → Room DAO
- `ktdb` → Room Database

## Commands

- **JetStart: Insert Package Declaration**: Manually insert the detected package line into a Kotlin file.

## License

MIT
Binary file added packages/extension/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/extension/images/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading