Skip to content

Conversation

KasimAhmic
Copy link
Owner

@KasimAhmic KasimAhmic commented Jul 30, 2025

Currently a work in progress, need to update all 100+ functions so it'll take a while.

Closes #10.

The log lines already felt a bit long and with the majority of the logs coming from AutoIt already,
having AutoIt JS in there was pretty redundent. Will likely remove this logger altogether at some
point
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinGetTitleByHandle to WinGetTitleByHandleSync

#10
@KasimAhmic KasimAhmic requested a review from Copilot July 30, 2025 22:05
Copilot

This comment was marked as outdated.

Part of the ongoing work of #10

BREAKING CHANGE: Renamed AutoItSetOption to AutoItSetOptionSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ClipGet to ClipGetSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ClipPut to ClipPutSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlClick to ControlClickSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlClickByHandle to ControlClickByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlCommand to ControlCommandSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlCommandByHandle to ControlCommandByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlDisableByHandle to ControlDisableByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlDisable to ControlDisableSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlEnable to ControlEnableSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlEnableByHandle to ControlEnableByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlFocus to ControlFocusSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlFocusByHandle to ControlFocusByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetFocus to ControlGetFocusSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetFocusByHandle to ControlGetFocusByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetHandle to ControlGetHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetHandleAsText to ControlGetHandleAsTextSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetPos to ControlGetPosSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetPosByHandle to ControlGetPosByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetText to ControlGetTextSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlGetTextByHandle to ControlGetTextByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlHide to ControlHideSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed ControlHideByHandle to ControlHideByHandleSync

#10
@KasimAhmic KasimAhmic requested a review from Copilot August 1, 2025 16:08
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWaitByHandle to WinWaitByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWaitCloseByHandle to WinWaitCloseByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWaitClose to WinWaitCloseSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWaitNotActiveByHandle to WinWaitNotActiveByHandleSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWaitNotActive to WinWaitNotActiveSync

#10
Part of the ongoing work of #10

BREAKING CHANGE: Renamed WinWait to WinWaitSync

#10
@KasimAhmic KasimAhmic requested a review from Copilot August 7, 2025 21:47
Copilot

This comment was marked as outdated.

@KasimAhmic KasimAhmic requested a review from Copilot August 9, 2025 02:06
Copilot

This comment was marked as outdated.

…dows

Because Win32 libs are loaded as sideffects of importing the Koffi wrappers, even though an AutoIt
test won't be ran non-Windows devices, Vitest still needs to load the test file to see if it should
or shouldn't. This results in the Win32 libraries attemptiong to be loaded which causes errors on CI
The declaration file was having comments stripped out by tsc so I re-enabled that and enabled
comment stripping in Rollup to prevent comment duplication
@KasimAhmic KasimAhmic requested a review from Copilot August 9, 2025 21:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements async functionality for the autoit-js library by adding asynchronous versions of all functions while maintaining backward compatibility. The implementation adds Promise-based async functions alongside synchronous ones, with the sync versions being renamed with a Sync suffix.

  • Adds async capability to all 100+ autoit functions using Promise-based APIs
  • Renames existing functions to *Sync variants for clarity
  • Updates test configuration to exclude Windows-specific tests on non-Windows platforms

Reviewed Changes

Copilot reviewed 145 out of 148 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Adds platform detection and test filtering for Windows-specific tests
src/lib/autoit.ts Implements async function invocation using promises and callback handling
src/util/typed-promisify.ts Utility for promisifying functions with type safety
src/lib/gdi32.ts, src/lib/user32.ts, src/lib/kernel32.ts Adds async versions of Windows API functions
src/win-.ts, src/process-.ts, src/mouse-*.ts, etc. Adds async versions of all AutoIt functions
Comments suppressed due to low confidence (1)

@KasimAhmic KasimAhmic merged commit f24681d into main Aug 9, 2025
2 checks passed
@KasimAhmic
Copy link
Owner Author

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add async functions

1 participant