-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Resolve properly package.json dependency aliases (#608)
Resolves: SAP/ui5-tooling#809 When shimmed packages are defined as dependency aliases in the package.json, they are being excluded from the bundlig as the packager eventually finds the real package and its path and as it's not defined in the shim, but its alias, it gets ignored. We need to provide more robust discovery in order to handle those cases: - npm/cli#3 - https://github.com/npm/rfcs/blob/main/implemented/0001-package-aliases.md
- Loading branch information
Showing
9 changed files
with
100 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
.../fixtures/application.a.aliases/node_modules/extension.a.esm.alias/lib/extensionModule.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
test/fixtures/application.a.aliases/node_modules/extension.a.esm.alias/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test(paramA) { | ||
var variableA = paramA; | ||
console.log(variableA); | ||
} | ||
test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters