Skip to content

Commit

Permalink
Update bos-cli package and setup (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 authored Jan 31, 2024
1 parent 4cb25bd commit bea12c4
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 1,601 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*.{json,js,jsx,ts,tsx}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/package-lock.json linguist-generated=true -diff
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI
on:
pull_request:
push:
branches:
- main

jobs:
sanity_checks:
name: Sanity Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run code formatting check
run: npm run fmt:check
- name: Run linting
run: npm run lint
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build/
node_modules/
.env
node_modules
.bos
yarn.lock
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import ts from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

const myRules = {
// https://eslint.org/docs/latest/rules/max-len
// Temporary rule to see if eslint will work:
//'max-len': ['warn', { code: 3, ignoreComments: false, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true }],
};

export default [
{
rules: myRules,
},
{
ignores: [".bos/*"],
},
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'",
"fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'",
"lint": "tsc --pretty --noEmit && eslint .",
"dev": "~/.cargo/bin/bos-loader devhub.near --path src",
"dev": "~/.cargo/bin/bos-loader dashboard.treasury-devdao.near --path ./.bos/transpiled/src",
"build": "npm run fmt && rimraf .bos/transpiled && mkdir -p .bos/transpiled/src && sucrase ./src -d .bos/transpiled/src/npm_package_name --transforms typescript,jsx --jsx-runtime preserve --disable-es-transforms --out-extension jsx && node ./build.js",
"deploy": "npm run build && cd .bos/transpiled && bos components deploy",
"prepare": "husky install"
Expand All @@ -41,20 +41,20 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/NEAR-DevHub/neardevhub-trustees-dashboard-bos"
"url": "git+https://github.com/NEAR-DevHub/neardevhub-treasury-dashboard.git"
},
"keywords": [
"near",
"nearprotocol",
"bos",
"blockchains",
"typescript",
"trustees"
"starter"
],
"author": "devhub.near",
"license": "MIT",
"bugs": {
"url": "https://github.com/NEAR-DevHub/neardevhub-trustees-dashboard-bos"
"url": "https://github.com/NEAR-DevHub/neardevhub-treasury-dashboard.git"
},
"homepage": "https://github.com/NEAR-DevHub/neardevhub-trustees-dashboard-bos#readme"
"homepage": "https://github.com/NEAR-DevHub/neardevhub-treasury-dashboard.git#readme"
}
15 changes: 14 additions & 1 deletion src/components/pages/homepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ export default function (props: Props, context: BosContext) {
return (
<>
<h1>
</h1>
{props.customWelcomeMessage ??
"Welcome to the home page of the first TypeScript BOS component"}
, {context.accountId ?? "anonymous user"}
</h1>
<p>
Learn more at{" "}
<a href="https://github.com/frol/neardevhub-trustees-dashboard-bos">
BOS Component TypeScript Starter repo
</a>
</p>
<Widget
src="frol.near/widget/neardevhub-trustees-dashboard-bos.components.subfolder.my-nested-component"
props={{ color: "green" }}
/>
</>
);
}
Loading

0 comments on commit bea12c4

Please sign in to comment.