-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ssx-core and improve code quality (#26)
* Create ssx-core package, populate and update other packages * Create a main file to be extended by packages * Optimize use of try/catch * Update serverless example login return and make ssx-test-dapp compatible * Add backwards types compatibility * Add changelogs * Add deprecation tags * Update changelog * Improve ssx-core docs * Improve ssx-gnosis-extension's docs * Improve ssx-react's docs * Improve ssx-sdk's docs * Improve ssx-server's docs * Improve ssx-serverless's docs * General docs updates * added support for documentation generation to ssx-core + supporting script * connect types from ssx-core to relying packages in documentation * moved eslint config to monorepo * airbnb-base rules update * update lint dependencies * moved .prettierrc to monorepo * use monorepo eslint * specify exported files * Return after middleware response Co-authored-by: Gregório Granado Magalhães <[email protected]> * Return response from middleware Co-authored-by: Sam Gbafa <[email protected]> * Remove console.error Co-authored-by: Sam Gbafa <[email protected]> * Remove console.error Co-authored-by: Sam Gbafa <[email protected]> * Remove redundant files * Remove .npmignore Co-authored-by: Samuel Gbafa <[email protected]> Co-authored-by: Gregório Granado Magalhães <[email protected]>
- Loading branch information
1 parent
ffa2132
commit c989838
Showing
57 changed files
with
2,072 additions
and
1,698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
"@spruceid/ssx-core": major | ||
"@spruceid/ssx-gnosis-extension": patch | ||
"@spruceid/ssx-react": patch | ||
"@spruceid/ssx": patch | ||
"@spruceid/ssx-server": patch | ||
"@spruceid/ssx-serverless": patch | ||
--- | ||
|
||
Refactor code to avoid duplication and improve performance. | ||
|
||
## General changes: | ||
- Creates a main `tsconfig` file to be extended by packages; | ||
- Configures `ssx-core`as a new package on the monorepo; | ||
- Removes duplicate `@changesets/cli` dependency. | ||
|
||
## @spruceid/ssx-core creation: | ||
- This package was created to held the types definitions and utils functions to all packages. This reduces the amount of duplicated code, prevent circular dependencies, reduces package sizes (tree-shaking during transpilation), and ensures that changes to the API will need a bump to this new package. | ||
- To unify the packages some interfaces/types names were updated: | ||
- `@spruceid/ssx-sdk`: `SSXConfig` -> `SSXClientConfig`; | ||
- `@spruceid/ssx-sdk`: `SSXProviders` -> `SSXClientProviders`; | ||
- `@spruceid/ssx-sdk`: `SSXSession` -> `SSXClientSession`; | ||
- `@spruceid/ssx-server`: `SSXConfig` -> `SSXServerConfig`; | ||
- `@spruceid/ssx-server`: `SSXProviders` -> `SSXServerProviders`; | ||
|
||
## @spruceid/ssx changes: | ||
- Adds `@spruceid/ssx-core` as a dependency; | ||
- Removes all types and interfaces declarations. They were moved to `ssx-core`; | ||
- Exports `SSXConfig` (deprecated) and `SSXClientConfig`; | ||
- Exports `SSXProviders` (deprecated) and `SSXClientProviders`; | ||
- Exports `SSXSession` (deprecated) and `SSXClientSession`; | ||
- Removes all utils functions. They were moved to `ssx-core`; | ||
- Optimizes `try/catch` blocks; | ||
- Updates `examples/ssx-test-dapp` to support ENS resolution from `examples/ssx-test-serverless-dynamodb-api`. | ||
|
||
## @spruceid/ssx-react changes: | ||
- Updates `ssxConfig?: SSXConfig;` on `SSXProviderProps` to `ssxConfig?: SSXClientConfig;` (non breaking change). | ||
|
||
## @spruceid/ssx-gnosis-extension changes: | ||
- Adds `@spruceid/ssx-core` as a dependency; | ||
- Adds types from `ssx-core` to all SSX related variables; | ||
- Optimizes `try/catch` blocks. | ||
|
||
## @spruceid/ssx-server changes: | ||
- Adds `@spruceid/ssx-core` as a dependency; | ||
- Removes all types and interfaces declarations. They were moved to `ssx-core`; | ||
- Exports `SSXConfig` (deprecated) and `SSXServerConfig`; | ||
- Exports `SSXProviders` (deprecated) and `SSXServerProviders`; | ||
- Removes all utils functions. They were moved to `ssx-core`; | ||
- Optimizes `try/catch` blocks. | ||
|
||
## @spruceid/ssx-serverless changes: | ||
- Adds `@spruceid/ssx-core` as a dependency; | ||
- Removes some types and interfaces declarations. They were moved to `ssx-core`; | ||
- Removes all utils functions. They were moved to `ssx-core`; | ||
- Optimizes `try/catch` blocks; | ||
- Changes axios version to `"^0.27.2"`; | ||
- Updates `examples/ssx-test-serverless-dynamodb-api` to resolve ENS accorddly with the request params and fixes the `/ssx-login` JSON response. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
"ignorePatterns": [ | ||
"examples/", | ||
"packages/create-ssx-dapp/", | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"], | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
], | ||
"root": true, | ||
"rules": { | ||
"object-property-newline": "error", | ||
"import/prefer-default-export": "off", | ||
"no-promise-executor-return": "warn", | ||
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }], | ||
"no-use-before-define": "warn", | ||
"import/extensions": "off", | ||
"import/no-unresolved": "off", | ||
"max-len": "warn", | ||
"max-classes-per-file": "off", | ||
"no-plusplus": "off", | ||
"no-await-in-loop": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": true, | ||
"arrowParens": "avoid", | ||
"bracketSameLine": true, | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"endOfLine": "lf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"../../.eslintrc" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SSX-Core | ||
|
||
SSX-Core is a library made to aggregate types and utils to other SSX packages. | ||
|
||
## Installation | ||
|
||
You can add SSX-Core from yarn or npm: | ||
|
||
```bash | ||
npm install @spruceid/ssx-core | ||
# or | ||
yarn add @spruceid/ssx-core | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-documenter.schema.json", | ||
"outputTarget": "markdown", | ||
"tableOfContents": { | ||
"nonEmptyCategoryNodeNames": ["References", "Interface6"], | ||
"catchAllCategory": "References", | ||
"categorizeByName": true, | ||
"categoryInlineTag": "docCategory" | ||
} | ||
} |
Oops, something went wrong.