-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@jsii/spec): add loadAssemblyFromBuffer function (#3634)
Usage is demonstrated here: cdklabs/construct-hub#920 Two implementations were considered to fit the use case in construct hub, `loadAssemblyFromBuffer` and `loadAssemblyFromTarball`. I went with loading from a buffer because it allows us to utilize prior art in construct hub for parsing tarballs, does not need an added dependency on `tar`, and causes minimal impact when refactoring the ingestion lambda to use this function. Also includes a small refactoring of the test suite. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
- Loading branch information
Showing
113 changed files
with
559 additions
and
288 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
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
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
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
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
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 |
---|---|---|
@@ -1,20 +1,42 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Input | ||
INPUT_FILE='lib/assembly.d.ts' | ||
|
||
# Output | ||
OUTPUT_DIR='schema' | ||
OUTPUT_FILE="${OUTPUT_DIR}/jsii-spec.schema.json" | ||
|
||
mkdir -p ${OUTPUT_DIR} | ||
|
||
echo "Generating JSON schema into ${OUTPUT_FILE}" | ||
typescript-json-schema \ | ||
${INPUT_FILE} 'Assembly' \ | ||
--out ${OUTPUT_FILE} \ | ||
--refs true \ | ||
--required true \ | ||
--strictNullChecks true \ | ||
--topRef true | ||
{ | ||
# Input | ||
INPUT_FILE='lib/assembly.d.ts' | ||
|
||
# Output | ||
OUTPUT_DIR='schema' | ||
OUTPUT_FILE="${OUTPUT_DIR}/jsii-spec.schema.json" | ||
|
||
mkdir -p ${OUTPUT_DIR} | ||
|
||
echo "Generating JSON schema into ${OUTPUT_FILE}" | ||
typescript-json-schema \ | ||
${INPUT_FILE} 'Assembly' \ | ||
--out ${OUTPUT_FILE} \ | ||
--refs true \ | ||
--required true \ | ||
--strictNullChecks true \ | ||
--topRef true | ||
} | ||
|
||
{ | ||
# Input | ||
INPUT_FILE='lib/redirect.d.ts' | ||
|
||
# Output | ||
OUTPUT_DIR='schema' | ||
OUTPUT_FILE="${OUTPUT_DIR}/assembly-redirect.schema.json" | ||
|
||
mkdir -p ${OUTPUT_DIR} | ||
|
||
echo "Generating JSON schema into ${OUTPUT_FILE}" | ||
typescript-json-schema \ | ||
${INPUT_FILE} 'AssemblyRedirect'\ | ||
--out ${OUTPUT_FILE} \ | ||
--refs true \ | ||
--required true \ | ||
--strictNullChecks true \ | ||
--topRef true | ||
} |
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.