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
12 changes: 9 additions & 3 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:

- name: Format Spore files
run: |
paths=(examples platform)
# `src/host.sp` is the package host entry; validate it via package/example flows,
# not standalone file-mode formatting.
paths=(examples src/basic_cli)
if [ -d tests ]; then
paths+=(tests)
fi
Expand All @@ -67,15 +69,19 @@ jobs:

- name: Check Spore files
run: |
paths=(examples platform)
# `src/host.sp` is the package host entry; validate it via package/example flows,
# not standalone file-mode checks.
paths=(examples src/basic_cli)
if [ -d tests ]; then
paths+=(tests)
fi
find "${paths[@]}" -name '*.sp' -type f | sort | xargs -n 1 _spore/target/release/spore check

- name: Build Spore files
run: |
paths=(examples platform)
# `src/host.sp` is the package host entry; validate it via package/example flows,
# not standalone file-mode builds.
paths=(examples src/basic_cli)
if [ -d tests ]; then
paths+=(tests)
fi
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build artifacts
target/
host/target/
/.spore-store

# OS
.DS_Store
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Operating System

| Module | Capabilities | Description |
|--------|-------------|-------------|
| `Stdout` | `uses [Console]` | Standard output |
| `Stdin` | `uses [Console]` | Standard input |
| `File` | `uses [FileRead]` or `uses [FileWrite]` | File system operations |
| `Dir` | `uses [FileRead]` or `uses [FileWrite]` | Directory listing and creation |
| `Env` | `uses [Env]` | Environment variables |
| `Cmd` | `uses [Spawn]` | Process execution |
| `basic_cli.stdout` | `uses [Console]` | Standard output |
| `basic_cli.stdin` | `uses [Console]` | Standard input |
| `basic_cli.file` | `uses [FileRead]` or `uses [FileWrite]` | File system operations |
| `basic_cli.dir` | `uses [FileRead]` or `uses [FileWrite]` | Directory listing and creation |
| `basic_cli.env` | `uses [Env]` | Environment variables |
| `basic_cli.cmd` | `uses [Spawn]` | Process execution |

## Quick Start

Expand All @@ -43,19 +43,21 @@ spore run examples/hello.sp
```

This repository currently keeps `examples/` limited to files that PR CI validates today.
It also intentionally keeps the current loose `.sp` file layout for now; the manifest/package-layout migration is deferred to a follow-up change.

## Project Structure

```
basic-cli/
├── platform/ # Spore API modules (.sp files), checked and built in CI
│ ├── Stdout.sp # Standard output operations
│ ├── Stdin.sp # Standard input operations
│ ├── File.sp # File read/write operations
│ ├── Dir.sp # Directory operations
│ ├── Env.sp # Environment variable access
│ ├── Cmd.sp # Process execution
├── spore.toml # Platform manifest
├── src/
│ ├── host.sp # Default platform entry point
│ └── basic_cli/ # Spore API modules, checked and built in CI
│ ├── stdout.sp # Standard output operations
│ ├── stdin.sp # Standard input operations
│ ├── file.sp # File read/write operations
│ ├── dir.sp # Directory operations
│ ├── env.sp # Environment variable access
│ └── cmd.sp # Process execution
├── host/ # Rust host implementation
│ ├── Cargo.toml
│ └── src/
Expand All @@ -66,7 +68,7 @@ basic-cli/
## Tutorial Contract

- `examples/` is for truthful, CI-validated examples only.
- `platform/` is the API surface for the platform modules themselves.
- `src/basic_cli/` is the API surface for the platform modules themselves.
- Only add `tests/` when the repo has real Spore-side regression coverage worth running with `spore test`.

If you want to add a new tutorial/example, treat this as the bar:
Expand Down
10 changes: 10 additions & 0 deletions spore.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "basic-cli"
version = "0.1.0"
type = "platform"
spore-version = ">=0.1.0"

[capabilities]
allow = ["Compute"]

[dependencies]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/host.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// Platform startup adapter.
/// This is where the platform sets up effect handlers before calling the application startup function.
pub fn main_for_host(app_main: () -> ()) -> () {
app_main()
return
}
Loading