Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f9812c6
added first draft of cli-api
krisbitney Oct 20, 2022
9e09bee
added awaitResponse to cli-js
krisbitney Oct 20, 2022
8279571
added test configuration to cli-js
krisbitney Oct 20, 2022
688ebf0
renamed Actions enum to DocgenActions in docgen and removed extra spa…
krisbitney Oct 20, 2022
440a3cc
added cli-js tests for build, codegen, infra, deploy, and awaitRespon…
krisbitney Oct 20, 2022
5ff3db6
reworked Commands types in cli-js
krisbitney Oct 20, 2022
7031a4a
correctly prefixing options with '--' and making them lowercase; test…
krisbitney Oct 20, 2022
fcd6a8b
init refactor CLI package
dOrgJelli Oct 20, 2022
321a1be
finish typings
dOrgJelli Oct 20, 2022
6288db2
Merge pull request #1357 from polywrap/dorgjelli/cli-js
krisbitney Oct 21, 2022
120cfc6
proper argument handling
dOrgJelli Oct 21, 2022
97a8bb2
improve required/optional semantics for command options
dOrgJelli Oct 21, 2022
e4c3fc6
ensure all option prop types are serializable
dOrgJelli Oct 21, 2022
0b45580
chore: rename js/cli-api to js/cli
dOrgJelli Oct 21, 2022
f8aeedc
feat: JS based SDK for the Polywrap CLI
dOrgJelli Oct 21, 2022
7975972
chore: remove files generated by test
dOrgJelli Oct 21, 2022
66c5e1a
chore: revert manifest migrate
dOrgJelli Oct 21, 2022
039b836
merge origin-0.10-dev
dOrgJelli Oct 26, 2022
601a78a
chore: revert --skip-codegen changes
dOrgJelli Oct 26, 2022
37c577e
chore: update js cli commands tests
dOrgJelli Oct 26, 2022
9ada2ce
chore: update cli-js readme
dOrgJelli Oct 26, 2022
0ad0609
chore: correct build options interface
dOrgJelli Oct 26, 2022
dd71980
lint fix
dOrgJelli Oct 26, 2022
f616b09
chore: fix help cli help text tests
dOrgJelli Oct 26, 2022
6d3eee5
chore: improved exec child_process security
dOrgJelli Oct 26, 2022
3c5f2e1
fix: infra --modules parsing
dOrgJelli Oct 26, 2022
3c5e400
chore: lint fix
dOrgJelli Oct 26, 2022
5f1ddd4
Merge remote-tracking branch 'origin/origin-dev' into cli-js
krisbitney Dec 20, 2022
8ff66f7
fix merge conflicts
krisbitney Dec 20, 2022
aac08bf
Merge branch 'origin-dev' into cli-js
dOrgJelli Dec 22, 2022
7a17f16
Update package.json
dOrgJelli Dec 22, 2022
1871844
using execSync and exec in CLI instead of execFileSync and execFile
krisbitney Dec 30, 2022
e90e312
fixed cwd used in local build strategy and help text from build cmd
krisbitney Jan 2, 2023
9eeae0a
removed console log form infra command and updated infra test to use …
krisbitney Jan 2, 2023
f2c71b9
removed leftover .only markers from cli build.spec.ts
krisbitney Jan 2, 2023
e0785af
Merge remote-tracking branch 'origin/origin-dev' into cli-js
krisbitney Jan 3, 2023
265b9b3
fix: infra tests
dOrgJelli Jan 4, 2023
0b4bc61
merge origin-dev
dOrgJelli Jan 4, 2023
ece1d33
fix: js cli build test
dOrgJelli Jan 4, 2023
a910c1e
chore: use codegen option
dOrgJelli Jan 4, 2023
9ac70e9
chore: fix pre-step for test command
dOrgJelli Jan 4, 2023
bc61e97
fix tests
dOrgJelli Jan 4, 2023
ea446fc
fix: properly parse option arrays
dOrgJelli Jan 4, 2023
1434836
lint fix
dOrgJelli Jan 4, 2023
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"dependencies:install": "cd dependencies && yarn",
"preinstall": "yarn dependencies:install",
"build": "yarn build:core && yarn build:interfaces && yarn link:schema && yarn build:plugins && yarn build:resolver:plugins && yarn build:config && yarn build:core:client && yarn build:client && yarn build:test-env && yarn build:cli",
"build:core": "lerna run build --no-private --ignore @polywrap/*-plugin-js --ignore @polywrap/client-config-builder-js --ignore polywrap --ignore @polywrap/core-client-js --ignore @polywrap/client-js --ignore @polywrap/test-env-js --ignore @polywrap/*-interface",
"build:core": "lerna run build --no-private --ignore @polywrap/*-plugin-js --ignore @polywrap/client-config-builder-js --ignore polywrap --ignore @polywrap/core-client-js --ignore @polywrap/client-js --ignore @polywrap/test-env-js --ignore @polywrap/*-interface --ignore @polywrap/cli-js",
"build:interfaces": "lerna run build --scope @polywrap/*-interface",
"build:plugins": "lerna run build --scope @polywrap/*-plugin-js --ignore @polywrap/*-resolver-plugin-js",
"build:resolver:plugins": "lerna run build --scope @polywrap/*-resolver-plugin-js",
"build:config": "lerna run build --scope @polywrap/client-config-builder-js",
"build:core:client": "lerna run build --scope @polywrap/core-client-js",
"build:client": "lerna run build --scope @polywrap/client-js",
"build:test-env": "lerna run build --scope @polywrap/test-env-js",
"build:cli": "lerna run build --scope polywrap",
"build:cli": "lerna run build --scope polywrap && lerna run build --scope @polywrap/cli-js",
"link:interface:deps": "yarn link:manifests && yarn link:schema",
"link:manifests": "yarn link:manifests:polywrap && yarn link:manifests:wrap",
"link:manifests:polywrap": "cd packages/js/manifests/polywrap && (yarn unlink || true) && yarn link && cd ../../../../dependencies && yarn link @polywrap/polywrap-manifest-types-js && cd ../",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"commands_build_options_codegen": "Perform code generation before build",
"commands_build_options_codegen_dir": "Codegen output directory (default: {default})",
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
"commands_build_options_s": "Strategy to use for building the wrapper",
"commands_build_options_s": "Strategy to use for building the wrapper (default: {default})",
"commands_build_options_s_strategy": "strategy",
"commands_build_options_l": "Log file to save console output to",
"commands_build_error_codegen_failed": "Code generation failed",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"commands_build_options_codegen": "Perform code generation before build",
"commands_build_options_codegen_dir": "Codegen output directory (default: {default})",
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
"commands_build_options_s": "Strategy to use for building the wrapper",
"commands_build_options_s": "Strategy to use for building the wrapper (default: {default})",
"commands_build_options_s_strategy": "strategy",
"commands_build_options_l": "Log file to save console output to",
"commands_build_error_codegen_failed": "Code generation failed",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"bin": {
"polywrap": "bin/polywrap"
},
"main": "build/index.js",
"types": "build/types/index.d.ts",
"scripts": {
"build": "yarn build:intl && yarn build:fast",
"build:fast": "rimraf ./build && tsc --project tsconfig.build.json && yarn build:build-strategies && yarn build:deploy-modules && yarn build:infra-modules && yarn build:docgen-templates",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/e2e/build-rs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GetPathToCliTestFiles } from "@polywrap/test-cases";
import fs from "fs";
import path from "path";

