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

Normalize some dependencies in workers-sdk #6029

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

threepointone
Copy link
Contributor

This is the first of a few expected patches that normalize dependency versions, This normalizes undici, concurrently, @types/node, react, react-dom, @types/react, @types/react-dom, eslint, typescript. There are no functional code changes (but there are a couple of typecheck fixes).


Let's see what CI says.

@threepointone threepointone requested review from a team as code owners June 13, 2024 16:21
Copy link

changeset-bot bot commented Jun 13, 2024

🦋 Changeset detected

Latest commit: f42e8db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
playground-preview-worker Patch
@cloudflare/vitest-pool-workers Patch
workers-playground Patch
create-cloudflare Patch
@cloudflare/kv-asset-handler Patch
@cloudflare/pages-shared Patch
@cloudflare/quick-edit Patch
miniflare Patch
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -4,7 +4,6 @@ import esbuild from "esbuild";
import { getPackage, pkgRoot } from "./common.mjs";

const argv = process.argv.slice(2);
const watch = argv[0] === "watch";
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 also removes watch mode for miniflare builds (we'll bring that back later)

Copy link
Contributor

Choose a reason for hiding this comment

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

later .... 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

This is used here:

"dev": "concurrently -n esbuild,typechk,typewrk -c yellow,blue,blue.dim \"node scripts/build.mjs watch\" \"node scripts/types.mjs tsconfig.json watch\" \"node scripts/types.mjs src/workers/tsconfig.json watch\"",

Copy link
Contributor

Choose a reason for hiding this comment

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

Tracking at #6042

Copy link
Contributor

github-actions bot commented Jun 13, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-wrangler-6029

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6029/npm-package-wrangler-6029

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-wrangler-6029 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-create-cloudflare-6029 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-cloudflare-kv-asset-handler-6029
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-miniflare-6029
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-cloudflare-pages-shared-6029
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9518851671/npm-package-cloudflare-vitest-pool-workers-6029

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.60.3 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240610.0
workerd 1.20240610.1 1.20240610.1
workerd --version 1.20240610.1 2024-06-10

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@threepointone threepointone force-pushed the normalize-deps branch 3 times, most recently from 08aaaf8 to 8c1c5a3 Compare June 13, 2024 16:41
This is the first of a few expected patches that normalize dependency versions, This normalizes `undici`, `concurrently`, `@types/node`, `react`, `react-dom`, `@types/react`, `@types/react-dom`, `eslint`, `typescript`. There are no functional code changes (but there are a couple of typecheck fixes).
@@ -4,7 +4,6 @@ import esbuild from "esbuild";
import { getPackage, pkgRoot } from "./common.mjs";

const argv = process.argv.slice(2);
const watch = argv[0] === "watch";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is used here:

"dev": "concurrently -n esbuild,typechk,typewrk -c yellow,blue,blue.dim \"node scripts/build.mjs watch\" \"node scripts/types.mjs tsconfig.json watch\" \"node scripts/types.mjs src/workers/tsconfig.json watch\"",

@@ -4,7 +4,6 @@ import esbuild from "esbuild";
import { getPackage, pkgRoot } from "./common.mjs";

const argv = process.argv.slice(2);
const watch = argv[0] === "watch";
Copy link
Contributor

Choose a reason for hiding this comment

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

Tracking at #6042

Comment on lines +30 to +31
"react": "^18.2.0",
"react-dom": "^18.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we have any tests of this template.
Is it definitely going to work with a big major bump like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tested, works fine

@petebacondarwin petebacondarwin added the e2e Run e2e tests on a PR label Jun 14, 2024
@threepointone threepointone merged commit f5ad1d3 into main Jun 14, 2024
32 checks passed
@threepointone threepointone deleted the normalize-deps branch June 14, 2024 17:59
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Jun 14, 2024
Copy link

holopin-bot bot commented Jun 14, 2024

Congratulations @threepointone, you just earned a holobyte! Here it is: https://holopin.io/holobyte/clxezu6jr09100clesvjm6mzx

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

threepointone added a commit that referenced this pull request Jun 14, 2024
Follow up to #6029, this normalizes some more dependencies : `get-port`, `chalk`, `yargs`, `toucan-js`, `@typescript-eslint/parser`, `@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`, `glob-to-regexp`
threepointone added a commit that referenced this pull request Jun 14, 2024
Follow up to #6029, this normalizes some more dependencies : `get-port`, `chalk`, `yargs`, `toucan-js`, `@typescript-eslint/parser`, `@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`, `glob-to-regexp`
threepointone added a commit that referenced this pull request Jun 14, 2024
Follow up toi #6029, this normalizes some more dependencies : `get-port`, `chalk`, `yargs`, `toucan-js`, `@typescript-eslint/parser`, `@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`, `glob-to-regexp, `@cloudflare/workers-types``
threepointone added a commit that referenced this pull request Jun 14, 2024
Follow up toi #6029, this normalizes some more dependencies : `get-port`, `chalk`, `yargs`, `toucan-js`, `@typescript-eslint/parser`, `@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`, `glob-to-regexp, `@cloudflare/workers-types``
threepointone added a commit that referenced this pull request Jun 15, 2024
Follow up toi #6029, this normalizes some more dependencies : `get-port`, `chalk`, `yargs`, `toucan-js`, `@typescript-eslint/parser`, `@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`, `glob-to-regexp, `@cloudflare/workers-types``
threepointone added a commit that referenced this pull request Jun 15, 2024
runing `pnpm dev` used to start a watch mode, but I removed that in #6029 because the esbuild watch api was changed. This patch brings it back with the new api.
threepointone added a commit that referenced this pull request Jun 15, 2024
Fixes #6042

runing `pnpm dev` used to start a watch mode, but I removed that in #6029 because the esbuild watch api was changed. This patch brings it back with the new api.
petebacondarwin pushed a commit that referenced this pull request Jun 15, 2024
Fixes #6042

runing `pnpm dev` used to start a watch mode, but I removed that in #6029 because the esbuild watch api was changed. This patch brings it back with the new api.
@@ -455,6 +455,7 @@ describe.concurrent(`E2E: Web frameworks`, () => {
await verifyBuildScript(framework, projectPath, logStream);
await storeDiff(framework, projectPath);
} catch (e) {
console.error("ERROR", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

@threepointone was this meant to be console.error or logger.error?

Copy link
Contributor

Choose a reason for hiding this comment

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

This can't be logger.error because that is only used inside Wrangler, right?
Or is there also an e2e test logger?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, totally missed this was in create-cloudflare. Is the log relevant here then? I see we're asserting on the fail message...not sure if that needs to be logged for that assertion to pass

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 added it while debugging, but it's not a bad idea to keep it here, because otherwise you have to see logs, which are hard to do in CI (unless I'm mistaken?)

renovate bot added a commit to Johannes-Andersen/Johannes that referenced this pull request Jun 18, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [wrangler](https://togithub.com/cloudflare/workers-sdk)
([source](https://togithub.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler))
| [`3.60.3` ->
`3.61.0`](https://renovatebot.com/diffs/npm/wrangler/3.60.3/3.61.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/wrangler/3.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/wrangler/3.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/wrangler/3.60.3/3.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/wrangler/3.60.3/3.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>cloudflare/workers-sdk (wrangler)</summary>

###
[`v3.61.0`](https://togithub.com/cloudflare/workers-sdk/blob/HEAD/packages/wrangler/CHANGELOG.md#3610)

##### Minor Changes

- [#&#8203;5995](https://togithub.com/cloudflare/workers-sdk/pull/5995)
[`374bc44`](https://togithub.com/cloudflare/workers-sdk/commit/374bc44cce65e2f83f10452122719d3ab28827b3)
Thanks [@&#8203;petebacondarwin](https://togithub.com/petebacondarwin)!
- feat: allow Durable Object migrations to be overridable in
environments

By making the `migrations` key inheritable, users can provide different
migrations
    for each wrangler.toml environment.

Resolves
[#&#8203;729](https://togithub.com/cloudflare/workers-sdk/issues/729)

##### Patch Changes

- [#&#8203;6039](https://togithub.com/cloudflare/workers-sdk/pull/6039)
[`dc597a3`](https://togithub.com/cloudflare/workers-sdk/commit/dc597a38218b428141c55c4e65633953c87ed180)
Thanks [@&#8203;petebacondarwin](https://togithub.com/petebacondarwin)!
- fix: hybrid nodejs compat now supports requiring the default export of
a CJS module

Fixes
[#&#8203;6028](https://togithub.com/cloudflare/workers-sdk/issues/6028)

- [#&#8203;6051](https://togithub.com/cloudflare/workers-sdk/pull/6051)
[`15aff8f`](https://togithub.com/cloudflare/workers-sdk/commit/15aff8f6e6ce533f25495193e702a6bec76fa81c)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
fix: Don't check expiry dates on custom certs

Fixes
[cloudflare/workers-sdk#5964

For `wrangler dev`, we don't have to check whether certificates have
expired when they're provided by the user.

- [#&#8203;6052](https://togithub.com/cloudflare/workers-sdk/pull/6052)
[`b4c0233`](https://togithub.com/cloudflare/workers-sdk/commit/b4c02333829c2312f883e897f812f9877dba603a)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
chore: Add `.wrangler` and `.DS_Store` to `.gitignore` generated by
`wrangler init`

This commit adds a small QOL improvement to `init` (to be deprecated in
the future), for those who still use this wrangler command.

- [#&#8203;6050](https://togithub.com/cloudflare/workers-sdk/pull/6050)
[`a0c3327`](https://togithub.com/cloudflare/workers-sdk/commit/a0c3327dd63059d3e24085a95f48f8a98605c49f)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
chore: Normalize more deps

This is the last of the patches that normalize dependencies across the
codebase. In this batch: `ws`, `vitest`, `zod` , `rimraf`,
`@types/rimraf`, `ava`, `source-map`, `glob`, `cookie`, `@types/cookie`,
`@microsoft/api-extractor`, `@types/mime`, `@types/yargs`,
`devtools-protocol`, `@vitest/ui`, `execa`, `strip-ansi`

    This patch also sorts dependencies in every `package.json`

- [#&#8203;6029](https://togithub.com/cloudflare/workers-sdk/pull/6029)
[`f5ad1d3`](https://togithub.com/cloudflare/workers-sdk/commit/f5ad1d3e562ce63b59f6ab136f1cdd703605bca4)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
chore: Normalize some dependencies in workers-sdk

This is the first of a few expected patches that normalize dependency
versions, This normalizes `undici`, `concurrently`, `@types/node`,
`react`, `react-dom`, `@types/react`, `@types/react-dom`, `eslint`,
`typescript`. There are no functional code changes (but there are a
couple of typecheck fixes).

- [#&#8203;6046](https://togithub.com/cloudflare/workers-sdk/pull/6046)
[`c643a81`](https://togithub.com/cloudflare/workers-sdk/commit/c643a8193a3c0739b33d3c0072ae716bc8f1565b)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
chore: Normalize more dependencies.

Follow up to
[cloudflare/workers-sdk#6029,
this normalizes some more dependencies : `get-port`, `chalk`, `yargs`,
`toucan-js`, `@typescript-eslint/parser`,
`@typescript-eslint/eslint-plugin`, `esbuild-register`, `hono`,
`glob-to-regexp`, `@cloudflare/workers-types`

- [#&#8203;6058](https://togithub.com/cloudflare/workers-sdk/pull/6058)
[`31cd51f`](https://togithub.com/cloudflare/workers-sdk/commit/31cd51f251050b0d6db97857a8d1d5427c855d99)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
chore: Quieter builds

This patch cleans up warnings we were seeing when doing a full build.
Specifically:

- fixtures/remix-pages-app had a bunch of warnings about impending
features that it should be upgraded to, so I did that. (tbh this one
needs a full upgrade of packages, but we'll get to that later when we're
upgrading across the codebase)
- updated `@microsoft/api-extractor` so it didn't complain that it
didn't match the `typescript` version (that we'd recently upgraded)
- it also silenced a bunch of warnings when exporting types from
`wrangler`. We'll need to fix those, but we'll do that when we work on
unstable_dev etc.
- workers-playground was complaining about the size of the bundle being
generated, so I increased the limit on it

- [#&#8203;6043](https://togithub.com/cloudflare/workers-sdk/pull/6043)
[`db66101`](https://togithub.com/cloudflare/workers-sdk/commit/db661015d37ce75c021413e3ca7c4f0488790cbc)
Thanks [@&#8203;threepointone](https://togithub.com/threepointone)! -
fix: avoid esbuild warning when running dev/bundle

I've been experimenting with esbuild 0.21.4 with wrangler. It's mostly
been fine. But I get this warning every time

▲ [WARNING] Import "__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__" will
always be undefined because there is no matching export in
"src/index.ts" [import-is-undefined]

.wrangler/tmp/bundle-Z3YXTd/middleware-insertion-facade.js:8:23:
8 │ .....(OTHER_EXPORTS.__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__ ??
[]),
                ╵

This is because esbuild@0.18.5 enabled a warning by default whenever an
undefined import is accessed on an imports object. However we abuse
imports to inject stuff in `middleware.test.ts`. A simple fix is to only
inject that code in tests.

- [#&#8203;6062](https://togithub.com/cloudflare/workers-sdk/pull/6062)
[`267761b`](https://togithub.com/cloudflare/workers-sdk/commit/267761b3f5a60e9ea72067d42302895f9d459460)
Thanks [@&#8203;WalshyDev](https://togithub.com/WalshyDev)! - fix: typo
in `wrangler d1 execute` saying "Databas" instead of "Database"

- [#&#8203;6064](https://togithub.com/cloudflare/workers-sdk/pull/6064)
[`84e6aeb`](https://togithub.com/cloudflare/workers-sdk/commit/84e6aeb189a4f385c49b7c6d451d0613186b29be)
Thanks [@&#8203;helloimalastair](https://togithub.com/helloimalastair)!
- fix: Wrangler is now able to upload files to local R2 buckets above
the 300 MiB limit

- Updated dependencies
\[[`a0c3327`](https://togithub.com/cloudflare/workers-sdk/commit/a0c3327dd63059d3e24085a95f48f8a98605c49f),
[`f5ad1d3`](https://togithub.com/cloudflare/workers-sdk/commit/f5ad1d3e562ce63b59f6ab136f1cdd703605bca4),
[`31cd51f`](https://togithub.com/cloudflare/workers-sdk/commit/31cd51f251050b0d6db97857a8d1d5427c855d99)]:
    -   miniflare@3.20240610.1
-
[@&#8203;cloudflare/kv-asset-handler](https://togithub.com/cloudflare/kv-asset-handler)[@&#8203;0](https://togithub.com/0).3.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Johannes-Andersen/Johannes).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution [Holopin] Recognizes an open-source contribution, big or small e2e Run e2e tests on a PR
4 participants