Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add opt-in usage of create as underlying files engine #1670

Merged
merged 62 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
019bced
WIP: Use create as underlying files engine
JoshuaKGoldberg Oct 22, 2024
b0b6b73
WIP: start testing created files
JoshuaKGoldberg Oct 23, 2024
6454600
WIP: using the latest create APIs, with a useNext
JoshuaKGoldberg Nov 9, 2024
3e7f491
Heck, updated all snapshots
JoshuaKGoldberg Nov 9, 2024
c8ccb52
Touch up nvmrc and prettier tests
JoshuaKGoldberg Nov 9, 2024
a93d87d
Lots of discrepency fixes for creation
JoshuaKGoldberg Nov 10, 2024
49f1623
Bring in create with implicit block ordering
JoshuaKGoldberg Nov 15, 2024
594566b
Switch from metadata to block args
JoshuaKGoldberg Nov 15, 2024
de04b8a
Update tests for new testBlock
JoshuaKGoldberg Nov 16, 2024
8609ae0
Rename Schema -> Foundation -> Base
JoshuaKGoldberg Nov 16, 2024
1f2251a
Most of the way to using inferred block ordering
JoshuaKGoldberg Nov 23, 2024
0133ce2
Updated for arg-less blocks
JoshuaKGoldberg Nov 24, 2024
ed2f276
finished updating remaining tests
JoshuaKGoldberg Nov 24, 2024
b0e4411
small tweaks
JoshuaKGoldberg Nov 24, 2024
20a2ef9
switched perfectionist to using settings
JoshuaKGoldberg Nov 24, 2024
48c734d
fix: printing settings in eslint config
JoshuaKGoldberg Nov 24, 2024
00d9413
Merge branch 'main'
JoshuaKGoldberg Nov 28, 2024
47b2916
Apply suggestions from code review
JoshuaKGoldberg Nov 28, 2024
aee29bd
dedupe cspell ignore of .all-contributorsrc
JoshuaKGoldberg Nov 28, 2024
b3c5c3b
Finished all files except README.md, including package.json version s…
JoshuaKGoldberg Dec 3, 2024
930d4d0
Update docs/Tooling.md
JoshuaKGoldberg Dec 3, 2024
015821e
revert CHANGELOG.md
JoshuaKGoldberg Dec 3, 2024
43ae967
fix Tooling.md typo
JoshuaKGoldberg Dec 3, 2024
9e32bad
Pin dependencies
JoshuaKGoldberg Dec 4, 2024
d01070d
Wait, only devDependencies
JoshuaKGoldberg Dec 4, 2024
e2011c0
Merge branch 'main'
JoshuaKGoldberg Dec 4, 2024
4c8ac70
Remove unnecessary cspell block deep addons
JoshuaKGoldberg Dec 5, 2024
6c490df
revert CHANGELOG.md change
JoshuaKGoldberg Dec 5, 2024
3d0439d
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
efd1a8b
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
08c8e60
docs: remove extra --exclude-templated-by
JoshuaKGoldberg Dec 5, 2024
21f6de0
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
9e18fde
chore: remove identity convertOptionsToBaseOptions
JoshuaKGoldberg Dec 5, 2024
b2b3829
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
d2f6a97
Remove .only
JoshuaKGoldberg Dec 5, 2024
2ab8a8d
Remove unused coverage z.string
JoshuaKGoldberg Dec 5, 2024
462a477
Merge branch 'main'
JoshuaKGoldberg Dec 5, 2024
856a597
use alpha versions of create packages
JoshuaKGoldberg Dec 5, 2024
7925b9f
chore: remove last types/eslint__js
JoshuaKGoldberg Dec 5, 2024
c6579a1
chore: use createRequire in packageData.ts
JoshuaKGoldberg Dec 5, 2024
eabce94
Move create-testers to devDependency
JoshuaKGoldberg Dec 5, 2024
4d99165
Normalization tweaks for blockESLint
JoshuaKGoldberg Dec 5, 2024
ddb4f87
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
c28f995
chore: add test files as Knip entries
JoshuaKGoldberg Dec 5, 2024
c7e5c17
chore: remove create.config.ts (for now)
JoshuaKGoldberg Dec 5, 2024
d7d03d3
Add src/next to removeSetupScripts
JoshuaKGoldberg Dec 5, 2024
c762de9
Also reset src/index.ts
JoshuaKGoldberg Dec 5, 2024
0ee57d0
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
1f78e11
Update migration snapshot
JoshuaKGoldberg Dec 5, 2024
41edc35
Also uninstall parse-package-name
JoshuaKGoldberg Dec 5, 2024
8233907
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
5813562
ugh ci.yml
JoshuaKGoldberg Dec 5, 2024
f3c6d40
Update migration snapshot
JoshuaKGoldberg Dec 5, 2024
cdbb679
UGH PINS
JoshuaKGoldberg Dec 5, 2024
3e38ffd
Merge branch 'main' into create
JoshuaKGoldberg Dec 5, 2024
7240459
Update migration snapshot
JoshuaKGoldberg Dec 5, 2024
cc7edef
Let's just ignore cspell.json in migration
JoshuaKGoldberg Dec 5, 2024
173270f
Update migration snapshot
JoshuaKGoldberg Dec 5, 2024
1b50172
New description and some devDependency touchups
JoshuaKGoldberg Dec 5, 2024
f5bb917
Fix pinning node to minimum
JoshuaKGoldberg Dec 5, 2024
abf1e03
expect package.json to change with prettier dep
JoshuaKGoldberg Dec 5, 2024
62a3b7e
Heck, let package.json change, what do I care
JoshuaKGoldberg Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
],
"words": [
"allcontributors",
"Anson",
"apexskier",
"arethetypeswrong",
"automerge",
"codespace",
"dbaeumer",
"execa",
"infile",
"joshuakgoldberg",
"markdownlintignore",
"mtfoley",
"outro",
"tada",
"tseslint"
"tseslint",
"wontfix"
]
}
4 changes: 1 addition & 3 deletions eslint.config.js
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ export default tseslint.config(
{
extends: [vitest.configs.recommended],
files: ["**/*.test.*"],
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
},
rules: { "@typescript-eslint/no-unsafe-assignment": "off" },
},
{
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
Expand Down
2 changes: 1 addition & 1 deletion knip.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"entry": ["src/index.ts!", "script/*e2e.js"],
"entry": ["script/*e2e.js", "src/index.ts!", "src/**/*.test.*"],
"ignoreExportsUsedInFile": { "interface": true, "type": true },
"project": ["src/**/*.ts!", "script/**/*.js"]
}
5 changes: 4 additions & 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 Expand Up @@ -45,6 +45,7 @@
"@prettier/sync": "^0.5.2",
"all-contributors-for-repository": "^0.3.0",
"chalk": "^5.3.0",
"create": "0.1.0-alpha.0",
"execa": "^9.5.1",
"get-github-auth-token": "^0.1.0",
"git-remote-origin-url": "^4.0.0",
Expand All @@ -54,6 +55,7 @@
"npm-user": "^6.1.1",
"octokit": "^4.0.2",
"parse-author": "^2.0.0",
"parse-package-name": "^1.0.0",
"prettier": "^3.4.1",
"replace-in-file": "^8.2.0",
"rimraf": "^6.0.1",
Expand All @@ -76,6 +78,7 @@
"@vitest/eslint-plugin": "1.1.14",
"c8": "10.1.2",
"console-fail-test": "0.5.0",
"create-testers": "0.1.0-alpha.0",
"cspell": "8.16.1",
"eslint": "9.16.0",
"eslint-plugin-jsdoc": "50.6.0",
Expand Down
34 changes: 34 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 14 additions & 37 deletions script/__snapshots__/migrate-test-e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -114,42 +114,6 @@ exports[`expected file changes > README.md 1`] = `
+> 💙 This package was templated with [\`create-typescript-app\`](https://github.com/JoshuaKGoldberg/create-typescript-app)."
`;

