Skip to content

Commit

Permalink
Merge branch 'main' into aiken-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Apr 5, 2024
2 parents 5623ef2 + e3c8ef0 commit f687eaf
Show file tree
Hide file tree
Showing 128 changed files with 49,807 additions and 5,332 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Build and Lint

on:
release:
types: [created]
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn ci
41 changes: 41 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn ci

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: yarn ci
- run: |
if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then
echo "Skipping npm publish due to commit message."
else
cd packages/module && npm publish --access public
cd ../react && npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@ _local

# local testing on new features
localTest.tsx

tmp
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
yarn ci
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Explore the features on [Mesh Playground](https://meshjs.dev/).
- [Resolvers](https://meshjs.dev/apis/resolvers)

## Why use Mesh

- Start a new project with one of out [Starter Templates](https://meshjs.dev/starter-templates) with CLI command
- Always up to date - Vasil-ready, developed promptly as the network updates so your app always works
- Simple to use - Check out our [guides](https://meshjs.dev/guides) - you'll get started in less than 10 mins!
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
7 changes: 2 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
}
44 changes: 35 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,55 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"lerna": "lerna",
"ci": "yarn && yarn lint && yarn build:module && yarn build:react",
"bootstrap": "yarn install && yarn lerna bootstrap",
"start:cli": "lerna exec --scope create-mesh-dapp -- yarn dev",
"start:demo": "lerna exec --scope @meshsdk/playground -- yarn dev",
"start:contracts": "lerna exec --scope @meshsdk/contracts -- yarn dev",
"start:module": "lerna exec --scope @meshsdk/core -- yarn dev",
"start:react": "lerna exec --scope @meshsdk/react -- yarn dev",
"build": "lerna link && yarn build:module && yarn build:react && yarn build:contracts && yarn build:demo",
"start:docs": "lerna exec --scope @meshsdk/docs -- yarn dev",
"build": "yarn build:module && yarn build:react && yarn build:contracts && yarn build:demo",
"build:cli": "lerna exec --scope create-mesh-dapp -- yarn build",
"build:demo": "lerna exec --scope @meshsdk/playground -- yarn build",
"build:contracts": "lerna exec --scope @meshsdk/contracts -- yarn build",
"build:module": "lerna exec --scope @meshsdk/core -- yarn build",
"build:react": "lerna exec --scope @meshsdk/react -- yarn build"
"build:react": "lerna exec --scope @meshsdk/react -- yarn build",
"build:docs": "lerna exec --scope @meshsdk/core -- yarn docs",
"prepare": "husky install",
"lint:docs": "lerna exec --scope @meshsdk/docs \"yarn eslint --fix\"",
"lint:demo": "lerna exec --scope @meshsdk/playground \"yarn eslint --fix\"",
"lint:module": "lerna exec --scope @meshsdk/core \"yarn eslint --fix\"",
"lint": "yarn lint:module && yarn lint:demo && yarn lint:docs"
},
"devDependencies": {
"@types/jest": "28.1.6",
"@types/node": "18.6.1",
"@types/react": "18.0.10",
"@types/react-dom": "18.0.5",
"eslint": "8.16.0",
"lerna": "5.3.0",
"typescript": "4.8.2"
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"eslint": "8.39.0",
"lerna": "^8.1.2",
"typescript": "4.8.2",
"husky": "^9.0.11",
"@commitlint/cli": "^17.4.3",
"@commitlint/config-conventional": "^17.4.3",
"commitlint": "^17.4.3",
"prettier": "^2.8.8",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1"
},
"workspaces": [
"packages/*"
]
}
],
"lint-staged": {
"**/*.{js,ts,}": [
"yarn prettier --write"
]
}
}
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"vitest": "0.28.4"
},
"peerDependencies": {
"@meshsdk/core": "*"
"@meshsdk/core": "1.5.11-beta.7"
},
"dependencies": {
"@harmoniclabs/plu-ts": "0.2.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Section from '../../../../common/section';
import Codeblock from '../../../../ui/codeblock';

export default function DeregisterCertificate() {
return (
<Section
sidebarTo="delegateStakeCertificate"
header="Delegate Stake to a Pool"
contentFn={Content()}
/>
);
}

function Content() {
let code = `mesh
.delegateStakeCertificate(stakeKeyHash: string, poolId: string)`;

return (
<>
<p>
Use <code>.delegateStakeCertificate()</code> to delegate a stake to a
pool:
</p>

<Codeblock data={code} isJson={false} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Section from '../../../../common/section';
import Codeblock from '../../../../ui/codeblock';

export default function DeregisterCertificate() {
return (
<Section
sidebarTo="deregisterCertificate"
header="Deregister Stake Certificate"
contentFn={Content()}
/>
);
}

function Content() {
let code = `mesh
.deregisterStakeCertificate(stakeKeyHash: string)`;

return (
<>
<p>
Use <code>.deregisterStakeCertificate()</code> to deregister a stake
certificate:
</p>

<Codeblock data={code} isJson={false} />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ export default function Mint() {

function Content() {
let code = `mesh
.mint(quantity: number, policy: string, name: string)
.mint(quantity: string, policy: string, name: string)
.mintingScript(scriptCbor: string)
`;

return (
<>
<h3>When minting tokens using a 'native script' as input, there are 2 steps:</h3>
<h3>
When minting tokens using a 'native script' as input, there are 2 steps:
</h3>
<h4>
1. Providing the minting value (quantity, policy and name) using <code>.mint()</code>
1. Providing the minting value (quantity, policy and name) using{' '}
<code>.mint()</code>
</h4>
<h4>
2. Providing the script source using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Mint() {
function Content() {
let code = `mesh
.mintPlutusScriptV2()
.mint(quantity: number, policy: string, name: string)
.mint(quantity: string, policy: string, name: string)
.mintTxInReference(txHash: string, txIndex: number) // or .mintingScript(scriptCbor: string)
.mintRedeemerValue(redeemer: Data | object | string, exUnits?: Budget, type?: "Mesh" | "CBOR" | "JSON")
`;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Section from '../../../../common/section';
import Codeblock from '../../../../ui/codeblock';

export default function RegisterCertificate() {
return (
<Section
sidebarTo="registerCertificate"
header="Register Stake Certificate"
contentFn={Content()}
/>
);
}

function Content() {
let code = `mesh
.registerStakeCertificate(stakeKeyHash: string)`;

return (
<>
<p>
Use <code>.registerStakeCertificate()</code> to register a stake
certificate:
</p>

<Codeblock data={code} isJson={false} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Section from '../../../../common/section';
import Codeblock from '../../../../ui/codeblock';

export default function RegisterPoolCertificate() {
return (
<Section
sidebarTo="registerPoolCertificate"
header="Register Pool Certificate"
contentFn={Content()}
/>
);
}

function Content() {
let code = `mesh
.registerPoolCertificate(poolParams: PoolParams)`;

return (
<>
<p>
Use <code>.registerPoolCertificate()</code> to register a pool
certificate:
</p>

<Codeblock data={code} isJson={false} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Section from '../../../../common/section';
import Codeblock from '../../../../ui/codeblock';

export default function RetirePoolCertificate() {
return (
<Section
sidebarTo="retirePoolCertificate"
header="Retire Pool Certificate"
contentFn={Content()}
/>
);
}

function Content() {
let code = `mesh
.retirePoolCertificate(poolId: string, epoch: number)`;

return (
<>
<p>
Use <code>.retirePoolCertificate()</code> to retire a pool certificate:
</p>

<Codeblock data={code} isJson={false} />
</>
);
}
Loading

0 comments on commit f687eaf

Please sign in to comment.