diff --git a/.gitignore b/.gitignore index 9bce6ceaf..d191ee446 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,13 @@ apps/api/deploy/ # Ignore vscode mcp chrome user data .vscode/.mcp-chrome-user-data* +# Python +.venv/ +__pycache__/ +*.pyc +*.pyo +*.egg-info/ + # Agent runtime artifacts (per-session working state) .agents-work/ diff --git a/knip.json b/knip.json index 2c3214d69..1ec067fb9 100644 --- a/knip.json +++ b/knip.json @@ -115,5 +115,5 @@ "ts-scope-trimmer-plugin", "chrome-devtools-mcp" ], - "ignoreBinaries": ["func"] + "ignoreBinaries": ["func", "python"] } diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..2ffed48e5 --- /dev/null +++ b/mise.toml @@ -0,0 +1,15 @@ +#:schema https://mise.jdx.dev/schema/mise.json + +[tools] +node = "22.22.2" +python = "3.13" + +[settings] +# Automatically install tools when entering the project directory +auto_install = true + +[env] +# Ensure pnpm is available (installed via corepack) +_.path = ["./node_modules/.bin"] +# Python virtual environment +_.python.venv = { path = ".venv", create = true } diff --git a/package.json b/package.json index 867f398a5..a0e7416e9 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "packageManager": "pnpm@10.30.1", "scripts": { "antd": "antd", + "install:all": "pnpm i && pnpm run install:python", + "install:python": "python -m pip install -r requirements.txt", "audit": "(pnpm audit --audit-level=high --prod) && (pnpm audit --audit-level=critical --dev)", "build": "turbo run build", "test": "turbo run test", diff --git a/packages/cellix/server-oauth2-mock-seedwork/src/login-handlers.ts b/packages/cellix/server-oauth2-mock-seedwork/src/login-handlers.ts index 450ab4889..288dc0313 100644 --- a/packages/cellix/server-oauth2-mock-seedwork/src/login-handlers.ts +++ b/packages/cellix/server-oauth2-mock-seedwork/src/login-handlers.ts @@ -230,11 +230,7 @@ export function createLoginHandlers(deps: LoginHandlerDeps): { return; } const safeState = rawState; - const safeNonce = existingSession - ? existingSession.nonce - : typeof queryNonce === 'string' - ? queryNonce - : undefined; + const safeNonce = existingSession ? existingSession.nonce : typeof queryNonce === 'string' ? queryNonce : undefined; const nonce = crypto.randomUUID(); loginSessionStore.set(nonce, { redirectUri: normalizedRedirect, diff --git a/readme.md b/readme.md index 4e7120b14..5e2700ca8 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,60 @@ Our Docusaurus website will help you get started in running and contributing to [![Build Status](https://dev.azure.com/simnova/ShareThrift/_apis/build/status%2FCellixJs?branchName=main)](https://dev.azure.com/simnova/ShareThrift/_build/latest?definitionId=12&branchName=main) +## Prerequisites + +### Install mise (version manager for Node.js + Python) + +```bash +# macOS with Homebrew +brew install mise +``` + +### Activate mise in your shell + +```bash +# Add this to ~/.zshrc or ~/.bashrc (one-time setup) +eval "$(mise activate zsh)" # or bash/fish +# Then reload: source ~/.zshrc +``` + +> **Troubleshooting:** You may need to run `mise trust` if mise says it does not have permission. Create a new terminal after editing your shell config so it reloads. + +### Install tools + +```bash +mise install # Installs Node.js + Python per mise.toml +``` + +This automatically: +- Installs **Node.js v22.22.2** (from `mise.toml`) +- Installs **Python 3.13** (from `mise.toml`) +- Creates `.venv/` Python virtual environment when mise activates the project + +### Install dependencies + +Run the combined installer from the repository root: + +```bash +pnpm run install:all +``` + +This runs: +- `pnpm i` for Node.js workspace dependencies +- `python -m pip install -r requirements.txt` for Python tools such as Sourcery + +To install only the Python requirements later, run: + +```bash +pnpm run install:python +``` + +### Build + +```bash +pnpm run build +``` + ## Developer usage - Full local dev (builds, starts the portless HTTPS proxy, starts Azurite, and runs the app-level dev servers): diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..8f3e9c615 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +sourcery~=1.43.0