@tdk-landscape/tdk-cli-core 1.3.86 → 1.3.88
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/CHANGELOG.md +6 -0
- package/README.md +22 -3
- package/cli/dist/backend-frameworks/express.js +50 -0
- package/cli/dist/backend-frameworks/registry.js +41 -0
- package/cli/dist/backend-frameworks/types.js +2 -0
- package/cli/dist/backend-languages/bun.js +53 -0
- package/cli/dist/backend-languages/python.js +89 -0
- package/cli/dist/backend-languages/registry.js +30 -0
- package/cli/dist/backend-languages/types.js +2 -0
- package/cli/dist/commands/resource.js +67 -51
- package/cli/dist/commands/up.js +1 -1
- package/cli/dist/frontend-frameworks/lit.js +65 -0
- package/cli/dist/frontend-frameworks/preact.js +63 -0
- package/cli/dist/frontend-frameworks/qwik.js +62 -0
- package/cli/dist/frontend-frameworks/registry.js +14 -3
- package/cli/dist/frontend-frameworks/solid.js +63 -0
- package/cli/dist/frontend-frameworks/svelte.js +68 -0
- package/cli/dist/utils/doctor-wiring.js +9 -1
- package/cli/dist/utils/service-manifest.js +2 -0
- package/cli/package.json +2 -2
- package/engine/schemas/service-schema.json +31 -4
- package/engine/topologies/platform/docker/compose/compose.star +9 -1
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +62 -0
- package/engine/topologies/platform/docker/index.star +7 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +10 -1
- package/engine/topologies/tilt/generators/validators.star +8 -4
- package/engine/topologies/tilt/generators/vite/frameworks/lit.star +90 -0
- package/engine/topologies/tilt/generators/vite/frameworks/preact.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/qwik.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/solid.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/svelte.star +92 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +25 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +31 -4
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +25 -6
- package/package.json +2 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Preact-specific Vite templates for frontend resources.
|
|
2
|
+
|
|
3
|
+
PREACT_VITE_FRONTEND = """{header}
|
|
4
|
+
import {{ resolve }} from 'node:path';
|
|
5
|
+
import preact from '@preact/preset-vite';
|
|
6
|
+
import {{ defineConfig }} from 'vite';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({{
|
|
9
|
+
base: '{base_path}',
|
|
10
|
+
build: {{
|
|
11
|
+
cssCodeSplit: false,
|
|
12
|
+
minify: false,
|
|
13
|
+
modulePreload: false,
|
|
14
|
+
rollupOptions: {{
|
|
15
|
+
output: {{
|
|
16
|
+
entryFileNames: '[name].js',
|
|
17
|
+
format: 'esm',
|
|
18
|
+
}},
|
|
19
|
+
}},
|
|
20
|
+
target: 'esnext',
|
|
21
|
+
}},
|
|
22
|
+
define: {{
|
|
23
|
+
global: 'globalThis',
|
|
24
|
+
}},
|
|
25
|
+
optimizeDeps: {{
|
|
26
|
+
include: [{optimize_deps_include}],
|
|
27
|
+
}},
|
|
28
|
+
plugins: [preact()],
|
|
29
|
+
preview: {{
|
|
30
|
+
host: '0.0.0.0',
|
|
31
|
+
port: {port},
|
|
32
|
+
}},
|
|
33
|
+
resolve: {{
|
|
34
|
+
alias: {{
|
|
35
|
+
'@/autogenerated': resolve(__dirname),
|
|
36
|
+
'@': resolve(__dirname, '../src'),
|
|
37
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
38
|
+
{internal_aliases}
|
|
39
|
+
}},
|
|
40
|
+
}},
|
|
41
|
+
server: {{
|
|
42
|
+
host: '0.0.0.0',
|
|
43
|
+
port: {port},
|
|
44
|
+
hmr: {{
|
|
45
|
+
port: {hmr_port},
|
|
46
|
+
}},
|
|
47
|
+
{proxy_config}
|
|
48
|
+
}},
|
|
49
|
+
}});
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
PREACT_VITE_FRONTEND_BUILD = """{header}
|
|
53
|
+
import {{ resolve }} from 'node:path';
|
|
54
|
+
import preact from '@preact/preset-vite';
|
|
55
|
+
import {{ defineConfig }} from 'vite';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({{
|
|
58
|
+
mode: 'production',
|
|
59
|
+
base: '{base_path}',
|
|
60
|
+
build: {{
|
|
61
|
+
cssCodeSplit: false,
|
|
62
|
+
minify: true,
|
|
63
|
+
modulePreload: false,
|
|
64
|
+
rollupOptions: {{
|
|
65
|
+
output: {{
|
|
66
|
+
entryFileNames: '[name].js',
|
|
67
|
+
format: 'esm',
|
|
68
|
+
manualChunks: undefined,
|
|
69
|
+
}},
|
|
70
|
+
}},
|
|
71
|
+
target: 'esnext',
|
|
72
|
+
}},
|
|
73
|
+
define: {{
|
|
74
|
+
global: 'globalThis',
|
|
75
|
+
__DEV__: 'false',
|
|
76
|
+
'process.env.NODE_ENV': '"production"',
|
|
77
|
+
}},
|
|
78
|
+
optimizeDeps: {{
|
|
79
|
+
include: [{optimize_deps_include}],
|
|
80
|
+
}},
|
|
81
|
+
plugins: [preact()],
|
|
82
|
+
resolve: {{
|
|
83
|
+
alias: {{
|
|
84
|
+
'@/autogenerated': resolve(__dirname),
|
|
85
|
+
'@': resolve(__dirname, '../src'),
|
|
86
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
87
|
+
}},
|
|
88
|
+
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
89
|
+
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
90
|
+
}},
|
|
91
|
+
}});
|
|
92
|
+
"""
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Qwik-specific Vite templates for frontend resources.
|
|
2
|
+
|
|
3
|
+
QWIK_VITE_FRONTEND = """{header}
|
|
4
|
+
import {{ resolve }} from 'node:path';
|
|
5
|
+
import {{ qwikVite }} from '@builder.io/qwik/optimizer';
|
|
6
|
+
import {{ defineConfig }} from 'vite';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({{
|
|
9
|
+
base: '{base_path}',
|
|
10
|
+
build: {{
|
|
11
|
+
cssCodeSplit: false,
|
|
12
|
+
minify: false,
|
|
13
|
+
modulePreload: false,
|
|
14
|
+
rollupOptions: {{
|
|
15
|
+
output: {{
|
|
16
|
+
entryFileNames: '[name].js',
|
|
17
|
+
format: 'esm',
|
|
18
|
+
}},
|
|
19
|
+
}},
|
|
20
|
+
target: 'esnext',
|
|
21
|
+
}},
|
|
22
|
+
define: {{
|
|
23
|
+
global: 'globalThis',
|
|
24
|
+
}},
|
|
25
|
+
optimizeDeps: {{
|
|
26
|
+
include: [{optimize_deps_include}],
|
|
27
|
+
}},
|
|
28
|
+
plugins: [qwikVite({{ csr: true }})],
|
|
29
|
+
preview: {{
|
|
30
|
+
host: '0.0.0.0',
|
|
31
|
+
port: {port},
|
|
32
|
+
}},
|
|
33
|
+
resolve: {{
|
|
34
|
+
alias: {{
|
|
35
|
+
'@/autogenerated': resolve(__dirname),
|
|
36
|
+
'@': resolve(__dirname, '../src'),
|
|
37
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
38
|
+
{internal_aliases}
|
|
39
|
+
}},
|
|
40
|
+
}},
|
|
41
|
+
server: {{
|
|
42
|
+
host: '0.0.0.0',
|
|
43
|
+
port: {port},
|
|
44
|
+
hmr: {{
|
|
45
|
+
port: {hmr_port},
|
|
46
|
+
}},
|
|
47
|
+
{proxy_config}
|
|
48
|
+
}},
|
|
49
|
+
}});
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
QWIK_VITE_FRONTEND_BUILD = """{header}
|
|
53
|
+
import {{ resolve }} from 'node:path';
|
|
54
|
+
import {{ qwikVite }} from '@builder.io/qwik/optimizer';
|
|
55
|
+
import {{ defineConfig }} from 'vite';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({{
|
|
58
|
+
mode: 'production',
|
|
59
|
+
base: '{base_path}',
|
|
60
|
+
build: {{
|
|
61
|
+
cssCodeSplit: false,
|
|
62
|
+
minify: true,
|
|
63
|
+
modulePreload: false,
|
|
64
|
+
rollupOptions: {{
|
|
65
|
+
output: {{
|
|
66
|
+
entryFileNames: '[name].js',
|
|
67
|
+
format: 'esm',
|
|
68
|
+
manualChunks: undefined,
|
|
69
|
+
}},
|
|
70
|
+
}},
|
|
71
|
+
target: 'esnext',
|
|
72
|
+
}},
|
|
73
|
+
define: {{
|
|
74
|
+
global: 'globalThis',
|
|
75
|
+
__DEV__: 'false',
|
|
76
|
+
'process.env.NODE_ENV': '"production"',
|
|
77
|
+
}},
|
|
78
|
+
optimizeDeps: {{
|
|
79
|
+
include: [{optimize_deps_include}],
|
|
80
|
+
}},
|
|
81
|
+
plugins: [qwikVite({{ csr: true }})],
|
|
82
|
+
resolve: {{
|
|
83
|
+
alias: {{
|
|
84
|
+
'@/autogenerated': resolve(__dirname),
|
|
85
|
+
'@': resolve(__dirname, '../src'),
|
|
86
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
87
|
+
}},
|
|
88
|
+
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
89
|
+
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
90
|
+
}},
|
|
91
|
+
}});
|
|
92
|
+
"""
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Solid-specific Vite templates for frontend resources.
|
|
2
|
+
|
|
3
|
+
SOLID_VITE_FRONTEND = """{header}
|
|
4
|
+
import {{ resolve }} from 'node:path';
|
|
5
|
+
import solid from 'vite-plugin-solid';
|
|
6
|
+
import {{ defineConfig }} from 'vite';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({{
|
|
9
|
+
base: '{base_path}',
|
|
10
|
+
build: {{
|
|
11
|
+
cssCodeSplit: false,
|
|
12
|
+
minify: false,
|
|
13
|
+
modulePreload: false,
|
|
14
|
+
rollupOptions: {{
|
|
15
|
+
output: {{
|
|
16
|
+
entryFileNames: '[name].js',
|
|
17
|
+
format: 'esm',
|
|
18
|
+
}},
|
|
19
|
+
}},
|
|
20
|
+
target: 'esnext',
|
|
21
|
+
}},
|
|
22
|
+
define: {{
|
|
23
|
+
global: 'globalThis',
|
|
24
|
+
}},
|
|
25
|
+
optimizeDeps: {{
|
|
26
|
+
include: [{optimize_deps_include}],
|
|
27
|
+
}},
|
|
28
|
+
plugins: [solid()],
|
|
29
|
+
preview: {{
|
|
30
|
+
host: '0.0.0.0',
|
|
31
|
+
port: {port},
|
|
32
|
+
}},
|
|
33
|
+
resolve: {{
|
|
34
|
+
alias: {{
|
|
35
|
+
'@/autogenerated': resolve(__dirname),
|
|
36
|
+
'@': resolve(__dirname, '../src'),
|
|
37
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
38
|
+
{internal_aliases}
|
|
39
|
+
}},
|
|
40
|
+
}},
|
|
41
|
+
server: {{
|
|
42
|
+
host: '0.0.0.0',
|
|
43
|
+
port: {port},
|
|
44
|
+
hmr: {{
|
|
45
|
+
port: {hmr_port},
|
|
46
|
+
}},
|
|
47
|
+
{proxy_config}
|
|
48
|
+
}},
|
|
49
|
+
}});
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
SOLID_VITE_FRONTEND_BUILD = """{header}
|
|
53
|
+
import {{ resolve }} from 'node:path';
|
|
54
|
+
import solid from 'vite-plugin-solid';
|
|
55
|
+
import {{ defineConfig }} from 'vite';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({{
|
|
58
|
+
mode: 'production',
|
|
59
|
+
base: '{base_path}',
|
|
60
|
+
build: {{
|
|
61
|
+
cssCodeSplit: false,
|
|
62
|
+
minify: true,
|
|
63
|
+
modulePreload: false,
|
|
64
|
+
rollupOptions: {{
|
|
65
|
+
output: {{
|
|
66
|
+
entryFileNames: '[name].js',
|
|
67
|
+
format: 'esm',
|
|
68
|
+
manualChunks: undefined,
|
|
69
|
+
}},
|
|
70
|
+
}},
|
|
71
|
+
target: 'esnext',
|
|
72
|
+
}},
|
|
73
|
+
define: {{
|
|
74
|
+
global: 'globalThis',
|
|
75
|
+
__DEV__: 'false',
|
|
76
|
+
'process.env.NODE_ENV': '"production"',
|
|
77
|
+
}},
|
|
78
|
+
optimizeDeps: {{
|
|
79
|
+
include: [{optimize_deps_include}],
|
|
80
|
+
}},
|
|
81
|
+
plugins: [solid()],
|
|
82
|
+
resolve: {{
|
|
83
|
+
alias: {{
|
|
84
|
+
'@/autogenerated': resolve(__dirname),
|
|
85
|
+
'@': resolve(__dirname, '../src'),
|
|
86
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
87
|
+
}},
|
|
88
|
+
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
89
|
+
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
90
|
+
}},
|
|
91
|
+
}});
|
|
92
|
+
"""
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Svelte-specific Vite templates for frontend resources.
|
|
2
|
+
|
|
3
|
+
SVELTE_VITE_FRONTEND = """{header}
|
|
4
|
+
import {{ resolve }} from 'node:path';
|
|
5
|
+
import {{ svelte }} from '@sveltejs/vite-plugin-svelte';
|
|
6
|
+
import {{ defineConfig }} from 'vite';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({{
|
|
9
|
+
base: '{base_path}',
|
|
10
|
+
build: {{
|
|
11
|
+
cssCodeSplit: false,
|
|
12
|
+
minify: false,
|
|
13
|
+
modulePreload: false,
|
|
14
|
+
rollupOptions: {{
|
|
15
|
+
output: {{
|
|
16
|
+
entryFileNames: '[name].js',
|
|
17
|
+
format: 'esm',
|
|
18
|
+
}},
|
|
19
|
+
}},
|
|
20
|
+
target: 'esnext',
|
|
21
|
+
}},
|
|
22
|
+
define: {{
|
|
23
|
+
global: 'globalThis',
|
|
24
|
+
}},
|
|
25
|
+
optimizeDeps: {{
|
|
26
|
+
include: [{optimize_deps_include}],
|
|
27
|
+
}},
|
|
28
|
+
plugins: [svelte()],
|
|
29
|
+
preview: {{
|
|
30
|
+
host: '0.0.0.0',
|
|
31
|
+
port: {port},
|
|
32
|
+
}},
|
|
33
|
+
resolve: {{
|
|
34
|
+
alias: {{
|
|
35
|
+
'@/autogenerated': resolve(__dirname),
|
|
36
|
+
'@': resolve(__dirname, '../src'),
|
|
37
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
38
|
+
{internal_aliases}
|
|
39
|
+
}},
|
|
40
|
+
}},
|
|
41
|
+
server: {{
|
|
42
|
+
host: '0.0.0.0',
|
|
43
|
+
port: {port},
|
|
44
|
+
hmr: {{
|
|
45
|
+
port: {hmr_port},
|
|
46
|
+
}},
|
|
47
|
+
{proxy_config}
|
|
48
|
+
}},
|
|
49
|
+
}});
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
SVELTE_VITE_FRONTEND_BUILD = """{header}
|
|
53
|
+
import {{ resolve }} from 'node:path';
|
|
54
|
+
import {{ svelte }} from '@sveltejs/vite-plugin-svelte';
|
|
55
|
+
import {{ defineConfig }} from 'vite';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({{
|
|
58
|
+
mode: 'production',
|
|
59
|
+
base: '{base_path}',
|
|
60
|
+
build: {{
|
|
61
|
+
cssCodeSplit: false,
|
|
62
|
+
minify: true,
|
|
63
|
+
modulePreload: false,
|
|
64
|
+
rollupOptions: {{
|
|
65
|
+
output: {{
|
|
66
|
+
entryFileNames: '[name].js',
|
|
67
|
+
format: 'esm',
|
|
68
|
+
manualChunks: undefined,
|
|
69
|
+
}},
|
|
70
|
+
}},
|
|
71
|
+
target: 'esnext',
|
|
72
|
+
}},
|
|
73
|
+
define: {{
|
|
74
|
+
global: 'globalThis',
|
|
75
|
+
__DEV__: 'false',
|
|
76
|
+
'process.env.NODE_ENV': '"production"',
|
|
77
|
+
}},
|
|
78
|
+
optimizeDeps: {{
|
|
79
|
+
include: [{optimize_deps_include}],
|
|
80
|
+
}},
|
|
81
|
+
plugins: [svelte()],
|
|
82
|
+
resolve: {{
|
|
83
|
+
alias: {{
|
|
84
|
+
'@/autogenerated': resolve(__dirname),
|
|
85
|
+
'@': resolve(__dirname, '../src'),
|
|
86
|
+
'set-cookie-parser': resolve(__dirname, '../src/utils/empty-module.js'),
|
|
87
|
+
}},
|
|
88
|
+
conditions: ['browser', 'import', 'module', 'es2020', 'default'],
|
|
89
|
+
mainFields: ['browser', 'module', 'jsnext:main', 'jsnext', 'main'],
|
|
90
|
+
}},
|
|
91
|
+
}});
|
|
92
|
+
"""
|
|
@@ -17,6 +17,11 @@ load('../../../../topologies/tilt/manifest/constants.star', 'GENERATED_CONFIG_FI
|
|
|
17
17
|
|
|
18
18
|
load('./frameworks/react.star', 'REACT_VITE_FRONTEND', 'REACT_VITE_FRONTEND_BUILD')
|
|
19
19
|
load('./frameworks/vue.star', 'VUE_VITE_FRONTEND', 'VUE_VITE_FRONTEND_BUILD')
|
|
20
|
+
load('./frameworks/svelte.star', 'SVELTE_VITE_FRONTEND', 'SVELTE_VITE_FRONTEND_BUILD')
|
|
21
|
+
load('./frameworks/preact.star', 'PREACT_VITE_FRONTEND', 'PREACT_VITE_FRONTEND_BUILD')
|
|
22
|
+
load('./frameworks/lit.star', 'LIT_VITE_FRONTEND', 'LIT_VITE_FRONTEND_BUILD')
|
|
23
|
+
load('./frameworks/solid.star', 'SOLID_VITE_FRONTEND', 'SOLID_VITE_FRONTEND_BUILD')
|
|
24
|
+
load('./frameworks/qwik.star', 'QWIK_VITE_FRONTEND', 'QWIK_VITE_FRONTEND_BUILD')
|
|
20
25
|
load('../../../platform/docker/networking/api_path_constants.star', 'get_frontend_base_path')
|
|
21
26
|
load('./helpers.star',
|
|
22
27
|
'build_header',
|
|
@@ -38,6 +43,26 @@ _FRAMEWORK_TEMPLATES = {
|
|
|
38
43
|
'dev': VUE_VITE_FRONTEND,
|
|
39
44
|
'build': VUE_VITE_FRONTEND_BUILD,
|
|
40
45
|
},
|
|
46
|
+
'svelte': {
|
|
47
|
+
'dev': SVELTE_VITE_FRONTEND,
|
|
48
|
+
'build': SVELTE_VITE_FRONTEND_BUILD,
|
|
49
|
+
},
|
|
50
|
+
'preact': {
|
|
51
|
+
'dev': PREACT_VITE_FRONTEND,
|
|
52
|
+
'build': PREACT_VITE_FRONTEND_BUILD,
|
|
53
|
+
},
|
|
54
|
+
'lit': {
|
|
55
|
+
'dev': LIT_VITE_FRONTEND,
|
|
56
|
+
'build': LIT_VITE_FRONTEND_BUILD,
|
|
57
|
+
},
|
|
58
|
+
'solid': {
|
|
59
|
+
'dev': SOLID_VITE_FRONTEND,
|
|
60
|
+
'build': SOLID_VITE_FRONTEND_BUILD,
|
|
61
|
+
},
|
|
62
|
+
'qwik': {
|
|
63
|
+
'dev': QWIK_VITE_FRONTEND,
|
|
64
|
+
'build': QWIK_VITE_FRONTEND_BUILD,
|
|
65
|
+
},
|
|
41
66
|
}
|
|
42
67
|
|
|
43
68
|
def _normalize_vite_base_path(base_path):
|
package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star
CHANGED
|
@@ -201,14 +201,39 @@ def _register_replicas(config, auto_init_apps):
|
|
|
201
201
|
)
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
def
|
|
205
|
-
"""
|
|
204
|
+
def _live_update_sync_source(project_root, full_res_path, sync_path):
|
|
205
|
+
"""Local path Tilt watches for a live-update sync.
|
|
206
|
+
|
|
207
|
+
Tilt resolves sync() local paths against the Tiltfile directory (.tdk/.tdk-out), not
|
|
208
|
+
the docker_build context, so a project-relative path never matches the changed files
|
|
209
|
+
and every edit falls back to a full image rebuild ("Found file(s) not matching any
|
|
210
|
+
sync"). Anchor it at the project root, like the Dockerfile and build context.
|
|
211
|
+
"""
|
|
212
|
+
relative_path = full_res_path + '/' + sync_path
|
|
213
|
+
if project_root:
|
|
214
|
+
return project_root.rstrip('/') + '/' + relative_path
|
|
215
|
+
return relative_path
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def _build_live_update_rules(res_path, full_res_path, syncs, project_root='', language='bun'):
|
|
219
|
+
"""Build live update sync and run rules for a resource.
|
|
220
|
+
|
|
221
|
+
Python backends reload their own process after a sync (uvicorn --reload), so they have
|
|
222
|
+
no Bun install step. A changed pyproject.toml is not synced, so Tilt rebuilds the image instead.
|
|
223
|
+
"""
|
|
206
224
|
live_update_rules = []
|
|
207
225
|
for sync_path in syncs:
|
|
208
|
-
|
|
226
|
+
# Python images never read the npm/Bun registry config, and the engine does not
|
|
227
|
+
# generate it for provider-owned languages, so there is nothing to sync.
|
|
228
|
+
if language == 'python' and (sync_path.endswith('.npmrc.docker.autogenerated') or sync_path.endswith('bunfig.docker.autogenerated.toml')):
|
|
229
|
+
continue
|
|
230
|
+
full_sync_path = _live_update_sync_source(project_root, full_res_path, sync_path)
|
|
209
231
|
dest = '/app/' + full_res_path + '/' + sync_path
|
|
210
232
|
live_update_rules.append(sync(full_sync_path, dest))
|
|
211
233
|
|
|
234
|
+
if language == 'python':
|
|
235
|
+
return live_update_rules
|
|
236
|
+
|
|
212
237
|
package_json_path = '/app/' + full_res_path + '/package.json'
|
|
213
238
|
bun_lock_path = '/app/' + full_res_path + '/bun.lock'
|
|
214
239
|
live_update_rules.append(run('cd /app/' + full_res_path + ' && bun install',
|
|
@@ -373,7 +398,9 @@ def _register_single_resource(config, resource_path, compose_project_name, auto_
|
|
|
373
398
|
live_update_rules = _build_live_update_rules(
|
|
374
399
|
config['res_path'],
|
|
375
400
|
config['res_path'],
|
|
376
|
-
config['syncs']
|
|
401
|
+
config['syncs'],
|
|
402
|
+
project_root=config.get('project_root', ''),
|
|
403
|
+
language=config.get('manifest', {}).get('language', 'bun'),
|
|
377
404
|
)
|
|
378
405
|
_register_docker_build(config, live_update_rules)
|
|
379
406
|
if defers_start:
|
|
@@ -310,6 +310,18 @@ def _generate_all_configs_for_resource(
|
|
|
310
310
|
|
|
311
311
|
app_type = manifest.get('appType', 'backend')
|
|
312
312
|
is_frontend = resource_config.get('frontend', False) or app_type == 'frontend'
|
|
313
|
+
# Python backends own their runtime files (package/pyproject, Dockerfile,
|
|
314
|
+
# reload command). Bun-only configs below (Vite, tsconfig, Prisma, bunfig) are skipped.
|
|
315
|
+
provider_owned = Docker.is_provider_owned_language(manifest)
|
|
316
|
+
if provider_owned:
|
|
317
|
+
# Fail before generating anything, with the missing file named, instead of a Docker
|
|
318
|
+
# COPY error halfway through the image build.
|
|
319
|
+
root = ctx.get('project_root', '')
|
|
320
|
+
prefix = (root.rstrip('/') + '/' if root else '') + resource_path + '/'
|
|
321
|
+
for required in ['pyproject.toml', 'src/main.py']:
|
|
322
|
+
if not os.path.exists(prefix + required):
|
|
323
|
+
fail("{}: language '{}' requires {} but {}{} does not exist".format(
|
|
324
|
+
resource_name, manifest.get('language'), required, resource_path + '/', required))
|
|
313
325
|
|
|
314
326
|
# ==========================================================================
|
|
315
327
|
# 1. VITE CONFIG
|
|
@@ -319,7 +331,7 @@ def _generate_all_configs_for_resource(
|
|
|
319
331
|
Vite.for_manifest(manifest, backend_manifest, write_file)
|
|
320
332
|
else:
|
|
321
333
|
Vite.for_manifest(manifest, None, write_file)
|
|
322
|
-
elif app_type == 'backend':
|
|
334
|
+
elif app_type == 'backend' and not provider_owned:
|
|
323
335
|
Vite.for_manifest(manifest, None, write_file)
|
|
324
336
|
elif app_type == 'sdk':
|
|
325
337
|
Vite.for_manifest(manifest, None, write_file)
|
|
@@ -365,6 +377,12 @@ def _generate_all_configs_for_resource(
|
|
|
365
377
|
use_nginx=use_nginx,
|
|
366
378
|
use_golden=should_enable('golden-image')
|
|
367
379
|
)
|
|
380
|
+
elif provider_owned:
|
|
381
|
+
dockerfile_content = Docker.backend_language(
|
|
382
|
+
res_path=resource_path,
|
|
383
|
+
language=manifest.get('language'),
|
|
384
|
+
port=manifest.get('port', 4000),
|
|
385
|
+
)
|
|
368
386
|
else:
|
|
369
387
|
dockerfile_content = Docker.backend(
|
|
370
388
|
res_path=resource_path,
|
|
@@ -419,7 +437,7 @@ def _generate_all_configs_for_resource(
|
|
|
419
437
|
resource_path, write_file, internal_deps=internal_deps_map, is_docker=False,
|
|
420
438
|
framework=manifest.get('framework', 'react'),
|
|
421
439
|
)
|
|
422
|
-
|
|
440
|
+
elif not provider_owned:
|
|
423
441
|
prisma_path = resource_config.get('prisma_client_path', './node_modules/.prisma/client')
|
|
424
442
|
resource_features = manifest.get('featuresEnabled', [])
|
|
425
443
|
TSConfig.backend(resource_path, prisma_path, write_file, internal_deps=internal_deps_map, is_docker=True, features=resource_features)
|
|
@@ -434,10 +452,11 @@ def _generate_all_configs_for_resource(
|
|
|
434
452
|
# 8. PACKAGE CONFIGS (npmrc, bunfig)
|
|
435
453
|
# ==========================================================================
|
|
436
454
|
verdaccio_enabled = global_config.get('verdaccio_enabled', True)
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
455
|
+
if not provider_owned:
|
|
456
|
+
PackageConfig.npmrc(resource_path=resource_path, registry_url=global_config['verdaccio_url_docker'], is_docker=True, write_fn=write_file, verdaccio_enabled=verdaccio_enabled)
|
|
457
|
+
PackageConfig.bunfig(resource_path=resource_path, registry_url=global_config['verdaccio_url_docker'], is_docker=True, write_fn=write_file, verdaccio_enabled=verdaccio_enabled)
|
|
458
|
+
PackageConfig.npmrc(resource_path=resource_path, registry_url=global_config['verdaccio_url_local'], is_docker=False, write_fn=write_file, verdaccio_enabled=verdaccio_enabled)
|
|
459
|
+
PackageConfig.bunfig(resource_path=resource_path, registry_url=global_config['verdaccio_url_local'], is_docker=False, write_fn=write_file, verdaccio_enabled=verdaccio_enabled)
|
|
441
460
|
|
|
442
461
|
# ==========================================================================
|
|
443
462
|
# 9. YAML MANIFEST (for verification)
|
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.88",
|
|
4
4
|
"description": "TDK CLI — start services on your laptop.",
|
|
5
5
|
"homepage": "https://tdk-landscape.github.io/tdk-website",
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
],
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"chalk": "^
|
|
70
|
+
"chalk": "^6.0.1",
|
|
71
71
|
"commander": "^15.0.0",
|
|
72
72
|
"handlebars": "^4.7.8",
|
|
73
73
|
"ink": "^7.1.1",
|