-
Notifications
You must be signed in to change notification settings - Fork 626
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: update tsconfigs to publish types accurately #2026
Conversation
…ogle#1987) Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2. - [Release notes](https://github.com/chaijs/get-func-name/releases) - [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2) --- updated-dependencies: - dependency-name: get-func-name dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: upgrade keyboard navigation to use new clipboard API (google#1844) * fix: upgrade keyboard navigation to use new clipboard API * chore: reorganize test suites * chore: fixup delete tests * chore: work on fixing copy tests * chore: finish fixing up copy tests * chore: fix cut and paste tests * chore: delete paste suite * chore: delete unnecessary test helpers * chore: fixup other tests * chore: document why we're stubbing cancelAnimationFrame and add it to teardown * fix: upgrade cross tab copy paste to use new clipboard API (google#1845) * fix: upgrade cross tab copy paste to use new clipboard API * chore: update to beta * fix: upgrade shareable procedures for new clipboard API (google#1863) * chore: fix tests * fix: upgrade the shareable procedure blocks to use the new clipboard system * chore: update blockly version * chore: fix lint * fix: serialization of dynamic if blocks (google#1880) * fix: normalize inputs * fix: work on fixing serialization * chore: remove inputCounts * chore: fix tests * fix: infinite loop * fix: serialization of dynamic list blocks (google#1885) * fix: normalize inputs * fix: serialization * chore: remove inputCounter * fix: normalize connections from load * chore: switch tests to regexp * chore: refactor tests * fix: rebuilding behavior * chore: revert changes to playground * chore: format * fix: fully tear down dynamic block before rebuilding (google#1886) * fix: dynamic text serialization (google#1887) * fix: normalize inputs * fix: serialization * chore: remove inputCounter * fix: normalize connections from load * chore: switch tests to regexp * chore: refactor tests * feat: dynamic json serialization (google#1888) * feat: add json serialization for text and list dynamic blocks * chore: use helpers to append inputs * chore: add json serialization to if blocks * fix: support loading stringified XML from JSOn * fix: dynamic connection plugin readme (google#1919) * chore: update readme and remove warning * chore: add backticks * deprecate: edit row separator readme to deprecate it (google#1920) * chore: edit row separator readme to deprecate it. * Mark deprecated package private to stop publishing * fix: unnamed callers for shareable procedures (google#1983) * fix: rendering dynamic connections (google#1984) * fix: migrating json for dynamic connections (google#1985) * chore: get tests to fail * fix: round tripping old json to new json * chore: fixup fixes * chore: give up on getting tests to fail properly * fix: fixup keyboard nav to remove blockly version check (google#1991) * fix: fixup keyboard nav to remove check * chore: update beta version * fix: bump blockly to v10.2.0 --------- Co-authored-by: John Nesky <nesky@google.com>
…oogle#2007) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.23 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.23...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
google#2010) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.27...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.21 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.21...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.14 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.14...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oogle#2006) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.18 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.18...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…e#2001) Bumps [debug](https://github.com/debug-js/debug) to 4.3.4 and updates ancestor dependencies [debug](https://github.com/debug-js/debug) and [socket.io](https://github.com/socketio/socket.io). These dependencies need to be updated together. Updates `debug` from 4.1.1 to 4.3.4 - [Release notes](https://github.com/debug-js/debug/releases) - [Commits](debug-js/debug@4.1.1...4.3.4) Updates `debug` from 3.2.6 to 4.3.4 - [Release notes](https://github.com/debug-js/debug/releases) - [Commits](debug-js/debug@4.1.1...4.3.4) Updates `socket.io` from 2.5.0 to 4.7.2 - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](socketio/socket.io@2.5.0...4.7.2) --- updated-dependencies: - dependency-name: debug dependency-type: indirect - dependency-name: debug dependency-type: indirect - dependency-name: socket.io dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ools (google#1986) * chore(deps): Bump get-func-name in /plugins/dev-tools Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2. - [Release notes](https://github.com/chaijs/get-func-name/releases) - [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2) --- updated-dependencies: - dependency-name: get-func-name dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore: update package-locks [dependabot skip] --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: blockly[bot] <blockly-github-robot@google.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.18 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.18...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…google#1992) Co-authored-by: Rachel Fenichel <fenichel@google.com>
) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.0 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2020) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.1 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.0 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oogle#2018) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.3 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Over the summer, JS-Interpreter recieved a string of updates due to prompting from Geo. It's 1 KB larger, but includes the following features: * Supports setTimeout/setInterval * Better error messages. * Zero type errors (Closure Compiler). * A collection of random bug fixes.
…2022) Fixes google#1877. Don't advertise module entrypoints on packages that are implemented in TypeScript as at the moment our webpack configuration does not generate any file called src/index.js.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
reminder to self: do not squash this PR. cla checks are only failing on the github-actions bot that publishes (expected) and on the blocklygithubrobot account that cleans up after dependabot (unexpected?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasoning makes sense! Scanned for any glaring errors and LGTM.
I did not check for any tsconfigs or package.jsons that might have gotten missed. I'm trusting that you caught all of those :P
You can use https://github.com/TypeStrong/ts-loader#compileroptions to override
I think if you do this you cannot use newer es202X syntax (eg
A little bit surprised that DOM/DOM.Iterable is not needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalizes all tsconfigs (including those in the dev-create templates) with the following settings:
- Sets output directory to
dist
instead ofbuild
, which is just straight up wrong (but was set that way in the templates).
Why is outputting to build
wrong? I was under the impression that that was so that test output (*.mocha.js
) would go to build/
, which seems correct; equally, I understood that that ts-loader
uses tsc
in a way that makes this setting moot.
It seems a lot safer that manual invocation of tsc
writes only to build/
, so that any intermediate output files it generates do not end up in the final package.
- Uses
excludes
rather thanincludes
, which affects the directory structure of the final output. Also exclude the build/dist directories so TS doesn't try to compile its own output.
It seems safer to "includes": ["src", "test"]
than try to exclude everywhere else that .ts
files might be found. Is your objective to change the output directory structure? If so, why?
- Installs typescript as a devDependency in every TS plugin. It was an error that it wasn't before. The reason this is needed is because I need to make sure we're using TS 5 in the plugins, as
moduleResolution: 'bundler'
didn't exist before TS 5.
- Also installed it as a devDependency in
dev-scripts
itself as that's the plugin runningts-loader
. I found if I didn't do this, sometimes plugins ended up using the version of typescript found in theeslint-config
plugin, which is just totally wrong.
This seems reasonable, but did you consider the alternative of making typescript
a (non-dev) dependency of dev-scripts
, obviating the need to have each individual plugin depend upon it directly? This sort of makes sense because AFAICT the places tsc
is actually invoked from are only in dev-scripts
, and it's advantageous in terms of simplifying upgrades (because only one package needs to be upgraded), but it does mean all our packages would be obliged to use the same version of typescript
.
- Merged in master and resolved all conflicts, so after this, the osd branch should be fully ready to be merged back into master.
Would it be possible to do that in a separate PR? It is difficult to properly review this PR when I don't know what's changed here vs. incidental changes in master
.
Sorry, I know the commits are a bit of a mess. The only non-merge commit that I made was in df4b084 I needed some changes from master before I could get the publint and arethetypeswrong tests to pass, and if those didn't pass, then it didn't make sense to do this change without being able to validate it in some way. |
The
We do not ever manually invoke tsc in samples afaik. Also, I believe we do clean the dist directory whenever we run webpack. |
I think I found that if I had |
I can't decide if this would be correct or not. It feels wrong. TypeScript plugins seem like they should have a dependency on TypeScript. I'll double check that if I remove it from each plugin then the correct version is still used every time from the build script, which was definitely not happening before. |
Is your suggestion to set noEmit to true in the tsconfig, then override it to false in ts-loader? If so, that is interesting, but seems a little bit convoluted. There's no actual gain to be made from setting
I don't know that we're ready to start outputting es2020. I don't know that I can make a decision about supporting e.g. import.meta right now because we still have a lot of people who use blockly directly via script tags in-browser and I don't know the browser support story for new features like that. For that reason, I'm fine with making an intentional decision at the time a plugin wishes to use a es2020+ feature that can't be compiled down.
DOM is included by default if you don't set the lib value. |
I was mainly referring to your comment that ts-loader need noEmit to work. If thats true then perhaps we should override it so that even if a 3rd party plugin author has noEmit to true for some reason their project will not fail to build. But it's a small point in any case, up to your preference.
Definitely, and I am not asking for this. There are two fields, one is
Just want to share a note on import.meta since it relates to the my other PR :) At least from my tests it would work fine in the UMD setup we have today. The dist code looks like
Might be a concern if a 3rd party plugin developer decides to install a new version of typescript and gets confused why their code won't build. |
I changed everything to use I opted not to remove TS and install it only in dev-scripts. The way dev-scripts is currently configured, it wants TypeScript as a peer dependency. I think it might be reasonable to change this, but I don't think we need to do it as part of this PR. |
The basics
The details
Resolves
Fixes #1871
Fixes problems with tsconfigs resulting in types sometimes being output to the wrong location.
I recommend reviewing by commit.
Proposed Changes
dist
instead ofbuild
, which is just straight up wrong (but was set that way in the templates).strict
to true if it was previously true, false if it was previously not set. This makes it easier to keep track of plugins which are not currently strict. Will file follow up issues for all plugins that are not strict.bundler
.import {foo} from './foo.js'
. We omit the file extension and sayimport {foo} from './foo'
. This is allowed by webpack but disallowed by strict esmodule rules. Usingbundler
mode makes typescript cool with us doing so.module
toes2015
. This setting affects the output oftsc
. Theoretically, this shouldn't matter because we don't actually use the output oftsc
directly; we're using webpack to output a UMD module currently, not an esm. I couldn't find out what the recommended value for this is if you're usingts-loader
so I just went with the currently recommended best practice. n.b. I tried to setnoEmit: true
which would truly make this setting redundant, butts-loader
didn't like that actually.target
toes6
. This was slightly inconsistent before.lib
property except on the one plugin that actually needs extra libs.excludes
rather thanincludes
, which affects the directory structure of the final output. Also exclude the build/dist directories so TS doesn't try to compile its own output.moduleResolution: 'bundler'
didn't exist before TS 5.dev-scripts
itself as that's the plugin runningts-loader
. I found if I didn't do this, sometimes plugins ended up using the version of typescript found in theeslint-config
plugin, which is just totally wrong.Reason for Changes
Test Coverage
npm pack
on 3 plugins and uploaded them to arethetypeswrong, got all green checkmarks.Documentation
No
Additional Information