Skip to content

Commit

Permalink
Migrate to jsr
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed May 4, 2024
1 parent 4ac891a commit 9bad23c
Show file tree
Hide file tree
Showing 32 changed files with 734 additions and 5,866 deletions.
3 changes: 0 additions & 3 deletions .dldc.json

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x # Run with latest stable Deno.

- run: deno fmt --check
- run: deno lint
- run: deno test

- run: npx jsr publish
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

15 changes: 0 additions & 15 deletions .release-it.json

This file was deleted.

5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.useFlatConfig": true
"deno.enable": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"npm.autoDetect": "off"
}
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ♻️ Rsync

> A pure TypeScript implementation of the [rsync algorithm](https://www.andrew.cmu.edu/course/15-749/READINGS/required/cas/tridgell96.pdf)
> A pure TypeScript implementation of the
> [rsync algorithm](https://www.andrew.cmu.edu/course/15-749/READINGS/required/cas/tridgell96.pdf)
## Installation

Expand All @@ -11,7 +12,7 @@ npm install @dldc/rsync
## Usage

```ts
import { prepare, diff, apply } from '@dldc/rsync';
import { apply, diff, prepare } from "@dldc/rsync";

const checksum = prepare(destFile); // you can specify block size as second argument (default: 1024)
// send checksum to source
Expand All @@ -22,9 +23,11 @@ const syncedFile = apply(destFile, patches);

## Performance

This package was not designed to be fast. Since it's implemented fully in TypeScript, it's not as fast as the C implementation of rsync.
I tried to use the best practices to make it less slow but I did not benchmark it 🤷.
This package was not designed to be fast. Since it's implemented fully in
TypeScript, it's not as fast as the C implementation of rsync. I tried to use
the best practices to make it less slow but I did not benchmark it 🤷.

## Dependencies 🪶

This package has a single dependency [@dldc/erreur](https://github.com/dldc-packages/erreur) to define custom errors.
This package has a single dependency
[@dldc/erreur](https://github.com/dldc-packages/erreur) to define custom errors.
18 changes: 18 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@dldc/rsync",
"version": "4.0.1",
"exports": "./mod.ts",
"imports": {
"$std/": "https://deno.land/[email protected]/",
"@dldc/erreur": "jsr:@dldc/erreur@^7.1.1",
"@dldc/file": "jsr:@dldc/file@^2.0.1",
"sql.js": "npm:sql.js@^1.10.3"
},
"tasks": {
"test": "deno test --allow-read .",
"test:watch": "deno test --watch",
"bump": "deno run -A jsr:@mys/bump@1",
"update": "deno run --allow-read=. --allow-write=. --allow-net https://deno.land/x/[email protected]/main.ts *.ts deno.jsonc",
"check": "deno fmt --check . && deno lint . && deno task test"
}
}
95 changes: 95 additions & 0 deletions deno.lock

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

41 changes: 0 additions & 41 deletions eslint.config.js

This file was deleted.

7 changes: 7 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from "./src/apply.ts";
export * from "./src/diff.ts";
export { RsyncErreur, type TRsyncErreurData } from "./src/erreur.ts";
export * from "./src/files/Checksum.ts";
export * from "./src/files/Diff.ts";
export * from "./src/prepare.ts";
export * from "./src/types.ts";
Loading

0 comments on commit 9bad23c

Please sign in to comment.