@tanstack/cta-ui 0.29.1 → 0.30.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.
- package/dist/assets/index-CQNNMRb1.css +1 -0
- package/dist/assets/index-DheH_mx5.js +333 -0
- package/dist/assets/index-DheH_mx5.js.map +1 -0
- package/dist/index.html +2 -2
- package/lib/engine-handling/add-to-app-wrapper.ts +2 -1
- package/lib/engine-handling/create-app-wrapper.ts +7 -4
- package/lib/engine-handling/file-helpers.ts +5 -3
- package/lib/engine-handling/generate-initial-payload.ts +5 -1
- package/lib-dist/engine-handling/add-to-app-wrapper.js +2 -1
- package/lib-dist/engine-handling/create-app-wrapper.js +4 -2
- package/lib-dist/engine-handling/file-helpers.d.ts +1 -1
- package/lib-dist/engine-handling/file-helpers.js +2 -2
- package/lib-dist/engine-handling/generate-initial-payload.js +1 -1
- package/package.json +3 -3
- package/vite.config.ts +4 -0
- package/dist/assets/index-Bj0ULjhK.js +0 -218
- package/dist/assets/index-Bj0ULjhK.js.map +0 -1
- package/dist/assets/index-rZsrUI6V.css +0 -1
package/dist/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
|
|
12
12
|
/>
|
|
13
13
|
<!-- PRELOAD-->
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DheH_mx5.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CQNNMRb1.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body class="dark">
|
|
18
18
|
<div id="root"></div>
|
|
@@ -129,7 +129,8 @@ export async function addToAppWrapper(
|
|
|
129
129
|
writeConfigFileToEnvironment(environment, options)
|
|
130
130
|
environment.finishRun()
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
// Preserve base64 content for WebContainer, FileViewer will display placeholders
|
|
133
|
+
output.files = cleanUpFiles(output.files, projectPath, true)
|
|
133
134
|
output.deletedFiles = cleanUpFileArray(output.deletedFiles, projectPath)
|
|
134
135
|
return output
|
|
135
136
|
}
|
|
@@ -65,9 +65,11 @@ export async function createAppWrapper(
|
|
|
65
65
|
starter,
|
|
66
66
|
framework,
|
|
67
67
|
chosenAddOns,
|
|
68
|
-
addOnOptions:
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
addOnOptions:
|
|
69
|
+
!projectOptions.addOnOptions ||
|
|
70
|
+
Object.keys(projectOptions.addOnOptions).length === 0
|
|
71
|
+
? populateAddOnOptionsDefaults(chosenAddOns)
|
|
72
|
+
: projectOptions.addOnOptions,
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
function createEnvironment() {
|
|
@@ -113,7 +115,8 @@ export async function createAppWrapper(
|
|
|
113
115
|
} else {
|
|
114
116
|
await createApp(environment, options)
|
|
115
117
|
|
|
116
|
-
|
|
118
|
+
// Preserve base64 content for WebContainer, FileViewer will display placeholders
|
|
119
|
+
output.files = cleanUpFiles(output.files, targetDir, true)
|
|
117
120
|
output.deletedFiles = cleanUpFileArray(output.deletedFiles, targetDir)
|
|
118
121
|
|
|
119
122
|
return output
|
|
@@ -5,11 +5,13 @@ import { CONFIG_FILE } from '@tanstack/cta-engine'
|
|
|
5
5
|
export function cleanUpFiles(
|
|
6
6
|
files: Record<string, string>,
|
|
7
7
|
targetDir?: string,
|
|
8
|
+
preserveBase64 = false,
|
|
8
9
|
) {
|
|
9
10
|
return Object.keys(files).reduce<Record<string, string>>((acc, file) => {
|
|
10
|
-
const content =
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const content =
|
|
12
|
+
files[file].startsWith('base64::') && !preserveBase64
|
|
13
|
+
? '<binary file>'
|
|
14
|
+
: files[file]
|
|
13
15
|
if (basename(file) !== CONFIG_FILE) {
|
|
14
16
|
acc[targetDir ? file.replace(targetDir, '.') : file] = content
|
|
15
17
|
}
|
|
@@ -45,7 +45,11 @@ export async function generateInitialPayload() {
|
|
|
45
45
|
|
|
46
46
|
const localFiles =
|
|
47
47
|
applicationMode === 'add'
|
|
48
|
-
? await cleanUpFiles(
|
|
48
|
+
? await cleanUpFiles(
|
|
49
|
+
await recursivelyGatherFiles(projectPath, false),
|
|
50
|
+
undefined,
|
|
51
|
+
true,
|
|
52
|
+
)
|
|
49
53
|
: {}
|
|
50
54
|
|
|
51
55
|
const forcedRouterMode = getForcedRouterMode()
|
|
@@ -72,7 +72,8 @@ export async function addToAppWrapper(addOns, opts) {
|
|
|
72
72
|
});
|
|
73
73
|
writeConfigFileToEnvironment(environment, options);
|
|
74
74
|
environment.finishRun();
|
|
75
|
-
|
|
75
|
+
// Preserve base64 content for WebContainer, FileViewer will display placeholders
|
|
76
|
+
output.files = cleanUpFiles(output.files, projectPath, true);
|
|
76
77
|
output.deletedFiles = cleanUpFileArray(output.deletedFiles, projectPath);
|
|
77
78
|
return output;
|
|
78
79
|
}
|
|
@@ -30,7 +30,8 @@ export async function createAppWrapper(projectOptions, opts) {
|
|
|
30
30
|
starter,
|
|
31
31
|
framework,
|
|
32
32
|
chosenAddOns,
|
|
33
|
-
addOnOptions:
|
|
33
|
+
addOnOptions: !projectOptions.addOnOptions ||
|
|
34
|
+
Object.keys(projectOptions.addOnOptions).length === 0
|
|
34
35
|
? populateAddOnOptionsDefaults(chosenAddOns)
|
|
35
36
|
: projectOptions.addOnOptions,
|
|
36
37
|
};
|
|
@@ -69,7 +70,8 @@ export async function createAppWrapper(projectOptions, opts) {
|
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
71
72
|
await createApp(environment, options);
|
|
72
|
-
|
|
73
|
+
// Preserve base64 content for WebContainer, FileViewer will display placeholders
|
|
74
|
+
output.files = cleanUpFiles(output.files, targetDir, true);
|
|
73
75
|
output.deletedFiles = cleanUpFileArray(output.deletedFiles, targetDir);
|
|
74
76
|
return output;
|
|
75
77
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function cleanUpFiles(files: Record<string, string>, targetDir?: string): Record<string, string>;
|
|
1
|
+
export declare function cleanUpFiles(files: Record<string, string>, targetDir?: string, preserveBase64?: boolean): Record<string, string>;
|
|
2
2
|
export declare function cleanUpFileArray(files: Array<string>, targetDir?: string): string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { basename } from 'node:path';
|
|
2
2
|
import { CONFIG_FILE } from '@tanstack/cta-engine';
|
|
3
|
-
export function cleanUpFiles(files, targetDir) {
|
|
3
|
+
export function cleanUpFiles(files, targetDir, preserveBase64 = false) {
|
|
4
4
|
return Object.keys(files).reduce((acc, file) => {
|
|
5
|
-
const content = files[file].startsWith('base64::')
|
|
5
|
+
const content = files[file].startsWith('base64::') && !preserveBase64
|
|
6
6
|
? '<binary file>'
|
|
7
7
|
: files[file];
|
|
8
8
|
if (basename(file) !== CONFIG_FILE) {
|
|
@@ -21,7 +21,7 @@ export async function generateInitialPayload() {
|
|
|
21
21
|
const projectPath = getProjectPath();
|
|
22
22
|
const applicationMode = getApplicationMode();
|
|
23
23
|
const localFiles = applicationMode === 'add'
|
|
24
|
-
? await cleanUpFiles(await recursivelyGatherFiles(projectPath, false))
|
|
24
|
+
? await cleanUpFiles(await recursivelyGatherFiles(projectPath, false), undefined, true)
|
|
25
25
|
: {};
|
|
26
26
|
const forcedRouterMode = getForcedRouterMode();
|
|
27
27
|
async function getSerializedOptions() {
|
package/package.json
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"tailwindcss": "^4.1.6",
|
|
18
18
|
"tailwindcss-animate": "^1.0.7",
|
|
19
19
|
"vite-tsconfig-paths": "^5.1.4",
|
|
20
|
-
"@tanstack/cta-
|
|
21
|
-
"@tanstack/cta-
|
|
20
|
+
"@tanstack/cta-ui-base": "0.30.0",
|
|
21
|
+
"@tanstack/cta-engine": "0.29.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@tailwindcss/typography": "^0.5.16",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"vitest": "^3.0.5",
|
|
38
38
|
"web-vitals": "^4.2.4"
|
|
39
39
|
},
|
|
40
|
-
"version": "0.
|
|
40
|
+
"version": "0.30.0",
|
|
41
41
|
"scripts": {}
|
|
42
42
|
}
|