Skip to content

Commit 9b17366

Browse files
committed
rename witDeps to witDependencies
Signed-off-by: karthik2804 <[email protected]>
1 parent fbea9c0 commit 9b17366

File tree

14 files changed

+33
-33
lines changed

14 files changed

+33
-33
lines changed

packages/build-tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"wit"
4242
],
4343
"config": {
44-
"witDeps": [
44+
"witDependencies": [
4545
{
4646
"witPath": "./wit",
4747
"package": "spinframework:[email protected]",

packages/build-tools/src/wasiDepsParser.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ type PackageJson = {
88
name: string;
99
dependencies?: Record<string, string>;
1010
config?: {
11-
witDeps?: witDep[];
11+
witDependencies?: witDependency[];
1212
};
1313
};
1414

15-
type witDep = {
15+
type witDependency = {
1616
witPath: string;
1717
package: string;
1818
world: string;
@@ -22,7 +22,7 @@ type witDep = {
2222
type DependencyResult = {
2323
name: string;
2424
config: {
25-
witDeps?: witDep[];
25+
witDependencies?: witDependency[];
2626
};
2727
}[];
2828

@@ -59,8 +59,8 @@ function absolutizeWitPath(
5959
depPackageJsonPath: string,
6060
depPackageJson: PackageJson,
6161
): void {
62-
if (depPackageJson.config?.witDeps) {
63-
depPackageJson.config.witDeps.forEach(witDep => {
62+
if (depPackageJson.config?.witDependencies) {
63+
depPackageJson.config.witDependencies.forEach(witDep => {
6464
if (!path.isAbsolute(witDep.witPath)) {
6565
witDep.witPath = path.resolve(depPackageJsonPath, witDep.witPath);
6666
}
@@ -87,16 +87,16 @@ export function getPackagesWithWasiDeps(
8787
const result: DependencyResult = [];
8888

8989
if (topLevel) {
90-
if (packageJson.config?.witDeps) {
91-
if (packageJson.config.witDeps) {
92-
if (packageJson.config.witDeps) {
90+
if (packageJson.config?.witDependencies) {
91+
if (packageJson.config.witDependencies) {
92+
if (packageJson.config.witDependencies) {
9393
absolutizeWitPath(dir, packageJson);
9494
}
9595

9696
result.push({
9797
name: packageJson.name,
9898
config: {
99-
witDeps: packageJson.config.witDeps,
99+
witDependencies: packageJson.config.witDependencies,
100100
},
101101
});
102102
}
@@ -117,11 +117,11 @@ export function getPackagesWithWasiDeps(
117117
absolutizeWitPath(depPath, depPackageJson);
118118

119119
// If the package has a 'knitwit' config, add it to the result
120-
if (depPackageJson.config?.witDeps) {
120+
if (depPackageJson.config?.witDependencies) {
121121
result.push({
122122
name: dep,
123123
config: {
124-
witDeps: depPackageJson.config.witDeps ?? [],
124+
witDependencies: depPackageJson.config.witDependencies ?? [],
125125
},
126126
});
127127
}
@@ -139,8 +139,8 @@ export function processWasiDeps(wasiDeps: DependencyResult) {
139139
let targetWorlds: TargetWorld[] = [];
140140

141141
wasiDeps.forEach(dep => {
142-
if (dep.config?.witDeps) {
143-
dep.config.witDeps.forEach(witDep => {
142+
if (dep.config?.witDependencies) {
143+
dep.config.witDependencies.forEach(witDep => {
144144
witPaths.push(witDep.witPath!);
145145
targetWorlds.push({
146146
packageName: witDep.package,

packages/build-tools/test/wasiDepsTest.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('getPackagesWithWasiDeps', () => {
7373
const packageJson = {
7474
name: 'test-package',
7575
config: {
76-
witDeps: [
76+
witDependencies: [
7777
{ witPath: './test.wit', package: 'test-pkg', world: 'test-world' },
7878
],
7979
},
@@ -84,7 +84,7 @@ describe('getPackagesWithWasiDeps', () => {
8484
{
8585
name: 'test-package',
8686
config: {
87-
witDeps: [
87+
witDependencies: [
8888
{
8989
witPath: '/project/test.wit',
9090
package: 'test-pkg',
@@ -103,7 +103,7 @@ describe('processWasiDeps', () => {
103103
{
104104
name: 'test-package',
105105
config: {
106-
witDeps: [
106+
witDependencies: [
107107
{ witPath: './test.wit', package: 'test-pkg', world: 'test-world' },
108108
],
109109
},
@@ -136,7 +136,7 @@ describe('getPackagesWithWasiDeps (recursive)', () => {
136136
'package-2': '^1.0.0',
137137
},
138138
config: {
139-
witDeps: [
139+
witDependencies: [
140140
{ witPath: './test1.wit', package: 'test-pkg-1', world: 'world-1' },
141141
],
142142
},
@@ -151,7 +151,7 @@ describe('getPackagesWithWasiDeps (recursive)', () => {
151151
'package-4': '^1.0.0',
152152
},
153153
config: {
154-
witDeps: [
154+
witDependencies: [
155155
{ witPath: './test2.wit', package: 'test-pkg-2', world: 'world-2' },
156156
],
157157
},
@@ -164,7 +164,7 @@ describe('getPackagesWithWasiDeps (recursive)', () => {
164164
'package-5': '^1.0.0',
165165
},
166166
config: {
167-
witDeps: [
167+
witDependencies: [
168168
{ witPath: './test3.wit', package: 'test-pkg-3', world: 'world-3' },
169169
],
170170
},
@@ -173,7 +173,7 @@ describe('getPackagesWithWasiDeps (recursive)', () => {
173173
const packageJson4 = {
174174
name: 'package-4',
175175
config: {
176-
witDeps: [
176+
witDependencies: [
177177
{ witPath: './test4.wit', package: 'test-pkg-4', world: 'world-4' },
178178
],
179179
},
@@ -182,7 +182,7 @@ describe('getPackagesWithWasiDeps (recursive)', () => {
182182
const packageJson5 = {
183183
name: 'package-5',
184184
config: {
185-
witDeps: [
185+
witDependencies: [
186186
{ witPath: './test5.wit', package: 'test-pkg-5', world: 'world-5' },
187187
],
188188
},

packages/http-trigger/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "spinframework:[email protected]",

packages/spin-kv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "fermyon:[email protected]",

packages/spin-llm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "fermyon:[email protected]",

packages/spin-mqtt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "fermyon:[email protected]",

packages/spin-mysql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "fermyon:[email protected]",

packages/spin-postgres/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "fermyon:[email protected]",

packages/spin-postgres3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"wit"
2020
],
2121
"config": {
22-
"witDeps": [
22+
"witDependencies": [
2323
{
2424
"witPath": "./wit",
2525
"package": "spin:[email protected]",

0 commit comments

Comments
 (0)