Skip to content

Commit 935bbdd

Browse files
authored
chore: update dependencies & migrate to vitest from mocha/chai (#739)
* chore: migrate to vitest from mocha/chai * chore: update dependencies * docs: refactor HooksTable to separate component
1 parent 15ddaa6 commit 935bbdd

File tree

98 files changed

+4450
-4361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+4450
-4361
lines changed

.eslintrc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
{
2+
"root": true,
23
"env": {
3-
"browser": true,
4-
"es6": true,
5-
"mocha": true,
64
"node": true
75
},
8-
"extends": [
9-
"plugin:@typescript-eslint/recommended",
10-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
11-
"plugin:prettier/recommended"
12-
],
136
"parser": "@typescript-eslint/parser",
147
"parserOptions": {
15-
"project": "tsconfig.test.json",
16-
"sourceType": "module"
8+
"project": ["./tsconfig.json"]
179
},
1810
"plugins": [
1911
"eslint-plugin-import",
2012
"eslint-plugin-prefer-arrow",
2113
"@typescript-eslint",
2214
"prettier"
2315
],
16+
"extends": [
17+
"plugin:@typescript-eslint/recommended",
18+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
19+
"plugin:prettier/recommended"
20+
],
2421
"rules": {
2522
// "indent": ["warn", 2],
2623
"prefer-rest-params": "off",

.mocharc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/components/HookTable.vue

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<table>
3+
<thead>
4+
<tr>
5+
<th>before</th>
6+
<th>after</th>
7+
<th>methods</th>
8+
<th>multi</th>
9+
<th>details</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
<tr>
14+
<td>{{ before ? 'yes' : 'no' }}</td>
15+
<td>{{ after ? 'yes' : 'no' }}</td>
16+
<td>{{ methods.join(", ") }}</td>
17+
<td>{{ typeof multi === 'boolean' ? multi ? 'yes' : 'no' : multi }}</td>
18+
<td><a :href="source" target="_blank">source</a></td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
</template>
23+
24+
<script setup lang="ts">
25+
26+
27+
const props = defineProps<{
28+
before: boolean;
29+
after: boolean;
30+
methods: string[];
31+
multi: boolean | string;
32+
source: string;
33+
}>();
34+
</script>
35+
36+
<script lang="ts">
37+
</script>

docs/hooks.md

Lines changed: 39 additions & 109 deletions
Large diffs are not rendered by default.

docs/utilities.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
---
2-
title: Utilities
3-
---
1+
<script setup>
2+
import HookTable from './components/HookTable.vue'
3+
</script>
44

55
# Utilities
66

@@ -158,9 +158,7 @@ Restrict a hook to run for certain methods and method types.
158158

159159
Sequentially execute multiple sync or async hooks.
160160

161-
| before | after | methods | multi | details |
162-
| ------ | ----- | ------- | ----- | -------------------------------------------------------------------------------------------------------- |
163-
| yes | yes | all | n/a | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/combine.ts) |
161+
<HookTable :before="true" :after="true" :methods="['all']" multi="n/a" source="https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/combine.ts" />
164162

165163
- **Arguments**
166164
- `{Array< Function >} hookFuncs`
@@ -199,9 +197,7 @@ module.exports = { before: {
199197

200198
Return the and of a series of sync or async predicate functions.
201199

202-
| before | after | methods | multi | details |
203-
| ------ | ----- | ------- | ----- | ------------------------------------------------------------------------------------------------------ |
204-
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/every.ts) |
200+
<HookTable :before="true" :after="true" :methods="['all']" :multi="true" source="https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/every.ts" />
205201

206202
- **Arguments**
207203
- `{Array< Function >} predicates`
@@ -283,9 +279,7 @@ Get the records in `context.data` or `context.result`
283279

284280
Negate a sync or async predicate function.
285281

286-
| before | after | methods | multi | details |
287-
| ------ | ----- | ------- | ----- | ------------------------------------------------------------------------------------------------------- |
288-
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-not.ts) |
282+
<HookTable :before="true" :after="true" :methods="['all']" :multi="true" source="https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-not.ts" />
289283

290284
- **Arguments**
291285

@@ -322,9 +316,7 @@ Negate a sync or async predicate function.
322316

323317
Check which transport provided the service call.
324318

325-
| before | after | methods | multi | details |
326-
| ------ | ----- | ------- | ----- | ------------------------------------------------------------------------------------------------------------ |
327-
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-provider.ts) |
319+
<HookTable :before="true" :after="true" :methods="['all']" :multi="true" source="https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-provider.ts" />
328320

329321
- **Arguments**
330322
- `{Array< String >} transports`
@@ -597,9 +589,7 @@ Let's you call a hook right after the service call.
597589

598590
Return the or of a series of sync or async predicate functions.
599591

600-
| before | after | methods | multi | details |
601-
| ------ | ----- | ------- | ----- | ----------------------------------------------------------------------------------------------------- |
602-
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/some.ts) |
592+
<HookTable :before="true" :after="true" :methods="['all']" :multi="true" source="https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/some.ts" />
603593

604594
- **Arguments**
605595

0 commit comments

Comments
 (0)