Skip to content

Commit

Permalink
chore: refactor in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrzn committed Jul 1, 2022
1 parent fe30a2f commit 62b8d56
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CompilerOverrides } from "../../../../Compiler";
import { intlMsg } from "../../../../intl";

import { PolywrapManifest } from "../../../../polywrap-manifests";
import { PolywrapManifest } from "@polywrap/polywrap-manifest-schemas";

export function getCompilerOverrides(): CompilerOverrides {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/helpers/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withSpinner } from "./";
import { displayPath, intlMsg } from "../";

import { normalizePath } from "@polywrap/os-js";
import { MetaManifest } from "../polywrap-manifests";
import { MetaManifest } from "@polywrap/polywrap-manifest-schemas";
import { Ora } from "ora";
import fs from "fs";
import path from "path";
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from "./helpers";
export * from "./infra";
export * from "./intl";
export * from "./option-parsers";
export * from "./polywrap-manifests";
export * from "./project";
export * from "./system";
export * from "./test-env";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/infra/Infra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CacheDirectory,
} from "../";

import { InfraManifest } from "../polywrap-manifests";
import { InfraManifest } from "@polywrap/polywrap-manifest-schemas";
import path from "path";
import fs, { lstatSync, readdirSync } from "fs";
import YAML from "js-yaml";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/project/AppProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
loadAppManifest,
appManifestLanguageToBindLanguage,
} from "./manifests";
import { AppManifest } from "../polywrap-manifests";

import { AppManifest } from "@polywrap/polywrap-manifest-schemas";
import { Client } from "@polywrap/core-js";
import { ComposerOutput } from "@polywrap/schema-compose";
import { bindSchema, BindOutput } from "@polywrap/schema-bind";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/project/PluginProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
isPluginManifestLanguage,
pluginManifestLanguageToBindLanguage,
} from "./manifests";
import { PluginManifest } from "../polywrap-manifests";
import { resetDir } from "../system";

import { PluginManifest } from "@polywrap/polywrap-manifest-schemas";
import { bindSchema, BindOutput, BindOptions } from "@polywrap/schema-bind";
import { ComposerOutput } from "@polywrap/schema-compose";
import { Abi } from "@polywrap/schema-parse";
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/lib/project/PolywrapProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import {
polywrapManifestLanguageToBindLanguage,
} from "./manifests";
import { Deployer } from "../deploy";
import { generateDockerImageName, resetDir } from "../system";
import { createUUID } from "../helpers";
import { intlMsg } from "../intl";

import {
BuildManifest,
PolywrapManifest,
MetaManifest,
DeployManifest,
} from "../polywrap-manifests";
import { generateDockerImageName, resetDir } from "../system";
import { createUUID } from "../helpers";
import { intlMsg } from "../intl";

} from "@polywrap/polywrap-manifest-schemas";
import { normalizePath } from "@polywrap/os-js";
import { bindSchema, BindOutput, BindOptions } from "@polywrap/schema-bind";
import { ComposerOutput } from "@polywrap/schema-compose";
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/project/manifests/app/load.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { displayPath, withSpinner, intlMsg } from "../../../";

import {
AppManifest,
deserializeAppManifest,
} from "../../../polywrap-manifests";

} from "@polywrap/polywrap-manifest-schemas";
import fs from "fs";

export const defaultAppManifest = ["polywrap.app.yaml", "polywrap.app.yml"];
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/project/manifests/plugin/load.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { displayPath, withSpinner, intlMsg } from "../../../";

import {
PluginManifest,
deserializePluginManifest,
} from "../../../polywrap-manifests";

} from "@polywrap/polywrap-manifest-schemas";
import fs from "fs";

export const defaultPluginManifest = [
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/project/manifests/polywrap/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
deserializeDeployManifest,
InfraManifest,
deserializeInfraManifest,
} from "../../../polywrap-manifests";
} from "@polywrap/polywrap-manifest-schemas";

