Build for npm and add readme

This commit is contained in:
armaniferrante 2021-05-16 17:53:57 -07:00
parent ede30702c5
commit 62b4d91044
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
5 changed files with 73 additions and 9 deletions

2
.gitignore vendored
View File

@ -21,3 +21,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/dist

View File

@ -1,4 +1,34 @@
# Swap UI
# `@project-serum/swap-ui`
An example UI for the swap frontend to the Serum DEX. The Solana program can be
found [here](https://github.com/project-serum/swap).
[![Build Status](https://travis-ci.com/project-serum/swap-ui.svg?branch=master)](https://travis-ci.com/project-serum/swap-ui)
[![npm](https://img.shields.io/npm/v/@project-serum/swap-ui.svg)](https://www.npmjs.com/package/@project-serum/swap-ui)
A reusable React component for swapping on the Serum DEX. The Solana program can be
found [here](https://github.com/project-serum/swap). An example application is also
provided in this repository.
## Developing
#### Install dependencies
```
yarn
```
#### Run the example app
```
yarn start
```
#### Build the `@project-serum/swap-ui` package for npm
```
yarn build:npm
```
#### Build the example app for GitHub pages
```
yarn build
```

View File

@ -1,7 +1,7 @@
{
"name": "swap-ui",
"version": "0.1.0",
"private": true,
"name": "@project-serum/swap-ui",
"version": "0.1.0-alpha.1",
"main": "dist/index.js",
"homepage": ".",
"dependencies": {
"@material-ui/core": "^4.11.4",
@ -38,7 +38,8 @@
"eject": "react-scripts eject",
"lint": "prettier src/** --check",
"lint:fix": "prettier src/** -w",
"deploy": "gh-pages -d build/"
"deploy": "gh-pages -d build/",
"build:npm": "rm -rf dist && tsc --build tsconfig.npm.json"
},
"eslintConfig": {
"extends": [
@ -61,5 +62,8 @@
"devDependencies": {
"gh-pages": "^3.1.0",
"prettier": "^2.3.0"
}
},
"files": [
"dist"
]
}

View File

@ -18,7 +18,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"jsx": "react-jsx",
"typeRoots": ["types/", "node_modules/@types"]
},
"include": [

28
tsconfig.npm.json Normal file
View File

@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"jsx": "react-jsx",
"typeRoots": ["types/", "node_modules/@types"],
"outDir": "dist"
},
"include": [
"src/swap/"
]
}