Skip to content

Commit 4399b88

Browse files
committed
[INTERNAL] Use Specification#getRootPath
API got renamed in SAP/ui5-project#557
1 parent 0bba913 commit 4399b88

File tree

9 files changed

+44
-44
lines changed

9 files changed

+44
-44
lines changed

lib/cli/commands/tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tree.handler = async function(argv) {
5757
`${baseString}${connectorString} ${chalk.bold(project.getName())} ` +
5858
`${project.getNamespace() ? chalk.inverse(project.getNamespace()) + " " : ""}` +
5959
chalk.dim(`(${project.getVersion()}, ${project.getType()}) `) +
60-
chalk.dim.italic(`${project.getPath()}`)
60+
chalk.dim.italic(`${project.getRootPath()}`)
6161
);
6262

6363
const lastIdx = dependencies.length - 1;
@@ -88,7 +88,7 @@ tree.handler = async function(argv) {
8888
console.log(
8989
`${connectorString} ${extensionName} ` +
9090
chalk.dim(`(${extension.getVersion()}, ${extension.getType()}) `) +
91-
chalk.dim.italic(`${extension.getPath()}`));
91+
chalk.dim.italic(`${extension.getRootPath()}`));
9292
});
9393
} else {
9494
console.log(chalk.italic(`None`));

lib/framework/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default async function({projectGraphOptions, libraries}) {
3333
const Resolver = getFrameworkResolver(project.getFrameworkName());
3434

3535
const resolver = new Resolver({
36-
cwd: project.getPath(),
36+
cwd: project.getRootPath(),
3737
version: project.getFrameworkVersion()
3838
});
3939

lib/framework/updateYaml.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ export default async function({project, configPathOverride, data}) {
146146
if (path.isAbsolute(configPathOverride)) {
147147
configPath = configPathOverride;
148148
} else {
149-
configPath = path.join(project.getPath(), configPathOverride);
149+
configPath = path.join(project.getRootPath(), configPathOverride);
150150
}
151151
} else {
152-
configPath = path.join(project.getPath(), "ui5.yaml");
152+
configPath = path.join(project.getRootPath(), "ui5.yaml");
153153
}
154154

155155
const configFile = await readFile(configPath, {encoding: "utf8"});

lib/framework/use.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default async function({projectGraphOptions, frameworkOptions}) {
4242
frameworkName: framework.name,
4343
frameworkVersion
4444
}, {
45-
cwd: project.getPath()
45+
cwd: project.getRootPath()
4646
});
4747
}
4848

test/lib/cli/commands/tree.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test.serial("ui5 tree (Without dependencies)", async (t) => {
5757
getNamespace: sinon.stub().returns("test/project1"),
5858
getVersion: sinon.stub().returns("1.0.0"),
5959
getType: sinon.stub().returns("application"),
60-
getPath: sinon.stub().returns("/home/project1")
60+
getRootPath: sinon.stub().returns("/home/project1")
6161
},
6262
dependencies: []
6363
});
@@ -91,7 +91,7 @@ test.serial("ui5 tree", async (t) => {
9191
getNamespace: sinon.stub().returns("test/project1"),
9292
getVersion: sinon.stub().returns("1.0.0"),
9393
getType: sinon.stub().returns("application"),
94-
getPath: sinon.stub().returns("/home/project1")
94+
getRootPath: sinon.stub().returns("/home/project1")
9595
},
9696
dependencies: ["dependency1", "dependency2"]
9797
});
@@ -101,7 +101,7 @@ test.serial("ui5 tree", async (t) => {
101101
getNamespace: sinon.stub().returns("test/dependency2"),
102102
getVersion: sinon.stub().returns("2.0.0"),
103103
getType: sinon.stub().returns("library"),
104-
getPath: sinon.stub().returns("/home/dependency2")
104+
getRootPath: sinon.stub().returns("/home/dependency2")
105105
},
106106
dependencies: ["dependency1"]
107107
});
@@ -111,7 +111,7 @@ test.serial("ui5 tree", async (t) => {
111111
getNamespace: sinon.stub().returns(null),
112112
getVersion: sinon.stub().returns("1.1.1"),
113113
getType: sinon.stub().returns("library"),
114-
getPath: sinon.stub().returns("/home/dependency1")
114+
getRootPath: sinon.stub().returns("/home/dependency1")
115115
},
116116
dependencies: ["dependency3"]
117117
});
@@ -121,7 +121,7 @@ test.serial("ui5 tree", async (t) => {
121121
getNamespace: sinon.stub().returns(null),
122122
getVersion: sinon.stub().returns("3.3.3"),
123123
getType: sinon.stub().returns("library"),
124-
getPath: sinon.stub().returns("/home/dependency3")
124+
getRootPath: sinon.stub().returns("/home/dependency3")
125125
},
126126
dependencies: []
127127
});
@@ -163,7 +163,7 @@ test.serial("ui5 tree (With extensions)", async (t) => {
163163
getNamespace: sinon.stub().returns("test/project1"),
164164
getVersion: sinon.stub().returns("1.0.0"),
165165
getType: sinon.stub().returns("application"),
166-
getPath: sinon.stub().returns("/home/project1")
166+
getRootPath: sinon.stub().returns("/home/project1")
167167
},
168168
dependencies: []
169169
});
@@ -174,12 +174,12 @@ test.serial("ui5 tree (With extensions)", async (t) => {
174174
getName: sinon.stub().returns("extension1"),
175175
getVersion: sinon.stub().returns("3.0.0"),
176176
getType: sinon.stub().returns("task"),
177-
getPath: sinon.stub().returns("/home/extension1")
177+
getRootPath: sinon.stub().returns("/home/extension1")
178178
}).onSecondCall().returns({
179179
getName: sinon.stub().returns("extension2"),
180180
getVersion: sinon.stub().returns("5.0.0"),
181181
getType: sinon.stub().returns("middleware"),
182-
getPath: sinon.stub().returns("/home/extension2")
182+
getRootPath: sinon.stub().returns("/home/extension2")
183183
});
184184

