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

Fix Eslint and Type-checking for st-lib #6675

Merged
merged 17 commits into from
May 11, 2023
Merged

Conversation

willhuang1997
Copy link
Contributor

This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts.

In addition, this PR fixes the type checking github actions by adding new commands.

import { createBaseUiTheme } from "./createThemeUtil"

export const AUTO_THEME_NAME = "Use system setting"
export const CUSTOM_THEME_NAME = "Custom Theme"

export const getSystemTheme = (): ThemeConfig => {
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 needs to be moved before getSystemTheme gets called.

"lint": "yarn lintApp && yarn lintLib",
"lintApp": "yarn workspace @streamlit/app lint",
"lintLib": "yarn workspace @streamlit/lib lint",
"prettier": "prettier --write --config .prettierrc app/src && prettier --write --config .prettierrc lib/src"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding this because it's useful but not necessary for linting / typechecking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted because we don't need it

"extends": "../tsconfig.json",
Copy link
Contributor Author

@willhuang1997 willhuang1997 May 11, 2023

Choose a reason for hiding this comment

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

extend root one so less duplication. I tried adding the extends property to app/tsconfig.json but it broke tschecks so will investigate that later.

@willhuang1997 willhuang1997 marked this pull request as ready for review May 11, 2023 23:27
"build:vendor": "cp -R ./src/vendor ./dist"
"build:vendor": "cp -R ./src/vendor ./dist",
"build:assets": "cp -R ./src/assets ./dist",
"build:proto": "cp ./src/proto* ./dist",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to look into if there's a better way of exporting this.

},
"dependencies": {
"@deck.gl/core": "^8.8.23",
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 dependencies should be a minimal set as they are added from eslint errors. app/package.json will need be cleaned up and it's already documented as something to do.

Copy link
Contributor

@tconkling tconkling left a comment

Choose a reason for hiding this comment

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

Looks great!

Makefile Outdated
Comment on lines 293 to 300
.PHONY: frontend-lib
frontend-lib:
cd frontend/ ; yarn run buildLib;

.PHONY: frontend-app
frontend-app:
cd frontend/ ; yarn run buildApp

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add short docstrings for these rules (just single-line descriptions under the .PHONY line)

@@ -14,7 +14,7 @@
"cy:run": "unset NODE_OPTIONS && cypress run",
"cy:run-flaky": "yarn cy:run --config integrationFolder=../e2e_flaky/specs",
"typecheck": "tsc --noEmit",
"lint": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx --max-warnings 0 --cache --fix src"
Copy link
Contributor

Choose a reason for hiding this comment

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

is the --fix arg intentionally removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm that's how it is in develop so I removed. I personally like the --fix when I run it locally and accidentally added it in a separate PR seemingly. I am happy to keep it because I use it but not sure if others use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense - let's keep parity with develop

@willhuang1997 willhuang1997 merged commit 96c844f into feature/st-lib May 11, 2023
willhuang1997 added a commit that referenced this pull request Jul 10, 2023
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (#6623)

This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer.

Most of the changes are import path changes. Some of the more notable changes to look through are

How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos).
a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True.
b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config.
The actual index.ts that is added to frontend/lib
Some things to note that will be punt down but worked on later:

We also need to look into why protobuf can't be compiled through tsc.

Cleaning frontend/app/package.json
Cleaning frontend/app/yarn.lock
Cleaning frontend/lib/scripts/create.js
Determine what's going wrong with globalStyles typing
Determine what's going wrong with styled-components typing for EmotionTheme

* Change exports for protobuf to be included in index.ts instead of copied through cp command. (#6635)

Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense.
The reason why I did that was because I was getting an error on first try:

`src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";
  ~~~~~~

src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";`
I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should.

* Simple fix for globalStyles (#6651)

* Fix typing issues for styled-components (#6652)

There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense.

* remove extra app directory in frontend dir (#6653)

The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory.
This PR also fixes the audit_license script.

* Remove unnecessary files

* Fix naming of directories and files

* Fix BaseColorPicker directory

* Add Fixes that should exist in feature/st-lib

* Fix Eslint and Type-checking for st-lib (#6675)

This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts.

In addition, this PR fixes the type checking github actions by adding new commands.

* Fix notices (#6676)

* Clean up audit_frontend_licenses

* Fix/yarn test (#6681)

This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests.
Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript.

There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18.

* Fix regex that I accidentally forgot to commit (#6698)

* Fix/cypress (#6699)

* Remove unused app dep / dev dep and declarations.d.ts (#6713)

* Remove unused app dep / dev dep and declarations.d.ts

* Remove d3 color resolution (#6714)

* Add dependencies removed from app to lib/package.json

* Add pbjs cli

* Readd notices

* Add watch lib script (#6730)

Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change.

Will also need to update the contributing wiki after this is merged to develop.

* Get rid of yarn start warnings and clean Makefile (#6739)

* Remove streamlit.css. I'm not sure where it came from

* Fix yarn buildLib

* Fix eslintrc

* Fix codeql

* Add notices and yarn.lock

* Fix glide-data-grid versions

* Fix nits

* Fix nits

* Lint and cleanup

* Minor cleanup for Block utils as comments got removed

* Remove accidentally committed file

* Revert "Remove accidentally committed file"

This reverts commit 87b7f13.

* Fix yarn lock

* Fix compilation errors

* Fix lint

* Fix notices

* Remove unnecessary package.json dependencies

* Fix package.json versions

* Fix yarn.lock and streamlit dialog snapshots

* Fix notices

* Have faster hot reloading and absolute imports for @streamlit/lib (#6961)

<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Describe your changes
- Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. 
- Change imports for `lib` to absolute imports
- add `tsconfig.dev.json` that is specifically for developement
- change `tsconfig.json` for `lib` and `app`
- change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project

## GitHub Issue Link (if applicable)

## Testing Plan
Manually testing
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
yes

https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7


---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

* Fix minor comments from Lukas
@sfc-gh-kmcgrady sfc-gh-kmcgrady deleted the fix/EslintAndTS branch October 5, 2023 19:30
eric-skydio pushed a commit to eric-skydio/streamlit that referenced this pull request Dec 20, 2023
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623)

This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer.

Most of the changes are import path changes. Some of the more notable changes to look through are

How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos).
a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True.
b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config.
The actual index.ts that is added to frontend/lib
Some things to note that will be punt down but worked on later:

We also need to look into why protobuf can't be compiled through tsc.

Cleaning frontend/app/package.json
Cleaning frontend/app/yarn.lock
Cleaning frontend/lib/scripts/create.js
Determine what's going wrong with globalStyles typing
Determine what's going wrong with styled-components typing for EmotionTheme

* Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635)

Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense.
The reason why I did that was because I was getting an error on first try:

`src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";
  ~~~~~~

src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";`
I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should.

* Simple fix for globalStyles (streamlit#6651)

* Fix typing issues for styled-components (streamlit#6652)

There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense.

* remove extra app directory in frontend dir (streamlit#6653)

The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory.
This PR also fixes the audit_license script.

* Remove unnecessary files

* Fix naming of directories and files

* Fix BaseColorPicker directory

* Add Fixes that should exist in feature/st-lib

* Fix Eslint and Type-checking for st-lib (streamlit#6675)

This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts.

In addition, this PR fixes the type checking github actions by adding new commands.

* Fix notices (streamlit#6676)

* Clean up audit_frontend_licenses

* Fix/yarn test (streamlit#6681)

This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests.
Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript.

There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18.

* Fix regex that I accidentally forgot to commit (streamlit#6698)

* Fix/cypress (streamlit#6699)

* Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713)

* Remove unused app dep / dev dep and declarations.d.ts

* Remove d3 color resolution (streamlit#6714)

* Add dependencies removed from app to lib/package.json

* Add pbjs cli

* Readd notices

* Add watch lib script (streamlit#6730)

Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change.

Will also need to update the contributing wiki after this is merged to develop.

* Get rid of yarn start warnings and clean Makefile (streamlit#6739)

* Remove streamlit.css. I'm not sure where it came from

* Fix yarn buildLib

* Fix eslintrc

* Fix codeql

* Add notices and yarn.lock

* Fix glide-data-grid versions

* Fix nits

* Fix nits

* Lint and cleanup

* Minor cleanup for Block utils as comments got removed

* Remove accidentally committed file

* Revert "Remove accidentally committed file"

This reverts commit 87b7f13.

* Fix yarn lock

* Fix compilation errors

* Fix lint

* Fix notices

* Remove unnecessary package.json dependencies

* Fix package.json versions

* Fix yarn.lock and streamlit dialog snapshots

* Fix notices

* Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961)

<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Describe your changes
- Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. 
- Change imports for `lib` to absolute imports
- add `tsconfig.dev.json` that is specifically for developement
- change `tsconfig.json` for `lib` and `app`
- change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project

## GitHub Issue Link (if applicable)

## Testing Plan
Manually testing
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
yes

https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7


---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

* Fix minor comments from Lukas
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Mar 22, 2024
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623)

This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer.

Most of the changes are import path changes. Some of the more notable changes to look through are

How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos).
a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True.
b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config.
The actual index.ts that is added to frontend/lib
Some things to note that will be punt down but worked on later:

We also need to look into why protobuf can't be compiled through tsc.

Cleaning frontend/app/package.json
Cleaning frontend/app/yarn.lock
Cleaning frontend/lib/scripts/create.js
Determine what's going wrong with globalStyles typing
Determine what's going wrong with styled-components typing for EmotionTheme

* Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635)

Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense.
The reason why I did that was because I was getting an error on first try:

`src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";
  ~~~~~~

src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";`
I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should.

* Simple fix for globalStyles (streamlit#6651)

* Fix typing issues for styled-components (streamlit#6652)

There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense.

* remove extra app directory in frontend dir (streamlit#6653)

The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory.
This PR also fixes the audit_license script.

* Remove unnecessary files

* Fix naming of directories and files

* Fix BaseColorPicker directory

* Add Fixes that should exist in feature/st-lib

* Fix Eslint and Type-checking for st-lib (streamlit#6675)

This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts.

In addition, this PR fixes the type checking github actions by adding new commands.

* Fix notices (streamlit#6676)

* Clean up audit_frontend_licenses

* Fix/yarn test (streamlit#6681)

This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests.
Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript.

There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18.

* Fix regex that I accidentally forgot to commit (streamlit#6698)

* Fix/cypress (streamlit#6699)

* Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713)

* Remove unused app dep / dev dep and declarations.d.ts

* Remove d3 color resolution (streamlit#6714)

* Add dependencies removed from app to lib/package.json

* Add pbjs cli

* Readd notices

* Add watch lib script (streamlit#6730)

Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change.

Will also need to update the contributing wiki after this is merged to develop.

* Get rid of yarn start warnings and clean Makefile (streamlit#6739)

* Remove streamlit.css. I'm not sure where it came from

* Fix yarn buildLib

* Fix eslintrc

* Fix codeql

* Add notices and yarn.lock

* Fix glide-data-grid versions

* Fix nits

* Fix nits

* Lint and cleanup

* Minor cleanup for Block utils as comments got removed

* Remove accidentally committed file

* Revert "Remove accidentally committed file"

This reverts commit 87b7f13.

* Fix yarn lock

* Fix compilation errors

* Fix lint

* Fix notices

* Remove unnecessary package.json dependencies

* Fix package.json versions

* Fix yarn.lock and streamlit dialog snapshots

* Fix notices

* Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961)

<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Describe your changes
- Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. 
- Change imports for `lib` to absolute imports
- add `tsconfig.dev.json` that is specifically for developement
- change `tsconfig.json` for `lib` and `app`
- change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project

## GitHub Issue Link (if applicable)

## Testing Plan
Manually testing
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
yes

https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7


---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

* Fix minor comments from Lukas
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Apr 16, 2024
* Minimal exports for app to consume + VerticalBlock and ElementNodeRenderer (streamlit#6623)

This PR is the first milestone to determine the minimal number of exports needed for app to consume + VerticalBlock + ElementNodeRenderer.

Most of the changes are import path changes. Some of the more notable changes to look through are

How the @streamlit/lib is built. It's built through the monorepo config for babel (https://babeljs.io/docs/config-files/#monorepos).
a. The babel process works by using a custom preset that is mainly babel-preset-react-app but slightly modified in order to make sure glide data grid code is es6 compatible and hard coding isTypeScriptEnabled to True.
b. The other keys are adding in the emotion plugin for styled-components, ignoring proto, vendor, test files, and telling babel that frontend is the root directory for babel config.
The actual index.ts that is added to frontend/lib
Some things to note that will be punt down but worked on later:

We also need to look into why protobuf can't be compiled through tsc.

Cleaning frontend/app/package.json
Cleaning frontend/app/yarn.lock
Cleaning frontend/lib/scripts/create.js
Determine what's going wrong with globalStyles typing
Determine what's going wrong with styled-components typing for EmotionTheme

* Change exports for protobuf to be included in index.ts instead of copied through cp command. (streamlit#6635)

Tim noticed that I was copying the protobuf.js and protobuf.d.ts instead of compiling it through babel. That causes problems because then you have to import by doing import { ... } from "@streamlit/lib/dist/proto" which doesn't make any sense.
The reason why I did that was because I was getting an error on first try:

`src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radii'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";
  ~~~~~~

src/proto.js:4:1 - error TS9005: Declaration emit for this file requires using private name 'Radio'. An explicit type annotation may unblock declaration emit.

4 import * as $protobuf from "protobufjs/minimal";`
I just removed the proto files and did a make protobuf and then tried exporting and that worked, as it should.

* Simple fix for globalStyles (streamlit#6651)

* Fix typing issues for styled-components (streamlit#6652)

There are going to be 2 emotion.d.ts. Our @streamlit/lib has our own theming and then our app will simply just be consuming from @streamlit/lib which makes sense.

* remove extra app directory in frontend dir (streamlit#6653)

The current folder structure is frontend/app/src/app. We should make it so that it's frontend/app/src and remove the extra app directory.
This PR also fixes the audit_license script.

* Remove unnecessary files

* Fix naming of directories and files

* Fix BaseColorPicker directory

* Add Fixes that should exist in feature/st-lib

* Fix Eslint and Type-checking for st-lib (streamlit#6675)

This PR is to fix eslint for app and lib. This also adds dependencies that are necessary to lib's package.json. This is done through eslint noticing the necessary dependencies. This PR also does some linting and also does a merge from develop as we need the BaseButton refactoring to stop duplication of exports from the root index.ts.

In addition, this PR fixes the type checking github actions by adding new commands.

* Fix notices (streamlit#6676)

* Clean up audit_frontend_licenses

* Fix/yarn test (streamlit#6681)

This is to fix yarn test. This simply adds new scripts through the yarn workspace command to run app and lib tests.
Currently, the lib testing works by mainly using the same scripts that CRA uses for transpiling typescript to javascript.

There is one other thing to note: It looks like if you were to upgrade to 17.0.1 supposedly for react-dom, it would fix jest tests for app to not hang (facebook/react#20756 (comment)). However, jest was still hanging so I just did a delete MessageChannel within src/setupTests.js and we can remove that when we upgrade to React 18.

* Fix regex that I accidentally forgot to commit (streamlit#6698)

* Fix/cypress (streamlit#6699)

* Remove unused app dep / dev dep and declarations.d.ts (streamlit#6713)

* Remove unused app dep / dev dep and declarations.d.ts

* Remove d3 color resolution (streamlit#6714)

* Add dependencies removed from app to lib/package.json

* Add pbjs cli

* Readd notices

* Add watch lib script (streamlit#6730)

Since @streamlit/lib is separated out to be its own separate lib, we need a script to constantly rebuild when the files change.

Will also need to update the contributing wiki after this is merged to develop.

* Get rid of yarn start warnings and clean Makefile (streamlit#6739)

* Remove streamlit.css. I'm not sure where it came from

* Fix yarn buildLib

* Fix eslintrc

* Fix codeql

* Add notices and yarn.lock

* Fix glide-data-grid versions

* Fix nits

* Fix nits

* Lint and cleanup

* Minor cleanup for Block utils as comments got removed

* Remove accidentally committed file

* Revert "Remove accidentally committed file"

This reverts commit 87b7f13.

* Fix yarn lock

* Fix compilation errors

* Fix lint

* Fix notices

* Remove unnecessary package.json dependencies

* Fix package.json versions

* Fix yarn.lock and streamlit dialog snapshots

* Fix notices

* Have faster hot reloading and absolute imports for @streamlit/lib (streamlit#6961)

<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Describe your changes
- Change imports for `app` to `@streamlit/app/src...` as we removed the `ModuleScopePlugin` which allows us to import out of `app/src`. 
- Change imports for `lib` to absolute imports
- add `tsconfig.dev.json` that is specifically for developement
- change `tsconfig.json` for `lib` and `app`
- change `.eslintrc` to `.eslintrc.js` in order to gain access to `__dirname` to make typescript configs relative to each project

## GitHub Issue Link (if applicable)

## Testing Plan
Manually testing
- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
- E2E Tests
- Any manual testing needed?
yes

https://github.com/streamlit/streamlit/assets/16749069/cc0a5f96-f8cd-487b-b70e-6a4e5823f0e7


---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

* Fix minor comments from Lukas
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.

2 participants