Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2c49985
Showing
23 changed files
with
15,791 additions
and
0 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,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
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,6 @@ | ||
{ | ||
"extends": "./node_modules/gts/", | ||
"rules": { | ||
"node/no-unpublished-import": "off" | ||
} | ||
} |
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,38 @@ | ||
name: release | ||
on: | ||
workflow_call: | ||
secrets: | ||
npm_access_token: | ||
description: Secret for getting JFrog credentials | ||
required: true | ||
push: | ||
branches: | ||
- fix-* | ||
- feature-* | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.ref }} | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Release | ||
run: npx --yes semantic-release |
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,36 @@ | ||
node_modules/ | ||
|
||
# Editors | ||
.vscode | ||
.idea | ||
*.iml | ||
|
||
# OS metadata | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Build | ||
build/ | ||
dist/ | ||
|
||
# env files | ||
.env.local | ||
.env.*.local | ||
.env | ||
|
||
# misc | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
|
||
# caches and test results | ||
.out/ | ||
|
||
# tests | ||
coverage/ | ||
test-results.xml | ||
test-reports/ |
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,17 @@ | ||
.github/ | ||
.out/ | ||
assets/ | ||
coverage/ | ||
dist/ | ||
node_modules/ | ||
src/ | ||
test/ | ||
test-reports/ | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.* | ||
jest.config.js | ||
tsconfig.json | ||
.prettierrc* | ||
prepublish.js | ||
.releaserc.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
...require('gts/.prettierrc.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"branches": [ | ||
{ | ||
"name": "main", | ||
"prerelease": false | ||
}, | ||
{ | ||
"name": "feature-*", | ||
"prerelease": true | ||
}, | ||
{ | ||
"name": "fix-*", | ||
"prerelease": true | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"releaseRules": [ | ||
{ | ||
"type": "chore", | ||
"scope": "RELEASE", | ||
"release": "patch" | ||
} | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator" | ||
], | ||
[ | ||
"@semantic-release/npm" | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [] | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"successComment": false, | ||
"failTitle": false | ||
} | ||
] | ||
] | ||
} |
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 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Mad Mirrajabi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,65 @@ | ||
# CloudFormation Template Renderer | ||
|
||
This is a simple tool that leverages AWS Application Composer's renderer to render CloudFormation templates. Since **CDK** also generates CloudFormation templates, this tool can be used to render the stacks created by CDK projects as well. | ||
|
||
**Beta notice**: This tool is currently in beta. Please report any issues you encounter. also read the [Good to know](#good-to-know) section. | ||
|
||
## Example output | ||
|
||
Below image is the output of [this template](https://github.com/awslabs/aws-cloudformation-templates/blob/master/community/solutions/StaticWebSiteWithPipeline/stacks/pipeline.json). | ||
![Example output](./assets/example.png) | ||
|
||
## Installation | ||
|
||
You can install it using npm: | ||
|
||
```bash | ||
# To use it as a CLI tool | ||
npm install -g cf-render | ||
|
||
# To use it as a library | ||
npm install cf-render | ||
``` | ||
|
||
## Usage - CLI | ||
|
||
```bash | ||
Usage: cf-render [options] | ||
|
||
CLI to render AWS CloudFormation templates | ||
|
||
Options: | ||
-V, --version output the version number | ||
-i, --input <template-path> Path to the cloudFormation template to render | ||
-o, --output <image-path> Path to the output image. Must end with .png | ||
-h, --help display help for command | ||
|
||
Examples: | ||
$ cf-render --input template.json --output template.png | ||
$ cf-render -i template.yaml -o template.png | ||
``` | ||
|
||
## Usage - Library | ||
|
||
```typescript | ||
import { renderTemplate } from 'cf-render'; | ||
|
||
... | ||
await renderTemplate({ | ||
inputPath: './template.yaml', | ||
outputPath: './template.png' | ||
}); | ||
... | ||
``` | ||
|
||
## Roadmap | ||
|
||
- [x] Put it out there! | ||
- [ ] Add support for screen size configuration | ||
- [ ] Trim the output image. Currently the canvas area is too large. | ||
|
||
## Good to know | ||
|
||
- This tool uses the publicly available [AWS Application Composer instance](https://ide-toolkits.app-composer.aws.dev/index.html) to render the templates. I'm not aware of any legal issues with using this public instance. If you represent AWS and you have any issues with this tool, please let me know but just don't tell Jeff. | ||
- Changes to the Application Composer's web UI might affect this library's functionality. If you encounter any issues, please report them. **If your life depends on generating diagrams from CloudFormation templates, you might want to consider using a different tool.** Otherwise, you can help improving this tool. | ||
- You need to have an internet connection to use this tool. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,25 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testMatch: [ | ||
'<rootDir>/src/**/__tests__/**/*.ts?(x)', | ||
'<rootDir>/(test|src)/**/*(*.)@(spec|test).ts?(x)', | ||
], | ||
clearMocks: true, | ||
collectCoverage: true, | ||
coverageReporters: ['json', 'lcov', 'clover', 'cobertura', 'text'], | ||
coverageDirectory: 'coverage', | ||
coveragePathIgnorePatterns: ['/node_modules/'], | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
watchPathIgnorePatterns: ['/node_modules/'], | ||
reporters: [ | ||
'default', | ||
[ | ||
'jest-junit', | ||
{ | ||
outputDirectory: 'test-reports', | ||
}, | ||
], | ||
], | ||
}; |
Oops, something went wrong.