Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Build manifest refactor #986

Merged
merged 58 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
06ba2e5
chore(cli/compiler): update build modules logic to support wrap.info …
cbrzn Jun 28, 2022
c73bf0b
chore(manifest-schemas): add wrap.info folder and create polywrap fol…
cbrzn Jun 28, 2022
b5983e1
chore(js/core): create new templates for different manifest files
cbrzn Jun 28, 2022
8aa5554
chore(js/core): update manifest autogenerated files - build works
cbrzn Jun 28, 2022
e0750d4
feat(js/core): manifest script update to handle wrap.info and polywra…
cbrzn Jun 28, 2022
7632eba
chore(js/core): manifest script generation works
cbrzn Jun 28, 2022
7a5ef35
chore: refactor with jordan
cbrzn Jun 28, 2022
e7212f6
core building
dOrgJelli Jun 28, 2022
ef8ef58
core builds + runs tests
dOrgJelli Jun 29, 2022
8181677
chore: remove polywrap manifest update in build
cbrzn Jun 29, 2022
4283ff2
chore: trying to fix build
cbrzn Jun 29, 2022
d856fb6
chore: client building and cli almost there
cbrzn Jun 29, 2022
bcd58dd
chore: cli building
cbrzn Jun 29, 2022
53b1060
revert compiler changes
dOrgJelli Jun 29, 2022
2014a7a
chore(validation): update to wrap manifest in progress
cbrzn Jun 29, 2022
7946893
Merge branch 'feat/build-structure-improvements' of github.com:polywr…
cbrzn Jun 29, 2022
e11da17
chore(validation): builds!
cbrzn Jun 30, 2022
8291d82
chore: invoke encodig fix pr merged
cbrzn Jun 30, 2022
f4631de
Merge branch 'prealpha-dev' into feat/build-structure-with-fixed-enco…
cbrzn Jun 30, 2022
e61c00a
chore(js/validation): first test pass :-D
cbrzn Jun 30, 2022
81c79ae
fix conflicts
cbrzn Jun 30, 2022
5ebd910
chore(js/validation): update with wrap manifest
cbrzn Jun 30, 2022
0b7f1ca
fix conflicts
cbrzn Jul 1, 2022
2d4b6a8
chore: scripts & generate manifests moved into manifest-schema package
cbrzn Jul 1, 2022
fb31096
chore(manifests/polywrap): script and templates moved to manifests fo…
cbrzn Jul 1, 2022
fe30a2f
chore(manifest/wrap): scripts & templates migrated
cbrzn Jul 1, 2022
62b8d56
chore: refactor in progress
cbrzn Jul 1, 2022
ddb2985
chore: refactor in progress
cbrzn Jul 1, 2022
a995395
refactor manifest codebases
dOrgJelli Jul 2, 2022
2513fb8
move types into JS folder
dOrgJelli Jul 2, 2022
451d30c
core + validation build & pass tests
dOrgJelli Jul 2, 2022
1351b95
everything building
dOrgJelli Jul 2, 2022
1bf96d9
Merge branch 'prealpha-dev' into feat/build-structure-improvements
dOrgJelli Jul 2, 2022
475d249
regex fixes
dOrgJelli Jul 2, 2022
35800a4
chore: updated with latest changes
cbrzn Jul 4, 2022
7874f4b
chore(cli): green light on built tests (removed filter regexp for now)
cbrzn Jul 4, 2022
6be2519
chore: update validation with new abi interface
cbrzn Jul 4, 2022
c5e858a
feat(fs-uri-resolver): looks for wrap.info and returns it as expected
cbrzn Jul 4, 2022
2283ae2
feat(ipfs-uri-resolve): fetch wrap.info & resolve uri tests are green
cbrzn Jul 5, 2022
2f17f32
chore: lint is green + fixes in plugin tests
cbrzn Jul 5, 2022
c56c538
chore: delete notes file & fix ipfs uri resolver test
cbrzn Jul 5, 2022
65f1cfa
chore: conflicts fixed
cbrzn Jul 5, 2022
8a28e51
chore: update ens wrapper in test env js
cbrzn Jul 5, 2022
cc4a3af
change polywrap to wrap, using schema file as test validation, checki…
nerfZael Jul 5, 2022
fab61a8
Merge pull request #1012 from polywrap/nerfzael-package-artifacts-fixes
cbrzn Jul 5, 2022
4726282
chore: update ens wrapper
cbrzn Jul 5, 2022
fb071eb
Merge branch 'feat/build-structure-improvements' of github.com:polywr…
cbrzn Jul 5, 2022
f0b5bca
using local plugin package to test schema
nerfZael Jul 5, 2022
9cd3d71
chore: uses same ens of integrations repository
cbrzn Jul 5, 2022
1283683
chore: removing unsued file
cbrzn Jul 5, 2022
7da084b
Merge pull request #1014 from polywrap/nerfzael-package-artifacts-fixes
cbrzn Jul 5, 2022
5ec7867
chore(cli): tests should be green
cbrzn Jul 5, 2022
1cc1e60
Merge branch 'feat/build-structure-improvements' of github.com:polywr…
cbrzn Jul 5, 2022
0c109d6
core-interfaces -> interfaces + make public
dOrgJelli Jul 5, 2022
025cec3
fix UriResolverInterface module export
dOrgJelli Jul 5, 2022
9b5a85f
remove msgpack as encoding option for getFile
dOrgJelli Jul 5, 2022
969f1d6
remove null fields from output abi
dOrgJelli Jul 6, 2022
7fd5b2f
remove null fields from wrap.info
dOrgJelli Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ packages/manifest-schemas/ @dOrgJelli
packages/js/cli @dOrgJelli @krisbitney @namesty @nerfZael @Niraj-Kamdar

