Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
bcd1f23
refactor(core): TUri with Uri
Niraj-Kamdar Dec 26, 2022
8443d6d
refactor: core-client
Niraj-Kamdar Dec 26, 2022
06910ff
refactor: client-config-builder
Niraj-Kamdar Dec 26, 2022
edef748
refactor: polywrap-client
Niraj-Kamdar Dec 26, 2022
5837b7f
fix: build process
Niraj-Kamdar Dec 30, 2022
55f82e7
wip: fix tests
Niraj-Kamdar Jan 2, 2023
6fe69ea
fix: plugin tests
Niraj-Kamdar Jan 2, 2023
a01e993
fix: issues
Niraj-Kamdar Jan 2, 2023
d76067c
wip
Niraj-Kamdar Jan 3, 2023
0a78395
wip
Niraj-Kamdar Jan 3, 2023
5960855
fix: issues
Niraj-Kamdar Jan 3, 2023
b07cc6a
Merge remote-tracking branch 'upstream/origin-dev' into nk/refactor-c…
Niraj-Kamdar Jan 3, 2023
2efe763
wip
Niraj-Kamdar Jan 3, 2023
ac5e306
fix: issues
Niraj-Kamdar Jan 3, 2023
e1f92e1
fix: plugin
Niraj-Kamdar Jan 3, 2023
4675647
fix: custom config issues
Niraj-Kamdar Jan 3, 2023
d7a512e
fix: plugin tests
Niraj-Kamdar Jan 3, 2023
77feb4c
wip: fixes
Niraj-Kamdar Jan 4, 2023
9e59d65
wip
Niraj-Kamdar Jan 4, 2023
09fad8b
fix: issues
Niraj-Kamdar Jan 5, 2023
77cf007
debug
Niraj-Kamdar Jan 6, 2023
ccbbac3
wip working
Niraj-Kamdar Jan 6, 2023
ffebf2e
fix: issue
Niraj-Kamdar Jan 10, 2023
a6d9b86
Merge with origin-dev
pileks Jan 10, 2023
93194b7
fix issues in merge with origin-dev
pileks Jan 11, 2023
17e6924
chore: remove debug code
pileks Jan 11, 2023
4840030
chore: lint
pileks Jan 11, 2023
fdc2536
Fix client tests, remove console.logs
pileks Jan 12, 2023
a8a1cef
Merge remote-tracking branch 'origin/origin-dev' into pileks/refactor…
pileks Jan 12, 2023
63e88c1
Merge remote-tracking branch 'origin/origin-dev' into temp
pileks Jan 12, 2023
fa5f407
chore: fix tests
pileks Jan 12, 2023
3fcd635
chore: fix package dependencies
pileks Jan 12, 2023
c0092e6
fix up resolvers, return tests
pileks Jan 13, 2023
bbe48dd
chore:lint
pileks Jan 14, 2023
760574e
chore(js/client): uncomment build wrappers function in uri resolution…
cbrzn Jan 16, 2023
1251f85
parseWrapperEnvsOption should be able to accept false for file path
pileks Jan 17, 2023
a4f08e3
clientConfigBuilder - move wrapperCache and resolver from constructor…
pileks Jan 17, 2023
043ced7
Merge remote-tracking branch 'origin/origin-dev' into pileks/refactor…
pileks Jan 18, 2023
30d57f1
chore: fix up post-merge issues
pileks Jan 18, 2023
e250e4e
chore: update with latest changes from origin-dev
cbrzn Jan 25, 2023
4811d71
chore: update with latest from refactor
cbrzn Jan 25, 2023
b6c0db2
chore: fix conflicts
cbrzn Jan 25, 2023
6a54ba1
fix build
cbrzn Jan 25, 2023
b924069
Merge pull request #1484 from polywrap/pileks/bugfix/client-config-bu…
Niraj-Kamdar Jan 26, 2023
2a428dc
Return defaultWrappers/packages/interfaces as configbuilder package e…
pileks Jan 27, 2023
1ab298b
chore: remove type aliases
pileks Jan 27, 2023
ea12e59
WIP: Remove ClientConfigBuilder.build and replace it with buildCoreCo…
pileks Jan 28, 2023
3fe3b5a
fix up package builds
pileks Jan 28, 2023
a8382fb
fix test cases
pileks Jan 28, 2023
fa458f0
fix test cases and lint
pileks Jan 29, 2023
c7b1b07
fix wasm-wrapper test
pileks Jan 29, 2023
6419ef6
rename legacy client configuration types
pileks Jan 29, 2023
151a43d
move legacy configuration types to client-js package
pileks Jan 29, 2023
39a082b
chore: fix tests
pileks Jan 30, 2023
c1cae91
client - rename files in legacy folder
pileks Jan 30, 2023
ebf6413
chore: lint
pileks Jan 30, 2023
6e1f2cc
chore: fix tests
pileks Jan 30, 2023
a3c356f
refactor ClientConfigBuilder & fix up related tests
pileks Jan 30, 2023
09ccb13
chore: lint
pileks Jan 30, 2023
bc8ee1d
Merge pull request #1498 from polywrap/pileks/refactor-client-updates…
cbrzn Jan 31, 2023
dfd392f
merge with origin-dev
pileks Jan 31, 2023
8a3e9c7
chore: update readme
pileks Jan 31, 2023
7ae6a87
Merge branch 'pileks/refactor-client-updates' of github.com:polywrap/…
pileks Jan 31, 2023
cb6a60c
Merge remote-tracking branch 'origin/origin-dev' into pileks/refactor…
pileks Jan 31, 2023
3aa8ac6
add config property to IClientConfigBuilder, remove arguments from Ba…
pileks Feb 1, 2023
db18606
Merge with 'origin-dev'
pileks Feb 1, 2023
f876383
fix up default config, tests
pileks Feb 2, 2023
a79726c
chore: lint
pileks Feb 2, 2023
259d531
fix plugin test cases, remove tracing dependency from client-config-b…
pileks Feb 2, 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
3 changes: 1 addition & 2 deletions packages/cli/src/__tests__/unit/jobrunner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { buildWrapper } from "@polywrap/test-env-js";
import { testCases } from "./jobrunner-test-cases";
import { JobRunner } from "../../lib";
import path from "path";
import { ClientConfigBuilder } from "@polywrap/client-config-builder-js";
import { IClientConfigBuilder } from "@polywrap/client-config-builder-js/build/IClientConfigBuilder";
import { ClientConfigBuilder, IClientConfigBuilder } from "@polywrap/client-config-builder-js";

