diff --git a/package.json b/package.json index f8e296ba4..d677229a9 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ }, "homepage": "https://github.com/stellar/js-stellar-base", "devDependencies": { + "@stellar/tsconfig": "^1.0.1", "@types/node": "^11.13.0", "babel-cli": "^6.26.0", "babel-core": "~6.26.3", @@ -99,6 +100,8 @@ "run-sequence": "^1.0.2", "sinon": "^1.14.1", "sinon-chai": "^2.7.0", + "tslint": "^5.18.0", + "typescript": "^3.5.3", "webpack": "^1.13.2" }, "dependencies": { diff --git a/src/account.js b/src/account.ts similarity index 100% rename from src/account.js rename to src/account.ts diff --git a/src/asset.js b/src/asset.ts similarity index 100% rename from src/asset.js rename to src/asset.ts diff --git a/src/base58.js b/src/base58.ts similarity index 100% rename from src/base58.js rename to src/base58.ts diff --git a/src/browser.js b/src/browser.ts similarity index 100% rename from src/browser.js rename to src/browser.ts diff --git a/src/generated/stellar-xdr_generated.js b/src/generated/stellar-xdr_generated.ts similarity index 100% rename from src/generated/stellar-xdr_generated.js rename to src/generated/stellar-xdr_generated.ts diff --git a/src/hashing.js b/src/hashing.ts similarity index 100% rename from src/hashing.js rename to src/hashing.ts diff --git a/src/index.js b/src/index.ts similarity index 100% rename from src/index.js rename to src/index.ts diff --git a/src/keypair.js b/src/keypair.ts similarity index 100% rename from src/keypair.js rename to src/keypair.ts diff --git a/src/memo.js b/src/memo.ts similarity index 100% rename from src/memo.js rename to src/memo.ts diff --git a/src/network.js b/src/network.ts similarity index 100% rename from src/network.js rename to src/network.ts diff --git a/src/operation.js b/src/operation.ts similarity index 100% rename from src/operation.js rename to src/operation.ts diff --git a/src/operations/account_merge.js b/src/operations/account_merge.ts similarity index 100% rename from src/operations/account_merge.js rename to src/operations/account_merge.ts diff --git a/src/operations/allow_trust.js b/src/operations/allow_trust.ts similarity index 100% rename from src/operations/allow_trust.js rename to src/operations/allow_trust.ts diff --git a/src/operations/bump_sequence.js b/src/operations/bump_sequence.ts similarity index 100% rename from src/operations/bump_sequence.js rename to src/operations/bump_sequence.ts diff --git a/src/operations/change_trust.js b/src/operations/change_trust.ts similarity index 100% rename from src/operations/change_trust.js rename to src/operations/change_trust.ts diff --git a/src/operations/create_account.js b/src/operations/create_account.ts similarity index 100% rename from src/operations/create_account.js rename to src/operations/create_account.ts diff --git a/src/operations/create_passive_sell_offer.js b/src/operations/create_passive_sell_offer.ts similarity index 100% rename from src/operations/create_passive_sell_offer.js rename to src/operations/create_passive_sell_offer.ts diff --git a/src/operations/index.js b/src/operations/index.ts similarity index 100% rename from src/operations/index.js rename to src/operations/index.ts diff --git a/src/operations/inflation.js b/src/operations/inflation.ts similarity index 100% rename from src/operations/inflation.js rename to src/operations/inflation.ts diff --git a/src/operations/manage_buy_offer.js b/src/operations/manage_buy_offer.ts similarity index 100% rename from src/operations/manage_buy_offer.js rename to src/operations/manage_buy_offer.ts diff --git a/src/operations/manage_data.js b/src/operations/manage_data.ts similarity index 100% rename from src/operations/manage_data.js rename to src/operations/manage_data.ts diff --git a/src/operations/manage_sell_offer.js b/src/operations/manage_sell_offer.ts similarity index 100% rename from src/operations/manage_sell_offer.js rename to src/operations/manage_sell_offer.ts diff --git a/src/operations/path_payment.js b/src/operations/path_payment.ts similarity index 100% rename from src/operations/path_payment.js rename to src/operations/path_payment.ts diff --git a/src/operations/payment.js b/src/operations/payment.ts similarity index 100% rename from src/operations/payment.js rename to src/operations/payment.ts diff --git a/src/operations/set_options.js b/src/operations/set_options.ts similarity index 100% rename from src/operations/set_options.js rename to src/operations/set_options.ts diff --git a/src/signing.js b/src/signing.ts similarity index 100% rename from src/signing.js rename to src/signing.ts diff --git a/src/strkey.js b/src/strkey.ts similarity index 100% rename from src/strkey.js rename to src/strkey.ts diff --git a/src/transaction.js b/src/transaction.ts similarity index 100% rename from src/transaction.js rename to src/transaction.ts diff --git a/src/transaction_builder.js b/src/transaction_builder.ts similarity index 100% rename from src/transaction_builder.js rename to src/transaction_builder.ts diff --git a/src/util/checksum.js b/src/util/checksum.ts similarity index 100% rename from src/util/checksum.js rename to src/util/checksum.ts diff --git a/src/util/continued_fraction.js b/src/util/continued_fraction.ts similarity index 100% rename from src/util/continued_fraction.js rename to src/util/continued_fraction.ts diff --git a/src/vendor/bs58.js b/src/vendor/bs58.ts similarity index 100% rename from src/vendor/bs58.js rename to src/vendor/bs58.ts diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..d099ec3e5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@stellar/tsconfig", + "compilerOptions": { + "declaration": true, + "declarationDir": "lib", + "lib": ["es2015"], + "moduleResolution": "node", + "rootDir": "src", + "outDir": "lib", + "target": "es5" + }, + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 246116408..0da9e23b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -97,6 +97,11 @@ dependencies: any-observable "^0.3.0" +"@stellar/tsconfig@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@stellar/tsconfig/-/tsconfig-1.0.1.tgz#71fdb62e9a20a435d4962b906c997ec6927264e6" + integrity sha512-dYdEY2chPcD8V2flkG00BTxYUKkIFqTV1n8aIxkdUpSIfnMv8FnixtdLbCb9hRutQgKjIQvHRisUS7yczfjSrw== + "@types/node@^11.13.0": version "11.13.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1" @@ -4324,7 +4329,7 @@ js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.9.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.7.0: +js-yaml@^3.13.1, js-yaml@^3.7.0: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -7369,6 +7374,25 @@ tslint@5.14.0: tslib "^1.8.0" tsutils "^2.29.0" +tslint@^5.18.0: + version "5.18.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" + integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^3.2.0" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.1" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.8.0" + tsutils "^2.29.0" + tsutils@^2.29.0: version "2.29.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" @@ -7419,6 +7443,11 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typescript@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== + typescript@next: version "3.5.0-dev.20190407" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.0-dev.20190407.tgz#5b5f9e2031c8ddf5bb9d9be36e70bc77327b0d0c"