# Client Interfaces
packages/core-interfaces @dOrgJelli
packages/interfaces @dOrgJelli

# JS Client
packages/js/client @dOrgJelli @krisbitney @namesty @nerfZael
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"workspaces": {
"packages": [
"./packages/cli",
"./packages/core-interfaces/**",
"./packages/interfaces/**",
"./packages/js/**",
"./packages/manifest-schemas/**",
"./packages/manifests/**",
"./packages/schema/**",
"./packages/templates/**",
"./packages/test-cases",
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,9 @@
"lib_wasm_rust_invalidModule": "Module paths must point to Cargo.toml files. Found: {path}",
"lib_docker_invalidImageId": "Invalid docker image ID returned: {imageId}",
"lib_docker_noInstall": "Docker executable not found in PATH",
"lib_infra_unrecognizedModule": "Unrecognized modules: {modules}. Default modules: {defaultModules}"
"lib_infra_unrecognizedModule": "Unrecognized modules: {modules}. Default modules: {defaultModules}",
"lib_wrap_abi_not_found": "No WRAP ABI found",
"lib_helpers_wrap_manifest_outputText": "WRAP manifest written in {path}",
"lib_helpers_wrap_manifest_outputError": "Error writing WRAP manifest in {path}",
"lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}"
}
6 changes: 5 additions & 1 deletion packages/cli/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,9 @@
"lib_wasm_rust_invalidModule": "Module paths must point to Cargo.toml files. Found: {path}",
"lib_docker_invalidImageId": "Invalid docker image ID returned: {imageId}",
"lib_docker_noInstall": "Docker executable not found in PATH",
"lib_infra_unrecognizedModule": "Unrecognized modules: {modules}. Default modules: {defaultModules}"
"lib_infra_unrecognizedModule": "Unrecognized modules: {modules}. Default modules: {defaultModules}",
"lib_wrap_abi_not_found": "No WRAP ABI found",
"lib_helpers_wrap_manifest_outputText": "WRAP manifest written in {path}",
"lib_helpers_wrap_manifest_outputError": "Error writing WRAP manifest in {path}",
"lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}"
}
6 changes: 5 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "rimraf ./build && tsc --project tsconfig.build.json && yarn build:build-images && yarn build:deploy-modules && yarn build:infra-modules",
"build:build-images": "copyfiles ./src/lib/defaults/build-images/**/**/* ./build/lib/defaults/build-images/ -u 4",
"build:deploy-modules": "copyfiles ./src/lib/defaults/deploy-modules/**/polywrap.deploy.ext.json ./build/lib/defaults/deploy-modules -u 4",
"build:infra-modules": "ts-node ./copyfiles ./src/lib/defaults/infra-modules ./build/lib/defaults/infra-modules",
"build:infra-modules": "ts-node ./scripts/copyfiles ./src/lib/defaults/infra-modules ./build/lib/defaults/infra-modules",
"prebuild": "ts-node ./scripts/generateIntlTypes.ts",
"build:fast": "rimraf ./build && tsc --project tsconfig.build.json",
"lint": "eslint --color -c ../../.eslintrc.js .",
Expand All @@ -40,11 +40,14 @@
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.92",
"@polywrap/ethereum-plugin-js": "0.0.1-prealpha.92",
"@polywrap/ipfs-plugin-js": "0.0.1-prealpha.92",
"@polywrap/msgpack-js": "0.0.1-prealpha.92",
"@polywrap/os-js": "0.0.1-prealpha.92",
"@polywrap/polywrap-manifest-types-js": "0.0.1-prealpha.92",
"@polywrap/schema-bind": "0.0.1-prealpha.92",
"@polywrap/schema-compose": "0.0.1-prealpha.92",
"@polywrap/schema-parse": "0.0.1-prealpha.92",
"@polywrap/test-env-js": "0.0.1-prealpha.92",
"@polywrap/wrap-manifest-types-js": "0.0.1-prealpha.92",
"assemblyscript": "0.19.1",
"axios": "0.21.2",
"chalk": "4.1.0",
Expand Down Expand Up @@ -78,6 +81,7 @@
"dir-compare": "3.3.0",
"eslint-plugin-formatjs": "2.12.7",
"jest": "26.6.3",
"json-schema-to-typescript": "10.1.3",
"ts-jest": "26.5.4",
"ts-morph": "10.0.1",
"ts-node": "8.10.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fse from "fs-extra";
import path from "path";

