Skip to content

Commit dc401af

Browse files
committed
Merge remote-tracking branch 'origin/main' into codemirror
2 parents e7bc331 + 606c98d commit dc401af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+713
-153
lines changed

.devcontainer/Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Acode Development Container - Standalone Docker Build
2+
#
3+
# This Dockerfile is for MANUAL Docker builds (docker build/run).
4+
# Usage:
5+
# docker build -t acode-dev .devcontainer/
6+
# docker run -it -v $(pwd):/workspaces/acode acode-dev
7+
8+
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
9+
10+
ARG ANDROID_PLATFORM=35
11+
ARG ANDROID_BUILD_TOOLS=35.0.0
12+
ARG CMDLINE_TOOLS_VERSION=11076708
13+
ARG NODE_VERSION=22
14+
ARG GRADLE_VERSION=8.11
15+
16+
ENV ANDROID_HOME=/opt/android-sdk
17+
ENV ANDROID_SDK_ROOT=/opt/android-sdk
18+
ENV GRADLE_HOME=/opt/gradle
19+
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin"
20+
21+
RUN apt-get update && apt-get install -y --no-install-recommends \
22+
wget \
23+
unzip \
24+
&& rm -rf /var/lib/apt/lists/*
25+
26+
# Install Gradle
27+
RUN wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -O /tmp/gradle.zip \
28+
&& unzip -q /tmp/gradle.zip -d /opt \
29+
&& rm /tmp/gradle.zip \
30+
&& ln -s /opt/gradle-${GRADLE_VERSION} ${GRADLE_HOME}
31+
32+
# Install fnm and Node.js
33+
ENV FNM_DIR=/usr/local/fnm
34+
ENV PATH="${FNM_DIR}:${PATH}"
35+
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
36+
&& eval "$(${FNM_DIR}/fnm env)" \
37+
&& fnm install ${NODE_VERSION} \
38+
&& fnm default ${NODE_VERSION} \
39+
&& npm install -g pnpm
40+
41+
ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
42+
43+
# Install Android SDK
44+
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
45+
&& cd ${ANDROID_HOME}/cmdline-tools \
46+
&& wget -q "https://dl.google.com/android/repository/commandlinetools-linux-${CMDLINE_TOOLS_VERSION}_latest.zip" -O cmdline-tools.zip \
47+
&& unzip -q cmdline-tools.zip \
48+
&& rm cmdline-tools.zip \
49+
&& mv cmdline-tools latest \
50+
&& yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses 2>/dev/null || true \
51+
&& ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --update \
52+
&& ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager \
53+
"platform-tools" \
54+
"platforms;android-${ANDROID_PLATFORM}" \
55+
"build-tools;${ANDROID_BUILD_TOOLS}"
56+
57+
WORKDIR /workspaces/acode
58+
59+
LABEL maintainer="Acode Foundation"
60+
LABEL description="Development environment for building Acode - Code Editor for Android"

.devcontainer/devcontainer.json

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/java
31
{
4-
"name": "Java",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",
2+
"name": "Acode Development",
3+
"image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",
74

8-
"features": {
9-
"ghcr.io/devcontainers/features/java:1": {
10-
"installGradle": true,
11-
"installGroovy": false,
12-
"installMaven": false,
13-
"installAnt": false,
14-
"version": "21",
15-
"jdkDistro": "ms",
16-
"gradleVersion": "latest",
17-
"mavenVersion": "none"
18-
},
19-
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
20-
"platform": "35",
21-
"build_tools": "35.0.0"
22-
},
23-
"ghcr.io/devcontainers/features/node:1": {
24-
"nodeGypDependencies": false,
25-
"installYarnUsingApt": false,
26-
"version": "lts",
27-
"pnpmVersion": "latest",
28-
"nvmVersion": "latest"
29-
}
30-
}
5+
"features": {
6+
"ghcr.io/devcontainers/features/java:1": {
7+
"installGradle": true,
8+
"installGroovy": false,
9+
"installMaven": false,
10+
"installAnt": false,
11+
"version": "21",
12+
"jdkDistro": "ms",
13+
"gradleVersion": "latest"
14+
},
15+
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
16+
"platform": "35",
17+
"build_tools": "35.0.0"
18+
},
19+
"ghcr.io/devcontainers/features/node:1": {
20+
"nodeGypDependencies": false,
21+
"installYarnUsingApt": false,
22+
"version": "lts",
23+
"pnpmVersion": "latest",
24+
"nvmVersion": "latest"
25+
}
26+
},
3127

32-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
33-
// "forwardPorts": [],
28+
"postCreateCommand": "pnpm run setup",
3429

35-
// Use 'postCreateCommand' to run commands after the container is created.
36-
// "postCreateCommand": "java -version",
37-
38-
// Configure tool-specific properties.
39-
// "customizations": {},
40-
41-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
42-
// "remoteUser": "root"
30+
"customizations": {
31+
"vscode": {
32+
"extensions": ["biomejs.biome", "redhat.java"],
33+
"settings": {
34+
"editor.formatOnSave": true,
35+
"editor.defaultFormatter": "biomejs.biome",
36+
"[java]": {
37+
"editor.defaultFormatter": "redhat.java"
38+
}
39+
}
40+
}
41+
}
4342
}

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependencies
2+
node_modules/
3+
.pnpm-store/
4+
5+
# Build outputs
6+
platforms/
7+
plugins/
8+
www/css/build/
9+
www/js/build/
10+
11+
# IDE
12+
.vscode/
13+
.idea/
14+
15+
# Git
16+
.git/
17+
.gitignore
18+
19+
# Misc
20+
*.log
21+
*.apk
22+
*.aab
23+
.DS_Store
24+
Thumbs.db

CONTRIBUTING.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Contributing to Acode
2+
3+
Thank you for your interest in contributing to Acode! This guide will help you get started with development.
4+
5+
## Quick Start Options
6+
7+
### Option 1: DevContainer (Recommended)
8+
9+
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code or other editors that support DevContainers.
10+
11+
2. Clone and open the repository:
12+
```bash
13+
git clone https://github.com/Acode-Foundation/Acode.git
14+
code Acode
15+
```
16+
17+
3. When VS Code prompts "Reopen in Container", click it
18+
- Or use Command Palette (Cmd/Ctrl+Shift+P) → "Dev Containers: Reopen in Container"
19+
20+
4. Wait for the container to build (~5-10 minutes first time, subsequent opens are instant)
21+
22+
5. Once ready, build the APK:
23+
```bash
24+
pnpm run build paid dev apk
25+
```
26+
27+
> Use any package manager (pnpm, bun, npm, yarn, etc.)
28+
29+
### Option 2: Docker CLI (For Any Editor)
30+
31+
If your editor doesn't support DevContainers, you can use Docker directly:
32+
33+
```bash
34+
# Clone the repository
35+
git clone https://github.com/Acode-Foundation/Acode.git
36+
cd Acode
37+
38+
# Build the Docker image from our Dockerfile
39+
docker build -t acode-dev .devcontainer/
40+
41+
# Run the container with your code mounted
42+
docker run -it --rm \
43+
-v "$(pwd):/workspaces/acode" \
44+
-w /workspaces/acode \
45+
acode-dev \
46+
bash
47+
48+
# Inside the container, run setup and build
49+
# bun run setup && bun run build paid dev apk
50+
pnpm run setup
51+
pnpm run build paid dev apk # or pnpm run build p d
52+
```
53+
54+
**Keep container running for repeated use:**
55+
```bash
56+
# Start container in background
57+
docker run -d --name acode-dev \
58+
-v "$(pwd):/workspaces/acode" \
59+
-w /workspaces/acode \
60+
acode-dev \
61+
sleep infinity
62+
63+
# Execute commands in the running container
64+
docker exec -it acode-dev bash -c "pnpm run setup"
65+
docker exec -it acode-dev pnpm run build paid dev apk
66+
67+
# Stop and remove when done
68+
docker stop acode-dev && docker rm acode-dev
69+
```
70+
71+
---
72+
73+
## 🛠️ Manual Setup (Without Docker)
74+
75+
If you prefer not to use Docker at all:
76+
77+
### Prerequisites
78+
79+
| Requirement | Version |
80+
|------------|---------|
81+
| **Node.js** | 18+ (22 recommended) |
82+
| **pnpm** or **bun** | Latest |
83+
| **Java JDK** | 17+ (21 recommended) |
84+
| **Android SDK** | API 35 |
85+
| **Gradle** | 8.x |
86+
87+
### Environment Setup
88+
89+
Add these to your shell profile (`~/.bashrc`, `~/.zshrc`, or `~/.config/fish/config.fish`):
90+
91+
**macOS:**
92+
```bash
93+
export ANDROID_HOME="$HOME/Library/Android/sdk"
94+
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin"
95+
```
96+
97+
**Linux:**
98+
```bash
99+
export ANDROID_HOME="$HOME/Android/Sdk"
100+
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin"
101+
```
102+
103+
Some more environment variables, check [cordova docs](https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html).
104+
105+
### Build Steps
106+
107+
```bash
108+
# Clone the repository
109+
git clone https://github.com/Acode-Foundation/Acode.git
110+
cd Acode
111+
112+
# Install dependencies and set up Cordova
113+
pnpm run setup
114+
115+
# Build the APK
116+
pnpm run build paid dev apk # or pnpm run build p d
117+
```
118+
119+
The APK will be at: `platforms/android/app/build/outputs/apk/debug/app-debug.apk`
120+
121+
122+
## 📝 Contribution Guidelines
123+
124+
### Before Submitting a PR
125+
126+
1. **Fork** the repository and create a branch from `main`
127+
2. **Make changes** - keep commits focused and atomic
128+
3. **Check code quality:**
129+
```bash
130+
pnpm run check
131+
```
132+
4. **Test** on a device or emulator if possible
133+
134+
### Pull Request Checklist
135+
136+
- [ ] Clear description of changes
137+
- [ ] Reference to related issue (if applicable)
138+
- [ ] Screenshots/GIFs for UI changes
139+
- [ ] Passing CI checks
140+
141+
### Code Style
142+
143+
We use [Biome](https://biomejs.dev/) for linting and formatting:
144+
- Run `pnpm run check` before committing
145+
- Install the Biome VS Code extension for auto-formatting
146+
147+
### Commit Messages
148+
149+
Use clear, descriptive messages:
150+
```
151+
feat: add dark mode toggle to settings
152+
fix: resolve crash when opening large files
153+
docs: update build instructions
154+
refactor: simplify file loading logic
155+
```
156+
157+
## 🌍 Adding Translations
158+
159+
1. Create a JSON file in `src/lang/` (e.g., `fr-fr.json` for French)
160+
2. Add it to `src/lib/lang.js`
161+
3. Use the translation utilities:
162+
```bash
163+
pnpm run lang add # Add new string
164+
pnpm run lang remove # Remove string
165+
pnpm run lang search # Search strings
166+
pnpm run lang update # Update translations
167+
```
168+
169+
## 🔌 Plugin Development
170+
171+
To create plugins for Acode:
172+
- [Plugin Starter Repository](https://github.com/Acode-Foundation/acode-plugin)
173+
- [Plugin Documentation](https://docs.acode.app/)

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)