From 51954af82590fee22d4a010f1ab2dbf17e54f045 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 3 Aug 2026 18:17:18 +0200 Subject: [PATCH 1/3] initial commit --- .gitignore | 6 +++ .nx/nxw.js | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++ PROGRESS.md | 6 +++ nx | 5 +++ nx.bat | 10 +++++ nx.json | 7 +++ 6 files changed, 156 insertions(+) create mode 100644 .nx/nxw.js create mode 100644 PROGRESS.md create mode 100755 nx create mode 100644 nx.bat create mode 100644 nx.json diff --git a/.gitignore b/.gitignore index 1b6985c..b30e424 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,9 @@ # Ignore Gradle build output directory build + +.nx/installation +.nx/cache +.nx/workspace-data +.nx/self-healing +.nx/migrate-runs \ No newline at end of file diff --git a/.nx/nxw.js b/.nx/nxw.js new file mode 100644 index 0000000..91f2d17 --- /dev/null +++ b/.nx/nxw.js @@ -0,0 +1,122 @@ +"use strict"; +// This file should be committed to your repository! It wraps Nx and ensures +// that your local installation matches nx.json. +// See: https://nx.dev/recipes/installation/install-non-javascript for more info. + + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); +const installationPath = path.join(__dirname, 'installation', 'package.json'); +function matchesCurrentNxInstall(currentInstallation, nxJsonInstallation) { + if (!currentInstallation.devDependencies || + !Object.keys(currentInstallation.devDependencies).length) { + return false; + } + try { + if (currentInstallation.devDependencies['nx'] !== + nxJsonInstallation.version || + require(path.join(path.dirname(installationPath), 'node_modules', 'nx', 'package.json')).version !== nxJsonInstallation.version) { + return false; + } + for (const [plugin, desiredVersion] of Object.entries(nxJsonInstallation.plugins || {})) { + if (currentInstallation.devDependencies[plugin] !== desiredVersion) { + return false; + } + } + return true; + } + catch { + return false; + } +} +function ensureDir(p) { + if (!fs.existsSync(p)) { + fs.mkdirSync(p, { recursive: true }); + } +} +function getCurrentInstallation() { + try { + return require(installationPath); + } + catch { + return { + name: 'nx-installation', + version: '0.0.0', + devDependencies: {}, + }; + } +} +function performInstallation(currentInstallation, nxJson) { + fs.writeFileSync(installationPath, JSON.stringify({ + name: 'nx-installation', + devDependencies: { + nx: nxJson.installation.version, + ...nxJson.installation.plugins, + }, + })); + try { + // --include=dev forces install even if consumer env sets NODE_ENV=production / omit=dev. + cp.execSync('npm i --include=dev', { + cwd: path.dirname(installationPath), + stdio: 'inherit', + windowsHide: true, + }); + } + catch (e) { + // revert possible changes to the current installation + fs.writeFileSync(installationPath, JSON.stringify(currentInstallation)); + // rethrow + throw e; + } +} +function ensureUpToDateInstallation() { + const nxJsonPath = path.join(__dirname, '..', 'nx.json'); + let nxJson; + try { + nxJson = require(nxJsonPath); + if (!nxJson.installation) { + console.error('[NX]: The "installation" entry in the "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript'); + process.exit(1); + } + } + catch (e) { + if (e instanceof Error && + e.code === 'MODULE_NOT_FOUND') { + console.error('[NX]: The "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript'); + } + else { + console.error(`[NX]: Failed to parse "nx.json": ${e instanceof Error ? e.message : e}. See https://nx.dev/recipes/installation/install-non-javascript`); + } + process.exit(1); + } + try { + ensureDir(path.join(__dirname, 'installation')); + const currentInstallation = getCurrentInstallation(); + if (!matchesCurrentNxInstall(currentInstallation, nxJson.installation)) { + performInstallation(currentInstallation, nxJson); + } + } + catch (e) { + const messageLines = [ + '[NX]: Nx wrapper failed to synchronize installation.', + ]; + if (e instanceof Error) { + messageLines.push(''); + messageLines.push(e.message); + messageLines.push(e.stack); + } + else { + messageLines.push(e.toString()); + } + console.error(messageLines.join('\n')); + process.exit(1); + } +} +if (!process.env.NX_WRAPPER_SKIP_INSTALL) { + ensureUpToDateInstallation(); +} +require('./installation/node_modules/nx/dist/bin/nx'); diff --git a/PROGRESS.md b/PROGRESS.md new file mode 100644 index 0000000..cd75d98 --- /dev/null +++ b/PROGRESS.md @@ -0,0 +1,6 @@ +# Progress Log + +## 2026-08-01 14:15 — Fixed Gradle Java Compatibility +- **Did:** Diagnosed and resolved `./gradlew projects` failure caused by Java 26 incompatibility with Gradle 8.5. Installed OpenJDK 21 via Homebrew and ran the command successfully, revealing project structure (application, library subprojects). +- **Changed:** None committed (temporary Gradle wrapper version testing was reverted). +- **Next:** Continue with Nx Gradle tutorial using `JAVA_HOME=/home/linuxbrew/.linuxbrew/opt/openjdk@21` or link openjdk@21 permanently. diff --git a/nx b/nx new file mode 100755 index 0000000..9204614 --- /dev/null +++ b/nx @@ -0,0 +1,5 @@ +#!/bin/bash +command -v node >/dev/null 2>&1 || { echo >&2 "Nx requires NodeJS to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ ."; exit 1; } +command -v npm >/dev/null 2>&1 || { echo >&2 "Nx requires npm to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ ."; exit 1; } +path_to_root=$(dirname $BASH_SOURCE) +node $path_to_root/.nx/nxw.js "$@" \ No newline at end of file diff --git a/nx.bat b/nx.bat new file mode 100644 index 0000000..d6b09b7 --- /dev/null +++ b/nx.bat @@ -0,0 +1,10 @@ +@ECHO OFF +SETLOCAL +SET path_to_root=%~dp0 +WHERE node >nul 2>nul +IF %ERRORLEVEL% NEQ 0 (ECHO Nx requires NodeJS to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ . & GOTO exit) +WHERE npm >nul 2>nul +IF %ERRORLEVEL% NEQ 0 (ECHO Nx requires npm to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ . & GOTO exit) +node %path_to_root%\.nx\nxw.js %* +:exit + cmd /c exit /b %ERRORLEVEL% \ No newline at end of file diff --git a/nx.json b/nx.json new file mode 100644 index 0000000..08532eb --- /dev/null +++ b/nx.json @@ -0,0 +1,7 @@ +{ + "installation": { + "version": "23.1.1" + }, + "$schema": "./node_modules/nx/schemas/nx-schema.json", + "analytics": false +} \ No newline at end of file From bcedb99145489050a286b2c34589f612241e661d Mon Sep 17 00:00:00 2001 From: elitd123 Date: Mon, 3 Aug 2026 18:19:15 +0200 Subject: [PATCH 2/3] feat(nx-cloud): setup nx cloud workspace This commit sets up Nx Cloud for your Nx workspace, enabling distributed caching and the Nx Cloud GitHub integration for fast CI and improved developer experience. You can access your Nx Cloud workspace by going to https://cloud.nx.app/orgs/6a70be5f3921f75c107dd586/workspaces/6a70bf81e98bb324ec3577d7 > [!TIP] > Run `npx nx generate ci-workflow` if you don't have a CI script configured yet. **Note:** This commit attempts to maintain formatting of the nx.json file, however you may need to correct formatting by running an nx format command and committing the changes. --- nx.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 08532eb..c7d2284 100644 --- a/nx.json +++ b/nx.json @@ -3,5 +3,6 @@ "version": "23.1.1" }, "$schema": "./node_modules/nx/schemas/nx-schema.json", - "analytics": false + "analytics": false, + "nxCloudId": "6a70bf81e98bb324ec3577d7" } \ No newline at end of file From 3e19dc4790b21c1be787951bb4fbe22af226d54b Mon Sep 17 00:00:00 2001 From: "nx-cloud[bot]" <71083854+nx-cloud[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:19:20 +0000 Subject: [PATCH 3/3] chore: add CI workflow with Nx Cloud self-healing CI --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..526bd43 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +permissions: + actions: read + contents: read + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + filter: tree:0 + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm ci + - uses: nrwl/nx-set-shas@v4 + + - run: npx nx affected -t lint test build + - run: npx nx fix-ci + if: always() \ No newline at end of file