diff --git a/.commitlintrc.yml b/.commitlintrc.yml index cbab72e..9f17590 100644 --- a/.commitlintrc.yml +++ b/.commitlintrc.yml @@ -1,4 +1,4 @@ extends: - - "@commitlint/config-angular" + - '@commitlint/config-angular' rules: 'header-max-length': [2, 'always', 100] diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index ed67729..ce8fb1f 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -1,6 +1,6 @@ # https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment # The copilot-setup-steps.yml workflow won't trigger unless it's present on your main branch. -name: "Copilot Setup Steps" +name: 'Copilot Setup Steps' # Automatically run the setup steps when they are changed to allow for easy validation, and # allow manual testing through the repository's "Actions" tab @@ -33,4 +33,4 @@ jobs: cache: 'npm' - name: GitHub registry Auth & Install Dependencies - run: npm ci \ No newline at end of file + run: npm ci diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bc2626..e52ddc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: name: Check for execution uses: shiftcode/github-action-skip@v4.0.0 with: - skipOnCommitMsg: "[skip_build]" + skipOnCommitMsg: '[skip_build]' githubToken: ${{ secrets.GITHUB_TOKEN }} test: runs-on: ubuntu-latest diff --git a/.husky/pre-commit b/.husky/pre-commit index 5a4886f..7350666 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npx lint-staged && npx lerna exec --concurrency 1 --stream lint-staged +npx lerna exec --concurrency 1 --stream lint-staged && npx lint-staged diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml index 07bad69..5c35b40 100644 --- a/.lintstagedrc.yml +++ b/.lintstagedrc.yml @@ -1,2 +1,5 @@ ./package.json: - npx sort-package-json + +'*': + - npm run format:staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist/ diff --git a/README.md b/README.md index 0e97930..1a0e7ee 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,37 @@ Public helper packages with commonly used utilities / helpers. +> [![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \ +> functions to read information about the current branch either locally or inside Github actions. ->[![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \ ->functions to read information about the current branch either locally or inside Github actions. +> [![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \ +> Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular. ->[![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \ ->Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular. +> [![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \ +> Contains some custom es lint rules. Those are used in our recommended eslint config. ->[![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \ ->Contains some custom es lint rules. Those are used in our recommended eslint config. - ->[![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\ ->scripts to prepare and publish libs inside mono-repos with lerna +> [![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\ +> scripts to prepare and publish libs inside mono-repos with lerna ->[![@shiftcode/utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Futilities%2Fpackage.json&label=%40shiftcode%2Futilities)](packages/utilities)\ ->various utility functions, constants and helper types - usable in Node and Browsers +> [![@shiftcode/utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Futilities%2Fpackage.json&label=%40shiftcode%2Futilities)](packages/utilities)\ +> various utility functions, constants and helper types - usable in Node and Browsers ## Usage + Add a `.npmrc` file to the root of your project: + ``` @shiftcode:registry=https://npm.pkg.github.com ``` ## Quick Start -* `npm i` -* `npm run build` -* start developing +- `npm i` +- `npm run build` +- start developing ## Versioning + When opening a PR lerna publishes a new prerelease version with the preId `-prXX.{COUNT}`. By creating this version lerna creates a commit with the updated versions in the package.json. It does not update the `peerDependencies` versions. @@ -39,26 +41,31 @@ After merging the PR back to the master a new release is published with the grad > ensure your branch is named correctly by the convention `#XX-name` where `XX` is your github issue number. ### Hint + If it happens that you already have another commit locally, before updating the branch with this `build(release):..` commit: -> use `rebase` instead of `merge` +> use `rebase` instead of `merge` ## Anatomy of the repo We use lerna to manage the packages. + - For lerna to know the topological order of packages, we define the dependencies between the packages in each individual package as `devDependency` - For testing reasons we compile against the source code to run tests without prior compiling of the source, this requires `tsconfig.paths` definitions and also `moduleNameMapper` in `jest.config.js` ## ES Version + We support two runtimes: `node` and `latest browser versions`. ### Node 22 -Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features + +Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features (no version supports 100%) and [100%](https://node.green/#ES2023) of `es2023` features. The only `es2022` feature that is currently not supported and needs a polyfill when using it is -[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights). +[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights). Polyfill can be found here: https://www.npmjs.com/package/regexp-match-indices. ### Browser + For modern browsers the latest fully supported version is `es2023` (see [can-i-use](https://caniuse.com/?search=es2023)) which therefore is the target for `@shiftcode/utilities` package (see [package README](./packages/utilities/README.md)). diff --git a/package-lock.json b/package-lock.json index 35463a3..2714ef7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15487,7 +15487,7 @@ }, "packages/branch-utilities": { "name": "@shiftcode/branch-utilities", - "version": "5.1.0", + "version": "5.1.1-pr67.0", "license": "MIT", "engines": { "node": "^20.0.0 || ^22.0.0" @@ -15498,11 +15498,11 @@ }, "packages/eslint-config-recommended": { "name": "@shiftcode/eslint-config-recommended", - "version": "6.0.0", + "version": "6.0.1-pr67.0", "license": "UNLICENSED", "dependencies": { "@eslint/js": "^9.37.0", - "@shiftcode/eslint-plugin-rules": "^5.0.0", + "@shiftcode/eslint-plugin-rules": "^5.0.1-pr67.0", "eslint": "^9.37.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", @@ -15527,7 +15527,7 @@ }, "packages/eslint-plugin-rules": { "name": "@shiftcode/eslint-plugin-rules", - "version": "5.0.0", + "version": "5.0.1-pr67.0", "license": "UNLICENSED", "dependencies": { "@typescript-eslint/utils": "^8.46.0" @@ -15545,10 +15545,10 @@ }, "packages/logger": { "name": "@shiftcode/logger", - "version": "3.0.3", + "version": "3.0.4-pr67.0", "license": "UNLICENSED", "devDependencies": { - "@shiftcode/utilities": "^4.3.0" + "@shiftcode/utilities": "^4.3.1-pr67.0" }, "engines": { "node": "^20.0.0 || ^22.0.0" @@ -15559,7 +15559,7 @@ }, "packages/publish-helper": { "name": "@shiftcode/publish-helper", - "version": "4.2.0", + "version": "4.2.1-pr67.0", "license": "MIT", "dependencies": { "conventional-changelog-angular": "^8.0.0", @@ -15570,7 +15570,7 @@ "publish-lib": "dist/publish-lib.js" }, "devDependencies": { - "@shiftcode/branch-utilities": "^5.1.0", + "@shiftcode/branch-utilities": "^5.1.1-pr67.0", "@types/yargs": "^17.0.32" }, "engines": { @@ -15595,7 +15595,7 @@ }, "packages/utilities": { "name": "@shiftcode/utilities", - "version": "4.3.0", + "version": "4.3.1-pr67.0", "license": "MIT", "engines": { "node": "^20.0.0 || ^22.0.0" diff --git a/package.json b/package.json index 1e1abcc..3430fb7 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,9 @@ "scripts": { "build:ci": "lerna run build", "build:lint:ci": "lerna run build --scope @shiftcode/eslint-plugin-rules && lerna run build --scope @shiftcode/eslint-config-recommended", - "format": "lerna run format", - "format:ci": "lerna run format:ci", + "format": "prettier --write .", + "format:ci": "prettier --check .", + "format:staged": "prettier --write --ignore-unknown", "lint:ci": "lerna run lint:ci", "prepare": "husky", "publish-libs": "node packages/publish-helper/dist/publish-lib", diff --git a/packages/branch-utilities/.lintstagedrc.yml b/packages/branch-utilities/.lintstagedrc.yml index a033e03..4ad7472 100644 --- a/packages/branch-utilities/.lintstagedrc.yml +++ b/packages/branch-utilities/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: - - sort-package-json \ No newline at end of file +'./package.json': + - sort-package-json diff --git a/packages/branch-utilities/package.json b/packages/branch-utilities/package.json index af50277..46fbfb3 100644 --- a/packages/branch-utilities/package.json +++ b/packages/branch-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/branch-utilities", - "version": "5.1.0", + "version": "5.1.1-pr67.0", "description": "Utilities for local and ci to get branch name and stage", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", diff --git a/packages/branch-utilities/tsconfig.jest.json b/packages/branch-utilities/tsconfig.jest.json index 406accb..d40fa1e 100644 --- a/packages/branch-utilities/tsconfig.jest.json +++ b/packages/branch-utilities/tsconfig.jest.json @@ -3,9 +3,5 @@ "compilerOptions": { "baseUrl": "./" }, - "include": [ - "src/**/*.spec.ts", - "test/**/*.ts" - ] + "include": ["src/**/*.spec.ts", "test/**/*.ts"] } - diff --git a/packages/branch-utilities/tsconfig.lint.json b/packages/branch-utilities/tsconfig.lint.json index 5b8b248..922aad8 100644 --- a/packages/branch-utilities/tsconfig.lint.json +++ b/packages/branch-utilities/tsconfig.lint.json @@ -4,10 +4,6 @@ "baseUrl": "./", "types": ["jest", "node"] }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], + "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": [] } - diff --git a/packages/eslint-config-recommended/.lintstagedrc.yml b/packages/eslint-config-recommended/.lintstagedrc.yml index bb9649d..4ad7472 100644 --- a/packages/eslint-config-recommended/.lintstagedrc.yml +++ b/packages/eslint-config-recommended/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: +'./package.json': - sort-package-json diff --git a/packages/eslint-config-recommended/README.md b/packages/eslint-config-recommended/README.md index 5a83bfc..3ebd5e4 100644 --- a/packages/eslint-config-recommended/README.md +++ b/packages/eslint-config-recommended/README.md @@ -2,14 +2,15 @@ > 🎯 Target runtime: es2023 ([Node >= 20](https://node.green/#ES2023)) - This module provides an eslint default rule-set configuration for shiftcode projects. ### remark + By using this module, the [@shiftcode/eslint-plugin-rules](../eslint-plugin-rules) module will be automatically installed as dependency. ## usage + the module only exports a single function `defineScTsConfig` which can be used to create the eslint configuration. it is basically a wrapper around the new eslint `defineConfig` function but already includes the setup for typescript, some rules with default configurations and will ensure the prettier rules (disabling formatting rules) are included at last. @@ -32,13 +33,13 @@ export default defineScTsConfig( rules: { '@typescript-eslint/explicit-function-return-type': 'error', }, - } + }, ) ``` ## Additional configurations -Additionally on the submodule `/angular` the `defineScAngularConfig` function is exported +Additionally on the submodule `/angular` the `defineScAngularConfig` function is exported which includes angular-specific rules and configurations. ```js @@ -59,7 +60,7 @@ export default defineScAngularConfig( rules: { '@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'gf', style: 'kebab-case' }], }, - } + }, ) ``` diff --git a/packages/eslint-config-recommended/package.json b/packages/eslint-config-recommended/package.json index cf9b269..29da058 100644 --- a/packages/eslint-config-recommended/package.json +++ b/packages/eslint-config-recommended/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/eslint-config-recommended", - "version": "6.0.0", + "version": "6.0.1-pr67.0", "description": "default shiftcode config for eslint", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", @@ -34,7 +34,7 @@ }, "dependencies": { "@eslint/js": "^9.37.0", - "@shiftcode/eslint-plugin-rules": "^5.0.0", + "@shiftcode/eslint-plugin-rules": "^5.0.1-pr67.0", "eslint": "^9.37.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", diff --git a/packages/eslint-config-recommended/tsconfig.json b/packages/eslint-config-recommended/tsconfig.json index fedb240..6812fc3 100644 --- a/packages/eslint-config-recommended/tsconfig.json +++ b/packages/eslint-config-recommended/tsconfig.json @@ -6,7 +6,5 @@ "declarationDir": "./dist", "types": ["node"] }, - "include": [ - "src/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/packages/eslint-config-recommended/tsconfig.lint.json b/packages/eslint-config-recommended/tsconfig.lint.json index fd36dc4..f79528e 100644 --- a/packages/eslint-config-recommended/tsconfig.lint.json +++ b/packages/eslint-config-recommended/tsconfig.lint.json @@ -7,10 +7,6 @@ "@shiftcode/eslint-plugin-rules": ["../eslint-plugin-rules/src/index.ts"] } }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], + "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": [] } - diff --git a/packages/eslint-plugin-rules/.lintstagedrc.yml b/packages/eslint-plugin-rules/.lintstagedrc.yml index a033e03..4ad7472 100644 --- a/packages/eslint-plugin-rules/.lintstagedrc.yml +++ b/packages/eslint-plugin-rules/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: - - sort-package-json \ No newline at end of file +'./package.json': + - sort-package-json diff --git a/packages/eslint-plugin-rules/README.md b/packages/eslint-plugin-rules/README.md index 641ff32..c835cf5 100644 --- a/packages/eslint-plugin-rules/README.md +++ b/packages/eslint-plugin-rules/README.md @@ -14,25 +14,25 @@ import eslintScPlugin from '@shiftcode/eslint-plugin-rules' export default defineConfig( // ... - { - files: ['*.ts'], - extends: [eslintScPlugin.configs.recommended], - rules: { - '@shiftcode/import-denylist': [ // former TSLint rule: "import-blacklist" - 'error', - { - patterns: [ - /aws-cdk-lib\/core/, - /\.\/(core|models|shared|static)\/.*/, // use app/* instead - /^app\/core/, // disallow importing from self - /^somewhat\/.*/, // import filename must never start with "somewhat" - /example$/, // import filename must never end with "example" - // etc ... - ], - }, - ], - }, + { + files: ['*.ts'], + extends: [eslintScPlugin.configs.recommended], + rules: { + '@shiftcode/import-denylist': [ + 'error', + { + patterns: [ + /aws-cdk-lib\/core/, + /\.\/(core|models|shared|static)\/.*/, // use app/* instead + /^app\/core/, // disallow importing from self + /^somewhat\/.*/, // import filename must never start with "somewhat" + /example$/, // import filename must never end with "example" + // etc ... + ], + }, + ], }, + }, // ... ) @@ -46,12 +46,12 @@ import eslintScPlugin from '@shiftcode/eslint-plugin-rules' export default defineConfig({ files: ['**/*.ts'], plugins: { - '@shiftcode': eslintScPlugin + '@shiftcode': eslintScPlugin, }, rules: { '@shiftcode/prefix-builtin-module-import': 'error', // ... - } + }, }) ``` @@ -72,17 +72,20 @@ This can potentially be replaced by using [no-restricted-imports](https://eslint - example configuration: see above ### prefix-builtin-module-import + This rule ensures all node builtin modules are imported with the `node:` prefix. - note: this rule is already included by [@shiftcode/eslint-config-recommended](../eslint-config-recommended) - ✅ Correct + ```js import { writeFile } from 'node:fs/promises' import crypto from 'node:crypto' ``` + ❌ Incorrect + ```js import { writeFile } from 'fs/promises' import crypto from 'crypto' diff --git a/packages/eslint-plugin-rules/eslint-suppressions.json b/packages/eslint-plugin-rules/eslint-suppressions.json index 8aa6721..8676e5a 100644 --- a/packages/eslint-plugin-rules/eslint-suppressions.json +++ b/packages/eslint-plugin-rules/eslint-suppressions.json @@ -14,4 +14,4 @@ "count": 2 } } -} \ No newline at end of file +} diff --git a/packages/eslint-plugin-rules/package.json b/packages/eslint-plugin-rules/package.json index 0afc5a1..756c6ef 100644 --- a/packages/eslint-plugin-rules/package.json +++ b/packages/eslint-plugin-rules/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/eslint-plugin-rules", - "version": "5.0.0", + "version": "5.0.1-pr67.0", "description": "eslint-rules for shiftcode-specific eslint rules", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", diff --git a/packages/eslint-plugin-rules/test/tsconfig.json b/packages/eslint-plugin-rules/test/tsconfig.json index 01cff34..3a7227a 100644 --- a/packages/eslint-plugin-rules/test/tsconfig.json +++ b/packages/eslint-plugin-rules/test/tsconfig.json @@ -7,7 +7,5 @@ "esModuleInterop": true, "experimentalDecorators": true }, - "files": [ - "file.ts" - ], -} \ No newline at end of file + "files": ["file.ts"] +} diff --git a/packages/eslint-plugin-rules/tsconfig.jest.json b/packages/eslint-plugin-rules/tsconfig.jest.json index 406accb..d40fa1e 100644 --- a/packages/eslint-plugin-rules/tsconfig.jest.json +++ b/packages/eslint-plugin-rules/tsconfig.jest.json @@ -3,9 +3,5 @@ "compilerOptions": { "baseUrl": "./" }, - "include": [ - "src/**/*.spec.ts", - "test/**/*.ts" - ] + "include": ["src/**/*.spec.ts", "test/**/*.ts"] } - diff --git a/packages/eslint-plugin-rules/tsconfig.json b/packages/eslint-plugin-rules/tsconfig.json index 7d37ed2..6812fc3 100644 --- a/packages/eslint-plugin-rules/tsconfig.json +++ b/packages/eslint-plugin-rules/tsconfig.json @@ -4,9 +4,7 @@ "baseUrl": "./", "outDir": "./dist", "declarationDir": "./dist", - "types": ["node"], + "types": ["node"] }, - "include": [ - "src/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/packages/eslint-plugin-rules/tsconfig.lint.json b/packages/eslint-plugin-rules/tsconfig.lint.json index b17fb76..c653bf3 100644 --- a/packages/eslint-plugin-rules/tsconfig.lint.json +++ b/packages/eslint-plugin-rules/tsconfig.lint.json @@ -4,10 +4,6 @@ "baseUrl": "./" }, "types": ["jest", "node"], - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], + "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": [] } - diff --git a/packages/logger/.lintstagedrc.yml b/packages/logger/.lintstagedrc.yml index a033e03..4ad7472 100644 --- a/packages/logger/.lintstagedrc.yml +++ b/packages/logger/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: - - sort-package-json \ No newline at end of file +'./package.json': + - sort-package-json diff --git a/packages/logger/README.md b/packages/logger/README.md index 7dc7e46..b11b7c0 100644 --- a/packages/logger/README.md +++ b/packages/logger/README.md @@ -2,13 +2,13 @@ > 🎯 Target runtime: es2023 ([Node >= 20](https://node.green/#ES2023)) -A simple logger to use with minimal dependencies. -By default, the logger is standalone and can be easily configured to log +A simple logger to use with minimal dependencies. +By default, the logger is standalone and can be easily configured to log messages to various transports. # Usage -````typescript +```typescript import { Logger, LogLevel, LogTransport, BaseLoggerService } from '@shiftcode/logger' // Create a transport for logging to the console with a specific log level @@ -27,4 +27,4 @@ logger.debug('This is a debug message') logger.info('This is an info message') logger.warn('This is a warning message') logger.error('This is an error message') -```` \ No newline at end of file +``` diff --git a/packages/logger/package.json b/packages/logger/package.json index fb96b48..da7a23b 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/logger", - "version": "3.0.3", + "version": "3.0.4-pr67.0", "description": "logger for local and aws lambda execution", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", @@ -33,7 +33,7 @@ "test:watch": "npm run test -- --watch" }, "devDependencies": { - "@shiftcode/utilities": "^4.3.0" + "@shiftcode/utilities": "^4.3.1-pr67.0" }, "peerDependencies": { "@shiftcode/utilities": "^4.0.0 || ^4.0.0-pr53" diff --git a/packages/logger/tsconfig.jest.json b/packages/logger/tsconfig.jest.json index 4873dcd..141e5f5 100644 --- a/packages/logger/tsconfig.jest.json +++ b/packages/logger/tsconfig.jest.json @@ -6,8 +6,5 @@ "@shiftcode/utilities": ["../utilities/src"] } }, - "include": [ - "src/**/*.spec.ts", - "test/**/*.ts" - ] -} \ No newline at end of file + "include": ["src/**/*.spec.ts", "test/**/*.ts"] +} diff --git a/packages/logger/tsconfig.lint.json b/packages/logger/tsconfig.lint.json index e0154de..69d6ac1 100644 --- a/packages/logger/tsconfig.lint.json +++ b/packages/logger/tsconfig.lint.json @@ -7,9 +7,6 @@ "@shiftcode/utilities": ["../utilities/src/index.ts"] } }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], - "exclude": [], + "include": ["src/**/*.ts", "test/**/*.ts"], + "exclude": [] } diff --git a/packages/publish-helper/.lintstagedrc.yml b/packages/publish-helper/.lintstagedrc.yml index a033e03..4ad7472 100644 --- a/packages/publish-helper/.lintstagedrc.yml +++ b/packages/publish-helper/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: - - sort-package-json \ No newline at end of file +'./package.json': + - sort-package-json diff --git a/packages/publish-helper/README.md b/packages/publish-helper/README.md index 9938c28..e94adc3 100644 --- a/packages/publish-helper/README.md +++ b/packages/publish-helper/README.md @@ -5,25 +5,30 @@ Contains js scripts for publishing libraries ## Publish Lib [depends on lerna] + command: `publish-lib` updates the package.json version and the changelog file (changelog only on main/master)\ and makes a commit with the updated versions. make sure to provide the following env vars in the GitHub workflow: + - `GITHUB_CONTEXT: ${{ toJson(github) }}` - `GH_TOKEN: ${{ secrets.GH_TOKEN_3 }}` options: + - `--verbose` use lerna in verbose mode - `--canary` use lerna canary mode instead of conventional-prerelease for PR releases ## Prepare Dist + command: `prepare-dist` -Copies package.json and other files to the dist directory to allow publishing the dist instead of the package root. +Copies package.json and other files to the dist directory to allow publishing the dist instead of the package root. When using another dir name than `dist` specify the name inside the package.json\ + ```json { "publishConfig": { @@ -33,4 +38,5 @@ When using another dir name than `dist` specify the name inside the package.json ``` options: + - `--include` copy additional files to the dist folder e.g. `--include extra.md` diff --git a/packages/publish-helper/eslint-suppressions.json b/packages/publish-helper/eslint-suppressions.json index 42268be..d8479f0 100644 --- a/packages/publish-helper/eslint-suppressions.json +++ b/packages/publish-helper/eslint-suppressions.json @@ -15,4 +15,4 @@ "count": 2 } } -} \ No newline at end of file +} diff --git a/packages/publish-helper/package.json b/packages/publish-helper/package.json index 8ab3bcb..f055c75 100644 --- a/packages/publish-helper/package.json +++ b/packages/publish-helper/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/publish-helper", - "version": "4.2.0", + "version": "4.2.1-pr67.0", "description": "scripts for conventional (pre)releases", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", @@ -30,7 +30,7 @@ "yargs": "^17.7.2" }, "devDependencies": { - "@shiftcode/branch-utilities": "^5.1.0", + "@shiftcode/branch-utilities": "^5.1.1-pr67.0", "@types/yargs": "^17.0.32" }, "peerDependencies": { diff --git a/packages/publish-helper/tsconfig.jest.json b/packages/publish-helper/tsconfig.jest.json index 60ebfcd..a2a478b 100644 --- a/packages/publish-helper/tsconfig.jest.json +++ b/packages/publish-helper/tsconfig.jest.json @@ -6,9 +6,5 @@ "@shiftcode/branch-utilities": ["../branch-utilities/src/index.ts"] } }, - "include": [ - "src/**/*.spec.ts", - "test/**/*.ts" - ] + "include": ["src/**/*.spec.ts", "test/**/*.ts"] } - diff --git a/packages/publish-helper/tsconfig.json b/packages/publish-helper/tsconfig.json index 4d47614..f861ecd 100644 --- a/packages/publish-helper/tsconfig.json +++ b/packages/publish-helper/tsconfig.json @@ -7,7 +7,5 @@ "declarationDir": null, "types": ["node"] }, - "include": [ - "src/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/packages/publish-helper/tsconfig.lint.json b/packages/publish-helper/tsconfig.lint.json index 3c672cc..27da0e0 100644 --- a/packages/publish-helper/tsconfig.lint.json +++ b/packages/publish-helper/tsconfig.lint.json @@ -4,13 +4,9 @@ "baseUrl": "./", "types": ["jest", "node"], "paths": { - "@shiftcode/branch-utilities": ["../branch-utilities/src/index.ts"], + "@shiftcode/branch-utilities": ["../branch-utilities/src/index.ts"] } }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], + "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": [] } - diff --git a/packages/utilities/.lintstagedrc.yml b/packages/utilities/.lintstagedrc.yml index a033e03..4ad7472 100644 --- a/packages/utilities/.lintstagedrc.yml +++ b/packages/utilities/.lintstagedrc.yml @@ -1,8 +1,5 @@ -# Reformat all .ts / .js -"**/*.(t|j)s": - - npm run format:staged +'{src,test}/**/*.(t|j)s': - npm run lint:staged -# sort package.json keys -./package.json: - - sort-package-json \ No newline at end of file +'./package.json': + - sort-package-json diff --git a/packages/utilities/eslint-suppressions.json b/packages/utilities/eslint-suppressions.json index 63f73d1..bb7c296 100644 --- a/packages/utilities/eslint-suppressions.json +++ b/packages/utilities/eslint-suppressions.json @@ -47,4 +47,4 @@ "count": 1 } } -} \ No newline at end of file +} diff --git a/packages/utilities/package.json b/packages/utilities/package.json index f3abd6c..01f63d1 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/utilities", - "version": "4.3.0", + "version": "4.3.1-pr67.0", "description": "Contains some utilities", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", diff --git a/packages/utilities/tsconfig.jest.json b/packages/utilities/tsconfig.jest.json index 911257b..d40fa1e 100644 --- a/packages/utilities/tsconfig.jest.json +++ b/packages/utilities/tsconfig.jest.json @@ -3,8 +3,5 @@ "compilerOptions": { "baseUrl": "./" }, - "include": [ - "src/**/*.spec.ts", - "test/**/*.ts" - ] + "include": ["src/**/*.spec.ts", "test/**/*.ts"] } diff --git a/packages/utilities/tsconfig.lint.json b/packages/utilities/tsconfig.lint.json index 5b8b248..922aad8 100644 --- a/packages/utilities/tsconfig.lint.json +++ b/packages/utilities/tsconfig.lint.json @@ -4,10 +4,6 @@ "baseUrl": "./", "types": ["jest", "node"] }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], + "include": ["src/**/*.ts", "test/**/*.ts"], "exclude": [] } - diff --git a/tsconfig.jest.json b/tsconfig.jest.json index a48ad1a..e67cf8f 100644 --- a/tsconfig.jest.json +++ b/tsconfig.jest.json @@ -4,10 +4,7 @@ "declaration": false, "declarationDir": null, "noEmit": true, - "types": [ - "jest", - "node" - ], + "types": ["jest", "node"], "strictPropertyInitialization": false, "resolveJsonModule": true }, diff --git a/tsconfig.json b/tsconfig.json index 011577f..45b0803 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,5 @@ "declaration": true, "importHelpers": true }, - "exclude": [ - "**/*.spec.ts", - "packages/**/test/**/*.ts" - ] + "exclude": ["**/*.spec.ts", "packages/**/test/**/*.ts"] }