Skip to content

Commit

Permalink
✨ feat: Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabubenik committed Mar 13, 2024
1 parent 6c2ef96 commit b0a57bc
Show file tree
Hide file tree
Showing 236 changed files with 23,460 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests/fixtures/file-types-metafile/file15-js/
tests/fixtures/file-types-metafile/file14-ts/
docs/code-examples/
28 changes: 28 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'airbnb-base',
'airbnb-typescript/base',
],
parserOptions: {
project: ['tsconfig.json', 'tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'max-len': ['error', { code: 120 }],
'prefer-destructuring': 'off',
},
};
38 changes: 38 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy Docs

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy-docs:
name: Deploy Docs
runs-on: [ self-hosted, Linux ]
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build Docs
run: |
cd docs
npm ci
npm run build
- name: Update Docs Branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/.vitepress/dist
109 changes: 109 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: QA checks

on:
pull_request:
branches:
- main

push:
branches:
- docs

jobs:
lint:
name: Lint, Typecheck, Test and Build source files
runs-on: [ self-hosted, Linux ]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Lint source files
run: npm run lint

- name: Check types
run: npm run typecheck

- name: Run tests
run: npm run test:coverage

- name: Build package
run: npm run build

- name: 'Report Coverage'
if: always()
uses: davelosert/vitest-coverage-report-action@v2

- name: Gather data
id: data
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
LICENSE=$(node -p "require('./package.json').license")
echo "license=$LICENSE" >> "$GITHUB_OUTPUT"
COVERAGE=50
echo "coverage=$COVERAGE" >> "$GITHUB_OUTPUT"
BRANCH=${GITHUB_REF#refs/heads/}
echo "branch=$BRANCH" >> "${GITHUB_OUTPUT}"
shell: bash

- uses: actions/checkout@v4
with:
ref: gh-badges

- name: Create badges directory
run: mkdir -p "${{ steps.data.outputs.branch }}"
shell: bash

- name: Generate version badge
uses: emibcn/[email protected]
with:
label: npm
status: ${{ steps.data.outputs.version }}
color: 066fef
path: ${{ steps.data.outputs.branch }}/version.svg

- name: Generate coverage badge
uses: emibcn/[email protected]
with:
label: coverage
status: ${{ steps.data.outputs.coverage }}%
color: ${{ steps.data.outputs.coverage > 90 && 'green'
|| steps.data.outputs.coverage > 80 && 'yellow,green'
|| steps.data.outputs.coverage > 70 && 'yellow'
|| steps.data.outputs.coverage > 60 && 'orange,yellow'
|| steps.data.outputs.coverage > 50 && 'orange'
|| steps.data.outputs.coverage > 40 && 'red,orange'
|| steps.data.outputs.coverage > 30 && 'red,red,orange'
|| steps.data.outputs.coverage > 20 && 'red,red,red,orange'
|| 'red' }}
path: ${{ steps.data.outputs.branch }}/coverage.svg

- name: Generate license badge
uses: emibcn/[email protected]
with:
label: license
status: ${{ steps.data.outputs.license }}
color: 066fef,ffffff
path: ${{ steps.data.outputs.branch }}/license.svg

- name: Commit files
run: |
git config --local user.email "${{ github.actor_id }}+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git status
git commit -m "Update badges"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-badges
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release CI

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
ci:
name: CI Init
runs-on: [ self-hosted, Linux ]
outputs:
action: ${{ steps.init.outputs.action }}
steps:
- id: init
uses: localazy/release/init@v2

prepare:
name: Prepare Release PR
needs: ci
if: needs.ci.outputs.action == 'prepare'
runs-on: [ self-hosted, Linux ]
steps:
- uses: localazy/release/prepare@v2
with:
node-version: 20
app-id: ${{ secrets.AUTH_APP_ID }}
app-key: ${{ secrets.AUTH_APP_KEY }}

publish:
name: Publish Release
needs: ci
if: needs.ci.outputs.action == 'publish'
runs-on: [ self-hosted, Linux ]
steps:
- uses: localazy/release/publish@v2
with:
node-version: 20
app-id: ${{ secrets.AUTH_APP_ID }}
app-key: ${{ secrets.AUTH_APP_KEY }}
npm-publish: public
npm-token: ${{ secrets.NPM_AUTH_TOKEN_PUBLIC }}

deploy-docs:
name: Deploy Docs
needs: publish
runs-on: [ self-hosted, Linux ]
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build Docs
run: |
cd docs
npm ci
npm run docs:build
- name: Update Docs Branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/.vuepress/dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fund=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Localazy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<div align="center">

[<img src="https://localazy.com/directus9/assets/9fc36b9c-81b7-4dbf-bd82-b64cd984090f" width="285" height="50" alt="Localazy" >](https://localazy.com)

### 📦 `@localazy/cdn-client`

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

[**Documentation**](https://localazy.github.io/cdn-client/) &nbsp;|&nbsp;
[**Getting Started**](https://localazy.github.io/cdn-client/get-started/introduction.html) &nbsp;|&nbsp;
[**API Reference**](https://localazy.github.io/cdn-client/reference/client-api.html) &nbsp;|&nbsp;
[**Live Demo**]()

</div>

## 🔧 Install

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

For more information, visit the [installation guide](https://localazy.com/docs/cdn/cdn-introduction).

## 🛟 Support

- [Intercom chat](https://localazy.com)
- [GitHub issues](https://github.com/localazy/cdn-client/issues)
- [Discussion forum](https://discuss.localazy.com/)
- [[email protected]](mailto:[email protected])

## 💙 Localazy Ecosystem

Check out other npm packages from Localazy:

- [@localazy/cli](https://www.npmjs.com/package/@localazy/cli)
- [@localazy/api-client](https://www.npmjs.com/package/@localazy/api-client)
- [@localazy/cdn-client](https://www.npmjs.com/package/@localazy/cdn-client)
- [@localazy/languages](https://www.npmjs.com/package/@localazy/languages)
- [@localazy/strapi-plugin](https://www.npmjs.com/package/@localazy/strapi-plugin)

Discover all available [integration options and localization examples](https://github.com/localazy).

## 📜 License

Code released under the [MIT license](LICENSE).
8 changes: 8 additions & 0 deletions assets/es.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/js.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/ts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.vitepress/cache
Loading

0 comments on commit b0a57bc

Please sign in to comment.