generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 45
Fix: middleware crashes when manifest.json is missing or not where it was expected #1054
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9f421dd
quick and dirty fix
tobiasqueck 945c411
Linting auto fix commit
github-actions[bot] f1f604d
proper code quality and checks
tobiasqueck f80bae8
testing the new scenarios
tobiasqueck 1f9c76a
changeset
tobiasqueck ea8223b
avoid mutating the passed in manifest
tobiasqueck dcbcd92
Linting auto fix commit
github-actions[bot] b92aa56
fixed broken links
tobiasqueck 26a4ba6
Merge branch 'fix/1051/manifest' of https://github.com/SAP/open-ux-to…
tobiasqueck 53b4ed7
also check for undefined as return value
tobiasqueck 4524f43
added missing test
tobiasqueck 900f0fb
enhanced test app for local testing
tobiasqueck b8a1836
Merge branch 'main' into fix/1051/manifest
tobiasqueck 9ef1a9c
Merge branch 'main' into fix/1051/manifest
tobiasqueck e66599a
review feedback
tobiasqueck f108b7c
Merge branch 'main' into fix/1051/manifest
tobiasqueck 2f9db7f
Merge branch 'main' into fix/1051/manifest
tobiasqueck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
--- | ||
'@sap-ux/ui5-proxy-middleware': patch | ||
--- | ||
|
||
Fix: handle missing manifest.json |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,118 @@ | ||
declare module '@ui5/fs' { | ||
/** | ||
* https://sap.github.io/ui5-tooling/v2/api/module-@ui5_fs.Resource.html | ||
*/ | ||
export class Resource { | ||
/** | ||
* Gets the resources path | ||
*/ | ||
getPath(): string; | ||
|
||
/** | ||
* Gets a buffer with the resource content. | ||
*/ | ||
getBuffer(): Promise<Buffer>; | ||
|
||
/** | ||
* Gets a string with the resource content. | ||
*/ | ||
getString(): Promise<string>; | ||
} | ||
|
||
/** | ||
* https://sap.github.io/ui5-tooling/v2/api/module-@ui5_fs.ReaderCollection.html | ||
*/ | ||
export class ReaderCollection { | ||
/** | ||
* Locates resources by matching glob patterns. | ||
*/ | ||
byGlob(virPattern: string | string[], options?: object): Promise<Resource[]>; | ||
|
||
/** | ||
* Locates resources by matching a given path. | ||
*/ | ||
byPath(virPattern: string | string[], options?: object): Promise<Resource[]>; | ||
} | ||
|
||
/** | ||
* https://sap.github.io/ui5-tooling/v2/api/module-@ui5_fs.DuplexCollection.html | ||
*/ | ||
export class DuplexCollection extends ReaderCollection {} | ||
|
||
/** | ||
* https://sap.github.io/ui5-tooling/v2/api/module-@ui5_fs.AbstractReader.html | ||
*/ | ||
export class AbstractReader {} | ||
} | ||
|
||
declare module '@ui5/server' { | ||
export interface MiddlewareParameters<C> { | ||
/** | ||
* DuplexCollection to read and write files | ||
*/ | ||
resources: { | ||
all: ReaderCollection; | ||
dependencies: ReaderCollection; | ||
rootProject: ReaderCollection; | ||
}; | ||
|
||
/** | ||
* Project specific options | ||
*/ | ||
options: { | ||
/** | ||
* Optional middleware configuration if provided in ui5*.yaml | ||
*/ | ||
configuration?: C; | ||
}; | ||
|
||
/** | ||
* Middleware utilities (not yet used in our middlewares) | ||
*/ | ||
middlewareUtils: unknown; | ||
} | ||
} | ||
|
||
declare module '@ui5/builder' { | ||
/** | ||
* https://sap.github.io/ui5-tooling/v2/api/module-@ui5_builder.tasks.TaskUtil.html | ||
*/ | ||
export class TaskUtil {} | ||
|
||
export interface TaskParameters<C> { | ||
/** | ||
* DuplexCollection to read and write files | ||
*/ | ||
workspace: DuplexCollection; | ||
|
||
/** | ||
* Reader or Collection to read dependency files | ||
*/ | ||
dependencies: AbstractReader; | ||
|
||
/** | ||
* Specification Version dependent interface to a @ui5/builder.tasks.TaskUtil instance | ||
*/ | ||
taskUtil: TaskUtil; | ||
|
||
/** | ||
* Project specific options | ||
*/ | ||
options: { | ||
/** | ||
* Project name | ||
*/ | ||
projectName: string; | ||
|
||
/** | ||
* Project namespace if available | ||
*/ | ||
projectNamespace?: string; | ||
|
||
/** | ||
* Optional task configuration if provided in ui5*.yaml | ||
*/ | ||
configuration?: C; | ||
}; | ||
} | ||
} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.