Skip to content

Commit

Permalink
feat: require node >=14, drop IE support, use util.debuglog vs debug,…
Browse files Browse the repository at this point in the history
… bump deps, added locales out of the box (fixes #2)
  • Loading branch information
titanism committed Jun 29, 2022
1 parent 7258903 commit 1869b1f
Show file tree
Hide file tree
Showing 20 changed files with 137 additions and 9,840 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
10 changes: 5 additions & 5 deletions .dist.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"plugins": ["compat"],
"rules": {
"compat/compat": "error",
"no-func-assign": "off",
"no-unused-vars": "off",
"no-empty": "off"
"no-undef": "off",
"no-empty": "off",
"no-redeclare": "off",
"no-control-regex": "off"
},
"settings": {
"polyfills": [
"Array.from",
"Symbol",
"console"
"Promise"
]
}
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.*.js
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto
* text=auto eol=lf
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 14
- 16
- 18
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
node_modules
coverage
.nyc_output
locales/
package-lock.json
yarn.lock

Thumbs.db
tmp/
temp/
*.lcov
.env
lib
dist
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged && npm test
2 changes: 1 addition & 1 deletion .lib.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"node": "14",
"browsers": [ "extends @ladjs/browserslist-config" ]
}
}]
Expand Down
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.md': (filenames) => filenames.map((filename) => `remark ${filename} -qfo`),
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
trailingComma: 'none'
};
3 changes: 3 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['preset-github']
};
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .xo-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
prettier: true,
space: true,
extends: ['xo-lass']
};
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# dayjs-with-plugins

