Skip to content

Commit 5afe5f2

Browse files
feat: support MacOS Sonoma (#27)
* ci: add macos-14 to tests * feat: add new `--ignore-tcc-db` flag * docs: sonoma added to readme * chore: package version bump
1 parent 728a766 commit 5afe5f2

File tree

5 files changed

+70
-11
lines changed

5 files changed

+70
-11
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ jobs:
2727
name: artifacts
2828
path: |
2929
**/recordings/**/*
30+
test-ignore-tcc-db:
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
matrix:
34+
os: [macos-14]
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-node@v3
38+
with:
39+
node-version: 20
40+
- run: yarn install --frozen-lockfile
41+
- run: yarn ci:ignore-tcc-db
42+
- uses: actions/upload-artifact@v3
43+
if: always()
44+
with:
45+
name: artifacts
46+
path: |
47+
**/recordings/**/*
3048
test-nvda-install-dir:
3149
runs-on: ${{ matrix.os }}
3250
strategy:

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[![MacOS Big Sur Support](https://img.shields.io/badge/macos-Big_Sur-blue.svg?logo=apple)](https://apps.apple.com/id/app/macos-big-sur/id1526878132)
1010
[![MacOS Monetary Support](https://img.shields.io/badge/macos-Monetary-blue.svg?logo=apple)](https://apps.apple.com/us/app/macos-monterey/id1576738294)
1111
[![MacOS Ventura Support](https://img.shields.io/badge/macos-Ventura-blue.svg?logo=apple)](https://apps.apple.com/us/app/macos-ventura/id1638787999)
12+
[![MacOS Sonoma Support](https://img.shields.io/badge/macos-Somona-blue.svg?logo=apple)](https://apps.apple.com/us/app/macos-sonoma/id6450717509)
1213
[![Windows 10 Support](https://img.shields.io/badge/windows-10-blue.svg?logo=windows10)](https://www.microsoft.com/en-gb/software-download/windows10ISO)
1314
[![Windows Server 2019 Support](https://img.shields.io/badge/windows_server-2019-blue.svg?logo=windows)](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019)
1415
[![Windows Server 2022 Support](https://img.shields.io/badge/windows_server-2022-blue.svg?logo=windows)](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2022)
@@ -42,12 +43,26 @@ If you are using GitHub Actions, check out the dedicated [`guidepup/setup-action
4243
4344
If you are running this command locally, you might find it prompts you to pass in credentials so that it can using UI automation to change a checkbox value which enables the automation of VoiceOver. If you are uncomfortable with providing your credentials you can manually achieve these steps by following the [manual VoiceOver setup documentation](https://www.guidepup.dev/docs/guides/manual-voiceover-setup).
4445
46+
#### CI
47+
4548
If you are running this command in CI/CD, it is recommended to add the `--ci` flag to prevent interactive prompts:
4649

4750
```console
4851
npx @guidepup/setup --ci
4952
```
5053

54+
#### Ignore TCC.db Updates
55+
56+
If updating the TCC.db is not possible (due to SIP) or required you can skip the database update step by using the `--ignore-tcc-db` flag:
57+
58+
```console
59+
npx @guidepup/setup --ignore-tcc-db
60+
```
61+
62+
> Note: If the necessary permissions have not been granted by other means, using this flag may result in your environment not being setup for reliable screen reader automation.
63+
64+
#### Recording
65+
5166
If you are encountering errors in CI for MacOS you can pass a `--record` flag to the command which will output a screen-recording of the setup to a `./recordings/` directory:
5267

5368
```console

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@guidepup/setup",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Setup your environment for screen-reader automation.",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -28,6 +28,7 @@
2828
"build": "yarn clean && yarn compile",
2929
"ci": "yarn clean && yarn lint && yarn build && yarn resolutionFix && yarn start --ci --record",
3030
"ci:nvda-install-dir": "yarn clean && yarn lint && yarn build && yarn resolutionFix && yarn start --ci --record --nvda-install-dir %userprofile%\\nvda",
31+
"ci:ignore-tcc-db": "yarn clean && yarn lint && yarn build && yarn resolutionFix && yarn start --ci --record --ignore-tcc-db",
3132
"clean": "rimraf lib",
3233
"compile": "tsc",
3334
"dev": "ts-node ./src/index.ts",

src/logging.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import chalk from "chalk";
22

33
export const logInfo = console.info.bind(console);
4+
export const logWarn = console.warn.bind(console);
45
export const logError = console.error.bind(console);
56

67
export function handleComplete(): never {
@@ -11,6 +12,27 @@ export function handleComplete(): never {
1112
process.exit(0);
1213
}
1314

15+
export function handleWarning(err: Error): void {
16+
let message = err.message;
17+
18+
if (err.name) {
19+
message = `${err.name}: ${message}`;
20+
}
21+
22+
logWarn("");
23+
logWarn(chalk.bold(chalk.yellow(`[!] ${chalk.bold(message.toString())}`)));
24+
logWarn("");
25+
logWarn("Unable to complete environment setup");
26+
logWarn("");
27+
logWarn(
28+
chalk.dim(
29+
"Please raise new issues at: " +
30+
chalk.underline("https://github.com/guidepup/setup/issues")
31+
)
32+
);
33+
logWarn("");
34+
}
35+
1436
export function handleError(err: Error): never {
1537
let message = err.message;
1638

src/macOS/setup.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@ import { enableDoNotDisturb } from "./enableDoNotDisturb";
1616
import { enabledDbFile } from "./isAppleScriptControlEnabled/enabledDbFile";
1717

1818
const isCi = process.argv.includes("--ci");
19+
const ignoreTccDb = process.argv.includes("--ignore-tcc-db");
1920
const isRecorded = process.argv.includes("--record");
2021

2122
export async function setup(): Promise<void> {
22-
try {
23-
updateTccDb(USER_PATH);
24-
} catch (e) {
25-
if (isCi) {
26-
throw e;
23+
if (!ignoreTccDb) {
24+
try {
25+
updateTccDb(USER_PATH);
26+
} catch (e) {
27+
if (isCi) {
28+
throw e;
29+
}
2730
}
28-
}
2931

30-
try {
31-
updateTccDb(SYSTEM_PATH);
32-
} catch {
33-
// Swallow error - most CI don't allow system configuration
32+
try {
33+
updateTccDb(SYSTEM_PATH);
34+
} catch {
35+
// Swallow error - most CI don't allow system configuration
36+
}
3437
}
3538

3639
const osName = platform();

0 commit comments

Comments
 (0)