Skip to content

Commit

Permalink
Added CI, updated deps, build
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Mar 2, 2025
1 parent 220082f commit bd5c239
Show file tree
Hide file tree
Showing 7 changed files with 772 additions and 37 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/any.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Any build
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install, lint and/or test
run: |
yarn
- name: build
run: yarn build
env:
CI: true
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish to npm
on:
push:
branches:
- main
- app

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 18
- run: yarn
- run: yarn build
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "ecency-wallets",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"main": "./dist/ecency-wallets.umd.cjs",
"module": "./dist/ecency-wallets.js",
"types": "./dist/index.d.ts",
"main": "./dist/ecency-wallets.umd.js",
"module": "./dist/ecency-wallets.es.js",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand All @@ -16,13 +15,15 @@
"@tanstack/react-query": "^5.66.11",
"@types/node": "^22.13.8",
"@types/react": "^19.0.10",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.21.0",
"lru-cache": "^11.0.2",
"prettier": "^3.5.2",
"react": "^19.0.0",
"typescript": "~5.7.2",
"vite": "^6.2.0",
"vite-plugin-dts": "^4.5.1"
"vite-plugin-dts": "^4.5.1",
"vite-plugin-node-polyfills": "^0.23.0"
},
"dependencies": {
"@okxweb3/coin-aptos": "^1.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from "./enums";
export * from "./mutations";
export * from "./utils";
export * from "./queries";
export * from "./types";
32 changes: 26 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
import path, { resolve } from "path";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import react from "@vitejs/plugin-react";
import dtsPlugin from "vite-plugin-dts";
import { nodePolyfills } from "vite-plugin-node-polyfills";

// https://vitejs.dev/guide/build.html#library-mode
export default defineConfig({
build: {
minify: false,
terserOptions: {
compress: false,
mangle: false,
},
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "ecency-wallets",
fileName: "ecency-wallets",
entry: path.resolve(__dirname, "src/index.ts"),
name: "Ecency Wallets",
formats: ["es"],
fileName: (format) => `ecency-wallets.${format}.js`,
},

rollupOptions: {
external: [
"crypto",
"react",
"@hiveio/dhive",
"@tanstack/react-query",
"lru-cache",
"scheduler",
"react/jsx-runtime",
"@okxweb3/coin-aptos",
"@okxweb3/coin-base",
"@okxweb3/coin-bitcoin",
"@okxweb3/coin-cosmos",
"@okxweb3/coin-ethereum",
"@okxweb3/coin-solana",
"@okxweb3/coin-ton",
"@okxweb3/coin-tron",
"@okxweb3/crypto-lib",
"bip39",
],
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"near-api-js": "near-api-js/dist/near-api-js.js",
},
},
plugins: [dts()],
plugins: [react(), dtsPlugin({ rollupTypes: true }), nodePolyfills()],
});
Loading

0 comments on commit bd5c239

Please sign in to comment.