Skip to content

Commit

Permalink
Merge pull request #3 from dbayarchyk/ci
Browse files Browse the repository at this point in the history
build: move ci into workflows
  • Loading branch information
dbayarchyk authored Aug 9, 2024
2 parents 04cb7b5 + c64797c commit 4ba6663
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ _Please provide a short summary of your changes._

## Description

_Please describe the changes in this PR here and provide some context._
_Please describe the changes in this PR here and provide some context._
4 changes: 2 additions & 2 deletions .github/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: install
run: npm install --frozen-lockfile
- name: type check
run: npm type-check
run: npm run type-check
- name: lint
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail (avoids multiple runs uncovering different issues at different steps)
run: npm lint
run: npm run lint
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can view the documentation [https://dbayarchyk.github.io/remote-date](https:
## Example

```js
import { RemoteDate } from 'remote-date';
import { RemoteDate } from "remote-date";

const remoteDate = new RemoteDate({
remoteDate: new Date("2024-08-05T00:00Z"),
Expand All @@ -39,20 +39,24 @@ remoteDate.dateNow(); // 2024-08-05T00:00:10Z
```

```js
import { RemoteDate, RemoteDateSynchronizer } from 'remote-date';
import { RemoteDate, RemoteDateSynchronizer } from "remote-date";

const remoteDate = new RemoteDate();
const remoteDateSynchronizer = new RemoteDateSynchronizer({
remoteDate: remoteDate,
fetchRemote: async ({ signal }) => {
const response = await fetch('https://api.example.com/remote-date', { signal });
const response = await fetch("https://api.example.com/remote-date", {
signal,
});
const data = await response.json();

return {
remoteDate: new Date(data.remoteDate),
serverStartProcessingMonotonicTimeInMs: data.serverStartProcessingMonotonicTimeInMs,
serverEndProcessingMonotonicTimeInMs: data.serverEndProcessingMonotonicTimeInMs,
}
serverStartProcessingMonotonicTimeInMs:
data.serverStartProcessingMonotonicTimeInMs,
serverEndProcessingMonotonicTimeInMs:
data.serverEndProcessingMonotonicTimeInMs,
};
},
});

Expand All @@ -74,4 +78,5 @@ remoteDate.dateNow(); // 2024-08-05T00:00:10Z
- [Distributed Systems 3.2: Clock synchronisation](https://youtu.be/mAyW-4LeXZo?feature=shared)

## License

This project is licensed under the MIT License - see the LICENSE file for details.
160 changes: 69 additions & 91 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"module": "src/index.js",
"main": "src/index.js",
"scripts": {
"format": "prettier --write \"src/**/*.(js|ts)\"",
"lint": "eslint src --ext .js,.ts",
"lint:fix": "eslint src --fix --ext .js,.ts",
"format": "prettier --check --write \"src/**/*.js\"",
"lint": "prettier --check \"src/**/*.js\"",
"type-check": "tsc",
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
"docs": "jsdoc -c jsdoc.json"
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"compilerOptions": {
"target": "es2015",
"lib": ["es2015"],
"moduleResolution": "bundler",
"target": "es2015",
"lib": ["es2015"],
"allowJs": true,
"checkJs": true,
"strict": true,
"declaration": true,
"noImplicitOverride": true,
"noEmit": true
"noEmit": true,
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 4ba6663

Please sign in to comment.