Skip to content

Commit

Permalink
fix!: keep up with recent dove (#77)
Browse files Browse the repository at this point in the history
* init new

* chore: update dependencies

* chore: update dependencies

* refactor: modernize repo
- unbuild
- vitest
- restricter eslint
- named exports instead of default exports
- export * from

* fix: right filters

* fix(channels): assign ability to connection from authResult

* ci: update coverage & add build job

* test: add lcov to coverage

* test: coverage threshold 90
  • Loading branch information
fratzinger authored Nov 23, 2022
1 parent b3ffacd commit 1a1f9bc
Show file tree
Hide file tree
Showing 113 changed files with 21,486 additions and 16,839 deletions.
64 changes: 64 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"root": true,
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["security", "@typescript-eslint", "unicorn", "prettier"],
"extends": [
"eslint:recommended",
"plugin:security/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:prettier/recommended"
],
"rules": {
"quotes": ["warn", "double", "avoid-escape"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"semi": ["warn", "always"],
"@typescript-eslint/no-unused-vars": "warn",
"no-console": "off",
"camelcase": "warn",
"require-atomic-updates": "off",
"prefer-destructuring": [
"warn",
{
"AssignmentExpression": { "object": false, "array": false },
"VariableDeclarator": { "object": true, "array": true }
},
{
"enforceForRenamedProperties": false
}
],
"security/detect-object-injection": "off",
"object-curly-spacing": ["warn", "always"],
"prefer-const": ["warn"],
"@typescript-eslint/consistent-type-imports": [
"warn",
{ "prefer": "type-imports" }
],
"unicorn/prefer-node-protocol": "warn"
},
"overrides": [
{
"files": ["test/**/*.ts"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-function": "off"
}
}
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
"project": "./tsconfig.json"
}
}
}
}
44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

27 changes: 0 additions & 27 deletions .github/stale.yml

This file was deleted.

49 changes: 29 additions & 20 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,43 @@ name: Node.js CI
on: [push, pull_request]

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test

coverage:
needs: [ test ]
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '12'
- run: npm ci
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run coverage
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "18"
- run: npm ci
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run coverage

build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "18"
- run: npm ci
- run: npm run build
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $RECYCLE.BIN/
# dot_env
.env.*

/dist
dist

.cache
.temp
docs/.vitepress/dist
13 changes: 0 additions & 13 deletions .mocharc.js

This file was deleted.

20 changes: 0 additions & 20 deletions .npmignore

This file was deleted.

27 changes: 0 additions & 27 deletions .nycrc.json

This file was deleted.

47 changes: 15 additions & 32 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": [
"--require",
"ts-node/register",
"--timeout",
"999999",
"--colors",
"--recursive"
],
"internalConsoleOptions": "openOnSessionStart",
"env": {
"NODE_ENV": "test",
"TS_NODE_PROJECT": "tsconfig.test.json"
},
"outputCapture": "std",
"skipFiles": [
"<node_internals>/**"
]
},
]
}

"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true,
"console": "integratedTerminal"
}
]
}
21 changes: 10 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"search.exclude": {
"**/node_modules": true,
"**/public": true,
"**/package-lock.json": true
},
"workbench.colorCustomizations": {
"activityBar.background": "#29b757",
"titleBar.activeBackground": "#29b757",
"titleBar.activeForeground": "#FAFBF4"
}
"search.exclude": {
"**/node_modules": true,
"**/public": true,
"**/package-lock.json": true
},
"workbench.colorCustomizations": {
"activityBar.background": "#29b757",
"titleBar.activeBackground": "#29b757",
"titleBar.activeForeground": "#FAFBF4"
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Frederik Schmatz
Copyright (c) 2022 Frederik Schmatz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
<img src="https://feathers-casl.netlify.app/img/logo.svg" width="200">
</p>

![npm](https://img.shields.io/npm/v/feathers-casl)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/fratzinger/feathers-casl/Node.js%20CI)
![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/fratzinger/feathers-casl)
![Code Climate coverage](https://img.shields.io/codeclimate/coverage/fratzinger/feathers-casl)
![David](https://img.shields.io/david/fratzinger/feathers-casl)
![npm](https://img.shields.io/npm/dm/feathers-casl)
[![npm](https://img.shields.io/npm/v/feathers-casl)](https://www.npmjs.com/package/feathers-casl)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/fratzinger/feathers-casl/Node.js%20CI)](https://github.com/fratzinger/feathers-casl/actions/workflows/node.js.yml?query=branch%3Amaster)
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/fratzinger/feathers-casl)](https://codeclimate.com/github/fratzinger/feathers-casl)
[![Code Climate coverage](https://img.shields.io/codeclimate/coverage/fratzinger/feathers-casl)](https://codeclimate.com/github/fratzinger/feathers-casl)
[![libraries.io](https://img.shields.io/librariesio/release/npm/feathers-casl)](https://libraries.io/npm/feathers-casl)
[![npm](https://img.shields.io/npm/dm/feathers-casl)](https://www.npmjs.com/package/feathers-casl)
[![GitHub license](https://img.shields.io/github/license/fratzinger/feathers-casl)](https://github.com/fratzinger/feathers-casl/blob/master/LICENSE)
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/qa8kez8QBx)

## About

Expand Down
15 changes: 15 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineBuildConfig } from "unbuild";
import pkg from "./package.json";

export default defineBuildConfig({
entries: ["./lib/index"],
outDir: "./dist",
declaration: true,
externals: [
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies),
],
rollup: {
emitCJS: true,
},
});
Loading

0 comments on commit 1a1f9bc

Please sign in to comment.