@tanstack/cta-engine 0.46.2 → 0.47.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/CHANGELOG.md +9 -0
- package/dist/create-app.js +21 -9
- package/dist/custom-add-ons/add-on.js +5 -1
- package/dist/frameworks.js +1 -0
- package/dist/types/custom-add-ons/add-on.d.ts +1 -0
- package/dist/types/types.d.ts +14 -4
- package/dist/types.js +1 -0
- package/package.json +1 -1
- package/src/create-app.ts +26 -13
- package/src/custom-add-ons/add-on.ts +5 -1
- package/src/frameworks.ts +1 -0
- package/src/types.ts +2 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @tanstack/cta-engine
|
|
2
|
+
|
|
3
|
+
## 0.47.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Smakll content fixes ([`7647683`](https://github.com/TanStack/create-tsrouter-app/commit/76476838fc427d71535881b959530307ca4664a2))
|
|
8
|
+
|
|
9
|
+
- allowing for no tailwind ([#151](https://github.com/TanStack/create-tsrouter-app/pull/151))
|
package/dist/create-app.js
CHANGED
|
@@ -100,15 +100,27 @@ async function runCommandsAndInstallDependencies(environment, options) {
|
|
|
100
100
|
await runSpecialSteps(environment, options, Array.from(specialSteps));
|
|
101
101
|
}
|
|
102
102
|
// Install dependencies
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
if (options.install !== false) {
|
|
104
|
+
s.start(`Installing dependencies via ${options.packageManager}...`);
|
|
105
|
+
environment.startStep({
|
|
106
|
+
id: 'install-dependencies',
|
|
107
|
+
type: 'package-manager',
|
|
108
|
+
message: `Installing dependencies via ${options.packageManager}...`,
|
|
109
|
+
});
|
|
110
|
+
await packageManagerInstall(environment, options.targetDir, options.packageManager);
|
|
111
|
+
environment.finishStep('install-dependencies', 'Installed dependencies');
|
|
112
|
+
s.stop(`Installed dependencies`);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
s.start(`Skipping dependency installation...`);
|
|
116
|
+
environment.startStep({
|
|
117
|
+
id: 'skip-dependencies',
|
|
118
|
+
type: 'info',
|
|
119
|
+
message: `Skipping dependency installation...`,
|
|
120
|
+
});
|
|
121
|
+
environment.finishStep('skip-dependencies', 'Dependency installation skipped');
|
|
122
|
+
s.stop(`Dependency installation skipped`);
|
|
123
|
+
}
|
|
112
124
|
// Run any post-init special steps for the new add-ons
|
|
113
125
|
const postInitSpecialSteps = new Set([]);
|
|
114
126
|
for (const addOn of options.chosenAddOns) {
|
|
@@ -35,6 +35,7 @@ export function templatize(routeCode, routeFile) {
|
|
|
35
35
|
const routeDefinition = routeMatch[2];
|
|
36
36
|
code = code.replace(fullMatch, `<% if (codeRouter) { %>
|
|
37
37
|
import type { RootRoute } from '@tanstack/react-router'
|
|
38
|
+
import tailwind from '@tailwindcss/vite';
|
|
38
39
|
<% } else { %>
|
|
39
40
|
export const Route = createFileRoute('${path}')({${routeDefinition}})
|
|
40
41
|
<% } %>`);
|
|
@@ -75,7 +76,7 @@ export async function validateAddOnSetup(environment) {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
export async function readOrGenerateAddOnInfo(options) {
|
|
78
|
-
|
|
79
|
+
const info = existsSync(INFO_FILE)
|
|
79
80
|
? JSON.parse((await readFile(INFO_FILE)).toString())
|
|
80
81
|
: {
|
|
81
82
|
id: `${options.projectName}-add-on`,
|
|
@@ -83,6 +84,7 @@ export async function readOrGenerateAddOnInfo(options) {
|
|
|
83
84
|
version: '0.0.1',
|
|
84
85
|
description: 'Add-on',
|
|
85
86
|
author: 'Jane Smith <jane.smith@example.com>',
|
|
87
|
+
tailwind: options.tailwind || true,
|
|
86
88
|
license: 'MIT',
|
|
87
89
|
link: `https://github.com/jane-smith/${options.projectName}-add-on`,
|
|
88
90
|
shadcnComponents: [],
|
|
@@ -99,6 +101,8 @@ export async function readOrGenerateAddOnInfo(options) {
|
|
|
99
101
|
},
|
|
100
102
|
dependsOn: options.chosenAddOns,
|
|
101
103
|
};
|
|
104
|
+
info.tailwind = options.tailwind || true;
|
|
105
|
+
return info;
|
|
102
106
|
}
|
|
103
107
|
export async function generateProject(persistedOptions) {
|
|
104
108
|
const info = await readOrGenerateAddOnInfo(persistedOptions);
|
package/dist/frameworks.js
CHANGED
|
@@ -28,6 +28,7 @@ export function scanAddOnDirectories(addOnsDirectories) {
|
|
|
28
28
|
const filePath = resolve(addOnsBase, dir, 'info.json');
|
|
29
29
|
const fileContent = readFileSync(filePath, 'utf-8');
|
|
30
30
|
const info = JSON.parse(fileContent);
|
|
31
|
+
info.tailwind = info.tailwind ?? true;
|
|
31
32
|
let packageAdditions = {};
|
|
32
33
|
let packageTemplate = undefined;
|
|
33
34
|
if (existsSync(resolve(addOnsBase, dir, 'package.json'))) {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
112
112
|
link: z.ZodOptional<z.ZodString>;
|
|
113
113
|
license: z.ZodOptional<z.ZodString>;
|
|
114
114
|
warning: z.ZodOptional<z.ZodString>;
|
|
115
|
+
tailwind: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
115
116
|
type: z.ZodEnum<["add-on", "example", "starter", "toolchain", "deployment"]>;
|
|
116
117
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
117
118
|
command: z.ZodOptional<z.ZodObject<{
|
|
@@ -200,6 +201,7 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
200
201
|
description: string;
|
|
201
202
|
id: string;
|
|
202
203
|
name: string;
|
|
204
|
+
tailwind: boolean;
|
|
203
205
|
command?: {
|
|
204
206
|
command: string;
|
|
205
207
|
args?: string[] | undefined;
|
|
@@ -264,6 +266,7 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
264
266
|
link?: string | undefined;
|
|
265
267
|
license?: string | undefined;
|
|
266
268
|
warning?: string | undefined;
|
|
269
|
+
tailwind?: boolean | undefined;
|
|
267
270
|
priority?: number | undefined;
|
|
268
271
|
routes?: {
|
|
269
272
|
path: string;
|
|
@@ -387,10 +390,10 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
387
390
|
description: string;
|
|
388
391
|
id: string;
|
|
389
392
|
name: string;
|
|
393
|
+
tailwind: boolean;
|
|
390
394
|
framework: string;
|
|
391
395
|
mode: string;
|
|
392
396
|
typescript: boolean;
|
|
393
|
-
tailwind: boolean;
|
|
394
397
|
command?: {
|
|
395
398
|
command: string;
|
|
396
399
|
args?: string[] | undefined;
|
|
@@ -436,10 +439,10 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
436
439
|
description: string;
|
|
437
440
|
id: string;
|
|
438
441
|
name: string;
|
|
442
|
+
tailwind: boolean;
|
|
439
443
|
framework: string;
|
|
440
444
|
mode: string;
|
|
441
445
|
typescript: boolean;
|
|
442
|
-
tailwind: boolean;
|
|
443
446
|
command?: {
|
|
444
447
|
command: string;
|
|
445
448
|
args?: string[] | undefined;
|
|
@@ -587,10 +590,10 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
587
590
|
description: string;
|
|
588
591
|
id: string;
|
|
589
592
|
name: string;
|
|
593
|
+
tailwind: boolean;
|
|
590
594
|
framework: string;
|
|
591
595
|
mode: string;
|
|
592
596
|
typescript: boolean;
|
|
593
|
-
tailwind: boolean;
|
|
594
597
|
files: Record<string, string>;
|
|
595
598
|
deletedFiles: string[];
|
|
596
599
|
command?: {
|
|
@@ -638,10 +641,10 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
638
641
|
description: string;
|
|
639
642
|
id: string;
|
|
640
643
|
name: string;
|
|
644
|
+
tailwind: boolean;
|
|
641
645
|
framework: string;
|
|
642
646
|
mode: string;
|
|
643
647
|
typescript: boolean;
|
|
644
|
-
tailwind: boolean;
|
|
645
648
|
files: Record<string, string>;
|
|
646
649
|
deletedFiles: string[];
|
|
647
650
|
command?: {
|
|
@@ -713,6 +716,7 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
713
716
|
link: z.ZodOptional<z.ZodString>;
|
|
714
717
|
license: z.ZodOptional<z.ZodString>;
|
|
715
718
|
warning: z.ZodOptional<z.ZodString>;
|
|
719
|
+
tailwind: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
716
720
|
type: z.ZodEnum<["add-on", "example", "starter", "toolchain", "deployment"]>;
|
|
717
721
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
718
722
|
command: z.ZodOptional<z.ZodObject<{
|
|
@@ -824,6 +828,7 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
824
828
|
description: string;
|
|
825
829
|
id: string;
|
|
826
830
|
name: string;
|
|
831
|
+
tailwind: boolean;
|
|
827
832
|
modes: string[];
|
|
828
833
|
phase: "add-on" | "setup";
|
|
829
834
|
command?: {
|
|
@@ -900,6 +905,7 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
900
905
|
link?: string | undefined;
|
|
901
906
|
license?: string | undefined;
|
|
902
907
|
warning?: string | undefined;
|
|
908
|
+
tailwind?: boolean | undefined;
|
|
903
909
|
priority?: number | undefined;
|
|
904
910
|
routes?: {
|
|
905
911
|
path: string;
|
|
@@ -937,6 +943,7 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
937
943
|
link: z.ZodOptional<z.ZodString>;
|
|
938
944
|
license: z.ZodOptional<z.ZodString>;
|
|
939
945
|
warning: z.ZodOptional<z.ZodString>;
|
|
946
|
+
tailwind: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
940
947
|
type: z.ZodEnum<["add-on", "example", "starter", "toolchain", "deployment"]>;
|
|
941
948
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
942
949
|
command: z.ZodOptional<z.ZodObject<{
|
|
@@ -1052,6 +1059,7 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
1052
1059
|
description: string;
|
|
1053
1060
|
id: string;
|
|
1054
1061
|
name: string;
|
|
1062
|
+
tailwind: boolean;
|
|
1055
1063
|
files: Record<string, string>;
|
|
1056
1064
|
deletedFiles: string[];
|
|
1057
1065
|
modes: string[];
|
|
@@ -1133,6 +1141,7 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
1133
1141
|
link?: string | undefined;
|
|
1134
1142
|
license?: string | undefined;
|
|
1135
1143
|
warning?: string | undefined;
|
|
1144
|
+
tailwind?: boolean | undefined;
|
|
1136
1145
|
priority?: number | undefined;
|
|
1137
1146
|
routes?: {
|
|
1138
1147
|
path: string;
|
|
@@ -1210,6 +1219,7 @@ export interface Options {
|
|
|
1210
1219
|
tailwind: boolean;
|
|
1211
1220
|
packageManager: PackageManager;
|
|
1212
1221
|
git: boolean;
|
|
1222
|
+
install?: boolean;
|
|
1213
1223
|
chosenAddOns: Array<AddOn>;
|
|
1214
1224
|
addOnOptions: Record<string, Record<string, any>>;
|
|
1215
1225
|
starter?: Starter | undefined;
|
package/dist/types.js
CHANGED
|
@@ -22,6 +22,7 @@ export const AddOnBaseSchema = z.object({
|
|
|
22
22
|
link: z.string().optional(),
|
|
23
23
|
license: z.string().optional(),
|
|
24
24
|
warning: z.string().optional(),
|
|
25
|
+
tailwind: z.boolean().optional().default(true),
|
|
25
26
|
type: z.enum(['add-on', 'example', 'starter', 'toolchain', 'deployment']),
|
|
26
27
|
priority: z.number().optional(),
|
|
27
28
|
command: z
|
package/package.json
CHANGED
package/src/create-app.ts
CHANGED
|
@@ -20,8 +20,10 @@ async function writeFiles(environment: Environment, options: Options) {
|
|
|
20
20
|
|
|
21
21
|
async function writeFileBundle(bundle: FileBundleHandler) {
|
|
22
22
|
const files = await bundle.getFiles()
|
|
23
|
+
|
|
23
24
|
for (const file of files) {
|
|
24
25
|
const contents = await bundle.getFileContents(file)
|
|
26
|
+
|
|
25
27
|
const isBinaryFile = isBase64(contents)
|
|
26
28
|
if (isBinaryFile) {
|
|
27
29
|
await environment.writeFileBase64(
|
|
@@ -133,19 +135,30 @@ async function runCommandsAndInstallDependencies(
|
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
// Install dependencies
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
if (options.install !== false) {
|
|
139
|
+
s.start(`Installing dependencies via ${options.packageManager}...`)
|
|
140
|
+
environment.startStep({
|
|
141
|
+
id: 'install-dependencies',
|
|
142
|
+
type: 'package-manager',
|
|
143
|
+
message: `Installing dependencies via ${options.packageManager}...`,
|
|
144
|
+
})
|
|
145
|
+
await packageManagerInstall(
|
|
146
|
+
environment,
|
|
147
|
+
options.targetDir,
|
|
148
|
+
options.packageManager,
|
|
149
|
+
)
|
|
150
|
+
environment.finishStep('install-dependencies', 'Installed dependencies')
|
|
151
|
+
s.stop(`Installed dependencies`)
|
|
152
|
+
} else {
|
|
153
|
+
s.start(`Skipping dependency installation...`)
|
|
154
|
+
environment.startStep({
|
|
155
|
+
id: 'skip-dependencies',
|
|
156
|
+
type: 'info',
|
|
157
|
+
message: `Skipping dependency installation...`,
|
|
158
|
+
})
|
|
159
|
+
environment.finishStep('skip-dependencies', 'Dependency installation skipped')
|
|
160
|
+
s.stop(`Dependency installation skipped`)
|
|
161
|
+
}
|
|
149
162
|
|
|
150
163
|
// Run any post-init special steps for the new add-ons
|
|
151
164
|
const postInitSpecialSteps = new Set<string>([])
|
|
@@ -68,6 +68,7 @@ export function templatize(routeCode: string, routeFile: string) {
|
|
|
68
68
|
fullMatch,
|
|
69
69
|
`<% if (codeRouter) { %>
|
|
70
70
|
import type { RootRoute } from '@tanstack/react-router'
|
|
71
|
+
import tailwind from '@tailwindcss/vite';
|
|
71
72
|
<% } else { %>
|
|
72
73
|
export const Route = createFileRoute('${path}')({${routeDefinition}})
|
|
73
74
|
<% } %>`,
|
|
@@ -126,7 +127,7 @@ export async function validateAddOnSetup(environment: Environment) {
|
|
|
126
127
|
export async function readOrGenerateAddOnInfo(
|
|
127
128
|
options: PersistedOptions,
|
|
128
129
|
): Promise<AddOnInfo> {
|
|
129
|
-
|
|
130
|
+
const info = existsSync(INFO_FILE)
|
|
130
131
|
? JSON.parse((await readFile(INFO_FILE)).toString())
|
|
131
132
|
: ({
|
|
132
133
|
id: `${options.projectName}-add-on`,
|
|
@@ -134,6 +135,7 @@ export async function readOrGenerateAddOnInfo(
|
|
|
134
135
|
version: '0.0.1',
|
|
135
136
|
description: 'Add-on',
|
|
136
137
|
author: 'Jane Smith <jane.smith@example.com>',
|
|
138
|
+
tailwind: options.tailwind || true,
|
|
137
139
|
license: 'MIT',
|
|
138
140
|
link: `https://github.com/jane-smith/${options.projectName}-add-on`,
|
|
139
141
|
shadcnComponents: [],
|
|
@@ -150,6 +152,8 @@ export async function readOrGenerateAddOnInfo(
|
|
|
150
152
|
},
|
|
151
153
|
dependsOn: options.chosenAddOns,
|
|
152
154
|
} as AddOnInfo)
|
|
155
|
+
info.tailwind = options.tailwind || true
|
|
156
|
+
return info
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
export async function generateProject(persistedOptions: PersistedOptions) {
|
package/src/frameworks.ts
CHANGED
|
@@ -55,6 +55,7 @@ export function scanAddOnDirectories(addOnsDirectories: Array<string>) {
|
|
|
55
55
|
const filePath = resolve(addOnsBase, dir, 'info.json')
|
|
56
56
|
const fileContent = readFileSync(filePath, 'utf-8')
|
|
57
57
|
const info = JSON.parse(fileContent)
|
|
58
|
+
info.tailwind = info.tailwind ?? true
|
|
58
59
|
|
|
59
60
|
let packageAdditions: Record<string, any> = {}
|
|
60
61
|
let packageTemplate: string | undefined = undefined
|
package/src/types.ts
CHANGED
|
@@ -37,6 +37,7 @@ export const AddOnBaseSchema = z.object({
|
|
|
37
37
|
link: z.string().optional(),
|
|
38
38
|
license: z.string().optional(),
|
|
39
39
|
warning: z.string().optional(),
|
|
40
|
+
tailwind: z.boolean().optional().default(true),
|
|
40
41
|
type: z.enum(['add-on', 'example', 'starter', 'toolchain', 'deployment']),
|
|
41
42
|
priority: z.number().optional(),
|
|
42
43
|
command: z
|
|
@@ -179,6 +180,7 @@ export interface Options {
|
|
|
179
180
|
|
|
180
181
|
packageManager: PackageManager
|
|
181
182
|
git: boolean
|
|
183
|
+
install?: boolean
|
|
182
184
|
|
|
183
185
|
chosenAddOns: Array<AddOn>
|
|
184
186
|
addOnOptions: Record<string, Record<string, any>>
|