Skip to content

Commit 62f8694

Browse files
authored
Merge pull request #205 from mlabs-haskell/jared/ts-milestone
TS milestone documentation
2 parents 56935e5 + 35ba9ad commit 62f8694

File tree

12 files changed

+491
-43
lines changed

12 files changed

+491
-43
lines changed

docs/catalyst-reports.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ finished Catalyst projects here:
1010
- [Milestone 4: Project adoption](catalyst09-reports/milestone-3.md)
1111
- [Catalyst 10 reports](catalyst10-reports)
1212
- [Milestone 1: Rust support](catalyst10-reports/milestone-1.md)
13+
- [Milestone 2: Javascript/Typescript support](catalyst10-reports/milestone-2.md)

docs/catalyst10-reports/milestone-1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- [x] LambdaBuffers schemas that are based on the LambdaBuffers Prelude module can be used in Rust projects to specify application types.
2828
- Test libraries for Prelude demonstrate how Rust code for LambdaBuffers Prelude is generated to Rust and used in a library: [testsuites/lbt-prelude/lbt-prelude-rust](https://github.com/mlabs-haskell/lambda-buffers/tree/c83cdf9b881a95b8607821027c3551ecd56c9447/testsuites/lbt-prelude/lbt-prelude-rust)
2929
- [x] LambdaBuffers schemas that are based on the LambdaBuffers Plutus module can be used in Rust projects to specify application types.
30-
- Test libraries for Prelude demonstrate how Rust code for LambdaBuffers Plutus is generated to Rust and used in a library: [testsuites/lbt-plutus/lbt-plutus-rust](https://github.com/mlabs-haskell/lambda-buffers/tree/c83cdf9b881a95b8607821027c3551ecd56c9447/testsuites/lbt-plutus/lbt-plutus-rust)
30+
- Test libraries for Plutus demonstrate how Rust code for LambdaBuffers Plutus is generated to Rust and used in a library: [testsuites/lbt-plutus/lbt-plutus-rust](https://github.com/mlabs-haskell/lambda-buffers/tree/c83cdf9b881a95b8607821027c3551ecd56c9447/testsuites/lbt-plutus/lbt-plutus-rust)
3131
- [x] The documentation and devops tooling is available to facilitate easy adoption.
3232
- Similarly to other languages supported by LambdaBuffers, a Rust flake is implemented. The testing libraries also serve as an example, to understand how to use these Nix utilities:
3333
[testsuites/lbt-plutus/lbt-plutus-rust/build.nix](https://github.com/mlabs-haskell/lambda-buffers/tree/c83cdf9b881a95b8607821027c3551ecd56c9447/testsuites/lbt-plutus/lbt-plutus-rust/build.nix)
Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,72 @@
1-
# Catalyst milestone 2: Javascript support
1+
# Catalyst milestone 2: Javascript/Typescript support
2+
3+
While the milestone technically requires Javascript support, we implemented [Typescript](https://www.typescriptlang.org/) support which is a [typed superset of Javascript](https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html#a-typed-superset-of-javascript). This was done to better interpolate with existing Javascript/Typescript libraries on Cardano such as [lucid](https://github.com/spacebudz/lucid), [cardano-js-sdk](https://github.com/input-output-hk/cardano-js-sdk), [cardano-serialization-lib](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-nodejs), etc. With Typescript support, we get Javascript support for free as the compilation from Typescript to Javascript is a well established practise.
24

35
## Outputs
46

5-
- [ ] A LambdaBuffers code generation module that outputs type constructors and derived implementations in the Javascript programming language given a LambdaBuffers schema.
6-
- [ ] A Javascript library that implements the LambdaBuffers Prelude runtime. This module would include standardised JSON encoding and equality implementations for all declared type class instances in the schema.
7-
- [ ] A Javascript test suite that assures the manually implemented and automatically generated implementations are consistent with the predefined LambdaBuffers Prelude golden data set of JSON files and perform correct implementation derivation.
8-
- [ ] A Javascript library that implements the LambdaBuffers Plutus runtime. This module would include standardised PlutusData encoding implementations for all declared type class instances in the Plutus schema.
9-
- [ ] A Javascript test suite that assures the manually implemented and automatically generated implementations are consistent with the predefined LambdaBuffers Plutus golden data set of PlutusData encoded files and perform correct implementation derivation.
10-
- [ ] Nix devops modules (Nix API) for streamlining the LambdaBuffers code generation pipeline to Javascript.
11-
- [ ] Documentation on LambdaBuffers usage patterns for Javascript.
7+
- [x] A LambdaBuffers code generation module that outputs type constructors and derived implementations in the Javascript programming language given a LambdaBuffers schema.
8+
- The module implementation is in [lambda-buffers-codegen/src/LambdaBuffers/Codegen/Typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/2e2ed98f4df7f207ec3cf131adf5b47b202e248f/lambda-buffers-codegen/src/LambdaBuffers/Codegen/Typescript).
129

13-
## Acceptance Criteria
10+
- [x] A Javascript library that implements the LambdaBuffers Prelude runtime.
11+
This module would include standardised JSON encoding and equality
12+
implementations for all declared type class instances in the schema.
13+
- A standalone Prelude library for Typescript was implemented together with
14+
its runtime for LambdaBuffers. These can be found here:
15+
- [prelude-typescript](https://github.com/mlabs-haskell/prelude-typescript)
16+
- [runtimes/typescript/lbr-prelude](https://github.com/mlabs-haskell/lambda-buffers/tree/343a1a900f42dcf5b1c1a7e330eafb07c280908b/runtimes/typescript/lbr-prelude)
1417

15-
- [ ] LambdaBuffers schemas that are based on the LambdaBuffers Prelude module can be used in Javascript projects to specify application types.
16-
- [ ] LambdaBuffers schemas that are based on the LambdaBuffers Plutus module can be used in Javascript projects to specify application types.
17-
- [ ] The documentation and devops tooling is available to facilitate easy adoption.
18+
- [x] A Javascript test suite that assures the manually implemented and automatically generated implementations are consistent with the predefined LambdaBuffers Prelude golden data set of JSON files and perform correct implementation derivation.
19+
- A test suite ensuring that the manually implemented and automatically generated implementations can be found here: [testsuites/lbt-prelude/lbt-prelude-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-prelude/lbt-prelude-typescript).
20+
- [x] A Javascript library that implements the LambdaBuffers Plutus runtime. This module would include standardised PlutusData encoding implementations for all declared type class instances in the Plutus schema.
21+
- A standalone Plutus library for Typescript was implemented together with
22+
its runtime for LambdaBuffers. These can be found here:
1823

19-
## Evidence of Milestone Completion
24+
- [plutus-ledger-api-typescript](https://github.com/mlabs-haskell/plutus-ledger-api-typescript)
2025

21-
- [ ] The completed and reviewed LambdaBuffers Prelude runtime library is available for the Javascript programming language.
22-
- [ ] The completed and reviewed LambdaBuffers Plutus runtime library is available for the Javascript programming language.
23-
- [ ] The completed and reviewed LambdaBuffers Prelude test suite is available and is passing in CI for the Javascript programming language.
24-
- [ ] The completed and reviewed LambdaBuffers Plutus test suite is available and is passing in CI for the Javascript programming language.
25-
- [ ] The completed and reviewed Nix API for LambdaBuffers Javascript support is available.
26-
- [ ] The completed and reviewed LambdaBuffers for Javascript documentation is available.
26+
- [runtimes/typescript/lbr-plutus](https://github.com/mlabs-haskell/lambda-buffers/tree/dc5ee6797d1230661d6bb3dfa658eddeadd7cb60/runtimes/typescript/lbr-plutus)
2727

28-
## Demo recordings
28+
- [x] A Javascript test suite that assures the manually implemented and automatically generated implementations are consistent with the predefined LambdaBuffers Plutus golden data set of PlutusData encoded files and perform correct implementation derivation.
29+
- A test suite ensuring that the manually implemented and automatically generated implementations can be found here: [testsuites/lbf-plutus/lbf-plutus-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-plutus/lbt-plutus-typescript)
30+
- [x] Nix devops modules (Nix API) for streamlining the LambdaBuffers code generation pipeline to Javascript.
31+
- New flake modules were implemented to easily generate NPM packages from LambdaBuffers
32+
- [lbf-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-typescript.nix)
33+
- [lbf-prelude-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-prelude-typescript.nix)
34+
- [lbf-plutus-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-plutus-typescript.nix)
35+
- [x] Documentation on LambdaBuffers usage patterns for Javascript.
36+
- [A new page was created for the TypeScript use case](https://mlabs-haskell.github.io/lambda-buffers/typescript.html)
2937

30-
- [ ]
38+
## Acceptance Criteria
39+
40+
- [x] LambdaBuffers schemas that are based on the LambdaBuffers Prelude module can be used in Javascript projects to specify application types.
41+
- Test libraries for Prelude demonstrate how TypeScript code for the LambdaBuffers Prelude is generated to TypeScript and used in a library: [testsuites/lbt-prelude/lbt-prelude-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-prelude/lbt-prelude-typescript)
42+
- Moreover, there is a [docs/typescript-prelude](https://github.com/mlabs-haskell/lambda-buffers/tree/1d806a1710aab625ea520c596a72338c5bde578d/docs/typescript-prelude) sample project which also demonstrates this.
43+
- [x] LambdaBuffers schemas that are based on the LambdaBuffers Plutus module can be used in Javascript projects to specify application types.
44+
- Test libraries for Plutus demonstrate how TypeScript code for the LambdaBuffers Prelude is generated to TypeScript and used in a library: [testsuites/lbt-plutus/lbt-plutus-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-plutus/lbt-plutus-typescript)
45+
- Moreover, there is a [docs/typescript-plutus](https://github.com/mlabs-haskell/lambda-buffers/tree/1d806a1710aab625ea520c596a72338c5bde578d/docs/typescript-plutus) sample project which also demonstrates this.
46+
- [x] The documentation and devops tooling is available to facilitate easy adoption.
47+
- Similarly to other languages supported by LambdaBuffers, a [TypeScript flake](https://github.com/mlabs-haskell/flake-lang.nix/tree/5bb4fdf556a2f2f23717c654c186f13f28b9c277/flake-lang/typescript) is implemented along with its documentation.
48+
The testing libraries also serve as an example, to understand how to use these Nix utilities:
49+
[testsuites/lbt-plutus/lbt-plutus-typescript/build.nix](https://github.com/mlabs-haskell/lambda-buffers/blob/4c6304cf3a3a0c08bbb46e94532a293fdea513e9/testsuites/lbt-plutus/lbt-plutus-typescript/build.nix).
3150

32-
Demo files:
51+
## Evidence of Milestone Completion
3352

34-
- [ ]
53+
- [x] The completed and reviewed LambdaBuffers Prelude runtime library is available for the Javascript programming language.
54+
- [runtimes/typescript/lbr-prelude](https://github.com/mlabs-haskell/lambda-buffers/tree/343a1a900f42dcf5b1c1a7e330eafb07c280908b/runtimes/typescript/lbr-prelude)
55+
- [prelude-typescript](https://github.com/mlabs-haskell/prelude-typescript)
56+
- [x] The completed and reviewed LambdaBuffers Plutus runtime library is available for the Javascript programming language.
57+
- [runtimes/typescript/lbr-plutus](https://github.com/mlabs-haskell/lambda-buffers/tree/dc5ee6797d1230661d6bb3dfa658eddeadd7cb60/runtimes/typescript/lbr-plutus)
58+
- [plutus-ledger-api-typescript](https://github.com/mlabs-haskell/plutus-ledger-api-typescript)
59+
- [x] The completed and reviewed LambdaBuffers Prelude test suite is available and is passing in CI for the Javascript programming language.
60+
- [testsuites/lbt-prelude/lbt-prelude-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-prelude/lbt-prelude-typescript)
61+
- [x] The completed and reviewed LambdaBuffers Plutus test suite is available and is passing in CI for the Javascript programming language.
62+
- [testsuites/lbf-plutus/lbt-plutus-typescript](https://github.com/mlabs-haskell/lambda-buffers/tree/50bfbc4a182275d42be978b5a251530bab84f4aa/testsuites/lbt-plutus/lbt-plutus-typescript)
63+
- [x] The completed and reviewed Nix API for LambdaBuffers Javascript support is available.
64+
- [lbf-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-typescript.nix)
65+
- [lbf-prelude-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-prelude-typescript.nix)
66+
- [lbf-plutus-typescript](https://github.com/mlabs-haskell/lambda-buffers/blob/f59bdb78d06fa677567d053eddb3d1fe46250fd8/extras/lbf-nix/lbf-plutus-typescript.nix)
67+
- [x] The completed and reviewed LambdaBuffers for Javascript documentation is available.
68+
- [TypeScript documentation](google.com) TODO(jaredponn) put the commit here just before this when this is reviewed
3569

36-
## References
70+
## Demo files
3771

38-
- [ ]
72+
- Demo project: [lambda-buffers-for-cardano](https://github.com/mlabs-haskell/lambda-buffers-for-cardano/tree/main/transactions/demo-typescript)

0 commit comments

Comments
 (0)