Skip to content

Commit a826cd9

Browse files
committed
chore(repo): initial commit
0 parents  commit a826cd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6967
-0
lines changed

.commitlintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = true
14+
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
max_line_length = 500
18+
19+
[README.md]
20+
max_line_length = 170

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/dist

.eslintrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
extends: ['shellscape/typescript', 'plugin:import/typescript'],
3+
parserOptions: {
4+
project: ['./shared/tsconfig.eslint.json', './packages/*/tsconfig.json'],
5+
tsconfigRootDir: __dirname
6+
},
7+
overrides: [
8+
{
9+
files: ['**/fixtures/**', '**/scripts/**', '**/test/**'],
10+
rules: {
11+
'import/extensions': 'off',
12+
'import/no-extraneous-dependencies': 'off',
13+
'import/no-unresolved': 'off',
14+
'no-console': 'off'
15+
}
16+
}
17+
]
18+
};

.github/CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Contributing
2+
3+
We 💛 contributions! The rules for contributing to this org are few:
4+
5+
1. Don't be a jerk
6+
1. Search issues before opening a new one
7+
1. Lint and run tests locally before submitting a PR
8+
1. Adhere to the code style the org has chosen
9+
10+
11+
## Before Committing
12+
13+
1. Use at least Node.js v18 or higher. [NVM](https://github.com/creationix/nvm) can be handy for switching between Node versions.
14+
1. Lint your changes via `pnpm lint`. Fix any errors and warnings before committing.
15+
1. Test your changes via `pnpm -r test`. Only Pull Requests with passing tests will be accepted.
16+
17+
### Commits
18+
19+
Commits in this repository are expected to follow the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/). Since commits are used to generate CHANGELOGs for the packages in this repository and control version-release flows, each commit that affects a particular package must have a scope matching that pacakge's name. e.g. `fix(batman): broken riddle` will match the `@dot/batman` a package located at `packages/batman` in the repository.
20+
21+
To affect multiple packages in one commit, use a comma to delimit package names in the commit scope. e.g. `fix(batman,robin): batcave permissions.`
22+
23+
### Pull Requests
24+
25+
Pull Requests should ideally be limited to affect one package, but there may be situations where more than one package needs changes. PR merges should use _Squash Merge_.
26+
27+
### Adding Dependencies
28+
29+
Much like `yarn`, `pnpm add {dependency-name}` will add a dependency to a package.
30+
31+
However, because this is a monorepo, dependencies aren't frequently added to the repo root. Instead, move to the target package directory and run `pnpm add` there. e.g.
32+
33+
```console
34+
cd packages/batman
35+
pnpm add del-cli --save-dev
36+
```
37+
38+
If the rare need arises to add or update a dependency in all packages in the repository, a recursive add may be performed. e.g.
39+
40+
```console
41+
$ pnpm add typescript --recursive
42+
```
43+
44+
To add a package to the repo root, use the `-D -W` flags, which instruct `pnpm` to save to `devDependencies` and target the "workspace root." Root packages should always be installed to `devDependencies`.
45+
46+
## Package Scripts
47+
48+
All packages in this monorepo share the same set of scripts, and similar functionality between packages can be expected.
49+
50+
Scripts can be run from the respective `packages/*` directories using `pnpm {script name}`, or from the monorepo root directory using `pnpm {script-name} --filter {package-name}` to target specific packages.

.github/ISSUE_TEMPLATE/BUG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: 🐞 Bug Report
3+
about: Something went awry and you'd like to tell us about it.
4+
labels: ['t¹ 🐞 bug']
5+
---
6+
7+
- Package Name: `<name>`
8+
9+
### Expected Behavior
10+
11+
### Actual Behavior
12+
13+
### Additional Information

.github/ISSUE_TEMPLATE/FEATURE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: ✨ Feature Request
3+
about: Suggest an idea for a package in this repo
4+
labels: ['t³ ✨ feature']
5+
---
6+
7+
- Package Name: `<name>`
8+
9+
### Feature Use Case
10+
11+
### Feature Proposal
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: 🔧 Modification Request
3+
about: Would you like something work differently? Have an alternative approach? This is the template for you.
4+
labels: ['t⁴ 💡 idea']
5+
---
6+
7+
- Package Name: `<name>`
8+
9+
### Expected Behavior / Situation
10+
11+
### Actual Behavior / Situation
12+
13+
### Modification Proposal

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
This PR contains a:
2+
3+
- [ ] bugfix
4+
- [ ] feature
5+
- [ ] refactor
6+
- [ ] documentation
7+
- [ ] other
8+
9+
Are tests included?
10+
11+
- [ ] yes
12+
- [ ] no
13+
14+
Breaking Changes?
15+
16+
- [ ] yes
17+
- [ ] no
18+
19+
<!-- If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking. -->
20+
21+
### Description
22+
23+
<!--
24+
Please be thorough and clearly explain the problem being solved.
25+
* If this PR adds a feature, look for previous discussion on the feature by searching the issues first.
26+
* Is this PR related to an issue?
27+
* List any relevant issue numbers
28+
-->

