@beeblock/svelar 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/cli/bin.js +533 -125
- package/dist/cli/commands/DeployTemplates.d.ts +14 -0
- package/dist/cli/commands/DevDownCommand.d.ts +14 -0
- package/dist/cli/commands/DevLogsCommand.d.ts +14 -0
- package/dist/cli/commands/DevRestartCommand.d.ts +14 -0
- package/dist/cli/commands/DevUpCommand.d.ts +14 -0
- package/dist/cli/commands/DockerComposeCommand.d.ts +11 -0
- package/dist/cli/commands/InfraSetupCommand.d.ts +32 -0
- package/dist/cli/commands/MakeCiCommand.d.ts +27 -0
- package/dist/cli/commands/MakeDeployCommand.d.ts +26 -0
- package/dist/cli/commands/MakeDockerCommand.d.ts +8 -2
- package/dist/cli/commands/MakeInfraCommand.d.ts +18 -0
- package/dist/cli/commands/ProdDeployCommand.d.ts +14 -0
- package/dist/cli/commands/ProdDownCommand.d.ts +14 -0
- package/dist/cli/commands/ProdLogsCommand.d.ts +14 -0
- package/dist/cli/commands/ProdRestartCommand.d.ts +14 -0
- package/dist/cli/commands/ProdUpCommand.d.ts +14 -0
- package/dist/cli/index.js +486 -86
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeployTemplates — Template strings for deployment scaffolding.
|
|
3
|
+
*
|
|
4
|
+
* Used by MakeDockerCommand, MakeCiCommand, and MakeInfraCommand.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DeployTemplates {
|
|
7
|
+
static dockerfile(): string;
|
|
8
|
+
static composeDevOverride(): string;
|
|
9
|
+
static composeProdOverride(image: string): string;
|
|
10
|
+
static healthEndpoint(): string;
|
|
11
|
+
static githubActionsWorkflow(image: string): string;
|
|
12
|
+
static setupDropletScript(appName: string): string;
|
|
13
|
+
static dropletEnvExample(appName: string): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dev:down — Stop development containers.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class DevDownCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dev:logs — Follow development container logs.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class DevLogsCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dev:restart — Restart development containers (down + up).
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class DevRestartCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dev:up — Start development containers with hot-reload.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class DevUpCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DockerComposeCommand — Abstract base for docker compose runtime commands.
|
|
3
|
+
*
|
|
4
|
+
* Provides shared compose file resolution and execution logic for
|
|
5
|
+
* dev:* and prod:* commands.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from '../Command.js';
|
|
8
|
+
export declare abstract class DockerComposeCommand extends Command {
|
|
9
|
+
arguments: never[];
|
|
10
|
+
protected composeExec(args: string[], dev: boolean, flags?: Record<string, any>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* infra:setup — Provision a droplet by running infra/setup-droplet.sh.
|
|
3
|
+
*
|
|
4
|
+
* Supports two modes:
|
|
5
|
+
* 1. Config file: reads from infra/droplet.env (default)
|
|
6
|
+
* 2. CLI flags: --ip, --key, --user, --deploy-user, --project
|
|
7
|
+
*
|
|
8
|
+
* The setup script SSHs into the droplet, creates a deploy user,
|
|
9
|
+
* installs Docker if needed, copies compose files, and configures UFW.
|
|
10
|
+
*
|
|
11
|
+
* .env is NOT copied — it's managed by CI/CD via the ENV_PROD secret.
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from '../Command.js';
|
|
14
|
+
export declare class InfraSetupCommand extends Command {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
arguments: never[];
|
|
18
|
+
flags: ({
|
|
19
|
+
name: string;
|
|
20
|
+
alias: string;
|
|
21
|
+
description: string;
|
|
22
|
+
type: "string";
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
type: "string";
|
|
27
|
+
alias?: undefined;
|
|
28
|
+
})[];
|
|
29
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
30
|
+
private resolveAppName;
|
|
31
|
+
private parseEnvFile;
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* make:ci — Generate GitHub Actions CI/CD workflow.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from '../Command.js';
|
|
5
|
+
export declare class MakeCiCommand extends Command {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
arguments: never[];
|
|
9
|
+
flags: ({
|
|
10
|
+
name: string;
|
|
11
|
+
alias: string;
|
|
12
|
+
description: string;
|
|
13
|
+
type: "string";
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
type: "string";
|
|
18
|
+
alias?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
alias: string;
|
|
22
|
+
description: string;
|
|
23
|
+
type: "boolean";
|
|
24
|
+
})[];
|
|
25
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
26
|
+
private resolveAppName;
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* make:deploy — Convenience command that runs make:docker + make:ci + make:infra.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from '../Command.js';
|
|
5
|
+
export declare class MakeDeployCommand extends Command {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
arguments: never[];
|
|
9
|
+
flags: ({
|
|
10
|
+
name: string;
|
|
11
|
+
alias: string;
|
|
12
|
+
description: string;
|
|
13
|
+
type: "string";
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
type: "string";
|
|
18
|
+
alias?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
alias: string;
|
|
22
|
+
description: string;
|
|
23
|
+
type: "boolean";
|
|
24
|
+
})[];
|
|
25
|
+
handle(args: string[], flags: Record<string, any>): Promise<void>;
|
|
26
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* make:docker — Generate Docker deployment files
|
|
3
3
|
*
|
|
4
|
-
* Creates Dockerfile, docker-compose.yml,
|
|
4
|
+
* Creates Dockerfile (multi-stage), docker-compose.yml, dev/prod overrides,
|
|
5
|
+
* .dockerignore, PM2 ecosystem config, and health endpoint.
|
|
5
6
|
*/
|
|
6
7
|
import { Command } from '../Command.js';
|
|
7
8
|
export declare class MakeDockerCommand extends Command {
|
|
@@ -13,6 +14,11 @@ export declare class MakeDockerCommand extends Command {
|
|
|
13
14
|
alias: string;
|
|
14
15
|
description: string;
|
|
15
16
|
type: "string";
|
|
17
|
+
} | {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
type: "string";
|
|
21
|
+
alias?: undefined;
|
|
16
22
|
} | {
|
|
17
23
|
name: string;
|
|
18
24
|
alias: string;
|
|
@@ -25,7 +31,7 @@ export declare class MakeDockerCommand extends Command {
|
|
|
25
31
|
alias?: undefined;
|
|
26
32
|
})[];
|
|
27
33
|
handle(args: string[], flags: Record<string, any>): Promise<void>;
|
|
28
|
-
private
|
|
34
|
+
private resolveAppName;
|
|
29
35
|
private composeTemplate;
|
|
30
36
|
private dockerignoreTemplate;
|
|
31
37
|
private pm2Template;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* make:infra — Generate DigitalOcean droplet setup script and env template.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from '../Command.js';
|
|
5
|
+
export declare class MakeInfraCommand extends Command {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
arguments: never[];
|
|
9
|
+
flags: {
|
|
10
|
+
name: string;
|
|
11
|
+
alias: string;
|
|
12
|
+
description: string;
|
|
13
|
+
type: "boolean";
|
|
14
|
+
}[];
|
|
15
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
16
|
+
private addToGitignore;
|
|
17
|
+
private resolveAppName;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prod:deploy — Pull latest images and redeploy production containers.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class ProdDeployCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prod:down — Stop production containers.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class ProdDownCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prod:logs — Follow production container logs.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class ProdLogsCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prod:restart — Restart production containers (down + up).
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class ProdRestartCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prod:up — Start production containers.
|
|
3
|
+
*/
|
|
4
|
+
import { DockerComposeCommand } from './DockerComposeCommand.js';
|
|
5
|
+
export declare class ProdUpCommand extends DockerComposeCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
flags: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
}[];
|
|
13
|
+
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
14
|
+
}
|