jest.setTimeout(200000);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
import { Uri } from "@polywrap/core-js";
import path from "path";
import { parseWrapperEnvsOption } from "../../../lib";

describe("unit tests for option-parsers", () => {
describe("wrapper-envs", () => {
const sampleFileEnvs = [
{
uri: Uri.from("wrap://ens/hello-world.polywrap.eth"),
env: {
foo: "bar",
const sampleFileEnvs = {
"ens/ethereum.polywrap.eth": {
connection: {
networkNameOrChainId: "mainnet",
node: "https://mainnet.infura.io/v3/some_api_key",
},
},
{
uri: Uri.from("ens/ethereum.polywrap.eth"),
env: {
connection: {
node: "https://mainnet.infura.io/v3/some_api_key",
networkNameOrChainId: "mainnet",
},
},
},
];
"ens/hello-world.polywrap.eth": { foo: "bar" },
};

it("Should return undefined when no filename is provided", async () => {
it("Should return undefined when undefined is provided for wrapperEnvsPath", async () => {
const envs = await parseWrapperEnvsOption(undefined);

expect(envs).toBeUndefined();
});

it("Should return undefined when false is provided for wrapperEnvsPath", async () => {
const envs = await parseWrapperEnvsOption(false);

expect(envs).toBeUndefined();
});

it("Should throw for a nonexistent wrapper-env file", async () => {
const nonExistentFilePath = path.join(
__dirname,
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import {
import { defaultCodegenDir } from "../lib/defaults/defaultCodegenDir";

import readline from "readline";
import { Env, PolywrapClient } from "@polywrap/client-js";
import { PolywrapClient } from "@polywrap/client-js";
import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js";
import { Uri } from "@polywrap/core-js";

const defaultOutputDir = "./build";
const defaultStrategy = SupportedStrategies.VM;
Expand Down Expand Up @@ -178,11 +177,11 @@ async function run(options: Required<BuildCommandOptions>) {
const configBuilder = await parseClientConfigOption(clientConfig);

if (envs) {
configBuilder.addEnvs(envs as Env<Uri>[]);
configBuilder.addEnvs(envs);
}

// Get Client
const client = new PolywrapClient(configBuilder.buildCoreConfig(), {
const client = new PolywrapClient(configBuilder.build(), {
noDefaults: true,
});

Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/commands/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
import { ScriptCodegenerator } from "../lib/codegen/ScriptCodeGenerator";
import { defaultCodegenDir } from "../lib/defaults/defaultCodegenDir";

import { Env, PolywrapClient } from "@polywrap/client-js";
import { Uri } from "@polywrap/core-js";
import { PolywrapClient } from "@polywrap/client-js";

const pathStr = intlMsg.commands_codegen_options_o_path();
const defaultManifestStr = defaultPolywrapManifest.join(" | ");
Expand Down Expand Up @@ -103,11 +102,11 @@ async function run(options: Required<CodegenCommandOptions>) {
const configBuilder = await parseClientConfigOption(clientConfig);

if (envs) {
configBuilder.addEnvs(envs as Env<Uri>[]);
configBuilder.addEnvs(envs);
}

// Get Client
const client = new PolywrapClient(configBuilder.buildCoreConfig(), {
const client = new PolywrapClient(configBuilder.build(), {
noDefaults: true,
});

Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/commands/docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import { scriptPath as jsdocScriptPath } from "../lib/docgen/jsdoc";
import { scriptPath as schemaScriptPath } from "../lib/docgen/schema";
import { ScriptCodegenerator } from "../lib/codegen/ScriptCodeGenerator";

import { Env, PolywrapClient } from "@polywrap/client-js";
import { PolywrapClient } from "@polywrap/client-js";
import chalk from "chalk";
import { Argument } from "commander";
import { Uri } from "@polywrap/core-js";

const commandToPathMap: Record<string, string> = {
schema: schemaScriptPath,
Expand Down Expand Up @@ -141,7 +140,7 @@ async function run(
const configBuilder = await parseClientConfigOption(clientConfig);

if (envs) {
configBuilder.addEnvs(envs as Env<Uri>[]);
configBuilder.addEnvs(envs);
}

let project = await getProjectFromManifest(manifestFile, logger);
Expand All @@ -161,7 +160,7 @@ async function run(
// Resolve custom script
const customScript = require.resolve(commandToPathMap[action]);

const client = new PolywrapClient(configBuilder.buildCoreConfig(), {
const client = new PolywrapClient(configBuilder.build(), {
noDefaults: true,
});

Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { createLogger } from "./utils/createLogger";
import path from "path";
import yaml from "yaml";
import fs from "fs";
import { Env, Uri } from "@polywrap/core-js";

export interface TestCommandOptions extends BaseCommandOptions {
clientConfig: string | false;
Expand Down Expand Up @@ -109,7 +108,7 @@ const _run = async (options: Required<TestCommandOptions>) => {
const configBuilder = await parseClientConfigOption(clientConfig);

if (envs) {
configBuilder.addEnvs(envs as Env<Uri>[]);
configBuilder.addEnvs(envs);
}

const manifestPath = path.resolve(manifestFile);
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "./uuid";
export * from "./validate-client-config";
export * from "./workflow-validator";
export * from "./wrap";
131 changes: 0 additions & 131 deletions packages/cli/src/lib/helpers/validate-client-config.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/cli/src/lib/option-parsers/wrapper-envs.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { loadEnvironmentVariables } from "../system";

import { ClientConfigBuilder } from "@polywrap/client-config-builder-js";
import { Env, Uri } from "@polywrap/core-js";
import fs from "fs";
import YAML from "yaml";

type WrapperEnvs = Record<string, Record<string, unknown>>;

export async function parseWrapperEnvsOption(
wrapperEnvsPath: string | false | undefined
): Promise<Readonly<Env<Uri>[]> | undefined> {
): Promise<Readonly<Record<string, Record<string, unknown>>> | undefined> {
if (!wrapperEnvsPath) {
return undefined;
}
Expand Down Expand Up @@ -41,5 +40,5 @@ export async function parseWrapperEnvsOption(
builder.addEnv(env, wrapperEnvs[env]);
}

return builder.buildCoreConfig().envs;
return builder.config.envs;
}
Loading