185185
await tree.handler(argv);
@@ -221,7 +221,7 @@ test.serial("ui5 tree --x-perf", async (t) => {
221221
getNamespace: sinon.stub().returns("test/project1"),
222222
getVersion: sinon.stub().returns("1.0.0"),
223223
getType: sinon.stub().returns("application"),
224-
getPath: sinon.stub().returns("/home/project1")
224+
getRootPath: sinon.stub().returns("/home/project1")
225225
},
226226
dependencies: []
227227
});
@@ -265,7 +265,7 @@ test.serial("ui5 tree --framework-version", async (t) => {
265265
getNamespace: sinon.stub().returns("test/project1"),
266266
getVersion: sinon.stub().returns("1.0.0"),
267267
getType: sinon.stub().returns("application"),
268-
getPath: sinon.stub().returns("/home/project1")
268+
getRootPath: sinon.stub().returns("/home/project1")
269269
},
270270
dependencies: []
271271
});
@@ -301,7 +301,7 @@ test.serial("ui5 tree --config", async (t) => {
301301
getNamespace: sinon.stub().returns("test/project1"),
302302
getVersion: sinon.stub().returns("1.0.0"),
303303
getType: sinon.stub().returns("application"),
304-
getPath: sinon.stub().returns("/home/project1")
304+
getRootPath: sinon.stub().returns("/home/project1")
305305
},
306306
dependencies: []
307307
});
@@ -337,7 +337,7 @@ test.serial("ui5 tree --dependency-definition", async (t) => {
337337
getNamespace: sinon.stub().returns("test/project1"),
338338
getVersion: sinon.stub().returns("1.0.0"),
339339
getType: sinon.stub().returns("application"),
340-
getPath: sinon.stub().returns("/home/project1")
340+
getRootPath: sinon.stub().returns("/home/project1")
341341
},
342342
dependencies: []
343343
});

test/lib/framework/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function createMockProject(attr) {
1111
lt: () => attr.specVersion === "1.0",
1212
};
1313
},
14-
getPath: () => attr.path,
14+
getRootPath: () => attr.path,
1515
getFrameworkName: () => attr.frameworkName,
1616
getFrameworkVersion: () => attr.frameworkVersion,
1717
getFrameworkDependencies: () => attr.frameworkLibraries || [],

test/lib/framework/remove.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function createMockProject(attr) {
1111
lt: () => attr.specVersion === "1.0",
1212
};
1313
},
14-
getPath: () => attr.path,
14+
getRootPath: () => attr.path,
1515
getFrameworkName: () => attr.frameworkName,
1616
getFrameworkVersion: () => attr.frameworkVersion,
1717
getFrameworkDependencies: () => attr.frameworkLibraries || [],

test/lib/framework/updateYaml.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ framework:
3232

