Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies & migrate to vitest from mocha/chai #739

Merged
merged 5 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
{
"root": true,
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.test.json",
"sourceType": "module"
"project": ["./tsconfig.json"]
},
"plugins": [
"eslint-plugin-import",
"eslint-plugin-prefer-arrow",
"@typescript-eslint",
"prettier"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"rules": {
// "indent": ["warn", 2],
"prefer-rest-params": "off",
Expand Down
12 changes: 0 additions & 12 deletions .mocharc.js

This file was deleted.

37 changes: 37 additions & 0 deletions docs/components/HookTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<table>
<thead>
<tr>
<th>before</th>
<th>after</th>
<th>methods</th>
<th>multi</th>
<th>details</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ before ? 'yes' : 'no' }}</td>
<td>{{ after ? 'yes' : 'no' }}</td>
<td>{{ methods.join(", ") }}</td>
<td>{{ typeof multi === 'boolean' ? multi ? 'yes' : 'no' : multi }}</td>
<td><a :href="source" target="_blank">source</a></td>
</tr>
</tbody>
</table>
</template>

<script setup lang="ts">


const props = defineProps<{
before: boolean;
after: boolean;
methods: string[];
multi: boolean | string;
source: string;
}>();
</script>

<script lang="ts">
</script>
148 changes: 39 additions & 109 deletions docs/hooks.md

Large diffs are not rendered by default.

26 changes: 8 additions & 18 deletions docs/utilities.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Utilities
---
<script setup>
import HookTable from './components/HookTable.vue'
</script>

# Utilities

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

Sequentially execute multiple sync or async hooks.

| before | after | methods | multi | details |
| ------ | ----- | ------- | ----- | -------------------------------------------------------------------------------------------------------- |
| yes | yes | all | n/a | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/combine.ts) |
<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" />

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

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

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

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

Negate a sync or async predicate function.

| before | after | methods | multi | details |
| ------ | ----- | ------- | ----- | ------------------------------------------------------------------------------------------------------- |
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-not.ts) |
<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" />

- **Arguments**

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

Check which transport provided the service call.

| before | after | methods | multi | details |
| ------ | ----- | ------- | ----- | ------------------------------------------------------------------------------------------------------------ |
| yes | yes | all | yes | [source](https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/src/utils/is-provider.ts) |
<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" />

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

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

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

- **Arguments**

Expand Down
Loading
Loading