Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Oct 15, 2024
0 parents commit 79db7d1
Show file tree
Hide file tree
Showing 10 changed files with 1,746 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test and Build

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Lint, test, build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Lint
run: pnpm lint
- name: Prettier
run: pnpm format:check
- name: Build
run: pnpm build
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
22 changes: 22 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Installation

```
pnpm add @livekit/mutex
```

## Usage

```ts
import { Mutex } from '@livekit/mutex';

const myLock = new Mutex();

const unlock = await myLock.unlock();

try {
...
}
finally {
unlock();
}
```
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@livekit/mutex",
"private": false,
"access": "public",
"version": "1.0.0",
"description": "Tiny mutex helper",
"repository": "[email protected]:livekit/ts-mutex.git",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"sideEffects": false,
"type": "module",
"files": [
"dist",
"src"
],
"scripts": {
"build": "vite build",
"test": "vitest --environment node run",
"test:browser": "vitest --environment happy-dom run",
"test:edge": "vitest --environment edge-runtime run"
},
"devDependencies": {
"@edge-runtime/vm": "^4.0.3",
"happy-dom": "^15.7.4",
"typescript": "~5.0.0",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.4",
"vitest": "^2.1.3"
}
}
Loading

0 comments on commit 79db7d1

Please sign in to comment.