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

Refresh tsconfig and eslint setup #1677

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Next Next commit
Attempt to overhaul tsconfig/eslint
1. Migrate to ESLint 9 + new config format
2. Migrate to a single tsconfig file for the entire repo

In general, this results in more consistency across the repo, including
in one-off packages and tests, but it still gives us flexibility to
create special rules if necessary.

As part of this process, a new `repo-metadata` package was created that
allows other infrastructure packages to get workspace metadata. This
package has a static JSON file with the information about each package
in the workspace. This was important in the current PR because it allows
our eslint config to be sensitive to information in individual packages
without slowing down the boot time of eslint.

Fully migrating to ESLint 9 required:

- Making the whole repo clean with `eslint .`
- Making `eslint .` in individual packages work (and perhaps move the
  custom configuration to configs in each package
- Moving the guts of the code into `@glimmer-workspace/eslint-plugin`.
  This should be **much** more straightforward with ESLint 9.
- Porting all of the ESLint rules from the current setup to the new
  config, or deciding to ignore them.
- Updating our JSON linting

Rather than using a workspace package for benchmarks and trying to
get `vite build` to emulate the expected behavior, we `pack` the
dependencies and refer to them directly in the `package.json`.

This is a little bit more involved than it might seem like it should be
because the benchmark has to run on the `main` branch, so it has to be
very general and can't use any infrastructure in the workspace itself
that could affect the builds.

On the bright side, that constraint pushes us towards treating the
benchmark environment as a normal consumer of the normal Glimmer
packages, which is good.

The only tiny exception to that rule is that the build script builds the
`@glimmer-workspace/benchmark-env` package, even though it's not a
public package. This means that the code in
`@glimmer-workspace/benchmark-env` needs to make sure it can be built.

The current setup allows us to use the `main` branch's
`@glimmer-workspace/benchmark-env` package with the experiment's
`krausest` package, so it seems reasonable to build the benchmark env
and use it as a traditional package rather than trying to get two
workspaces to somehow mesh together (which is what got us into trouble
in the first place).

Note: Getting this working right now requires a little bit of hackery
when setting up the current `control` (i.e. `main`) branch, because
`main` isn't set up to build the `@glimmer-workspace/benchmark-env`.
Once this PR is merged, we should be able to remove those hacks and rely
on vanilla package builds for the entire setup going forward.

Other changes:

- Document recommendations
- Use LFS
- Explain recommended extensions for vscode
- Remove unused dependencies

NOTE: This PR comes after multiple attempts to set up a `.meta-updater`
config, but I realized that it would be much easier after a long-needed
overhaul to the tsconfig and eslint configs.
wycats committed Jan 21, 2025
commit edf78f2a18cbeecd6c61aa2fb7c9a4d4f6c1e20a
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

138 changes: 0 additions & 138 deletions .eslintrc.cjs

This file was deleted.

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
guides/workspace/demos/auto-import.gif filter=lfs diff=lfs merge=lfs -text
guides/workspace/demos/fixme.png filter=lfs diff=lfs merge=lfs -text
guides/workspace/demos/dependency-links.png filter=lfs diff=lfs merge=lfs -text
guides/workspace/demos/dependi-outdated.png filter=lfs diff=lfs merge=lfs -text
guides/workspace/demos/dependi-update.png filter=lfs diff=lfs merge=lfs -text
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ jobs:
- uses: wyvox/action@v1
with:
pnpm-args: '--ignore-scripts'
node-version: 20.1.0
node-version: 22.13.0
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm turbo build
- run: node ./bin/build-verify.mjs
@@ -41,7 +41,7 @@ jobs:
- uses: wyvox/action@v1
with:
pnpm-args: '--ignore-scripts'
node-version: 20.1.0
node-version: 22.13.0
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm lint

@@ -113,7 +113,7 @@ jobs:
steps:
- uses: wyvox/action@v1
with:
node-version: 20.1.0
node-version: 22.13.0
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm turbo test:types

2 changes: 1 addition & 1 deletion .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ jobs:
- uses: wyvox/action-setup-pnpm@v3
with:
args: '--ignore-scripts'
node-version: 20.1.0
node-version: 22.13.0

- name: "Generate Explanation and Prep Changelogs"
id: explanation
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ jobs:
- uses: wyvox/action-setup-pnpm@v3
with:
args: '--ignore-scripts'
node-version: 20.1.0
node-version: 22.13.0
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
node-registry-url: 'https://registry.npmjs.org'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/dist/
/dist
**/dist
/control-dist/
node_modules/
7 changes: 0 additions & 7 deletions .madgerc

This file was deleted.

7 changes: 0 additions & 7 deletions .npmcheckrc

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use-node-version=20.9.0
ignore-workspace-root-check=true
auto-install-peers=true
strict-peer-dependencies=true
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -9,4 +9,5 @@ ts-dist/
!packages/**/*.md
*.yaml
*.yml
guides/
guides/**/*.md
!guides/workspace/**/*.md
2 changes: 2 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node = "22"
pnpm = "latest"
13 changes: 11 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"recommendations": ["foxundermoon.shell-format"]
}
"recommendations": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These recommendations are documented in guides/workspace/vscode.md

"foxundermoon.shell-format",
"dbaeumer.vscode-eslint",
"fill-labs.dependi",
"rohit-gohri.format-code-action",
"tintinweb.vscode-inline-bookmarks",
"herrmannplatz.npm-dependency-links",
"esbenp.prettier-vscode",
"dnut.rewrap-revived"
]
}
Loading