Skip to content

Commit

Permalink
feat: add husky with a convential commit check (#189)
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
  • Loading branch information
scottschreckengaust authored Jan 12, 2024
1 parent 2dc3e3f commit 722ccec
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 23 deletions.
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

0 comments on commit 722ccec

Please sign in to comment.