Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 3 deletions packages/interfaces/file-system/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions packages/interfaces/file-system/deployment.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/interfaces/file-system/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/interfaces/file-system/polywrap.deploy.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions packages/interfaces/file-system/polywrap.yaml

This file was deleted.

11 changes: 10 additions & 1 deletion packages/js/client-config-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export const defaultPackages = {
http: "wrap://plugin/http",
httpResolver: "wrap://ens/http-resolver.polywrap.eth",
logger: "wrap://plugin/logger",
fileSystem: "wrap://ens/fs.polywrap.eth",
fileSystem: "wrap://plugin/fs",
fileSystemResolver: "wrap://ens/fs-resolver.polywrap.eth",
ipfsResolver: "wrap://ens/ipfs-resolver.polywrap.eth",
concurrent: "wrap://plugin/concurrent",
Expand All @@ -544,6 +544,7 @@ export const defaultInterfaces = {
concurrent: "wrap://ens/goerli/interface.concurrent.wrappers.eth",
logger: "wrap://ens/wrappers.polywrap.eth:logger@1.0.0",
http: "wrap://ens/wrappers.polywrap.eth:http@1.1.0",
fileSystem: "wrap://ens/wrappers.polywrap.eth:file-system@1.0.0",
};

export const getDefaultConfig = (): ClientConfig<Uri> => {
Expand Down Expand Up @@ -588,6 +589,14 @@ export const getDefaultConfig = (): ClientConfig<Uri> => {
from: new Uri(defaultInterfaces.http),
to: new Uri(defaultPackages.http),
},
{
from: new Uri("wrap://ens/fs.polywrap.eth"),
to: new Uri(defaultInterfaces.fileSystem),
},
{
from: new Uri(defaultInterfaces.fileSystem),
to: new Uri(defaultPackages.fileSystem),
},
],
interfaces: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const defaultPackages = {
http: "wrap://plugin/http",
httpResolver: "wrap://ens/http-resolver.polywrap.eth",
logger: "wrap://plugin/logger",
fileSystem: "wrap://ens/fs.polywrap.eth",
fileSystem: "wrap://plugin/fs",
fileSystemResolver: "wrap://ens/fs-resolver.polywrap.eth",
ipfsResolver: "wrap://ens/ipfs-resolver.polywrap.eth",
concurrent: "wrap://plugin/concurrent",
Expand All @@ -49,6 +49,7 @@ export const defaultInterfaces = {
concurrent: "wrap://ens/goerli/interface.concurrent.wrappers.eth",
logger: "wrap://ens/wrappers.polywrap.eth:logger@1.0.0",
http: "wrap://ens/wrappers.polywrap.eth:http@1.1.0",
fileSystem: "wrap://ens/wrappers.polywrap.eth:file-system@1.0.0",
};

export const getDefaultConfig = (): ClientConfig<Uri> => {
Expand Down Expand Up @@ -93,6 +94,14 @@ export const getDefaultConfig = (): ClientConfig<Uri> => {
from: new Uri(defaultInterfaces.http),
to: new Uri(defaultPackages.http),
},
{
from: new Uri("wrap://ens/fs.polywrap.eth"),
to: new Uri(defaultInterfaces.fileSystem),
},
{
from: new Uri(defaultInterfaces.fileSystem),
to: new Uri(defaultPackages.fileSystem),
},
],
interfaces: [
{
Expand Down
13 changes: 7 additions & 6 deletions packages/js/client/src/__tests__/core/error-structure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Uri, PolywrapClient } from "../..";
import { buildWrapper } from "@polywrap/test-env-js";
import { WrapError, WrapErrorCode } from "@polywrap/core-js";
import { mockPluginRegistration } from "../helpers/mockPluginRegistration";
import { defaultPackages } from "@polywrap/client-config-builder-js";

jest.setTimeout(660000);

Expand Down Expand Up @@ -235,7 +236,7 @@ describe("Error structure", () => {
describe("Plugin wrapper", () => {
test("Invoke a plugin wrapper with malformed args", async () => {
const result = await client.invoke<Uint8Array>({
uri: "wrap://ens/fs.polywrap.eth",
uri: defaultPackages.fileSystem,
method: "readFile",
args: {
pathh: "packages/js/client/src/__tests__/core/index.ts",
Expand All @@ -248,15 +249,15 @@ describe("Error structure", () => {
expect(result.error?.name).toEqual("WrapError");
expect(result.error?.code).toEqual(WrapErrorCode.WRAPPER_INVOKE_ABORTED);
expect(result.error?.reason).toEqual("The \"path\" argument must be of type string or an instance of Buffer or URL. Received undefined");
expect(result.error?.uri).toEqual("wrap://ens/fs.polywrap.eth");
expect(result.error?.uri).toEqual(defaultPackages.fileSystem);
expect(result.error?.method).toEqual("readFile");
expect(result.error?.args).toContain("{\n \"pathh\": \"packages/js/client/src/__tests__/core/index.ts\"\n}");
expect(result.error?.source).toEqual({ file: "node:internal/fs/promises", row: 450, col: 10 });
});

test("Invoke a plugin wrapper with a method that doesn't exist", async () => {
const result = await client.invoke<Uint8Array>({
uri: "wrap://ens/fs.polywrap.eth",
uri: defaultPackages.fileSystem,
method: "readFileNotFound",
args: {
path: __dirname + "/index.ts",
Expand All @@ -269,7 +270,7 @@ describe("Error structure", () => {
expect(result.error?.name).toEqual("WrapError");
expect(result.error?.code).toEqual(WrapErrorCode.WRAPPER_METHOD_NOT_FOUND);
expect(result.error?.reason.startsWith("Plugin missing method ")).toBeTruthy();
expect(result.error?.uri).toEqual("wrap://ens/fs.polywrap.eth");
expect(result.error?.uri).toEqual(defaultPackages.fileSystem);
expect(result.error?.method).toEqual("readFileNotFound");
});

Expand All @@ -293,7 +294,7 @@ describe("Error structure", () => {

test("Invoke a plugin wrapper that throws unexpectedly", async () => {
const result = await client.invoke<Uint8Array>({
uri: "wrap://ens/fs.polywrap.eth",
uri: defaultPackages.fileSystem,
method: "readFile",
args: {
path: "./this/path/does/not/exist.ts",
Expand All @@ -306,7 +307,7 @@ describe("Error structure", () => {
expect(result.error?.name).toEqual("WrapError");
expect(result.error?.code).toEqual(WrapErrorCode.WRAPPER_INVOKE_ABORTED);
expect(result.error?.reason.startsWith("ENOENT: no such file or directory")).toBeTruthy();
expect(result.error?.uri).toEqual("wrap://ens/fs.polywrap.eth");
expect(result.error?.uri).toEqual(defaultPackages.fileSystem);
expect(result.error?.method).toEqual("readFile");
expect(result.error?.args).toEqual("{\n \"path\": \"./this/path/does/not/exist.ts\"\n}");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
WrapperCache,
} from "@polywrap/uri-resolvers-js";
import { ExtendableUriResolver } from "@polywrap/uri-resolver-extensions-js";
import { defaultInterfaces } from "@polywrap/client-config-builder-js";

export const getClientWithEnsAndIpfs = () => {
const connections: Connections = new Connections({
Expand Down Expand Up @@ -70,7 +71,7 @@ export const getClientWithEnsAndIpfs = () => {
package: ipfsResolverPlugin({}),
},
{
uri: "wrap://ens/fs.polywrap.eth",
uri: defaultInterfaces.fileSystem,
package: fileSystemPlugin({}),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ethereumPlugin, Connections } from "../..";
import { providers } from "@polywrap/test-env-js";
import {
defaultIpfsProviders,
ClientConfig,
ClientConfig, defaultInterfaces,
} from "@polywrap/client-config-builder-js";

export const getDefaultConfig = (
Expand Down Expand Up @@ -37,7 +37,7 @@ export const getDefaultConfig = (
package: fileSystemResolverPlugin({}),
},
{
uri: "wrap://ens/fs.polywrap.eth",
uri: defaultInterfaces.fileSystem,
package: fileSystemPlugin({}),
},
],
Expand Down
58 changes: 0 additions & 58 deletions packages/js/plugins/file-system/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions packages/js/plugins/file-system/jest.config.js

This file was deleted.

41 changes: 0 additions & 41 deletions packages/js/plugins/file-system/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/js/plugins/file-system/polywrap.yaml

This file was deleted.

Loading