Skip to content

Commit cdf456f

Browse files
authored
Merge pull request #9 from Avivbens/feat/support-text-transformer-active-app-context
feat/support text transformer active app context
2 parents fb66200 + 1cce514 commit cdf456f

37 files changed

+1610
-1276
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ To help you get started with creating a new library or workflow app within Alfre
4040
nx g @alfredo/workspace:generate-workflow
4141
```
4242

43+
### Generate a new Library
44+
45+
```bash
46+
nx generate @nx/js:library projects/libs/<your-library-name>
47+
```
48+
4349
> **Note:** The generator CLI is designed to simplify the process of creating new libraries and workflows, ensuring that they are compatible with the FastAlfred framework. It handles the boilerplate code and configuration, allowing you to focus on building your workflow's functionality.
4450
4551
### Important Notes

demo/text-transformer/settings.png

719 KB
Loading

projects/libs/active-app/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# active-app
2+
3+
This library was generated with [Nx](https://nx.dev).
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { defineConfig } from 'eslint/config';
2+
import rootConfig from '../../../eslint.config.mjs';
3+
4+
export default defineConfig([rootConfig]);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "active-app",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "projects/libs/active-app/src",
5+
"projectType": "library",
6+
"tags": ["os:macos", "lib:util"],
7+
"targets": {
8+
"test": {},
9+
"lint": {}
10+
}
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { getActiveApp } from './lib/get-window-context';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { $ } from 'zurk';
2+
3+
export async function getActiveApp(): Promise<string> {
4+
const { stdout, stderr } =
5+
await $`osascript -e 'tell application "System Events" to get bundle identifier of first application process whose frontmost is true'`;
6+
7+
if (stderr) {
8+
throw new Error(`Error: ${stderr}`);
9+
}
10+
11+
const appName = stdout.trim();
12+
return appName;
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.app.json"
8+
},
9+
{
10+
"path": "./tsconfig.spec.json"
11+
}
12+
],
13+
"compilerOptions": {
14+
"esModuleInterop": true
15+
}
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"declaration": true,
6+
"types": ["node"]
7+
},
8+
"include": ["src/**/*.ts"]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["jest.config.cjs", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
9+
}

0 commit comments

Comments
 (0)