Skip to content

Commit a2c54e7

Browse files
committed
chore: update js polywrap manifest bindings + migration functions
1 parent 5de86de commit a2c54e7

14 files changed

Lines changed: 146 additions & 159 deletions

File tree

packages/js/manifests/polywrap/src/formats/polywrap.app/0.3.0.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,6 @@ export interface AppManifest {
3737
*/
3838
import_abis?: ImportAbis[];
3939
};
40-
/**
41-
* Project extension files (build, deploy, infra).
42-
*/
43-
extensions?: {
44-
/**
45-
* Path to the project build manifest file.
46-
*/
47-
build?: string;
48-
/**
49-
* Path to project deploy manifest file.
50-
*/
51-
deploy?: string;
52-
/**
53-
* Path to project infra manifest file.
54-
*/
55-
infra?: string;
56-
};
5740
__type: "AppManifest";
5841
}
5942
export interface ImportAbis {
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
/* tslint:disable */
3+
/**
4+
* This file was automatically generated by json-schema-to-typescript.
5+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
6+
* and run json-schema-to-typescript to regenerate this file.
7+
*/
8+
9+
export interface BuildManifest {
10+
/**
11+
* Polywrap build manifest format version.
12+
*/
13+
format: "0.3.0";
14+
/**
15+
* Path to the project manifest file.
16+
*/
17+
project: string;
18+
/**
19+
* Custom build image configurations.
20+
*/
21+
strategies?: {
22+
image?: Image;
23+
local?: Local;
24+
vm?: Vm;
25+
};
26+
/**
27+
* Locally linked packages into docker build image.
28+
*/
29+
linked_packages?: {
30+
/**
31+
* Package name.
32+
*/
33+
name: string;
34+
/**
35+
* Path to linked package directory.
36+
*/
37+
path: string;
38+
/**
39+
* Ignore files matching this regex in linked package directory.
40+
*/
41+
filter?: string;
42+
}[];
43+
/**
44+
* General configurations.
45+
*/
46+
config?: {
47+
[k: string]: unknown;
48+
};
49+
__type: "BuildManifest";
50+
}
51+
/**
52+
* Docker image strategy configuration
53+
*/
54+
export interface Image {
55+
/**
56+
* Docker image name.
57+
*/
58+
name?: string;
59+
/**
60+
* Docker image file name.
61+
*/
62+
dockerfile?: string;
63+
/**
64+
* Configuration options for Docker Buildx, set to true for default value.
65+
*/
66+
buildx?:
67+
| {
68+
/**
69+
* Path to cache directory, set to true for default value, set to false to disable caching.
70+
*/
71+
cache?: string | boolean;
72+
/**
73+
* Remove the builder instance.
74+
*/
75+
removeBuilder?: boolean;
76+
}
77+
| boolean;
78+
/**
79+
* Remove the image.
80+
*/
81+
removeImage?: boolean;
82+
[k: string]: unknown;
83+
}
84+
/**
85+
* Local build strategy configuration
86+
*/
87+
export interface Local {
88+
/**
89+
* Custom script path for local build
90+
*/
91+
scriptPath?: string;
92+
}
93+
/**
94+
* Docker VM strategy configuration
95+
*/
96+
export interface Vm {
97+
/**
98+
* Base image for the Docker VM
99+
*/
100+
baseImage?: string;
101+
/**
102+
* Files to include in build VM container, by default
103+
*/
104+
defaultIncludes?: string[];
105+
}

packages/js/manifests/polywrap/src/formats/polywrap.build/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,42 @@ import {
1111
import {
1212
BuildManifest as BuildManifest_0_2_0,
1313
} from "./0.2.0";
14+
import {
15+
BuildManifest as BuildManifest_0_3_0,
16+
} from "./0.3.0";
1417

1518
export {
1619
BuildManifest_0_1_0,
1720
BuildManifest_0_2_0,
21+
BuildManifest_0_3_0,
1822
};
1923

2024
export enum BuildManifestFormats {
2125
// NOTE: Patch fix for backwards compatability
2226
"v0.1" = "0.1",
2327
"v0.1.0" = "0.1.0",
2428
"v0.2.0" = "0.2.0",
29+
"v0.3.0" = "0.3.0",
2530
}
2631

2732
export const BuildManifestSchemaFiles: Record<string, string> = {
2833
// NOTE: Patch fix for backwards compatability
2934
"0.1": "formats/polywrap.build/0.1.0.json",
3035
"0.1.0": "formats/polywrap.build/0.1.0.json",
3136
"0.2.0": "formats/polywrap.build/0.2.0.json",
37+
"0.3.0": "formats/polywrap.build/0.3.0.json",
3238
}
3339

3440
export type AnyBuildManifest =
3541
| BuildManifest_0_1_0
3642
| BuildManifest_0_2_0
43+
| BuildManifest_0_3_0
3744

3845

3946

40-
export type BuildManifest = BuildManifest_0_2_0;
47+
export type BuildManifest = BuildManifest_0_3_0;
4148

42-
export const latestBuildManifestFormat = BuildManifestFormats["v0.2.0"]
49+
export const latestBuildManifestFormat = BuildManifestFormats["v0.3.0"]
4350

4451
export { migrateBuildManifest } from "./migrate";
4552

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { BuildManifest as OldManifest } from "../0.2.0";
2+
import { BuildManifest as NewManifest } from "../0.3.0";
3+
4+
export function migrate(old: OldManifest): NewManifest {
5+
return {
6+
...old,
7+
project: "polywrap.yaml",
8+
format: "0.3.0"
9+
};
10+
}

packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Migrator } from "../../../migrations";
22
import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0";
3+
import { migrate as migrate_0_2_0_to_0_3_0 } from "./0.2.0_to_0.3.0";
34

45
export const migrators: Migrator[] = [
56
{
@@ -11,5 +12,10 @@ export const migrators: Migrator[] = [
1112
from: "0.1.0",
1213
to: "0.2.0",
1314
migrate: migrate_0_1_0_to_0_2_0
15+
},
16+
{
17+
from: "0.2.0",
18+
to: "0.3.0",
19+
migrate: migrate_0_2_0_to_0_3_0
1420
}
1521
];

packages/js/manifests/polywrap/src/formats/polywrap.build/validate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111

1212
import BuildManifestSchema_0_1_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.build/0.1.0.json";
1313
import BuildManifestSchema_0_2_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.build/0.2.0.json";
14+
import BuildManifestSchema_0_3_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.build/0.3.0.json";
1415

1516
import {
1617
Schema,
@@ -28,6 +29,7 @@ const schemas: BuildManifestSchemas = {
2829
"0.1": BuildManifestSchema_0_1_0,
2930
"0.1.0": BuildManifestSchema_0_1_0,
3031
"0.2.0": BuildManifestSchema_0_2_0,
32+
"0.3.0": BuildManifestSchema_0_3_0,
3133
};
3234

3335
const validator = new Validator();

packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.3.0.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,6 @@ export interface PluginManifest {
4141
*/
4242
import_abis?: ImportAbis[];
4343
};
44-
/**
45-
* Project extension files (build, deploy, infra).
46-
*/
47-
extensions?: {
48-
/**
49-
* Path to the project build manifest file.
50-
*/
51-
build?: string;
52-
/**
53-
* Path to project deploy manifest file.
54-
*/
55-
deploy?: string;
56-
/**
57-
* Path to project infra manifest file.
58-
*/
59-
infra?: string;
60-
};
6144
__type: "PluginManifest";
6245
}
6346
export interface ImportAbis {

packages/js/manifests/polywrap/src/formats/polywrap/0.3.0.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,6 @@ export interface PolywrapManifest {
4545
* Project resources folder
4646
*/
4747
resources?: string;
48-
/**
49-
* Project extension files (build, deploy, infra).
50-
*/
51-
extensions?: {
52-
/**
53-
* Path to the project build manifest file.
54-
*/
55-
build?: string;
56-
/**
57-
* Path to project deploy manifest file.
58-
*/
59-
deploy?: string;
60-
/**
61-
* Path to project infra manifest file.
62-
*/
63-
infra?: string;
64-
};
6548
__type: "PolywrapManifest";
6649
}
6750
export interface ImportAbis {

packages/js/manifests/polywrap/src/formats/polywrap/0.4.0.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

packages/js/manifests/polywrap/src/formats/polywrap/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ import {
1414
import {
1515
PolywrapManifest as PolywrapManifest_0_3_0,
1616
} from "./0.3.0";
17-
import {
18-
PolywrapManifest as PolywrapManifest_0_4_0,
19-
} from "./0.4.0";
2017

2118
export {
2219
PolywrapManifest_0_1_0,
2320
PolywrapManifest_0_2_0,
2421
PolywrapManifest_0_3_0,
25-
PolywrapManifest_0_4_0,
2622
};
2723

2824
export enum PolywrapManifestFormats {
@@ -31,7 +27,6 @@ export enum PolywrapManifestFormats {
3127
"v0.1.0" = "0.1.0",
3228
"v0.2.0" = "0.2.0",
3329
"v0.3.0" = "0.3.0",
34-
"v0.4.0" = "0.4.0",
3530
}
3631

3732
export const PolywrapManifestSchemaFiles: Record<string, string> = {
@@ -40,20 +35,18 @@ export const PolywrapManifestSchemaFiles: Record<string, string> = {
4035
"0.1.0": "formats/polywrap/0.1.0.json",
4136
"0.2.0": "formats/polywrap/0.2.0.json",
4237
"0.3.0": "formats/polywrap/0.3.0.json",
43-
"0.4.0": "formats/polywrap/0.4.0.json",
4438
}
4539

4640
export type AnyPolywrapManifest =
4741
| PolywrapManifest_0_1_0
4842
| PolywrapManifest_0_2_0
4943
| PolywrapManifest_0_3_0
50-
| PolywrapManifest_0_4_0
5144

5245

5346

54-
export type PolywrapManifest = PolywrapManifest_0_4_0;
47+
export type PolywrapManifest = PolywrapManifest_0_3_0;
5548

56-
export const latestPolywrapManifestFormat = PolywrapManifestFormats["v0.4.0"]
49+
export const latestPolywrapManifestFormat = PolywrapManifestFormats["v0.3.0"]
5750

5851
export { migratePolywrapManifest } from "./migrate";
5952

0 commit comments

Comments
 (0)