35 Commits

Author SHA1 Message Date
xiantang 24363a00a2 feat(config): add configurable startup banner output (#893) 2026-04-05 22:59:22 +08:00
xiantang c1e77778ac feat: add build-specific platform overrides (#889)
* feat: add build-specific platform overrides

* test(engine): align default config expectation with init overrides

* test(config): add integration coverage for windows build overrides

* test(config): make args_bin override assertion resilient

* test(config): expand coverage for platform override helpers

* docs(readme): fix broken markdown fences in config sections

* refactor(config): reuse shared build command fields

* test(engine): normalize windows override slices in config assertion
2026-04-05 16:44:48 +08:00
Fredrick Kioko ca0794e771 fix: Remove double-kill bug while keeping PowerShell (#777) (#858)
* fix: Remove double-kill bug while keeping PowerShell (#777)

Problems fixed:
- Removed double TASKKILL execution when SendInterrupt is enabled
- Simplified kill logic to single TASKKILL command
- Added console window hiding for TASKKILL and PowerShell
- Improved PowerShell with -NoProfile and -NonInteractive flags

Key difference from reverted PR #855:
- Kept PowerShell instead of cmd.exe to avoid sound issues (#707)
- Still fixes the double-kill bug that caused orphaned processes
- Added window hiding for cleaner UX on Windows
- Better PowerShell performance with optimized flags

The previous code would run TASKKILL twice when SendInterrupt was
enabled, causing processes to not be properly terminated and leading
to port conflicts and orphaned processes.

This fix addresses #777 without introducing #707 sound issues.

Testing on Linux shows clean process transitions with no port conflicts.

Fixes #777
Avoids #707

* fix: clarify Windows send_interrupt handling

Document that Windows ignores send_interrupt and use CREATE_NO_WINDOW for clearer process spawning.

* Add env file config and warn on dangerous roots

* Add default env file list

---------

Co-authored-by: xiantang <zhujingdi1998@gmail.com>
2026-01-19 22:50:34 +08:00
xiantang f7485ca491 Implement .env file preload (#867)
* implement .env parsing and expanding

* implement .env parsing and expanding

* reload env on reload/rebuild as well

* default to empty env file. remove cyclical dependency stuff

* default to empty env file. remove cyclical dependency stuff

* use godotenv to parse, dont override global vars

* implement multiple env file support

* update readme and example config

* update readme some more

* fix typo

* dce in util.go

* Avoid loading env files on cancelled runs

* Clean up env load linting

---------

Co-authored-by: sirkostya009 <kosta.tovstik@gmail.com>
2026-01-19 22:10:51 +08:00
xiantang 122d83caf7 Revert "feat: add build-specific platform overrides (#864)" (#865)
This reverts commit f5498179c6.
2026-01-19 21:34:27 +08:00
xiantang f5498179c6 feat: add build-specific platform overrides (#864) 2026-01-19 21:34:08 +08:00
Andrew Borg e4c89c110d feat: Add option to ignore dangerous root dir protections (#862) 2026-01-14 14:32:28 +08:00
xiantang 07de0e2f11 feat: add app_start_timeout to proxy configuration and improve error handling (#844)
* feat: add app_start_timeout to proxy configuration and improve error handling

* fix: resolve P0 and P1 issues in app_start_timeout proxy feature

- Use context timeout for first HTTP request to prevent hanging
- Fix WriteHeader called before setting Content-Length header
- Simplify retry loop condition (for err != nil instead of for { if err == nil })
- Add code comments for clarity (HTML vs non-HTML response handling)
- Clean up strconv.Itoa usage (remove unnecessary byte conversion)
- Add documentation to air_example.toml explaining app_start_timeout
- Add comprehensive unit tests for timeout scenarios (5 test cases)

P0 fixes (critical):
- First request now uses context timeout
- WriteHeader now called after all headers are set

P1 fixes (strongly recommended):
- Documented in air_example.toml with usage examples
- Added TestProxy_appStartTimeout with 5 test scenarios

Related to #656 (proxy reload timing issue)

* test: add comprehensive test coverage for app_start_timeout feature

---------

Co-authored-by: Juan Gonzalez <jrg2156@gmail.com>
Co-authored-by: Juan Gonzalez <juanrgon@github.com>
2026-01-05 22:06:11 +08:00
Copilot 64a47a2839 Add wildcard (*) support for include_ext to watch all file extensions (#833)
* Initial plan

* Add wildcard (*) support for include_ext to watch all file extensions

Co-authored-by: xiantang <34479567+xiantang@users.noreply.github.com>

* Add test coverage for isBinPath empty binPath case

Co-authored-by: xiantang <34479567+xiantang@users.noreply.github.com>

* Extract wildcard string literal to extWildcard constant

Co-authored-by: xiantang <34479567+xiantang@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: xiantang <34479567+xiantang@users.noreply.github.com>
2026-01-04 20:02:40 +08:00
xiantang dc225acc8e deprecated: --build.bin --build.args_bin (#826)
* Silence logs in build failure tests

* Add build entrypoint support

* Resolve entrypoint via PATH

* Fix TestWriteDefaultConfig

* Set default entrypoint path

* runner: support inline entrypoint args

* Fix TestRunCommand port setup

* Update runner/config.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-20 22:31:21 +08:00
xiantang fb52989494 Add schema header to init config (#811) 2025-11-11 23:39:31 +08:00
Olivia Bahr 7019f7aa79 Fix: typo in air_example.toml (#706) 2024-11-21 15:19:56 +08:00
~ jesse ~ 0dfcd29786 feat: silent flag in .air.toml, suppressing all air prints (#641)
* feat: silent flag in .air.toml, suppressing all air prints

useful if the app being watched has structured outputs that are being
piped into subsequent program/s.

* update: add silent to air_example.toml
2024-09-25 19:49:57 +08:00
Rick Yu 9f5042d77c fix: broken code (#652) 2024-09-22 11:59:12 +08:00
xiantang 42d73d7de0 Change project owner to air-verse (#607)
This reverts commit 613d2b313d.
2024-06-04 10:52:28 +08:00
xiantang 613d2b313d Revert "Change project owner to air-verse (#602)" (#606)
This reverts commit 32b22d6c7f.
2024-06-04 09:09:34 +08:00
xiantang 32b22d6c7f Change project owner to air-verse (#602) 2024-06-03 22:44:23 +08:00
Neemias 82848039bc Add live proxy feature (#512)
* fix: fix linter

* feat: add live proxy

* fix: fix live reload script injection for pages with partial updates

* fix: fix proxy for post method and include more tests

* fix: fix reload script

* Add fatal format message

---------

Co-authored-by: Neemias Almeida <ndalmeida@bol.com>
Co-authored-by: xiantang <zhujingdi1998@gmail.com>
2024-05-05 22:23:18 +08:00
Rick Yu 3164beedb7 feat: bump deps and actions (#536) 2024-02-25 11:01:19 +08:00
xiantang 9644428b22 set kill delay as nanosecond in example 2023-10-10 00:30:18 +08:00
Kareem Ebrahim c29522a1f3 Pre & Post commands (#461)
* feat: pre_cmd before each build

* test: pre_cmd option & runPreCmd func

* refactor: cmd&pre_cmd run logic into runCommand

* test: runCommand func

* docs: update example toml

* refactor: use fs to ensure pre_cmd is working

* feat: run post_cmd after ^C

* test: post_cmd

* docs: update example toml

* style: use single quotes instead of escape char
2023-09-21 09:34:11 +08:00
Rick Yu 32675c4c22 fix: revert code 2023-06-02 23:44:35 +08:00
Sander van Harmelen 6e01a68c91 Prevent double delays and add some docs (#411)
* Fix a few linter warnings

* Prevent double delays and add some docs

I just noticed that reusing `delay` for the poll interval will cause an unintended double delay (first the delay is used as interval, and when a change happened delay is used to wait before building after the change).

Adding a dedicated `poll_interval` parameter allows people to prevent that and apply a more fine-grained configuration.

Also added the new params to the example toml file with some docs which I forgot to do in the initial PR.
2023-04-13 22:01:31 +08:00
Harry Merritt 26c752a7b0 Feat: option to silence verbose air logging using main_only in config (#367)
* feat: silence air logging using main_only in config

* docs: update air_example with main_only usage
2023-01-13 23:06:32 +08:00
amikai 078d8ffa29 feat: support executing bin again when bin exit (#363)
* feat: support executing bin again when bin exit

* fix bug and add feature flag

* add rerun test

* disable rerun in default

* fix logic error

* delete unnecessary code

* add default option in toml

Co-authored-by: xiantang <zhujingdi1998@gmail.com>
2023-01-05 15:36:20 +08:00
xiantang a2b8871f2a change build delay to zero (#343)
* change build delay to zero

Co-authored-by: xiantang <zhujingdi1998@gamil.com>
2022-10-24 15:56:13 +08:00
silverwind 25c287e039 Add include_file option (#337)
* Add `include_file` option
2022-10-24 14:12:13 +08:00
jshnaidman 6f18a44eb4 fixes air_example.toml regex expression (#303)
* fixes air_example.toml regex expression

* increases coverage of TestRegexes
2022-07-07 23:31:17 +08:00
Gurleen Sethi f7ec5b5ac2 🌐 doc: update example air file to document args_bin property (#264) 2022-04-05 00:30:12 +08:00
jingdi.zhu 4ad4028b96 chore(*): update air_example.toml 2021-11-21 17:36:04 +08:00
xiantang bedc182012 chore(*):ignore test code 2021-07-11 11:43:46 +08:00
Zheng Can d012f24b89 Follow symlink if required (#137)
* Follow symlink is required

* update air_example.toml, ignore symlink for files

Co-authored-by: canzheng <canzheng@tencent.com>
2021-04-23 22:38:23 +08:00
Kyle Unverferth 99f2a65d02 ExcludeRegex (#158)
* Adding `ExcludeRegex` to build config, excluding files based on compiled regular expressions

* Lintfix
2021-04-23 22:34:43 +08:00
Ben Brooks 0b21d9ef12 feat: Skip write events for unchanged files.
Can be enabled with the [build].exclude_unchanged config option.

On startup, walks the watched filepaths and stores current file checksums
in memory. After a file write event, the file is checked to determine if
the contents have changed since the previously cached checksum.
2020-11-12 10:36:01 +00:00
Masahiro Furudate 71d8bf298b Rename air_example.conf -> air_example.toml 2020-07-25 16:41:46 +09:00