Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/branch-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/branch-utilities",
"version": "6.0.0",
"version": "6.1.0-pr7.1",
"description": "Utilities for local and ci to get branch name and stage",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand Down
14 changes: 13 additions & 1 deletion packages/branch-utilities/src/lib/base.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ describe('base utils', () => {

expect(parseBranchName('#72- whatever').branchId).toBe(72)
expect(parseBranchName('feature/#72-ok').branchId).toBe(72)
expect(parseBranchName('1-foobar')).toEqual({ branchId: 1, branchName: 'foobar' } satisfies ReturnType<
typeof parseBranchName
>)
expect(parseBranchName('feat/42-foo-bar-baz')).toEqual({
branchId: 42,
branchName: 'foo-bar-baz',
} satisfies ReturnType<typeof parseBranchName>)
expect(parseBranchName('007-oh-james')).toEqual({ branchId: 7, branchName: 'oh-james' } satisfies ReturnType<
typeof parseBranchName
>)
})

test('works for github copilot created branches', () => {
Expand All @@ -107,8 +117,10 @@ describe('base utils', () => {

test('throws when invalid pattern', () => {
expect(() => parseBranchName('whrjwe')).toThrow()
expect(() => parseBranchName('copilot/123-fix')).toThrow()
expect(() => parseBranchName('feat/copilot/fix-123')).toThrow()
expect(() => parseBranchName('/42-foo')).toThrow()
expect(() => parseBranchName('fix-7-issues')).toThrow()
expect(() => parseBranchName('fix7-issues')).toThrow()
})
})

Expand Down
4 changes: 2 additions & 2 deletions packages/branch-utilities/src/lib/base.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const REGEX_MAIN = /^main$/
* @example #123-my-feature -> { id: '123', name: 'my-feature' }
* @example feature/#456-yanr -> { id: '456', name: 'yanr' }
*/
const REGEX_BRANCH_NAME_DEFAULT = /^[a-z]*\/?#(?<id>\d+)-(?<name>.*)$/
const REGEX_BRANCH_NAME_DEFAULT = /^(?:[a-z]+\/)?#?(?<id>\d+)-(?<name>.*)$/
/**
* regex to match the branch convention github copilot uses with the following named capture groups: id, name
* @example copilot/fix-789 -> { id: '789', name: 'fix' }
Expand Down Expand Up @@ -153,7 +153,7 @@ export function parseBranchName(branchName: string): { branchId: number; branchN
}
} else {
throw new Error(
`given branch name ${branchName} does not match our convention #<one or more digit>-<branch-name-with-kebap-case>`,
`given branch name ${branchName} does not match our convention #<one or more digit>-<branch-name-with-kebap-case> (# is optional, feat/123-foo-bar is also valid)`,
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-recommended/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/eslint-config-recommended",
"version": "7.0.0",
"version": "7.0.1-pr7.1",
"description": "default shiftcode config for eslint",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,7 @@
"angular-eslint": "^20.5.1"
},
"peerDependencies": {
"angular-eslint": "^20.5.1 || ^21.0.0"
"angular-eslint": "^20.5.1 || ^21.0.0 || ^22.0.0"
Comment thread
mumenthalers marked this conversation as resolved.
Outdated
},
"peerDependenciesMeta": {
"angular-eslint": {
Expand Down
4 changes: 2 additions & 2 deletions packages/iac-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/iac-utilities",
"version": "1.0.1",
"version": "1.0.2-pr7.1",
"description": "scripts and util functions for aws iac",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand Down Expand Up @@ -54,7 +54,7 @@
"@aws-sdk/client-s3": "^3.204.0",
"@aws-sdk/credential-providers": "^3.204.0",
"@aws-sdk/types": "^3.201.0",
"@shiftcode/branch-utilities": "^6.0.0",
"@shiftcode/branch-utilities": "^6.1.0-pr7.1",
Comment thread
mumenthalers marked this conversation as resolved.
Outdated
"@shiftcode/lambda-utilities": "^1.0.1",
"@types/yargs": "^17.0.5"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/publish-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/publish-helper",
"version": "6.0.0",
"version": "6.0.1-pr7.1",
"description": "scripts for conventional (pre)releases",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand All @@ -25,7 +25,7 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@shiftcode/branch-utilities": "^6.0.0",
"@shiftcode/branch-utilities": "^6.1.0-pr7.1",
Comment thread
mumenthalers marked this conversation as resolved.
Outdated
"@types/yargs": "^17.0.32"
},
"peerDependencies": {
Expand Down
Loading