Skip to content

Commit

Permalink
Merge pull request #345 from ForgeRock/commitizen
Browse files Browse the repository at this point in the history
style: support-commitizen
  • Loading branch information
ryanbas21 authored May 19, 2023
2 parents adde82c + e8dc927 commit 08af8c0
Show file tree
Hide file tree
Showing 13 changed files with 806 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "cz-git",
"$schema": "https://cdn.jsdelivr.net/gh/Zhengqbbb/cz-git@1.6.1/docs/public/schema/cz-git.json"
}
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"allow": ["regenerator-runtime/runtime"],
"depConstraints": [
{
"sourceTag": "scope:sample",
Expand Down
6 changes: 6 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ $2 == "template" ]; then
exec < /dev/tty && npm run commit || true
fi
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ WORKDIR /app/builder
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ARG HUSKY=0
ENV HUSKY=0
ENV HUSKY_SKIP_HOOKS=1

COPY . /app/builder/

RUN npm ci --ignore-scripts
RUN npm install
ENV NODE_ENV=production

ARG AM_URL=$AM_URL
Expand Down
54 changes: 54 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
const fs = require('fs');
const path = require('path');

const packages = fs.readdirSync(path.resolve(__dirname, 'packages'));
const samples = fs.readdirSync(path.resolve(__dirname, 'samples'));
const e2e = fs.readdirSync(path.resolve(__dirname, 'e2e'));

/* commitlint.config.js | .commitlintrc.js
@type {import('cz-git').UserConfig} */
module.exports = {
extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'],
prompt: {
alias: { fd: 'docs: fix typos' },
types: [
{ value: 'feat', name: 'feat: ✨ A new feature', emoji: ':sparkles:' },
{ value: 'fix', name: 'fix: 🐛 A bug fix', emoji: ':bug:' },
{ value: 'docs', name: 'docs: 📝 Documentation only changes', emoji: ':memo:' },
{
value: 'style',
name: 'style: 💄 Changes that do not affect the meaning of the code',
emoji: ':lipstick:',
},
{
value: 'refactor',
name: 'refactor: ♻️ A code change that neither fixes a bug nor adds a feature',
emoji: ':recycle:',
},
{
value: 'perf',
name: 'perf: ⚡️ A code change that improves performance',
emoji: ':zap:',
},
{
value: 'test',
name: 'test: ✅ Adding missing tests or correcting existing tests',
emoji: ':white_check_mark:',
},
{
value: 'build',
name: 'build: 📦️ Changes that affect the build system or external dependencies',
emoji: ':package:',
},
{
value: 'ci',
name: 'ci: 🎡 Changes to our CI configuration files and scripts',
emoji: ':ferris_wheel:',
},
{
value: 'chore',
name: "chore: 🔨 Other changes that don't modify src or test files",
emoji: ':hammer:',
},
{ value: 'revert', name: 'revert: ⏪️ Reverts a previous commit', emoji: ':rewind:' },
],
scopes: [...packages, ...samples, ...e2e],
},
};
3 changes: 3 additions & 0 deletions e2e/mock-api/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@nx/js/babel", { "useBuiltIns": "entry" }]]
}
14 changes: 7 additions & 7 deletions e2e/mock-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
}
},
"serve": {
"executor": "@nx/js:node",
"executor": "nx:run-commands",
"options": {
"buildTarget": "mock-api:build",
"watch": true
"command": "node dist/e2e/mock-api/index.cjs"
},
"configurations": {
"live": {},
"development": {},
"production": {
"buildTarget": "mock-api:build:production",
"development": {
"readyWhen": "Listening to HTTPS on secure port: 9443",
"args": ["MOCK_PORT=9443"]
},
"production": {
"buildTarget": "mock-api:build:production"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/mock-api/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "ES2020",
"module": "CommonJS",
"allowUmdGlobalAccess": true,
"target": "ES2020",
"composite": true,
Expand Down
Loading

0 comments on commit 08af8c0

Please sign in to comment.