genlayer 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
2
 
3
+ ## 0.3.1 (2024-11-19)
4
+
3
5
  ## 0.3.0 (2024-11-15)
4
6
 
5
7
 
package/dist/index.js CHANGED
@@ -31,6 +31,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
31
31
  var __commonJS = (cb, mod) => function __require() {
32
32
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
33
33
  };
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, { get: all[name], enumerable: true });
37
+ };
34
38
  var __copyProps = (to, from3, except, desc) => {
35
39
  if (from3 && typeof from3 === "object" || typeof from3 === "function") {
36
40
  for (let key of __getOwnPropNames(from3))
@@ -47,6 +51,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
47
51
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
48
52
  mod
49
53
  ));
54
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
55
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
51
56
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
52
57
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
@@ -46391,6 +46396,13 @@ var require_set = __commonJS({
46391
46396
  }
46392
46397
  });
46393
46398
 
46399
+ // src/index.ts
46400
+ var src_exports = {};
46401
+ __export(src_exports, {
46402
+ initializeCLI: () => initializeCLI
46403
+ });
46404
+ module.exports = __toCommonJS(src_exports);
46405
+
46394
46406
  // node_modules/commander/esm.mjs
46395
46407
  var import_index = __toESM(require_commander(), 1);
46396
46408
  var {
@@ -46409,7 +46421,7 @@ var {
46409
46421
  } = import_index.default;
46410
46422
 
46411
46423
  // package.json
46412
- var version = "0.3.0";
46424
+ var version = "0.3.1";
46413
46425
 
46414
46426
  // src/lib/config/text.ts
46415
46427
  var CLI_DESCRIPTION = "GenLayer CLI is a development environment for the GenLayer ecosystem. It allows developers to interact with the protocol by creating accounts, sending transactions, and working with Intelligent Contracts by testing, debugging, and deploying them.";
@@ -50189,9 +50201,16 @@ function initializeGeneralCommands(program2) {
50189
50201
  }
50190
50202
 
50191
50203
  // src/index.ts
50192
- program.version(version).description(CLI_DESCRIPTION);
50193
- initializeGeneralCommands(program);
50194
- program.parse(process.argv);
50204
+ function initializeCLI() {
50205
+ program.version(version).description(CLI_DESCRIPTION);
50206
+ initializeGeneralCommands(program);
50207
+ program.parse(process.argv);
50208
+ }
50209
+ initializeCLI();
50210
+ // Annotate the CommonJS export names for ESM import in node:
50211
+ 0 && (module.exports = {
50212
+ initializeCLI
50213
+ });
50195
50214
  /*! Bundled license information:
50196
50215
 
50197
50216
  safe-buffer/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {program} from "commander";
3
3
  import {version} from "../package.json";
4
- import {CLI_DESCRIPTION} from "@/lib/config/text";
5
- import {initializeGeneralCommands} from "@/commands/general";
4
+ import {CLI_DESCRIPTION} from "../src/lib/config/text";
5
+ import {initializeGeneralCommands} from "../src/commands/general";
6
6
 
7
- program.version(version).description(CLI_DESCRIPTION);
7
+ export function initializeCLI() {
8
+ program.version(version).description(CLI_DESCRIPTION);
9
+ initializeGeneralCommands(program);
10
+ program.parse(process.argv);
11
+ }
8
12
 
9
- initializeGeneralCommands(program);
10
-
11
- program.parse(process.argv);
13
+ initializeCLI();
@@ -0,0 +1,21 @@
1
+ import { describe, it, vi, expect } from "vitest";
2
+ import { initializeCLI } from "../src/index";
3
+
4
+ vi.mock("commander", () => ({
5
+ program: {
6
+ version: vi.fn().mockReturnThis(),
7
+ description: vi.fn().mockReturnThis(),
8
+ parse: vi.fn(),
9
+ },
10
+ }));
11
+
12
+ vi.mock("../src/commands/general", () => ({
13
+ initializeGeneralCommands: vi.fn(),
14
+ }));
15
+
16
+
17
+ describe("CLI", () => {
18
+ it("should initialize CLI", () => {
19
+ expect(initializeCLI).not.toThrow();
20
+ });
21
+ });
package/vitest.config.ts CHANGED
@@ -5,7 +5,7 @@ export default defineConfig({
5
5
  globals: true,
6
6
  environment: 'jsdom',
7
7
  coverage: {
8
- exclude: [...configDefaults.exclude, '*.js', 'src/index.ts', 'tests/**/*.ts', 'src/types'],
8
+ exclude: [...configDefaults.exclude, '*.js', 'tests/**/*.ts', 'src/types'],
9
9
  }
10
10
  }
11
11
  });
@@ -1,9 +0,0 @@
1
- export class MissingRequirementError extends Error {
2
- requirement: string;
3
-
4
- constructor(requirement: string) {
5
- super(`${requirement} is not installed. Please install ${requirement}.`);
6
- this.name = "MissingRequirement";
7
- this.requirement = requirement;
8
- }
9
- }