@worktif/runtime 0.3.0-edge.0 → 0.3.0-edge.10

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 (108) hide show
  1. package/README.md +26 -26
  2. package/out/dist/bin/index.js +41 -35
  3. package/out/dist/bin/purenow.js +23 -22
  4. package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/package.json +1 -1
  5. package/out/dist/bin/templates/runtime-web/cdk/package.json.template +1 -1
  6. package/out/dist/infra/index.js +164 -0
  7. package/out/dist/lambda/bundle.js +57 -0
  8. package/out/dist/lib/index.d.ts +0 -1
  9. package/out/dist/lib/index.js +4 -4
  10. package/out/dist/lib/lib/runtime-web/index.d.ts +3 -8
  11. package/out/dist/lib/lib/runtime-web/pureweb.d.ts +1 -1
  12. package/out/dist/src/bin/commands/index.d.ts +3 -0
  13. package/out/dist/src/bin/commands/runtime-web-deployment.service.d.ts +15 -0
  14. package/out/dist/src/bin/index.d.ts +3 -2
  15. package/out/dist/src/bin/{purenow-runtime-cli.d.ts → runtime-web-cli.d.ts} +13 -4
  16. package/out/dist/src/bin/services/index.d.ts +0 -1
  17. package/out/dist/src/bin/services/purenow-runtime-deployment.strategy.d.ts +2 -2
  18. package/out/dist/src/bin/services/purenow-runtime-stacks-deploy.service.d.ts +2 -3
  19. package/out/dist/src/bin/services/purenow-runtime-stacks-deploy.service.types.d.ts +1 -1
  20. package/out/dist/src/bin/services/runtime-web-cli-extensions.d.ts +0 -1
  21. package/out/dist/src/core/bundle/index.d.ts +5 -0
  22. package/out/dist/src/core/bundle/index.d.ts.map +1 -0
  23. package/out/dist/src/core/bundle/runtime.container.d.ts +35 -0
  24. package/out/dist/src/core/bundle/runtime.container.d.ts.map +1 -0
  25. package/out/dist/src/core/bundle/runtime.container.types.d.ts +15 -0
  26. package/out/dist/src/core/bundle/runtime.container.types.d.ts.map +1 -0
  27. package/out/dist/src/core/index.d.ts +5 -0
  28. package/out/dist/src/core/index.d.ts.map +1 -0
  29. package/out/dist/src/core/runtime-web/detector/index.d.ts +7 -0
  30. package/out/dist/src/core/runtime-web/detector/index.d.ts.map +1 -0
  31. package/out/dist/src/core/runtime-web/detector/metadata-collectors.d.ts +52 -0
  32. package/out/dist/src/core/runtime-web/detector/metadata-collectors.d.ts.map +1 -0
  33. package/out/dist/src/core/runtime-web/detector/runtime-detector.d.ts +69 -0
  34. package/out/dist/src/core/runtime-web/detector/runtime-detector.d.ts.map +1 -0
  35. package/out/dist/src/core/runtime-web/detector/runtime-detector.types.d.ts +40 -0
  36. package/out/dist/src/core/runtime-web/detector/runtime-detector.types.d.ts.map +1 -0
  37. package/out/dist/src/core/runtime-web/di/di-errors.d.ts +44 -0
  38. package/out/dist/src/core/runtime-web/di/di-errors.d.ts.map +1 -0
  39. package/out/dist/src/core/runtime-web/di/index.d.ts +9 -0
  40. package/out/dist/src/core/runtime-web/di/index.d.ts.map +1 -0
  41. package/out/dist/src/core/runtime-web/di/pure-container-factory.d.ts +105 -0
  42. package/out/dist/src/core/runtime-web/di/pure-container-factory.d.ts.map +1 -0
  43. package/out/dist/src/core/runtime-web/di/ties-registrar.d.ts +87 -0
  44. package/out/dist/src/core/runtime-web/di/ties-registrar.d.ts.map +1 -0
  45. package/out/dist/src/core/runtime-web/factory/handler-wrappers.d.ts +122 -0
  46. package/out/dist/src/core/runtime-web/factory/handler-wrappers.d.ts.map +1 -0
  47. package/out/dist/src/core/runtime-web/factory/index.d.ts +12 -0
  48. package/out/dist/src/core/runtime-web/factory/index.d.ts.map +1 -0
  49. package/out/dist/src/core/runtime-web/factory/lambda-handler-factory.d.ts +110 -0
  50. package/out/dist/src/core/runtime-web/factory/lambda-handler-factory.d.ts.map +1 -0
  51. package/out/dist/src/core/runtime-web/factory/runtime-web-lambda-handler.d.ts +94 -0
  52. package/out/dist/src/core/runtime-web/factory/runtime-web-lambda-handler.d.ts.map +1 -0
  53. package/out/dist/src/core/runtime-web/index.d.ts +7 -0
  54. package/out/dist/src/core/runtime-web/index.d.ts.map +1 -0
  55. package/out/dist/src/core/runtime-web/pipelines/index.d.ts +3 -0
  56. package/out/dist/src/core/runtime-web/pipelines/index.d.ts.map +1 -0
  57. package/out/dist/src/core/runtime-web/pipelines/lambda-pipeline.d.ts +110 -0
  58. package/out/dist/src/core/runtime-web/pipelines/lambda-pipeline.d.ts.map +1 -0
  59. package/out/dist/src/core/runtime-web/registrar/container-registry.d.ts +261 -0
  60. package/out/dist/src/core/runtime-web/registrar/container-registry.d.ts.map +1 -0
  61. package/out/dist/src/core/runtime-web/registrar/index.d.ts +6 -0
  62. package/out/dist/src/core/runtime-web/registrar/index.d.ts.map +1 -0
  63. package/out/dist/src/core/runtime-web/registrar/microservice-registrar.d.ts +167 -0
  64. package/out/dist/src/core/runtime-web/registrar/microservice-registrar.d.ts.map +1 -0
  65. package/out/dist/src/core/services/index.d.ts +4 -0
  66. package/out/dist/src/core/services/index.d.ts.map +1 -0
  67. package/out/dist/src/core/services/runtime-extensions/index.d.ts +4 -0
  68. package/out/dist/src/core/services/runtime-extensions/index.d.ts.map +1 -0
  69. package/out/dist/src/core/services/runtime-extensions/runtime-extensions.service.d.ts +98 -0
  70. package/out/dist/src/core/services/runtime-extensions/runtime-extensions.service.d.ts.map +1 -0
  71. package/out/dist/src/core/services/runtime-extensions/runtime-extensions.types.d.ts +71 -0
  72. package/out/dist/src/core/services/runtime-extensions/runtime-extensions.types.d.ts.map +1 -0
  73. package/out/dist/src/infra/index.d.ts +3 -0
  74. package/out/dist/src/infra/runtime-web/constructs/api-gateway-builder.d.ts +157 -0
  75. package/out/dist/src/infra/runtime-web/constructs/index.d.ts +3 -0
  76. package/out/dist/src/infra/runtime-web/constructs/lambda-builder.d.ts +158 -0
  77. package/out/dist/src/infra/runtime-web/index.d.ts +21 -0
  78. package/out/dist/src/infra/runtime-web/pipelines/cdk-pipeline.d.ts +112 -0
  79. package/out/dist/src/infra/runtime-web/pipelines/index.d.ts +2 -0
  80. package/out/dist/src/infra/runtime-web/stacks/index.d.ts +2 -0
  81. package/out/dist/src/infra/runtime-web/stacks/runtime-web-stack.d.ts +182 -0
  82. package/out/dist/src/infra/runtime-web/validation/config-validator.d.ts +127 -0
  83. package/out/dist/src/infra/runtime-web/validation/index.d.ts +2 -0
  84. package/out/dist/src/lib/index.d.ts +3 -0
  85. package/out/dist/src/lib/runtime-web/index.d.ts +3 -8
  86. package/out/dist/src/lib/runtime-web/pureweb.d.ts +1 -1
  87. package/out/dist/src/lib/runtime-web/runtime.config.types.d.ts +71 -0
  88. package/package.json +44 -11
  89. package/out/dist/lib/utils/index.d.ts +0 -2
  90. package/out/dist/lib/utils/types/index.d.ts +0 -3
  91. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/.env.example +0 -0
  92. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/README.md +0 -0
  93. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/gitignore.template +0 -0
  94. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/purenow.config.ts +0 -0
  95. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/app.tsx +0 -0
  96. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/handlers/users/index.ts +0 -0
  97. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/handlers/users/users.handlers.ts +0 -0
  98. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/index.tsx +0 -0
  99. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/pages/about-page.tsx +0 -0
  100. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/pages/home-page.tsx +0 -0
  101. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/pages/users-page.tsx +0 -0
  102. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/routes.tsx +0 -0
  103. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/services/index.ts +0 -0
  104. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/services/users.service.ts +0 -0
  105. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/ties/index.ts +0 -0
  106. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/src/ties/users.ties.ts +0 -0
  107. /package/out/dist/bin/templates/runtime-web/{purenow-basic → basic}/tsconfig.json +0 -0
  108. /package/out/dist/lib/{utils/types → lib/runtime-web}/runtime.config.types.d.ts +0 -0
