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

Wrangler and C3: Move the cli folder of C3 into @cloudflare/cli and make Wrangler and C3 depend on it #4189

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

gabivlj
Copy link
Contributor

@gabivlj gabivlj commented Oct 16, 2023

What this PR solves:
We want to start using @clack/core and C3-like components in Wrangler, so the logical next step is to make these components available to wrangler and C3.

  1. ./helpers/cli.ts in C3 is now index.ts in @cloudflare/cli, didn't include openInBrowser,C3_DEFAULTS and WRANGLER_DEFAULTS.
  2. ./helpers/colors in C3 is now colors.ts in @cloudflare/cli.
  3. ./helpers/interactive.ts in C3 is now interactive.ts in @cloudflare/cli.

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@gabivlj gabivlj requested review from a team as code owners October 16, 2023 19:59
@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2023

🦋 Changeset detected

Latest commit: bf67717

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

This PR includes changesets to release 3 packages
Name Type
@cloudflare/cli Major
create-cloudflare 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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

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/6625416151/npm-package-wrangler-4189

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6625416151/npm-package-wrangler-4189 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6625416151/npm-package-cloudflare-pages-shared-4189

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


wrangler@3.14.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231016.0 3.20231016.0
workerd 1.20231016.0 1.20231016.0
workerd --version 1.20231016.0 2023-10-16

|

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

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #4189 (053fb2b) into main (773e2a8) will not change coverage.
Report is 2 commits behind head on main.
The diff coverage is n/a.

❗ Current head 053fb2b differs from pull request most recent head bf67717. Consider uploading reports for the commit bf67717 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4189   +/-   ##
=======================================
  Coverage   75.36%   75.36%           
=======================================
  Files         223      223           
  Lines       12259    12259           
  Branches     3171     3171           
=======================================
  Hits         9239     9239           
  Misses       3020     3020           

Copy link
Contributor

@jculvey jculvey left a comment

Choose a reason for hiding this comment

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

Changes LGTM. I've been intending to revisit some of the naming in interactive.ts for a while, which I'd still like to do at some point. I'm curious to hear more about your use case, perhaps we can chat some time.

@@ -0,0 +1,8 @@
import { describe, expect, test } from "vitest";
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want this to run in CI I think we'll have to add a workflow to .github/workflows

packages/cli/.eslintrc.js Outdated Show resolved Hide resolved
@gabivlj
Copy link
Contributor Author

gabivlj commented Oct 17, 2023

Changes LGTM. I've been intending to revisit some of the naming in interactive.ts for a while, which I'd still like to do at some point. I'm curious to hear more about your use case, perhaps we can chat some time.

Sure! We also want to introduce some changes we did where we added a multiselect component, perhaps we can discuss those naming changes in that future PR and talk more about our interactivity use-cases.

@gabivlj gabivlj force-pushed the gv/cli branch 2 times, most recently from 9d3131c to 65a39a9 Compare October 17, 2023 18:59
Copy link
Contributor

Choose a reason for hiding this comment

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

This file shouldn't be needed—checks should run as part of the monorepo setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Just added it because of the suggestion above. Anyway I think that makes sense.

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'll want to publish this to npm (at least initially), so this should be set to private

Comment on lines 6 to 12
"compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"moduleResolution": "node",
"allowJs": false,
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"types": ["node"],
"resolveJsonModule": true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How many of these options are necessary given the base config of workers-tsconfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to keep it barebones

@gabivlj
Copy link
Contributor Author

gabivlj commented Oct 19, 2023

Rebased

@gabivlj gabivlj force-pushed the gv/cli branch 2 times, most recently from d45e346 to 1a0bc84 Compare October 23, 2023 11:46
@gabivlj
Copy link
Contributor Author

gabivlj commented Oct 23, 2023

Rebased again

@gabivlj gabivlj force-pushed the gv/cli branch 4 times, most recently from d741cd7 to 053fb2b Compare October 23, 2023 14:46
@admah admah added the awaiting Cloudflare response Awaiting response from workers-sdk maintainer team label Oct 23, 2023
…ake Wrangler and C3 depend on it

We want to start using @clack/core and C3-like components in Wrangler, so the logical next step is to make these components available to wrangler and C3.

`./helpers/cli.ts` in C3 is now index.ts in @cloudflare/cli, didn't include openInBrowser,C3_DEFAULTS and WRANGLER_DEFAULTS.
`./helpers/colors` in C3 is now colors.ts in @cloudflare/cli.
`./helpers/interactive.ts` in C3 is now interactive.ts in @cloudflare/cli.
@gabivlj gabivlj merged commit 0579803 into cloudflare:main Oct 24, 2023
21 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Cloudflare response Awaiting response from workers-sdk maintainer team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants