@flisk-sh/flisk 1.4.0 → 1.4.2

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 +305 -52
  2. package/cli/dist/commands/doctor.js +62 -0
  3. package/cli/dist/commands/runtime.js +6 -3
  4. package/cli/dist/generator/template-engine.js +7 -4
  5. package/cli/dist/utils/runtime-layout.js +7 -0
  6. package/cli/dist-bundle/{chunk-QQEV6D74.js → chunk-3XODDLRJ.js} +1 -1
  7. package/cli/dist-bundle/{chunk-VMB5673O.js → chunk-43XWL2PB.js} +30 -26
  8. package/cli/dist-bundle/{chunk-5EZ4EX6U.js → chunk-53L2JN7G.js} +1 -1
  9. package/cli/dist-bundle/{chunk-BWK6MPCB.js → chunk-5F7YP5IR.js} +1 -1
  10. package/cli/dist-bundle/{chunk-36SOQVAL.js → chunk-5QBYM33Q.js} +1 -1
  11. package/cli/dist-bundle/{chunk-HEMPQKD6.js → chunk-DU2BN46C.js} +1 -1
  12. package/cli/dist-bundle/{chunk-ICXF6PXA.js → chunk-ETKUVKJ2.js} +2 -2
  13. package/cli/dist-bundle/{chunk-PVBAGX5X.js → chunk-I7TGIK5N.js} +1 -1
  14. package/cli/dist-bundle/{chunk-B6Q5VKL7.js → chunk-IGN5UC3P.js} +1 -1
  15. package/cli/dist-bundle/chunk-MWOVYIBB.js +54 -0
  16. package/cli/dist-bundle/{chunk-D7N2GGJH.js → chunk-YHYRGWUH.js} +1 -1
  17. package/cli/dist-bundle/{chunk-VHFFSBVJ.js → chunk-YNCBBJ4V.js} +1 -1
  18. package/cli/dist-bundle/cli.js +153 -153
  19. package/cli/dist-bundle/{cold-preflight-ABU26DYW.js → cold-preflight-ZOPR7PWJ.js} +1 -1
  20. package/cli/dist-bundle/{demo-stage-EBIUCJBX.js → demo-stage-OHNTP2UJ.js} +1 -1
  21. package/cli/dist-bundle/{open-2KSAF6M2.js → open-XROJ6YEY.js} +1 -1
  22. package/cli/dist-bundle/project-7PTIOHGF.js +2 -0
  23. package/cli/dist-bundle/{services-V6Q55JR5.js → services-BIMF6MVU.js} +1 -1
  24. package/cli/dist-bundle/{tilt-port-owner-MWJ7P6NB.js → tilt-port-owner-ZY5M2JC4.js} +1 -1
  25. package/cli/package.json +1 -1
  26. package/package.json +12 -2
  27. package/runtime/platform/services/platform/proxy/service.yaml +14 -0
  28. package/cli/dist/commands/__tests__/project-e2e-helpers.js +0 -49
  29. package/cli/dist/commands/__tests__/ui-loading-screen.test.js +0 -16
  30. package/cli/dist/generator/__tests__/golden-helpers.js +0 -43
  31. package/cli/dist-bundle/chunk-763VK575.js +0 -54
  32. package/cli/dist-bundle/project-YD3C4ZV3.js +0 -2
  33. package/runtime/discovery/test_resource_snapshot.py +0 -253
  34. package/runtime/engine/assets/docker/wake-gateway/decide.test.ts +0 -177
  35. package/runtime/engine/topologies/tilt/manifest/tests/test_integration.star +0 -278
  36. package/runtime/engine/topologies/tilt/manifest/tests/test_loader_parser.star +0 -475
  37. package/runtime/engine/topologies/tilt/manifest/tests/test_manifest.star +0 -319
  38. package/runtime/engine/topologies/tilt/manifest/tests/test_validator.star +0 -472
  39. package/runtime/ext/ide-components/shared/test_config_service.py +0 -328
  40. /package/{shared-platform-engineering → runtime/shared-platform-engineering}/docker-templates/bun-hoisted-symlink-fix.sh +0 -0
  41. /package/{shared-platform-engineering → runtime/shared-platform-engineering}/docker-templates/infisical-entrypoint.sh +0 -0
  42. /package/{shared-platform-engineering → runtime/shared-platform-engineering}/docker-templates/install-deps.sh +0 -0
  43. /package/{shared-platform-engineering → runtime/shared-platform-engineering}/docker-templates/prisma-bun-client-link-fix.sh +0 -0
  44. /package/{shared-platform-engineering → runtime/shared-platform-engineering}/docker-templates/prisma-normalize-client.sh +0 -0