@@ -0,0 +1,182 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
4
+ import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
5
+ import type { MicroserviceDefinition, VpcConfig } from '../../../lib/runtime-web/types';
6
+ import { MicroserviceRegistrar } from '../../../core/runtime-web/registrar';
7
+ import type { PurenowInfraStack } from '@worktif/purenow/infra';
8
+ /**
9
+ * Properties for RuntimeWebStack
10
+ */
11
+ export interface RuntimeWebStackProps extends cdk.StackProps {
12
+ /**
13
+ * Deployment stage (dev, staging, prod)
14
+ */
15
+ stage: 'dev' | 'staging' | 'prod';
16
+ /**
17
+ * Service name for resource naming
18
+ */
19
+ serviceName: string;
20
+ /**
21
+ * Reference to Infra stack for cross-stack references
22
+ */
23
+ infraStack: PurenowInfraStack;
24
+ /**
25
+ * Microservice registry with service definitions
26
+ */
27
+ register: Record<string, MicroserviceDefinition>;
28
+ /**
29
+ * API exposure mode
30
+ * @default 'apiGateway'
31
+ */
32
+ apiMode?: 'apiGateway' | 'lambdaUrl';
33
+ /**
34
+ * Default Lambda memory size in MB
35
+ * @default 512
36
+ */
37
+ lambdaMemorySize?: number;
38
+ /**
39
+ * Default Lambda timeout in seconds
40
+ * @default 30
41
+ */
42
+ lambdaTimeout?: number;
43
+ /**
44
+ * Enable Lambda warmup
45
+ * @default false
46
+ */
47
+ enableWarmup?: boolean;
48
+ /**
49
+ * VPC configuration for Lambda functions
50
+ */
51
+ vpc?: VpcConfig;
52
+ /**
53
+ * Global environment variables for all Lambda functions
54
+ */
55
+ environment?: Record<string, string>;
56
+ /**
57
+ * Path to React application entry point for SSR Lambda
58
+ */
59
+ reactEntry?: string;
60
+ }
61
+ /**
62
+ * RuntimeWebStack - CDK stack for Runtime Web Core microservices.
63
+ *
64
+ * Creates Lambda functions and API Gateway from microservice definitions.
65
+ * Extends the existing Purenow infrastructure with microservice support.
66
+ *
67
+ * **Features**:
68
+ * - Automatic Lambda function creation from LambdaDefinition
69
+ * - API Gateway with HTTP routes for Lambda endpoints
70
+ * - Environment variable injection (LAMBDA_ID, SERVICE_NAME, STAGE)
71
+ * - VPC support for private resources
72
+ * - Lambda warmup for reduced cold starts
73
+ *
74
+ * **Requirements**: REQ-11, REQ-13, REQ-14
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const runtimeStack = new RuntimeWebStack(app, 'my-app-runtime-dev', {
79
+ * stage: 'dev',
80
+ * serviceName: 'my-app',
81
+ * infraStack,
82
+ * register: {
83
+ * payments: {
84
+ * ties: [PaymentsTies],
85
+ * lambdas: [chargeHandler, refundHandler]
86
+ * }
87
+ * },
88
+ * apiMode: 'apiGateway',
89
+ * lambdaMemorySize: 512,
90
+ * lambdaTimeout: 30
91
+ * });
92
+ * ```
93
+ */
94
+ export declare class RuntimeWebStack extends cdk.Stack {
95
+ /**
96
+ * Map of Lambda functions by Lambda ID
97
+ */
98
+ readonly lambdaFunctions: Map<string, lambda.Function>;
99
+ /**
100
+ * API Gateway HttpApi (if apiMode is 'apiGateway')
101
+ */
102
+ readonly apiGateway?: apigatewayv2.HttpApi;
103
+ /**
104
+ * API Gateway stage
105
+ */
106
+ readonly apiGatewayStage?: apigatewayv2.HttpStage;
107
+ /**
108
+ * Microservice registrar for DI container management
109
+ */
110
+ private readonly registrar;
111
+ /**
112
+ * Lambda builder construct
113
+ */
114
+ private readonly lambdaBuilder;
115
+ /**
116
+ * API Gateway builder construct
117
+ */
118
+ private readonly apiGatewayBuilder;
119
+ /**
120
+ * IAM role for Lambda execution
121
+ */
122
+ private readonly lambdaRole;
123
+ constructor(scope: Construct, id: string, props: RuntimeWebStackProps);
124
+ /**
125
+ * Register microservices and build DI containers.
126
+ *
127
+ * Processes each microservice definition to create PureContainer instances
128
+ * and establish Lambda-to-service mappings.
129
+ *
130
+ * @param register - Microservice registry
131
+ * @private
132
+ */
133
+ private registerMicroservices;
134
+ /**
135
+ * Create Lambda functions for all registered microservices.
136
+ *
137
+ * Iterates through all microservice definitions and creates Lambda
138
+ * functions for each LambdaDefinition with proper environment variables.
139
+ *
140
+ * @param props - Stack properties
141
+ * @private
142
+ */
143
+ private createLambdaFunctions;
144
+ /**
145
+ * Build global environment variables for Lambda functions.
146
+ *
147
+ * Creates environment variables that are shared across all Lambda functions
148
+ * including infrastructure references from the Infra stack.
149
+ *
150
+ * @param props - Stack properties
151
+ * @returns Environment variables record
152
+ * @private
153
+ */
154
+ private buildGlobalEnvironment;
155
+ /**
156
+ * Create CloudFormation outputs for stack resources.
157
+ *
158
+ * @param props - Stack properties
159
+ * @private
160
+ */
161
+ private createOutputs;
162
+ /**
163
+ * Get Lambda function by ID.
164
+ *
165
+ * @param lambdaId - Full Lambda ID (e.g., 'payments.charge')
166
+ * @returns Lambda function or undefined
167
+ */
168
+ getLambdaFunction(lambdaId: string): lambda.Function | undefined;
169
+ /**
170
+ * Get all Lambda IDs.
171
+ *
172
+ * @returns Array of Lambda IDs
173
+ */
174
+ getLambdaIds(): string[];
175
+ /**
176
+ * Get the microservice registrar.
177
+ *
178
+ * @returns MicroserviceRegistrar instance
179
+ */
180
+ getRegistrar(): MicroserviceRegistrar;
181
+ }
182
+ //# sourceMappingURL=runtime-web-stack.d.ts.map
@@ -0,0 +1,127 @@
1
+ import type { InfraOptions, RuntimeWebConfig } from '../../../lib/runtime-web/types';
2
+ /**
3
+ * Validation result containing success status and any errors.
4
+ */
5
+ export interface ConfigValidationResult {
6
+ /** Whether the configuration is valid */
7
+ valid: boolean;
8
+ /** Array of validation error messages */
9
+ errors: string[];
10
+ }
11
+ /**
12
+ * Error thrown when configuration validation fails.
13
+ */
14
+ export declare class ConfigValidationError extends Error {
15
+ /** Array of validation error messages */
16
+ readonly errors: string[];
17
+ constructor(errors: string[]);
18
+ }
19
+ /**
20
+ * Configuration validator for Runtime Target Core.
21
+ *
22
+ * Validates PurenowConfig objects to ensure they meet all requirements
23
+ * before execution. Provides detailed error messages with actionable guidance.
24
+ *
25
+ * **Validation Rules**:
26
+ * - serviceName: Must start with letter, alphanumeric and hyphens only, max 128 chars
27
+ * - stage: Must be 'dev', 'staging', or 'prod'
28
+ * - infra: Required in CDK context, optional in browser/Lambda
29
+ * - register: Must have at least one microservice if provided
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * const validator = new ConfigValidator();
34
+ * const result = validator.validate(config);
35
+ *
36
+ * if (!result.valid) {
37
+ * console.error('Configuration errors:', result.errors);
38
+ * }
39
+ * ```
40
+ */
41
+ export declare class ConfigValidator {
42
+ /** Regex pattern for valid service names */
43
+ private static readonly SERVICE_NAME_PATTERN;
44
+ /** Valid stage values */
45
+ private static readonly VALID_STAGES;
46
+ /** AWS account ID pattern (12 digits) */
47
+ private static readonly AWS_ACCOUNT_PATTERN;
48
+ /**
49
+ * Validate a PurenowConfig object.
50
+ *
51
+ * Performs comprehensive validation of all configuration properties
52
+ * and returns a result with any validation errors.
53
+ *
54
+ * @param config - Configuration to validate
55
+ * @param isCDKContext - Whether running in CDK context (requires infra)
56
+ * @returns Validation result with errors array
57
+ */
58
+ validate(config: RuntimeWebConfig, isCDKContext?: boolean): ConfigValidationResult;
59
+ /**
60
+ * Validate configuration and throw if invalid.
61
+ *
62
+ * @param config - Configuration to validate
63
+ * @param isCDKContext - Whether running in CDK context
64
+ * @throws ConfigValidationError if validation fails
65
+ */
66
+ validateOrThrow(config: RuntimeWebConfig, isCDKContext?: boolean): void;
67
+ /**
68
+ * Validate service name format.
69
+ *
70
+ * Service name must:
71
+ * - Start with a letter (a-z, A-Z)
72
+ * - Contain only alphanumeric characters and hyphens
73
+ * - Be between 1 and 128 characters
74
+ *
75
+ * @param serviceName - Service name to validate
76
+ * @returns Array of error messages (empty if valid)
77
+ */
78
+ validateServiceName(serviceName: unknown): string[];
79
+ /**
80
+ * Validate deployment stage.
81
+ *
82
+ * Stage must be one of: 'dev', 'staging', 'prod'
83
+ *
84
+ * @param stage - Stage to validate
85
+ * @returns Array of error messages (empty if valid)
86
+ */
87
+ validateStage(stage: unknown): string[];
88
+ /**
89
+ * Validate app factory function.
90
+ *
91
+ * App must be a function that accepts router dependency and returns React element.
92
+ *
93
+ * @param app - App factory function to validate
94
+ * @returns Array of error messages (empty if valid)
95
+ */
96
+ validateApp(app: unknown): string[];
97
+ /**
98
+ * Validate router instance.
99
+ *
100
+ * Router must be a PurenowRouter instance with getRoutes method.
101
+ *
102
+ * @param router - Router to validate
103
+ * @returns Array of error messages (empty if valid)
104
+ */
105
+ validateRouter(router: unknown): string[];
106
+ /**
107
+ * Validate microservice register.
108
+ *
109
+ * Register must be an object with microservice definitions.
110
+ * Each microservice must have ties and lambdas arrays.
111
+ *
112
+ * @param register - Microservice register to validate
113
+ * @returns Array of error messages (empty if valid)
114
+ */
115
+ validateRegister(register: unknown): string[];
116
+ /**
117
+ * Validate infrastructure configuration.
118
+ *
119
+ * Infra is required in CDK context and must have valid env and stage.
120
+ *
121
+ * @param infra - Infrastructure options to validate
122
+ * @param isCDKContext - Whether running in CDK context
123
+ * @returns Array of error messages (empty if valid)
124
+ */
125
+ validateInfra(infra: InfraOptions | undefined, isCDKContext: boolean): string[];
126
+ }
127
+ //# sourceMappingURL=config-validator.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { ConfigValidator, ConfigValidationError, type ConfigValidationResult, } from './config-validator';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from '@worktif/purenow';
2
+ export * from './runtime-web';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,12 @@
1
1
  /**
2
2
  * Runtime Web Core - Library (Isomorphic/Browser)
3
3
  *
4
- * **ARCHITECTURE NOTE**: This module contains browser-safe code that:
5
- * - Runs in browser environment (client-side)
6
- * - Uses browser APIs (window, document, hydrateRoot)
7
- * - Must be isomorphic-safe (no Node.js APIs)
8
- * - NEVER runs in Lambda
9
- * - Bundled into browser builds
10
- *
11
- * **Exports**:
4
+ * Exports:
12
5
  * - BrowserPipeline: Client-side React hydration and routing
13
6
  */
