Skip to content

Commit 8dc5df9

Browse files
authored
feat: add files to new repo (#1)
1 parent a892453 commit 8dc5df9

File tree

12 files changed

+3070
-0
lines changed

12 files changed

+3070
-0
lines changed

.eslintrc.js

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:import/recommended",
5+
"plugin:prettier/recommended",
6+
],
7+
ignorePatterns: ["**/cdk.out/**", "**/dist/**"],
8+
rules: {
9+
"prettier/prettier": "error",
10+
"import/extensions": 0,
11+
"import/no-unresolved": 0,
12+
"import/prefer-default-export": 0,
13+
"import/no-duplicates": "error",
14+
complexity: ["error", 8],
15+
"max-lines": ["error", { max: 200, skipBlankLines: true }],
16+
"max-depth": ["error", 3],
17+
"max-params": ["error", 6],
18+
eqeqeq: ["error", "smart"],
19+
"import/no-extraneous-dependencies": [
20+
"error",
21+
{
22+
devDependencies: true,
23+
optionalDependencies: false,
24+
peerDependencies: false,
25+
},
26+
],
27+
"no-shadow": [
28+
"error",
29+
{
30+
hoist: "all",
31+
},
32+
],
33+
"prefer-const": "error",
34+
"import/order": [
35+
"error",
36+
{
37+
groups: [
38+
["external", "builtin"],
39+
"unknown",
40+
"internal",
41+
["parent", "sibling", "index"],
42+
],
43+
alphabetize: {
44+
order: "asc",
45+
caseInsensitive: false,
46+
},
47+
"newlines-between": "always",
48+
pathGroupsExcludedImportTypes: ["builtin"],
49+
},
50+
],
51+
"sort-imports": [
52+
"error",
53+
{
54+
ignoreCase: true,
55+
ignoreDeclarationSort: true,
56+
ignoreMemberSort: false,
57+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
58+
},
59+
],
60+
"padding-line-between-statements": [
61+
"error",
62+
{
63+
blankLine: "always",
64+
prev: "*",
65+
next: "return",
66+
},
67+
],
68+
"prefer-arrow/prefer-arrow-functions": [
69+
"error",
70+
{
71+
disallowPrototype: true,
72+
singleReturnOnly: false,
73+
classPropertiesAllowed: false,
74+
},
75+
],
76+
"no-restricted-imports": [
77+
"error",
78+
{
79+
paths: [
80+
{
81+
name: "aws-sdk",
82+
message: "Please use aws-sdk/{module} import instead",
83+
},
84+
{
85+
name: ".",
86+
message: "Please use explicit import file",
87+
},
88+
],
89+
},
90+
],
91+
curly: ["error", "all"],
92+
},
93+
root: true,
94+
env: {
95+
es6: true,
96+
node: true,
97+
browser: true,
98+
},
99+
plugins: ["prefer-arrow", "import"],
100+
parserOptions: {
101+
ecmaVersion: 9,
102+
sourceType: "module",
103+
project: ["./tsconfig.eslint.json"],
104+
tsconfigRootDir: __dirname,
105+
},
106+
overrides: [
107+
{
108+
files: ["**/*.ts?(x)"],
109+
extends: [
110+
"plugin:@typescript-eslint/recommended",
111+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
112+
"plugin:prettier/recommended",
113+
],
114+
parser: "@typescript-eslint/parser",
115+
parserOptions: {
116+
project: "tsconfig.eslint.json",
117+
},
118+
rules: {
119+
"@typescript-eslint/prefer-optional-chain": "error",
120+
"no-shadow": "off",
121+
"@typescript-eslint/no-shadow": "error",
122+
"@typescript-eslint/prefer-nullish-coalescing": "error",
123+
"@typescript-eslint/strict-boolean-expressions": [
124+
"error",
125+
{
126+
allowString: false,
127+
allowNumber: false,
128+
allowNullableObject: true,
129+
},
130+
],
131+
"@typescript-eslint/ban-ts-comment": [
132+
"error",
133+
{
134+
"ts-ignore": "allow-with-description",
135+
minimumDescriptionLength: 10,
136+
},
137+
],
138+
"@typescript-eslint/explicit-function-return-type": 0,
139+
"@typescript-eslint/explicit-member-accessibility": 0,
140+
"@typescript-eslint/camelcase": 0,
141+
"@typescript-eslint/interface-name-prefix": 0,
142+
"@typescript-eslint/explicit-module-boundary-types": "error",
143+
"@typescript-eslint/no-explicit-any": "error",
144+
"@typescript-eslint/no-unused-vars": "error",
145+
"@typescript-eslint/ban-types": [
146+
"error",
147+
{
148+
types: {
149+
FC: "Use `const MyComponent = (props: Props): JSX.Element` instead",
150+
SFC: "Use `const MyComponent = (props: Props): JSX.Element` instead",
151+
FunctionComponent:
152+
"Use `const MyComponent = (props: Props): JSX.Element` instead",
153+
"React.FC":
154+
"Use `const MyComponent = (props: Props): JSX.Element` instead",
155+
"React.SFC":
156+
"Use `const MyComponent = (props: Props): JSX.Element` instead",
157+
"React.FunctionComponent":
158+
"Use `const MyComponent = (props: Props): JSX.Element` instead",
159+
},
160+
extendDefaults: true,
161+
},
162+
],
163+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
164+
"@typescript-eslint/no-unnecessary-condition": "error",
165+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
166+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
167+
"@typescript-eslint/switch-exhaustiveness-check": "error",
168+
"@typescript-eslint/restrict-template-expressions": [
169+
"error",
170+
{
171+
allowNumber: true,
172+
allowBoolean: true,
173+
},
174+
],
175+
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
176+
},
177+
},
178+
],
179+
};

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:wrench: Changes in this PR:
2+
3+
-
4+
5+
:books: Documentation
6+
7+
-
8+
9+
:construction: Remaining work:
10+
11+
-

