Skip to content

Commit

Permalink
Merge branch 'development' into features/SMA-84-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Sep 12, 2023
2 parents 23a457a + 6cfb7d2 commit 0d381c0
Show file tree
Hide file tree
Showing 75 changed files with 1,091 additions and 1,118 deletions.
14 changes: 14 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore node_modules in the root and in all packages
**/node_modules/

# Ignore build or dist directories
**/dist/
**/build/
**/coverage/

# Ignore any auto-generated files
**/typechain/

# Ignore any config files
*.config.js
*.config.ts
40 changes: 32 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "airbnb-typescript/base", "plugin:prettier/recommended"],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
}
ecmaVersion: 2020,
sourceType: "module",
project: './tsconfig.eslint.json',
},
env: {
node: true,
es6: true,
},
plugins: ["@typescript-eslint", "prettier", "security", "import"],
rules: {
"prettier/prettier": "error",
"no-var": "error",
"prefer-const": "error",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"security/detect-object-injection": "warn",
"security/detect-unsafe-regex": "error",
},
settings: {},
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
},
},
],
};
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore node_modules in the root and in all packages
**/node_modules/

# Ignore build or dist directories
**/dist/
**/build/
**/coverage/

# Ignore any auto-generated files
**/typechain/

# Ignore any config files
*.config.js
*.config.ts
7 changes: 4 additions & 3 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"printWidth": 100,
"printWidth": 150,
"semi": true,
"singleQuote": true,
"trailingComma": "none"
"singleQuote": false,
"trailingComma": "all",
"tabWidth": 2
}
184 changes: 184 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/

import type { Config } from "jest";

const config: Config = {
// All imported modules in your tests should be mocked automatically
// automock: false,

// Stop running tests after `n` failures
// bail: 0,

// The directory where Jest should store its cached dependency information
// cacheDirectory: "/private/var/folders/_y/33lkcttj3w3fd6v6xvg7f33m0000gn/T/jest_dx",

// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false,

// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ["packages/**/*.{js,ts}", "!packages/**/node_modules/**", "!packages/**/dist/**"],

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",

// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],

// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,

// A path to a custom dependency extractor
// dependencyExtractor: undefined,

// Make calling deprecated APIs throw helpful error messages
// errorOnDeprecated: false,

// The default configuration for fake timers
// fakeTimers: {
// "enableGlobally": false
// },

// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],

// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,

// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,

// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",

// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],

// An array of file extensions your modules use
moduleFileExtensions: ["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],

// Activates notifications for test results
// notify: false,

// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
preset: "ts-jest",

// Run tests from one or more projects
// projects: undefined,

// Use this configuration option to add custom reporters to Jest
// reporters: undefined,

// Automatically reset mock state before every test
// resetMocks: false,

// Reset the module registry before running each individual test
// resetModules: false,

// A path to a custom resolver
// resolver: undefined,

// Automatically restore mock state and implementation before every test
// restoreMocks: false,

// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,

// A list of paths to directories that Jest should use to search for files in
roots: ["<rootDir>/packages/"],

// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",

// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],

// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,

// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],

// The test environment that will be used for testing
testEnvironment: "node",

// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},

// Adds a location field to test results
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: ["**/*.spec.ts"],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "/node_modules/"
// ],

// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],

// This option allows the use of a custom results processor
// testResultsProcessor: undefined,

// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",

// A map from regular expressions to paths to transformers
transform: {
"^.+\\.tsx?$": "ts-jest",
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "/node_modules/",
// "\\.pnp\\.[^\\/]+$"
// ],

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,

// Indicates whether each individual test should be reported during the run
verbose: true,

// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],

// Whether to use watchman for file crawling
// watchman: true,
};

export default config;
9 changes: 1 addition & 8 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent",
"command": {
"publish": {
"conventionalCommits": true
}
},
"ignoreChanges": [
"**/CHANGELOG.md",
"**/node_modules/**",
"**/package.json",
"**/*.md",
"**/perf/**"
]
"ignoreChanges": ["**/CHANGELOG.md", "**/node_modules/**", "**/*.md", "**/perf/**"]
}
76 changes: 51 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
{
"name": "biconomy-sdk",
"version": "1.0.0",
"description": "SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337, ERC-6900, and cross-chain functionalities.",
"keywords": [
"biconomy",
"sdk",
"blockchain",
"integration",
"account abstraction",
"smart accounts",
"erc-4337",
"erc-6900",
"crosschain",
"cross-chain",
"metatransactions"
],
"license": "MIT",
"homepage": "https://biconomy.io/docs",
"bugs": {
"url": "https://github.com/bcnmy/biconomy-client-sdk/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/bcnmy/biconomy-client-sdk"
},
"author": "Biconomy (https://biconomy.io)",
"private": true,
"scripts": {
"clean": "lerna clean",
"unbuild": "lerna run unbuild",
"build": "lerna run build --stream --npm-client=yarn",
"test": "lerna run test --stream --npm-client=yarn",
"test:ci": "FORCE_COLOR=1 lerna run test:ci --stream --npm-client=yarn",
"build": "lerna run build",
"clean": "lerna clean && lerna run unbuild",
"format": "lerna run format --npm-client=yarn",
"prettier": "npx prettier --write .",
"diff": "lerna diff",
"new-version": "lerna version patch --no-git-tag-version --no-push --conventional-commits --yes",
"prettier": "lerna run prettier --npm-client=yarn",
"lint": "eslint -c .eslintrc.js 'packages/*/src/**/*.{ts,tsx}'",
"lint:fix": "eslint -c .eslintrc.js 'packages/*/src/**/*.{ts,tsx}' --fix"
"lint:fix": "eslint -c .eslintrc.js 'packages/*/src/**/*.{ts,tsx}' --fix",
"test": "yarn jest --runInBand",
"test:ci": "FORCE_COLOR=1 lerna run test:ci --stream --npm-client=yarn",
"test:coverage": "yarn jest --coverage",
"diff": "lerna diff",
"release": "lerna version patch --no-git-tag-version --no-push --conventional-commits --yes"
},
"changelog": {
"labels": {
Expand All @@ -29,24 +50,29 @@
"packages/*"
]
},
"author": "Biconomy (https://biconomy.io)",
"dependencies": {
"node-gyp": "^9.4.0",
"typescript": "^5.2.2"
},
"devDependencies": {
"@types/jest": "^28.1.7",
"@types/mocha": "^9.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"hardhat": "^2.9.9",
"lerna": "^5.5.4",
"@types/jest": "^29.5.4",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.48.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-security": "^1.7.1",
"hardhat": "^2.17.2",
"jest": "^29.6.4",
"lerna": "^7.2.0",
"lerna-changelog": "^2.2.0",
"nx": "^15.8.3",
"prettier": "2.7.1",
"rimraf": "^3.0.2",
"nx": "^16.8.1",
"prettier": "^3.0.3",
"rimraf": "^5.0.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1"
},
"dependencies": {
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"node-gyp": "^9.1.0",
"typescript": "^4.7.4"
}
}
Loading

0 comments on commit 0d381c0

Please sign in to comment.