Skip to content

Commit

Permalink
feat!: use latest telescope setup for api (#91)
Browse files Browse the repository at this point in the history
* fix: use ts-node for codegen

* feat!: use latest telescope setup and update api-demo

* chore: add files

* chore: untrack dist

* chore: rm homepage

* docs: add api readme

* update: eslintignore

* fix: lint

* chore: mv lint cmd
  • Loading branch information
blushi authored Oct 15, 2024
1 parent 02de097 commit 8d42b49
Show file tree
Hide file tree
Showing 625 changed files with 5,799 additions and 116,035 deletions.
7 changes: 2 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.eslintrc.js

**/build/*
**/codegen/*

/packages/api/main
/packages/api/module
/packages/api/dist
/packages/api/src
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ node_modules/
.env.development.local
.env.test.local
.env.production.local

# Build
packages/api/dist/
26 changes: 18 additions & 8 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
{
"lerna": "6",
"conventionalCommits": true,
"npmClient": "yarn",
"npmClientArgs": [
"--no-lockfile"
],
"packages": [
"packages/*"
],
"version": "independent",
"registry": "https://registry.npmjs.org",
"command": {
"version": {
"message": "chore(release): Publish %s"
}
"message": "chore(release): publish"
},
"publish": {
"allowBranch": "main",
"message": "chore(release): publish"
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
"version": "0.6.0"
"useWorkspaces": true
}
83 changes: 52 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
{
"name": "regen-js",
"version": "1.0.0-alpha5",
"author": "admin@regen.network",
"description": "Regen Network does JavaScript",
"license": "Apache-2.0",
"private": true,
"repository": "https://github.com/regen-network/regen-js",
"workspaces": [
"packages/*"
],
"scripts": {
"name": "regen-js",
"version": "1.0.0-alpha5",
"author": "admin@regen.network",
"description": "Regen Network does JavaScript",
"license": "Apache-2.0",
"private": true,
"repository": "https://github.com/regen-network/regen-js",
"workspaces": [
"packages/*"
],
"publishConfig": {
"access": "restricted"
},
"scripts": {
"clean": "lerna run clean",
"build:api": "yarn workspace @regen-network/api build",
"build": "lerna run build --stream",
"format": "yarn lint --fix",
"build": "lerna run build --stream",
"lerna:deploy": "yarn build && lerna version --conventional-commits && lerna publish from-git",
"lint": "eslint --ext js,ts,tsx .",
"lint": "eslint --ext js,ts,tsx .",
"test": "lerna run test --stream --scope @regen-network/api",
"codegen": "lerna run codegen --stream --scope @regen-network/api",
"start": "yarn workspace @regen-network/api-demo start",
"test": "lerna run test"
},
"devDependencies": {
"@types/jest": "27.0.3",
"@types/jest-expect-message": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"@typescript-eslint/typescript-estree": "^5.37.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest-expect-message": "^1.1.3",
"lerna": "^3.22.1",
"prettier": "2.4.1",
"ts-jest": "^26.4.4",
"typescript": "^4.0.5"
}
"symlink": "symlink-workspace --logLevel error",
"postinstall": "yarn symlink"
},
"devDependencies": {
"@protobufs/amino": "^0.0.11",
"@protobufs/cosmos": "^0.1.0",
"@protobufs/cosmos_proto": "^0.0.10",
"@protobufs/cosmwasm": "^0.1.1",
"@protobufs/gogoproto": "^0.0.10",
"@protobufs/google": "^0.0.10",
"@protobufs/ibc": "^0.1.0",
"@protobufs/regen": "^0.1.0",
"@protobufs/tendermint": "^0.0.10",
"@types/jest": "^29.5.11",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"copyfiles": "^2.4.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-unused-imports": "^4.0.0",
"jest": "^29.6.2",
"lerna": "^6",
"prettier": "^3.0.2",
"rimraf": "4.4.1",
"strip-ansi": "^5",
"symlink-workspace": "^1.1.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.1.6"
}
}
2 changes: 1 addition & 1 deletion packages/api-demo/src/MyBalance.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryAllBalancesResponseSDKType } from '@regen-network/api/types/codegen/cosmos/bank/v1beta1/query';
import { QueryAllBalancesResponseSDKType } from '@regen-network/api/cosmos/bank/v1beta1/query';
import React, { useState } from 'react';

export function MyBalance({ client }: { client: any }): React.ReactElement {
Expand Down
4 changes: 2 additions & 2 deletions packages/api-demo/src/examples/LCDCosmos.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';

import { cosmos } from '@regen-network/api';
import { QueryAllBalancesResponseSDKType } from '@regen-network/api/types/codegen/cosmos/bank/v1beta1/query';
import { PageRequest } from '@regen-network/api/types/codegen/helpers';
import { QueryAllBalancesResponseSDKType } from '@regen-network/api/cosmos/bank/v1beta1/query';
import { PageRequest } from '@regen-network/api/helpers';

export function LCDCosmos(): React.ReactElement {
const [result, setResult] = useState<
Expand Down
4 changes: 2 additions & 2 deletions packages/api-demo/src/examples/LCDRegen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';

import { regen } from '@regen-network/api';
import { QueryProjectsByClassResponseSDKType } from '@regen-network/api/types/codegen/regen/ecocredit/v1/query';
import { PageRequest } from '@regen-network/api/types/codegen/helpers';
import { QueryProjectsByClassResponseSDKType } from '@regen-network/api/regen/ecocredit/v1/query';
import { PageRequest } from '@regen-network/api/helpers';

export function LCDRegen(): React.ReactElement {
const [result, setResult] = useState<
Expand Down
13 changes: 6 additions & 7 deletions packages/api-demo/src/examples/RPCCosmos.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Long from 'long';
import React, { useEffect, useState } from 'react';

import { cosmos } from '@regen-network/api';
import { QueryAllBalancesResponse } from '@regen-network/api/types/codegen/cosmos/bank/v1beta1/query';
import { PageRequest } from '@regen-network/api/types/codegen/helpers';
import { QueryAllBalancesResponse } from '@regen-network/api/cosmos/bank/v1beta1/query';
import { PageRequest } from '@regen-network/api/helpers';

export function RPCCosmos(): React.ReactElement {
const [result, setResult] = useState<QueryAllBalancesResponse | undefined>(
Expand All @@ -24,8 +23,8 @@ export function RPCCosmos(): React.ReactElement {
address: 'regen1df675r9vnf7pdedn4sf26svdsem3ugavgxmy46',
pagination: {
key: new Uint8Array(0),
limit: Long.fromNumber(0),
offset: Long.fromNumber(0),
limit: BigInt(0),
offset: BigInt(0),
} as PageRequest,
})
.then(setResult)
Expand All @@ -38,10 +37,10 @@ export function RPCCosmos(): React.ReactElement {
return (
<div>
<h3>{'RPC Queries > cosmos bank balances'}</h3>
{'Response: '}
{'Balances: '}
<code>
{result ? (
JSON.stringify(result)
JSON.stringify(result.balances)
) : error ? (
<span>{error.message}</span>
) : (
Expand Down
9 changes: 4 additions & 5 deletions packages/api-demo/src/examples/RPCRegen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Long from 'long';
import React, { useEffect, useState } from 'react';

import { regen } from '@regen-network/api';
import { QueryProjectsByClassResponse } from '@regen-network/api/types/codegen/regen/ecocredit/v1/query';
import { PageRequest } from '@regen-network/api/types/codegen/helpers';
import { QueryProjectsByClassResponse } from '@regen-network/api/regen/ecocredit/v1/query';
import { PageRequest } from '@regen-network/api/helpers';

export function RPCRegen(): React.ReactElement {
const [result, setResult] = useState<
Expand All @@ -24,8 +23,8 @@ export function RPCRegen(): React.ReactElement {
classId: 'C01',
pagination: {
key: new Uint8Array(0),
limit: Long.fromNumber(0),
offset: Long.fromNumber(0),
limit: BigInt(0),
offset: BigInt(0),
} as PageRequest,
})
.then(setResult)
Expand Down
2 changes: 1 addition & 1 deletion packages/api-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"lib": [
"dom",
"dom.iterable",
Expand All @@ -17,7 +18,6 @@
"isolatedModules": true,
"noEmit": true,
"target": "es6",
"sourceMap": true,
},
"extends": "../../tsconfig",
"include": [
Expand Down
17 changes: 0 additions & 17 deletions packages/api/.babelrc.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/api/.eslintrc.js

This file was deleted.

17 changes: 0 additions & 17 deletions packages/api/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions packages/api/.npmignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/api/.npmrc

This file was deleted.

Loading

0 comments on commit 8d42b49

Please sign in to comment.