exports[`expected file changes > cspell.json 1`] = `
"--- a/cspell.json
+++ b/cspell.json
@@ ... @@
".all-contributorsrc",
".github",
"CHANGELOG.md",
- "coverage*",
+ "coverage",
"lib",
"node_modules",
- "pnpm-lock.yaml",
- "script/__snapshots__"
+ "pnpm-lock.yaml"
],
"words": [
"allcontributors",
@@ ... @@
"arethetypeswrong",
"automerge",
"codespace",
- "execa",
+ "contributorsrc",
"infile",
"joshuakgoldberg",
"markdownlintignore",
"mtfoley",
"outro",
"tada",
- "tseslint"
+ "tseslint",
+ "wontfix"
]
}"
`;

exports[`expected file changes > eslint.config.js 1`] = `
"--- a/eslint.config.js
+++ b/eslint.config.js
Expand Down Expand Up @@ -238,14 +202,27 @@ exports[`expected file changes > knip.json 1`] = `
@@ ... @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
- "entry": ["src/index.ts!", "script/*e2e.js"],
- "entry": ["script/*e2e.js", "src/index.ts!", "src/**/*.test.*"],
+ "entry": ["src/index.ts!"],
"ignoreExportsUsedInFile": { "interface": true, "type": true },
- "project": ["src/**/*.ts!", "script/**/*.js"]
+ "project": ["src/**/*.ts!"]
}"
`;

exports[`expected file changes > package.json 1`] = `
"--- a/package.json
+++ b/package.json
@@ ... @@
"lint-staged": "15.2.10",
"markdownlint": "0.36.1",
"markdownlint-cli": "0.43.0",
+ "prettier": "^3.4.1",
"prettier-plugin-curly": "0.3.1",
"prettier-plugin-packagejson": "2.5.6",
"prettier-plugin-sh": "0.14.0","
`;

exports[`expected file changes > tsconfig.json 1`] = `
"--- a/tsconfig.json
+++ b/tsconfig.json
Expand Down
5 changes: 4 additions & 1 deletion script/migrate-test-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ const filesExpectedToBeChanged = [
".github/workflows/ci.yml",
".gitignore",
".prettierignore",
"cspell.json",
"eslint.config.js",
"package.json",
"tsconfig.json",
];

