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 16 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
54 changes: 43 additions & 11 deletions .github/DEVELOPMENT.md
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,56 @@ pnpm format --write

## Linting

This package includes several forms of linting to enforce consistent code quality and styling.
Each should be shown in VS Code, and can be run manually on the command-line:

- `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files
- `pnpm lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports
- `pnpm lint:md` ([Markdownlint](https://github.com/DavidAnson/markdownlint)): Checks Markdown source files
- `pnpm lint:packages` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the `pnpm-lock.yml` file
- `pnpm lint:spelling` ([cspell](https://cspell.org)): Spell checks across all source files
[ESLint](https://eslint.org) is used with [typescript-eslint](https://typescript-eslint.io)) to lint JavaScript and TypeScript source files.
You can run it locally on the command-line:

Read the individual documentation for each linter to understand how it can be configured and used best.
```shell
pnpm run lint
```

For example, ESLint can be run with `--fix` to auto-fix some lint rule complaints:
ESLint can be run with `--fix` to auto-fix some lint rule complaints:

```shell
pnpm run lint --fix
```

Note that you'll likely need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files.
Note that you'll need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files.

### Linting Duplicate Packages

[pnpm dedupe --check](https://pnpm.io/cli/dedupe)) is used to check for unnecessarily duplicated packages in the `pnpm-lock.yml` file.
You can run it with `lint:packages`:

```shell
pnpm run lint:packages
```

### Linting With CSpell

[cspell](https://cspell.org) is used to spell check across all source files.
You can run it with `lint:spelling`:

```shell
pnpm lint:spelling
```

### Linting With Knip

[knip](https://github.com/webpro/knip) is used to detect unused files, dependencies, and code exports.
You can run it with `lint:knip`:

```shell
pnpm lint:knip
```

### Linting With Markdownlint

[Markdownlint](https://github.com/DavidAnson/markdownlint) is used to run linting on Markdown source files.
You can run it with `lint:md`:

```shell
pnpm lint:md
```

## Testing

Expand Down
9 changes: 4 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.all-contributorsrc
.husky/
coverage*/
lib/
pnpm-lock.yaml
/.husky
/coverage*
/lib
/pnpm-lock.yaml
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"yaml"
],
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.useFlatConfig": true,
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
"typescript.tsdk": "node_modules/typescript/lib"
}
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dictionaries": ["typescript"],
"ignorePaths": [
".all-contributorsrc",
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
"./coverage*",
"./script/__snapshots__",
".github",
Expand All @@ -17,6 +18,8 @@
"codecov",
"codespace",
"contributorsrc",
"DavidAnson",
"dbaeumer",
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
"execa",
"infile",
"knip",
Expand Down
36 changes: 10 additions & 26 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 @@ -24,11 +24,11 @@ import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
"**/*.snap",
"coverage*",
"lib",
"node_modules",
"pnpm-lock.yaml",
"**/*.snap",
],
},
{
Expand All @@ -49,7 +49,7 @@ export default tseslint.config(
packageJson,
perfectionist.configs["recommended-natural"],
regexp.configs["flat/recommended"],
...tseslint.config({
{
extends: [
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
Expand All @@ -59,7 +59,6 @@ export default tseslint.config(
parserOptions: {
projectService: {
allowDefaultProject: ["*.config.*s", "bin/*.js", "script/*.ts"],
defaultProject: "./tsconfig.json",
},
tsconfigRootDir: import.meta.dirname,
},
Expand All @@ -75,7 +74,6 @@ export default tseslint.config(

// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/lines-before-block": "off",
"no-constant-condition": "off",

// These on-by-default rules work well for this repo if configured
"@typescript-eslint/no-unnecessary-condition": [
Expand All @@ -97,20 +95,18 @@ export default tseslint.config(
"error",
{ allowExperimental: true },
],
"perfectionist/sort-objects": [
"error",
{
order: "asc",
partitionByComment: true,
type: "natural",
},
],

// Stylistic concerns that don't interfere with Prettier
"no-useless-rename": "error",
"object-shorthand": "error",
},
}),
settings: {
perfectionist: {
partitionByComment: true,
type: "natural",
},
},
},
{
files: ["*.jsonc"],
rules: {
Expand All @@ -122,23 +118,11 @@ export default tseslint.config(
{
extends: [tseslint.configs.disableTypeChecked],
files: ["**/*.md/*.ts"],
rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["create-typescript-app"] },
],
},
},
{
extends: [vitest.configs.recommended],
files: ["**/*.test.*"],
languageOptions: {
globals: vitest.environments.env.globals,
},
plugins: { vitest },
rules: {
...vitest.configs.recommended.rules,

// These on-by-default rules aren't useful in test files.
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
},
"dependencies": {
"@clack/prompts": "^0.7.0",
"@prettier/sync": "^0.5.2",
"all-contributors-for-repository": "^0.3.0",
"chalk": "^5.3.0",
"create": "0.1.0",
"execa": "^9.3.1",
"get-github-auth-token": "^0.1.0",
"git-remote-origin-url": "^4.0.0",
Expand All @@ -53,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.3.3",
"replace-in-file": "^8.1.0",
"rimraf": "^6.0.1",
Expand All @@ -75,6 +78,7 @@
"@vitest/eslint-plugin": "^1.0.3",
"c8": "^10.1.2",
"console-fail-test": "^0.5.0",
"create-testers": "^0.1.0",
"cspell": "^8.14.1",
"eslint": "^9.9.0",
"eslint-plugin-jsdoc": "^50.2.2",
Expand All @@ -87,7 +91,6 @@
"eslint-plugin-yml": "^1.14.0",
"globby": "^14.0.2",
"husky": "^9.1.4",
"jsonc-eslint-parser": "^2.4.0",
"knip": "5.27.2",
"lint-staged": "^15.2.9",
"markdownlint": "^0.34.0",
Expand All @@ -100,7 +103,7 @@
"tsup": "^8.2.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.1.0",
"typescript-eslint": "^8.3.0",
"vitest": "^2.0.5"
},
"engines": {
Expand Down
Loading