Skip to content

Commit 6578ff6

Browse files
authoredAug 30, 2020
Merge pull request #4 from ruedap/v1.0.0.1
1.0.0.1
2 parents f6a72df + da3ebe0 commit 6578ff6

File tree

10 files changed

+208
-118
lines changed

10 files changed

+208
-118
lines changed
 

‎.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
- name: Build
2222
run: npm run build
2323

24-
- name: Cmd
25-
run: npm run cmd
24+
- name: Test command
25+
run: npm run test:cmd

‎README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
You can incrementally search for [Bootstrap Icons](https://icons.getbootstrap.com/) and paste it to front most app.
77

8-
<a href="https://github.com/ruedap/alfred-bootstrap-icons-workflow/releases"><img alt="screencast" src="https://github.com/ruedap/alfred-bootstrap-icons-workflow/raw/main/utils/screenshots/screencast.gif" width="700"></a>
8+
<a href="https://github.com/ruedap/alfred-bootstrap-icons-workflow/releases"><img alt="screencast" src="https://github.com/ruedap/alfred-bootstrap-icons-workflow/raw/assets/images/screencast.gif" width="800"></a>
99

1010
## Installation
1111

@@ -18,7 +18,6 @@ The current supported version is **Bootstrap Icons 1.0.0**. Previous versions ar
1818
There are a few ways to allow such programs to run.
1919
See: https://github.com/ruedap/alfred-bootstrap-icons-workflow/issues/1
2020

21-
2221
## Usage
2322

2423
**Keyword** `bi`: Search through [Bootstrap Icons](https://icons.getbootstrap.com/).
@@ -41,7 +40,7 @@ See: https://github.com/ruedap/alfred-bootstrap-icons-workflow/issues/1
4140

4241
**Disable pasting**: Turn off "Automatically paste to front most app" in Workflow's Preferences.
4342

44-
<img alt="Disable pasting" src="https://github.com/ruedap/alfred-bootstrap-icons-workflow/raw/main/utils/screenshots/option-disable-pasting.png" width="700">
43+
<img alt="Disable pasting" src="https://github.com/ruedap/alfred-bootstrap-icons-workflow/raw/assets/images/option-disable-pasting.png" width="800">
4544

4645
## Development
4746

‎assets/info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<plist version="1.0">
44
<dict>
55
<key>name</key>
6-
<string>Bootstrap Icons 1.0.0.0</string>
6+
<string>Bootstrap Icons 1.0.0.1</string>
77
<key>version</key>
8-
<string>1.0.0.0</string>
8+
<string>1.0.0.1</string>
99
<key>webaddress</key>
1010
<string>https://github.com/ruedap/alfred-bootstrap-icons-workflow</string>
1111
<key>readme</key>

‎package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"engines": {
55
"node": "12.x"
66
},
7-
"description": "You can incrementally search for Font Awesome icons and paste it to front most app.",
7+
"description": "You can incrementally search for Bootstrap Icons and paste it to front most app.",
88
"scripts": {
99
"clean": "rimraf ./dist && mkdirp ./dist && cpx './assets/{icons/*,icon.png,info.plist}' ./dist",
1010
"compile": "webpack",
@@ -13,15 +13,15 @@
1313
"build": "npm run clean && npm run compile && npm run package && npm run compress",
1414
"build:open": "npm run build && npm run open",
1515
"open": "open ./dist/Bootstrap-Icons.alfredworkflow",
16-
"cmd:find": "./dist/bootstrap-icons-workflow --find bootstrap",
17-
"cmd:put:svg": "./dist/bootstrap-icons-workflow --put-svg bootstrap",
18-
"cmd:put:name": "./dist/bootstrap-icons-workflow --put-name bootstrap",
19-
"cmd:put:url": "./dist/bootstrap-icons-workflow --put-url bootstrap",
20-
"cmd:put": "npm run cmd:put:svg && npm run cmd:put:name && npm run cmd:put:url",
21-
"cmd": "npm run cmd:find && npm run cmd:put",
2216
"exec": "npm run clean && npm run compile && node ./dist/index.js",
2317
"test": "jest",
2418
"test:watch": "jest --watchAll",
19+
"test:cmd:find": "./dist/bootstrap-icons-workflow --find bootstrap",
20+
"test:cmd:put:svg": "./dist/bootstrap-icons-workflow --put-svg bootstrap",
21+
"test:cmd:put:name": "./dist/bootstrap-icons-workflow --put-name bootstrap",
22+
"test:cmd:put:url": "./dist/bootstrap-icons-workflow --put-url bootstrap",
23+
"test:cmd:put": "npm run test:cmd:put:svg && npm run test:cmd:put:name && npm run test:cmd:put:url",
24+
"test:cmd": "npm run test:cmd:find && npm run test:cmd:put",
2525
"fmt": "prettier --write .",
2626
"lint": "eslint . --ext 'ts,js'",
2727
"lint:fix": "eslint . --fix --ext 'ts,js'",
@@ -34,8 +34,7 @@
3434
"type": "git",
3535
"url": "git+https://github.com/ruedap/alfred-bootstrap-icons-workflow.git"
3636
},
37-
"keywords": [],
38-
"author": "",
37+
"author": "ruedap",
3938
"license": "MIT",
4039
"bugs": {
4140
"url": "https://github.com/ruedap/alfred-bootstrap-icons-workflow/issues"

‎src/alfred/response.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ type TText = Readonly<{
1919
}>;
2020

2121
export type TResponseItem = Readonly<{
22-
uid: string;
22+
// NOTE: If you would like Alfred to always show the results in the order you return them from your script, exclude the UID field.
23+
// https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
24+
uid?: string;
2325
title: string;
2426
subtitle: string;
2527
arg: string; // recommended

‎src/icons.test.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test("toResponseItem()", () => {
1414

1515
const actual = toResponseItem(iconObject);
1616
const expected = {
17-
uid: "bootstrap",
1817
title: "bootstrap",
1918
subtitle: "Paste SVG code",
2019
arg: "bootstrap",
@@ -27,9 +26,8 @@ test("getAllIcons()", () => {
2726
const allIcons = getAllIcons();
2827
expect(allIcons.items.length).toBe(1120);
2928

30-
const actual = allIcons.items.find((icon) => icon.uid === "bootstrap");
29+
const actual = allIcons.items.find((icon) => icon.arg === "bootstrap");
3130
const expected = {
32-
uid: "bootstrap",
3331
title: "bootstrap",
3432
subtitle: "Paste SVG code",
3533
arg: "bootstrap",

‎src/icons.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { getAllIconsObject, TIconObject } from "./assets/icons_object";
33

44
export const toResponseItem = (iconObject: TIconObject): TResponseItem => {
55
return {
6-
uid: iconObject.name,
76
title: iconObject.name,
87
subtitle: `Paste SVG code`,
98
arg: iconObject.name,

‎src/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ const output = (str: string): void => {
1919
const main = (): void => {
2020
const args = getArgs();
2121
const list = getAllIconsObject();
22-
const keys = ["name", "search.terms"];
2322

2423
if (includesFlag(args, FLAG.FIND)) {
2524
const query = getFlagArgs(args, FLAG.FIND);
26-
const searchResult = search(list, keys, query);
25+
const searchResult = search(list, query);
2726
output(toJson(searchResult));
2827
return;
2928
}
@@ -50,7 +49,7 @@ const main = (): void => {
5049
}
5150

5251
// NOTE: No flags
53-
output(toJson(search(list, keys, "")));
52+
output(toJson(search(list, "")));
5453
};
5554

5655
main();

0 commit comments

Comments
 (0)