diff --git a/.eslintrc.json b/.eslintrc.json index a39ac05..286e9de 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,20 +1,17 @@ { - "env": { - "browser": true, - "es6": true, - "commonjs": true - }, - "extends": "eslint:recommended", - "rules": { - "quotes": [ - "error", - "single" - ] - }, - "parserOptions": { - "sourceType": "module" - }, - "globals": { - "L": true - } -} \ No newline at end of file + "env": { + "browser": true, + "es6": true, + "amd": true, + "commonjs": true + }, + "extends": "eslint:recommended", + "rules": { + "indent": ["error", 2], + "quotes": ["error", "single"], + "no-extra-semi": "off" + }, + "globals": { + "L": true + } +} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..df64aa5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +ko_fi: surunzi +open_collective: eruda \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d47b285 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - 'master' + paths: + - 'src/**/*' + +jobs: + ci: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm i + - run: npm run ci diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..590412d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish to NPM + +on: + workflow_dispatch: + release: + types: [created] + +jobs: + publish: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Build eruda-geolocation + run: | + npm i + npm run build + - name: Publish package on NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 3eaa041..0000000 --- a/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -src/ -eustia/ -.eslintignore -.eslintrc.json -.gitignore -.npmignore -.prettierignore -.travis.yml -index.html -prettier.config.js -webpack.config.js \ No newline at end of file diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index f03e6c9..0000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -src/util.js -eruda-geolocation.js -eruda-geolocation.min.js \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..1ddf8df --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "tabWidth": 2, + "semi": false +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 65f2ccf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "8" -script: - - npm run ci \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 230ce1c..83786ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.1.0 (6 Aug 2024) + +* fix: obsolete api + ## v2.0.0 (6 Jan 2020) * feat: theme support \ No newline at end of file diff --git a/README.md b/README.md index 8912558..eb48b53 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # eruda-geolocation [![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] +[![Build status][ci-image]][ci-url] [![License][license-image]][npm-url] [npm-image]: https://img.shields.io/npm/v/eruda-geolocation.svg [npm-url]: https://npmjs.org/package/eruda-geolocation -[travis-image]: https://img.shields.io/travis/liriliri/eruda-geolocation.svg -[travis-url]: https://travis-ci.org/liriliri/eruda-geolocation +[ci-image]: https://img.shields.io/github/actions/workflow/status/liriliri/eruda-geolocation/main.yml?branch=master&style=flat-square +[ci-url]: https://github.com/liriliri/eruda-geolocation/actions/workflows/main.yml [license-image]: https://img.shields.io/npm/l/eruda-geolocation.svg Eruda plugin for testing geolocation. @@ -15,7 +15,7 @@ Eruda plugin for testing geolocation. ## Demo Browse it on your phone: -[http://eruda.liriliri.io/?plugin=geolocation](http://eruda.liriliri.io/?plugin=geolocation) +[https://eruda.liriliri.io/?plugin=geolocation](https://eruda.liriliri.io/?plugin=geolocation) ## Install diff --git a/eustia/loadCss.js b/eustia/loadCss.js deleted file mode 100644 index 3adb307..0000000 --- a/eustia/loadCss.js +++ /dev/null @@ -1,10 +0,0 @@ -function exports(src, container) { - var link = document.createElement('link') - - link.rel = 'stylesheet' - link.type = 'text/css' - link.href = src - - container = container || document.head - container.appendChild(link) -} diff --git a/index.html b/index.html index 9f85d11..f38eed0 100644 --- a/index.html +++ b/index.html @@ -1,24 +1,14 @@ -
- - -