Skip to content

Commit

Permalink
Merge pull request #2024 from aeternity/update-deps
Browse files Browse the repository at this point in the history
Switch package type to module and update deps
  • Loading branch information
davidyuk authored Oct 17, 2024
2 parents a5fa0fb + f6f00a9 commit 700205f
Show file tree
Hide file tree
Showing 58 changed files with 3,908 additions and 2,280 deletions.
File renamed without changes.
30 changes: 0 additions & 30 deletions .github/workflows/docs-develop.yml

This file was deleted.

21 changes: 16 additions & 5 deletions .github/workflows/docs-release.yml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 "[email protected]"
- 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
7 changes: 7 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -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/**'],
};
7 changes: 0 additions & 7 deletions .mocharc.js

This file was deleted.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
presets: [
[
'@babel/preset-env',
Expand Down
7 changes: 3 additions & 4 deletions babel.esm.config.js
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ In case you're not using any JS bundling/compilation technique, the SDK can also
### Latest SDK version

```html
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script>
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.cjs"></script>
```

### Specific SDK version

```html
<script src="https://unpkg.com/@aeternity/aepp-sdk@VERSION/dist/aepp-sdk.browser-script.js"></script>
<script src="https://unpkg.com/@aeternity/aepp-sdk@VERSION/dist/aepp-sdk.browser-script.cjs"></script>
```

...where `VERSION` is the version number of the SDK you want to use (eg. `13.1.0`).
Expand All @@ -32,7 +32,7 @@ Usage:
</head>
<body>
<!-- include latest SDK version -->
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script>
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.cjs"></script>
<script type="text/javascript">
const { AeSdk, Node } = Aeternity;
Expand Down
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Create a [new issue](https://github.com/aeternity/aepp-sdk-js/issues/new) to sug

## NodeJS

1. [Contract interaction](node/contract-interaction.mjs)
2. [Transfer AE](node/transfer-ae.mjs)
3. [Paying for spend tx](node/paying-for-spend-tx.mjs)
4. [Paying for contract call tx](node/paying-for-contract-call-tx.mjs)
5. [Dry-run using debug endpoint](node/dry-run-using-debug-endpoint.mjs)
6. [Oracle](node/oracle.mjs)
1. [Contract interaction](node/contract-interaction.js)
2. [Transfer AE](node/transfer-ae.js)
3. [Paying for spend tx](node/paying-for-spend-tx.js)
4. [Paying for contract call tx](node/paying-for-contract-call-tx.js)
5. [Dry-run using debug endpoint](node/dry-run-using-debug-endpoint.js)
6. [Oracle](node/oracle.js)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// # Create and use Generalized Accounts
//
// ## Introduction
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/account-generalized.mjs)
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/account-generalized.js)
// and this page explains in detail how to:
//
// - initialize an instance of the SDK with a random account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// # Compile & Deploy a Sophia Smart Contract
//
// ## Introduction
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/contract-interaction.mjs) and this page explains in detail how to:
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/contract-interaction.js) and this page explains in detail how to:
//
// - deal with the different phases of compiling Sophia contracts to bytecode
// - deploy the bytecode to get a callable contract address
Expand Down Expand Up @@ -54,7 +54,7 @@ const aeSdk = new AeSdk({
// contract in a convenient way.
console.log(CONTRACT_SOURCE_CODE);
const contract = await Contract.initialize({
...aeSdk.getOptions(),
...aeSdk.getContext(),
sourceCode: CONTRACT_SOURCE_CODE,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/node/oracle.mjs → examples/node/oracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const aeSdk = new AeSdk({
nodes: [{ name: 'testnet', instance: node }],
accounts: [new MemoryAccount('sk_2CuofqWZHrABCrM7GY95YSQn8PyFvKQadnvFnpwhjUnDCFAWmf')],
});
await aeSdk.spend(1e14, oracleAccount.address);
await aeSdk.spend(2e14, oracleAccount.address);
console.log('Spend done');

// Creating and registering Oracle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// # InnerTx: ContractCallTx
//
// ## Introduction
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/paying-for-contract-call-tx.mjs)
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/paying-for-contract-call-tx.js)
// and this page explains in detail how to:
//
// - Create and sign a `ContractCallTx` with the `innerTx` option for an account that has no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// # InnerTx: SpendTx
//
// ## Introduction
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/paying-for-spend-tx.mjs)
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/paying-for-spend-tx.js)
// and this page explains in detail how to:
//
// - Create and sign a `SpendTx` for an account with the `innerTx` option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// # Transfer AE
//
// ## Introduction
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/transfer-ae.mjs)
// The whole script is [located in the repository](https://github.com/aeternity/aepp-sdk-js/blob/master/examples/node/transfer-ae.js)
// and this page explains in detail how to:
//
// - initialize an instance of the SDK with a pre-funded account
Expand Down
Loading

0 comments on commit 700205f

Please sign in to comment.