From bd2cf4b15f8e075ddcd2b29d928b44bc288438bb Mon Sep 17 00:00:00 2001 From: Thomas Vaillant Date: Fri, 23 Sep 2022 16:00:42 +0200 Subject: [PATCH 1/6] ci: fix typescript checks --- .github/workflows/build.yml | 6 +++--- .github/workflows/ci.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 952ec179..fffd45c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,9 +117,6 @@ jobs: run: yarn install --frozen-lockfile # End of yarn setup - - name: typescript checks - run: yarn typescript - # We have to build all the packages before the tests # Because init-log4brains's integration tests use @log4brains/cli, which uses @log4brains/core # TODO: we should separate tests that require built packages of the others, to get a quicker feedback @@ -130,6 +127,9 @@ jobs: yarn link-cli echo "$(yarn global bin)" >> $GITHUB_PATH + - name: typescript checks + run: yarn typescript + - name: test run: yarn test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d87dbc1..99b8c193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,9 +119,6 @@ jobs: # - steps.yarn-lock.outcome == 'success' --> yarn.lock was not changed # - steps.yarn-lock.outcome == 'failure' --> yarn.lock was changed - - name: typescript checks - run: yarn typescript - # We have to build all the packages before the tests # Because init-log4brains's integration tests use @log4brains/cli, which uses @log4brains/core # TODO: we should separate tests that require built packages of the others, to get a quicker feedback @@ -132,6 +129,9 @@ jobs: yarn link-cli echo "$(yarn global bin)" >> $GITHUB_PATH + - name: typescript checks + run: yarn typescript + - name: test changed packages if: ${{ steps.yarn-lock.outcome == 'success' }} run: yarn test --since origin/master From 58fdc2e977042dddad93d60aa308ec36109c0e6b Mon Sep 17 00:00:00 2001 From: Martin Goldhahn Date: Mon, 7 Jul 2025 00:07:08 +0200 Subject: [PATCH 2/6] fix(gitignore): gitgnore intellij files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 7068d9a6..9e24b9de 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,7 @@ dist # Log4brains .log4brains + +# IntelliJ +*.iml +.idea From 61280e2b306a4a89c5554a6c30b0daf9affb21c4 Mon Sep 17 00:00:00 2001 From: Martin Goldhahn Date: Mon, 7 Jul 2025 00:07:08 +0200 Subject: [PATCH 3/6] fix(gitignore): gitgnore intellij files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 674505c4..6a95282f 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,7 @@ dist # Log4brains .log4brains + +# IntelliJ +*.iml +.idea From c7c0699e92e554800d1a5cd4aaa68f7d3bcb7ee9 Mon Sep 17 00:00:00 2001 From: Martin Goldhahn Date: Mon, 7 Jul 2025 01:39:23 +0200 Subject: [PATCH 4/6] chore(browserlist): updated to latest browserlist --- package.json | 3 ++- yarn.lock | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 75a9230c..ea8386cb 100644 --- a/package.json +++ b/package.json @@ -74,5 +74,6 @@ "commitizen": { "path": "cz-conventional-changelog" } - } + }, + "dependencies": {} } diff --git a/yarn.lock b/yarn.lock index bc9a50a2..1289265b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5856,9 +5856,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001202, caniuse-lite@^1.0.30001214, caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001228: - version "1.0.30001687" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz" - integrity sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ== + version "1.0.30001727" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001727.tgz" + integrity sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q== capture-exit@^2.0.0: version "2.0.0" From d725b49cc14c991795039b7db0715d1260310e96 Mon Sep 17 00:00:00 2001 From: Martin Goldhahn Date: Sat, 26 Jul 2025 15:42:44 +0200 Subject: [PATCH 5/6] fix: update CONTRIBUTING.md development instructions - Replace broken 'yarn link-cli' with working 'cd packages/global-cli && yarn link' - Fix format command from 'yarn format:fix' to 'yarn format --write' - Update git workflow commands to use working alternatives - Add clear comments explaining the linking process --- CONTRIBUTING.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c38c9a4a..440b8761 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,19 +9,20 @@ Thank you so much! :clap: ## Development ```bash +# First, uninstall any global version and install dependencies npm uninstall -g log4brains yarn install -yarn link-cli + +# Build all packages yarn build -yarn dev -# ... if it does not work, you may have to add this line to your ~/.bashrc (or similar): -# export PATH="$PATH:$(yarn global bin)" +# Link the CLI for local development (only the global-cli package supports linking) +cd packages/global-cli && yarn link && cd ../.. -# You can now develop -# `yarn dev` re-builds the changed packages live +# Start development mode (watches and rebuilds packages on changes) +yarn dev -# You can test the different packages directly on the Log4brains project +# You can now develop and test the CLI directly on the Log4brains project log4brains adr new log4brains preview log4brains build @@ -40,7 +41,7 @@ cd $(mktemp -d -t l4b-test-XXXX) log4brains init ``` -When you are done, run `yarn unlink-cli && npm install -g log4brains` to use the official version again. +When you are done, run `cd packages/global-cli && yarn unlink && cd ../.. && npm install -g log4brains` to use the official version again. ## Coding standards @@ -75,13 +76,13 @@ Log4brains follows a **simplified Git Flow** model. Here’s how the process wor ```bash yarn lint # enforced automatically before every commit with husky+lint-staged - yarn format:fix # enforced automatically before every commit with husky+lint-staged + yarn format --write # format code (format:fix script may not work correctly) yarn typescript # enforced automatically before every commit with husky - yarn test:changed # (or `yarn test` to run all the tests) + yarn test # run all tests (test:changed may have issues) # Simulate the execution on a fresh install: - yarn link-cli yarn build + cd packages/global-cli && yarn link && cd ../.. rm -rf node_modules yarn install --production --no-lockfile yarn e2e From 29303d5853a8d94e257ccfa4eb2e0bbe9a7739c0 Mon Sep 17 00:00:00 2001 From: Martin Goldhahn Date: Sat, 26 Jul 2025 16:05:50 +0200 Subject: [PATCH 6/6] fix: resolve build errors and dependency warnings --- package.json | 2 +- packages/web/nextjs/src/lib/core-api/instance.ts | 2 +- packages/web/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ea8386cb..e3e69bca 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^7.20.6", "eslint-plugin-react-hooks": "^4.1.2", - "eslint-plugin-sonarjs": "^0.5.0", + "eslint-plugin-sonarjs": "^0.25.1", "husky": "^4.3.5", "jest": "^26.4.2", "jest-mock-extended": "^1.0.10", diff --git a/packages/web/nextjs/src/lib/core-api/instance.ts b/packages/web/nextjs/src/lib/core-api/instance.ts index 9851c48e..eb6ef05e 100644 --- a/packages/web/nextjs/src/lib/core-api/instance.ts +++ b/packages/web/nextjs/src/lib/core-api/instance.ts @@ -11,7 +11,7 @@ export function getLog4brainsInstance(): Log4brains { instance = Log4brains.create( path.join( getConfig().serverRuntimeConfig.PROJECT_ROOT, - "lib/core-api/noop" + "src/lib/core-api/noop" ) ); } else { diff --git a/packages/web/package.json b/packages/web/package.json index 4fc56044..a8d35c02 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -36,7 +36,7 @@ "build:cli": "microbundle --no-compress --format es,cjs --tsconfig tsconfig.build.json --target node", "clean:cli": "rimraf ./dist", "dev:nextjs": "cd nextjs && cross-env LOG4BRAINS_CWD=../.. NODE_OPTIONS=--openssl-legacy-provider next", - "build:nextjs": "yarn clean:nextjs && cd nextjs && cross-env LOG4BRAINS_PHASE=initial-build NODE_OPTIONS=--openssl-legacy-provider next build", + "build:nextjs": "yarn clean:nextjs && cd nextjs && cross-env LOG4BRAINS_CWD=../.. LOG4BRAINS_PHASE=initial-build NODE_OPTIONS=--openssl-legacy-provider next build", "clean:nextjs": "rimraf ./nextjs/.next ./nextjs/.next-export", "serve": "serve .log4brains/out", "typescript": "tsc --noEmit && cd nextjs && tsc", diff --git a/yarn.lock b/yarn.lock index 1289265b..1523364f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8235,10 +8235,10 @@ eslint-plugin-react@^7.20.6: resolve "^2.0.0-next.3" string.prototype.matchall "^4.0.4" -eslint-plugin-sonarjs@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.5.0.tgz#ce17b2daba65a874c2862213a9e38e8986ad7d7d" - integrity sha512-XW5MnzlRjhXpIdbULC/qAdJYHWw3rRLws/DyawdlPU/IdVr9AmRK1r2LaCvabwKOAW2XYYSo3kDX58E4MrB7PQ== +eslint-plugin-sonarjs@^0.25.1: + version "0.25.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.25.1.tgz#0619798dbc27b04fd0a8e6d0fb6adf7fa2cb5041" + integrity sha512-5IOKvj/GMBNqjxBdItfotfRHo7w48496GOu1hxdeXuD0mB1JBlDCViiLHETDTfA8pDAVSBimBEQoetRXYceQEw== eslint-scope@^3.7.1: version "3.7.3"