14
7
  export * from './pipelines';
15
8
  export * from './types';
16
9
  export * from './pureweb';
10
+ export type { RuntimeConfig, } from './runtime.config.types';
11
+ export { mergeRuntimeConfig, isRuntimeConfig, extractRuntimeConfig, createRuntimeConfig, } from './runtime.config.types';
17
12
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { RuntimeWebConfig } from './types';
1
+ import { RuntimeWebConfig } from '../runtime-web/types';
2
2
  /**
3
3
  * Error thrown when configuration validation fails.
4
4
  * Follows purenow error patterns without emoji.
@@ -0,0 +1,71 @@
1
+ import type { PurenowConfig } from '@worktif/purenow';
2
+ /**
3
+ * Runtime-specific configuration that extends PurenowConfig.
4
+ *
5
+ * This interface adds runtime workspace functionality while preserving
6
+ * all existing purenow configuration options. The runtime configuration
7
+ * is merged with purenow configuration rather than replacing it.
8
+ */
9
+ export interface RuntimeConfig extends PurenowConfig {
10
+ /**
11
+ * Runtime-specific configuration options.
12
+ * These settings extend purenow functionality without replacing it.
13
+ */
14
+ runtime?: {
15
+ /** Enable Runtime Core stack deployment (extends purenow's two-stack architecture) */
16
+ enableThirdStack?: boolean;
17
+ /** Runtime web mode configuration */
18
+ runtimeWebMode?: 'development' | 'production';
19
+ /** Additional runtime features to enable */
20
+ additionalFeatures?: string[];
21
+ /** Development server enhancements */
22
+ devServerEnhancements?: {
23
+ /** Enable hot module replacement */
24
+ hotReload?: boolean;
25
+ /** Enable debug mode with additional logging */
26
+ debugMode?: boolean;
27
+ /** Enable performance monitoring */
28
+ performanceMonitoring?: boolean;
29
+ };
30
+ /** Build optimizations */
31
+ buildOptimizations?: {
32
+ /** Enable bundle analysis */
33
+ bundleAnalysis?: boolean;
34
+ /** Enable tree shaking */
35
+ treeshaking?: boolean;
36
+ /** Enable code minification */
37
+ codeMinification?: boolean;
38
+ };
39
+ };
40
+ }
41
+ /**
42
+ * Configuration merging utility that preserves all purenow settings
43
+ * while adding runtime-specific extensions.
44
+ *
45
+ * @param purenowConfig - Base purenow configuration
46
+ * @param runtimeConfig - Runtime-specific configuration to merge
47
+ * @returns Merged configuration with all purenow settings preserved
48
+ */
49
+ export declare function mergeRuntimeConfig(purenowConfig: PurenowConfig, runtimeConfig?: Partial<RuntimeConfig['runtime']>): RuntimeConfig;
50
+ /**
51
+ * Type guard to check if a configuration is a RuntimeConfig.
52
+ *
53
+ * @param config - Configuration to check
54
+ * @returns True if the configuration has runtime-specific properties
55
+ */
56
+ export declare function isRuntimeConfig(config: any): config is RuntimeConfig;
57
+ /**
58
+ * Extract runtime-specific configuration from a RuntimeConfig.
59
+ *
60
+ * @param config - RuntimeConfig to extract from
61
+ * @returns Runtime-specific configuration or undefined
62
+ */
63
+ export declare function extractRuntimeConfig(config: RuntimeConfig): RuntimeConfig['runtime'];
64
+ /**
65
+ * Create a RuntimeConfig from a base PurenowConfig with default runtime settings.
66
+ *
67
+ * @param purenowConfig - Base purenow configuration
68
+ * @returns RuntimeConfig with default runtime settings
69
+ */
70
+ export declare function createRuntimeConfig(purenowConfig: PurenowConfig): RuntimeConfig;
71
+ //# sourceMappingURL=runtime.config.types.d.ts.map
package/package.json CHANGED
@@ -1,19 +1,27 @@
1
1
  {
2
2
  "name": "@worktif/runtime",
3
- "version": "0.3.0-edge.0",
3
+ "version": "0.3.0-edge.10",
4
4
  "description": "Serverless web framework running on AWS Lambda with support for server-side rendering, caching, and CI/CD.",
5
5
  "repository": "git@bitbucket.org:worktif/runtime-target.git",
6
6
  "author": "Raman Marozau <raman@worktif.com>",
7
7
  "license": "Elastic-2.0",
8
+ "readme": "README.md",
8
9
  "main": "out/dist/lib/index.js",
9
10
  "types": "out/dist/lib/index.d.ts",
10
11
  "files": [
11
12
  "out/dist/lib/**/*",
12
- "out/dist/src/lib/runtime-web/**/*.d.ts",
13
+ "out/dist/src/lib/**/*.d.ts",
14
+ "out/dist/infra/**/*.js",
15
+ "out/dist/src/infra/**/*.d.ts",
16
+ "out/dist/lambda/**/*",
17
+ "out/dist/src/core/**/*",
18
+ "out/dist/src/utils/**/*",
19
+ "out/dist/src/types/**/*",
13
20
  "out/dist/src/bin/**/*.d.ts",
14
21
  "out/dist/bin/purenow.js",
15
22
  "out/dist/bin/index.js",
16
23
  "out/dist/bin/templates/**/*",
24
+ "lambda-layer/package.json",
17
25
  "package.json",
18
26
  "README.md"
19
27
  ],
@@ -22,29 +30,54 @@
22
30
  "types": "./out/dist/lib/index.d.ts",
23
31
  "default": "./out/dist/lib/index.js"
24
32
  },
