Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
A clear and concise description of what the bug is.

**What version are you on?**
Check `yarn.lock` or `package-lock.json` to find out precisely what version of `stellar-base` you're running.
Check `pnpm-lock.yaml` or `package-lock.json` to find out precisely what version of `stellar-base` you're running.

**To Reproduce**
Steps to reproduce the behavior:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/bundle_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.3

- name: Install Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: "20.x"
cache: "pnpm"

# Workaround for some `yarn` nonsense, see:
# https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210
- name: Install Dependencies
run: yarn install --network-concurrency 1
run: pnpm install --frozen-lockfile

- name: Build All
run: yarn build:prod
run: pnpm run build:prod

- name: Report Bundle Size
uses: preactjs/compressed-size-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pattern: "dist/*.js"
compression: "none"
compression: "none"
20 changes: 13 additions & 7 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Code Formatting

on:
push:
branches: [ master ]
branches: [master]
pull_request:

jobs:
Expand All @@ -12,15 +12,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.3

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: "20.x"
cache: "pnpm"

# Workaround for some `yarn` nonsense, see:
# https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210
- name: Install Dependencies
run: yarn install --network-concurrency 1

run: pnpm install --frozen-lockfile
- name: Check local TS version
run: pnpm tsc --version
- name: Run Linter Checks
run: yarn fmt && yarn lint && (git diff-index --quiet HEAD; git diff)
run: |
pnpm run fmt && pnpm run lint && (git diff-index --quiet HEAD -- src/ test/; git diff -- src/ test/)
12 changes: 9 additions & 3 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.3

- name: Install Node (20.x)
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install Dependencies
run: yarn install
run: pnpm install --frozen-lockfile

- name: Build & Test
run: yarn preversion
run: pnpm run preversion

- name: Checkout GH pages
uses: actions/checkout@v4
Expand All @@ -33,7 +39,7 @@ jobs:
- name: Generate JS docs
# because parsing errors still result in renderable docs
continue-on-error: true
run: yarn docs
run: pnpm run docs

- name: Publish JS docs
run: |
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types: [published]

permissions:
id-token: write # Required for OIDC
id-token: write # Required for OIDC
contents: read

jobs:
Expand All @@ -14,17 +14,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.3

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Install Depencencies
run: yarn install
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Test & Build
run: yarn preversion
run: pnpm run preversion

- name: Publish npm package to both places
run: yarn publish --access public --provenance
run: pnpm publish --access public --provenance
21 changes: 14 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests

on:
push:
branches: [ master ]
branches: [master]
pull_request:

jobs:
Expand All @@ -19,21 +19,28 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

# Workaround for some `yarn` nonsense, see:
# https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210
- name: Install Dependencies
run: yarn install --network-concurrency 1
run: pnpm install --frozen-lockfile

- name: Build All
run: yarn build:prod
run: pnpm run build:prod

- name: Run Node Tests
run: yarn test:node
run: pnpm run test:node

- name: Run Vitest Tests
run: pnpm run test:vitest

- name: Run Browser Tests
run: yarn test:browser
run: pnpm run test:browser
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eslint.options": {
"overrideConfigFile": "./config/eslint.config.cjs"
},
"prettier.configPath": "./config/prettier.config.cjs",
"prettier.ignorePath": "./config/.prettierignore"
}
69 changes: 51 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,75 @@
# How to contribute

