Skip to content

Commit

Permalink
Prepare v10.0.0 for its stable release. (#716)
Browse files Browse the repository at this point in the history
* Drop the @beta tag
* Upgrade all dependencies
* Amend references to use @stellar, bump to Node 18
* Rename babel config file
  • Loading branch information
Shaptic committed Dec 5, 2023
1 parent 5766516 commit cf370f4
Show file tree
Hide file tree
Showing 11 changed files with 945 additions and 868 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/bundle_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Node.js 16
- name: Install Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18.x'

# Workaround for some `yarn` nonsense, see:
# https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
with:
fetch-depth: 0

- name: Install Node (16.x)
- name: Install Node (18.x)
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Install Dependencies
run: yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install Depencencies
Expand All @@ -24,7 +24,7 @@ jobs:

- name: Publish npm package to both places
run: |
yarn publish --tag beta --access public
yarn publish --access public
sed -i -e 's#"@stellar/stellar-base"#"stellar-base"#' package.json
yarn publish
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
node-version: [16, 18, 20]
node-version: [18, 20, 21]

steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog


## Unreleased
## [`v10.0.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0): Protocol 20 Stable Release

### Breaking Changes
* The new minimum supported Node version is Node 18.
* XDR has been upgraded to the latest stable version ([stellar-xdr@`6a620d1`](https://github.com/stellar/stellar-xdr/tree/6a620d160aab22609c982d54578ff6a63bfcdc01)). This is mostly renames, but it includes the following relevant breaking changes ([#704](https://github.com/stellar/js-stellar-base/pull/704)):
- `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose.
- In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTTL`
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ relative to your html file.
1. Install it using yarn:

```shell
yarn add stellar-base
yarn add @stellar/stellar-base
```

2. require/import it in your JavaScript:

```js
var StellarBase = require('stellar-base');
var StellarBase = require('@stellar/stellar-base');
```

### To self host for use in the browser
Expand Down Expand Up @@ -98,9 +98,9 @@ Make sure that you are using the latest version number. They can be found on the

### To develop and test js-stellar-base itself

1. Install Node 16.x
1. Install Node 18.x

We support the oldest LTS release of Node, which is [currently 16.x](https://nodejs.org/en/about/releases/). Please likewise install and develop on Node 16 so you don't get surprised when your code works locally but breaks in CI.
We support the oldest LTS release of Node, which is [currently 18.x](https://nodejs.org/en/about/releases/). Please likewise install and develop on Node 16 so you don't get surprised when your code works locally but breaks in CI.

If you work on several projects that use different Node versions, you might find helpful to install a NodeJS version manager:

Expand Down
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
"@babel/preset-env"
],
"env": {
"development": {
"plugins": [
"istanbul"
]
}
}
}
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@stellar/stellar-base",
"version": "10.0.0-beta.4",
"version": "10.0.0",
"description": "Low-level support library for the Stellar network.",
"main": "./lib/index.js",
"browser": {
"main": "./dist/stellar-base.js",
"main": "./dist/stellar-base.min.js",
"sodium-native": false
},
"types": "./types/index.d.ts",
Expand Down Expand Up @@ -63,35 +63,35 @@
"keywords": [
"stellar"
],
"author": "George Kudrayvtsev <george@stellar.org>",
"author": "Stellar Development Foundation <hello@stellar.org>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/stellar/js-stellar-base/issues"
},
"homepage": "https://github.com/stellar/js-stellar-base",
"devDependencies": {
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.0",
"@babel/eslint-parser": "^7.22.15",
"@babel/eslint-plugin": "^7.22.10",
"@babel/preset-env": "^7.22.20",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.5",
"@babel/eslint-parser": "^7.23.3",
"@babel/eslint-plugin": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/register": "^7.22.15",
"@definitelytyped/dtslint": "^0.0.182",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@types/node": "^20.8.4",
"@typescript-eslint/parser": "^6.7.5",
"@types/node": "^20.10.3",
"@typescript-eslint/parser": "^6.13.2",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.3",
"eslint": "^8.51.0",
"eslint": "^8.55.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-webpack-plugin": "^4.0.0",
"ghooks": "^2.0.4",
"husky": "^8.0.3",
Expand All @@ -103,27 +103,27 @@
"karma-mocha": "^2.0.0",
"karma-sinon-chai": "^2.0.2",
"karma-webpack": "^5.0.0",
"lint-staged": "^14.0.1",
"lint-staged": "^15.2.0",
"minami": "^1.1.1",
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"randombytes": "^2.1.0",
"sinon": "^16.1.0",
"sinon-chai": "^3.7.0",
"taffydb": "^2.7.3",
"terser-webpack-plugin": "^5.3.8",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"webpack": "^5.82.1",
"typescript": "^5.3.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.1"
},
"dependencies": {
"@stellar/js-xdr": "^3.0.1",
"base32.js": "^0.1.0",
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
"@stellar/js-xdr": "^3.0.1",
"sha.js": "^2.3.6",
"tweetnacl": "^1.0.3"
},
Expand Down
20 changes: 10 additions & 10 deletions src/numbers/sc_int.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import { XdrLargeInt } from './xdr_large_int';
* example, you could do `new XdrLargeInt('u128', bytes...).toBigInt()`.
*
* @example
* import sdk from "stellar-base";
* import { xdr, ScInt } from "@stellar/stellar-base";
*
* // You have an ScVal from a contract and want to parse it into JS native.
* const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64");
* const bigi = sdk.ScInt.fromScVal(value); // grab it as a BigInt
* const value = xdr.ScVal.fromXDR(someXdr, "base64");
* const bigi = ScInt.fromScVal(value); // grab it as a BigInt
* let sci = new ScInt(bigi);
*
* sci.toNumber(); // gives native JS type (w/ size check)
* sci.toBigInt(); // gives the native BigInt value
* sci.toU64(); // gives ScValType-specific XDR constructs (with size checks)
*
* // You have a number and want to shove it into a contract.
* sci = sdk.ScInt(0xdeadcafebabe);
* sci = ScInt(0xdeadcafebabe);
* sci.toBigInt() // returns 244838016400062n
* sci.toNumber() // throws: too large
*
Expand All @@ -35,16 +35,16 @@ import { XdrLargeInt } from './xdr_large_int';
* const scValU64 = sci.toU64();
*
* // Lots of ways to initialize:
* sdk.ScInt("123456789123456789")
* sdk.ScInt(123456789123456789n);
* sdk.ScInt(1n << 140n);
* sdk.ScInt(-42);
* sdk.ScInt.fromScVal(scValU128); // from above
* ScInt("123456789123456789")
* ScInt(123456789123456789n);
* ScInt(1n << 140n);
* ScInt(-42);
* ScInt.fromScVal(scValU128); // from above
*
* // If you know the type ahead of time (accessing `.raw` is faster than
* // conversions), you can specify the type directly (otherwise, it's
* // interpreted from the numbers you pass in):
* const i = sdk.ScInt(123456789n, { type: "u256" });
* const i = ScInt(123456789n, { type: "u256" });
*
* // For example, you can use the underlying `sdk.U256` and convert it to an
* // `xdr.ScVal` directly like so:
Expand Down
Loading

0 comments on commit cf370f4

Please sign in to comment.