Skip to content

Commit

Permalink
New description and some devDependency touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 5, 2024
1 parent 173270f commit 1b50172
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">Create TypeScript App</h1>

<p align="center">Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝</p>
<p align="center">Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. ❤️‍🔥</p>

<p align="center">
<!-- prettier-ignore-start -->
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-typescript-app",
"version": "1.75.0",
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝",
"description": "Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. ❤️‍🔥",
"repository": {
"type": "git",
"url": "https://github.com/JoshuaKGoldberg/create-typescript-app"
Expand Down
4 changes: 2 additions & 2 deletions src/create/createWithOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "../shared/cli/spinners.js";
import { createCleanupCommands } from "../shared/createCleanupCommands.js";
import { doesRepositoryExist } from "../shared/doesRepositoryExist.js";
import { isUsingNextCreateEngine } from "../shared/isUsingNextCreateEngine.js";
import { isUsingCreateEngine } from "../shared/isUsingCreateEngine.js";
import { GitHubAndOptions } from "../shared/options/readOptions.js";
import { addToolAllContributors } from "../steps/addToolAllContributors.js";
import { clearLocalGitTags } from "../steps/clearLocalGitTags.js";
Expand All @@ -25,7 +25,7 @@ export async function createWithOptions({ github, options }: GitHubAndOptions) {
await writeStructure(options);
},
],
...(isUsingNextCreateEngine()
...(isUsingCreateEngine()
? []
: [
[
Expand Down
1 change: 1 addition & 0 deletions src/next/blocks/blockCSpell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const blockCSpell = base.createBlock({
}),
blockPackageJson({
properties: {
devDependencies: getPackageDependencies("cspell"),
scripts: {
"lint:spelling": 'cspell "**" ".github/**/*"',
},
Expand Down
1 change: 1 addition & 0 deletions src/next/blocks/blockPrettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pnpm format --write
...plugins,
"husky",
"lint-staged",
"prettier",
),
"lint-staged": {
"*": "prettier --ignore-unknown --write",
Expand Down
2 changes: 1 addition & 1 deletion src/next/blocks/blockTemplatedBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const blockTemplatedBy = base.createBlock({
`
<!-- You can remove this notice if you don't want it 🙂 no worries! -->
> 💙 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app).
> 💝 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [\`create\` engine](https://github.com/JoshuaKGoldberg/create).
`,
],
}),
Expand Down
5 changes: 5 additions & 0 deletions src/shared/isUsingCreateEngine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function isUsingCreateEngine() {
return (
!!process.env.CTA_CREATE_ENGINE && Boolean(process.env.CTA_CREATE_ENGINE)
);
}
6 changes: 0 additions & 6 deletions src/shared/isUsingNextCreateEngine.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ nothing.
it("parses when found after an h1 and many badge images", async () => {
mockReadFileSafe.mockResolvedValue(`<h1 align="center">Create TypeScript App</h1>
<p align="center">Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. 💝</p>
<p align="center">Quickstart-friendly TypeScript template with comprehensive, configurable, opinionated tooling. ❤️‍🔥</p>
<p align="center">
<!-- prettier-ignore-start -->
Expand Down
14 changes: 7 additions & 7 deletions src/steps/finalizeDependencies.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { execaCommand } from "execa";

import { isUsingNextCreateEngine } from "../shared/isUsingNextCreateEngine.js";
import { isUsingCreateEngine } from "../shared/isUsingCreateEngine.js";
import { readPackageData, removeDependencies } from "../shared/packages.js";
import { Options } from "../shared/types.js";

export async function finalizeDependencies(options: Options) {
if (isUsingNextCreateEngine()) {
if (isUsingCreateEngine()) {
// TODO: How to switch from "latest" to the actual versions?
// Maybe an eslint-plugin-package-json lint rule?
await execaCommand("pnpm install");
} else {
const devDependencies = [
"@eslint/js",
"@types/node",
"eslint-plugin-n",
"eslint",
"husky",
"lint-staged",
"prettier-plugin-curly",
"prettier-plugin-packagejson",
"prettier-plugin-sh",
"prettier",
"tsup",
"typescript",
"typescript-eslint",
"eslint-plugin-n",
"prettier-plugin-curly",
"prettier-plugin-sh",
"prettier-plugin-packagejson",
"typescript",
...(options.excludeAllContributors ? [] : ["all-contributors-cli"]),
...(options.excludeLintESLint
? []
Expand Down
6 changes: 5 additions & 1 deletion src/steps/writing/creation/writePackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export async function writePackageJson(options: Options) {
: undefined,

// We copy all existing dev dependencies except those we know are not used anymore
devDependencies: copyDevDependencies(existingPackageJson),
devDependencies: {
...copyDevDependencies(existingPackageJson),
// prettier is a special case of being switched to a devDependency
prettier: existingPackageJson.dependencies?.prettier,
},

// Remove fields we know we don't want, such as old or redundant configs
eslintConfig: undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/steps/writing/writeStructure.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { $ } from "execa";

import { isUsingNextCreateEngine } from "../../shared/isUsingNextCreateEngine.js";
import { isUsingCreateEngine } from "../../shared/isUsingCreateEngine.js";
import { Options } from "../../shared/types.js";
import { createStructure } from "./creation/index.js";
import { writeStructureWorker } from "./writeStructureWorker.js";

export async function writeStructure(options: Options) {
await writeStructureWorker(
await createStructure(options, isUsingNextCreateEngine()),
await createStructure(options, isUsingCreateEngine()),
".",
);

Expand Down

0 comments on commit 1b50172

Please sign in to comment.