Skip to content

Commit

Permalink
Merge pull request #340 from swrlab/dev/dep-fetch-update
Browse files Browse the repository at this point in the history
Utils Migration and Dependency Upgrades
  • Loading branch information
frytg authored Jan 26, 2022
2 parents eb5f8c4 + 079b097 commit 46d05bd
Show file tree
Hide file tree
Showing 45 changed files with 8,893 additions and 1,832 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# set google login
GCP_PROJECT_ID="my-project"
GOOGLE_APPLICATION_CREDENTIALS=./keys/gcp.json

ARD_DELIVER_API="https://deliver-test.ard.de/organization-service/"
ARD_AUTH="user:pass"
22 changes: 10 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2020
},
"root": true,
"plugins": ["@swrlab/eslint-plugin-swr"],
"extends": ["plugin:@swrlab/eslint-plugin-swr/recommended"],
"rules": {
"radix": 0,
"no-unused-vars": ["error", { "argsIgnorePattern": "next" }],
"no-param-reassign": [2, { "props": false }],
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-return-assign": ["error", "except-parens"]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Lint Code Base
uses: docker://github/super-linter:v2.2.0
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/publish.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
.env

# config
config.js
Expand Down Expand Up @@ -60,3 +62,6 @@ typings/

# next.js build output
.next

tmp/*
!tmp/.gitkeep
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Storage Wrapper for NodeJS
# SWR Audio Lab / Node Utils Changelog

by [**SWR audio lab**](https://lab.swr.de/)
by [**SWR Audio Lab**](https://lab.swr.de/)

## Changelog

- 2022-01-26 - v1.0.0-beta
- chore!: folder migration
- refactor: swap node-fetch for undici
- feat: add ard publisher script
- feat: add ard category parser
- feat: add string helpers

- 2021-08-11 - v0.2.3
- updated dependencies
- updated github actions
- add optional 'resumable' flag

- 2021-06-22 - v0.2.2
- 2021-06-21 - v0.2.2
- updated dependencies
- updated github actions
- changed dependabot interval
92 changes: 88 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,96 @@
# Storage Wrapper for NodeJS
# SWR Audio Lab / Node Utils

This module allows easy unified access to the most common storage operations in the local file storage, AWS S3 and Google Cloud Storage.
This repository contains several frequently used packages and scripts for easier access and maintenance.

*Please note: This project is still under development!*

## Installation
- [SWR Audio Lab / Node Utils](#swr-audio-lab--node-utils)
- [Install](#install)
- [Packages](#packages)
- [Scripts](#scripts)
- [ARD Category Remapper](#ard-category-remapper)
- [ARD Core ID generator](#ard-core-id-generator)
- [ARD Core Publisher Remapper](#ard-core-publisher-remapper)
- [Publish to NPM](#publish-to-npm)
- [Changelog](#changelog)
- [License](#license)

Install dependencies with `yarn`.
## Install

Packages are meant to be imported into other projects:

```js
const undici = require('@swrlab/utils/packages/undici')
```

Scripts are meant to be run locally, therefore clone the repository and first install dependencies. We prefer `yarn` for this:

```sh
yarn install
```

Then run the desired script.

## Packages

- [ARD](./packages/ard) - Common internal ARD tools like ID creation
- [Storage Wrapper](./packages/storage-wrapper) - A utility to wrap file access to local, Google Cloud Storage and AWS S3 file storage
- [Strings](./packages/strings) - Common string, array, object encoding and getter helpers
- [Undici](./packages/undici) - Provides the latest install of [`undici-wrapper`](https://github.com/frytg/undici-wrapper), a wrapper around the [`undici`](https://undici.nodejs.org/) HTTP library

## Scripts

### ARD Category Remapper

Use the publicly available ARD categories and reformat them into our structure:

```sh
yarn ard:categories
```

The output is written to a file: [`data/ard/categories.json`](./data/ard/categories.json) (also kept in state in this repository).

### ARD Core ID generator

A CLI to encode strings into the ARD Core ID standard:

```sh
yarn ard:coreId "my-string-to-encode"
```

This will print:

```txt
INPUT:
my-string-to-encode
OUTPUT (CRC64-ECMA182):
6a80b80f748c9b50
```

### ARD Core Publisher Remapper

Download all publishers and remap them into our format:

```sh
yarn ard:publishers
```

The output is written to a file: `tmp/ard-publishers.json` (the state is not in this repository, but likely still in [`ard-eventhub/.../coreApi.json`](https://github.com/swrlab/ard-eventhub/blob/main/src/data/coreApi.json)).

## Publish to NPM

Sign in to NPM and provide username, password, and email-address:

```sh
npm login
```

Publish updates of this package with:

```sh
npm publish
```

## Changelog

Expand Down
Empty file added data/.gitkeep
Empty file.
Empty file added data/ard/.gitkeep
Empty file.
Loading

0 comments on commit 46d05bd

Please sign in to comment.