Skip to content

Commit

Permalink
feat: staking extension and git submodules (#360)
Browse files Browse the repository at this point in the history
* feat: staking extension and git submodules

* fix: build

* fix: test build

* fix: build

* fix: test

* fix: save

* fix: submodule

* fix: fix

* fix: build

* fix: rem comment
  • Loading branch information
cgilbe27 authored Jun 24, 2024
1 parent f3dfa3a commit 4251709
Show file tree
Hide file tree
Showing 18 changed files with 331 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
]
],
"ignorePatterns": ["nibiru/*", "cosmos-sdk/*"]
}
11 changes: 1 addition & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
token: ${{ secrets.NIBIBOT_GIT_TOKEN }}

- name: Checkout nibiru Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
repository: NibiruChain/nibiru
ref: releases/v0.21.x
path: "nibiru"
token: ${{ secrets.NIBIBOT_GIT_TOKEN }}
submodules: true

- name: Setup NodeJS and npm
uses: actions/setup-node@v3
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/test-ts-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Checkout nibiru Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
repository: NibiruChain/nibiru
ref: main
path: "nibiru"
token: ${{ secrets.NIBIBOT_GIT_TOKEN }}
submodules: true

- name: Setup NodeJS with yarn caching
uses: actions/setup-node@v3
with:
node-version: "lts/hydrogen"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"

- name: yarn install
uses: borales/actions-yarn@v4
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ src/gql/utils/generated.ts
src/gql/utils/schema.graphql
dist
**/node_modules/*
nibiru/


reports
junit.xml
Expand Down Expand Up @@ -208,5 +206,3 @@ typings/
# End of https://www.gitignore.io/api/node,intellij+all,visualstudiocode
.yarn
.DS_Store

nibiru/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "cosmos-sdk"]
path = cosmos-sdk
url = https://github.com/cosmos/cosmos-sdk
[submodule "nibiru"]
path = nibiru
url = https://github.com/NibiruChain/nibiru
213 changes: 213 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/nibiru
/cosmos-sdk

# Rest of file is .gitignore

# Created by https://www.gitignore.io/api/node,intellij+all,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,intellij+all,visualstudiocode

docs/
src/protojs/
proto/
src/gql/utils/generated.ts
src/gql/utils/schema.graphql
dist
**/node_modules/*

reports
junit.xml
temp
.build-cache
.DS_STORE

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage*
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
**/node_modules/*

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/node,intellij+all,visualstudiocode
.yarn
.DS_Store
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,14 @@ console.log("perpPositions: %o", perpPositions)
yarn
```

4. Lastly, compile the code in each package.
4. Initialize git submodules

```sh
git submodule init
git submodule update
```

5. Lastly, compile the code in each package.

```sh
yarn build
Expand Down
1 change: 1 addition & 0 deletions cosmos-sdk
Submodule cosmos-sdk added at b48fd6
1 change: 1 addition & 0 deletions nibiru
Submodule nibiru added at 98c2b2
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
"lint-staged": {
"*.{js,ts}": [
"eslint --fix . --ignore-path .gitignore",
"prettier --write . --ignore-path .gitignore",
"prettier --write . --ignore-path .prettierignore",
"git add ."
],
"*.json": [
"prettier --write . --ignore-path .gitignore",
"prettier --write . --ignore-path .prettierignore",
"git add ."
]
},
Expand All @@ -117,5 +117,6 @@
"@commitlint/config-conventional"
]
},
"gitHead": "bac1729be8575a9e75bf9e04447a63c45e227c8c"
"gitHead": "bac1729be8575a9e75bf9e04447a63c45e227c8c",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
18 changes: 2 additions & 16 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
#!/bin/bash
set -e

# Test for ./nibiru/ directory
if [ -d "./nibiru/" ]; then
echo "The ./nibiru/ directory exists."
cd nibiru
git checkout main
cd ..
elif [ -d "../nibiru/" ]; then
cd ../nibiru
git checkout main
git pull
cd ../ts-sdk
else
cd ..
git clone [email protected]:NibiruChain/nibiru.git
cd ts-sdk
fi
git submodule init
git submodule update

yarn gql-generate & yarn proto-gen
yarn build:tsc
Expand Down
Loading

0 comments on commit 4251709

Please sign in to comment.