@stackweld/core 0.3.0 → 0.4.0

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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/__tests__/compatibility-scorer.test.d.ts +1 -1
  3. package/dist/__tests__/rules-engine.test.d.ts +1 -1
  4. package/dist/__tests__/scaffold-orchestrator.test.d.ts +1 -1
  5. package/dist/__tests__/stack-engine.test.d.ts +1 -1
  6. package/dist/db/database.d.ts +1 -1
  7. package/dist/engine/compatibility-scorer.d.ts +16 -19
  8. package/dist/engine/compose-generator.d.ts +21 -31
  9. package/dist/engine/compose-generator.js +1 -15
  10. package/dist/engine/cost-estimator.d.ts +13 -13
  11. package/dist/engine/env-analyzer.d.ts +14 -14
  12. package/dist/engine/health-checker.d.ts +12 -12
  13. package/dist/engine/health-checker.js +14 -6
  14. package/dist/engine/infra-generator.d.ts +14 -17
  15. package/dist/engine/license-manager.d.ts +29 -0
  16. package/dist/engine/license-manager.js +130 -0
  17. package/dist/engine/migration-planner.d.ts +18 -22
  18. package/dist/engine/performance-profiler.d.ts +13 -13
  19. package/dist/engine/preferences.d.ts +7 -7
  20. package/dist/engine/runtime-manager.d.ts +46 -56
  21. package/dist/engine/runtime-manager.js +24 -10
  22. package/dist/engine/scaffold-orchestrator.js +42 -6
  23. package/dist/engine/stack-detector.d.ts +10 -10
  24. package/dist/engine/stack-differ.d.ts +15 -15
  25. package/dist/engine/stack-differ.js +76 -72
  26. package/dist/engine/stack-engine.d.ts +0 -20
  27. package/dist/engine/stack-engine.js +0 -24
  28. package/dist/engine/stack-serializer.d.ts +8 -8
  29. package/dist/engine/tech-installer.d.ts +12 -12
  30. package/dist/engine/tech-installer.js +3 -2
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.js +1 -0
  33. package/dist/types/project.d.ts +19 -19
  34. package/dist/types/project.js +1 -1
  35. package/dist/types/stack.d.ts +18 -18
  36. package/dist/types/stack.js +1 -1
  37. package/dist/types/technology.d.ts +28 -37
  38. package/dist/types/technology.js +1 -1
  39. package/dist/types/template.d.ts +22 -22
  40. package/dist/types/template.js +1 -1
  41. package/dist/types/validation.d.ts +12 -12
  42. package/dist/types/validation.js +1 -1
  43. package/package.json +1 -1
  44. package/LICENSE +0 -21
@@ -14,19 +14,19 @@
14
14
  */
15
15
  import type { Technology } from "../types/index.js";
16
16
  export interface InstallContext {
17
- projectDir: string;
18
- frontendDir: string | null;
19
- backendDir: string | null;
20
- projectName: string;
21
- isFullStack: boolean;
22
- allTechs: Technology[];
23
- runtime: "node" | "python" | "go" | "rust" | "bun" | "deno" | "php" | null;
17
+ projectDir: string;
18
+ frontendDir: string | null;
19
+ backendDir: string | null;
20
+ projectName: string;
21
+ isFullStack: boolean;
22
+ allTechs: Technology[];
23
+ runtime: "node" | "python" | "go" | "rust" | "bun" | "deno" | "php" | null;
24
24
  }
25
25
  export interface InstallResult {
26
- techId: string;
27
- success: boolean;
28
- message: string;
29
- filesCreated: string[];
26
+ techId: string;
27
+ success: boolean;
28
+ message: string;
29
+ filesCreated: string[];
30
30
  }
31
31
  /**
32
32
  * Install all selected technologies that have installers.
@@ -34,4 +34,4 @@ export interface InstallResult {
34
34
  * databases (handled by docker-compose), and services (handled by docker-compose).
35
35
  */
36
36
  export declare function installTechnologies(ctx: InstallContext): InstallResult[];
37
- //# sourceMappingURL=tech-installer.d.ts.map
37
+ //# sourceMappingURL=tech-installer.d.ts.map
@@ -12,13 +12,14 @@
12
12
  *
