From 6023a47595e6acb1f421428ef361ba8b41ba50f9 Mon Sep 17 00:00:00 2001 From: ALPAC-4 <81249838+ALPAC-4@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:17:53 +0900 Subject: [PATCH] feat: add readme (#31) --- .../workflows/npm_publish_initia_registry.yml | 8 +++--- _packages/initia-registry/README.md | 20 ++++++++++++++ _packages/initia-registry/package.json | 2 +- _packages/types/README.md | 26 +++++++++++++++++++ _packages/types/package.json | 2 +- 5 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 _packages/initia-registry/README.md create mode 100644 _packages/types/README.md diff --git a/.github/workflows/npm_publish_initia_registry.yml b/.github/workflows/npm_publish_initia_registry.yml index 84902f7..01bd72e 100644 --- a/.github/workflows/npm_publish_initia_registry.yml +++ b/.github/workflows/npm_publish_initia_registry.yml @@ -4,7 +4,7 @@ on: push: branches: ["main"] paths: - - _packages/initia_registry/package.json + - _packages/initia-registry/package.json jobs: publish_types: @@ -17,10 +17,10 @@ jobs: node-version: "20.x" registry-url: "https://registry.npmjs.org" - run: npm ci - working-directory: ./_packages/initia_registry + working-directory: ./_packages/initia-registry - run: npm run build - working-directory: ./_packages/initia_registry + working-directory: ./_packages/initia-registry - run: npm publish - working-directory: ./_packages/initia_registry + working-directory: ./_packages/initia-registry env: NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} diff --git a/_packages/initia-registry/README.md b/_packages/initia-registry/README.md new file mode 100644 index 0000000..384d16b --- /dev/null +++ b/_packages/initia-registry/README.md @@ -0,0 +1,20 @@ +# initia-registry + +The npm package for the [initia registry](https://github.com/initia-labs/initia-registry) + +``` +npm install @initia/initia-registry +``` + +## usage + +Fetch data from initia-registry: + +```typescript +import { assets, chains, ibc } from "@intiia/initia-registry"; +import { Chain } from "@initia/initia-registry-types"; + +const assetList: Chain = assets.find( + ({ chain_name }) => chain_name === "initia" +); +``` diff --git a/_packages/initia-registry/package.json b/_packages/initia-registry/package.json index acffaf1..aaf9b38 100644 --- a/_packages/initia-registry/package.json +++ b/_packages/initia-registry/package.json @@ -1,6 +1,6 @@ { "name": "@initia/initia-registry", - "version": "0.1.1", + "version": "0.1.2", "description": "Initia chain registry", "main": "main/index.js", "module": "esm/index.js", diff --git a/_packages/types/README.md b/_packages/types/README.md new file mode 100644 index 0000000..c0e4b13 --- /dev/null +++ b/_packages/types/README.md @@ -0,0 +1,26 @@ +# Initia Registry Types + +This repository contains types and schema validation definitions for Initia Registry, which can be found at [Initia Registry GitHub Repository](https://github.com/initia-labs/initia-registry). + +## Usage + +### Installation + +You can install the Initia Registry Types package via npm: + +```bash +npm install @initia/initia-registry-types +``` + +### Imports + +After installing the package, you can import the types and schemas in your TypeScript files as follows: + +```typescript +import { Chain, AssetList, IBCInfo } from "@initia/initia-registry-types"; +import { + ChainSchema, + AssetListSchema, + IBCInfoSchema, +} from "@initia/initia-registry-types/zod"; +``` diff --git a/_packages/types/package.json b/_packages/types/package.json index 1a0da2c..c2f119a 100644 --- a/_packages/types/package.json +++ b/_packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@initia/initia-registry-types", - "version": "0.0.12", + "version": "0.0.13", "description": "The package provides TypeScript type definitions and Zod integration for initia-registry.", "types": "./dist/types/index.d.ts", "exports": {