Skip to content

Commit 78a5308

Browse files
committed
feat: docs
1 parent 2e31aec commit 78a5308

File tree

5 files changed

+20
-114
lines changed

5 files changed

+20
-114
lines changed

static/content/docs/cli-reference.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ andromeda run hello.ts
301301
# Multiple files with dependencies
302302
andromeda run utils.ts main.ts
303303

304-
# Verbose execution for debugging
305-
andromeda run --verbose complex-app.ts
304+
andromeda run complex-app.ts
306305
```
307306

308307
### Development Workflow
@@ -311,8 +310,7 @@ andromeda run --verbose complex-app.ts
311310
# Format code
312311
andromeda fmt src/
313312

314-
# Run with error checking
315-
andromeda run --verbose src/main.ts
313+
andromeda run src/main.ts
316314

317315
# Test in REPL
318316
andromeda repl

static/content/docs/contributing.md

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ struct RuntimeConfig {
173173
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30);
174174
```
175175

176-
**Formatting**: Use `cargo fmt` to format code
176+
**Formatting**: Use `cargo fmt` to format code and `andromeda fmt` for TypeScript files.
177177

178178
**Linting**: Use `cargo clippy` to check for common issues
179179

@@ -228,38 +228,6 @@ cargo test --test integration
228228

229229
### Writing Tests
230230

231-
#### Unit Tests
232-
233-
```rust
234-
#[cfg(test)]
235-
mod tests {
236-
use super::*;
237-
238-
#[test]
239-
fn test_extension_registration() {
240-
let mut runtime = Runtime::new();
241-
let extension = TestExtension::new();
242-
243-
runtime.register_extension(extension);
244-
245-
assert!(runtime.has_extension("test"));
246-
}
247-
}
248-
```
249-
250-
#### Integration Tests
251-
252-
```rust
253-
// tests/integration_test.rs
254-
use andromeda_cli::run_script;
255-
256-
#[tokio::test]
257-
async fn test_script_execution() {
258-
let result = run_script("examples/console.ts").await;
259-
assert!(result.is_ok());
260-
}
261-
```
262-
263231
#### TypeScript Examples
264232

265233
Ensure examples work correctly:
@@ -366,20 +334,23 @@ git commit -m "test: add integration tests for file system"
366334

367335
```typescript
368336
// runtime/src/ext/new_api/mod.ts
369-
declare global {
370-
const newApi: {
371-
methodName(param: string): Promise<Result>;
372-
};
337+
function methodName(param: string): Promise<Result> {
338+
// Implementation
373339
}
340+
// TODO: once imports are supported, use `export` syntax
374341
```
375342

376343
4. **Write tests**:
377344

378-
```rust
379-
#[test]
380-
fn test_new_api_functionality() {
381-
// Test implementation
382-
}
345+
```typescript
346+
// tests/new_api.test.ts
347+
348+
describe("New API", () => {
349+
it("should return expected result", async () => {
350+
const result = await methodName("test");
351+
expect(result).toEqual({ success: true });
352+
});
353+
});
383354
```
384355

385356
5. **Add examples**:
@@ -393,7 +364,7 @@ git commit -m "test: add integration tests for file system"
393364
6. **Update documentation**:
394365
- API reference in `docs/api/`
395366
- Tutorial if complex
396-
- Update main README if significant
367+
- Update index.md if significant
397368

398369
### Debugging
399370

@@ -415,9 +386,6 @@ rust-gdb target/debug/andromeda
415386
```bash
416387
# Compile TypeScript separately
417388
cargo run -- compile script.ts
418-
419-
# Run with verbose output
420-
cargo run -- run script.ts --verbose
421389
```
422390

423391
### Performance Considerations
@@ -430,16 +398,6 @@ When contributing:
430398
- Consider async/await overhead
431399
- Test with realistic workloads
432400

433-
```rust
434-
// Use criterion for benchmarks
435-
#[bench]
436-
fn bench_extension_call(b: &mut Bencher) {
437-
b.iter(|| {
438-
// Benchmark code
439-
});
440-
}
441-
```
442-
443401
## Community
444402

445403
### Communication
@@ -506,7 +464,9 @@ Help expand platform support:
506464
- [Rust Programming Language](https://doc.rust-lang.org/)
507465
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
508466
- [Web APIs Standards](https://developer.mozilla.org/en-US/docs/Web/API)
509-
- [V8 Engine Documentation](https://v8.dev/docs)
467+
- [Nova Engine](https://trynova.dev)
468+
- [WinterTC](https://wintertc.org)
469+
- [Andromeda GitHub Repository](https://github.com/tryandromeda/andromeda)
510470

511471
Thank you for contributing to Andromeda! Your efforts help make it a better
512472
runtime for everyone.

static/content/docs/faq.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -216,25 +216,6 @@ If Andromeda uses too much memory:
216216

217217
Yes! Andromeda is designed to be embeddable:
218218

219-
```rust
220-
use andromeda_core::Runtime;
221-
222-
let mut runtime = Runtime::new();
223-
let result = runtime.execute_script("console.log('Hello from embedded Andromeda!')");
224-
```
225-
226-
### Can I use Andromeda in CI/CD pipelines?
227-
228-
Yes, Andromeda works well in CI/CD:
229-
230-
```yaml
231-
# GitHub Actions example
232-
- name: Run tests with Andromeda
233-
run: |
234-
curl -L https://github.com/your-org/andromeda/releases/latest/download/andromeda-linux.tar.gz | tar xz
235-
./andromeda test-suite.ts
236-
```
237-
238219
## Comparison with Other Runtimes
239220

240221
### Why choose Andromeda over Deno?

static/content/docs/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ established web standards including:
6060
- **WHATWG Standards** - URL, Encoding, and Fetch specifications
6161
- **W3C Standards** - Canvas 2D, Performance API
6262
- **ECMAScript Standards** - Modern JavaScript/TypeScript features
63-
- **Node.js Compatibility** - Core APIs and patterns where applicable
6463

6564
## 🆘 Getting Help
6665

static/content/docs/troubleshooting.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -137,36 +137,6 @@ Common issues and solutions for Andromeda runtime.
137137
andromeda run --verbose script.ts
138138
```
139139

140-
### "Module not found" errors
141-
142-
**Problem:** Import/require statements failing.
143-
144-
**Solutions:**
145-
146-
1. **Use relative paths:**
147-
148-
```typescript
149-
// ✅ Correct
150-
import { helper } from "./utils.ts";
151-
152-
// ❌ Incorrect (no npm modules yet)
153-
import express from "express";
154-
```
155-
156-
2. **Check file paths:**
157-
158-
```bash
159-
# Verify file exists
160-
ls -la utils.ts
161-
```
162-
163-
3. **Use absolute paths:**
164-
165-
```typescript
166-
const fullPath = Andromeda.resolve("./utils.ts");
167-
console.log("Looking for:", fullPath);
168-
```
169-
170140
### Canvas operations failing
171141

172142
**Problem:** Canvas API errors or black images.
@@ -190,9 +160,7 @@ Common issues and solutions for Andromeda runtime.
190160
// Draw something
191161
ctx.fillStyle = "red";
192162
ctx.fillRect(0, 0, 100, 100);
193-
194-
// Must call render before saving
195-
canvas.render();
163+
// Save the canvas as PNG
196164
canvas.saveAsPng("output.png");
197165
```
198166

0 commit comments

Comments
 (0)