const filesThatMightBeChanged = new Set([
// For now, ignore typos cspell is picking up from migration snapshots.
"cspell.json",

"script/__snapshots__/migrate-test-e2e.ts.snap",
...filesExpectedToBeChanged,
]);
Expand Down
23 changes: 16 additions & 7 deletions src/create/createWithOptions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { $ } from "execa";

import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
import {
LabeledSpinnerTask,
withSpinner,
withSpinners,
} from "../shared/cli/spinners.js";
import { createCleanupCommands } from "../shared/createCleanupCommands.js";
import { doesRepositoryExist } from "../shared/doesRepositoryExist.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 @@ -20,12 +25,16 @@ export async function createWithOptions({ github, options }: GitHubAndOptions) {
await writeStructure(options);
},
],
[
"Writing README.md",
async () => {
await writeReadme(options);
},
],
...(isUsingCreateEngine()
? []
: [
[
"Writing README.md",
async () => {
await writeReadme(options);
},
] satisfies LabeledSpinnerTask<void>,
]),
]);

if (!options.excludeAllContributors && !options.skipAllContributorsApi) {
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
export * from "./greet.js";

// If you're using create-typescript-app as a template, ignore these.
// They're plumbing for the create engine. :)
export * from "./next/blocks/index.js";
export { default } from "./next/template.js";

export * from "./types.js";
Loading
Loading