Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/hybrid #45

Merged
merged 6 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 13 additions & 32 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,34 @@ on:
- master
pull_request:

permissions:
contents: read

jobs:
##################
# Jobs with matrix
##################
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14, 'lts/*']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
junderw marked this conversation as resolved.
Show resolved Hide resolved
- run: npm ci
- run: npm run unit

#####################
# Jobs without matrix
#####################
coverage:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run coverage
standard:
- run: npm run standard
gitdiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run standard
- run: npm run gitdiff
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.nyc_output
coverage

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A straight forward implementation of base58check extending upon bs58.
## Example

```javascript
var bs58check = require('bs58check')
import bs58check from 'bs58check'

var decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')

Expand Down
50 changes: 0 additions & 50 deletions base.js

This file was deleted.

18 changes: 18 additions & 0 deletions fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

find src/cjs -type f -name "*.js" -exec bash -c 'mv "$0" "${0%.js}.cjs"' {} \;

replace_in_file() {
local file="$1"
local regex="$2"
local replacement="$3"

sed -i "s/${regex}/${replacement}/g" "$file"
}

search_pattern='__importDefault(require("\([^"]*\)\.js"));'
replace_pattern='__importDefault(require("\1.cjs"));'

find src/cjs -type f -name "*.cjs" | while read -r file; do
replace_in_file "$file" "$search_pattern" "$replace_pattern"
done
9 changes: 0 additions & 9 deletions index.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions index.js

This file was deleted.

Loading
Loading