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

Fixes #516

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Fixes #516

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
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
},
"type": "module",
"exports": {
".": {
"types": "./build/types/lib/index.d.ts",
"import": "./build/esm/src/lib/index.js",
"default": "./build/esm/src/lib/index.js"
}
"types": "./build/types/lib/index.d.ts",
"import": "./build/esm/src/lib/index.js",
"default": "./build/esm/src/lib/index.js"
},
"files": [
"build",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function addInitOption(program) {
.option("--update", "update project files")
.option(
"--next",
"apply patches to initialise or update for use with the upcoming release",
"apply patches to initialize or update for use with the upcoming release",
)
.option("-y", "overwrite all files in update process")
.action(async (folder, option) => {
Expand Down
15 changes: 0 additions & 15 deletions src/config/config.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/init/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"artifactsDir": "/artifacts",
"updateArtifactsDir": "/update-artifacts",
"nextArtifactsDir": "/next-artifacts",
"dependencies": ["@aeternity/aepp-sdk@13"],
"dependencies": ["@aeternity/aepp-sdk@14"],
"devDependencies": ["chai@5", "chai-as-promised@8", "mocha@10"],
"uninstallDependencies": ["aeproject", "aeproject-lib"],
"deleteArtifacts": [
Expand Down
6 changes: 3 additions & 3 deletions src/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ async function patchForNextRelease(folder, y) {
}

function checkNodeVersion() {
if (parseInt(process.version.split(".")[0].replace("v", ""), 10) < 16) {
print("You need to use Node.js 16 or newer to use aeproject.");
if (parseInt(process.version.split(".")[0].replace("v", ""), 10) < 18) {
print("You need to use Node.js 18 or newer to use aeproject.");
process.exit(1);
}
}
Expand Down Expand Up @@ -75,7 +75,7 @@ async function updateAEprojectProjectLibraries(folder, update, y) {
await updateArtifacts(folder, y);
await installDependencies(folder, update);

print("===== aeproject sucessfully initalized =====");
print("===== aeproject successfully initialized =====");
print(
"test/exampleTest.js and contract/ExampleContract.aes have been added as example how to use aeproject",
);
Expand Down
1 change: 0 additions & 1 deletion src/init/update-artifacts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.6"
services:
aeproject_node:
image: aeternity/aeternity:${NODE_TAG:-v7.2.0}-bundle
Expand Down
6 changes: 4 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ export function getDefaultAccounts(): MemoryAccount[] {
);
}

export function getSdk(options: {}): AeSdk {
export function getSdk(
options: ConstructorParameters<typeof Node>[1] &
ConstructorParameters<typeof CompilerHttp>[1],
): AeSdk {
const instance = new Node(networks.devmode.nodeUrl, options);

return new AeSdk({
accounts: getDefaultAccounts(),
nodes: [{ name: "node", instance }],
onCompiler: new CompilerHttp(networks.devmode.compilerUrl, options),
interval: 50,
});
}

Expand Down
26 changes: 0 additions & 26 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
import { readFile } from "fs/promises";

const config = JSON.parse(
await readFile(new URL("../config/config.json", import.meta.url)),
);

export function getNetwork(network) {
const networks = {
local: {
url: config.localhostParams.url,
networkId: config.localhostParams.networkId,
},
testnet: {
url: config.testNetParams.url,
networkId: config.testNetParams.networkId,
},
mainnet: {
url: config.mainNetParams.url,
networkId: config.mainNetParams.networkId,
},
};

return networks[network];
}

export const print = console.log;
export const printError = console.error;
export { config };
Loading