diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..0312896 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/dubnium diff --git a/.travis.yml b/.travis.yml index 7cec398..2a02bc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,47 +1,10 @@ language: node_js node_js: - - stable + - lts/dubnium + - lts/erbium + - node cache: npm install: npm install - -stages: - - test - - name: deploy - if: tag IS present - -before_script: - - npm run build - -jobs: - include: - - stage: test - name: "Test" - script: - - npm run test && npm i -g codecov && codecov - - - stage: deploy - name: Deploy to GitHub Releases - script: skip - deploy: - provider: releases - api_key: - secure: PmUkI/oJ8HDDGlxMbTzmDC6BVHuv0ITBmSQkcO61ksjNgUpbaCx3b0K8S8v/CF1R0Lq34AavREdwrWvVIbWHLVqNlCU+7pFhc2Qv3pfErLFGW4z1aLQsmEWSm1nhHOdYa7G0Tna0F90lU8YZlilNH52yK0PXeAQyx3d0yWMIHq2HPasPh7NwEacGYbkyD8hdQfjl4UsKXZXIczyy0m0Li7+1mixadUeSGmz39p6idBwoLP3hgCX5V7kJD6b37zcuKINRVLMKMalUtKHSysyJ8WgGphTMSHvnSFXYJxDb6RDFTHiDzjHApMy2j9ykQbkdaeqmtjO2KQ950m84dAPcKvJzZpYSKl6NWKaR/YPKkCdjiiY9hO+079dNSu6fMKUCrtvHTJQz9oaMvuVYjQXTlJuQenfwtHS4dKceZOUyLC4Jywus4NooCagyxp4A6R0QI3OAbXAGAC0UEn0VtXkxgzszstdsYoJsNibxMBXV//RKszTyjBLNE8g0dnTibqIJMtviTcBf5PfppYvhUh+ax4v5Io2ADRjBrDZi0XDk9XaBliK2VPl3eoQ1Qp+Y0W3bsR8WRygle4h+fxHPOpJH2jOylnGCua4eTTBpDi6VslFwlgdNtanNSUn/qIPeAQCSvvj1ZjhbFgo6C95LB9pDXCTfE40Jc95WtXsVqIrv/rM= - file: - - ./dist/pretty-money.umd.js - - ./dist/pretty-money.esm.js - skip_cleanup: true - draft: true - on: - tags: true - - stage: deploy - name: Deploy to NPM - script: skip - deploy: - provider: npm - email: nick@karamoff.ru - api_key: - secure: DXa8qj0RO+ft6oWsnAQBkj1KpOjuqkrGKpKUyxo0emzYHhJhZYmHvwbf92xwJyDkheF/d/HkyQUrR01OJkOCmispBRrPh32/zIoqAsOZoUmTsZAqQVqYavYhZYdjrnHWjOL5SsAjiTpiioGTMgkCYSiomuncG9bJJ5BXB/RpKj31zZNKZnBhZlev854PS7sFk8vf7/vABpERaEsSXH/ZbrSw9hj/K4FiGidZYFFm2TZopO+SYHztDmDVRxBXXgNrVOaxINGztF31PPauBTnE9ovlCPDSw0pRnB6P5jGL2FF3+v4NRAMsogh1vWjhP1eY+ilypeFUlRDsVBv/7VkQyn6G/F7HJPikfSRpHuOXSdYtitF78azsTZiRCTyGRQ2viUZv+mGmJOPYkrIeWTWw/FnW3T5L3N8MQjfo+Y0Td1S3mNR8NXy+DNwmcAV07ZPaeY5SIkhDE6P1J85KQxCLeoLH06AgC9OfYubMRILZuNx681W4X6d5Bbkfvo0hPjJJJ5SVYoUcAaqHUE7SFq+sil+rXM/TDigX37KF4ZhjFi1YHixpA92d3jrv3GA+IJJGMOesBu25ypoUvxPfo8zMaWzv6V9jQP4yPu0lfUmEXLPkoFPo7nSONXwND4o803lySKEEYPPrGEe8prfX8OuJBDhYwWp7TjYHPwe4wimw/HE= - skip_cleanup: true - on: - tags: true +script: npm run test +after_script: npm install -g codecov && codecov diff --git a/README.md b/README.md index 78d42d1..2470ef7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # pretty-money + + A tiny currency formatting library for JavaScript. - **Small.** Dependency-free. 468 bytes minified and gzipped. Controlled by @@ -13,7 +19,7 @@ let price = prettyMoney({ currency: "EUR" }, 10000); //=> "10000 EUR" ``` Works in any ES3-compatible environment, be that Node.js or a browser. -[**See it for yourself**](https://os.karamoff.ru/pretty-money#demo) +[**Try it yourself**](https://os.karamoff.dev/pretty-money#demo)! ## Install @@ -176,18 +182,11 @@ around with the developer build, here's all you need to know: - `npm run build` to build the production-ready minified version of the library and output it to `./dist/pretty-money.umd.js` and `./dist/pretty-money.esm.js` -- `npm run checks` to run all tests +- `npm run test` to build the project and run all tests, which include: - `npm run test:lint` to check the code formatting with ESLint (this won't auto fix errors) - `npm run test:unit` to run the Jest unit tests - `npm run test:size` to check the size -- `npm run test` to first build and run all tests. Helpful if you tend to forget - the first step - -There are no peer dependencies and other extra requirements. There are no commit -message rules. Any help is welcome if it keeps things simple and small. - ----- -Created by [Nikita Karamov](https://karamoff.ru) and distributed under the MIT -License. +There are no peer dependencies and other extra requirements. Any help is welcome +when it keeps things simple and small. diff --git a/config/build/plugins.js b/config/build/plugins.js index 2ae60f2..6756003 100644 --- a/config/build/plugins.js +++ b/config/build/plugins.js @@ -1,13 +1,19 @@ -import rpStrip from 'rollup-plugin-strip'; +import rpStrip from '@rollup/plugin-strip'; import { terser as rpTerser } from 'rollup-plugin-terser'; -import rpTypescript2 from 'rollup-plugin-typescript2'; +import rpTypescript from '@rollup/plugin-typescript'; export const strip = () => rpStrip({ debugger: true, - functions: ['console.log', 'console.debug'], - sourceMap: false + functions: ['console.log', 'console.debug'] }); -export const terser = () => rpTerser(); +export const terser = () => rpTerser({ + sourcemap: false, + ie8: true, + output: { + comments: false, + ecma: 3 + } +}); -export const typescript = () => rpTypescript2(); +export const typescript = () => rpTypescript(); diff --git a/config/build/rollup.config.prod.js b/config/build/rollup.config.prod.js index 7122cb3..8521c34 100644 --- a/config/build/rollup.config.prod.js +++ b/config/build/rollup.config.prod.js @@ -17,7 +17,7 @@ export default { ], plugins: [ typescript(), + strip(), terser(), - strip() ] } diff --git a/docs/index.html b/docs/index.html index d5500e1..dc2b87a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -217,7 +217,7 @@