-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: make
@ckb-lumos/lumos
more convenient (#588)
- Loading branch information
Showing
55 changed files
with
626 additions
and
1,439 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,5 @@ | ||
--- | ||
"@ckb-lumos/lumos": minor | ||
--- | ||
|
||
BREAKING CHANGE: refine the export structure |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
# Devtools | ||
|
||
## Mock Publication | ||
|
||
If the release workflow is changed, it is important to test the new workflow. This can be done by publishing to a local registry. The following steps will setup a local registry and configure npm to use it. | ||
|
||
```sh | ||
npm install -g verdaccio | ||
verdaccio --config ./devtools/verdaccio.yaml --listen=4873 | ||
npm config set registry http://localhost:4873 | ||
npm config set //localhost:4873/:_authToken fake | ||
``` | ||
|
||
To test the release workflow on GitHub, the following step can be added to the workflow file. | ||
|
||
```yaml | ||
# TODO remove me when ready | ||
- name: Release to Verdaccio | ||
run: | | ||
npm install -g verdaccio | ||
npm config set registry http://localhost:4873 | ||
npm config set //localhost:4873/:_authToken fake | ||
nohup verdaccio --config ./devtools/verdaccio.yaml --listen=4873 >/dev/null 2>&1 & | ||
``` |
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import { blockchain } from "@ckb-lumos/base"; | ||
import { molecule } from "@ckb-lumos/codec"; | ||
import { blockchain, table } from "@ckb-lumos/lumos/codec"; | ||
|
||
const { Byte32, Bytes } = blockchain; | ||
const Byte64 = blockchain.createFixedHexBytesCodec(64); | ||
|
||
export const CardanoWitnessLock = molecule.table( | ||
export const CardanoWitnessLock = table( | ||
{ | ||
pubkey: Byte32, | ||
pubkey: blockchain.Byte32, | ||
signature: Byte64, | ||
sig_structure: Bytes, | ||
sig_structure: blockchain.Bytes, | ||
}, | ||
["pubkey", "signature", "sig_structure"] | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This example shows how to create a codec for UTF-8 strings. | ||
|
||
import { createBytesCodec } from "@ckb-lumos/lumos/codec"; | ||
|
||
const stringCodec = createBytesCodec<string>({ | ||
pack: (str) => new TextEncoder().encode(str), | ||
unpack: (bytes) => new TextDecoder().decode(bytes), | ||
}); | ||
|
||
const encoded = stringCodec.pack("hello world"); | ||
const decoded = stringCodec.unpack(encoded); | ||
|
||
console.log("encoded:", encoded); | ||
console.log("decoded:", decoded); |
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.
00c3035
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 New canary release:
0.0.0-canary-00c3035-20231220025235
00c3035
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
lumos-website – ./
lumos-website.vercel.app
lumos-website-git-develop-magickbase.vercel.app
lumos-website-magickbase.vercel.app