diff --git a/identity-providers/.eslintignore b/identity-providers/.eslintignore new file mode 100644 index 0000000000..a110658985 --- /dev/null +++ b/identity-providers/.eslintignore @@ -0,0 +1,9 @@ +/*.js +/*.ts +/dist/* +/coverage/* +/node_modules/* +/src/didkit-node/* +/src/didkit-browser/* +/__mocks__/**/* +/__tests__/**/* diff --git a/identity-providers/.eslintrc.js b/identity-providers/.eslintrc.js new file mode 100644 index 0000000000..e57a23082d --- /dev/null +++ b/identity-providers/.eslintrc.js @@ -0,0 +1,49 @@ +module.exports = { + env: { + es6: true, + browser: true, + jest: true, + }, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:prettier/recommended", + "plugin:jest/recommended", + "plugin:react/recommended", + "prettier", + ], + ignorePatterns: [".eslintrc.js", "jest.config.js"], + parser: "@typescript-eslint/parser", + parserOptions: { + sourceType: "module", + ecmaVersion: 2017, + ecmaFeatures: { + jsx: true, + }, + tsconfigRootDir: __dirname, + project: ["./tsconfig.json"], + }, + plugins: ["@typescript-eslint", "prettier", "jest", "react"], + rules: { + quotes: ["error", "double"], + "no-console": "warn", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": ["warn", { vars: "all", args: "after-used", ignoreRestSiblings: false }], + "@typescript-eslint/explicit-function-return-type": "warn", // Consider using explicit annotations for object literals and function return types even when they can be inferred. + "no-empty": "warn", + "@typescript-eslint/no-misused-promises": 1, + "@typescript-eslint/no-floating-promises": 1, + "@typescript-eslint/no-unsafe-assignment": "warn", + }, + settings: { + "import/resolver": { + node: { + extensions: [".js", ".jsx", ".ts", ".tsx"], + }, + }, + react: { + version: "detect", + }, + }, +}; diff --git a/identity-providers/.gitignore b/identity-providers/.gitignore new file mode 100644 index 0000000000..48d12f5c92 --- /dev/null +++ b/identity-providers/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +/dist +/coverage +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/identity-providers/.prettierignore b/identity-providers/.prettierignore new file mode 100644 index 0000000000..2f70a66d2b --- /dev/null +++ b/identity-providers/.prettierignore @@ -0,0 +1,5 @@ +/dist/* +/coverage/* +/node_modules/* +/src/didkit-node/* +/src/didkit-browser/* diff --git a/identity-providers/.prettierrc.js b/identity-providers/.prettierrc.js new file mode 100644 index 0000000000..d3857de11f --- /dev/null +++ b/identity-providers/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require("../.prettierrc.js"), +}; diff --git a/identity-providers/README.md b/identity-providers/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/identity-providers/jest.config.js b/identity-providers/jest.config.js new file mode 100644 index 0000000000..652c929fd7 --- /dev/null +++ b/identity-providers/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + testEnvironment: "node", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + modulePathIgnorePatterns: ["/dist/"], +}; diff --git a/identity-providers/package.json b/identity-providers/package.json new file mode 100644 index 0000000000..c4a6175efd --- /dev/null +++ b/identity-providers/package.json @@ -0,0 +1,35 @@ +{ + "name": "@gitcoin/passport-identity-providers", + "version": "1.0.0", + "license": "MIT", + "main": "dist/commonjs/index.js", + "directories": { + "src": "src", + "dist": "dist" + }, + "files": [ + "src", + "dist" + ], + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@ethersproject/base64": "^5.6.1", + "@ethersproject/providers": "^5.6.2", + "@gitcoin/passport-types": "^1.0.0", + "axios": "^0.26.1", + "typescript": "~4.6.3" + }, + "devDependencies": { + "jest": "^27.5.1", + "ts-jest": "^27.1.4" + }, + "scripts": { + "clean": "rimraf dist node_modules", + "build": "tsc", + "test": "jest --verbose", + "lint": "tsc --noEmit && eslint --ext .ts,.js,.tsx .", + "prettier": "prettier --write ." + } +} diff --git a/identity-providers/src/index.ts b/identity-providers/src/index.ts new file mode 100644 index 0000000000..ff8b4c5632 --- /dev/null +++ b/identity-providers/src/index.ts @@ -0,0 +1 @@ +export default {}; diff --git a/identity-providers/tsconfig.json b/identity-providers/tsconfig.json new file mode 100644 index 0000000000..fae6b3996b --- /dev/null +++ b/identity-providers/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.settings.json", + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "declaration": true, + "allowSyntheticDefaultImports": true, + "target": "es6", + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist/commonjs", + "allowJs": true, + "baseUrl": "src", + "paths": { + "*": ["../node_modules/*", "node_modules/*"] + } + }, + "include": ["src/*", "__tests__"] +} diff --git a/package.json b/package.json index 0eb459ba49..a778ee9304 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "database-client", "iam", "identity", + "identity-providers", "schemas", "types", "signer"