Skip to content

Commit

Permalink
chore: change package type to es module
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Package type is now ES Module (dropped CommonJS)
BREAKING CHANGE: CLI tool dropped the --version flag

Signed-off-by: Tomer Figenblat <[email protected]>
  • Loading branch information
TomerFi committed Aug 8, 2024
1 parent 36e7a00 commit a5db434
Show file tree
Hide file tree
Showing 9 changed files with 297 additions and 382 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
load: true
- name: Test image run
run: |
pattern='^@tomerfi/version-bumper ([0-9]\.){2}[0-9](.+)?$'
sut=$(docker run --rm ${{ env.TESTING_TAG }} -v)
pattern='Usage.*Example.*Options.*'
sut=$(docker run --rm ${{ env.TESTING_TAG }} -h)
[[ $sut =~ $pattern ]] || exit 1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ $ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b major
{"current":"2.1.4","bump":"major","next":"3.0.0","dev":"3.0.1-dev"}
```

### JS Module
### ES Module

```js
const bumper = require('@tomerfi/version-bumper')
import { bumper } from '@tomerfi/version-bumper'

// prints { current: '2.1.4', bump: 'patch', next: '2.1.5', dev: '2.1.5-dev' }
bumper({source: "2.1.4", bump: 'patch'}).then(bump => console.log(bump))
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default [
name: "default",
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
sourceType: "module",
globals: {
...globals.node
...globals.nodeBuiltin
}
},
rules: {
Expand Down
Loading

0 comments on commit a5db434

Please sign in to comment.