Skip to content

Commit

Permalink
style(standards): adhering to standards
Browse files Browse the repository at this point in the history
- Replaced commitizen for czg
- Added some scopes to .czrc
- Removed unused dependencies
  • Loading branch information
andreszorro committed May 6, 2024
1 parent 50e574c commit 4c3d86d
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 35 deletions.
7 changes: 7 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://cdn.jsdelivr.net/gh/Zhengqbbb/[email protected]/docs/public/schema/cz-git.json",
"scopes": ["deps-dev", "deps", "generators", "templates", "scripts"],
"useEmoji": false,
"allowCustomIssuePrefix": false,
"emptyScopesAlias": "none"
}
8 changes: 7 additions & 1 deletion .husky/commit-msg
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env sh
#!/bin/bash

# If explicitly disabled, skip the hook
if [ "$(git config --get custom.hooks.commit-msg)" == "false" ]; then
echo "commit-msg: hook disabled by user"
exit 0
fi

bun commitlint --edit "$1"
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# If explicitly disabled, skip the hook
if [ "$(git config --get custom.hooks.pre-commit)" == "false" ]; then
echo "pre-commit: hook disabled by user"
exit 0
fi

bun lint-staged
11 changes: 8 additions & 3 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh

#!/bin/bash
# $2 contains the source of the commit message.
# It can be message, template, merge, squash, or commit (for git commit --amend)
if [ "$2" = "commit" ]; then
Expand All @@ -22,4 +21,10 @@ if [ -n "$GIT_SEQUENCE_EDITOR" ]; then
exit 0
fi

exec < /dev/tty && bun cz --hook || true
# If explicitly disabled, skip the hook
if [ "$(git config --get custom.hooks.prepare-commit-msg)" == "false" ]; then
echo "prepare-commit-msg: hook disabled by user"
exit 0
fi

exec < /dev/tty && bun czg --hook || true
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{json,ts,js,cjs,mjs,mts,css}": ["bun biome ci"],
"*.{ts,mjs}": ["bun test:ci"]
}
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"github.vscode-github-actions",
"gruntfuggly.todo-tree",
"biomejs.biome"
"biomejs.biome",
"streetsidesoftware.code-spell-checker"
]
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"files.associations": {
"*.hbs": "structurizr"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
Expand Down
36 changes: 21 additions & 15 deletions architecture/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
} ]
},
"id" : 1,
"lastModifiedDate" : "2024-03-18T21:31:04Z",
"lastModifiedAgent" : "structurizr-javascript",
"lastModifiedDate" : "2024-05-06T21:18:50Z",
"model" : {
"people" : [ {
"description" : "Architect",
Expand All @@ -58,7 +59,7 @@
"destinationId" : "1",
"id" : "7",
"properties" : {
"structurizr.dsl.identifier" : "b1a0b14a-2558-4af2-b9b4-0ea6b607fe44"
"structurizr.dsl.identifier" : "eb7d1b40-9293-44b6-a662-e58bef5abb01"
},
"sourceId" : "5",
"tags" : "Relationship",
Expand All @@ -68,7 +69,7 @@
"destinationId" : "4",
"id" : "10",
"properties" : {
"structurizr.dsl.identifier" : "4ca9d221-462b-40f8-84e6-2961c3e5c406"
"structurizr.dsl.identifier" : "94feb38d-3dba-45c2-a126-fa48c808d4a4"
},
"sourceId" : "5",
"tags" : "Relationship",
Expand Down Expand Up @@ -107,7 +108,7 @@
"destinationId" : "1",
"id" : "9",
"properties" : {
"structurizr.dsl.identifier" : "d339a508-1f97-408d-9e66-8dabde1d921e"
"structurizr.dsl.identifier" : "d27441a0-7130-4660-8d26-1941098681ba"
},
"sourceId" : "2",
"tags" : "Relationship",
Expand All @@ -128,7 +129,7 @@
"destinationId" : "2",
"id" : "12",
"properties" : {
"structurizr.dsl.identifier" : "03b46530-59f2-453b-9253-0182428b2c36"
"structurizr.dsl.identifier" : "91e8dc86-99b5-4971-a292-1ac802de1251"
},
"sourceId" : "4",
"tags" : "Relationship",
Expand All @@ -150,7 +151,7 @@
"destinationId" : "1",
"id" : "6",
"properties" : {
"structurizr.dsl.identifier" : "439e5c1c-3864-46bf-b162-faf67019a54f"
"structurizr.dsl.identifier" : "0ddcc401-1df0-4a9d-b323-201d82f759f2"
},
"sourceId" : "3",
"tags" : "Relationship",
Expand All @@ -160,7 +161,7 @@
"destinationId" : "2",
"id" : "8",
"properties" : {
"structurizr.dsl.identifier" : "83bbcae7-3353-4780-85b3-9a368459c5f3"
"structurizr.dsl.identifier" : "556dbc0b-610f-484b-8a8a-60802709d6eb"
},
"sourceId" : "3",
"tags" : "Relationship",
Expand All @@ -176,14 +177,15 @@
"views" : {
"configuration" : {
"branding" : { },
"lastSavedView" : "Container-001",
"lastSavedView" : "Scaffoldizr",
"metadataSymbols" : "SquareBrackets",
"styles" : { },
"terminology" : { },
"themes" : [ "https://structurizr.test.zemoga-client.com/share/1/theme" ]
},
"containerViews" : [ {
"automaticLayout" : {
"applied" : false,
"applied" : true,
"edgeSeparation" : 0,
"implementation" : "Graphviz",
"nodeSeparation" : 300,
Expand All @@ -192,18 +194,22 @@
"vertices" : false
},
"description" : "Command Line Interface (binary). Author: Formula.monks <[email protected]>",
"dimensions" : {
"height" : 841,
"width" : 2300
},
"elements" : [ {
"id" : "2",
"x" : 0,
"y" : 0
"x" : 1649,
"y" : 249
}, {
"id" : "4",
"x" : 0,
"y" : 0
"x" : 899,
"y" : 249
}, {
"id" : "5",
"x" : 0,
"y" : 0
"x" : 199,
"y" : 199
} ],
"externalSoftwareSystemBoundariesVisible" : false,
"generatedKey" : true,
Expand Down
7 changes: 6 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -26,5 +26,10 @@
"noUndeclaredVariables": "error"
}
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
Binary file modified bun.lockb
Binary file not shown.
File renamed without changes.
17 changes: 4 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"test:dev": "bun test --watch",
"test": "bun test",
"test:ci": "bun test --coverage",
"postinstall": "scripts/install-git-hooks.sh"
"postinstall": "scripts/install-git-hooks.sh",
"prepare": "husky"
},
"trustedDependencies": [".", "@biomejs/biome"],
"dependencies": {
Expand All @@ -25,25 +26,15 @@
"devDependencies": {
"@biomejs/biome": "^1.7.3",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.1.0",
"@commitlint/cz-commitlint": "^19.2.0",
"@commitlint/config-conventional": "^19.2.2",
"@types/bun": "^1.1.1",
"@types/yargs": "^17.0.32",
"branch-name-lint": "^2.1.1",
"commitizen": "^4.3.0",
"czg": "^1.9.1",
"generate-changelog": "^1.8.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
},
"lint-staged": {
"*.{json,ts,js,mjs,mts}": ["bun biome ci"],
"*.{ts,mjs}": ["bun test:ci"]
},
"branchNameLinter": {
"prefixes": ["feature", "bugfix", "hotfix", "release"],
"suggestions": {
Expand Down

0 comments on commit 4c3d86d

Please sign in to comment.