Skip to content

Commit d1540f8

Browse files
committed
refactor: rename isJS to transpile
This better reflects the fact that js-based templates shouldn't be transpiled. Previously `isJS` would be set to false, which is obviously misleading
1 parent 55bff9b commit d1540f8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/create/src/create-start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const createStartJS = async ({ template, destination }: CreateStartArgs)
2525
writeFileSync(join(destination, ".gitignore"), GIT_IGNORE);
2626
};
2727

28-
export const createStart = (args: CreateStartArgs, js?: boolean) => {
29-
if (js) {
28+
export const createStart = (args: CreateStartArgs, transpile?: boolean) => {
29+
if (transpile) {
3030
return createStartJS(args);
3131
}
3232
return createStartTS(args);

packages/create/src/create-vanilla.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export type CreateVanillaArgs = {
88
template: VanillaTemplate;
99
destination: string;
1010
};
11-
export const createVanilla = (args: CreateVanillaArgs, js?: boolean) => {
12-
if (js) {
11+
export const createVanilla = (args: CreateVanillaArgs, transpile?: boolean) => {
12+
if (transpile) {
1313
return createVanillaJS(args);
1414
}
1515
return createVanillaTS(args);

packages/create/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ export const createSolid = (version: string) =>
6060
);
6161

6262
// Don't transpile project if it's already javascript!
63-
const isJS = template.startsWith("js") ? false : !(await cancelable(p.confirm({ message: "Use Typescript?" })));
63+
const transpileToJS = template.startsWith("js") ? false : !(await cancelable(p.confirm({ message: "Use Typescript?" })));
6464

6565
if (isStart) {
6666
await spinnerify({
6767
startText: "Creating project",
6868
finishText: "Project created 🎉",
69-
fn: () => createStart({ template: template as StartTemplate, destination: projectName }, isJS),
69+
fn: () => createStart({ template: template as StartTemplate, destination: projectName }, transpileToJS),
7070
});
7171
} else {
7272
await spinnerify({
7373
startText: "Creating project",
7474
finishText: "Project created 🎉",
75-
fn: () => createVanilla({ template: template as VanillaTemplate, destination: projectName }, isJS),
75+
fn: () => createVanilla({ template: template as VanillaTemplate, destination: projectName }, transpileToJS),
7676
});
7777
}
7878
// Add "Created with Solid CLI" text to bottom of README

0 commit comments

Comments
 (0)