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

Deploy as CF Worker (again) + CLI installer [WIP] #151

Closed
wants to merge 1 commit into from
Closed

Conversation

benvinegar
Copy link
Owner

This is a large-ish PR which does the following:

  • Deploys Counterscale as a Worker again (as it did originally)
  • Introduces a new package, @counterscale/cli, which is a command line installer for Counterscale
    • This CLI installer significantly reduces the number of commands you need to run in order to deploy Counterscale (see below)
  • Publishes @counterscale/server as a package
    • This package is used by the CLI installer
    • This also means you no longer need to manually download/clone the latest release from GitHub

👋 Feedback greatly appreciated...

CLI Usage

First, install the CLI installer via your favorite package manager:

npm install @counterscale/cli
npm install -g @counterscale/cli # Globally

Sign into your Cloudflare account using Wrangler:

npx wrangler login

Run the installer and follow steps:

counterscale

If you want to set your own worker name and data set name, use:

counterscale --advanced

Here's what the output looks like:

counterscale-cli-output

Upgrade notes

Deploying will prompt you to create a Worker named "counterscale" (vs. a Pages project called "counterscale", previously). Your data will stay as it was / no change necessary there.

I'm debating making this a major release (3.0.0) because there is a "breaking" change.

* Migrate back to Cloudflare Workers

* Delete deprecated CF pages files
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.

Project coverage is 86.47%. Comparing base (7c28341) to head (d596427).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/server/workers/app.ts 0.00% 31 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
- Coverage   87.00%   86.47%   -0.54%     
==========================================
  Files          38       37       -1     
  Lines        2439     2454      +15     
  Branches      302      301       -1     
==========================================
  Hits         2122     2122              
- Misses        309      325      +16     
+ Partials        8        7       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benvinegar
Copy link
Owner Author

Closing this PR so that I can change the source branch to v3-cli, and the target branch will be v3.

@benvinegar benvinegar closed this Jan 28, 2025
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.

1 participant