chore: basic structure of files to rewrite in TS

This commit is contained in:
divlo 2020-12-28 16:49:31 +01:00
parent d5e0dcc69d
commit 748c61ed07
18 changed files with 109 additions and 18 deletions

35
.gitignore vendored
View File

@ -1,2 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules
.pnp
.pnp.js
.yarn
# production
build
# testing
coverage
# envs
.env
.env.production
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# lockfiles
package-lock.json
yarn.lock
pnpm-lock.yaml
# editors
.vscode
.theia
.idea
node_modules/*
# misc
.DS_Store

1
example/.gitignore vendored
View File

@ -1 +0,0 @@
node_modules

View File

@ -1,3 +0,0 @@
# Deprecation Notice
This sample has been deprecated. Please see the [auth0-samples](https://github.com/auth0-samples) org for the latest Auth0 samples.

View File

@ -3,17 +3,28 @@
"version": "0.0.1",
"description": "Authenticate socket.io incoming connections with JWTs.",
"license": "MIT",
"main": "lib/index.js",
"types": "./types/index.d.ts",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
"build/**/*"
],
"engines": {
"node": ">=12"
},
"keywords": [
"socket",
"socket.io",
"jwt"
],
"author": "Divlo <contact@divlo.fr>",
"repository": {
"type": "git",
"url": "git+https://github.com/Thream/socketio-jwt"
},
"bugs": {
"url": "https://github.com/Thream/socketio-jwt/issues"
},
"homepage": "https://github.com/Thream/socketio-jwt#readme",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
@ -43,10 +54,33 @@
}
}
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"rootDir": "./src",
"collectCoverage": true,
"coverageDirectory": "../coverage/"
},
"ts-standard": {
"files": [
"./src/**/*.ts"
],
"envs": [
"node",
"jest"
]
},
"scripts": {
"test": "mocha",
"lint": "exit 0",
"build": "exit 0"
"build": "rimraf ./build && tsc",
"lint": "ts-standard | snazzy",
"format": "ts-standard --fix | snazzy",
"release": "release-it",
"test": "jest",
"test:watchAll": "jest --watchAll",
"test:clearCache": "jest --clearCache"
},
"peerDependencies": {
"socket.io": "*"
},
"dependencies": {
"jsonwebtoken": "8.5.1",
@ -56,17 +90,19 @@
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@release-it/conventional-changelog": "2.0.0",
"@types/jest": "26.0.19",
"@types/node": "14.14.16",
"@types/socket.io": "2.1.12",
"express": "4.17.1",
"husky": "4.3.6",
"mocha": "3.2.0",
"q": "1.5.1",
"jest": "26.6.3",
"release-it": "14.2.2",
"request": "2.88.2",
"serve-static": "1.14.1",
"server-destroy": "1.0.1",
"should": "13.2.3",
"socket.io": "2.3.0",
"socket.io-client": "2.3.0"
"rimraf": "3.0.2",
"snazzy": "9.0.0",
"socket.io": "3.0.4",
"socket.io-client": "3.0.4",
"ts-jest": "26.4.4",
"ts-standard": "10.0.0",
"typescript": "4.1.3"
}
}

3
src/index.ts Normal file
View File

@ -0,0 +1,3 @@
export const authorize = (options: any): any => {
return options
}

23
tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES2019",
"module": "commonjs",
"lib": ["ES2019"],
"moduleResolution": "node",
"allowJs": false,
"checkJs": false,
"declaration": true,
"sourceMap": false,
"outDir": "./build",
"rootDir": "./src",
"removeComments": false,
"noEmitOnError": true,
"importHelpers": false,
"strict": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"forceConsistentCasingInFileNames": true,
"incremental": false
}
}