-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: export
ContractClient
et al. in contract
; rename `SorobanR…
…pc` to `rpc` (#962) * Appease ESLint: This includes some fixes and updates to eslint configuration to make it work as expected - Extended `airbnb-typescript/base` to get it to stop yelling at me about importing files without file extension. Saw this recommended as the fix on StackOverflow [[1]]. And it makes sense to me that if we are extending Airbnb's lint rules and using TypeScript, we probably want their TypeScript-specific lint rules, too. - Added the `eslint-plugin-jsdoc` plugin because the old `valid-jsdoc` rule we were using has been deprecated [[2]], and this plugin is the new way. Previously we had `valid-jsdoc: 1` (with some extra customization), and my guess is that extending `plugin:jsdoc/recommended` (plus some customization) is roughly equivalent. - Researched [[3]] whether JSDoc `@param`-style docs or TSDoc-style `/** inline param docs */` work better. TSDoc work better. So disabled `jsdoc/require-param`. - Remove mostly-duplicate `src/soroban/.eslintrc.js`, which had only one setting different from `src/.eslintrc.js` Note that `src/contract_client` is now perhaps the only directory of code to pass our ESLint settings 🤔 [1]: https://stackoverflow.com/a/67610259/249801 [2]: https://eslint.org/docs/latest/rules/valid-jsdoc [3]: #962 (comment) * New exports `contract` and `rpc`: - `SorobanRpc` now also exported as `rpc` - New main export `contract`. This allows us to import it the usual way, instead of needing to do things like import { ContractClient } from "stellar-sdk/lib/contract_client" which doesn't work in the browser (because `lib`) - `ContractSpec` now available at `contract.Spec` - Also includes other supporting classes, functions, and types: - `contract.AssembledTransaction` - `contract.ClientOptions` - etc - These are also available at matching entrypoints, if your node and TypeScript configuration support the `exports` declaration: import { Client, ClientOptions, AssembledTransaction, } from 'stellar-sdk/contract' This also attempts to document exported modules. The JSDoc-style comments in `src/index.ts` don't actually show up when you import these things. We can figure this out later. Docs here https://jsdoc.app/howto-es2015-modules. In the meantime, these are still useful notes that we can use later. --------- Co-authored-by: George <[email protected]>
- Loading branch information
Showing
48 changed files
with
661 additions
and
443 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
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
Oops, something went wrong.