Skip to content

Commit

Permalink
Merge pull request #45 from Nesopie/feat/hybrid
Browse files Browse the repository at this point in the history
Feat/hybrid
  • Loading branch information
junderw authored Jun 25, 2024
2 parents cd8cb4b + 3d7c00e commit a128f03
Show file tree
Hide file tree
Showing 22 changed files with 4,552 additions and 2,699 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14, 'lts/*']
node-version: [18, 'lts/*']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
Expand All @@ -37,8 +37,8 @@ jobs:
coverage:
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/*'
registry-url: https://registry.npmjs.org/
Expand All @@ -48,11 +48,21 @@ jobs:
standard:
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/*'
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run standard
gitdiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- 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

0 comments on commit a128f03

Please sign in to comment.