Skip to content

Commit

Permalink
feat: support esmodules
Browse files Browse the repository at this point in the history
  • Loading branch information
pine committed Dec 24, 2022
1 parent cd5a265 commit 6462f47
Show file tree
Hide file tree
Showing 14 changed files with 295 additions and 208 deletions.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 2

[*.ts]
indent_style = space
indent_size = 4
9 changes: 0 additions & 9 deletions .eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: build
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version:
- 14
- 16
- 18
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/
node_modules/
npm-debug.log*
node_modules
yarn.lock
yarn-error.log
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2019 Pine Mizune
Copyright (c) 2016-2020, 2022 Pine Mizune

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
52 changes: 0 additions & 52 deletions __tests__/index.js

This file was deleted.

77 changes: 0 additions & 77 deletions __tests__/interfaces.json

This file was deleted.

43 changes: 0 additions & 43 deletions index.js

This file was deleted.

8 changes: 8 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Config } from '@jest/types'

const config: Config.InitialOptions = {
preset: 'ts-jest',
verbose: true,
}

export default config
42 changes: 27 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,40 @@
"name": "self-ip",
"version": "0.3.7",
"description": "Get self IP addresses",
"main": "index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"scripts": {
"test": "eslint index.js __tests__ && jest"
"test": "jest",
"build": "tsup src/index.ts --dts --format esm,cjs --target es5",
"clean": "rimraf dist",
"prepare": "run-s clean build"
},
"files": [
"index.js",
"*.md"
"dist"
],
"dependencies": {
"is-lo": "^0.2.0"
"is-lo": "^1.0.0"
},
"devDependencies": {
"eslint": ">=5.0.0",
"eslint-config-standard": "^14.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.8.0"
},
"engines": {
"node": ">= 4.0.0"
"@swc/core": "^1.3.24",
"@types/jest": "^29.2.4",
"@types/lodash.sortby": "^4.7.7",
"@types/node": "^18.11.17",
"jest": "^29.3.1",
"lodash.sortby": "^4.7.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"tsup": "^6.5.0",
"typescript": "^4.9.4"
},
"author": {
"name": "Pine Mizune",
Expand Down
Loading

0 comments on commit 6462f47

Please sign in to comment.