Skip to content

Expand fromFile Support for Common Developer Files #219

@jahvon

Description

@jahvon

Extend the fromFile feature to parse and generate executables from common developer tooling files including Makefiles, package.json scripts, and docker-compose configurations. This enables seamless onboarding to flow by automatically discovering existing project automation.

Base File Types

Makefile Support

# Build the application binary
build:
	go build -o bin/app ./cmd/app

# Run all tests with coverage
test: ## Run unit and integration tests
	go test -v -race -coverprofile=coverage.out ./...

# Deploy to production environment  
deploy: build test
	./scripts/deploy.sh production

Generated Executables:

  • buildflow build (verb: build, name: unset)
  • testflow test (verb: test, description from comment)
  • deployflow deploy (verb: deploy, dependencies converted to serial steps)

package.json Scripts

{
  "scripts": {
    "dev": "vite dev --host",
    "build": "vite build && tsc",
    "test": "vitest run",
    "test:watch": "vitest",
    "lint": "eslint . --fix",
    "preview": "vite preview"
  }
}

Generated Executables:

  • devflow start dev (verb: start)
  • buildflow build (verb: build)
  • testflow test (verb: test)
  • test:watchflow watch test (verb: watch)
  • lintflow lint (verb: lint)
  • previewflow show preview (verb: show)

Docker Compose Services

services:
  app:
    build: .
    ports: ["3000:3000"]
  
  db:
    image: postgres:15
    environment: 
      POSTGRES_DB: myapp
  
  redis:
    image: redis:alpine

Generated Executables:

  • start appflow start app (docker-compose up app)
  • start dbflow start db (docker-compose up db)
  • startflow start (docker-compose up --all)
  • stopflow stop (docker-compose down)
  • build appflow build app (docker-compose build app)

Configuration

Workspace Flow File

fromFile:
  - "package.json"        # Parse npm scripts
  - "Makefile"           # Parse make targets  
  - "docker-compose.yml" # Parse compose services
  - "scripts/*.sh"       # Existing shell script support

Breaking change: Parsing Options

fromFile:
  - path: "Makefile"
    options:
      ignoreTargets: [".PHONY", "clean"]
      defaultVerb: "run"
  - path: "package.json" 
    options:
      scriptPrefix: "npm-"
      verbMapping:
        start: "start"
        dev: "start" 
        build: "build"
        test: "test"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions