Skip to content

Commit

Permalink
Upgrade (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmer Bulthuis authored Apr 21, 2023
1 parent d815319 commit 35a4ae7
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 391 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
tags:
- v*

jobs:

publish-npm:
runs-on: ubuntu-latest
container: node:18
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
- run: npm ci
- run: npm version $GITHUB_REF_NAME
- run: npm publish
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
- push
- pull_request

jobs:

test-unit:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm test

test-audit:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm audit
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.*
*.log

/node_modules/
/node/
/module/
/types/
/out/

!.gitignore
!.npmrc

!.vscode/
!.github/
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
commit-hooks=false
git-tag-version=false
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "run file",
"program": "${file}",
"args": [],
"cwd": "${workspaceFolder}",
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "watch"
}
]
}
12 changes: 8 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"tslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.rulers": [
80,
120
]
100,
],
"javascript.preferences.quoteStyle": "double",
"typescript.preferences.quoteStyle": "double",
}
8 changes: 5 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"type": "typescript",
"label": "watch",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc"
"$tsc-watch"
],
"group": {
"kind": "build",
Expand Down
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ISC License

Copyright 2018 LuvDaSun Software B.V.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 changes: 2 additions & 2 deletions readme.markdown → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ This "library" provides the following constants:
- day = 24 * hour;
- week = 7 * day;

So you can do things like
So you can easy to read math on your dates!
```javascript
import {day, week} from "msecs";

const now = new Date();
const tomorrow = new Date(now + day);
const midnight = new Date(Math.floor(now / day) + 1 * day);
const inTwoWeeks = new Date(now + 2 * week);
const midnight = new Date(now - now % day + 1 * day);
```
Loading

0 comments on commit 35a4ae7

Please sign in to comment.