Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: improve eslint, sb, tsc configs #483

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

Merged
merged 6 commits into from
Mar 18, 2022
Merged

Conversation

greyscaled
Copy link
Contributor

@greyscaled greyscaled commented Mar 18, 2022

Summary:

This commit is a bit of a shotgun fix for various project settings.
Realistically, they could've been separate commits, but this is
convenience for just getting things into a green state to unblock
further work.

Details:

  • Use our version of TS in vscode plugins
  • organize vscode/settings.json
  • fix tsconfig.test and tsconfig.prod (removes errors in test files)
  • only use prod tsconfig in webpack
  • point .eslintrc to both test and prod configs
  • cleanup storybook
  • running eslint in my workspace was OOMing. I configured maxWorkers like we had in v1 to fix this.
  • remove .storybook from code coverage
  • remove .js files from code coverage --> after moving away from Next.js, we don't allowJS in our tsconfig anymore. We only use JS for configurations, it's not allowed in src code!

Summary:

This commit is a bit of a shotgun fix for various project settings.
Realistically, they could've been separate commits, but this is
convenience for just getting things into a green state to unblock
further work.

Details:

- Use our version of TS in vscode plugins
- organize vscode/settings.json
- fix tsconfig.test and tsconfig.prod (removes errors in test files)
- only use prod tsconfig in webpack
- point .eslintrc to both test and prod configs
- cleanup storybook
@greyscaled greyscaled self-assigned this Mar 18, 2022
@@ -1,31 +1,4 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was:

  • re-organized (alphabetically). Reason = "at a glance" behaviors.
  • we point vscode plugins to use our version of TS installed, not the version shipped with vs code (this fixes various problems in reading tsconfig files and red squiggly lines showing up in files)

// Automatically loads all stories in source ending in 'stories.tsx'
//
// SEE: https://storybook.js.org/docs/react/configure/overview#configure-story-loading
stories: ["../src/**/*.stories.tsx"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I simplified this for now because:

  1. it's just easier to understand like this
  2. we don't have use-cases or scenarios for mdx or ts stories
  3. changing this to accommodate mdx or ts files later is trivial

Copy link
Contributor

@bryphe-coder bryphe-coder Mar 18, 2022

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a similar commit in an unpushed branch for v1, yes! Good call!

@codecov
Copy link

codecov bot commented Mar 18, 2022

Codecov Report

Merging #483 (aab6cec) into main (d875298) will increase coverage by 0.09%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #483      +/-   ##
==========================================
+ Coverage   68.01%   68.10%   +0.09%     
==========================================
  Files         160      158       -2     
  Lines        9278     9271       -7     
  Branches       79       79              
==========================================
+ Hits         6310     6314       +4     
+ Misses       2343     2334       -9     
+ Partials      625      623       -2     
Flag Coverage Δ
unittest-go-macos-latest 62.65% <ø> (+0.15%) ⬆️
unittest-go-ubuntu-latest 67.46% <ø> (+0.02%) ⬆️
unittest-go-windows-2022 62.04% <ø> (-0.15%) ⬇️
unittest-js 64.26% <ø> (+0.54%) ⬆️
Impacted Files Coverage Δ
peerbroker/dial.go 75.43% <0.00%> (-7.02%) ⬇️
provisionersdk/transport.go 78.72% <0.00%> (-6.39%) ⬇️
peer/channel.go 83.62% <0.00%> (-2.34%) ⬇️
coderd/provisionerdaemons.go 57.60% <0.00%> (ø)
site/.storybook/main.js
site/jest-runner-eslint.config.js
provisionerd/provisionerd.go 79.04% <0.00%> (+0.91%) ⬆️
peer/conn.go 79.53% <0.00%> (+2.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d875298...aab6cec. Read the comment docs.

@@ -9,7 +9,7 @@ Started container user
Using user 'coder' with shell '/bin/bash'`.split("\n")

export default {
title: "CodeBlock",
title: "CodeBlock/CodeBlock",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two types of CodeBlocks, so I organized them. Furthermore, this makes it so that every current story has a top-level heading, which is visually appealing.

@greyscaled greyscaled marked this pull request as ready for review March 18, 2022 01:52
@greyscaled greyscaled requested a review from a team as a code owner March 18, 2022 01:52
This is safe because we don't allow JS in our tsconfigs! We only use JS
for config files!
Copy link
Contributor

@bryphe-coder bryphe-coder left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up, @vapurrmaid !

greyscaled added a commit that referenced this pull request Mar 18, 2022
Summary:

This is a first step in porting over v1 AuditLog in a refactored/cleaned
up fashion. This isn't a direct port, since we do not yet have a
UserAvatar component.

Details:

- Port over UserCell from v1, sans UserAvatar impl
- Add tests and stories for UserCell

Notes:

We do not have a holistic solution for handling localization, but
starting from some kind of easy way that collects/resources strings will
make the migration significantly easier. It will also help out our
product copy owner, @khorne3 with maintenance. An RFC regarding this
might be necessitated.

Impact:

This change does not have any user-facing impact yet, because the
UserCell is not yet rendered in the product. This enables an incremental
approach to migrating in the FE of the Audit Log, which is still waiting
on the BE port.

Relations:

- This commit relates to #472, but does not finish it.
- This commit should not merge until after #465 and #483 because it's
based on them.
@greyscaled greyscaled requested a review from presleyp March 18, 2022 07:14
Copy link
Contributor

@presleyp presleyp left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@greyscaled greyscaled merged commit 8fde3ed into main Mar 18, 2022
@greyscaled greyscaled deleted the vapurrmaid/project-config branch March 18, 2022 14:26
greyscaled added a commit that referenced this pull request Mar 18, 2022
Summary:

This is a first step in porting over v1 AuditLog in a refactored/cleaned
up fashion. This isn't a direct port, since we do not yet have a
UserAvatar component.

Details:

- Port over UserCell from v1, sans UserAvatar impl
- Add tests and stories for UserCell

Notes:

We do not have a holistic solution for handling localization, but
starting from some kind of easy way that collects/resources strings will
make the migration significantly easier. It will also help out our
product copy owner, @khorne3 with maintenance. An RFC regarding this
might be necessitated.

Impact:

This change does not have any user-facing impact yet, because the
UserCell is not yet rendered in the product. This enables an incremental
approach to migrating in the FE of the Audit Log, which is still waiting
on the BE port.

Relations:

- This commit relates to #472, but does not finish it.
- This commit should not merge until after #465 and #483 because it's
based on them.
greyscaled pushed a commit that referenced this pull request Mar 23, 2022
Summary:

This is a first step in porting over v1 AuditLog in a refactored/cleaned
up fashion. The existing `UserCell` component was generalized for re-use
across various tables (AuditLog, Users, Orgs).

Details:

- Move UserCell to `components/Table/Cells`
- Add tests and stories for UserCell


Impact:

This unblocks future work in list views like the audit log, user management
panel and organizations management panel.

Relations:

- This commit relates to #472, but does not finish it.
- This commit should not merge until after #465 and #483 because it's
based on them.
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants