@tdk-landscape/tdk-cli-core 1.3.74 → 1.3.75
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 +3 -0
- package/cli/dist/commands/doctor.js +58 -2
- package/cli/dist/commands/resource.js +62 -62
- package/cli/dist/commands/ui.js +27 -24
- package/cli/dist/frontend-frameworks/react.js +70 -0
- package/cli/dist/frontend-frameworks/registry.js +29 -0
- package/cli/dist/frontend-frameworks/types.js +2 -0
- package/cli/dist/frontend-frameworks/vue.js +73 -0
- package/cli/dist/utils/discovery-paths.js +67 -0
- package/cli/dist/utils/errors.js +4 -1
- package/cli/package.json +1 -1
- package/engine/AGENTS.md +5 -4
- package/engine/schemas/service-schema.json +9 -1
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +26 -19
- package/engine/topologies/tilt/generators/validators.star +2 -1
- package/engine/topologies/tilt/generators/vite/frameworks/react.star +126 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vue.star +92 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +21 -4
- package/engine/topologies/tilt/generators/vite/templates.star +0 -283
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +8 -2
- package/package.json +1 -1
|
@@ -20,131 +20,6 @@ def _load_npm_scope():
|
|
|
20
20
|
|
|
21
21
|
_NPM_SCOPE = _load_npm_scope()
|
|
22
22
|
|
|
23
|
-
TEMPLATE_VITE_FRONTEND = """{header}
|
|
24
|
-
import {{ resolve }} from 'node:path';
|
|
25
|
-
import react from '@vitejs/plugin-react';
|
|
26
|
-
import {{ defineConfig }} from 'vite';
|
|
27
|
-
|
|
28
|
-
export default defineConfig({{
|
|
29
|
-
base: '{base_path}',
|
|
30
|
-
build: {{
|
|
31
|
-
cssCodeSplit: false,
|
|
32
|
-
minify: false,
|
|
33
|
-
modulePreload: false,
|
|
34
|
-
rollupOptions: {{
|
|
35
|
-
output: {{
|
|
36
|
-
entryFileNames: '[name].js',
|
|
37
|
-
format: 'esm',
|
|
38
|
-
}},
|
|
39
|
-
}},
|
|
40
|
-
target: 'esnext',
|
|
41
|
-
}},
|
|
42
|
-
define: {{
|
|
43
|
-
global: 'globalThis',
|
|
44
|
-
}},
|
|
45
|
-
optimizeDeps: {{
|
|
46
|
-
include: [{optimize_deps_include}],
|
|
47
|
-
}},
|
|
48
|
-
plugins: [react()],
|
|
49
|
-
preview: {{
|
|
50
|
-
host: '0.0.0.0',
|
|
51
|
-
port: {port},
|
|
52
|
-
}},
|
|
53
|
-
resolve: {{
|
|
54
|
-
alias: {{
|
|
55
|
-
// 🎯 IMPORTANT: Order matters! More specific aliases must come FIRST
|
|
56
|
-
'@/autogenerated': resolve(__dirname),
|
|
57
|
-
'@': resolve(__dirname, '../src'),
|
|
58
|
-
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
59
|
-
{internal_aliases}
|
|
60
|
-
}},
|
|
61
|
-
}},
|
|
62
|
-
server: {{
|
|
63
|
-
host: '0.0.0.0',
|
|
64
|
-
port: {port},
|
|
65
|
-
hmr: {{
|
|
66
|
-
port: {hmr_port},
|
|
67
|
-
}},
|
|
68
|
-
{proxy_config}
|
|
69
|
-
}},
|
|
70
|
-
}});
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
TEMPLATE_VITE_FRONTEND_BUILD = """{header}
|
|
74
|
-
import {{ resolve }} from 'node:path';
|
|
75
|
-
import react from '@vitejs/plugin-react';
|
|
76
|
-
import {{ defineConfig }} from 'vite';
|
|
77
|
-
|
|
78
|
-
export default defineConfig({{
|
|
79
|
-
mode: 'production',
|
|
80
|
-
base: '{base_path}',
|
|
81
|
-
build: {{
|
|
82
|
-
cssCodeSplit: false,
|
|
83
|
-
minify: true,
|
|
84
|
-
modulePreload: false,
|
|
85
|
-
rollupOptions: {{
|
|
86
|
-
output: {{
|
|
87
|
-
entryFileNames: '[name].js',
|
|
88
|
-
format: 'esm',
|
|
89
|
-
// Inline all node_modules to prevent lazy dynamic imports for CJS modules
|
|
90
|
-
manualChunks: undefined,
|
|
91
|
-
}},
|
|
92
|
-
}},
|
|
93
|
-
target: 'esnext',
|
|
94
|
-
}},
|
|
95
|
-
define: {{
|
|
96
|
-
global: 'globalThis',
|
|
97
|
-
__DEV__: 'false',
|
|
98
|
-
'process.env.NODE_ENV': '"production"',
|
|
99
|
-
}},
|
|
100
|
-
esbuild: {{
|
|
101
|
-
// Force production JSX runtime
|
|
102
|
-
jsx: 'automatic',
|
|
103
|
-
jsxImportSource: 'react',
|
|
104
|
-
// CRITICAL: Disable development JSX (jsxDEV) for Vite 8 + Rolldown compatibility
|
|
105
|
-
jsxDev: false,
|
|
106
|
-
}},
|
|
107
|
-
optimizeDeps: {{
|
|
108
|
-
include: [
|
|
109
|
-
'react',
|
|
110
|
-
'react-dom',
|
|
111
|
-
'react-dom/client',
|
|
112
|
-
'react/jsx-runtime',
|
|
113
|
-
'@tanstack/react-query',
|
|
114
|
-
// Internal packages (auto-generated)
|
|
115
|
-
{optimize_deps_include}
|
|
116
|
-
],
|
|
117
|
-
esbuildOptions: {{
|
|
118
|
-
format: 'esm',
|
|
119
|
-
target: 'esnext',
|
|
120
|
-
// Use production JSX runtime
|
|
121
|
-
jsx: 'automatic',
|
|
122
|
-
jsxImportSource: 'react',
|
|
123
|
-
jsxDev: false,
|
|
124
|
-
}},
|
|
125
|
-
}},
|
|
126
|
-
plugins: [
|
|
127
|
-
react({{
|
|
128
|
-
// Force automatic JSX runtime in production mode
|
|
129
|
-
jsxRuntime: 'automatic',
|
|
130
|
-
jsxImportSource: 'react',
|
|
131
|
-
}}),
|
|
132
|
-
],
|
|
133
|
-
resolve: {{
|
|
134
|
-
alias: {{
|
|
135
|
-
// 🎯 IMPORTANT: Order matters! More specific aliases must come FIRST
|
|
136
|
-
'@/autogenerated': resolve(__dirname),
|
|
137
|
-
'@': resolve(__dirname, '../src'),
|
|
138
|
-
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
139
|
-
// Force production JSX runtime - alias dev runtime to production runtime
|
|
140
|
-
'react/jsx-dev-runtime': 'react/jsx-runtime',
|
|
141
|
-
}},
|
|
142
|
-
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
143
|
-
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
144
|
-
}},
|
|
145
|
-
}});
|
|
146
|
-
"""
|
|
147
|
-
|
|
148
23
|
TEMPLATE_VITE_BACKEND_WITH_NODE = """{header}
|
|
149
24
|
import path from 'node:path';
|
|
150
25
|
import {{ VitePluginNode }} from 'vite-plugin-node';
|
|
@@ -555,137 +430,6 @@ export default defineConfig({{
|
|
|
555
430
|
}});
|
|
556
431
|
"""
|
|
557
432
|
|
|
558
|
-
TEMPLATE_VITE_FRONTEND_DEV = """{header}
|
|
559
|
-
import {{ resolve }} from 'node:path';
|
|
560
|
-
import react from '@vitejs/plugin-react';
|
|
561
|
-
import {{ defineConfig }} from 'vite';
|
|
562
|
-
|
|
563
|
-
export default defineConfig({{
|
|
564
|
-
mode: 'development',
|
|
565
|
-
base: '{base_path}',
|
|
566
|
-
build: {{
|
|
567
|
-
cssCodeSplit: false,
|
|
568
|
-
minify: false,
|
|
569
|
-
modulePreload: false,
|
|
570
|
-
rollupOptions: {{
|
|
571
|
-
output: {{
|
|
572
|
-
entryFileNames: '[name].js',
|
|
573
|
-
format: 'esm',
|
|
574
|
-
}},
|
|
575
|
-
}},
|
|
576
|
-
target: 'esnext',
|
|
577
|
-
}},
|
|
578
|
-
define: {{
|
|
579
|
-
global: 'globalThis',
|
|
580
|
-
__DEV__: 'true',
|
|
581
|
-
'process.env.NODE_ENV': '"development"',
|
|
582
|
-
}},
|
|
583
|
-
optimizeDeps: {{
|
|
584
|
-
include: [
|
|
585
|
-
'react',
|
|
586
|
-
'react-dom',
|
|
587
|
-
'react-dom/client',
|
|
588
|
-
'react/jsx-runtime',
|
|
589
|
-
'@tanstack/react-query',
|
|
590
|
-
{optimize_deps_include}
|
|
591
|
-
],
|
|
592
|
-
}},
|
|
593
|
-
plugins: [
|
|
594
|
-
react({{
|
|
595
|
-
jsxRuntime: 'automatic',
|
|
596
|
-
}}),
|
|
597
|
-
],
|
|
598
|
-
preview: {{
|
|
599
|
-
host: '0.0.0.0',
|
|
600
|
-
port: {port},
|
|
601
|
-
}},
|
|
602
|
-
resolve: {{
|
|
603
|
-
alias: {{
|
|
604
|
-
// 🎯 IMPORTANT: Order matters! More specific aliases must come FIRST
|
|
605
|
-
'@/autogenerated': resolve(__dirname),
|
|
606
|
-
'@': resolve(__dirname, '../src'),
|
|
607
|
-
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
608
|
-
}},
|
|
609
|
-
}},
|
|
610
|
-
server: {{
|
|
611
|
-
host: '0.0.0.0',
|
|
612
|
-
port: {port},
|
|
613
|
-
hmr: {{
|
|
614
|
-
port: {hmr_port},
|
|
615
|
-
}},
|
|
616
|
-
{proxy_config}
|
|
617
|
-
}},
|
|
618
|
-
}});
|
|
619
|
-
"""
|
|
620
|
-
|
|
621
|
-
TEMPLATE_VITE_FRONTEND_PROD = """{header}
|
|
622
|
-
import {{ resolve }} from 'node:path';
|
|
623
|
-
import react from '@vitejs/plugin-react';
|
|
624
|
-
import {{ defineConfig }} from 'vite';
|
|
625
|
-
|
|
626
|
-
export default defineConfig({{
|
|
627
|
-
mode: 'production',
|
|
628
|
-
base: '{base_path}',
|
|
629
|
-
build: {{
|
|
630
|
-
cssCodeSplit: false,
|
|
631
|
-
minify: true,
|
|
632
|
-
modulePreload: false,
|
|
633
|
-
rollupOptions: {{
|
|
634
|
-
output: {{
|
|
635
|
-
entryFileNames: '[name].js',
|
|
636
|
-
format: 'esm',
|
|
637
|
-
manualChunks: undefined,
|
|
638
|
-
}},
|
|
639
|
-
}},
|
|
640
|
-
target: 'esnext',
|
|
641
|
-
}},
|
|
642
|
-
define: {{
|
|
643
|
-
global: 'globalThis',
|
|
644
|
-
__DEV__: 'false',
|
|
645
|
-
'process.env.NODE_ENV': '"production"',
|
|
646
|
-
}},
|
|
647
|
-
esbuild: {{
|
|
648
|
-
jsx: 'automatic',
|
|
649
|
-
jsxImportSource: 'react',
|
|
650
|
-
jsxDev: false,
|
|
651
|
-
}},
|
|
652
|
-
optimizeDeps: {{
|
|
653
|
-
include: [
|
|
654
|
-
'react',
|
|
655
|
-
'react-dom',
|
|
656
|
-
'react-dom/client',
|
|
657
|
-
'react/jsx-runtime',
|
|
658
|
-
'@tanstack/react-query',
|
|
659
|
-
{optimize_deps_include}
|
|
660
|
-
],
|
|
661
|
-
esbuildOptions: {{
|
|
662
|
-
format: 'esm',
|
|
663
|
-
target: 'esnext',
|
|
664
|
-
jsx: 'automatic',
|
|
665
|
-
jsxImportSource: 'react',
|
|
666
|
-
jsxDev: false,
|
|
667
|
-
}},
|
|
668
|
-
}},
|
|
669
|
-
plugins: [
|
|
670
|
-
react({{
|
|
671
|
-
jsxRuntime: 'automatic',
|
|
672
|
-
jsxImportSource: 'react',
|
|
673
|
-
}}),
|
|
674
|
-
],
|
|
675
|
-
resolve: {{
|
|
676
|
-
alias: {{
|
|
677
|
-
// 🎯 IMPORTANT: Order matters! More specific aliases must come FIRST
|
|
678
|
-
'@/autogenerated': resolve(__dirname),
|
|
679
|
-
'@': resolve(__dirname, '../src'),
|
|
680
|
-
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
681
|
-
'react/jsx-dev-runtime': 'react/jsx-runtime',
|
|
682
|
-
}},
|
|
683
|
-
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
684
|
-
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
685
|
-
}},
|
|
686
|
-
}});
|
|
687
|
-
"""
|
|
688
|
-
|
|
689
433
|
# =============================================================================
|
|
690
434
|
# Template Generation Functions
|
|
691
435
|
# =============================================================================
|
|
@@ -708,30 +452,3 @@ def get_library_template(environment = 'production'):
|
|
|
708
452
|
else:
|
|
709
453
|
# Default to production for safety
|
|
710
454
|
return TEMPLATE_VITE_LIBRARY_PROD
|
|
711
|
-
|
|
712
|
-
def get_frontend_template(environment = 'production'):
|
|
713
|
-
"""
|
|
714
|
-
Get the appropriate frontend template based on environment.
|
|
715
|
-
|
|
716
|
-
Args:
|
|
717
|
-
environment: 'development', 'production', or 'dev'/'prod' shortcuts
|
|
718
|
-
|
|
719
|
-
Returns:
|
|
720
|
-
Template string for the specified environment
|
|
721
|
-
"""
|
|
722
|
-
env = environment.lower()
|
|
723
|
-
if env in ['development', 'dev']:
|
|
724
|
-
return TEMPLATE_VITE_FRONTEND_DEV
|
|
725
|
-
elif env in ['production', 'prod']:
|
|
726
|
-
return TEMPLATE_VITE_FRONTEND_PROD
|
|
727
|
-
else:
|
|
728
|
-
# Default to production for safety
|
|
729
|
-
return TEMPLATE_VITE_FRONTEND_PROD
|
|
730
|
-
|
|
731
|
-
def get_frontend_build_template(environment = 'production'):
|
|
732
|
-
"""
|
|
733
|
-
Get the appropriate frontend build template based on environment.
|
|
734
|
-
|
|
735
|
-
This is an alias for get_frontend_template since they serve the same purpose.
|
|
736
|
-
"""
|
|
737
|
-
return get_frontend_template(environment)
|
|
@@ -400,10 +400,16 @@ def _generate_all_configs_for_resource(
|
|
|
400
400
|
# Docker builds: Resolve from node_modules (packages must be published)
|
|
401
401
|
|
|
402
402
|
# Docker tsconfig: NO path aliases to internal deps
|
|
403
|
-
TSConfig.frontend(
|
|
403
|
+
TSConfig.frontend(
|
|
404
|
+
resource_path, write_file, internal_deps=None, is_docker=True,
|
|
405
|
+
framework=manifest.get('framework', 'react'),
|
|
406
|
+
)
|
|
404
407
|
|
|
405
408
|
# Local tsconfig: CAN use path aliases to internal deps
|
|
406
|
-
TSConfig.frontend(
|
|
409
|
+
TSConfig.frontend(
|
|
410
|
+
resource_path, write_file, internal_deps=internal_deps_map, is_docker=False,
|
|
411
|
+
framework=manifest.get('framework', 'react'),
|
|
412
|
+
)
|
|
407
413
|
else:
|
|
408
414
|
prisma_path = resource_config.get('prisma_client_path', './node_modules/.prisma/client')
|
|
409
415
|
resource_features = manifest.get('featuresEnabled', [])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdk-landscape/tdk-cli-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.75",
|
|
4
4
|
"description": "Run your whole microservice landscape locally without Kubernetes. Scaffold services and run them with hot reload, built on Tilt.",
|
|
5
5
|
"homepage": "https://tdk-landscape.github.io/tdk-website",
|
|
6
6
|
"repository": {
|