Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b98721e
feat(utilities): add basic ts guards to check for a certain type from…
michaelwittwer Jul 25, 2025
8eeef5e
docs(utilities): add some docs
michaelwittwer Jul 25, 2025
4bfa6b5
build(release): next version [skip_build]
actions-user Jul 25, 2025
844978c
refactor(logger): update to correct prerelease version
michaelwittwer Jul 25, 2025
887937c
build(release): next version [skip_build]
actions-user Jul 25, 2025
306fbb3
Merge branch 'main' into #53-basic-ts-guards
michaelwittwer Sep 9, 2025
6363ab2
Merge remote-tracking branch 'origin/#53-basic-ts-guards' into #53-ba…
michaelwittwer Sep 9, 2025
cd29211
build(release): next version [skip_build]
actions-user Sep 9, 2025
1939bfa
refactor(utils): use consistent naming
michaelwittwer Sep 9, 2025
70e68aa
Merge remote-tracking branch 'origin/#53-basic-ts-guards' into #53-ba…
michaelwittwer Sep 9, 2025
2630b3c
build(release): next version [skip_build]
actions-user Sep 9, 2025
355b0b4
build(*): add prettier check to CI
michaelwittwer Sep 9, 2025
588779d
Merge remote-tracking branch 'origin/#53-basic-ts-guards' into #53-ba…
michaelwittwer Sep 9, 2025
cb60f0c
refactor(*): prettify whole code base
michaelwittwer Sep 9, 2025
50efcc1
build(release): next version [skip_build]
actions-user Sep 9, 2025
5832940
refactor(*): rename lib specific names to format
michaelwittwer Sep 9, 2025
3329071
refactor(*): align lintstagedrc file pattern matching
michaelwittwer Sep 9, 2025
b6546e4
Merge remote-tracking branch 'origin/#53-basic-ts-guards' into #53-ba…
michaelwittwer Sep 9, 2025
d588e28
refactor(*): align script naming
michaelwittwer Sep 9, 2025
4763c67
build(release): next version [skip_build]
actions-user Sep 9, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ jobs:
# build lint plugins before linting
- name: Build lint plugins
run: npm run build:lint:ci
# check formatting
- name: Check Formatting
run: npm run format:ci
# lint
- name: Lint
run: npm run lint:ci
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"scripts": {
"build:ci": "lerna run build",
"build:lint:ci": "lerna run build:lint:ci",
"format": "lerna run format",
"format:ci": "lerna run format:ci",
"lint:ci": "lerna run lint:ci",
"prepare": "husky",
"prettier": "lerna run prettier",
"publish-libs": "node packages/publish-helper/dist/publish-lib",
"test:ci": "lerna run test:ci"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/branch-utilities/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# we use eslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude)
# and --files argument pointing to other files
src/{**/,}*.ts,test/{**/,}*.ts:
- npm run prettier:staged
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
8 changes: 5 additions & 3 deletions packages/branch-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/branch-utilities",
"version": "5.0.0",
"version": "5.0.1-pr53.1",
"description": "Utilities for local and ci to get branch name and stage",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand All @@ -16,13 +16,15 @@
"scripts": {
"prebuild": "rm -rf ./dist",
"build": "tsc",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix",
"lint:ci": "npm run lint:src",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "eslint --fix --cache",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ../publish-helper/dist/prepare-dist.js",
"test": "NODE_OPTIONS=\"--experimental-vm-modules --trace-warnings\" npx jest --config jest.config.js",
"test:ci": "npm run test",
Expand Down
13 changes: 9 additions & 4 deletions packages/branch-utilities/src/lib/base.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ describe('base utils', () => {
})

describe('parseBranchName', () => {

test('works when valid pattern', () => {
expect(parseBranchName('#7-abc')).toEqual({ branchId: 7, branchName: 'abc' } satisfies ReturnType<typeof parseBranchName>)
expect(parseBranchName('#7-abc')).toEqual({ branchId: 7, branchName: 'abc' } satisfies ReturnType<
typeof parseBranchName
>)

expect(parseBranchName('#72-abc').branchId).toBe(72)
expect(parseBranchName('#000-int').branchId).toBe(0)
Expand All @@ -94,8 +95,12 @@ describe('base utils', () => {
})

test('works for github copilot created branches', () => {
expect(parseBranchName('copilot/fix-123')).toEqual({ branchId: 123, branchName: 'fix' } satisfies ReturnType<typeof parseBranchName>)
expect(parseBranchName('copilot/feat-123')).toEqual({ branchId: 123, branchName: 'feat' } satisfies ReturnType<typeof parseBranchName>)
expect(parseBranchName('copilot/fix-123')).toEqual({ branchId: 123, branchName: 'fix' } satisfies ReturnType<
typeof parseBranchName
>)
expect(parseBranchName('copilot/feat-123')).toEqual({ branchId: 123, branchName: 'feat' } satisfies ReturnType<
typeof parseBranchName
>)
})

test('throws when invalid pattern', () => {
Expand Down
8 changes: 5 additions & 3 deletions packages/branch-utilities/src/lib/base.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ export function getBranchInfo(env: unknown, branchName?: string): BranchInfo {
}

export function isFullBranchOverrideDefined(envVars: unknown): envVars is CustomScOverrideEnv {
return envVars !== null
&& typeof (envVars as CustomScOverrideEnv).SC_OVERRIDE_BRANCH_NAME ==='string'
&& typeof (envVars as CustomScOverrideEnv).SC_OVERRIDE_IS_PR ==='string'
return (
envVars !== null &&
typeof (envVars as CustomScOverrideEnv).SC_OVERRIDE_BRANCH_NAME === 'string' &&
typeof (envVars as CustomScOverrideEnv).SC_OVERRIDE_IS_PR === 'string'
)
}

export function getBranchNameOverride(env: CustomScOverrideEnv): string {
Expand Down
7 changes: 3 additions & 4 deletions packages/eslint-config-recommended/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# we use eslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude)
# and --files argument pointing to other files
src/{**/,}*.ts,test/{**/,}*.ts:
- npm run prettier:staged
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
10 changes: 6 additions & 4 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": "5.0.0",
"version": "5.0.1-pr53.1",
"description": "default shiftcode config for eslint",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "UNLICENSED",
Expand All @@ -24,19 +24,21 @@
"prebuild": "rm -rf ./dist",
"build": "tsc",
"build:lint:ci": "npm run build",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix",
"lint:ci": "npm run lint:src",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "eslint --fix --cache",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ../publish-helper/dist/prepare-dist.js",
"test": "echo 'Error: no test specificed'",
"test:ci": "npm run test"
},
"dependencies": {
"@shiftcode/eslint-plugin-rules": "^4.0.0",
"@shiftcode/eslint-plugin-rules": "^4.0.1-pr53.1",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"eslint": "^8.56.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/eslint-plugin-rules/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# we use eslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude)
# and --files argument pointing to other files
src/{**/,}*.ts,test/{**/,}*.ts:
- npm run prettier:staged
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
8 changes: 5 additions & 3 deletions packages/eslint-plugin-rules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/eslint-plugin-rules",
"version": "4.0.0",
"version": "4.0.1-pr53.1",
"description": "eslint-rules for shiftcode-specific eslint rules",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "UNLICENSED",
Expand All @@ -14,13 +14,15 @@
"prebuild": "rm -rf ./dist",
"build": "tsc",
"build:lint:ci": "npm run build",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix",
"lint:ci": "npm run lint:src",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "eslint --fix --cache",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ../publish-helper/dist/prepare-dist.js",
"test": "jest",
"test:ci": "npm run test"
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run prettier:staged
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
12 changes: 7 additions & 5 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/logger",
"version": "3.0.0",
"version": "3.0.1-pr53.5",
"description": "logger for local and aws lambda execution",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "UNLICENSED",
Expand All @@ -20,25 +20,27 @@
"scripts": {
"prebuild": "rm -rf ./dist",
"build": "tsc",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix && npm run lint:test:fix",
"lint:ci": "npm run lint:src && npm run lint:test",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "npm run lint",
"lint:test": "eslint ./test",
"lint:test:fix": "eslint ./test --cache --fix",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ../publish-helper/dist/prepare-dist.js",
"test": "NODE_OPTIONS=\"--experimental-vm-modules --trace-warnings\" npx jest --config jest.config.js",
"test:ci": "npm run test",
"test:watch": "npm run test -- --watch"
},
"devDependencies": {
"@shiftcode/utilities": "^4.0.0"
"@shiftcode/utilities": "^4.1.0-pr53.5"
},
"peerDependencies": {
"@shiftcode/utilities": "^4.0.0 || ^4.0.0-pr45"
"@shiftcode/utilities": "^4.0.0 || ^4.0.0-pr53"
},
"engines": {
"node": "^20.0.0 || ^22.0.0"
Expand Down
7 changes: 3 additions & 4 deletions packages/publish-helper/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# we use eslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude)
# and --files argument pointing to other files
src/{**/,}*.ts,test/{**/,}*.ts:
- npm run prettier:staged
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
10 changes: 6 additions & 4 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": "4.1.0",
"version": "4.1.1-pr53.1",
"description": "scripts for conventional (pre)releases",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand All @@ -13,13 +13,15 @@
"scripts": {
"prebuild": "rm -rf ./dist",
"build": "tsc",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix",
"lint:ci": "npm run lint:src",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "eslint --fix --cache",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ./dist/prepare-dist.js",
"test": "NODE_OPTIONS=\"--experimental-vm-modules --trace-warnings\" npx jest --config jest.config.js --passWithNoTests",
"test:ci": "npm run test",
Expand All @@ -30,7 +32,7 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@shiftcode/branch-utilities": "^5.0.0",
"@shiftcode/branch-utilities": "^5.0.1-pr53.1",
"@types/yargs": "^17.0.32"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/publish-helper/src/prepare-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const argv = yargs(hideBin(process.argv)).option('include', {
type: 'array',
description: 'copy additional files into the dist folder',
default: [],
string: true
string: true,
}).argv

function log(...args: any[]) {
Expand Down
7 changes: 3 additions & 4 deletions packages/utilities/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# we use eslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude)
# and --files argument pointing to other files
src/{**/,}*.ts,test/{**/,}*.ts:
- npm run prettier:staged
# Reformat all .ts / .js
"**/*.(t|j)s":
- npm run format:staged
- npm run lint:staged

# sort package.json keys
Expand Down
8 changes: 5 additions & 3 deletions packages/utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shiftcode/utilities",
"version": "4.0.0",
"version": "4.1.0-pr53.5",
"description": "Contains some utilities",
"repository": "https://github.com/shiftcode/sc-commons-public",
"license": "MIT",
Expand All @@ -16,13 +16,15 @@
"scripts": {
"prebuild": "rm -rf ./dist",
"build": "tsc",
"format": "npm run format:base -- --write",
"format:base": "prettier --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"format:ci": "npm run format:base -- --check",
"format:staged": "prettier --write --config ../../.prettierrc.yml",
"lint": "npm run lint:src:fix",
"lint:ci": "npm run lint:src",
"lint:src": "eslint ./src",
"lint:src:fix": "eslint ./src --cache --fix",
"lint:staged": "eslint --fix --cache",
"prettier": "prettier --write --config ../../.prettierrc.yml '{src,e2e,test}/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml",
"prepublish": "node ../publish-helper/dist/prepare-dist.js",
"test": "NODE_OPTIONS=\"--experimental-vm-modules --trace-warnings\" npx jest --config jest.config.js",
"test:ci": "npm run test",
Expand Down
Loading