Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into docs-update-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
antonko committed Mar 15, 2024
2 parents a8466af + b75fb88 commit 612ead7
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
working-directory: ./blurhasher

- name: Archive built files
run: tar -czvf build.tar.gz -C ./blurhasher dist package.json package-lock.json
run: tar -czvf build.tar.gz -C ./blurhasher dist package.json

- name: Upload build artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -73,8 +73,16 @@ jobs:
name: built-files
path: ./blurhasher

- name: Copy README.md to blurhasher
run: cp README.md blurhasher/README.md

- name: Unpack build artifact
run: tar -xzvf build.tar.gz
working-directory: ./blurhasher

- name: Semantic Release
run: npx semantic-release
working-directory: ./blurhasher
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"editor.formatOnSave": true,
"prettier.trailingComma": "es5",
"editor.formatOnSave": false,
"files.eol": "\n",
"eslint.validate": ["javascript", "typescript"],
"editor.codeActionsOnSave": {
Expand Down
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Directus Blurhasher

Это расширение для Directus, которое автоматически генерирует blurhash строки для изображений при их загрузке и сохраняет их в базе данных.

При использовании API Directus для работы с коллекцией directus_files, в дополнение к основным полям, будет добавлено поле `blurhash`, в котором будет храниться сгенерированная blurhash строка.

Это расширение было протестировано на версии v10.10.4 Directus, однако оно должно работать и на более ранних версиях.

## Установка

```bash
npm install directus-extension-blurhasher
```

Пример Dockerfile с установленным расширением:

```Dockerfile
FROM directus/directus:10.10.4

USER root
RUN corepack enable
USER node

RUN pnpm install directus-extension-blurhasher
```

## Разработка

Для начала разработки вам необходимо запустить локальную копию Directus с помощью docker-compose.

* Логин: `admin@example.com`
* Пароль: `admin`

```bash
docker-compose up
```

После этого запустите процесс сборки в режиме разработки и следите за изменениями.

```bash
cd blurhasher
npm install
npm run dev
```

Также рекомендуется использовать линтеры и форматирование кода.

```bash
npm run lint
```
11 changes: 9 additions & 2 deletions blurhasher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@
"placeholder"
],
"files": [
"dist"
"dist",
"README.md"
],
"release": {
"branches": [
"semver-ci-cd"
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": true
}
],
[
"@semantic-release/github",
{
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ services:
KEY: "replace-with-random-value"
SECRET: "replace-with-random-value"
ADMIN_EMAIL: "admin@example.com"
ADMIN_PASSWORD: "d1r3ctu5"
ADMIN_PASSWORD: "admin"
DB_CLIENT: "sqlite3"
DB_FILENAME: "/directus/database/data.db"

0 comments on commit 612ead7

Please sign in to comment.