chore: cli to create self signed ca to dev with domain (#12466)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a CLI command to manage local Certificate Authority (CA) and generate SSL certificates for development domains.
  - Added example and template files for Nginx and OpenSSL configurations to support local development with SSL.
  - Provided new DNS and Nginx configuration files for enhanced local development setup.

- **Documentation**
  - Added a README with step-by-step instructions for setting up development containers and managing certificates on MacOS with OrbStack.

- **Chores**
  - Updated ignore patterns to exclude additional development files and directories.
  - Enhanced example Docker Compose files with commented service configurations and new volume definitions.
  - Removed the Elasticsearch example Docker Compose file.

- **Refactor**
  - Extended utility and command classes with new methods to support file operations and command execution.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-05-23 05:19:13 +00:00
parent aea45f451d
commit 8519f4474a
13 changed files with 325 additions and 70 deletions
+9 -2
View File
@@ -1,5 +1,6 @@
import { AliasToPackage } from '@affine-tools/utils/distribution';
import { Logger } from '@affine-tools/utils/logger';
import { exec, execAsync, spawn } from '@affine-tools/utils/process';
import { type PackageName, Workspace } from '@affine-tools/utils/workspace';
import { Command as BaseCommand, Option } from 'clipanion';
import inquirer from 'inquirer';
@@ -8,9 +9,11 @@ import * as t from 'typanion';
import type { CliContext } from './context';
export abstract class Command extends BaseCommand<CliContext> {
// @ts-expect-error hack: Get the command name
cmd = this.constructor.paths[0][0];
get logger() {
// @ts-expect-error hack: Get the command name
return new Logger(this.constructor.paths[0][0]);
return new Logger(this.cmd);
}
get workspace() {
@@ -20,6 +23,10 @@ export abstract class Command extends BaseCommand<CliContext> {
set workspace(workspace: Workspace) {
this.context.workspace = workspace;
}
exec = exec.bind(null, this.cmd);
execAsync = execAsync.bind(null, this.cmd);
spawn = spawn.bind(null, this.cmd);
}
export abstract class PackageCommand extends Command {