Skip to content

Commit

Permalink
📚 docs: Update README.md and add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabubenik committed Mar 18, 2024
1 parent 8aa5725 commit 1fd6ac2
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 82 deletions.
34 changes: 34 additions & 0 deletions .badges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"dir": ".github/badges",
"files": [
{
"fileName": "npm.svg",
"label": "npm",
"status": "1.5.0",
"icon": "npm"
},
{
"fileName": "coverage.svg",
"label": "coverage",
"status": 99.5,
"icon": "vitest"
},
{
"fileName": "size.svg",
"label": "minzipped size",
"status": "3.53 kB",
"icon": "speed",
"color": "43b816"
},
{
"fileName": "maintainer.svg",
"label": "maintainer",
"status": "Localazy"
},
{
"fileName": "license.svg",
"label": "license",
"status": "MIT"
}
]
}
20 changes: 0 additions & 20 deletions .github/badges/coverage.svg

This file was deleted.

24 changes: 0 additions & 24 deletions .github/badges/license.svg

This file was deleted.

24 changes: 0 additions & 24 deletions .github/badges/version.svg

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
ci:
name: CI Init
runs-on: [self-hosted, Linux]
runs-on: [ self-hosted, Linux ]
outputs:
action: ${{ steps.init.outputs.action }}
steps:
Expand All @@ -23,19 +23,19 @@ jobs:
name: Prepare Release PR
needs: ci
if: needs.ci.outputs.action == 'prepare'
runs-on: [self-hosted, Linux]
runs-on: [ self-hosted, Linux ]
steps:
- uses: localazy/release/prepare@v2
with:
app-id: ${{ secrets.AUTH_APP_ID }}
app-key: ${{ secrets.AUTH_APP_KEY }}
generate-badges: true
badges: true

publish:
name: Publish Release
needs: ci
if: needs.ci.outputs.action == 'publish'
runs-on: [self-hosted, Linux]
runs-on: [ self-hosted, Linux ]
steps:
- uses: localazy/release/publish@v2
with:
Expand All @@ -47,7 +47,7 @@ jobs:
deploy-docs:
name: Deploy Docs
needs: publish
runs-on: [self-hosted, Linux]
runs-on: [ self-hosted, Linux ]
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
Expand Down
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,61 @@
[**Live Demo**](https://localazy.github.io/cdn-client/sandbox/live-demo.html)  | 
[**API Reference**](https://localazy.github.io/cdn-client/reference/client-api.html)

[//]: # '[**Live Demo**]()'

Node.js module that allows you to easily interact with the [Localazy CDN](https://localazy.com/docs/cdn/cdn-introduction).

[![coverage](.github/badges/version.svg)](https://www.npmjs.com/package/@localazy/cdn-client)
[![coverage](.github/badges/license.svg)](https://github.com/localazy/cdn-client/blob/main/LICENSE)
[![npm](.github/badges/npm.svg)](https://www.npmjs.com/package/@localazy/cdn-client)
[![maintainer](.github/badges/maintainer.svg)](https://github.com/localazy)
[![license](.github/badges/license.svg)](https://github.com/localazy/cdn-client/blob/main/LICENSE)<br>
[![coverage](.github/badges/coverage.svg)](https://github.com/localazy/cdn-client/actions)
[![size](.github/badges/size.svg)](https://bundlephobia.com/package/@localazy/cdn-client)

</div>

## 🚀 Install
## 🚀 Quick Start

```bash
npm install @localazy/cdn-client
# or use your favourite package manager
```

For more information, visit the [installation guide](https://localazy.github.io/cdn-client/get-started/install.html).
```javascript
import { CdnClient } from '@localazy/cdn-client';

const cdn = await CdnClient.create({
// use your own metafile
metafile: 'https://delivery.localazy.com/_a855374211039568660198b39c31/_e0.v2.json',
});

const result = await cdn.fetch({
// select files from metafile
files: cdn.metafile.files[0],
// select locales
locales: ['en', 'de'],
});
```

<details><summary><i><samp>example result</samp></i></summary>

```javascript
const result = {
en: {
cdn_info: 'With the CDN you can deliver the translation files instantly',
cdn_testing: 'We\'re testing the CDN',
hello_localazy: 'Hello Localazy!',
using_javascript: 'In this project we decided to use JavaScript'
},
de: {
cdn_info: 'Mit dem CDN können Sie die Übersetzungsdateien sofort liefern',
cdn_testing: 'Wir testen das CDN',
hello_localazy: 'Hallo Localazy!',
using_javascript: 'In diesem Projekt haben wir uns für JavaScript entschieden'
}
};
```

</details>

For more information, visit [Installation](https://localazy.github.io/cdn-client/get-started/install.html) guide.

## 🛟 Support

Expand All @@ -40,7 +77,7 @@ For more information, visit the [installation guide](https://localazy.github.io/
Check out all npm packages from Localazy:

| Package | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| [@localazy/cli](https://www.npmjs.com/package/@localazy/cli) | Localazy CLI tool for app and software localization and translation. |
| [@localazy/api-client](https://www.npmjs.com/package/@localazy/api-client) | Node.js module that allows you to easily interact with the Localazy API. |
| [@localazy/cdn-client](https://www.npmjs.com/package/@localazy/cdn-client) | Node.js module that allows you to easily interact with the Localazy CDN. |
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineConfig({
text: 'Get Started',
items: [
{ text: 'Introduction', link: '/get-started/introduction' },
{ text: 'Install', link: '/get-started/install' },
{ text: 'Installation', link: '/get-started/installation' },
{ text: 'Metafile', link: '/get-started/metafile' },
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Install
# Installation

You can install the CDN Client as a Node.js module or import it directly in the browser.

Expand Down

0 comments on commit 1fd6ac2

Please sign in to comment.