jest.setTimeout(700000);
jest.setTimeout(1200000);

describe("e2e tests for build command", () => {
const testCaseRoot = path.join(GetPathToCliTestFiles(), "wasm/build-cmd/rust");
Expand Down
40 changes: 20 additions & 20 deletions packages/cli/src/__tests__/e2e/build.wasm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ const HELP = `Usage: polywrap build|b [options]
Build Polywrap Projects (type: interface, wasm)

Options:
-m, --manifest-file <path> Path to the Polywrap Build manifest file
(default: polywrap.yaml | polywrap.yml)
-o, --output-dir <path> Output directory for build results
(default: ./build)
-c, --client-config <config-path> Add custom configuration to the
PolywrapClient
--codegen Perform code generation before build
--codegen-dir Codegen output directory (default:
./src/wrap)
--wrapper-envs <envs-path> Path to a JSON file containing wrapper
envs
-s, --strategy <strategy> Strategy to use for building the wrapper
(default: "vm")
-w, --watch Automatically rebuild when changes are
made (default: false)
-v, --verbose Verbose output (default: false)
-q, --quiet Suppress output (default: false)
-l, --log-file [path] Log file to save console output to
-h, --help display help for command
-m, --manifest-file <path> Path to the Polywrap Build manifest file
(default: polywrap.yaml | polywrap.yml)
-o, --output-dir <path> Output directory for build results
(default: ./build)
-c, --client-config <config-path> Add custom configuration to the
PolywrapClient
--codegen Perform code generation before build
--codegen-dir Codegen output directory (default:
./src/wrap)
--wrapper-envs <envs-path> Path to a JSON file containing wrapper
envs
-s, --strategy <vm | image | local> Strategy to use for building the wrapper
(default: vm)
-w, --watch Automatically rebuild when changes are
made (default: false)
-v, --verbose Verbose output (default: false)
-q, --quiet Suppress output (default: false)
-l, --log-file [path] Log file to save console output to
-h, --help display help for command
`;

jest.setTimeout(500000);
Expand Down Expand Up @@ -228,7 +228,7 @@ describe("e2e tests for build command", () => {
beforeAll(async () => {
await cleanupYarnLockfiles();
});

afterAll(async () => {
await cleanupYarnLockfiles();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/e2e/codegen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Generate Code For Polywrap Projects
Options:
-m, --manifest-file <path> Path to the Polywrap manifest file
(default: polywrap.yaml | polywrap.yml)
-g, --codegen-dir <path> Output directory for the generated code
-g, --codegen-dir <path> Output directory for the generated code
(default: ./src/wrap)
-s, --script <path> Path to a custom generation script
(JavaScript | TypeScript)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/e2e/help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Commands:
codegen|g [options] Generate Code For Polywrap Projects
create|c Create New Projects
deploy|d [options] Deploys Polywrap Projects
infra|i [options] <action> Modular Infrastructure-As-Code Orchestrator
test|t [options] Execute Tests
docgen|o [options] <action> Generate wrapper documentation
infra|i [options] <action> Modular Infrastructure-As-Code Orchestrator
manifest|m Inspect & Migrade Polywrap Manifests
test|t [options] Execute Tests
help [command] display help for command
`;

Expand Down
46 changes: 23 additions & 23 deletions packages/cli/src/__tests__/e2e/infra.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const HELP = `Usage: polywrap infra|i <action> [options]
Modular Infrastructure-As-Code Orchestrator

Arguments:
action
action
Infra allows you to execute the following commands:
up Start Polywrap infrastructure
down Stop Polywrap infrastructure
Expand All @@ -28,14 +28,14 @@ Arguments:
(choices: "up", "down", "vars", "config")

Options:
-m, --manifest-file <path> Path to the Polywrap Infra manifest file
(default: polywrap.infra.yaml |
polywrap.infra.yml)
-o, --modules <module,module> Use only specified modules
-v, --verbose Verbose output (default: false)
-q, --quiet Suppress output (default: false)
-l, --log-file [path] Log file to save console output to
-h, --help display help for command
-m, --manifest-file <path> Path to the Polywrap Infra manifest file
(default: polywrap.infra.yaml |
polywrap.infra.yml)
-o, --modules <module...> Use only specified modules
-v, --verbose Verbose output (default: false)
-q, --quiet Suppress output (default: false)
-l, --log-file [path] Log file to save console output to
-h, --help display help for command
`;

const portInUse = (port: number) => {
Expand Down Expand Up @@ -119,7 +119,7 @@ describe("e2e tests for infra command", () => {
);

await runPolywrapCli(
["infra", "down", "-v", "--modules=eth-ens-ipfs"],
["infra", "down", "-v", "--modules eth-ens-ipfs"],
getTestCaseDir(0),
);

Expand Down Expand Up @@ -222,7 +222,7 @@ describe("e2e tests for infra command", () => {

it("Should correctly open one process for default module because modules flag overwrites it", async () => {
await runPolywrapCli(
["infra", "up", "--modules=eth-ens-ipfs"],
["infra", "up", "--modules eth-ens-ipfs"],
getTestCaseDir(4),
);

Expand All @@ -231,7 +231,7 @@ describe("e2e tests for infra command", () => {
]);

await runPolywrapCli(
["infra", "down", "--modules=eth-ens-ipfs"],
["infra", "down", "--modules eth-ens-ipfs"],
getTestCaseDir(4),
);
});
Expand Down Expand Up @@ -291,7 +291,7 @@ describe("e2e tests for infra command", () => {

it("Should set environment up with only selected modules", async () => {
await runPolywrapCli(
["infra", "up", "--modules=ipfs"],
["infra", "up", "--modules ipfs"],
getTestCaseDir(0),
);

Expand All @@ -302,7 +302,7 @@ describe("e2e tests for infra command", () => {
]);

await runPolywrapCli(
["infra", "down", "--modules=ipfs"],
["infra", "down", "--modules ipfs"],
getTestCaseDir(0),
);

Expand All @@ -316,7 +316,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"config",
"--modules=notExistingModule,alsoNotExisting",
"--modules notExistingModule alsoNotExisting",
],
getTestCaseDir(0),
);
Expand All @@ -332,7 +332,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"up",
"--modules=eth-ens-ipfs",
"--modules eth-ens-ipfs",
"--verbose"
],
getTestCaseDir(0),
Expand All @@ -349,7 +349,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"config",
"--modules=eth-ens-ipfs",
"--modules eth-ens-ipfs",
"--verbose"
],
getTestCaseDir(2),
Expand All @@ -363,7 +363,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"config",
"--modules=eth-ens-ipfs",
"--modules eth-ens-ipfs",
"--verbose"
],
getTestCaseDir(0),
Expand All @@ -380,7 +380,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"up",
"--modules=eth-ens-ipfs",
"--modules eth-ens-ipfs",
"--verbose"
],
getTestCaseDir(3),
Expand Down Expand Up @@ -430,7 +430,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"up",
"--modules=ganache,dev-server"
"--modules ganache,dev-server"
],
getTestCaseDir(1),
);
Expand All @@ -441,7 +441,7 @@ describe("e2e tests for infra command", () => {
]);

await runPolywrapCli(
["infra", "down", "--modules=ganache,dev-server"],
["infra", "down", "--modules ganache,dev-server"],
getTestCaseDir(1),
);
});
Expand All @@ -451,7 +451,7 @@ describe("e2e tests for infra command", () => {
[
"infra",
"up",
"--modules=ipfs,ipfs-duplicate"
"--modules ipfs,ipfs-duplicate"
],
getTestCaseDir(1),
);
Expand All @@ -461,7 +461,7 @@ describe("e2e tests for infra command", () => {
]);

await runPolywrapCli(
["infra", "down", "--modules=ipfs,ipfs-duplicate"],
["infra", "down", "--modules ipfs,ipfs-duplicate"],
getTestCaseDir(1),
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/e2e/manifest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Arguments:
\"infra\", \"workflow\", default: \"project\")

Options:
-r, --raw Output raw JSON Schema (default: false)
-r, --raw Output raw JSON Schema
-m, --manifest-file <path> Path to the manifest file (default: polywrap.yaml
| polywrap.yml)
-v, --verbose Verbose output (default: false)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/e2e/no-command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Commands:
codegen|g [options] Generate Code For Polywrap Projects
create|c Create New Projects
deploy|d [options] Deploys Polywrap Projects
infra|i [options] <action> Modular Infrastructure-As-Code Orchestrator
test|t [options] Execute Tests
docgen|o [options] <action> Generate wrapper documentation
infra|i [options] <action> Modular Infrastructure-As-Code Orchestrator
manifest|m Inspect & Migrade Polywrap Manifests
test|t [options] Execute Tests
help [command] display help for command
`;

Expand Down
Loading