3333
await updateYaml({
3434
project: {
35-
getPath: () => "my-project",
35+
getRootPath: () => "my-project",
3636
getName: () => "my-project"
3737
},
3838
data: {
@@ -76,7 +76,7 @@ shims:
7676

7777
await updateYaml({
7878
project: {
79-
getPath: () => "my-project",
79+
getRootPath: () => "my-project",
8080
getName: () => "my-project"
8181
},
8282
data: {
@@ -132,7 +132,7 @@ framework:
132132

133133
await updateYaml({
134134
project: {
135-
getPath: () => "my-project",
135+
getRootPath: () => "my-project",
136136
getName: () => "my-project"
137137
},
138138
data: {
@@ -174,7 +174,7 @@ metadata:
174174

175175
await updateYaml({
176176
project: {
177-
getPath: () => "my-project",
177+
getRootPath: () => "my-project",
178178
getName: () => "my-project"
179179
},
180180
data: {
@@ -202,7 +202,7 @@ metadata:
202202

203203
await updateYaml({
204204
project: {
205-
getPath: () => "my-project",
205+
getRootPath: () => "my-project",
206206
getName: () => "my-project"
207207
},
208208
data: {
@@ -235,7 +235,7 @@ framework:
235235

236236
await updateYaml({
237237
project: {
238-
getPath: () => "my-project",
238+
getRootPath: () => "my-project",
239239
getName: () => "my-project"
240240
},
241241
data: {
@@ -268,7 +268,7 @@ framework:
268268

269269
await updateYaml({
270270
project: {
271-
getPath: () => "my-project",
271+
getRootPath: () => "my-project",
272272
getName: () => "my-project"
273273
},
274274
data: {
@@ -302,7 +302,7 @@ framework:
302302

303303
await updateYaml({
304304
project: {
305-
getPath: () => "my-project",
305+
getRootPath: () => "my-project",
306306
getName: () => "my-project"
307307
},
308308
data: {
@@ -343,7 +343,7 @@ framework:
343343

344344
await updateYaml({
345345
project: {
346-
getPath: () => "my-project",
346+
getRootPath: () => "my-project",
347347
getName: () => "my-project"
348348
},
349349
data: {
@@ -387,7 +387,7 @@ framework:
387387

388388
await updateYaml({
389389
project: {
390-
getPath: () => "my-project",
390+
getRootPath: () => "my-project",
391391
getName: () => "my-project"
392392
},
393393
data: {
@@ -425,7 +425,7 @@ resources:
425425

426426
await updateYaml({
427427
project: {
428-
getPath: () => "my-project",
428+
getRootPath: () => "my-project",
429429
getName: () => "my-project"
430430
},
431431
data: {
@@ -463,7 +463,7 @@ resources:
463463

464464
await updateYaml({
465465
project: {
466-
getPath: () => "my-project",
466+
getRootPath: () => "my-project",
467467
getName: () => "my-project"
468468
},
469469
data: {
@@ -508,7 +508,7 @@ resources:
508508

509509
await updateYaml({
510510
project: {
511-
getPath: () => "my-project",
511+
getRootPath: () => "my-project",
512512
getName: () => "my-project"
513513
},
514514
data: {
@@ -553,7 +553,7 @@ framework:
553553

554554
await updateYaml({
555555
project: {
556-
getPath: () => "my-project",
556+
getRootPath: () => "my-project",
557557
getName: () => "my-project"
558558
},
559559
data: {
@@ -594,7 +594,7 @@ framework:
594594

595595
await updateYaml({
596596
project: {
597-
getPath: () => "my-project",
597+
getRootPath: () => "my-project",
598598
getName: () => "my-project"
599599
},
600600
data: {
@@ -640,7 +640,7 @@ resources:
640640

641641
await updateYaml({
642642
project: {
643-
getPath: () => "my-project",
643+
getRootPath: () => "my-project",
644644
getName: () => "my-project"
645645
},
646646
data: {
@@ -691,7 +691,7 @@ resources:
691691

692692
await updateYaml({
693693
project: {
694-
getPath: () => "my-project",
694+
getRootPath: () => "my-project",
695695
getName: () => "my-project"
696696
},
697697
data: {
@@ -738,7 +738,7 @@ framework:
738738

739739
await updateYaml({
740740
project: {
741-
getPath: () => "my-project",
741+
getRootPath: () => "my-project",
742742
getName: () => "my-project"
743743
},
744744
data: {
@@ -780,7 +780,7 @@ framework: { name: "SAPUI5" }
780780

781781
const error = await t.throwsAsync(updateYaml({
782782
project: {
783-
getPath: () => "my-project",
783+
getRootPath: () => "my-project",
784784
getName: () => "my-project"
785785
},
786786
data: {
@@ -814,7 +814,7 @@ metadata:
814814

815815
const error = await t.throwsAsync(updateYaml({
816816
project: {
817-
getPath: () => "my-project",
817+
getRootPath: () => "my-project",
818818
getName: () => "my-project-3"
819819
},
820820
configPathOverride: "ui5.yaml",
@@ -839,7 +839,7 @@ something: else
839839

840840
await updateYaml({
841841
project: {
842-
getPath: () => "my-project",
842+
getRootPath: () => "my-project",
843843
getName: () => "my-project"
844844
},
845845
data: {
@@ -876,7 +876,7 @@ framework:
876876

877877
await updateYaml({
878878
project: {
879-
getPath: () => "my-project",
879+
getRootPath: () => "my-project",
880880
getName: () => "my-project"
881881
},
882882
configPathOverride: path.join("dir", "other-file.yaml"),
@@ -916,7 +916,7 @@ framework:
916916

917917
await updateYaml({
918918
project: {
919-
getPath: () => "my-project",
919+
getRootPath: () => "my-project",
920920
getName: () => "my-project"
921921
},
922922
configPathOverride: path.join("/", "dir", "other-file.yaml"),

test/lib/framework/use.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function createMockProject(attr) {
1111
lt: () => attr.specVersion === "1.0",
1212
};
1313
},
14-
getPath: () => attr.path,
14+
getRootPath: () => attr.path,
1515
getFrameworkName: () => attr.frameworkName,
1616
getFrameworkVersion: () => attr.frameworkVersion,
1717
};

0 commit comments

Comments
 (0)