Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add husky with a conventional commit check #189

Merged
merged 3 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
12 changes: 12 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
import { awscdk } from 'projen';
import { JsonPatch, awscdk } from 'projen';
import { NpmAccess } from 'projen/lib/javascript';
import {
buildMeritBadgerWorkflow,
Expand Down Expand Up @@ -45,7 +45,13 @@ const project = new awscdk.AwsCdkConstructLibrary({

// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
keywords: ['constructs', 'aws-cdk', 'generative-ai', 'emerging-tech'],
devDeps: ['eslint-plugin-header'],
devDeps: [
'@commitlint/config-conventional',
'commitlint',
'eslint-plugin-header',
'husky',
// 'pinst',
],
deps: ['cdk-nag'],

// Keep synchronized with https://github.com/nodejs/release#release-schedule
Expand Down Expand Up @@ -151,6 +157,10 @@ project.eslint?.addRules({
'header/header': [2, 'header.js'],
});

const packageJson = project.tryFindObjectFile('package.json');
packageJson?.patch(JsonPatch.add('/scripts/prepare', 'husky install')); // yarn 1
packageJson?.patch(JsonPatch.add('/scripts/postinstall', 'husky install')); // yarn 2

// Add generation of new available models for constructs
project.addTask('generate-models-containers', {
description: 'Generate new list of models available from Jumpstart and DLC containers',
Expand All @@ -163,5 +173,4 @@ project.addTask('generate-models-containers', {
],
});


project.synth();
7 changes: 6 additions & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading