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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 20 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# infra/.cache is the only mutable tool-cache root (see infra/README.md).
# Every cache/build artifact below is generated and deliberately ignored;
# nothing cache-related should ever live outside infra/.cache.
node_modules/

# Tool caches & build output (all redirected into infra/.cache)
.turbo/
**/.turbo/
.cache/
**/.cache/
provision/.cache/
.DS_Store
infra/.cache/
coverage/
*.tsbuildinfo
packages/artefacts/.logs/
packages/artefacts/dist/
packages/tui/dist/
packages/docs/src/.vitepress/
packages/docs/src/api/
**/dist/
**/.vitepress/cache/
**/.vitepress/dist/
apps/docs/src/.vitepress/
apps/docs/src/api/

# OS / editor
.DS_Store
.idea/

# Go
pkgs-go/bin/
*.test
*.out
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
store-dir=provision/.cache/pnpm/store
store-dir=infra/.cache/pnpm-store
71 changes: 10 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,70 +1,19 @@
SHELL := /bin/bash

ROOT_PATH := $(CURDIR)
FMT_IMAGE := ghcr.io/oullin/go-fmt:v0.4.0
FMT_RUN := docker run --rm \
--user $$(id -u):$$(id -g) \
-v $(ROOT_PATH):/work \
-w /work \
-e HOST_PROJECT_PATH=$(ROOT_PATH) \
$(FMT_IMAGE)

TS_GLOBS := '*.ts' '*.tsx' '*.vue' '*.mts' '*.cts'
INFRA_MAKEFILE := infra/make/Makefile

.DEFAULT_GOAL := help

define step
@printf "\n\033[1;36m==>\033[0m \033[1m%s\033[0m\n" "$(1)"
endef

define run_oxfmt
@cd "$(ROOT_PATH)" && tmp=$$(mktemp); git ls-files -z $(1) --exclude-standard -- $(TS_GLOBS) | while IFS= read -r -d '' f; do [ -f "$$f" ] && printf '%s\0' "$$f"; done > "$$tmp"; if [ ! -s "$$tmp" ]; then echo "No TS/Vue files to format."; rm -f "$$tmp"; else xargs -0 $(FMT_RUN) format < "$$tmp"; rc=$$?; rm -f "$$tmp"; exit $$rc; fi
endef

define run_in
@cd "$(1)" && $(2)
endef

.PHONY: help dev format format-all fresh

# Every real target lives in infra/make. This root Makefile is a transparent
# forwarder so existing `make <target>` commands keep working.
.PHONY: help FORCE
help:
@awk 'BEGIN {FS = ":.*?## "; printf "\nUsage: \033[36mmake <target>\033[0m\n"} \
/^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5); next } \
/^[a-zA-Z0-9_.-]+:.*?##/ { printf " \033[36m%-28s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
@echo ""

##@ Development
dev: ## Run the docs dev server
$(call run_in,$(ROOT_PATH),pnpm --filter docs dev)
@$(MAKE) --no-print-directory -f $(INFRA_MAKEFILE) help

##@ Formatting
format: ## Format + lint untracked + modified TS/Vue files via oxfmt/oxlint
$(call run_oxfmt,--others --modified)
Makefile:
@:

format-all: ## Format + lint every non-ignored TS/Vue file in the repo via oxfmt/oxlint
@cd "$(ROOT_PATH)" && tmp=$$(mktemp); git ls-files -z --cached --others --exclude-standard -- $(TS_GLOBS) | while IFS= read -r -d '' f; do [ -f "$$f" ] && printf '%s\0' "$$f"; done > "$$tmp"; if [ ! -s "$$tmp" ]; then echo "No TS/Vue files to format."; rm -f "$$tmp"; else xargs -0 $(FMT_RUN) format < "$$tmp"; rc=$$?; rm -f "$$tmp"; exit $$rc; fi
%: FORCE
@$(MAKE) --no-print-directory -f $(INFRA_MAKEFILE) $@

##@ Maintenance
fresh: ## Clean generated state, reinstall dependencies, then build
$(call step,Removing generated dependency/cache/build state)
@test -n "$(ROOT_PATH)" && test "$(ROOT_PATH)" != "/" || { echo "Refusing to clean unsafe ROOT_PATH='$(ROOT_PATH)'"; exit 1; }
rm -rf \
"$(ROOT_PATH)/node_modules" \
"$(ROOT_PATH)"/packages/*/node_modules \
"$(ROOT_PATH)"/provision/*/node_modules \
"$(ROOT_PATH)/provision/.cache" \
"$(ROOT_PATH)/packages/artefacts/.logs" \
"$(ROOT_PATH)/packages/artefacts/dist" \
"$(ROOT_PATH)/packages/docs/src/.vitepress/cache" \
"$(ROOT_PATH)/packages/docs/src/.vitepress/dist" \
"$(ROOT_PATH)/packages/docs/src/api" \
"$(ROOT_PATH)/packages/tui/dist"
$(call step,Removing generated workspace caches)
find "$(ROOT_PATH)" -path "$(ROOT_PATH)/.git" -prune -o -type d -name '.turbo' -prune -exec rm -rf {} +
find "$(ROOT_PATH)" -path "$(ROOT_PATH)/.git" -prune -o -path "$(ROOT_PATH)/provision/.cache" -prune -o -type d -name '.cache' -prune -exec rm -rf {} +
$(call step,Removing TypeScript build info files)
find "$(ROOT_PATH)" -name '*.tsbuildinfo' -type f -delete
$(call step,Installing dependencies)
$(call run_in,$(ROOT_PATH),pnpm install)
$(call step,Building from scratch)
$(call run_in,$(ROOT_PATH),pnpm build)
FORCE:
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@ollin/tui`
# `@ollin/console`

An idiomatic TypeScript/OpenTUI prompt toolkit.

Expand All @@ -7,14 +7,14 @@ This repository targets behavioral parity with reference prompt toolkit release

## Status

The current codebase is a TypeScript ESM package with the public `@ollin/tui`
The current codebase is a TypeScript ESM package with the public `@ollin/console`
entrypoint exporting prompts, form composition, output helpers, status
indicators, terminal utilities, OpenTUI adapter wiring, and deterministic prompt
environment helpers.

Local test suites cover prompt behavior, form flows, output and status helpers,
terminal and string utilities, key handling, typed-value editing, and package
consumption through `packages/acceptance`. The docs package builds a VitePress
consumption through `pkgs-ts/tests`. The docs package builds a VitePress
guide plus generated API reference. Reference parity and the completion audit are
tracked in `UPSTREAM.md`.

Expand Down
Loading
Loading