-
Notifications
You must be signed in to change notification settings - Fork 13
[FIX] Resolve properly package.json dependency aliases #608
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
Changes from 4 commits
9f5b8d3
c0dcbe9
e948306
446d7dc
febc68a
c65bb1e
53edb46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "application.a.aliases", | ||
| "version": "1.0.0", | ||
| "description": "Simple SAPUI5 based application", | ||
| "main": "index.html", | ||
| "dependencies": { | ||
| "extension.a.esm.alias": "file:../extension.a.esm" | ||
| }, | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| specVersion: "3.0" | ||
| type: application | ||
| metadata: | ||
| name: application.a.aliases | ||
|
|
||
| --- # Everything below this line could also be put into the ui5.yaml of a standalone extension module | ||
| specVersion: "3.0" | ||
| kind: extension | ||
| type: project-shim | ||
| metadata: | ||
| name: my.application.thirdparty | ||
| shims: | ||
| configurations: | ||
| extension.a.esm.alias: # name as defined in package.json | ||
| specVersion: "3.0" | ||
| type: module # Use module type | ||
| metadata: | ||
| name: extension.a.esm.alias | ||
| resources: | ||
| configuration: | ||
| paths: | ||
| /resources/my/application/thirdparty/: "" # map root directory of lodash module |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Application A</title> | ||
| </head> | ||
| <body> | ||
|
|
||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "_version": "1.1.0", | ||
| "sap.app": { | ||
| "_version": "1.1.0", | ||
| "id": "id1", | ||
| "type": "application", | ||
| "applicationVersion": { | ||
| "version": "1.2.2" | ||
| }, | ||
| "embeds": ["embedded"], | ||
| "title": "{{title}}" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function test(paramA) { | ||
| var variableA = paramA; | ||
| console.log(variableA); | ||
| } | ||
| test(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import sinonGlobal from "sinon"; | |
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| const applicationAPath = path.join(__dirname, "..", "..", "..", "fixtures", "application.a"); | ||
| const applicationAAliasesPath = path.join(__dirname, "..", "..", "..", "fixtures", "application.a.aliases"); | ||
| const applicationCPath = path.join(__dirname, "..", "..", "..", "fixtures", "application.c"); | ||
| const applicationC2Path = path.join(__dirname, "..", "..", "..", "fixtures", "application.c2"); | ||
| const applicationC3Path = path.join(__dirname, "..", "..", "..", "fixtures", "application.c3"); | ||
|
|
@@ -68,6 +69,25 @@ test("AppA: project with collection dependency", async (t) => { | |
| ]); | ||
| }); | ||
|
|
||
| test("AppA: project with an alias dependency", async (t) => { | ||
| const workspace = { | ||
| getName: () => "workspace name", | ||
| getModuleByNodeId: t.context.sinon.stub().resolves(undefined).onFirstCall().resolves({ | ||
| // This version of library.d has an additional dependency to library.f, | ||
| // which in turn has a dependency to library.g | ||
|
||
| getPath: () => path.join(applicationAAliasesPath, "node_modules", "extension.a.esm.alias"), | ||
| getVersion: () => "1.0.0", | ||
| }) | ||
| }; | ||
| const npmProvider = new NodePackageDependenciesProvider({ | ||
| cwd: applicationAAliasesPath | ||
| }); | ||
| await testGraphCreationDfs(t, npmProvider, [ | ||
| "extension.a.esm.alias", | ||
| "application.a.aliases", | ||
| ], workspace); | ||
| }); | ||
|
|
||
| test("AppA: project with workspace overrides", async (t) => { | ||
| const workspace = { | ||
| getName: () => "workspace name", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.