.github/labels.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{ "name": "s¹ 🔥🔥 critical", "color": "#E53935" },
3+
{ "name": "s² 🔥 important", "color": "#FB8C00" },
4+
{ "name": "s³ 💧 nice to have", "color": "#FDD835" },
5+
{ "name": "s⁴ 💧💧 low priority", "color": "#039BE5" },
6+
7+
{ "name": "t¹ 🐞 bug", "color": "#F44336" },
8+
{ "name": "t² 📚 documentation", "color": "#FDD835" },
9+
{ "name": "t³ ✨ feature", "color": "#8bc34A" },
10+
{ "name": "t⁴ 💡 idea", "color": "#1976D2" },
11+
{ "name": "t⁵ 🔜 todo", "color": "#311B92" },
12+
13+
{ "name": "x¹ ⋅ could not reproduce", "color": "#CFD8DC" },
14+
{ "name": "x² ⋅ duplicate", "color": "#CFD8DC" },
15+
{ "name": "x³ ⋅ hold", "color": "#CFD8DC" },
16+
{ "name": "x⁴ ⋅ in progress", "color": "#1B5E20" },
17+
{ "name": "x⁵ ⋅ need more info", "color": "#6A1B9A" },
18+
{ "name": "x⁶ ⋅ wontfix", "color": "#CFD8DC" }
19+
]

.github/workflows/pr-title.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Pull Request Title Format
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
types:
8+
- opened
9+
- reopened
10+
- edited
11+
- synchronize
12+
13+
jobs:
14+
prTitle:
15+
name: Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Check PR Title
21+
uses: clowdhaus/actions/[email protected]
22+
with:
23+
on-fail-message: "Your PR title doesn't match the required format. The title should be in the conventional commit (https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format. e.g.\n\n```\nchore: add pr title workflow\n```. Note that scopes should not contain spaces."
24+
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w|,|\-|\|]+\))?(!)?\:\s.*'
25+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Validate Monorepo
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types:
7+
- edited
8+
- opened
9+
- synchronize
10+
push:
11+
branches:
12+
- '*'
13+
- '!master'
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
name: Validate
19+
20+
steps:
21+
- name: Checkout Commit
22+
uses: actions/checkout@v1
23+
24+
- name: Checkout Master
25+
run: git branch -f master origin/master
26+
27+
- name: Setup Node
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 18
31+
32+
- name: Enable Corepack
33+
id: pnpm-setup
34+
run: |
35+
corepack enable
36+
corepack prepare pnpm@latest --activate
37+
pnpm config set script-shell "/usr/bin/bash"
38+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
39+
40+
- name: pnpm Cache
41+
uses: actions/cache@v3
42+
with:
43+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
44+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pnpm-store-
47+
48+
- name: ESLint Cache
49+
uses: actions/cache@v3
50+
with:
51+
path: ./.eslintcache
52+
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
53+
restore-keys: |
54+
${{ runner.os }}-eslintcache-
55+
56+
- name: Sanity Check
57+
run: |
58+
echo git `git version`;
59+
echo branch `git branch --show-current`;
60+
echo node `node -v`;
61+
echo pnpm `pnpm -v`
62+
echo python `python --version`
63+
64+
- name: pnpm install
65+
run: pnpm install --frozen-lockfile
66+
67+
- name: Build Packages
68+
run: pnpm -r build
69+
70+
- name: Lint Monorepo
71+
run: pnpm lint
72+
73+
- name: Run Tests
74+
run: pnpm --filter "...[origin/master]" test

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage*
2+
dist
3+
node_modules
4+
.DS_Store
5+
.eslintcache
6+
.pnpm-debug.log

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm dlx lint-staged

.npmrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pnpm options
2+
always-auth = true
3+
enable-pre-post-scripts = true
4+
link-workspace-packages = false
5+
shamefully-hoist = true
6+
shared-workspace-lockfile = true
7+
strict-peer-dependencies = false

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github/PULL_REQUEST_TEMPLATE.md
2+
**/dist/
3+
**/fixtures/
4+
pnpm-lock.yaml
5+
cdk.out

.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Note: This file is necessary so that prettier writes which happen in hooks and scripts match the
2+
// same config that we're using from the eslint-config package.
3+
module.exports = require('eslint-config-shellscape/prettier');

0 commit comments

Comments
 (0)