Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Bug Report
description: Create a bug report
#title: ""
labels: ["bug"]
#assignees:
# -
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report.
Please check the existing issues before raising a bug.
- type: textarea
attributes:
label: Summary
description: A clear and specific description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce the bug
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
validations:
required: false
- type: textarea
attributes:
label: Actual Result
description: What is the reproducible outcome?
placeholder: provide your TX JSON if its related to transactions
validations:
required: true
- type: textarea
attributes:
label: Expected Result
description: A clear and concise description of what you expected to happen.
placeholder: No errors observed.
validations:
required: true
- type: input
attributes:
label: SDK version
description: Provide release or Git revision are you using here
placeholder: "0.2.0"
validations:
required: true
- type: checkboxes
attributes:
label: Environment type
description: You may select more than one.
options:
- label: Node.js
- label: Browser
- label: Browser Extension
- label: Other
- type: textarea
attributes:
label: Environment details
description: Provide details and versions of your environemnt
placeholder: |
Browser: Version 1.36.111 Chromium: 99.0.4844.51
Node.js: v14.15.0
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Documentation improvements
description: Suggest documentation improvements
#title: ""
labels: ["enhancement"]
#assignees:
# -
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request.
Please check the existing issues before submitting.
- type: textarea
id: description
attributes:
label: Describe the issue with the documentation
description: A clear and concise description of what the issue is.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Suggest a solution
description: Describe how the documentation can be improved or corrected.
validations:
required: false
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
- type: checkboxes
attributes:
label: Would you be willing to implement it?
options:
- label: "Yes, I will implement it."
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Feature Request
description: Submit a feature request
#title: ""
labels: ["enhancement"]
#assignees:
# -
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request.
Please check the existing issues before submitting.
- type: textarea
id: description
attributes:
label: Describe the feature you'd like
description: A clear and detailed description of what you are suggesting.
validations:
required: true
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: false
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
- type: checkboxes
attributes:
label: Would you be willing to implement it?
options:
- label: "Yes, I will implement it."
35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
> Thank you for contributing to Mesh! We appreciate your effort and dedication to improving this project. To ensure that your contribution is in line with the project's guidelines and can be reviewed efficiently, please fill out the template below.

> Remember to follow our [Contributing Guide](CONTRIBUTING.md) before submitting your pull request.

## Summary

> Please provide a brief, concise summary of the changes in your pull request. Explain the problem you are trying to solve and the solution you have implemented.

## Type of Change

> Please mark the relevant option(s) for your pull request:

- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Code refactoring (improving code quality without changing its behavior)
- [ ] Documentation update (adding or updating documentation related to the project)

## Related Issues

> Please add the related issue here if any

## Checklist

> Please ensure that your pull request meets the following criteria:

- [ ] My code is appropriately commented and includes relevant documentation, if necessary
- [ ] I have added tests to cover my changes, if necessary
- [ ] I have updated the documentation, if necessary
- [ ] All new and existing tests pass (i.e. `npm run test`)
- [ ] The build is pass (i.e. `npm run build`)

## Additional Information

> If you have any additional information or context to provide, such as screenshots, relevant issues, or other details, please include them here.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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

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

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build:mesh && npm run build:apps
132 changes: 132 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# 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: Publish MeshSDK Packages

on:
pull_request:
types:
- closed
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build:mesh && npm run build:apps

check-version:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
core-version-updated: ${{ steps.compare-versions.outputs.core-version-updated }}
react-version-updated: ${{ steps.compare-versions.outputs.react-version-updated }}
wallet-version-updated: ${{ steps.compare-versions.outputs.wallet-version-updated }}
steps:
- name: Checkout main branch at commit before merge
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}

- name: Get package version from main branch before merge
id: pre-merge-version
run: |
CORE_PRE_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-core/package.json').version")
REACT_PRE_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-react/package.json').version")
WALLET_PRE_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-wallet/package.json').version")

echo "core_pre_merge_version=$CORE_PRE_MERGE_VERSION" >> "$GITHUB_OUTPUT"
echo "react_pre_merge_version=$REACT_PRE_MERGE_VERSION" >> "$GITHUB_OUTPUT"
echo "wallet_pre_merge_version=$WALLET_PRE_MERGE_VERSION" >> "$GITHUB_OUTPUT"

- name: Checkout main branch at commit after merge
uses: actions/checkout@v4
with:
ref: "main"

- name: Get package version from main branch after merge
id: post-merge-version
run: |
CORE_POST_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-core/package.json').version")
REACT_POST_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-react/package.json').version")
WALLET_POST_MERGE_VERSION=$(node -p "require('./packages/mesh-midnight-wallet/package.json').version")
echo "core_post_merge_version=$CORE_POST_MERGE_VERSION" >> "$GITHUB_OUTPUT"
echo "react_post_merge_version=$REACT_POST_MERGE_VERSION" >> "$GITHUB_OUTPUT"
echo "wallet_post_merge_version=$WALLET_POST_MERGE_VERSION" >> "$GITHUB_OUTPUT"

- name: Compare versions
id: compare-versions
run: |
if [[ "${{ steps.pre-merge-version.outputs.core_pre_merge_version }}" != "${{ steps.post-merge-version.outputs.core_post_merge_version }}" ]]; then
echo "core-version-updated=true" >> "$GITHUB_OUTPUT"
else
echo "core-version-updated=false" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ steps.pre-merge-version.outputs.react_pre_merge_version }}" != "${{ steps.post-merge-version.outputs.react_post_merge_version }}" ]]; then
echo "react-version-updated=true" >> "$GITHUB_OUTPUT"
else
echo "react-version-updated=false" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ steps.pre-merge-version.outputs.wallet_pre_merge_version }}" != "${{ steps.post-merge-version.outputs.wallet_post_merge_version }}" ]]; then
echo "wallet-version-updated=true" >> "$GITHUB_OUTPUT"
else
echo "wallet-version-updated=false" >> "$GITHUB_OUTPUT"
fi


publish-meshsdk-core:
needs: [build, check-version]
if: needs.check-version.outputs.core-version-updated == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install && npm run build
- run: cd packages/mesh-midnight-core && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-meshsdk-react:
needs: [build, check-version]
if: needs.check-version.outputs.react-version-updated == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install && npm run build
- run: cd packages/mesh-midnight-react && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-meshsdk-wallet:
needs: [build, check-version]
if: needs.check-version.outputs.wallet-version-updated == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install && npm run build
- run: cd packages/mesh-midnight-wallet && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ yarn-error.log*

.DS_Store
Thumbs.db

yarn.lock
.yarn/*
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Mesh Midnight provides tools, documentations, and education materials to remove

[midnight.meshjs.dev](https://midnight.meshjs.dev/)

# When creating a new folder with React
rm -rf node_modules package-lock.json
# Buil the workspace
npm run clean
npm install

# Buil the package
npm run prepack:packages
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.0.0",
"scripts": {
"dev": "next dev",
"build": "next build"
"build:apps": "next build"
},
"dependencies": {
"next": "^14.1.1",
Expand Down
7 changes: 4 additions & 3 deletions example-workspaces/next-pages-150107/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"clean": "rm -rf node_modules package-lock.json .next"
},
"dependencies": {
"@meshsdk/midnight-react": "*",
"dependencies": {
"@meshsdk/midnight-react": "0.1.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.484.0",
Expand Down
Loading