Please read the [Contribution Guide](https://github.com/stellar/docs/blob/master/CONTRIBUTING.md).

Then please [sign the Contributor License Agreement](https://docs.google.com/forms/d/1g7EF6PERciwn7zfmfke5Sir2n10yddGGSXyZsq98tVY/viewform?usp=send_form).

Please read the
[Contribution Guide](https://github.com/stellar/docs/blob/master/CONTRIBUTING.md).

Then please
[sign the Contributor License Agreement](https://docs.google.com/forms/d/1g7EF6PERciwn7zfmfke5Sir2n10yddGGSXyZsq98tVY/viewform?usp=send_form).

# Releasing
SDK maintainers should follow [semantic versioning](https://semver.org/) best practices for releasing the SDK.

Use your best judgement when deciding on when to craft a release: maybe enough changes have accumulated to warrant a release, maybe there's a high-urgency fix that needs to be published immediately, or maybe you can put it off for a particular feature. It's all dependent on what else is going on.
SDK maintainers should follow [semantic versioning](https://semver.org/) best
practices for releasing the SDK.

Use your best judgement when deciding on when to craft a release: maybe enough
changes have accumulated to warrant a release, maybe there's a high-urgency fix
that needs to be published immediately, or maybe you can put it off for a
particular feature. It's all dependent on what else is going on.

As you probably already know, there are two main components to the JavaScript SDK environment: the `stellar-base` package (this repo) and the higher-level `stellar-sdk` package (from [here](https://github.com/stellar/js-stellar-sdk)) that relies on this one as a dependency. Care should be taken when updating either, as there are quite a few small steps that can get overlooked.
As you probably already know, there are two main components to the JavaScript
SDK environment: the `stellar-base` package (this repo) and the higher-level
`stellar-sdk` package (from [here](https://github.com/stellar/js-stellar-sdk))
that relies on this one as a dependency. Care should be taken when updating
either, as there are quite a few small steps that can get overlooked.

### Updating Base
Once all of the PRs for a particular release are in, it's time to actually publish & deploy a new version.

- [ ] Create a new branch with the new version, e.g. `git switch -C v1.0.0`
Once all of the PRs for a particular release are in, it's time to actually
publish & deploy a new version.

- [ ] First, look at the diff between the latest release and master: e.g. https://github.com/stellar/js-stellar-base/compare/v5.1.0...master. Replace `v5.1.0` here with the [latest release](https://github.com/stellar/js-stellar-base/releases/latest).
- [ ] Create a new branch with the new version, e.g. `git switch -C v1.0.0`

- [ ] Ensure that all of the PRs in this delta are accurately reflected in the [CHANGELOG](./CHANGELOG.md), broken down by impact and linking to the corresponding PRs. Update the file if necessary.
- [ ] First, look at the diff between the latest release and master: e.g.
https://github.com/stellar/js-stellar-base/compare/v5.1.0...master.
Replace `v5.1.0` here with the
[latest release](https://github.com/stellar/js-stellar-base/releases/latest).

- [ ] Ensure that the version being deprecated in the `npm_publish.yml` Action matches the latest `package.json` version: we want to ensure everything in `stellar-base` gets deprecated, but `@stellar/stellar-base` is not.
- [ ] Ensure that all of the PRs in this delta are accurately reflected in the
[CHANGELOG](./CHANGELOG.md), broken down by impact and linking to the
corresponding PRs. Update the file if necessary.

- [ ] Run `yarn preversion` to build and test an optimized bundle and ensure Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS).
- [ ] Ensure that the version being deprecated in the `npm_publish.yml` Action
matches the latest `package.json` version: we want to ensure everything in
`stellar-base` gets deprecated, but `@stellar/stellar-base` is not.

- [ ] Run `yarn version` to update the version number in the package.json (or modify the `"version"` field manually).
- [ ] Run `pnpm run preversion` to build and test an optimized bundle and ensure
Typescript compatibility (one of the most common sources of bugs, since
this library is written purely in JS but must be usable from TS).

- [ ] Commit & push your branch, then [create a PR](https://github.com/stellar/js-stellar-base/compare).
- [ ] Run `pnpm version` to update the version number in the package.json (or
modify the `"version"` field manually).

- [ ] Once approved, merge it and then [create a new release](https://github.com/stellar/js-stellar-base/releases/new), using the same version as you did for the branch; **let GitHub create the tag for you**. In the description for the release, paste in the relevant parts of the [CHANGELOG](./CHANGELOG.md).
- [ ] Commit & push your branch, then
[create a PR](https://github.com/stellar/js-stellar-base/compare).

- [ ] Once the release has been created and the build succeeds, the new version should be deployed to `npm` and accessible to all. You can watch this yourself, either via the [`npm` page](https://www.npmjs.com/package/stellar-base) or from the command line:
- [ ] Once approved, merge it and then
[create a new release](https://github.com/stellar/js-stellar-base/releases/new),
using the same version as you did for the branch; **let GitHub create the
tag for you**. In the description for the release, paste in the relevant
parts of the [CHANGELOG](./CHANGELOG.md).

- [ ] Once the release has been created and the build succeeds, the new version
should be deployed to `npm` and accessible to all. You can watch this
yourself, either via the
[`npm` page](https://www.npmjs.com/package/stellar-base) or from the
command line:

```bash
watch 'curl -s "https://registry.npmjs.org/stellar-base" | jq ".versions | keys | last"'
```

### Updating SDK
Refer to the SDK's [contributing guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md#Releasing) for any additional steps required there.

Refer to the SDK's
[contributing guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md#Releasing)
for any additional steps required there.
Loading
Loading