diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.github/workflows/docs-develop.yml b/.github/workflows/docs-develop.yml deleted file mode 100644 index 8ef5a004c9..0000000000 --- a/.github/workflows/docs-develop.yml +++ /dev/null @@ -1,30 +0,0 @@ -# TODO: combine with docs-release using if -name: Publish develop docs -on: - push: - branches: [develop] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - uses: actions/cache@v4 - with: - path: ~/.cache/pip3 - key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} - - uses: actions/cache@v4 - with: - path: | - ~/.npm - ~/.autorest - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - - run: pip3 install -r docs/requirements.txt - - run: git config --global user.email "github-action@users.noreply.github.com" - - run: git config --global user.name "GitHub Action" - - run: mike deploy --push develop diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs.yml similarity index 58% rename from .github/workflows/docs-release.yml rename to .github/workflows/docs.yml index bd10d47452..6f015dee9f 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs.yml @@ -1,8 +1,10 @@ -name: Publish release docs +name: Build and publish docs on: + pull_request: + push: + branches: [develop] release: types: [released] - jobs: main: runs-on: ubuntu-latest @@ -12,7 +14,10 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.x + - uses: actions/setup-node@v4 + with: + node-version: 20.x - uses: actions/cache@v4 with: path: ~/.cache/pip3 @@ -24,7 +29,13 @@ jobs: ~/.autorest key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - run: pip3 install -r docs/requirements.txt - - run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV - run: git config --global user.email "github-action@users.noreply.github.com" - run: git config --global user.name "GitHub Action" - - run: mike deploy --push --update-aliases $RELEASE_VERSION latest + - if: github.event_name == 'pull_request' + run: mkdocs build + - if: github.event_name == 'push' + run: mike deploy --push develop + - if: github.event_name == 'release' + run: | + echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV + mike deploy --push --update-aliases $RELEASE_VERSION latest diff --git a/.mocharc.cjs b/.mocharc.cjs new file mode 100644 index 0000000000..84f5eaf53a --- /dev/null +++ b/.mocharc.cjs @@ -0,0 +1,7 @@ +module.exports = { + 'node-option': ['import=tsx'], + recursive: true, + extension: '.ts', + timeout: process.env.NETWORK ? '30s' : '6s', + ignore: ['test/charts/**', 'test/emitter/**', 'test/environment/**'], +}; diff --git a/.mocharc.js b/.mocharc.js deleted file mode 100644 index be1ec29c8e..0000000000 --- a/.mocharc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - require: 'tooling/babel-register.js', - recursive: true, - extension: '.js,.ts', - timeout: process.env.NETWORK ? '30s' : '6s', - ignore: 'test/environment/**', -}; diff --git a/babel.config.js b/babel.config.js index 1a495364d5..15ec37c605 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { presets: [ [ '@babel/preset-env', diff --git a/babel.esm.config.js b/babel.esm.config.js index 549b92c257..29e6972224 100644 --- a/babel.esm.config.js +++ b/babel.esm.config.js @@ -1,19 +1,18 @@ -const config = require('./babel.config'); +import config from './babel.config.js'; config.presets .filter((plugin) => Array.isArray(plugin)) .find(([name]) => name === '@babel/preset-env')[1].modules = false; config.plugins.push( - ['add-import-extension', { extension: 'mjs' }], + ['add-import-extension', { extension: 'js' }], [ 'import-globals', { Buffer: { moduleName: 'buffer', exportName: 'Buffer' }, }, ], - ['transform-default-named-imports', { exclude: ['@scure/bip39'] }], ); config.plugins = config.plugins.filter((p) => p !== 'babel-plugin-transform-import-meta'); -module.exports = config; +export default config; diff --git a/commitlint.config.js b/commitlint.config.js index 813ce53814..ba22be2c43 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { extends: ['@commitlint/config-conventional'], rules: { 'scope-enum': [ diff --git a/docs/README.md b/docs/README.md index ce169bf921..8715c4a37a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,13 +7,13 @@ In case you're not using any JS bundling/compilation technique, the SDK can also ### Latest SDK version ```html - + ``` ### Specific SDK version ```html - + ``` ...where `VERSION` is the version number of the SDK you want to use (eg. `13.1.0`). @@ -32,7 +32,7 @@ Usage: - + - + - + + +