mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:27:32 +00:00
simplify
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
"dev:turbo": "next dev --turbopack",
|
"dev:turbo": "next dev --turbopack",
|
||||||
"test:unit": "pnpm vitest --run",
|
"test:unit": "pnpm vitest --run",
|
||||||
"test:unit:standalone": "pnpm test:unit",
|
"test:unit:standalone": "pnpm test:unit",
|
||||||
"test:unit:watch": "pnpm test:unit --watch",
|
|
||||||
"lint": "pnpm exec next lint && pnpm exec prettier --check .",
|
"lint": "pnpm exec next lint && pnpm exec prettier --check .",
|
||||||
"lint:fix": "pnpm exec prettier --write .",
|
"lint:fix": "pnpm exec prettier --write .",
|
||||||
"lint-staged": "lint-staged",
|
"lint-staged": "lint-staged",
|
||||||
@@ -15,8 +14,7 @@
|
|||||||
"build:login:standalone": "NEXT_PUBLIC_BASE_PATH=/ui/v2/login NEXT_OUTPUT_MODE=standalone pnpm build",
|
"build:login:standalone": "NEXT_PUBLIC_BASE_PATH=/ui/v2/login NEXT_OUTPUT_MODE=standalone pnpm build",
|
||||||
"start": "pnpm build && pnpm exec next start",
|
"start": "pnpm build && pnpm exec next start",
|
||||||
"start:built": "pnpm exec next start",
|
"start:built": "pnpm exec next start",
|
||||||
"clean": "pnpm mock:stop && rm -rf .turbo && rm -rf node_modules && rm -rf .next",
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||||
"standalone:prepare": "node scripts/prepare-standalone.js"
|
|
||||||
},
|
},
|
||||||
"git": {
|
"git": {
|
||||||
"pre-commit": "lint-staged"
|
"pre-commit": "lint-staged"
|
||||||
@@ -29,8 +27,8 @@
|
|||||||
"@heroicons/react": "2.1.3",
|
"@heroicons/react": "2.1.3",
|
||||||
"@tailwindcss/forms": "0.5.7",
|
"@tailwindcss/forms": "0.5.7",
|
||||||
"@vercel/analytics": "^1.2.2",
|
"@vercel/analytics": "^1.2.2",
|
||||||
"@zitadel/client": "workspace:*",
|
"@zitadel/client": "latest",
|
||||||
"@zitadel/proto": "workspace:*",
|
"@zitadel/proto": "latest",
|
||||||
"clsx": "1.2.1",
|
"clsx": "1.2.1",
|
||||||
"copy-to-clipboard": "^3.3.3",
|
"copy-to-clipboard": "^3.3.3",
|
||||||
"deepmerge": "^4.3.1",
|
"deepmerge": "^4.3.1",
|
||||||
|
@@ -1,99 +0,0 @@
|
|||||||
# Standalone Build Scripts
|
|
||||||
|
|
||||||
This directory contains the simplified scripts needed for managing the ZITADEL Login UI standalone conversion.
|
|
||||||
|
|
||||||
## 📁 File Overview
|
|
||||||
|
|
||||||
### Required Files
|
|
||||||
|
|
||||||
- `package.json` - Main package file (monorepo mode with `workspace:*`)
|
|
||||||
- `package.standalone.json` - Pre-configured standalone version (uses `latest`)
|
|
||||||
- `scripts/prepare-standalone.js` - Conversion script
|
|
||||||
|
|
||||||
### Generated/Temporary Files
|
|
||||||
|
|
||||||
- `package.monorepo.backup.json` - Backup when switching to standalone mode
|
|
||||||
|
|
||||||
## 🛠️ Scripts Overview
|
|
||||||
|
|
||||||
### `prepare-standalone.js`
|
|
||||||
|
|
||||||
**The main script for converting monorepo to standalone mode.**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node scripts/prepare-standalone.js [--install]
|
|
||||||
```
|
|
||||||
|
|
||||||
- `--install` - Automatically install dependencies after preparation
|
|
||||||
|
|
||||||
**What it does:**
|
|
||||||
|
|
||||||
- Copies `package.standalone.json` → `package.json`
|
|
||||||
- Confirms all configurations are unified and ready for standalone use
|
|
||||||
- Optionally runs `pnpm install`
|
|
||||||
|
|
||||||
## 🚀 **Simplified Approach**
|
|
||||||
|
|
||||||
This setup now uses a **much simpler approach**:
|
|
||||||
|
|
||||||
1. **Unified Configuration**: All ESLint, Prettier, and Tailwind configs work for both monorepo and standalone modes
|
|
||||||
2. **Static Configuration**: `package.standalone.json` is pre-configured with `latest` versions
|
|
||||||
3. **No Duplicate Configs**: No separate `*.standalone.*` config files needed
|
|
||||||
4. **Faster Setup**: Conversion is instant with just file copying
|
|
||||||
|
|
||||||
## 📋 **Usage for Customers**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. Clone the repository
|
|
||||||
git clone <standalone-repo>
|
|
||||||
|
|
||||||
# 2. Prepare standalone mode
|
|
||||||
node scripts/prepare-standalone.js --install
|
|
||||||
|
|
||||||
# 3. Start developing
|
|
||||||
pnpm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## 🔧 **Usage for Maintainers**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Update to latest packages manually in package.standalone.json
|
|
||||||
npm view @zitadel/client version
|
|
||||||
npm view @zitadel/proto version
|
|
||||||
|
|
||||||
# Then update package.standalone.json with latest versions
|
|
||||||
```
|
|
||||||
|
|
||||||
## ✨ **Key Benefits**
|
|
||||||
|
|
||||||
- **Single Config Files**: ESLint, Prettier, and Tailwind configs work for both modes
|
|
||||||
- **No Duplication**: No need for separate `*.standalone.*` configuration files
|
|
||||||
- **Faster Conversion**: Only 2 files need to be copied (package.json and tsconfig.json)
|
|
||||||
- **Simpler Maintenance**: All configuration logic is in one place
|
|
||||||
|
|
||||||
# Switch back to monorepo mode
|
|
||||||
|
|
||||||
node scripts/config-manager.js switch monorepo
|
|
||||||
|
|
||||||
````
|
|
||||||
|
|
||||||
### `validate-standalone.js`
|
|
||||||
|
|
||||||
**Validates that standalone setup is working correctly.**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node scripts/validate-standalone.js
|
|
||||||
````
|
|
||||||
|
|
||||||
**Checks:**
|
|
||||||
|
|
||||||
- Required files exist
|
|
||||||
- Package.json has required scripts and dependencies
|
|
||||||
- Dependencies can be resolved
|
|
||||||
- TypeScript compilation works
|
|
||||||
|
|
||||||
## Workflow Examples
|
|
||||||
|
|
||||||
### For Developers (Monorepo)
|
|
||||||
|
|
||||||
1. **Working in monorepo:**
|
|
@@ -1,93 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare script for standalone version
|
|
||||||
* This script converts the monorepo version to a standalone version
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { execSync } from "child_process";
|
|
||||||
import fs from "fs/promises";
|
|
||||||
|
|
||||||
const FILES_TO_REMOVE = [
|
|
||||||
// Turbo is not needed for standalone builds since there are no workspace dependencies
|
|
||||||
{ file: "turbo.json", backup: "turbo.monorepo.backup.json" },
|
|
||||||
];
|
|
||||||
|
|
||||||
async function prepareStandalone() {
|
|
||||||
console.log("🔧 Preparing standalone version...\n");
|
|
||||||
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
const shouldInstall = args.includes("--install");
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Step 1: Copy package.standalone.json to package.json
|
|
||||||
console.log("📦 Setting up package.json...");
|
|
||||||
const packageStandaloneExists = await fs
|
|
||||||
.access("package.standalone.json")
|
|
||||||
.then(() => true)
|
|
||||||
.catch(() => false);
|
|
||||||
|
|
||||||
if (packageStandaloneExists) {
|
|
||||||
// Backup current package.json
|
|
||||||
await fs.copyFile("package.json", "package.monorepo.backup.json");
|
|
||||||
console.log(
|
|
||||||
" 💾 Backed up package.json → package.monorepo.backup.json",
|
|
||||||
);
|
|
||||||
|
|
||||||
// Copy standalone version
|
|
||||||
await fs.copyFile("package.standalone.json", "package.json");
|
|
||||||
console.log(" ✅ package.standalone.json → package.json");
|
|
||||||
} else {
|
|
||||||
throw new Error("package.standalone.json not found!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Step 2: Remove unnecessary files for standalone
|
|
||||||
console.log("🗑️ Removing monorepo-specific files...");
|
|
||||||
for (const item of FILES_TO_REMOVE) {
|
|
||||||
const fileExists = await fs
|
|
||||||
.access(item.file)
|
|
||||||
.then(() => true)
|
|
||||||
.catch(() => false);
|
|
||||||
|
|
||||||
if (fileExists) {
|
|
||||||
// Backup current file
|
|
||||||
await fs.copyFile(item.file, item.backup);
|
|
||||||
console.log(` 💾 Backed up ${item.file} → ${item.backup}`);
|
|
||||||
|
|
||||||
// Remove the file
|
|
||||||
await fs.unlink(item.file);
|
|
||||||
console.log(` 🗑️ Removed ${item.file} (not needed in standalone)`);
|
|
||||||
} else {
|
|
||||||
console.log(` ℹ️ ${item.file} not found, skipping`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Step 3: Install dependencies if requested
|
|
||||||
if (shouldInstall) {
|
|
||||||
console.log("\n📥 Installing dependencies...");
|
|
||||||
try {
|
|
||||||
execSync("pnpm install", { stdio: "inherit" });
|
|
||||||
console.log(" ✅ Dependencies installed successfully");
|
|
||||||
} catch (error) {
|
|
||||||
console.warn(
|
|
||||||
" ⚠️ pnpm install failed, you may need to run it manually",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("\n🎉 Standalone preparation complete!");
|
|
||||||
console.log(" ✨ Turbo removed - using standard npm scripts");
|
|
||||||
console.log("\n📋 Next steps:");
|
|
||||||
if (!shouldInstall) {
|
|
||||||
console.log(" 1. Run: pnpm install");
|
|
||||||
}
|
|
||||||
console.log(" 2. Run: pnpm run dev");
|
|
||||||
console.log(" 3. Start developing!\n");
|
|
||||||
} catch (error) {
|
|
||||||
console.error("\n❌ Failed to prepare standalone version:", error.message);
|
|
||||||
console.error("Please check the error above and try again.\n");
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
prepareStandalone();
|
|
@@ -18,7 +18,6 @@
|
|||||||
"test:integration:setup": "NODE_ENV=test pnpm exec turbo run test:integration:setup",
|
"test:integration:setup": "NODE_ENV=test pnpm exec turbo run test:integration:setup",
|
||||||
"test:acceptance": "cd apps/login-test-acceptance && pnpm test:acceptance",
|
"test:acceptance": "cd apps/login-test-acceptance && pnpm test:acceptance",
|
||||||
"test:acceptance:setup": "cd apps/login-test-acceptance && pnpm test:acceptance:setup",
|
"test:acceptance:setup": "cd apps/login-test-acceptance && pnpm test:acceptance:setup",
|
||||||
"test:watch": "pnpm exec turbo run test:watch",
|
|
||||||
"dev": "pnpm exec turbo run dev --no-cache --continue",
|
"dev": "pnpm exec turbo run dev --no-cache --continue",
|
||||||
"dev:local": "pnpm test:acceptance:setup",
|
"dev:local": "pnpm test:acceptance:setup",
|
||||||
"lint": "pnpm exec turbo run lint",
|
"lint": "pnpm exec turbo run lint",
|
||||||
|
@@ -46,11 +46,8 @@
|
|||||||
"build": "pnpm exec tsup",
|
"build": "pnpm exec tsup",
|
||||||
"build:client:standalone": "pnpm build",
|
"build:client:standalone": "pnpm build",
|
||||||
"test": "pnpm test:unit",
|
"test": "pnpm test:unit",
|
||||||
"test:watch": "pnpm test:unit:watch",
|
|
||||||
"test:unit": "pnpm exec vitest",
|
"test:unit": "pnpm exec vitest",
|
||||||
"test:unit:standalone": "pnpm test:unit",
|
"test:unit:standalone": "pnpm test:unit",
|
||||||
"test:unit:watch": "pnpm exec vitest --watch",
|
|
||||||
"dev": "pnpm exec tsup --watch --dts",
|
|
||||||
"lint": "eslint \"src/**/*.ts*\"",
|
"lint": "eslint \"src/**/*.ts*\"",
|
||||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
||||||
},
|
},
|
||||||
|
@@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://turbo.build/schema.json",
|
|
||||||
"extends": ["//"],
|
|
||||||
"tasks": {
|
|
||||||
"generate": {
|
|
||||||
"outputs": ["zitadel/**"],
|
|
||||||
"cache": false
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"outputs": ["dist/**"],
|
|
||||||
"dependsOn": ["@zitadel/proto#generate"]
|
|
||||||
},
|
|
||||||
"dev": {
|
|
||||||
"cache": false,
|
|
||||||
"persistent": true,
|
|
||||||
"dependsOn": ["@zitadel/proto#generate"]
|
|
||||||
},
|
|
||||||
"lint": {
|
|
||||||
"outputs": [],
|
|
||||||
"cache": true
|
|
||||||
},
|
|
||||||
"test:unit": {
|
|
||||||
"outputs": [],
|
|
||||||
"cache": true,
|
|
||||||
"dependsOn": ["@zitadel/client#build"]
|
|
||||||
},
|
|
||||||
"build:client:standalone": {
|
|
||||||
"outputs": ["dist/**"],
|
|
||||||
"dependsOn": ["@zitadel/proto#generate"]
|
|
||||||
},
|
|
||||||
"client:build": {
|
|
||||||
"outputs": ["dist/**"],
|
|
||||||
"dependsOn": ["@zitadel/proto#generate"]
|
|
||||||
},
|
|
||||||
"proto:generate": {
|
|
||||||
"outputs": ["zitadel/**"],
|
|
||||||
"cache": false
|
|
||||||
},
|
|
||||||
"test:integration:setup": {
|
|
||||||
"with": ["dev"]
|
|
||||||
},
|
|
||||||
"test:acceptance:setup:dev": {
|
|
||||||
"with": ["dev"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -19,7 +19,6 @@
|
|||||||
"test:integration:setup": "NODE_ENV=test pnpm exec turbo run test:integration:setup",
|
"test:integration:setup": "NODE_ENV=test pnpm exec turbo run test:integration:setup",
|
||||||
"test:acceptance": "cd login/apps/login-test-acceptance && pnpm test:acceptance",
|
"test:acceptance": "cd login/apps/login-test-acceptance && pnpm test:acceptance",
|
||||||
"test:acceptance:setup": "cd login/apps/login-test-acceptance && pnpm test:acceptance:setup",
|
"test:acceptance:setup": "cd login/apps/login-test-acceptance && pnpm test:acceptance:setup",
|
||||||
"test:watch": "pnpm exec turbo run test:watch",
|
|
||||||
"dev": "pnpm exec turbo run dev --no-cache --continue",
|
"dev": "pnpm exec turbo run dev --no-cache --continue",
|
||||||
"dev:local": "pnpm test:acceptance:setup",
|
"dev:local": "pnpm test:acceptance:setup",
|
||||||
"dev:console": "pnpm exec turbo run start --filter=console",
|
"dev:console": "pnpm exec turbo run start --filter=console",
|
||||||
|
27
pnpm-lock.yaml
generated
27
pnpm-lock.yaml
generated
@@ -468,11 +468,11 @@ importers:
|
|||||||
specifier: ^1.2.2
|
specifier: ^1.2.2
|
||||||
version: 1.5.0(next@15.4.0-canary.86(@babel/core@7.28.0)(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.89.2))(react@19.1.0)
|
version: 1.5.0(next@15.4.0-canary.86(@babel/core@7.28.0)(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.89.2))(react@19.1.0)
|
||||||
'@zitadel/client':
|
'@zitadel/client':
|
||||||
specifier: workspace:*
|
specifier: latest
|
||||||
version: link:../../packages/zitadel-client
|
version: 1.2.1-sha-220f335
|
||||||
'@zitadel/proto':
|
'@zitadel/proto':
|
||||||
specifier: workspace:*
|
specifier: latest
|
||||||
version: link:../../packages/zitadel-proto
|
version: 1.2.1-sha-220f335
|
||||||
clsx:
|
clsx:
|
||||||
specifier: 1.2.1
|
specifier: 1.2.1
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
@@ -5869,6 +5869,12 @@ packages:
|
|||||||
'@zag-js/utils@1.18.1':
|
'@zag-js/utils@1.18.1':
|
||||||
resolution: {integrity: sha512-KocaggqVZ/gAwON1a9szCLNTSrgg4MHNg3pJImBeex8RGMXo4vK0G4DTm7WS8ccxoIaeP+gqeTS+vuof22+SMg==}
|
resolution: {integrity: sha512-KocaggqVZ/gAwON1a9szCLNTSrgg4MHNg3pJImBeex8RGMXo4vK0G4DTm7WS8ccxoIaeP+gqeTS+vuof22+SMg==}
|
||||||
|
|
||||||
|
'@zitadel/client@1.2.1-sha-220f335':
|
||||||
|
resolution: {integrity: sha512-1rO+nh3IMVp+8oVmXJlYxeBUPnNPF4vNz/LPwdmZ6k41oxn6LbyDjdgK8cYnyN7paW2wUZJtXXn6gedoHyuuxw==}
|
||||||
|
|
||||||
|
'@zitadel/proto@1.2.1-sha-220f335':
|
||||||
|
resolution: {integrity: sha512-IdVEIqOi+R8J+e815ut2XmjUU5yIca8J/OMAq8IdzW8f8TFnCv70uGqhdpa5vEMqEHrv3wihNUG4EhylZtogmA==}
|
||||||
|
|
||||||
'@zkochan/js-yaml@0.0.6':
|
'@zkochan/js-yaml@0.0.6':
|
||||||
resolution: {integrity: sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==}
|
resolution: {integrity: sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -21913,6 +21919,19 @@ snapshots:
|
|||||||
|
|
||||||
'@zag-js/utils@1.18.1': {}
|
'@zag-js/utils@1.18.1': {}
|
||||||
|
|
||||||
|
'@zitadel/client@1.2.1-sha-220f335':
|
||||||
|
dependencies:
|
||||||
|
'@bufbuild/protobuf': 2.6.0
|
||||||
|
'@connectrpc/connect': 2.0.2(@bufbuild/protobuf@2.6.0)
|
||||||
|
'@connectrpc/connect-node': 2.0.2(@bufbuild/protobuf@2.6.0)(@connectrpc/connect@2.0.2(@bufbuild/protobuf@2.6.0))
|
||||||
|
'@connectrpc/connect-web': 2.0.2(@bufbuild/protobuf@2.6.0)(@connectrpc/connect@2.0.2(@bufbuild/protobuf@2.6.0))
|
||||||
|
'@zitadel/proto': link:login/packages/zitadel-proto
|
||||||
|
jose: 5.10.0
|
||||||
|
|
||||||
|
'@zitadel/proto@1.2.1-sha-220f335':
|
||||||
|
dependencies:
|
||||||
|
'@bufbuild/protobuf': 2.6.0
|
||||||
|
|
||||||
'@zkochan/js-yaml@0.0.6':
|
'@zkochan/js-yaml@0.0.6':
|
||||||
dependencies:
|
dependencies:
|
||||||
argparse: 2.0.1
|
argparse: 2.0.1
|
||||||
|
@@ -5,3 +5,6 @@ packages:
|
|||||||
- "login"
|
- "login"
|
||||||
- "login/apps/*"
|
- "login/apps/*"
|
||||||
- "login/packages/*"
|
- "login/packages/*"
|
||||||
|
overrides:
|
||||||
|
"@zitadel/client": "workspace:*"
|
||||||
|
"@zitadel/proto": "workspace:*"
|
Reference in New Issue
Block a user