[![build status](https://img.shields.io/travis/com/niftylettuce/dayjs-with-plugins.svg)](https://travis-ci.com/niftylettuce/dayjs-with-plugins)
[![code coverage](https://img.shields.io/codecov/c/github/niftylettuce/dayjs-with-plugins.svg)](https://codecov.io/gh/niftylettuce/dayjs-with-plugins)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/niftylettuce/dayjs-with-plugins.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/dayjs-with-plugins.svg)](https://npm.im/dayjs-with-plugins)

> Day.js with all plugins added out of the box, no need to use dayjs.extend!
> Day.js with all plugins and locales added out of the box, no need to use `dayjs.extend` nor `dayjs.locale`!

## Table of Contents
Expand All @@ -17,6 +16,7 @@
* [Usage](#usage)
* [Node](#node)
* [Browser](#browser)
* [Debugging](#debugging)
* [Contributors](#contributors)
* [License](#license)

Expand All @@ -29,12 +29,6 @@
npm install dayjs dayjs-with-plugins
```

[yarn][]:

```sh
yarn add dayjs dayjs-with-plugins
```


## Usage

Expand All @@ -53,7 +47,7 @@ console.log('M/D/YY', dayjs().format('M/D/YY'));
This is the solution for you if you're just using `<script>` tags everywhere!

```html
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6,es7,Array.from,Symbol,console"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise"></script>
<script src="https://unpkg.com/dayjs-with-plugins"></script>
<script type="text/javascript">
(function() {
Expand All @@ -67,21 +61,21 @@ This is the solution for you if you're just using `<script>` tags everywhere!
We recommend using <https://polyfill.io> (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above):

```html
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6,es7,Array.from,Symbol,console"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise"></script>
```

* Array.from() is not supported in IE 11
* Symbol.iterator() is not supported in IE 11
* Symbol.prototype() is not supported in IE 11
* Symbol is not supported in IE 11
* console.table() is not supported in IE 11
* Promise is not supported in op\_mini all

#### Bundler

This assumes you are using [browserify][], [webpack][], [rollup][], or another bundler.

See [Node](#node) usage above for how to use in a bundler environment.

### Debugging

You can use `NODE_DEBUG=dayjs-with-plugins node app.js` to debug output from this package.


## Contributors

Expand All @@ -95,12 +89,10 @@ See [Node](#node) usage above for how to use in a bundler environment.
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)


##
##

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[browserify]: https://github.com/browserify/browserify

[webpack]: https://github.com/webpack/webpack
Expand Down
108 changes: 29 additions & 79 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,50 @@
{
"name": "dayjs-with-plugins",
"description": "Day.js with all plugins added out of the box, no need to use dayjs.extend!",
"description": "Day.js with all plugins and locales added out of the box, no need to use dayjs.extend nor dayjs.locale!",
"version": "0.0.4",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"ava": {
"verbose": true
},
"bugs": {
"url": "https://github.com/niftylettuce/dayjs-with-plugins/issues",
"email": "niftylettuce@gmail.com"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"contributors": [
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
],
"dependencies": {
"debug": "^4.1.1"
},
"devDependencies": {
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@babel/preset-env": "^7.11.0",
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"@ladjs/browserslist-config": "^0.0.1",
"ava": "latest",
"@babel/cli": "^7.18.6",
"@babel/core": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@ladjs/browserslist-config": "^1.0.0",
"ava": "^4.3.0",
"babelify": "^10.0.0",
"browserify": "^16.5.2",
"codecov": "latest",
"cross-env": "^7.0.2",
"dayjs": "^1.8.33",
"eslint": "^7.6.0",
"eslint-config-xo-lass": "^1.0.3",
"eslint-plugin-compat": "^3.8.0",
"browserify": "^17.0.0",
"cross-env": "^7.0.3",
"dayjs": "^1.11.3",
"eslint": "^8.18.0",
"eslint-config-xo-lass": "^2.0.1",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-node": "^11.1.0",
"fixpack": "latest",
"husky": "latest",
"fixpack": "^4.0.0",
"husky": "^8.0.1",
"jsdom": "15",
"lint-staged": "latest",
"nyc": "latest",
"remark-cli": "latest",
"remark-preset-github": "latest",
"tinyify": "^3.0.0",
"xo": "latest"
"lint-staged": "^13.0.3",
"nyc": "^15.1.0",
"remark-cli": "^11.0.0",
"remark-preset-github": "^4.0.4",
"rimraf": "^3.0.2",
"tinyify": "^3.1.0",
"xo": "^0.50.0"
},
"engines": {
"node": ">=6.4.0"
"node": ">=14"
},
"files": [
"lib",
"dist"
],
"homepage": "https://github.com/niftylettuce/dayjs-with-plugins",
"husky": {
"hooks": {
"pre-commit": "npm test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"jsdelivr": "dist/dayjs-with-plugins.min.js",
"keywords": [
"all",
Expand All @@ -81,58 +64,25 @@
"replacement"
],
"license": "MIT",
"lint-staged": {
"*.js": [
"xo --fix",
"git add"
],
"*.md": [
"remark . -qfo",
"git add"
],
"package.json": [
"fixpack",
"git add"
]
},
"main": "lib/index.js",
"peerDependencies": {
"dayjs": "*"
},
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": [
"preset-github"
]
},
"repository": {
"type": "git",
"url": "https://github.com/niftylettuce/dayjs-with-plugins"
},
"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"browserify": "browserify src/index.js -o dist/dayjs-with-plugins.js -s dayjs -g [ babelify --configFile ./.dist.babelrc ]",
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
"build:clean": "rimraf lib dist",
"build:dist": "npm run browserify && npm run minify",
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo && eslint -c .lib.eslintrc lib && eslint --no-inline-config -c .dist.eslintrc dist",
"lint": "xo --fix && remark . -qfo && fixpack && eslint -c .lib.eslintrc lib && eslint --no-inline-config -c .dist.eslintrc dist",
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/dayjs-with-plugins.min.js -s dayjs -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
"nyc": "cross-env NODE_ENV=test nyc ava",
"test": "npm run build && npm run lint && npm run ava",
"test-coverage": "npm run build && npm run lint && npm run nyc"
"prepare": "husky install",
"pretest": "npm run build && npm run lint",
"test": "cross-env NODE_ENV=test nyc ava"
},
"unpkg": "dist/dayjs-with-plugins.min.js",
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
}
"unpkg": "dist/dayjs-with-plugins.min.js"
}
Loading

0 comments on commit 1869b1f

Please sign in to comment.