view.py icon indicating copy to clipboard operation
view.py copied to clipboard

Build Step

Open ZeroIntensity opened this issue 1 year ago • 0 comments

Feature description

Running a custom build step defined by the user should be supported. This should be callable from the CLI, but also done automatically at runtime.

This feature will allow things like TypeScript to be properly built at runtime. Perhaps tooling for NPM could be integrated as well (this would be a separate issue).

Feature example API

[build]
requires = ["npm"]
python = "3.10+"

[build.something]
requires = ["my_app.some_custom_dependency"]  # this refers to a package
command = "npm init"

[build.another_thing]
target = "another_thing.py"
# some_custom_dependency.py
from view.build import dependency

@dependency
async def dep() -> bool:
    ...  # check if x is installed
# another_thing.py
from view.build import step

@step
async def run() -> None:
    ...  # do some cool build magic
$ view buildstep something
- Ensuring dependencies...
- Ensuring `some_custom_dependency`
- Running command `npm init`
... npm output
- Success!
Successfully ran build step for `something`

Anything else?

No response

ZeroIntensity avatar Jan 02 '24 18:01 ZeroIntensity