Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support latest node #503

Closed
wants to merge 5 commits into from
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
20 changes: 7 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@ jobs:
build-and-test:
strategy:
matrix:
node-version: [ 16, 18, 20 ]
node-version: [ 16, 18, 20, 21 ]
node-tag: [latest]
compiler-tag: [latest]
compiler-tag: [v7.6.1] # latest is v8.0.0-rc1 which is not supported by the sdk currently

# for lts node also test first known compatible and latest known good compiler and node versions
include:
- node-version: 18
- node-version: 20
node-tag: v6.8.0 # v6.3.0 to v6.7.0 use a different config format
compiler-tag: latest
- node-version: 18
node-tag: v6.11.0
compiler-tag: latest
- node-version: 18
node-tag: latest
compiler-tag: v7.5.0
- node-version: 18
node-tag: latest
compiler-tag: v7.6.0
compiler-tag: v7.4.0
- node-version: 20
node-tag: v6.12.0
compiler-tag: v7.6.1

runs-on: ubuntu-latest

Expand Down
1,377 changes: 812 additions & 565 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@
"test": "mocha ./tests/**/*.js --timeout 0 --exit",
"prepublishOnly": "npm run build",
"copy-files": "cp -r ./src/init/artifacts ./.build/cjs/src/init/ && cp -r ./src/init/artifacts ./.build/esm/src/init/ && cp -r ./src/init/update-artifacts ./.build/cjs/src/init/ && cp -r ./src/init/update-artifacts ./.build/esm/src/init/",
"link:local": "npm run build && npm link"
"link:local": "npm run build:clean && npm run build && npm link"
},
"license": "ISC",
"engines": {
"npm": ">=8.0.0",
"node": ">=16.0.0"
},
"dependencies": {
"@aeternity/aepp-sdk": "^13.2.1",
"@aeternity/aepp-sdk": "^13.2.2",
"commander": "^11.0.0",
"promisify-child-process": "^4.1.2",
"prompts": "^2.4.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"chai": "^4.3.8",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chai": "^4.4.1",
"chai-files": "^1.4.0",
"eslint": "^8.49.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"mocha": "^10.2.0",
"typescript": "^5.2.2"
"eslint-plugin-import": "^2.29.1",
"mocha": "^10.3.0",
"typescript": "^5.3.3"
}
}
2 changes: 1 addition & 1 deletion src/env/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function startEnv(option) {

await getDockerCompose();
await exec(`${versionTags} ${dockerComposeCmd} pull`);
await exec(`${versionTags} ${dockerComposeCmd} up -d --wait`);
await exec(`${versionTags} ${dockerComposeCmd} up -d`);

await ensureNodeAndCompilerAvailable();

Expand Down
9 changes: 5 additions & 4 deletions src/init/artifacts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"test": "mocha ./test/**/*.js --timeout 0 --exit"
},
"dependencies": {
"@aeternity/aepp-sdk": "^13.2.1"
"@aeternity/aepp-sdk": "^13.2.2"
},
"devDependencies": {
"@aeternity/aeproject": "^4.8.2",
"chai": "^4.3.8",
"mocha": "^10.2.0"
"@aeternity/aeproject": "^4.8.3",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"mocha": "^10.3.0"
}
}
5 changes: 4 additions & 1 deletion src/init/update-artifacts/contracts/ExampleContract.aes
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ main contract Example =
Chain.event(SetXEvent(Call.caller, x))
put(Some(x))

entrypoint get() : option(int) = state
entrypoint get() : int =
switch(state)
None => abort("NOTHING_SET_YET")
Some(var) => var
5 changes: 3 additions & 2 deletions src/init/update-artifacts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ version: '3.6'
services:

aeproject_node:
image: aeternity/aeternity:${NODE_TAG:-v6.11.0}-bundle
image: aeternity/aeternity:${NODE_TAG:-v6.12.0}-bundle
hostname: node
environment:
AETERNITY_CONFIG: /home/aeternity/aeternity.yaml
AE__SYSTEM__CUSTOM_PREFUNDED_ACCS_FILE: '/home/aeternity/node/data/aecore/.genesis/accounts_test.json'
volumes:
- './docker/aeternity.yaml:/home/aeternity/aeternity.yaml'
- './docker/accounts.json:/home/aeternity/node/data/aecore/.genesis/accounts_test.json'

aeproject_compiler:
image: aeternity/aesophia_http:${COMPILER_TAG:-v7.6.0}
image: aeternity/aesophia_http:${COMPILER_TAG:-v7.6.1}
hostname: compiler
ports:
- '3080:3080'
Expand Down
7 changes: 5 additions & 2 deletions src/init/update-artifacts/test/exampleTest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { assert } = require('chai');
const { utils } = require('@aeternity/aeproject');
const chaiAsPromised = require("chai-as-promised");
const chai = require("chai");

chai.use(chaiAsPromised);

const EXAMPLE_CONTRACT_SOURCE = './contracts/ExampleContract.aes';

Expand Down Expand Up @@ -40,7 +44,6 @@ describe('ExampleContract', () => {
});

it('ExampleContract: get undefined when not set before', async () => {
const { decodedResult } = await contract.get();
assert.equal(decodedResult, undefined);
await assert.isRejected(contract.get(), "NOTHING_SET_YET");
});
});
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = require('../config/config.json');
// eslint-disable-next-line no-promise-executor-return
const pause = async (duration) => new Promise((resolve) => setTimeout(resolve, duration));

const ensureNodeAndCompilerAvailable = async (interval = 200, attempts = 1000) => {
const ensureNodeAndCompilerAvailable = async (interval = 100, attempts = 1200) => {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < attempts; i++) {
// eslint-disable-next-line no-await-in-loop
Expand Down
3 changes: 2 additions & 1 deletion tests/happy-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { exec: execP } = require('promisify-child-process');
const fs = require('fs');
const chai = require('chai');
const chaiFiles = require('chai-files');

const { isEnvRunning } = require('../src/env/env');
const { version } = require('../package.json');
const { print } = require("../src/utils/utils");
Expand All @@ -16,7 +17,7 @@ const exec = (cmd, options) => execP(`${fs.existsSync('~/.profile') ? '. ~/.prof

describe('Happy Path', () => {
before(async () => {
await exec('npm link');
await exec('npm run link:local');
if (!fs.existsSync(cwd)) fs.mkdirSync(cwd);
});

Expand Down
Loading