@@ -1,319 +0,0 @@
1
- # Copyright (c) 2026 Flisk Landscape contributors
2
- # SPDX-License-Identifier: MIT
3
- # =============================================================================
4
- # 📋 MANIFEST MODULE - UNIT TESTS
5
- # =============================================================================
6
- # Path: .tilt/topologies/tilt/manifest/tests/test_manifest.star
7
- # Purpose: Unit tests for manifest system
8
- # Status: Phase 1 of manifest system refactoring
9
- #
10
- # Run with: tilt test (when implemented) or manually load and run
11
- # =============================================================================
12
-
13
- # Import modules under test
14
- load("../__init__.star", "Manifest")
15
- load("../constants.star", "ManifestConstants")
16
- load("../errors.star", "ManifestErrors")
17
- load("../schema.star", "ManifestSchema")
18
-
19
- # =============================================================================
20
- # TEST FRAMEWORK (Simple implementation for Starlark)
21
- # =============================================================================
22
-
23
- test_results = {
24
- 'passed': 0,
25
- 'failed': 0,
26
- 'errors': [],
27
- }
28
-
29
- def assert_true(condition, message="Assertion failed"):
30
- """Assert that condition is true."""
31
- if not condition:
32
- test_results['failed'] += 1
33
- test_results['errors'].append("FAIL: " + message)
34
- else:
35
- test_results['passed'] += 1
36
-
37
- def assert_equal(expected, actual, message="Values not equal"):
38
- """Assert that expected equals actual."""
39
- if expected != actual:
40
- test_results['failed'] += 1
41
- test_results['errors'].append(
42
- "FAIL: {} - expected '{}', got '{}'".format(message, expected, actual)
43
- )
44
- else:
45
- test_results['passed'] += 1
46
-
47
- def assert_not_none(value, message="Value is None"):
48
- """Assert that value is not None."""
49
- if value == None:
50
- test_results['failed'] += 1
51
- test_results['errors'].append("FAIL: " + message)
52
- else:
53
- test_results['passed'] += 1
54
-
55
- def assert_in(value, collection, message="Value not in collection"):
56
- """Assert that value is in collection."""
57
- if value not in collection:
58
- test_results['failed'] += 1
59
- test_results['errors'].append("FAIL: {} - '{}' not in {}".format(message, value, collection))
60
- else:
61
- test_results['passed'] += 1
62
-
63
- def run_tests():
64
- """Run all tests and print results."""
65
- print("\n" + "="*70)
66
- print("📋 MANIFEST MODULE - UNIT TESTS")
67
- print("="*70 + "\n")
68
-
69
- # Run test suites
70
- _test_constants()
71
- _test_schema()
72
- _test_errors()
73
- _test_facade()
74
- _test_backward_compatibility()
75
-
76
- # Print results
77
- print("\n" + "="*70)
78
- print("📊 TEST RESULTS")
79
- print("="*70)
80
- print("✅ Passed: {}".format(test_results['passed']))
81
- print("❌ Failed: {}".format(test_results['failed']))
82
-
83
- if test_results['errors']:
84
- print("\n📝 ERRORS:")
85
- for error in test_results['errors']:
86
- print(" " + error)
87
- else:
88
- print("\n🎉 All tests passed!")
89
-
90
- print("="*70 + "\n")
91
-
92
- return test_results['failed'] == 0
93
-
94
- # =============================================================================
95
- # TEST SUITE: Constants Module
96
- # =============================================================================
97
-
98
- def _test_constants():
99
- """Test constants module."""
100
- print("🔍 Testing constants module...")
101
-
102
- # Test MANIFEST_FILENAME
103
- assert_equal(
104
- 'service.json',
105
- ManifestConstants.MANIFEST_FILENAME,
106
- "MANIFEST_FILENAME should match expected"
107
- )
108
-
109
- # Test VALID_APP_TYPES
110
- assert_in('frontend', ManifestConstants.VALID_APP_TYPES, "frontend should be valid app type")
111
- assert_in('backend', ManifestConstants.VALID_APP_TYPES, "backend should be valid app type")
112
-
113
- # Test VALID_STACKS (stacks discovered dynamically from filesystem)
114
- assert_true(type(ManifestConstants.VALID_STACKS) == "list", "VALID_STACKS should be a list")
115
-
116
- # Test VALID_FEATURES
117
- assert_in('nats', ManifestConstants.VALID_FEATURES, "nats should be valid feature")
118
- assert_in('prisma', ManifestConstants.VALID_FEATURES, "prisma should be valid feature")
119
- assert_in('drizzle', ManifestConstants.VALID_FEATURES, "drizzle should be valid feature")
120
- assert_in('api-client', ManifestConstants.VALID_FEATURES, "api-client should be valid feature")
121
- assert_in('env-config', ManifestConstants.VALID_FEATURES, "env-config should be valid feature")
122
- assert_in('api-index', ManifestConstants.VALID_FEATURES, "api-index should be valid feature")
123
-
124
- # Test MANIFEST_DEFAULTS
125
- assert_equal(4000, ManifestConstants.MANIFEST_DEFAULTS['port'], "Default port should be 4000")
126
- assert_equal('backend', ManifestConstants.MANIFEST_DEFAULTS['appType'], "Default appType should be backend")
127
- assert_equal(1, ManifestConstants.MANIFEST_DEFAULTS['replicas'], "Default replicas should be 1")
128
-
129
- # Test PORT_RANGES
130
- assert_not_none(ManifestConstants.PORT_RANGES['frontend'], "frontend should have port range")
131
- assert_not_none(ManifestConstants.PORT_RANGES['backend'], "backend should have port range")
132
-
133
- print("✅ Constants module tests complete\n")
134
-
135
- # =============================================================================
136
- # TEST SUITE: Schema Module
137
- # =============================================================================
138
-
139
- def _test_schema():
140
- """Test schema module."""
141
- print("🔍 Testing schema module...")
142
-
143
- # Test get_field
144
- app_name_schema = ManifestSchema.get_field('appName')
145
- assert_not_none(app_name_schema, "appName schema should exist")
146
- assert_equal('string', app_name_schema['type'], "appName should be string type")
147
- assert_true(app_name_schema['required'], "appName should be required")
148
-
149
- # Test get_required_fields
150
- required_fields = ManifestSchema.get_required_fields()
151
- assert_in('appName', required_fields, "appName should be required")
152
- assert_in('appType', required_fields, "appType should be required")
153
- assert_in('stack', required_fields, "stack should be required")
154
-
155
- # Test get_default
156
- default_port = ManifestSchema.get_default('port')
157
- assert_equal(4000, default_port, "Default port should be 4000")
158
-
159
- default_replicas = ManifestSchema.get_default('replicas')
160
- assert_equal(1, default_replicas, "Default replicas should be 1")
161
-
162
- # Test get_valid_values
163
- valid_app_types = ManifestSchema.get_valid_values('appType')
164
- assert_not_none(valid_app_types, "appType should have valid values")
165
- assert_in('frontend', valid_app_types, "frontend should be valid app type")
166
- assert_in('backend', valid_app_types, "backend should be valid app type")
167
-
168
- # Test is_required
169
- assert_true(ManifestSchema.is_required('appName'), "appName should be required")
170
- assert_true(ManifestSchema.is_required('appType'), "appType should be required")
171
-
172
- # Test is_deprecated
173
- # The 'dependencies' field is deprecated (replaced by 'dependsOn')
174
- is_dep = ManifestSchema.is_deprecated('dependencies')
175
- assert_true(is_dep, "dependencies field should be marked as deprecated")
176
-
177
- # Test get_all_fields
178
- all_fields = ManifestSchema.get_all_fields()
179
- assert_true(len(all_fields) > 0, "Should have field definitions")
180
- assert_in('appName', all_fields, "appName should be in all fields")
181
- assert_in('port', all_fields, "port should be in all fields")
182
-
183
- print("✅ Schema module tests complete\n")
184
-
185
- # =============================================================================
186
- # TEST SUITE: Errors Module
187
- # =============================================================================
188
-
189
- def _test_errors():
190
- """Test errors module."""
191
- print("🔍 Testing errors module...")
192
-
193
- # Test new error creation
194
- error = ManifestErrors.new(
195
- message="Test error",
196
- category=ManifestErrors.CATEGORY['SCHEMA'],
197
- severity=ManifestErrors.SEVERITY['ERROR'],
198
- context={'field': 'appName', 'path': '/test/manifest.json'},
199
- )
200
-
201
- assert_not_none(error, "Error should be created")
202
- assert_equal("Test error", error.message, "Error message should match")
203
- assert_equal('schema', error.category, "Error category should be schema")
204
- assert_equal('error', error.severity, "Error severity should be error")
205
-
206
- # Test format_error
207
- formatted = ManifestErrors.format(error)
208
- assert_not_none(formatted, "Formatted error should not be None")
209
- assert_true('[ERROR]' in formatted, "Formatted should include severity")
210
- assert_true('SCHEMA' in formatted, "Formatted should include category")
211
-
212
- # Test has_critical
213
- errors_list = [error]
214
- assert_true(not ManifestErrors.has_critical(errors_list), "Should not have critical errors")
215
-
216
- # Create a critical error
217
- critical_error = ManifestErrors.new(
218
- message="Critical test",
219
- category=ManifestErrors.CATEGORY['VALIDATION'],
220
- severity=ManifestErrors.SEVERITY['CRITICAL'],
221
- )
222
- critical_list = [critical_error]
223
- assert_true(ManifestErrors.has_critical(critical_list), "Should detect critical error")
224
-
225
- # Test get_summary
226
- summary = ManifestErrors.get_summary([error, critical_error])
227
- assert_equal(2, summary['total'], "Summary should show 2 errors")
228
- assert_equal(1, summary['by_severity']['CRITICAL'], "Should have 1 critical")
229
- assert_equal(1, summary['by_severity']['ERROR'], "Should have 1 error")
230
-
231
- print("✅ Errors module tests complete\n")
232
-
233
- # =============================================================================
234
- # TEST SUITE: Facade Module
235
- # =============================================================================
236
-
237
- def _test_facade():
238
- """Test main Manifest facade."""
239
- print("🔍 Testing Manifest facade...")
240
-
241
- # Test constants accessible via facade
242
- assert_equal('service.json', Manifest.filename, "Filename should be accessible")
243
- assert_not_none(Manifest.defaults, "Defaults should be accessible")
244
- assert_not_none(Manifest.app_types, "App types should be accessible")
245
- assert_not_none(Manifest.stacks, "Stacks should be accessible")
246
- assert_not_none(Manifest.features, "Features should be accessible")
247
-
248
- # Test schema utilities accessible
249
- assert_not_none(Manifest.get_field, "get_field should be accessible")
250
- assert_not_none(Manifest.get_required_fields, "get_required_fields should be accessible")
251
- assert_not_none(Manifest.get_default, "get_default should be accessible")
252
-
253
- # Test error utilities accessible
254
- assert_not_none(Manifest.format_error, "format_error should be accessible")
255
- assert_not_none(Manifest.group_errors, "group_errors should be accessible")
256
- assert_not_none(Manifest.has_critical_errors, "has_critical_errors should be accessible")
257
-
258
- # Test convenience functions
259
- assert_not_none(Manifest.is_valid_manifest, "is_valid_manifest should exist")
260
- assert_not_none(Manifest.get_resource_type, "get_resource_type should exist")
261
-
262
- print("✅ Facade module tests complete\n")
263
-
264
- # =============================================================================
265
- # TEST SUITE: Backward Compatibility
266
- # =============================================================================
267
-
268
- def _test_backward_compatibility():
269
- """Test backward compatibility with old imports."""
270
- print("🔍 Testing backward compatibility...")
271
-
272
- # Test that old imports still work
273
- load("../../manifest/constants.star",
274
- old_manifest_filename="MANIFEST_FILENAME",
275
- old_defaults="MANIFEST_DEFAULTS",
276
- )
277
-
278
- # Old import should return same values
279
- assert_equal(
280
- ManifestConstants.MANIFEST_FILENAME,
281
- old_manifest_filename,
282
- "Old import should match new constant"
283
- )
284
-
285
- assert_equal(
286
- ManifestConstants.MANIFEST_DEFAULTS['port'],
287
- old_defaults['port'],
288
- "Old defaults should match new defaults"
289
- )
290
-
291
- print("✅ Backward compatibility tests complete\n")
292
-
293
- # =============================================================================
294
- # MAIN
295
- # =============================================================================
296
-
297
- # Run tests when this file is loaded
298
- # In production, this would be called by a test runner
299
- # For now, we just define the test suite
300
-
301
- def main():
302
- """Run all tests."""
303
- return run_tests()
304
-
305
- # Export test functions for external test runner
306
- TestManifest = struct(
307
- run=run_tests,
308
- test_constants=_test_constants,
309
- test_schema=_test_schema,
310
- test_errors=_test_errors,
311
- test_facade=_test_facade,
312
- test_backward_compatibility=_test_backward_compatibility,
313
- )
314
-
315
-
316
- # Inlined constant
317
- DEFAULTS = {}
318
-
319
- VALIDATION = {}