Skip to content

Commit

Permalink
Prepare to pubishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sterliakov committed Nov 14, 2022
1 parent ccfe932 commit e6bc4f9
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test/lib/dist/
/proto/
.nyc_output
*.sublime-*
/lib
114 changes: 95 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 7 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
"version": "0.1.0-alpha.1",
"description": "TypeScript SDK that encapsulates the TRON HTTP API",
"scripts": {
"build": "npm run clean && npm run build:esm && npm run build:cjs",
"build:esm": "tsc -p ./tsconfig.esm.json && mv dist/esm/src/index.js dist/esm/src/index.mjs",
"build:cjs": "tsc -p ./tsconfig.cjs.json",
"build": "npm run clean && npx genversion --es6 --semi version.js && tsc && webpack && echo '{\"type\": \"commonjs\"}' > lib/package.json",
"prepack": "npm run build",
"clean": "rimraf dist",
"clean": "rimraf dist lib",
"newaccount": "npx ts-node test/helpers/newAccounts 50",
"do-test": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' npx nyc mocha --colors -r ts-node/register -r source-map-support/register --timeout 180000",
"test": "npm run-script newaccount && npm run-script do-test 'test/*/**.test.ts'",
Expand Down Expand Up @@ -48,6 +46,7 @@
"babel-plugin-source-map-support": "^2.1.3",
"chai": "^4.1.2",
"chalk": "^2.4.1",
"genversion": "^3.1.1",
"globby": "^13.1.2",
"jsonwebtoken": "^8.5.1",
"mocha": "^10.1.0",
Expand All @@ -70,20 +69,9 @@
"license": "MIT",
"repository": "https://github.com/sterliakov/tronweb.git",
"files": [
"dist/**/*"
"dist/**/*",
"lib"
],
"exports": {
".": {
"import": {
"types": "./dist/esm/types/index.d.ts",
"default": "./dist/esm/src/index.mjs"
},
"require": {
"types": "./dist/cjs/types/index.d.ts",
"default": "./dist/cjs/src/index.js"
}
}
},
"types": "./dist/cjs/types/index.d.ts",
"main": "./dist/cjs/src/index.js"
"types": "./lib/src/index.d.ts",
"main": "./lib/src/index.js"
}
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import EventEmitter from 'eventemitter3';
import injectpromise from 'injectpromise';
import semver from 'semver';

import * as pack from '../package.json';
import {version} from '../version.js';
import Contract from './lib/contract';
import type {IAbi} from './lib/contract';
import type {ContractEventOptions} from './lib/contract';
import type {ContractEventOptions, IAbi} from './lib/contract';
import Event from './lib/event';
import type {IEvent, IEventResponse} from './lib/event';
import Plugin from './lib/plugin';
Expand Down Expand Up @@ -48,9 +47,9 @@ export default class TronWeb extends EventEmitter {
static Contract = Contract;
static Plugin = Plugin;
static Event = Event;
static version = pack.version;
static version = version;
static utils = utils;
version = pack.version;
version = version;

providers = providers;
utils = utils;
Expand Down
4 changes: 3 additions & 1 deletion src/utils/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ec as EC} from 'elliptic';
import el from 'elliptic';

import type {ISignedTransaction, ITransaction} from '../lib/transactionBuilder';
import {ADDRESS_PREFIX, ADDRESS_PREFIX_BYTE, ADDRESS_SIZE} from './address';
Expand All @@ -14,6 +14,8 @@ import {SigningKey, sha256 as ethSha256, keccak256} from './ethersUtils';
import {TypedDataEncoder} from './typedData';
import type {IDomain} from './typedData';

const {ec: EC} = el;

// import {TransactionExtention as ITransactionExtention} from '../proto/api/api'

export {byteArray2hexStr} from './bytes';
Expand Down
Binary file added sterliakov-tstron-0.1.0-alpha.1.tgz
Binary file not shown.
11 changes: 0 additions & 11 deletions tsconfig.cjs.json

This file was deleted.

11 changes: 0 additions & 11 deletions tsconfig.esm.json

This file was deleted.

15 changes: 8 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"moduleResolution": "node",
"target": "es2015",
"strict": true,
"noImplicitAny": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"sourceMap": true,
"skipLibCheck": true,
"checkJs": true,
"allowJs": true,
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"allowSyntheticDefaultImports": true
"noFallthroughCasesInSwitch": true,

"module": "commonjs",
"target": "es2015",
"lib": ["es2015", "dom"],
"outDir": "lib"
},
"include": ["src/**/*", "src/index.ts"],
"files": ["src/index.ts"]
"include": ["src"]
}
2 changes: 2 additions & 0 deletions version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e6bc4f9

Please sign in to comment.