Skip to content

Commit

Permalink
Update wip extension (#15937)
Browse files Browse the repository at this point in the history
* Update wip extension

- Merge branch \'contributions/merge-1734539435869\'
- Pull contributions
- Merge branch \'contributions/merge-1734539337087\'
- Pull contributions
- Fix clipboard uploads
- Improve description

* Update CHANGELOG.md and optimise images

---------

Co-authored-by: raycastbot <[email protected]>
  • Loading branch information
marckohlbrugge and raycastbot authored Dec 19, 2024
1 parent 24aea82 commit 5345c10
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 5 deletions.
8 changes: 7 additions & 1 deletion extensions/wip/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# WIP Changelog

## [Fixed bug with upload] – 2024-12-19

- Set correct mime-type of copy/pasted files
- Update Client ID for development
- Improve README

## [Improved README] - 2024-10-04

- List all features
Expand All @@ -8,4 +14,4 @@

## [Initial Version] - 2024-10-03

- Ship first public version
- Ship first public version
7 changes: 7 additions & 0 deletions extensions/wip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,23 @@ npm run dev
Bug fixes and improvements are welcome. For major changes, please open an issue first to discuss what you would like to change.

Start development server:

```sh
npm run dev
```

Fix linting errors:

```sh
npm run fix-lint
```

Publish a new version to Raycast Store:

```sh
npm run publish
```

## About

This extension is built by [Marc Köhlbrugge](https://marc.io) for [WIP](https://wip.co).
155 changes: 155 additions & 0 deletions extensions/wip/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions extensions/wip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "wip",
"title": "WIP",
"description": "List your WIP todos.",
"description": "Manage your WIP todos and projects from Raycast.",
"icon": "icon.png",
"author": "marckohlbrugge",
"categories": [
Expand Down Expand Up @@ -44,12 +44,15 @@
"dependencies": {
"@raycast/api": "^1.66.2",
"date-fns": "^3.6.0",
"file-type": "^19.6.0",
"lodash.debounce": "^4.0.8",
"mime-types": "^2.1.35",
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@raycast/eslint-config": "^1.0.6",
"@types/lodash.debounce": "^4.0.9",
"@types/mime-types": "^2.1.4",
"@types/react": "18.2.27",
"eslint": "^8.51.0",
"prettier": "^3.0.3",
Expand Down Expand Up @@ -82,4 +85,4 @@
]
}
]
}
}
7 changes: 5 additions & 2 deletions extensions/wip/src/oauth/wip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Todo, User, Project } from "../types";
import * as crypto from "crypto";
import fs from "fs";
import path from "path";
import { fileTypeFromBuffer } from "file-type";
import mime from "mime-types";

const preferences = getPreferenceValues();
const environment = preferences.environment;
Expand All @@ -13,7 +15,7 @@ let oauthUrl: string;
let apiUrl: string;

if (environment === "development") {
clientId = "nzJzX-pGkEIM2Zjbf-uVkdlCBOZA0dEQAKDtoZGjnLc";
clientId = "RUe8R2Q4fS5t0LR16EewRRXpcWHaIWaSfLMT-nQd2Wk";
oauthUrl = "http://wip.test:3000";
apiUrl = "http://api.wip.test:3000/v1";
} else {
Expand Down Expand Up @@ -167,9 +169,10 @@ export async function createTodo(todoText: string, filePaths: string[] = []): Pr
}
const fileBuffer = fs.readFileSync(filePath);
const checksum = crypto.createHash("md5").update(fileBuffer).digest("base64");
const fileType = "application/octet-stream";
const fileName = path.basename(filePath);
const fileSize = fileBuffer.length;
const fileTypeResult = await fileTypeFromBuffer(fileBuffer);
const fileType = fileTypeResult?.mime || mime.lookup(filePath) || "application/octet-stream";

const { url, signed_id, method, headers } = await createUpload(fileName, fileSize, checksum, fileType);

Expand Down

0 comments on commit 5345c10

Please sign in to comment.