Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (104 loc) · 4.51 KB
/
Copy pathMakefile
File metadata and controls
133 lines (104 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# simple Makefile with scripts that are otherwise hard to remember
# to use, run from the repo root `make <command>`
SHELL := /bin/bash
default: help
help:
@echo Developer commands:
@echo
@echo "ruff Run ruff, fixing any safely-fixable errors and formatting"
@echo "ruff-unsafe Run ruff, fixing all fixable errors and formatting"
@echo "mypy Run mypy using the config in pyproject.toml to identify type mismatches and other coding errors"
@echo "mypy-all Run mypy ignoring the config in pyproject.tom but still ignoring missing imports"
@echo "test Run the unit tests."
@echo "frontend-install Install the pnpm modules needed for the frontend"
@echo "frontend-build Build the frontend for localhost:9090"
@echo "frontend-legacy-install Install legacy frontend dependencies"
@echo "frontend-legacy-build Build the legacy frontend for --web-legacy"
@echo "frontend-test Run the frontend test suite once"
@echo "frontend-dev Run the frontend in developer mode on localhost:5173"
@echo "frontend-legacy-dev Run the legacy frontend development server"
@echo "frontend-api-install Install shared API generation dependencies"
@echo "frontend-openapi Generate the OpenAPI schema"
@echo "frontend-typegen Generate types for the frontend from the OpenAPI schema"
@echo "frontend-lint Run frontend checks and fixable lint/format steps"
@echo "wheel Build the wheel for the current version"
@echo "tag-release Tag the GitHub repository with the current version (use at release time only!)"
@echo "openapi Generate the OpenAPI schema for the app, outputting to stdout"
@echo "docs-install Install the pnpm modules needed for the docs site"
@echo "docs-dev Serve the astro starlight docs site with live reload"
@echo "docs-build Build the docs site for production"
@echo "docs-preview Preview the docs site locally"
# Runs ruff, fixing any safely-fixable errors and formatting
ruff:
cd invokeai && uv tool run ruff@0.11.2 format
# Runs ruff, fixing all errors it can fix and formatting
ruff-unsafe:
ruff check . --fix --unsafe-fixes
ruff format
# Runs mypy, using the config in pyproject.toml
mypy:
mypy scripts/invokeai-web.py
# Runs mypy, ignoring the config in pyproject.toml but still ignoring missing (untyped) imports
# (many files are ignored by the config, so this is useful for checking all files)
mypy-all:
mypy scripts/invokeai-web.py --config-file= --ignore-missing-imports
# Run the unit tests
test:
pytest ./tests
# Install the pnpm modules needed for the front end
frontend-install:
rm -rf invokeai/frontend/webv2/node_modules
cd invokeai/frontend/webv2 && pnpm install
# Build the frontend
frontend-build:
cd invokeai/frontend/webv2 && pnpm build
# Compatibility aliases and explicit legacy commands
frontendv2-install: frontend-install
frontend-legacy-install:
rm -rf invokeai/frontend/webv1/node_modules
cd invokeai/frontend/webv1 && pnpm install
# Build the legacy frontend
frontendv2-build: frontend-build
frontend-legacy-build:
cd invokeai/frontend/webv1 && pnpm build
# Run the frontend test suite once
frontend-test:
cd invokeai/frontend/webv2 && pnpm test
# Run the frontend in dev mode
frontend-dev:
cd invokeai/frontend/webv2 && pnpm dev
# Run the legacy frontend in dev mode
frontendv2-dev: frontend-dev
frontend-legacy-dev:
cd invokeai/frontend/webv1 && pnpm run dev
# Install the shared contract generation tools
frontend-api-install:
pnpm -C invokeai/frontend/api install --frozen-lockfile
# Generate the OpenAPI Schema for the app
frontend-openapi:
cd invokeai/frontend/api && \
python ../../../scripts/generate_openapi_schema.py > openapi.json && \
pnpm format:openapi
frontend-typegen:
set -o pipefail; cd invokeai/frontend/api && python ../../../scripts/generate_openapi_schema.py | pnpm typegen
frontend-lint:
pnpm -C invokeai/frontend/webv2 lint
# Tag the release
wheel:
cd scripts && ./build_wheel.sh
# Tag the release
tag-release:
cd scripts && ./tag_release.sh
# Generate the OpenAPI Schema for the app
openapi:
python scripts/generate_openapi_schema.py
# Install the pnpm modules needed for the docs site
docs-install:
cd docs && pnpm install
# Serve the astro starlight docs site w/ live reload
docs-dev:
cd docs && pnpm run dev
docs-build:
cd docs && DEPLOY_TARGET='custom' pnpm run build
docs-preview:
cd docs && pnpm run preview