Skip to content

Commit

Permalink
chore: Major versions bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Mar 12, 2024
1 parent b18c7fa commit 8465f2a
Show file tree
Hide file tree
Showing 7 changed files with 3,366 additions and 2,066 deletions.
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
],
"dependencies": {
"@iarna/toml": "^2.2.5",
"@oclif/core": "2.10.0",
"@oclif/plugin-help": "5.2.14",
"@oclif/plugin-plugins": "3.1.8",
"@oclif/plugin-version": "1.3.7",
"@oclif/core": "3.24.0",
"@oclif/plugin-help": "6.0.18",
"@oclif/plugin-plugins": "4.3.5",
"@oclif/plugin-version": "2.0.14",
"@polkadot/api": "10.12.2",
"@polkadot/api-augment": "10.12.2",
"@polkadot/api-contract": "10.12.2",
Expand All @@ -34,34 +34,34 @@
"@polkadot/util-crypto": "12.6.2",
"bn.js": "5.2.1",
"chalk": "5.3.0",
"change-case": "4.1.2",
"change-case": "5.4.3",
"decompress": "4.2.1",
"enquirer": "^2.4.1",
"execa": "7.2.0",
"execa": "8.0.1",
"fs-extra": "11.2.0",
"globby": "^13.1.4",
"globby": "^14.0.1",
"handlebars": "4.7.8",
"inquirer": "9.2.15",
"inquirer-fuzzy-path": "^2.3.0",
"listr2": "6.6.0",
"listr2": "8.0.2",
"lodash-es": "^4.17.21",
"mocha": "10.3.0",
"mocha-suppress-logs": "0.3.1",
"mocha-suppress-logs": "0.5.1",
"mochawesome": "7.1.3",
"modern-errors": "^6.0.0",
"modern-errors-bugs": "^4.0.0",
"modern-errors-clean": "^5.0.0",
"modern-errors-winston": "^4.0.0",
"modern-errors": "^7.0.0",
"modern-errors-bugs": "^5.0.0",
"modern-errors-clean": "^6.0.0",
"modern-errors-winston": "^5.0.0",
"node-downloader-helper": "2.1.9",
"ora": "6.3.1",
"ora": "8.0.1",
"semver": "7.6.0",
"shelljs": "0.8.5",
"toml": "^3.0.0",
"ts-mocha": "^10.0.0",
"winston": "^3.12.0"
},
"devDependencies": {
"@oclif/test": "2.4.0",
"@oclif/test": "3.2.5",
"@types/bn.js": "^5.1.5",
"@types/chai": "4",
"@types/decompress": "4.2.7",
Expand All @@ -74,14 +74,14 @@
"@types/node": "^20.11.26",
"@types/semver": "7.5.8",
"@types/shelljs": "0.8.12",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"chai": "4",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"chai": "5",
"eslint": "8.57.0",
"eslint-config-prettier": "8.9.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"nodemon": "^3.1.0",
"oclif": "3.10.0",
"oclif": "4.5.4",
"prettier": "3.2.5",
"shx": "0.3.4",
"ts-node": "10.9.2",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/contract/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
getSwankyConfig,
} from "../../lib/index.js";
import { email, name, pickTemplate } from "../../lib/prompts.js";
import { paramCase, pascalCase, snakeCase } from "change-case";
import { kebabCase, pascalCase, snakeCase } from "change-case";
import { execaCommandSync } from "execa";
import inquirer from "inquirer";
import { SwankyCommand } from "../../lib/swankyCommand.js";
Expand Down Expand Up @@ -96,7 +96,7 @@ export class NewContract extends SwankyCommand<typeof NewContract> {
await this.spinner.runCommand(
() =>
processTemplates(projectPath, {
project_name: paramCase(this.config.pjson.name),
project_name: kebabCase(this.config.pjson.name),
author_name: answers.authorName,
author_email: answers.email,
swanky_version: this.config.pjson.version,
Expand Down
7 changes: 3 additions & 4 deletions src/commands/env/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import { ConfigBuilder } from "../../lib/config-builder.js";
export class Install extends SwankyCommand<typeof Install> {
static flags = {
deps: Flags.string({
required: false,
description: `Install the specified dev dependency name and version in the format <dependency@version>. The following options are supported: ${Object.keys(
SUPPORTED_DEPS
).join(", ")}. For installing rust nightly version run: env install --deps rust@nightly`,
multiple: true,
default: [],
char: "d",
}),
};

async run(): Promise<void> {
const { flags } = await this.parse(Install);
const depsArray = flags.deps ?? [];

const localConfig = getSwankyConfig('local') as SwankyConfig;
const depsToInstall = flags.deps.length > 0 ? this.parseDeps(flags.deps) : localConfig.env;
const depsToInstall = depsArray.length > 0 ? this.parseDeps(depsArray) : localConfig.env;

if (Object.keys(depsToInstall).length === 0) {
this.log("No dependencies to install.");
Expand All @@ -32,7 +31,7 @@ export class Install extends SwankyCommand<typeof Install> {

await this.installDeps(depsToInstall);

if (flags.deps.length > 0) {
if (depsArray.length > 0) {
await this.updateLocalConfig(depsToInstall);
}

Expand Down
5 changes: 2 additions & 3 deletions src/commands/generate/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ConfigError, FileError, InputError } from "../../lib/errors.js";
import path from "node:path";
import { existsSync } from "node:fs";
import inquirer from "inquirer";
import { paramCase, pascalCase } from "change-case";
import { kebabCase, pascalCase } from "change-case";
import { TestType } from "../../index.js";

export class GenerateTests extends SwankyCommand<typeof GenerateTests> {
Expand All @@ -15,7 +15,6 @@ export class GenerateTests extends SwankyCommand<typeof GenerateTests> {
static args = {
contractName: Args.string({
name: "contractName",
required: false,
description: "Name of the contract",
}),
};
Expand Down Expand Up @@ -151,7 +150,7 @@ export class GenerateTests extends SwankyCommand<typeof GenerateTests> {
await this.spinner.runCommand(
() =>
processTemplates(projectPath, {
project_name: paramCase(this.config.pjson.name),
project_name: kebabCase(this.config.pjson.name),
swanky_version: this.config.pjson.version,
contract_name: contractName ?? "",
contract_name_pascal: contractName ? pascalCase(contractName) : "",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from "node:path";
import { copy, ensureDir, outputFile, pathExists, readJSON, remove, writeJSON } from "fs-extra/esm";
import { readdir, readFile, stat } from "fs/promises";
import { execaCommand, execaCommandSync } from "execa";
import { paramCase, pascalCase, snakeCase } from "change-case";
import { kebabCase, pascalCase, snakeCase } from "change-case";
import inquirer from "inquirer";
import TOML from "@iarna/toml";
import { choice, email, name, pickNodeVersion, pickTemplate } from "../../lib/prompts.js";
Expand Down Expand Up @@ -259,7 +259,7 @@ export class Init extends SwankyCommand<typeof Init> {
args: [
this.projectPath,
{
project_name: paramCase(projectName),
project_name: kebabCase(projectName),
author_name: authorName,
author_email: authorEmail,
swanky_version: this.config.pjson.version,
Expand Down Expand Up @@ -328,7 +328,7 @@ export class Init extends SwankyCommand<typeof Init> {
args: [
this.projectPath,
{
project_name: paramCase(projectName),
project_name: kebabCase(projectName),
swanky_version: this.config.pjson.version,
},
],
Expand Down
15 changes: 7 additions & 8 deletions src/commands/zombienet/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ export class InitZombienet extends SwankyCommand<typeof InitZombienet> {
binaries: Flags.string({
char: "b",
multiple: true,
required: false,
options: zombienetBinariesList,
default: [],
description: "Binaries to install",
}),
};

async run(): Promise<void> {
const { flags } = await this.parse(InitZombienet);
const binArray = flags.deps ?? [];

const localConfig = getSwankyConfig("local") as SwankyConfig;

Expand All @@ -55,11 +54,11 @@ As a result users of MacOS need to clone the Polkadot repo (https://github.com/p
binaries: {},
};

if (!flags.binaries.includes("polkadot")) {
flags.binaries.push("polkadot");
if (!binArray.includes("polkadot")) {
binArray.push("polkadot");
}

for (const binaryName of flags.binaries) {
for (const binaryName of binArray) {
if (platform === "darwin" && binaryName.startsWith("polkadot")) {
continue;
}
Expand All @@ -80,22 +79,22 @@ As a result users of MacOS need to clone the Polkadot repo (https://github.com/p

const configPath = path.resolve(projectPath, "zombienet", "config");

if (flags.binaries.length === 1 && flags.binaries[0] === "polkadot") {
if (binArray.length === 1 && binArray[0] === "polkadot") {
await spinner.runCommand(
() =>
copyZombienetTemplateFile(zombienetTemplatePath, configPath),
"Copying template files",
);
} else {
await spinner.runCommand(
() => buildZombienetConfigFromBinaries(flags.binaries, zombienetTemplatePath, configPath),
() => buildZombienetConfigFromBinaries(binArray, zombienetTemplatePath, configPath),
"Copying template files",
);
}

// Install binaries based on zombie config
await this.spinner.runCommand(
() => downloadZombienetBinaries(flags.binaries, projectPath, localConfig, this.spinner),
() => downloadZombienetBinaries(binArray, projectPath, localConfig, this.spinner),
"Downloading Zombienet binaries",
);

Expand Down
Loading

0 comments on commit 8465f2a

Please sign in to comment.