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

tests infra, linters, CI, etc. #1

Merged
merged 1 commit into from
Oct 25, 2023
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: 17 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
root: true,
ignorePatterns: ["dist/**/*", "node_modules/**/*"],
rules: {
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
},
};
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
full:
name: Node.js Latest Full
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Run linter
run: pnpm lint
- name: Run typecheck
run: pnpm typecheck
- name: Run tests
run: pnpm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
9 changes: 0 additions & 9 deletions .npmignore

This file was deleted.

2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 18.9.0
pnpm 8.7.5
39 changes: 32 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,54 @@
"version": "0.0.1",
"description": "AnyCable channels for serverless JS apps",
"engines": {
"node": ">=18.0.0"
"node": ">=18.0.0",
"pnpm": ">=8.7.5"
},
"scripts": {
"prepublishOnly": "pnpm build",
"test": "uvu -r @esbuild-kit/cjs-loader src/test",
"lint": "eslint src/",
"typecheck": "tsc --noEmit",
"build": "tsc"
},
"keywords": [
"anycable",
"actioncable",
"serverless"
],
"homepage": "https://anycable.io/",
"repository": "https://github.com/anycable/anycable-serverless-js",
"repository": {
"type": "git",
"url": "git+https://github.com/anycable/anycable-serverless-js.git"
},
"bugs": {
"url": "https://github.com/anycable/anycable-serverless-js/issues"
},
"author": "Vladimir Dementyev",
"license": "MIT",
"sideEffects": false,
"main": "index.ts",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": "./index.ts",
"./package.json": "./package.json"
".": "./dist/index.js"
},
"dependencies": {
},
"peerDependencies": {
"jose": "^4.14.6"
},
"devDependencies": {
"@esbuild-kit/cjs-loader": "^2.4.4",
"@types/node": "^20.6.3",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"uvu": "^0.5.6"
}
}
Loading