Skip to content

Commit ccdf574

Browse files
authored
Merge pull request #1386 from polywrap/origin-0.9-dev
Prep 0.9.4
2 parents 8c0d351 + ebe361c commit ccdf574

72 files changed

Lines changed: 575 additions & 159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Polywrap Origin (0.9.4)
2+
## Bugs
3+
* [PR-1372](https://github.com/polywrap/toolchain/pull/1372) `@polywrap/schema-parse`, `@polywrap/schema-compose`: Fixed a bug when importing type with map properties that use imported types.
4+
* [PR-1380](https://github.com/polywrap/toolchain/pull/1380) `polywrap` CLI: Add informative logging when manifests are automatically migrated.
5+
* [PR-1356](https://github.com/polywrap/toolchain/pull/1356) `polywrap` CLI: Building interface projects should not require docker.
6+
* [PR-1374](https://github.com/polywrap/toolchain/pull/1374) `@polywrap/ethereum-plugin-js`: Update README.
7+
* [PR-1381](https://github.com/polywrap/toolchain/pull/1381) `@polywrap/templates`: Add https://ipfs.wrappers.io gateway to IPFS deployment step for interface project.
8+
19
# Polywrap Origin (0.9.3)
210
## Bugs
311
* [PR-1344](https://github.com/polywrap/toolchain/pull/1344) `@polywrap/cli`: Improve workflow validation.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.3
1+
0.9.4

packages/cli/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
2020
"commands_build_options_s": "Strategy to use for building the wrapper",
2121
"commands_build_options_s_strategy": "strategy",
22+
"commands_build_info_interface_no_strategy": "Interface projects do not use build strategies. Building without a strategy...",
2223
"commands_infra_description": "Modular Infrastructure-As-Code Orchestrator",
2324
"commands_infra_actions_subtitle": "Infra allows you to execute the following commands:",
2425
"commands_infra_options_options": "options",

packages/cli/lang/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
2020
"commands_build_options_s": "Strategy to use for building the wrapper",
2121
"commands_build_options_s_strategy": "strategy",
22+
"commands_build_info_interface_no_strategy": "Interface projects do not use build strategies. Building without a strategy...",
2223
"commands_infra_description": "Modular Infrastructure-As-Code Orchestrator",
2324
"commands_infra_actions_subtitle": "Infra allows you to execute the following commands:",
2425
"commands_infra_options_options": "options",

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@polywrap/test-env-js": "0.9.3",
5757
"@polywrap/wasm-js": "0.9.3",
5858
"@polywrap/wrap-manifest-types-js": "0.9.3",
59+
"@polywrap/logging-js": "0.9.3",
5960
"axios": "0.21.2",
6061
"chalk": "4.1.0",
6162
"chokidar": "3.5.1",

packages/cli/src/commands/build.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
parseDirOption,
1313
parseClientConfigOption,
1414
parseManifestFileOption,
15+
Logger,
1516
} from "../lib";
1617
import { CodeGenerator } from "../lib/codegen";
1718
import {
@@ -20,6 +21,7 @@ import {
2021
SupportedStrategies,
2122
DockerImageBuildStrategy,
2223
LocalBuildStrategy,
24+
EmptyBuildStrategy,
2325
} from "../lib/build-strategies";
2426

2527
import path from "path";
@@ -108,11 +110,20 @@ async function validateManifestModules(polywrapManifest: PolywrapManifest) {
108110
}
109111
}
110112

111-
function createBuildStrategy(
113+
async function createBuildStrategy(
112114
strategy: BuildCommandOptions["strategy"],
113115
outputDir: string,
114-
project: PolywrapProject
115-
): BuildStrategy {
116+
project: PolywrapProject,
117+
logger: Logger
118+
): Promise<BuildStrategy> {
119+
const isInterfaceProject =
120+
(await project.getManifest()).project.type === "interface";
121+
122+
if (isInterfaceProject) {
123+
logger.info(intlMsg.commands_build_info_interface_no_strategy());
124+
return new EmptyBuildStrategy({ outputDir, project });
125+
}
126+
116127
switch (strategy) {
117128
case SupportedStrategies.LOCAL:
118129
return new LocalBuildStrategy({ outputDir, project });
@@ -151,7 +162,12 @@ async function run(options: BuildCommandOptions) {
151162
const polywrapManifest = await project.getManifest();
152163
await validateManifestModules(polywrapManifest);
153164

154-
const buildStrategy = createBuildStrategy(strategy, outputDir, project);
165+
const buildStrategy = await createBuildStrategy(
166+
strategy,
167+
outputDir,
168+
project,
169+
logger
170+
);
155171

156172
const schemaComposer = new SchemaComposer({
157173
project,

packages/cli/src/commands/manifest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ const runMigrateCommand = async (
510510

511511
function migrateManifestFile(
512512
manifestFile: string,
513-
migrationFn: (input: string, to: string) => string,
513+
migrationFn: (input: string, to: string, logger?: Logger) => string,
514514
to: string,
515515
logger: Logger
516516
): void {
@@ -528,7 +528,7 @@ function migrateManifestFile(
528528
encoding: "utf-8",
529529
});
530530

531-
const outputManifestString = migrationFn(manifestString, to);
531+
const outputManifestString = migrationFn(manifestString, to, logger);
532532

533533
// Cache the old manifest file
534534
const cache = new CacheDirectory({

packages/cli/src/commands/utils/createLogger.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Logger, LogLevel, ConsoleLog } from "../../lib";
1+
import { Logger, ConsoleLog } from "../../lib";
2+
3+
import { LogLevel } from "@polywrap/logging-js";
24

35
export function createLogger(flags: {
46
verbose?: boolean;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { BuildStrategy } from "../BuildStrategy";
2+
3+
export class EmptyBuildStrategy extends BuildStrategy<void> {
4+
getStrategyName(): string {
5+
return "empty";
6+
}
7+
8+
public async buildSources(): Promise<void> {
9+
return;
10+
}
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./DockerVMStrategy";
22
export * from "./LocalStrategy";
33
export * from "./DockerImageStrategy";
4+
export * from "./EmptyStrategy";

0 commit comments

Comments
 (0)