import { Schema as JsonSchema } from "jsonschema";
import path from "path";
Expand Down
2 changes: 1 addition & 1 deletion packages/js/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build"
],
"scripts": {
"build": "rimraf ./build tsc --project tsconfig.build.json",
"build": "rimraf ./build && tsc --project tsconfig.build.json",
"lint": "eslint --color -c ../../../.eslintrc.js src/",
"test": "jest --passWithNoTests --runInBand --verbose",
"test:ci": "jest --passWithNoTests --runInBand --verbose",
Expand Down
1 change: 0 additions & 1 deletion packages/js/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from "./types";
export * from "./algorithms";
export * from "./interfaces";
export * from "./wrap-manifests";
export * from "./msgpack";
export * from "./uri-resolution/core";
export * from "./uri-resolution/resolvers";
Expand Down
3 changes: 2 additions & 1 deletion packages/js/core/src/types/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
} from "./";
import { UriResolver } from "../uri-resolution/core";
import { UriResolverHandler } from "./UriResolver";
import { WrapManifest } from "../wrap-manifests";

import { WrapManifest } from "@polywrap/wrap-manifest-schemas";

export interface ClientConfig<TUri extends Uri | string = string> {
redirects: UriRedirect<TUri>[];
Expand Down
2 changes: 1 addition & 1 deletion packages/js/core/src/types/Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Invoker,
InvocableResult,
} from ".";
import { WrapManifest } from "../wrap-manifests";
import { WrapManifest } from "@polywrap/polywrap-manifest-schemas";

/**
* The Wrapper definition, which can be used to spawn
Expand Down
2 changes: 1 addition & 1 deletion packages/js/core/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"exclude": [
"./src/**/__tests__"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import {
import { DeserializeManifestOptions } from "../";

import { compare } from "semver";
import { msgpackDecode } from "@polywrap/core-js";
import { Tracer } from "@polywrap/tracing-js";

export const deserializeWrapManifest = Tracer.traceFunc(
"core: deserializeWrapManifest",
(manifest: Uint8Array, options?: DeserializeManifestOptions): WrapManifest => {
(manifest: Uint8Array, decoder: (m: Uint8Array) => unknown, options?: DeserializeManifestOptions): WrapManifest => {
let anyWrapManifest: AnyWrapManifest | undefined;
try {
anyWrapManifest = msgpackDecode(manifest) as AnyWrapManifest;
anyWrapManifest = decoder(manifest) as AnyWrapManifest;
} catch (e) {
throw Error(`Unable to parse WrapManifest: ${`[${new Uint8Array(manifest).toString()}]`}`);
}
Expand Down
3 changes: 0 additions & 3 deletions packages/manifest-schemas/wrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"lint": "eslint --color -c ../../.eslintrc.js .",
"build": "ts-node generator.ts && tsc"
},
"dependencies": {
"@polywrap/core-js": "0.0.1-prealpha.91"
},
"devDependencies": {
"ts-node": "8.10.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import {
import { DeserializeManifestOptions } from "../";

import { compare } from "semver";
import { msgpackDecode } from "@polywrap/core-js";
import { Tracer } from "@polywrap/tracing-js";

export const deserializeWrapManifest = Tracer.traceFunc(
"core: deserializeWrapManifest",
(manifest: Uint8Array, options?: DeserializeManifestOptions): WrapManifest => {
(manifest: Uint8Array, decoder: (m: Uint8Array) => unknown, options?: DeserializeManifestOptions): WrapManifest => {
let anyWrapManifest: AnyWrapManifest | undefined;
try {
anyWrapManifest = msgpackDecode(manifest) as AnyWrapManifest;
anyWrapManifest = decoder(manifest) as AnyWrapManifest;
} catch (e) {
throw Error(`Unable to parse WrapManifest: ${`[${new Uint8Array(manifest).toString()}]`}`);
}
Expand Down

0 comments on commit 62b8d56

Please sign in to comment.