Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

1.0.0.1 #4

Merged
merged 6 commits into from
Aug 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: Build
run: npm run build

- name: Cmd
run: npm run cmd
- name: Test command
run: npm run test:cmd
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

<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>
<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>

## Installation

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


## Usage

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

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

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

## Development

Expand Down
4 changes: 2 additions & 2 deletions assets/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>name</key>
<string>Bootstrap Icons 1.0.0.0</string>
<string>Bootstrap Icons 1.0.0.1</string>
<key>version</key>
<string>1.0.0.0</string>
<string>1.0.0.1</string>
<key>webaddress</key>
<string>https://github.com/ruedap/alfred-bootstrap-icons-workflow</string>
<key>readme</key>
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"engines": {
"node": "12.x"
},
"description": "You can incrementally search for Font Awesome icons and paste it to front most app.",
"description": "You can incrementally search for Bootstrap Icons and paste it to front most app.",
"scripts": {
"clean": "rimraf ./dist && mkdirp ./dist && cpx './assets/{icons/*,icon.png,info.plist}' ./dist",
"compile": "webpack",
Expand All @@ -13,15 +13,15 @@
"build": "npm run clean && npm run compile && npm run package && npm run compress",
"build:open": "npm run build && npm run open",
"open": "open ./dist/Bootstrap-Icons.alfredworkflow",
"cmd:find": "./dist/bootstrap-icons-workflow --find bootstrap",
"cmd:put:svg": "./dist/bootstrap-icons-workflow --put-svg bootstrap",
"cmd:put:name": "./dist/bootstrap-icons-workflow --put-name bootstrap",
"cmd:put:url": "./dist/bootstrap-icons-workflow --put-url bootstrap",
"cmd:put": "npm run cmd:put:svg && npm run cmd:put:name && npm run cmd:put:url",
"cmd": "npm run cmd:find && npm run cmd:put",
"exec": "npm run clean && npm run compile && node ./dist/index.js",
"test": "jest",
"test:watch": "jest --watchAll",
"test:cmd:find": "./dist/bootstrap-icons-workflow --find bootstrap",
"test:cmd:put:svg": "./dist/bootstrap-icons-workflow --put-svg bootstrap",
"test:cmd:put:name": "./dist/bootstrap-icons-workflow --put-name bootstrap",
"test:cmd:put:url": "./dist/bootstrap-icons-workflow --put-url bootstrap",
"test:cmd:put": "npm run test:cmd:put:svg && npm run test:cmd:put:name && npm run test:cmd:put:url",
"test:cmd": "npm run test:cmd:find && npm run test:cmd:put",
"fmt": "prettier --write .",
"lint": "eslint . --ext 'ts,js'",
"lint:fix": "eslint . --fix --ext 'ts,js'",
Expand All @@ -34,8 +34,7 @@
"type": "git",
"url": "git+https://github.com/ruedap/alfred-bootstrap-icons-workflow.git"
},
"keywords": [],
"author": "",
"author": "ruedap",
"license": "MIT",
"bugs": {
"url": "https://github.com/ruedap/alfred-bootstrap-icons-workflow/issues"
Expand Down
4 changes: 3 additions & 1 deletion src/alfred/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ type TText = Readonly<{
}>;

export type TResponseItem = Readonly<{
uid: string;
// NOTE: If you would like Alfred to always show the results in the order you return them from your script, exclude the UID field.
// https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
uid?: string;
title: string;
subtitle: string;
arg: string; // recommended
Expand Down
4 changes: 1 addition & 3 deletions src/icons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test("toResponseItem()", () => {

const actual = toResponseItem(iconObject);
const expected = {
uid: "bootstrap",
title: "bootstrap",
subtitle: "Paste SVG code",
arg: "bootstrap",
Expand All @@ -27,9 +26,8 @@ test("getAllIcons()", () => {
const allIcons = getAllIcons();
expect(allIcons.items.length).toBe(1120);

const actual = allIcons.items.find((icon) => icon.uid === "bootstrap");
const actual = allIcons.items.find((icon) => icon.arg === "bootstrap");
const expected = {
uid: "bootstrap",
title: "bootstrap",
subtitle: "Paste SVG code",
arg: "bootstrap",
Expand Down
1 change: 0 additions & 1 deletion src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getAllIconsObject, TIconObject } from "./assets/icons_object";

export const toResponseItem = (iconObject: TIconObject): TResponseItem => {
return {
uid: iconObject.name,
title: iconObject.name,
subtitle: `Paste SVG code`,
arg: iconObject.name,
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ const output = (str: string): void => {
const main = (): void => {
const args = getArgs();
const list = getAllIconsObject();
const keys = ["name", "search.terms"];

if (includesFlag(args, FLAG.FIND)) {
const query = getFlagArgs(args, FLAG.FIND);
const searchResult = search(list, keys, query);
const searchResult = search(list, query);
output(toJson(searchResult));
return;
}
Expand All @@ -50,7 +49,7 @@ const main = (): void => {
}

// NOTE: No flags
output(toJson(search(list, keys, "")));
output(toJson(search(list, "")));
};

main();
Loading