generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: middleware crashes when manifest.json is missing or not where it…
… was expected (#1054) * quick and dirty fix * Linting auto fix commit * proper code quality and checks * testing the new scenarios * changeset * avoid mutating the passed in manifest * Linting auto fix commit * fixed broken links * also check for undefined as return value * added missing test * enhanced test app for local testing * review feedback --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e91e129
commit 7f1971c
Showing
19 changed files
with
21,999 additions
and
238 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
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 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 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 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 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 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 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 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.