25
- "./runtime-web": {
26
- "types": "./out/dist/src/lib/runtime-web/index.d.ts",
27
- "default": "./out/dist/lib/runtime-web/index.js"
33
+ "./infra": {
34
+ "types": "./out/dist/src/infra/index.d.ts",
35
+ "default": "./out/dist/infra/index.js"
28
36
  },
29
- "./cli": {
30
- "types": "./out/dist/src/bin/index.d.ts",
31
- "default": "./out/dist/bin/purenow.js"
37
+ "./lambda": {
38
+ "types": "./out/dist/src/core/index.d.ts",
39
+ "default": "./out/dist/lambda/bundle.js"
32
40
  },
33
41
  "./bin": {
34
42
  "types": "./out/dist/src/bin/index.d.ts",
35
43
  "default": "./out/dist/bin/index.js"
36
44
  },
45
+ "./cli": {
46
+ "types": "./out/dist/src/bin/index.d.ts",
47
+ "default": "./out/dist/bin/purenow.js"
48
+ },
49
+ "./core": {
50
+ "types": "./out/dist/src/core/index.d.ts",
51
+ "default": "./out/dist/src/core/index.js"
52
+ },
53
+ "./utils": {
54
+ "types": "./out/dist/src/utils/index.d.ts",
55
+ "default": "./out/dist/src/utils/index.js"
56
+ },
57
+ "./types": {
58
+ "types": "./out/dist/src/types/index.d.ts",
59
+ "default": "./out/dist/src/types/index.js"
60
+ },
61
+ "./runtime-web": {
62
+ "types": "./out/dist/src/lib/runtime-web/index.d.ts",
63
+ "default": "./out/dist/lib/runtime-web/index.js"
64
+ },
37
65
  "./package.json": "./package.json"
38
66
  },
39
67
  "bin": {
40
- "purenow": "./out/dist/bin/purenow.js"
68
+ "runtime": "./out/dist/bin/purenow.js"
41
69
  },
42
70
  "scripts": {
43
- "build": "rm -rf ./.docs && yarn run docs && rm -rf ./dist && rm -rf ./out && yarn run cli:build && yarn run cli:build:cli && yarn run cli:build:bin && node bin/deploy/copy-templates.js && yarn run types && node bin/deploy/generate-lib-types.js && node bin/deploy/validate-bundle-sizes.js",
71
+ "build": "rm -rf ./.docs && yarn run docs && rm -rf ./dist && rm -rf ./out && yarn run cli:build && yarn run cli:build:infra && yarn run cli:build:cli && yarn run cli:build:bin && node bin/deploy/copy-templates.js && yarn run types && node bin/deploy/generate-lib-types.js && node bin/deploy/validate-bundle-sizes.js",
44
72
  "clean": "rm -rf ./dist && rm -rf ./out && rm -rf ./.docs",
73
+ "build:lambda": "yarn run build:config && node dist/cli/build.js --target=lambda && node bin/deploy/validate-bundle-sizes.js",
45
74
  "generate:html-template": "node bin/deploy/generate-html-template.js",
75
+ "build:react": "yarn run build:config && node dist/cli/build.js --target=react && node bin/deploy/validate-bundle-sizes.js",
76
+ "build:react:verify": "yarn run build:react && node scripts/verify-browser-bundle.js",
77
+ "build:cdk": "yarn run build:config && node dist/cli/build.js --target=cdk",
46
78
  "build:config": "esbuild --bundle --platform=node bin/deploy/cloud.build/esbuild.build.ts --outfile=dist/cli/build.js --external:esbuild",
47
79
  "cli:build": "yarn run build:config && node dist/cli/build.js",
80
+ "cli:build:infra": "yarn run build:config && node dist/cli/build.js --target=infra",
48
81
  "cli:build:cli": "yarn run build:config && node dist/cli/build.js --target=cli",
49
82
  "cli:build:bin": "yarn run build:config && node dist/cli/build.js --target=bin",
50
83
  "types": "tsc --emitDeclarationOnly && tsc-alias",
@@ -68,7 +101,7 @@
68
101
  "migrate:seo:dry-run": "ts-node scripts/migrate-seo-metadata.ts --dry-run"
69
102
  },
70
103
  "dependencies": {
71
- "@worktif/purenow": "^0.3.0-rc.18",
104
+ "@worktif/purenow": "^0.3.0-rc.24",
72
105
  "@worktif/utils": "^0.2.32"
73
106
  },
74
107
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- export type { RuntimeConfig, } from './runtime.config.types';
2
- export { mergeRuntimeConfig, isRuntimeConfig, extractRuntimeConfig, createRuntimeConfig, } from './runtime.config.types';
3
- //# sourceMappingURL=index.d.ts.map