Skip to content

fix(create-cloudflare): bump vitest-pool-workers version on the templates#7827

Merged
andyjessop merged 12 commits intomainfrom
edmundhung/fix-vpw-version-on-c3-templates
Jan 21, 2025
Merged

fix(create-cloudflare): bump vitest-pool-workers version on the templates#7827
andyjessop merged 12 commits intomainfrom
edmundhung/fix-vpw-version-on-c3-templates

Conversation

@edmundhung
Copy link
Copy Markdown
Member

@edmundhung edmundhung commented Jan 20, 2025

Fixes #7815.


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: package version bump

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: 583d551

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

This PR includes changesets to release 1 package
Name Type
create-cloudflare 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 20, 2025

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/12888773890/npm-package-wrangler-7827

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-wrangler-7827 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-workers-bindings-extension-7827 -O ./cloudflare-workers-bindings-extension.0.0.0-v566bdc5be.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v566bdc5be.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-create-cloudflare-7827 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-kv-asset-handler-7827

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-miniflare-7827

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-pages-shared-7827

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-unenv-preset-7827

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-vite-plugin-7827

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-vitest-pool-workers-7827

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-workers-editor-shared-7827

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-workers-shared-7827

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12888773890/npm-package-cloudflare-workflows-shared-7827

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


wrangler@3.103.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241230.2
workerd 1.20241230.0 1.20241230.0
workerd --version 1.20241230.0 2024-12-30

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

@edmundhung edmundhung added the e2e Run wrangler + vite-plugin e2e tests on a PR label Jan 20, 2025
@edmundhung edmundhung marked this pull request as ready for review January 20, 2025 17:16
@edmundhung edmundhung requested a review from a team as a code owner January 20, 2025 17:16
@edmundhung edmundhung requested a review from a team January 20, 2025 17:16
Comment thread packages/create-cloudflare/e2e-tests/workers.test.ts Outdated
Comment thread packages/create-cloudflare/e2e-tests/helpers.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this feels like something we should be doing for all C3 starter projects that come accompanied by tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Afaik only hello-world and the experimental hello-world-with-assets template (js/ts) includes some tests. But there is no e2e tests for non-framework experimental templates. Let me see if I can set it up for the assets template 👍🏼

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added tests for all non-framework experimental templates on 6865673 and c180e93

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@edmundhung you are the abs best!!!! ♥️

@edmundhung edmundhung force-pushed the edmundhung/fix-vpw-version-on-c3-templates branch from f12136c to 6865673 Compare January 20, 2025 17:59
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🥹 sooo prity 🫶

@edmundhung edmundhung force-pushed the edmundhung/fix-vpw-version-on-c3-templates branch from 0739dc4 to 1d45ce9 Compare January 21, 2025 12:04
@edmundhung edmundhung force-pushed the edmundhung/fix-vpw-version-on-c3-templates branch from 1d45ce9 to d3e1866 Compare January 21, 2025 13:49
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will probably break the e2e cleanup scripts—is there a reason this needed to be changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! That might explains why some e2e tests are failing 😅

We are using prefix + random suffix + template name + language as the project name on the e2e tests and some of the templates end up with a project name more than 58 chars. So I was thinking if we can shrink the prefix a bit to save a few chars.. but maybe I should just trim it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reverted in 583d551

@edmundhung
Copy link
Copy Markdown
Member Author

@CarmenPopoviciu @penalosa This is ready for review again 👍🏼

{
template: "scheduled",
variants: ["TypeScript", "JavaScript"],
variants: ["ts", "js"],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All the variant name is changed as

  1. It is now passed as --lang [lang] instead of going through a prompt and have the test script figure out the right answer.
  2. They are part of the project name and might become too long depending on the template name. It should be less likly to be over 58 chars now.

Comment on lines -112 to -120
promptHandlers: [
{
matcher: /Which language do you want to use\?/,
input: {
type: "select",
target: variant,
},
},
],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We are now passing the --lang arg directly instead of trying to answer the prompt.

Comment on lines -140 to -142
const gitignorePath = join(project.path, ".gitignore");
expect(gitignorePath).toExist();

Copy link
Copy Markdown
Member Author

@edmundhung edmundhung Jan 21, 2025

Choose a reason for hiding this comment

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

The asset-only template has no .gitignore. I could have add an options to skip this check but I think we shouldn't assume .gitignore exists on all template especially when the git setup on c3 is optional.

Comment on lines +203 to +205
if (config.main) {
expect(join(project.path, config.main)).toExist();
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The asset-only template has no main file 😅

@andyjessop andyjessop merged commit 6c2e943 into main Jan 21, 2025
@andyjessop andyjessop deleted the edmundhung/fix-vpw-version-on-c3-templates branch January 21, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 BUG: npm test fails on fresh hello world create cloudflare project

4 participants