const source = process.argv[2];
const dest = process.argv[3];
const source = path.join(process.cwd(), process.argv[2]);
const dest = path.join(process.cwd(), process.argv[3]);

const ignore = [
".env",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/e2e/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe("e2e tests for build command", () => {
expect(error).toBe("");
expect(code).toEqual(0);
expect(output).toContain(`Artifacts written to ${buildDir}`);
expect(output).toContain(`Manifest written to ${buildDir}/polywrap.json`);
expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`);

testBuildOutput(testCaseDir, outputDir);
});
Expand Down
17 changes: 8 additions & 9 deletions packages/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable prefer-const */
import { Command, Program } from "./types";
import {
intlMsg,
PolywrapProject,
defaultPolywrapManifest,
DeployerHandler,
DeployPackage,
intlMsg,
parseWasmManifestFileOption,
PolywrapProject,
} from "../lib";
import { DeployerHandler } from "../lib/deploy/deployer";
import { Command, Program } from "./types";

import { DeployManifest } from "@polywrap/polywrap-manifest-types-js";
import fs from "fs";
import nodePath from "path";
import { print } from "gluegun";
import { Uri, DeployManifest } from "@polywrap/core-js";
import { Uri } from "@polywrap/core-js";
import { validate } from "jsonschema";

const defaultManifestStr = defaultPolywrapManifest.join(" | ");
Expand Down Expand Up @@ -54,7 +55,7 @@ async function run(options: DeployCommandOptions): Promise<void> {
const project = new PolywrapProject({
rootDir: nodePath.dirname(manifestFile),
polywrapManifestPath: manifestFile,
quiet: verbose ? false : true,
quiet: !verbose,
});
await project.validate();

Expand Down Expand Up @@ -91,14 +92,12 @@ async function run(options: DeployCommandOptions): Promise<void> {
// Create all handlers
Object.entries(deployManifest.stages).forEach(([stageName, stageValue]) => {
const publisher = stageToPackageMap[stageName].deployer;
const handler = new DeployerHandler(
handlers[stageName] = new DeployerHandler(
stageName,
publisher,
stageValue.config,
print
);

handlers[stageName] = handler;
});

// Establish dependency chains
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/infra.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { intlMsg, Infra, loadInfraManifest } from "../lib";
import { Command, Program } from "./types";

import { InfraManifest } from "@polywrap/polywrap-manifest-types-js";
import { print } from "gluegun";
import path from "path";
import { Argument } from "commander";
import chalk from "chalk";
import yaml from "js-yaml";
import { readdirSync } from "fs";
import { InfraManifest } from "@polywrap/core-js";

type InfraCommandOptions = {
modules?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const _run = async (workflowPath: string, options: WorkflowCommandOptions) => {
console.log(`ID: ${id}`);
}

if (!quiet && data && data !== {}) {
if (!quiet && data) {
console.log(`Data: ${JSON.stringify(data, null, 2)}`);
console.log("-----------------------------------");
}
Expand All @@ -115,7 +115,7 @@ const _run = async (workflowPath: string, options: WorkflowCommandOptions) => {

if (outputFile) {
const outputFileExt = path.extname(outputFile).substring(1);
if (!outputFileExt) throw new Error("Require output file extention");
if (!outputFileExt) throw new Error("Require output file extension");
switch (outputFileExt) {
case "yaml":
case "yml":
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/CodeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
isAppManifestLanguage,
appManifestLanguageToBindLanguage,
Project,
AnyManifest,
AnyProjectManifest,
SchemaComposer,
intlMsg,
resetDir,
Expand All @@ -29,7 +29,7 @@ import Mustache from "mustache";

export interface CodeGeneratorConfig {
codegenDirAbs: string;
project: Project<AnyManifest>;
project: Project<AnyProjectManifest>;
schemaComposer: SchemaComposer;
customScript?: string;
mustacheView?: Record<string, unknown>;
Expand Down
Loading