Skip to content

Commit 4e77f9e

Browse files
author
Fabrice Bascoulergue
committed
Fix cicd configuration
1 parent 3d42c0e commit 4e77f9e

File tree

9 files changed

+50
-51
lines changed

9 files changed

+50
-51
lines changed

.eslintignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
build/
2+
docs/
13
node_modules/
2-
lib/
4+
proto/
5+
scripts/
6+
*.d.ts

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
- name: Run build lib, types and docs
3838
run: yarn build
3939
- name: Copy LICENSE
40-
run: cp LICENSE lib/LICENSE
40+
run: cp LICENSE build/LICENSE
4141
- name: Copy README
42-
run: cp README.md lib/README.md
42+
run: cp README.md build/README.md
4343
- name: Copy sanitized package.json
44-
run: cp package.json lib/package.json
44+
run: cp package.json build/package.json
4545
- name: Publish package to NPM
4646
run: npm publish
4747
env:

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ dist
104104
.tern-port
105105

106106
# Build output
107-
/lib
108-
/typings
107+
/build
109108

110109
# Proto files
111110
/proto

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github/workflows
2+
build
3+
docs
4+
node_modules
5+
proto

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
testMatch: ['**/*test.(ts|js)'],
3-
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/lib/', '<rootDir>/typings'],
3+
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/build/', '<rootDir>/typings'],
44
transform: {
55
'^.+\\.(ts|js)?$': 'ts-jest',
66
},

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414
"type": "git",
1515
"url": "https://github.com/lum-network/sdk-javascript.git"
1616
},
17-
"main": "lib/index.js",
18-
"typings": "lib/index.d.ts",
17+
"main": "build/index.js",
18+
"typings": "build/index.d.ts",
1919
"files": [
20-
"lib/*"
20+
"build/*"
2121
],
2222
"scripts": {
2323
"test": "cross-env NODE_ENV=test jest",
24-
"build": "yarn clean && yarn build:types && yarn build:js && yarn build:docs",
25-
"build:types": "tsc --emitDeclarationOnly",
26-
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
27-
"build:docs": "rimraf docs/lib && typedoc --excludeExternals --excludeNotDocumented --readme none --out docs/lib --hideBreadcrumbs --disableSources",
28-
"clean": "rimraf lib",
24+
"build": "yarn clean && yarn build:lib && yarn build:docs",
25+
"build:lib": "tsc",
26+
"build:docs": "rimraf docs/lib && typedoc --excludeExternals --readme none --out docs/lib --hideBreadcrumbs --disableSources",
27+
"clean": "rimraf build",
2928
"lint": "eslint '**/*.{ts,js}'",
3029
"format": "prettier --write '**/*.{js,jsx,ts,tsx,css,json,md,html,yml}'",
3130
"bump": "npm version",

tests/client.test.ts

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
1-
import { LumClient, LumWallet, LumConstants, LumMessages, LumUtils } from '../src';
1+
import { LumWallet, LumConstants } from '../src';
22

33
describe('LumClient', () => {
44
it('Should connect', async () => {
55
const w1 = await LumWallet.fromMnemonic('noodle hope lounge dismiss erase elephant seek crawl check equal city chest', LumConstants.getLumHdPath(0), 'cosmos');
66
const w2 = await LumWallet.fromMnemonic('sick hollow lizard train motion eternal mixture rude section tray nice awful', LumConstants.getLumHdPath(0), 'cosmos');
7+
expect(w1.address).not.toEqual(w2.address);
78

89
// Can connect to Cosmos testnet for compatibility checks:
910
// https://stargate.cosmos.network/testnet
10-
const clt = await LumClient.connect('http://localhost:26657');
11-
console.log('wallet address', w1.address);
12-
console.log('getChainId', await clt.getChainId());
13-
console.log('getBlockHeight', await clt.getBlockHeight());
14-
15-
console.log('getBlock', await clt.getBlock());
16-
17-
console.log('getAccount', await clt.getAccount(w1.address));
18-
console.log('getAccountUnverified', await clt.getAccountUnverified(w1.address));
19-
20-
console.log('getBalance', await clt.getBalance(w1.address, 'token'));
21-
console.log('getBalancesUnverified', await clt.getBalancesUnverified(w1.address));
22-
23-
const txs = await clt.searchTx([LumUtils.searchTxFrom(w1.address), LumUtils.searchTxTo(w1.address)]);
24-
console.log('getTx', await clt.getTx(txs[0].hash));
25-
console.log('searchTxs', txs);
26-
27-
const sendMsg = LumMessages.BuildMsgSend(w1.address, w2.address, [{ denom: 'token', amount: '2' }]);
28-
29-
const res = await clt.signAndBroadcastTx(w1, [sendMsg], {
30-
amount: [
31-
{
32-
denom: 'token',
33-
amount: '1',
34-
},
35-
],
36-
gas: '180000', // 180k
37-
});
38-
console.log('signAndBroadcastTx', res);
39-
console.log('getBalance(w1)', await clt.getBalance(w1.address, 'token'));
40-
console.log('getBalance(w2)', await clt.getBalance(w2.address, 'token'));
41-
11+
// const clt = await LumClient.connect('http://localhost:26657');
12+
// console.log('wallet address', w1.address);
13+
// console.log('getChainId', await clt.getChainId());
14+
// console.log('getBlockHeight', await clt.getBlockHeight());
15+
// console.log('getBlock', await clt.getBlock());
16+
// console.log('getAccount', await clt.getAccount(w1.address));
17+
// console.log('getAccountUnverified', await clt.getAccountUnverified(w1.address));
18+
// console.log('getBalance', await clt.getBalance(w1.address, 'token'));
19+
// console.log('getBalancesUnverified', await clt.getBalancesUnverified(w1.address));
20+
// const txs = await clt.searchTx([LumUtils.searchTxFrom(w1.address), LumUtils.searchTxTo(w1.address)]);
21+
// console.log('getTx', await clt.getTx(txs[0].hash));
22+
// console.log('searchTxs', txs);
23+
// const sendMsg = LumMessages.BuildMsgSend(w1.address, w2.address, [{ denom: 'token', amount: '2' }]);
24+
// const res = await clt.signAndBroadcastTx(w1, [sendMsg], {
25+
// amount: [
26+
// {
27+
// denom: 'token',
28+
// amount: '1',
29+
// },
30+
// ],
31+
// gas: '180000', // 180k
32+
// });
33+
// console.log('signAndBroadcastTx', res);
34+
// console.log('getBalance(w1)', await clt.getBalance(w1.address, 'token'));
35+
// console.log('getBalance(w2)', await clt.getBalance(w2.address, 'token'));
4236
// WIP - needs to be automated through CICD
4337
});
4438
});

tests/wallet.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { LumWallet, LumUtils, LumConstants } from '../src';
2-
// import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
32

43
describe('LumWallet', () => {
54
it('Should be identical from mnemonic, privatekey and keystore recovery', async () => {

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"compilerOptions": {
33
"rootDir": ".",
4-
"outDir": "lib",
4+
"outDir": "build",
55
"resolveJsonModule": true,
66
"allowUnreachableCode": false,
77
"allowUnusedLabels": false,
88
"declaration": true,
99
"esModuleInterop": true,
10-
"emitDeclarationOnly": true,
1110
"isolatedModules": true,
1211
"forceConsistentCasingInFileNames": true,
1312
"lib": ["es2018"],

0 commit comments

Comments
 (0)