From 5a7f28ec4d2e1090492128764b434d82b235d296 Mon Sep 17 00:00:00 2001 From: Tim Wallace Date: Sat, 20 Jul 2024 16:05:16 -0400 Subject: [PATCH 1/2] hardcode version number for dependency --- src/cli/make.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cli/make.ts b/src/cli/make.ts index c2b95e4..34792bb 100644 --- a/src/cli/make.ts +++ b/src/cli/make.ts @@ -15,9 +15,6 @@ import { import { SingleBar, } from 'cli-progress'; -import pkg from '../../package.json' with { - type: 'json' -}; export default (args: string[], cwd: string,) => { const name = (args[FIRST_ARGUMENT] || 'benchmark') @@ -70,7 +67,7 @@ export default (args: string[], cwd: string,) => { private: true, type: 'module', dependencies: { - '@idrinth-api-bench/framework': '^' + pkg.version, + '@idrinth-api-bench/framework': '^1.0.5', }, devDependencies: { typescript: '^5.3.3', From fe679d8a8659c85178ce2df96882e4870c47b07e Mon Sep 17 00:00:00 2001 From: Tim Wallace Date: Tue, 23 Jul 2024 17:42:41 -0400 Subject: [PATCH 2/2] Unify multiple binaries into one (iabc) --- bin/iabc.js | 21 +++++++++++++++++++++ package.json | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 bin/iabc.js diff --git a/bin/iabc.js b/bin/iabc.js new file mode 100644 index 0000000..72323b0 --- /dev/null +++ b/bin/iabc.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +import make from '../src/cli/make.js'; +import create from '../src/cli/curl-route-builder.js'; + +// Retrieve command-line arguments +const args = process.argv.slice(2); +const command = args[0]; + +if (command === undefined) { + make(process.argv, process.cwd(),); +} +else { + if (command === "curl" || command === "har" || command === "open-api"){ + create(process.argv, process.cwd(),); + } + else { + throw new Error("unknown command: " + command); + } +} + + diff --git a/package.json b/package.json index f1cbb8c..edbe447 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ "iabgbfh": "bin/generate-benchmark-from-har.js", "iabmp": "bin/make-benchmark-project.js", "iabgfoa": "bin/generate-benchmark-from-open-api.js", - "iabgbfc": "bin/generate-benchmark-from-curl.js" + "iabgbfc": "bin/generate-benchmark-from-curl.js", + "iabc": "bin/iabc.js" }, "scripts": { "lint": "eslint . --ext .js,.ts,.cjs,.json,.tsx",