Restructure source code location - separate from .iw directory #106

Closed
opened 2026-01-06 09:16:31 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-01-06 09:16:31 +00:00 (Migrated from github.com)

Context

The iw-cli source code lives in .iw/ (commands/, core/, test/, scripts/, VERSION), but this nesting serves no purpose. It's a leftover from an early idea where .iw/ would double as a local installation directory. That never happened — consumer projects use iw-bootstrap which downloads releases to ~/.local/share/iw/versions/.

The .iw/ prefix creates concrete problems:

  1. Layout mismatch between dev and release. The release tarball has a flat layout (commands/, core/, VERSION), but dev has everything under .iw/. This forces ./iw to remap IW_COMMANDS_DIR and IW_CORE_DIR, and iw-bootstrap to sniff for .iw/commands vs commands/ in IW_HOME mode.

  2. VERSION file is broken. read_iw_version in iw-run looks for $INSTALL_DIR/VERSION, but in dev INSTALL_DIR is the repo root and VERSION is at .iw/VERSION. In releases, package-release.sh doesn't copy VERSION at all. Both paths return 0.0.0.

  3. release.sh still updates a hardcoded path in .iw/commands/version.scala and doesn't touch .iw/VERSION.

  4. package-release.sh has to remap .iw/commands/commands/ and .iw/core/core/.

Proposed Solution

Move source code out of .iw/ to the repo root so dev layout matches release layout:

iw-cli/
├── iw-run
├── iw-bootstrap
├── iw                # dev bootstrap (becomes trivial)
├── VERSION
├── commands/
├── core/
├── test/
├── scripts/

Consumer projects keep their .iw/config.conf — that's project config, unrelated to source layout.

What changes

  • ./iw no longer needs to set IW_COMMANDS_DIR / IW_CORE_DIR (defaults in iw-run just work)
  • iw-bootstrap IW_HOME mode drops the layout-sniffing branch
  • package-release.sh simplifies (no more .iw/ → flat remapping)
  • release.sh updates VERSION at repo root
  • read_iw_version finds $INSTALL_DIR/VERSION in both dev and release
  • All BATS tests update their paths
  • Pre-commit/pre-push hooks update their paths

What stays the same

  • .iw/config.conf in consumer projects (project-level config)
  • The release tarball format (already flat)
  • iw-run command execution logic
  • Plugin discovery mechanism
## Context The iw-cli source code lives in `.iw/` (commands/, core/, test/, scripts/, VERSION), but this nesting serves no purpose. It's a leftover from an early idea where `.iw/` would double as a local installation directory. That never happened — consumer projects use `iw-bootstrap` which downloads releases to `~/.local/share/iw/versions/`. The `.iw/` prefix creates concrete problems: 1. **Layout mismatch between dev and release.** The release tarball has a flat layout (`commands/`, `core/`, `VERSION`), but dev has everything under `.iw/`. This forces `./iw` to remap `IW_COMMANDS_DIR` and `IW_CORE_DIR`, and `iw-bootstrap` to sniff for `.iw/commands` vs `commands/` in `IW_HOME` mode. 2. **VERSION file is broken.** `read_iw_version` in `iw-run` looks for `$INSTALL_DIR/VERSION`, but in dev `INSTALL_DIR` is the repo root and VERSION is at `.iw/VERSION`. In releases, `package-release.sh` doesn't copy VERSION at all. Both paths return `0.0.0`. 3. **`release.sh` still updates a hardcoded path** in `.iw/commands/version.scala` and doesn't touch `.iw/VERSION`. 4. **`package-release.sh` has to remap** `.iw/commands/` → `commands/` and `.iw/core/` → `core/`. ## Proposed Solution Move source code out of `.iw/` to the repo root so dev layout matches release layout: ``` iw-cli/ ├── iw-run ├── iw-bootstrap ├── iw # dev bootstrap (becomes trivial) ├── VERSION ├── commands/ ├── core/ ├── test/ ├── scripts/ ``` Consumer projects keep their `.iw/config.conf` — that's project config, unrelated to source layout. ### What changes - `./iw` no longer needs to set `IW_COMMANDS_DIR` / `IW_CORE_DIR` (defaults in `iw-run` just work) - `iw-bootstrap` `IW_HOME` mode drops the layout-sniffing branch - `package-release.sh` simplifies (no more `.iw/` → flat remapping) - `release.sh` updates `VERSION` at repo root - `read_iw_version` finds `$INSTALL_DIR/VERSION` in both dev and release - All BATS tests update their paths - Pre-commit/pre-push hooks update their paths ### What stays the same - `.iw/config.conf` in consumer projects (project-level config) - The release tarball format (already flat) - `iw-run` command execution logic - Plugin discovery mechanism ## Related - iterative-works/dev-docs#123 — Bounded context extraction (benefits from cleaner source layout) - iterative-works/iw-cli#324 — Remove AI-specific code from core commands
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#106
No description provided.