From 5fe4b018b35f5fdb408af99af2b77d843c708204 Mon Sep 17 00:00:00 2001 From: Nicolas Henin Date: Sun, 17 Mar 2024 15:12:41 +0100 Subject: [PATCH] applied new prettier config to all the codebase --- CHANGELOG.md | 7 +- Readme.md | 10 +- ..._plt_9089_createContract_bundle_support.md | 2 - .../20240122_133315_hrajchert_cip45.md | 1 - ..._162752_bjorn.wilhelm.kihlberg_PLT_9368.md | 2 +- ...40214_142506_hrajchert_marlowe_template.md | 6 +- ...222_130945_hrajchert_fix_branded_output.md | 2 - doc/howToDevelop.md | 2 + doc/theme/assets/marlowe-theme.css | 23 +- doc/theme/src/ThemeContext.tsx | 15 +- doc/theme/src/index.tsx | 9 +- doc/theme/src/templates/footer.tsx | 67 +++- doc/theme/src/templates/layout.tsx | 51 +-- doc/theme/src/templates/toolbar.tsx | 45 +-- doc/theme/src/templates/utils.tsx | 5 +- doc/versioning-and-releases.md | 30 +- examples/cip45-flow/Readme.md | 4 + examples/cip45-flow/index.html | 9 +- examples/cip45-flow/index.js | 83 ++--- examples/get-my-contract-ids-flow/index.html | 2 +- examples/js/poc-helpers.js | 30 +- examples/nodejs/src/escrow-flow.ts | 40 +-- .../applicable-inputs.ts | 54 +-- .../experimental-features/contract-closure.ts | 6 +- .../src/experimental-features/source-map.ts | 54 +-- examples/nodejs/src/marlowe-object-flow.ts | 99 ++---- examples/nodejs/src/wallet-flow.ts | 8 +- examples/payouts-flow/index.html | 19 +- examples/rest-client-flow/index.html | 105 +----- examples/run-lite/index.html | 17 +- .../custodian/custodian-encript.js | 8 +- examples/survey-workshop/custodian/index.html | 23 +- examples/survey-workshop/custodian/index.js | 9 +- .../survey-workshop/participant/contract.js | 12 +- .../survey-workshop/participant/index.html | 159 +++------ examples/survey-workshop/participant/index.js | 57 +-- examples/vesting-flow/index.html | 134 ++----- examples/wallet-flow/index.html | 34 +- jsdelivr-npm-importmap.js | 21 +- packages/adapter/src/assoc-map.ts | 38 +- packages/adapter/src/codec.ts | 5 +- packages/adapter/src/deep-equal.ts | 7 +- packages/adapter/src/file.ts | 3 +- packages/adapter/src/fp-ts.ts | 4 +- packages/adapter/src/http.ts | 15 +- packages/adapter/src/io-ts.ts | 39 +- packages/adapter/src/time.ts | 9 +- packages/language/core/v1/src/actions.ts | 10 +- packages/language/core/v1/src/choices.ts | 4 +- packages/language/core/v1/src/contract.ts | 39 +- packages/language/core/v1/src/guards.ts | 16 +- packages/language/core/v1/src/index.ts | 9 +- packages/language/core/v1/src/inputs.ts | 45 +-- .../core/v1/src/next/applicables/canChoose.ts | 4 +- .../core/v1/src/next/applicables/canNotify.ts | 3 +- packages/language/core/v1/src/participants.ts | 3 +- packages/language/core/v1/src/payee.ts | 4 +- .../language/core/v1/src/playground-v1.ts | 91 +---- packages/language/core/v1/src/semantics.ts | 336 ++++-------------- packages/language/core/v1/src/state.ts | 15 +- packages/language/core/v1/src/token.ts | 3 +- packages/language/core/v1/src/tokenValue.ts | 13 +- packages/language/core/v1/src/transaction.ts | 30 +- .../core/v1/src/value-and-observation.ts | 62 ++-- .../core/v1/test/examples/parsing.spec.ts | 14 +- .../core/v1/test/jest.unit.config.mjs | 6 +- .../common/payee/accounts/parsing.spec.ts | 53 ++- .../contract/common/value/parsing.spec.ts | 51 +-- .../test/semantics/contract/parsing.spec.ts | 53 ++- .../contract/when/action/parsing.spec.ts | 53 ++- packages/language/core/v1/typedoc.json | 12 +- packages/language/examples/src/atomicSwap.ts | 56 +-- .../examples/src/contract-one-notify.ts | 4 +- .../playground-v1/escrow-with-collateral.ts | 50 +-- .../examples/src/playground-v1/escrow.ts | 40 +-- packages/language/examples/src/survey.ts | 112 ++---- packages/language/examples/src/vesting.ts | 72 +--- .../language/examples/test/atomicSwap.spec.ts | 43 +-- .../examples/test/jest.unit.config.mjs | 6 +- packages/language/examples/test/tsconfig.json | 6 +- .../specification-client/src/jsonStream.ts | 5 +- .../language/specification-client/src/main.ts | 34 +- packages/marlowe-object/Readme.md | 2 +- packages/marlowe-object/src/actions.ts | 18 +- packages/marlowe-object/src/annotations.ts | 14 +- .../marlowe-object/src/bundle-conversion.ts | 29 +- .../src/bundle-list/bundle-list.ts | 16 +- .../src/bundle-map/bundle-map.ts | 21 +- packages/marlowe-object/src/contract.ts | 46 +-- packages/marlowe-object/src/guards.ts | 10 +- packages/marlowe-object/src/index.ts | 7 +- packages/marlowe-object/src/participants.ts | 4 +- packages/marlowe-object/src/payee.ts | 4 +- packages/marlowe-object/src/token.ts | 6 +- .../src/value-and-observation.ts | 64 ++-- .../test/bundleListToMap.spec.ts | 39 +- .../test/bundleMapToList.spec.ts | 31 +- .../marlowe-object/test/jest.unit.config.mjs | 6 +- packages/marlowe-object/test/tsconfig.json | 6 +- packages/marlowe-object/typedoc.json | 7 +- packages/marlowe-template/src/codecs.ts | 37 +- .../marlowe-template/src/template-param.ts | 46 +-- packages/marlowe-template/src/template.ts | 48 +-- .../test/basic-types-template.spec.ts | 5 +- packages/marlowe-template/test/codecs.spec.ts | 10 +- .../test/delayed-payment-template.spec.ts | 5 +- .../test/jest.unit.config.mjs | 6 +- packages/marlowe-template/test/tsconfig.json | 6 +- .../client/rest/src/contract/details.ts | 6 +- .../rest/src/contract/endpoints/collection.ts | 73 +--- .../rest/src/contract/endpoints/singleton.ts | 35 +- .../rest/src/contract/endpoints/sources.ts | 85 ++--- .../client/rest/src/contract/next/endpoint.ts | 17 +- .../rest/src/contract/rolesConfigurations.ts | 59 +-- .../rest/src/contract/transaction/details.ts | 7 +- .../transaction/endpoints/collection.ts | 96 ++--- .../transaction/endpoints/singleton.ts | 32 +- .../rest/src/contract/transaction/status.ts | 6 +- packages/runtime/client/rest/src/index.ts | 180 +++------- .../runtime/client/rest/src/pagination.ts | 6 +- .../rest/src/payout/endpoints/collection.ts | 31 +- .../rest/src/payout/endpoints/singleton.ts | 36 +- .../runtime/client/rest/src/payout/header.ts | 7 +- .../runtime/client/rest/src/runtime/status.ts | 29 +- .../client/rest/src/runtime/version.ts | 11 +- .../src/withdrawal/endpoints/collection.ts | 81 ++--- .../src/withdrawal/endpoints/singleton.ts | 45 +-- .../rest/test/endpoints/contracts.spec.e2e.ts | 7 +- .../client/rest/test/jest.e2e.config.mjs | 57 +-- packages/runtime/core/src/address.ts | 8 +- packages/runtime/core/src/asset/index.ts | 22 +- packages/runtime/core/src/contract/id.ts | 8 +- packages/runtime/core/src/metadata.ts | 45 +-- packages/runtime/core/src/payout/index.ts | 10 +- packages/runtime/core/src/policyId.ts | 6 +- packages/runtime/core/src/textEnvelope.ts | 9 +- packages/runtime/core/src/tsconfig.json | 5 +- packages/runtime/core/src/tx/id.ts | 6 +- packages/runtime/lifecycle/Readme.md | 8 +- packages/runtime/lifecycle/src/api.ts | 33 +- .../runtime/lifecycle/src/browser/index.ts | 49 +-- .../lifecycle/src/generic/contracts.ts | 108 ++---- .../runtime/lifecycle/src/generic/payouts.ts | 61 +--- packages/runtime/lifecycle/src/index.ts | 29 +- .../runtime/lifecycle/src/nodejs/index.ts | 32 +- packages/runtime/lifecycle/src/tsconfig.json | 4 +- .../test/examples/swap.ada.token.e2e.spec.ts | 178 +++------- .../test/generic/contracts.e2e.spec.ts | 52 +-- .../lifecycle/test/jest.e2e.config.mjs | 59 +-- .../src/environment/configuration.ts | 4 +- packages/testing-kit/src/environment/index.ts | 16 +- packages/testing-kit/src/logging.ts | 14 +- .../testing-kit/src/wallet/lucid/index.ts | 34 +- .../src/wallet/lucid/provisionning.ts | 92 ++--- packages/testing-kit/src/wallet/seedPhrase.ts | 3 +- packages/token-metadata-client/src/index.ts | 12 +- packages/wallet/Readme.md | 9 +- packages/wallet/src/api.ts | 4 +- packages/wallet/src/browser/index.ts | 30 +- packages/wallet/src/index.ts | 5 +- packages/wallet/src/lucid/index.ts | 20 +- packages/wallet/src/tsconfig.json | 5 +- packages/wallet/test/tsconfig.json | 6 +- packages/wallet/typedoc.json | 7 +- rollup/config.mjs | 34 +- rollup/import-map.mjs | 31 +- rollup/package-helper.mjs | 28 +- test-nodejs-import.mjs | 9 +- typedoc.json | 5 +- 169 files changed, 1470 insertions(+), 3770 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 837ba1b3..6ca122f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ - # 0.3.0-beta - 18 Jan 2024 + The Marlowe team is happy to announce the 0.3.0 release with the following Milestones completed: + - Add Node.js/Deno support - Completed 1-1 feature parity between the TS-SDK and Runtime 0.0.6 - Added an open role example @@ -24,7 +25,6 @@ A more detailed description of the changes can be found next - Fix (PLT-9008): Fix documentation warnings and add a CI check to avoid them in the future. ([PR-139](https://github.com/input-output-hk/marlowe-ts-sdk/pull/139)) - ## Examples - Feat: Added a new interactive NodeJs example to make delayed payments with staking and merkleization. ([PR-136](https://github.com/input-output-hk/marlowe-ts-sdk/pull/136)) @@ -62,7 +62,7 @@ A more detailed description of the changes can be found next - or `json {withdrawals: {..}, page : {..} }` - **BREAKING CHANGE** Refactor: Create contract sources now uses a single parameter ContractBundle, instead of two separate bundle and main entrypoint parameters. ([PR-136](https://github.com/input-output-hk/marlowe-ts-sdk/pull/136)) - **BREAKING CHANGE** Feat: Modified the endpoint `healthcheck` to return `RuntimeStatus`(version deployed, Network Id of the Node and tips) instead of a `boolean`. ([PR-158](https://github.com/input-output-hk/marlowe-ts-sdk/pull/158)) -- **BREAKING CHANGE** Fix: Pagination responses not always return a current header. ([PR-136](https://github.com/input-output-hk/marlowe-ts-sdk/pull/136)) +- **BREAKING CHANGE** Fix: Pagination responses not always return a current header. ([PR-136](https://github.com/input-output-hk/marlowe-ts-sdk/pull/136)) - Feat (PLT-7704): Extend the rest client with procedure `getPayouts`. ([PR-124](https://github.com/input-output-hk/marlowe-ts-sdk/pull/124)) - Feat (PLT-7705): Extend the rest client with procedure `getPayoutById`. ([PR-124](https://github.com/input-output-hk/marlowe-ts-sdk/pull/124)) @@ -73,7 +73,6 @@ A more detailed description of the changes can be found next - Feat: Added `@marlowe.io/runtime-rest-client/guards` in a similar way as `@marlowe.io/labguage-core-v1/guards` ([PR-142](https://github.com/input-output-hk/marlowe-ts-sdk/pull/142)) - Fix: Revived integration tests ([PR-142](https://github.com/input-output-hk/marlowe-ts-sdk/pull/142)) - ## @marlowe.io/runtime-core - **BREAKING CHANGE** Refactor: `AddressBech32` is a branded type instead of newtype (`unAddressBech32` has been removed and is not necessary anymore) : [PR-127](https://github.com/input-output-hk/marlowe-ts-sdk/pull/127) diff --git a/Readme.md b/Readme.md index 6c74c308..7f222a80 100644 --- a/Readme.md +++ b/Readme.md @@ -24,12 +24,10 @@ It is composed of several npm packages documented in the [API reference](https:/ In order to interact with Marlowe contracts, the **TS-SDK** needs a Runtime instance. The following table shows the compatibility between the SDK and the Runtime versions: - -| | runtime v0.0.5 | runtime v0.0.6 | -| ------- | :--------: | :------------: | -| [SDK 0.2.0-beta](https://github.com/input-output-hk/marlowe-ts-sdk/releases/tag/0.2.0-beta) | ✓ | x | -| [SDK 0.3.0-beta](https://github.com/input-output-hk/marlowe-ts-sdk/releases/tag/0.3.0-beta) | ✓ | ✓ | - +| | runtime v0.0.5 | runtime v0.0.6 | +| ------------------------------------------------------------------------------------------- | :------------: | :------------: | +| [SDK 0.2.0-beta](https://github.com/input-output-hk/marlowe-ts-sdk/releases/tag/0.2.0-beta) | ✓ | x | +| [SDK 0.3.0-beta](https://github.com/input-output-hk/marlowe-ts-sdk/releases/tag/0.3.0-beta) | ✓ | ✓ | To get a running instance of the Runtime, it is recommended to check out the instructions on the [Marlowe Starter Kit](https://github.com/input-output-hk/marlowe-starter-kit) diff --git a/changelog.d/20240112_130130_hrajchert_plt_9089_createContract_bundle_support.md b/changelog.d/20240112_130130_hrajchert_plt_9089_createContract_bundle_support.md index 20252d9c..af017edc 100644 --- a/changelog.d/20240112_130130_hrajchert_plt_9089_createContract_bundle_support.md +++ b/changelog.d/20240112_130130_hrajchert_plt_9089_createContract_bundle_support.md @@ -1,5 +1,3 @@ - ### @marlowe.io/runtime-lifecycle - Feat (PLT-9089): Added support for contract bundles in the `lifecycle.contracts.createContract` function. ([PR-167](https://github.com/input-output-hk/marlowe-ts-sdk/pull/167)) - diff --git a/changelog.d/20240122_133315_hrajchert_cip45.md b/changelog.d/20240122_133315_hrajchert_cip45.md index 8d2ceae8..daf38c0b 100644 --- a/changelog.d/20240122_133315_hrajchert_cip45.md +++ b/changelog.d/20240122_133315_hrajchert_cip45.md @@ -1,4 +1,3 @@ - ### @marlowe.io/wallet - Feat: Added a `@marlowe.io/wallet/peer-connect` module to enable mobile support by adapting to the [cardano-peer-connect](https://github.com/fabianbormann/cardano-peer-connect) library. ([PR-179](https://github.com/input-output-hk/marlowe-ts-sdk/pull/179)) diff --git a/changelog.d/20240126_162752_bjorn.wilhelm.kihlberg_PLT_9368.md b/changelog.d/20240126_162752_bjorn.wilhelm.kihlberg_PLT_9368.md index 77af8e27..d8bd5614 100644 --- a/changelog.d/20240126_162752_bjorn.wilhelm.kihlberg_PLT_9368.md +++ b/changelog.d/20240126_162752_bjorn.wilhelm.kihlberg_PLT_9368.md @@ -1,7 +1,7 @@ ### @marlowe.io/runtime-rest-client - `mkRestClient` provides optional `strict` parameter for performing dynamic type checking in `RestClient` methods. ([PR-180](https://github.com/input-output-hk/marlowe-ts-sdk/pull/180)) -- **BREAKING CHANGE** The following `RestClient` methods uses keyword argument object instead of positional arguments. ([PR-180](https://github.com/input-output-hk/marlowe-ts-sdk/pull/180)) +- **BREAKING CHANGE** The following `RestClient` methods uses keyword argument object instead of positional arguments. ([PR-180](https://github.com/input-output-hk/marlowe-ts-sdk/pull/180)) - `createContractSources` - `getContractById` - `submitContract` diff --git a/changelog.d/20240214_142506_hrajchert_marlowe_template.md b/changelog.d/20240214_142506_hrajchert_marlowe_template.md index 0a0279e2..319d9643 100644 --- a/changelog.d/20240214_142506_hrajchert_marlowe_template.md +++ b/changelog.d/20240214_142506_hrajchert_marlowe_template.md @@ -1,12 +1,8 @@ - - ### General - Feat: Created a new experimental package `@marlowe.io/marlowe-template` that helps to share the parameters used in the creation of a Marlowe contract. ([PR-184](https://github.com/input-output-hk/marlowe-ts-sdk/pull/184)) - ### @marlowe.io/runtime-core -- Feat: Added AddressBech32 validation using the lucid library ([PR-184](https://github.com/input-output-hk/marlowe-ts-sdk/pull/184)) +- Feat: Added AddressBech32 validation using the lucid library ([PR-184](https://github.com/input-output-hk/marlowe-ts-sdk/pull/184)) - Fix: Added proper type guards to Metadata ([PR-184](https://github.com/input-output-hk/marlowe-ts-sdk/pull/184)) - diff --git a/changelog.d/20240222_130945_hrajchert_fix_branded_output.md b/changelog.d/20240222_130945_hrajchert_fix_branded_output.md index 7f0a2738..f01c6c58 100644 --- a/changelog.d/20240222_130945_hrajchert_fix_branded_output.md +++ b/changelog.d/20240222_130945_hrajchert_fix_branded_output.md @@ -1,5 +1,3 @@ ### @marlowe.io/runtime-core - Fix: Branding of ContractId and TxId ([PR-185](https://github.com/input-output-hk/marlowe-ts-sdk/pull/185)) - - diff --git a/doc/howToDevelop.md b/doc/howToDevelop.md index 64122bc0..3b246161 100644 --- a/doc/howToDevelop.md +++ b/doc/howToDevelop.md @@ -79,9 +79,11 @@ $ npm test #### How to Generate a new Seed Phrase for a Bank Wallet ? 1. At the root of the project : + ```bash npm run -w @marlowe.io/testing-kit genSeedPhrase ``` + 2. Copy/paste the words within quotes in the env file. 3. Go to one of your favorite Wallet Extension and restore a wallet with this seedphrase 4. Get a Payment Address from these Browser extensions to provision your Bank with the faucet. diff --git a/doc/theme/assets/marlowe-theme.css b/doc/theme/assets/marlowe-theme.css index 64249469..612f1fc8 100644 --- a/doc/theme/assets/marlowe-theme.css +++ b/doc/theme/assets/marlowe-theme.css @@ -1,7 +1,5 @@ /* https://github.com/elad2412/the-new-css-reset */ -*:where( - :not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *) - ) { +*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) { all: unset; display: revert; } @@ -79,8 +77,7 @@ meter { --light-button-color-hover: rgb(36, 41, 47); --light-button-background-hover: rgb(239, 241, 243); --light-button-border-color-hover: rgba(31, 35, 40, 0.15); - --light-button-box-shadow: rgba(31, 35, 40, 0.04) 0 1px 0, - rgba(255, 255, 255, 0.25) 0 1px 0 inset; + --light-button-box-shadow: rgba(31, 35, 40, 0.04) 0 1px 0, rgba(255, 255, 255, 0.25) 0 1px 0 inset; --light-input-border-color: rgb(208, 215, 222); --light-input-border-color-focus: rgb(9, 105, 218); @@ -104,10 +101,9 @@ meter { --pre-color-background: var(--color-background-secondary); --code-color-background: var(--color-background-secondary); - --font-family-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", - Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; - --font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, - Liberation Mono, monospace; + --font-family-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji"; + --font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; --font-size-h1: 2.1rem; --font-size-h2: 1.8rem; @@ -508,8 +504,7 @@ ul.tsd-parameter-list > li > h5:last-child { /* Show parameter signature as a cut-in block */ .tsd-parameter-signature { - margin: calc(var(--paragraph-spacing) / -2) - calc(var(--paragraph-spacing) * -1) calc(var(--paragraph-spacing) / 2); + margin: calc(var(--paragraph-spacing) / -2) calc(var(--paragraph-spacing) * -1) calc(var(--paragraph-spacing) / 2); padding: var(--paragraph-spacing); padding-bottom: 0.05px; background: var(--color-background-secondary); @@ -951,13 +946,11 @@ a.tsd-index-link { } .page-menu { - padding: var(--paragraph-spacing) var(--content-spacing) - var(--paragraph-spacing) 0; + padding: var(--paragraph-spacing) var(--content-spacing) var(--paragraph-spacing) 0; } .site-menu { - padding: var(--paragraph-spacing) 0 var(--paragraph-spacing) - var(--content-spacing); + padding: var(--paragraph-spacing) 0 var(--paragraph-spacing) var(--content-spacing); } } diff --git a/doc/theme/src/ThemeContext.tsx b/doc/theme/src/ThemeContext.tsx index b3314cd7..23cffb64 100644 --- a/doc/theme/src/ThemeContext.tsx +++ b/doc/theme/src/ThemeContext.tsx @@ -1,11 +1,4 @@ -import { - DefaultTheme, - DefaultThemeRenderContext, - JSX, - Options, - PageEvent, - Reflection, -} from "typedoc"; +import { DefaultTheme, DefaultThemeRenderContext, JSX, Options, PageEvent, Reflection } from "typedoc"; import * as templates from "./templates"; function bind(fn: (f: F, ...a: L) => R, first: F) { @@ -13,11 +6,7 @@ function bind(fn: (f: F, ...a: L) => R, first: F) { } export class ThemeContext extends DefaultThemeRenderContext { - constructor( - theme: DefaultTheme, - page: PageEvent, - options: Options - ) { + constructor(theme: DefaultTheme, page: PageEvent, options: Options) { super(theme, page, options); this.init(); } diff --git a/doc/theme/src/index.tsx b/doc/theme/src/index.tsx index a7916ebf..b96ac3e6 100644 --- a/doc/theme/src/index.tsx +++ b/doc/theme/src/index.tsx @@ -27,10 +27,7 @@ export function load(app: Application) { app.renderer.hooks.on("head.end", (event) => ( <> - + )); } @@ -40,9 +37,7 @@ export function copySync(src: string, dest: string): void { if (stat.isDirectory()) { const contained = fs.readdirSync(src); - contained.forEach((file) => - copySync(path.join(src, file), path.join(dest, file)) - ); + contained.forEach((file) => copySync(path.join(src, file), path.join(dest, file))); } else if (stat.isFile()) { fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(src, dest); diff --git a/doc/theme/src/templates/footer.tsx b/doc/theme/src/templates/footer.tsx index c372c769..8d716d82 100644 --- a/doc/theme/src/templates/footer.tsx +++ b/doc/theme/src/templates/footer.tsx @@ -1,9 +1,6 @@ import { DefaultThemeRenderContext, JSX, PageEvent, Reflection } from "typedoc"; -export const footer = ( - context: DefaultThemeRenderContext, - props: PageEvent -) => ( +export const footer = (context: DefaultThemeRenderContext, props: PageEvent) => (