.github/workflows/push-main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Merge into main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
# write to contents and pull-requests required for release-please
10+
contents: write
11+
pull-requests: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
release-please:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
releases_created: ${{ steps.release-please.outputs.releases_created }}
22+
steps:
23+
- uses: google-github-actions/release-please-action@v3
24+
id: release-please
25+
with:
26+
release-type: node
27+
package-name: eventbridge-toolbox-schema-generator
28+
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release Published
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
publish-package:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: pnpm/action-setup@v2
17+
with:
18+
version: 7.27.0
19+
- uses: actions/setup-node@v3
20+
with:
21+
registry-url: 'https://registry.npmjs.org/'
22+
cache: "pnpm"
23+
- name: 💫 Install dependencies
24+
run: pnpm install --frozen-lockfile
25+
- name: 🏡 Build
26+
run: pnpm run build
27+
- name: 🚀 Publish eventbridge-toolbox
28+
run: pnpm publish --access=public --no-git-checks
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Node modules
2+
node_modules
3+
4+
# CDK Output
5+
cdk.out
6+
7+
# Environment Variables
8+
.env
9+
10+
# Built Files
11+
dist

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
auto-install-peers=true
2+
3+
@aleios-cloud:registry=https://registry.npmjs.org

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# eventbridge-toolbox-schema-generator
2+
3+
Eventbridge Toolbox Schema Generator is cli tool that automates the initial creation of a schema registry in your documentation of your event-driven architecture.
4+
5+
This is designed to work with the [eventbridge-toolbox](https://github.com/aleios-cloud/eventbridge-toolbox) package.
6+
7+
## Eventbridge Contracts
8+
9+
Within event-driven architectures, events facilitate communication between loosely connected services in an application. EventBridge is AWS's tool for implementing asynchronous event-driven workflows.
10+
11+
Event emitters are responsible for broadcasting events to event channels, while event consumers are responsible for executing business logic whenever they encounter a relevant event.
12+
13+
EventBridge contracts ensure a stable and reliable interaction emitters and consumers. These contract acts as a guiding agreement which guarantees that emitters' published events will consistently trigger the corresponding business logic on the consumer side.
14+
15+
## Key Features
16+
17+
- Generate documentation skeletons for events
18+
- Generate json schemas for events from contracts
19+
20+
## Getting Started
21+
22+
### Prerequisites
23+
24+
### Installation
25+
26+
With npm:
27+
28+
```
29+
npm install --save-dev @aleios-cloud/eventbridge-toolbox-schema-generator
30+
```
31+
32+
With yarn:
33+
34+
```
35+
yarn add -D @aleios-cloud/eventbridge-toolbox-schema-generator
36+
```
37+
38+
With pnpm:
39+
40+
```
41+
pnpm add -D @aleios-cloud/eventbridge-toolbox-schema-generator
42+
```
43+
44+
### Usage
45+
46+
You can create a documentation website based on [eventcatalog.dev](https://www.eventcatalog.dev/) and generate docs directly from your event contracts.
47+
48+
1. Set up an event catalog site and give it a name:
49+
50+
```
51+
npx @eventcatalog/create-eventcatalog@latest <name your event catalog>
52+
```
53+
54+
2. Edit `eventcatalog.config.js` with your details
55+
56+
3. Remove the example events from the `events` folder, as well as everything in the `services` and `domains` folders
57+
58+
4. Run `eventbridge-toolbox-schema-generator` with the following arguments:
59+
60+
- The path from the root to your event contracts
61+
- The path from the root to the event catalog events folder
62+
63+
```
64+
npx schema-generator <path from root to your event contracts> <path from root to event catalog events>
65+
```
66+
67+
5. You can start a local development server by running:
68+
69+
```
70+
npm run dev
71+
```
72+
73+
6. You can find out more about how to deploy your documentation site in the [event catalog docs](https://www.eventcatalog.dev/docs/guides/deployment)
74+
75+
## Contributors
76+
77+
<!-- markdownlint-disable -->
78+
<table>
79+
<tbody>
80+
<tr>
81+
<td valign="top"><a href="https://github.com/RyanT5"><img src="https://avatars.githubusercontent.com/u/22382958?v=4" width="100px;" alt="Ryan Schuller"/><br /><sub><b>Ryan Schuller</b></sub></a></td>
82+
<td valign="top"><a href="https://github.com/lukey-aleios"><img src="https://avatars.githubusercontent.com/u/93375669?v=4" width="100px;" alt="Luke Yianni"/><br /><sub><b>Luke Yianni</b></sub></a></td>
83+
<td valign="top"><a href="https://github.com/april-bates-aleios"><img src="https://avatars.githubusercontent.com/u/124585201?v=4" width="100px;" alt="April Bates"/><br /><sub><b>April Bates</b></sub></a></td>
84+
</tr>
85+
</tbody>
86+
</table>
87+
<!-- markdownlint-restore -->

0 commit comments

Comments
 (0)