13
13
  * Frontend and Backend scaffolding is handled by the generate command directly.
14
14
  */
15
- import { execSync } from "node:child_process";
15
+ import { execFileSync } from "node:child_process";
16
16
  import * as fs from "node:fs";
17
17
  import * as path from "node:path";
18
18
  // ─── Helpers ────────────────────────────────────────
19
19
  function run(cmd, cwd, timeout = 60_000) {
20
20
  try {
21
- execSync(cmd, { cwd, stdio: "pipe", timeout });
21
+ const parts = cmd.split(/\s+/).filter(Boolean);
22
+ execFileSync(parts[0], parts.slice(1), { cwd, stdio: "pipe", timeout });
22
23
  return true;
23
24
  }
24
25
  catch {
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export type { HealthCheck, HealthReport } from "./engine/health-checker.js";
11
11
  export { checkProjectHealth } from "./engine/health-checker.js";
12
12
  export type { DeployTarget, InfraOutput } from "./engine/infra-generator.js";
13
13
  export { generateInfra } from "./engine/infra-generator.js";
14
+ export type { FeatureGate, LicenseInfo, LicenseTier } from "./engine/license-manager.js";
15
+ export { activateLicense, checkFeatureAccess, deactivateLicense, getLicenseInfo, listFeatures, } from "./engine/license-manager.js";
14
16
  export type { MigrationPlan, MigrationStep } from "./engine/migration-planner.js";
15
17
  export { planMigration } from "./engine/migration-planner.js";
16
18
  export type { PerformanceProfile, TechPerformance, } from "./engine/performance-profiler.js";
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export { estimateCost } from "./engine/cost-estimator.js";
7
7
  export { checkDangerous, parseEnvFile, syncEnv } from "./engine/env-analyzer.js";
8
8
  export { checkProjectHealth } from "./engine/health-checker.js";
9
9
  export { generateInfra } from "./engine/infra-generator.js";
10
+ export { activateLicense, checkFeatureAccess, deactivateLicense, getLicenseInfo, listFeatures, } from "./engine/license-manager.js";
10
11
  export { planMigration } from "./engine/migration-planner.js";
11
12
  export { profilePerformance } from "./engine/performance-profiler.js";
12
13
  export { getPluginDir, getPluginInfo, installPlugin, listPlugins, loadPlugin, loadPluginTechnologies, removePlugin, } from "./engine/plugin-loader.js";
@@ -3,31 +3,31 @@
3
3
  * Created by the Scaffold Orchestrator.
4
4
  */
5
5
  export interface ProjectInstance {
6
- id: string;
7
- stackId: string;
8
- name: string;
9
- path: string;
10
- createdAt: string;
11
- lastOpenedAt?: string;
12
- templateId?: string;
6
+ id: string;
7
+ stackId: string;
8
+ name: string;
9
+ path: string;
10
+ createdAt: string;
11
+ lastOpenedAt?: string;
12
+ templateId?: string;
13
13
  }
14
14
  /**
15
15
  * Runtime State — Live state of a running project.
16
16
  * Containers, ports, health checks, processes.
17
17
  */
18
18
  export interface ServiceStatus {
19
- name: string;
20
- technologyId: string;
21
- containerId?: string;
22
- status: "running" | "healthy" | "unhealthy" | "exited" | "stopped" | "not_started";
23
- port?: number;
24
- healthCheck?: "passing" | "failing" | "none";
25
- uptime?: number;
19
+ name: string;
20
+ technologyId: string;
21
+ containerId?: string;
22
+ status: "running" | "healthy" | "unhealthy" | "exited" | "stopped" | "not_started";
23
+ port?: number;
24
+ healthCheck?: "passing" | "failing" | "none";
25
+ uptime?: number;
26
26
  }
27
27
  export interface RuntimeState {
28
- projectId: string;
29
- services: ServiceStatus[];
30
- composePath?: string;
31
- lastChecked: string;
28
+ projectId: string;
29
+ services: ServiceStatus[];
30
+ composePath?: string;
31
+ lastChecked: string;
32
32
  }
33
- //# sourceMappingURL=project.d.ts.map
33
+ //# sourceMappingURL=project.d.ts.map
@@ -3,4 +3,4 @@
3
3
  * Created by the Scaffold Orchestrator.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=project.js.map
6
+ //# sourceMappingURL=project.js.map
@@ -3,27 +3,27 @@
3
3
  * Not yet a project on disk.
4
4
  */
5
5
  export interface StackTechnology {
6
- technologyId: string;
7
- version: string;
8
- port?: number;
9
- config?: Record<string, unknown>;
6
+ technologyId: string;
7
+ version: string;
8
+ port?: number;
9
+ config?: Record<string, unknown>;
10
10
  }
11
11
  export type StackProfile = "rapid" | "standard" | "production" | "enterprise" | "lightweight";
12
12
  export interface StackDefinition {
13
- id: string;
14
- name: string;
15
- description: string;
16
- profile: StackProfile;
17
- technologies: StackTechnology[];
18
- createdAt: string;
19
- updatedAt: string;
20
- version: number;
21
- tags: string[];
13
+ id: string;
14
+ name: string;
15
+ description: string;
16
+ profile: StackProfile;
17
+ technologies: StackTechnology[];
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ version: number;
21
+ tags: string[];
22
22
  }
23
23
  export interface StackVersion {
24
- version: number;
25
- timestamp: string;
26
- changelog: string;
27
- snapshot: StackDefinition;
24
+ version: number;
25
+ timestamp: string;
26
+ changelog: string;
27
+ snapshot: StackDefinition;
28
28
  }
29
- //# sourceMappingURL=stack.d.ts.map
29
+ //# sourceMappingURL=stack.d.ts.map
@@ -3,4 +3,4 @@
3
3
  * Not yet a project on disk.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=stack.js.map
6
+ //# sourceMappingURL=stack.js.map
@@ -2,46 +2,37 @@
2
2
  * Technology — Atomic unit of the registry catalog.
3
3
  * Each technology is deeply modeled with versions, ports, rules, and metadata.
4
4
  */
5
- export type TechnologyCategory =
6
- | "runtime"
7
- | "frontend"
8
- | "backend"
9
- | "database"
10
- | "orm"
11
- | "auth"
12
- | "styling"
13
- | "service"
14
- | "devops";
5
+ export type TechnologyCategory = "runtime" | "frontend" | "backend" | "database" | "orm" | "auth" | "styling" | "service" | "devops";
15
6
  export interface TechnologyVersion {
16
- version: string;
17
- eol?: string;
18
- lts?: boolean;
7
+ version: string;
8
+ eol?: string;
9
+ lts?: boolean;
19
10
  }
20
11
  export interface HealthCheckConfig {
21
- command?: string;
22
- endpoint?: string;
23
- interval?: string;
24
- timeout?: string;
25
- retries?: number;
12
+ command?: string;
13
+ endpoint?: string;
14
+ interval?: string;
15
+ timeout?: string;
16
+ retries?: number;
26
17
  }
27
18
  export interface Technology {
28
- id: string;
29
- name: string;
30
- category: TechnologyCategory;
31
- description: string;
32
- website: string;
33
- versions: TechnologyVersion[];
34
- defaultVersion: string;
35
- defaultPort?: number;
36
- requires: string[];
37
- incompatibleWith: string[];
38
- suggestedWith: string[];
39
- officialScaffold?: string;
40
- dockerImage?: string;
41
- healthCheck?: HealthCheckConfig;
42
- envVars: Record<string, string>;
43
- configFiles: string[];
44
- lastVerified: string;
45
- tags: string[];
19
+ id: string;
20
+ name: string;
21
+ category: TechnologyCategory;
22
+ description: string;
23
+ website: string;
24
+ versions: TechnologyVersion[];
25
+ defaultVersion: string;
26
+ defaultPort?: number;
27
+ requires: string[];
28
+ incompatibleWith: string[];
29
+ suggestedWith: string[];
30
+ officialScaffold?: string;
31
+ dockerImage?: string;
32
+ healthCheck?: HealthCheckConfig;
33
+ envVars: Record<string, string>;
34
+ configFiles: string[];
35
+ lastVerified: string;
36
+ tags: string[];
46
37
  }
47
- //# sourceMappingURL=technology.d.ts.map
38
+ //# sourceMappingURL=technology.d.ts.map
@@ -3,4 +3,4 @@
3
3
  * Each technology is deeply modeled with versions, ports, rules, and metadata.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=technology.js.map
6
+ //# sourceMappingURL=technology.js.map
@@ -3,32 +3,32 @@
3
3
  * Templates delegate to official tools and only fill gaps.
4
4
  */
5
5
  export interface ScaffoldStep {
6
- name: string;
7
- command: string;
8
- workingDir?: string;
9
- condition?: string;
6
+ name: string;
7
+ command: string;
8
+ workingDir?: string;
9
+ condition?: string;
10
10
  }
11
11
  export interface TemplateOverride {
12
- path: string;
13
- content: string;
14
- condition?: string;
12
+ path: string;
13
+ content: string;
14
+ condition?: string;
15
15
  }
16
16
  export interface TemplateHook {
17
- timing: "pre-scaffold" | "post-scaffold" | "pre-up" | "post-up";
18
- name: string;
19
- command: string;
20
- description: string;
21
- requiresConfirmation: boolean;
17
+ timing: "pre-scaffold" | "post-scaffold" | "pre-up" | "post-up";
18
+ name: string;
19
+ command: string;
20
+ description: string;
21
+ requiresConfirmation: boolean;
22
22
  }
23
23
  export interface Template {
24
- id: string;
25
- name: string;
26
- description: string;
27
- technologyIds: string[];
28
- profile: string;
29
- scaffoldSteps: ScaffoldStep[];
30
- overrides: TemplateOverride[];
31
- hooks: TemplateHook[];
32
- variables: Record<string, string>;
24
+ id: string;
25
+ name: string;
26
+ description: string;
27
+ technologyIds: string[];
28
+ profile: string;
29
+ scaffoldSteps: ScaffoldStep[];
30
+ overrides: TemplateOverride[];
31
+ hooks: TemplateHook[];
32
+ variables: Record<string, string>;
33
33
  }
34
- //# sourceMappingURL=template.d.ts.map
34
+ //# sourceMappingURL=template.d.ts.map
@@ -3,4 +3,4 @@
3
3
  * Templates delegate to official tools and only fill gaps.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=template.js.map
6
+ //# sourceMappingURL=template.js.map
@@ -3,18 +3,18 @@
3
3
  */
4
4
  export type ValidationSeverity = "error" | "warning" | "info";
5
5
  export interface ValidationIssue {
6
- severity: ValidationSeverity;
7
- code: string;
8
- message: string;
9
- technologyId?: string;
10
- relatedTechnologyId?: string;
11
- autoFixable: boolean;
12
- suggestedFix?: string;
6
+ severity: ValidationSeverity;
7
+ code: string;
8
+ message: string;
9
+ technologyId?: string;
10
+ relatedTechnologyId?: string;
11
+ autoFixable: boolean;
12
+ suggestedFix?: string;
13
13
  }
14
14
  export interface ValidationResult {
15
- valid: boolean;
16
- issues: ValidationIssue[];
17
- resolvedDependencies: string[];
18
- portAssignments: Record<string, number>;
15
+ valid: boolean;
16
+ issues: ValidationIssue[];
17
+ resolvedDependencies: string[];
18
+ portAssignments: Record<string, number>;
19
19
  }
20
- //# sourceMappingURL=validation.d.ts.map
20
+ //# sourceMappingURL=validation.d.ts.map
@@ -2,4 +2,4 @@
2
2
  * Validation — Results from the rules engine.
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=validation.js.map
5
+ //# sourceMappingURL=validation.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackweld/core",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Core engine for Stackweld — rules, scaffold orchestrator, runtime manager, tech installer, and SQLite persistence.",
5
5
  "license": "MIT",
6
6
  "author": "Orlando Fernandez <hello@xplustechnologies.com>",
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025-2026 Orlando Fernandez / XPlus Technologies LLC
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.