Skip to content

Commit 851d3ed

Browse files
authored
Merge branch 'master' into evgenii/inlined-wasm
2 parents e7a5d12 + 37e8a14 commit 851d3ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+20646
-2010
lines changed

.github/workflows/sonarqube.yml renamed to .github/workflows/_sonarqube.yml_

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
fetch-depth: 0
2222
- name: SonarQube Scan
2323
uses: sonarsource/[email protected]
24+
with:
25+
projectBaseDir: "rust"
2426
env:
2527
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2628
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

example/.eslintrc.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

example/.gitignore

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1-
node_modules/
2-
dist/
3-
tsconfig.tsbuildinfo
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

example/.mocharc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

example/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.14.0

example/.prettierignore

Whitespace-only changes.

example/.prettierrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 120,
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"parser": "typescript",
7+
"semi": true,
8+
"singleQuote": true,
9+
"bracketSpacing": true,
10+
"arrowParens": "always",
11+
"importOrder": ["^@(.*)$", "^[./]" ],
12+
"importOrderSeparation": true,
13+
"importOrderSortSpecifiers": true
14+
}

example/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Example how to use the Cardano Serialization Lib
2+
3+
The example includes the dApp with four basic operations:
4+
5+
* Creating a simple transaction
6+
* Registering a wallet staking public key
7+
* Unregistering a wallet staking key
8+
* Vote delegation
9+
10+
## Structure
11+
12+
Everything related to the user interface (UI) is located in the folder `./src/components-ui`.
13+
14+
The logic behind each operation is found in the folder `./src/components-logic` which has the same name.
15+
16+
Commonly used functions are placed in the file `./src/componets-logic/core.ts`.
17+
18+
### Example
19+
20+
Let's take a look at the file `TransactionCreator.tsx`.
21+
22+
It contains only UI and it is located in the folder `./src/components-ui`.
23+
24+
All logic related to this file is placed in the file `TransactionCreator.ts`, which is located in the `./src/components-logic` folder.
25+
26+
## Installation and running
27+
28+
### Instalation
29+
30+
To install the app, go to the `./example` folder. If you're reading this, you're already here.
31+
32+
Run the commands `nvm use` and then `npm install --force`.
33+
34+
That's it! The app is now ready to launch.
35+
36+
### Running
37+
38+
To start the app, simply run the command `npm start`.
39+
40+
## Conclusion
41+
42+
This is a simple and not very attractive app, but it does what it should: show you how to work with the Cardano Serialization Lib.

example/craco.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
webpack: {
3+
configure: (config) => {
4+
const wasmExtensionRegExp = /\.wasm$/
5+
config.resolve.extensions.push('.wasm')
6+
config.experiments = {
7+
...config.experiments,
8+
asyncWebAssembly: true,
9+
}
10+
11+
config.module.rules.forEach((rule) => {
12+
;(rule.oneOf || []).forEach((oneOf) => {
13+
if (oneOf.type === 'asset/resource') {
14+
oneOf.exclude.push(wasmExtensionRegExp)
15+
}
16+
})
17+
})
18+
19+
return config
20+
},
21+
},
22+
}

example/index.spec.ts

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)