Skip to content

Commit

Permalink
Merge pull request #683 from sandwichfarm/lib/nip66
Browse files Browse the repository at this point in the history
typescript port, lib/nip66, auditor
  • Loading branch information
dskvr authored Nov 22, 2024
2 parents c09bc29 + 4f0589f commit dd1ba3f
Show file tree
Hide file tree
Showing 670 changed files with 49,929 additions and 19,772 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,45 @@ jobs:
typescript: 'true'
- package: 'logger'
nodeVersion: '20'
typescript: 'true'
- package: 'seed'
nodeVersion: '20'
typescript: 'true'
- package: 'utils'
nodeVersion: '20'
typescript: 'true'
- package: 'nwcache'
nodeVersion: '20'
- package: 'controlflow'
nodeVersion: '20'
typescript: 'true'
- package: 'publisher'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-websocket-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-websocket-browser-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-info-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-dns-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-geo-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-ssl-adapter-default'
nodeVersion: '20'
typescript: 'true'
- package: 'nocap-every-adapter-default'
nodeVersion: '20'
typescript: 'true'

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -80,11 +93,11 @@ jobs:
cd "${{ steps.find_package.outputs.the_path }}"
yarn install
- name: Pre-Publish
- name: Build Typescript
if: matrix.typescript == 'true'
run: |
cd "${{ steps.find_package.outputs.the_path }}"
yarn prepublish
yarn build
- name: Publish Package
id: publish
Expand Down
Binary file added .yarn/install-state.gz
Binary file not shown.
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nmHoistingLimits: workspaces

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
14 changes: 14 additions & 0 deletions _tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@nostrwatch/*": ["./node_modules/@nostrwatch/*/src"],
},
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
8 changes: 8 additions & 0 deletions apps/gui/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions apps/gui/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
24 changes: 24 additions & 0 deletions apps/gui/.github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check

on: pull_request

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: svelte-check
run: npm run check

- name: Unit tests
run: npm test
42 changes: 42 additions & 0 deletions apps/gui/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install Dependencies
run: npm ci

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions apps/gui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
node_modules

# Output
.output
.vercel
/.svelte-kit
/build
/dist

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
4 changes: 4 additions & 0 deletions apps/gui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
8 changes: 8 additions & 0 deletions apps/gui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
91 changes: 91 additions & 0 deletions apps/gui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# @careswitch/svelte-data-table

## 0.6.3

### Patch Changes

- 267e6ba: Added allRows getter to retrieve all unpaginated filtered and sorted table rows

## 0.6.2

### Patch Changes

- e5b1ed1: fix: `totalPages` should react to changes in base rows

## 0.6.1

### Patch Changes

- e44c770: perf: filter matching, sort handling null/undefined, non-capturing group for global filter regex

## 0.6.0

### Minor Changes

- 4ba9232: Custom `sorter` fn now parameterizes `getValue()` return values in addition to row objects

## 0.5.4

### Patch Changes

- 17b1089: Pagination accessors should react to filter state

## 0.5.3

### Patch Changes

- 2ee673a: rows getter should react to `originalData`

## 0.5.2

### Patch Changes

- ed69b69: Updating `baseRows` should retrigger filterState

## 0.5.1

### Patch Changes

- 94f0694: Ensure row access doesn't mutate state, see: https://github.com/sveltejs/svelte/issues/12457

## 0.5.0

### Minor Changes

- 48cfdcf: Introduce `id` in column definition to allow multiple columns for the same key

## 0.4.0

### Minor Changes

- 26bea0d: Rename `filters` to `filterState`; introduce `sortState`, refactor filter mutators to reassign object

## 0.3.0

### Minor Changes

- 57b1ab6: Expose read and write access to base row data

### Patch Changes

- 57b1ab6: JSDoc comments for better documentation
- 57b1ab6: Expand test coverage for edge cases
- 57b1ab6: Performance improvements with fine-grained reactivity

## 0.2.2

### Patch Changes

- 58f6cdb: Package description, license, and keywords

## 0.2.1

### Patch Changes

- df3d810: Add project homepage

## 0.2.0

### Minor Changes

- efa074b: Public publishing with changesets
21 changes: 21 additions & 0 deletions apps/gui/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Careswitch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 65 additions & 0 deletions apps/gui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<img align="center" alt="Svelte Data Table Screenshot" src="https://github.com/user-attachments/assets/fc527332-882b-463a-b070-d4714b32ec47">

---

- No dependencies
- Blazing fast thanks to Svelte 5 and fine-grained reactivity
- Fully typed with TypeScript
- Comprehensive unit tests
- Supports SvelteKit and SSR
- Works great with shadcn [data table](https://www.shadcn-svelte.com/docs/components/data-table)

## Demo

**[Demo Website](https://careswitch-svelte-data-table.vercel.app)**

## Installation

```bash
npm install @careswitch/svelte-data-table
```

_Requires Svelte 5 peer dependency_

## Usage

```svelte
<script lang="ts">
import { DataTable } from '@careswitch/svelte-data-table';
const table = new DataTable({
data: [
{ id: 1, name: 'John Doe', status: 'active' },
{ id: 2, name: 'Jane Doe', status: 'inactive' }
],
columns: [
{ id: 'id', key: 'id', name: 'ID' },
{ id: 'name', key: 'name', name: 'Name' },
{ id: 'status', key: 'status', name: 'Status' }
]
});
</script>
<table>
<thead>
<tr>
{#each table.columns as column (column.id)}
<th>{column.name}</th>
{/each}
</tr>
</thead>
<tbody>
{#each table.rows as row (row.id)}
<tr>
{#each table.columns as column (column.id)}
<td>{row[column.key]}</td>
{/each}
</tr>
{/each}
</tbody>
</table>
```

## Examples

Refer to the demo website [+page.svelte](./src/routes/+page.svelte) and [unit tests](./src/index.test.ts) for more comprehensive examples.
Loading

0 comments on commit dd1ba3f

Please sign in to comment.