Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@storm-software/cloudflare-tools
Advanced tools
⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.
[!IMPORTANT] This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
A package containing tools for managing a Storm workspace. It includes various Nx generators and executors for common development tasks.
This library was generated with Nx.
Using pnpm:
pnpm add -D @storm-software/cloudflare-tools
npm install -D @storm-software/cloudflare-tools
yarn add -D @storm-software/cloudflare-tools
The following executors are available in this package to invoke common tasks for the workspace's projects:
Publish a Cloudflare worker using the Wrangler CLI
This executor can be used by executing the following in a command line utility:
nx run my-project:cloudflare-publish
Please note: The cloudflare-publish executor should be included in the desired projects's project.json
file.
The following executor options are available:
Option | Type | Description | Default |
---|---|---|---|
name | string | Name of the Worker. | |
noBundle | boolean | Skip Wrangler’s build steps and directly deploy script without modification. Particularly useful when using custom builds. | |
env | string | Perform on a specific environment. | |
outdir | string | Path to directory where Wrangler will write the bundled Worker files. | |
compatibilityDate | string | A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. | |
compatibilityFlags | string[] | Flags to use for compatibility checks. | |
latest | boolean | Use the latest version of the Workers runtime. | true |
assets | string | Root folder of static assets to be served. Unlike --site, --assets does not require a Worker script to serve your assets. | |
site | string | Root folder of static assets for Workers Sites. | |
siteInclude | string[] | Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded. | |
siteExclude | string[] | Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded. | |
var | string[] | Array of key:value pairs to inject as variables into your code. The value will always be passed as a string to your Worker. | |
define | string[] | Array of key:value pairs to replace global identifiers in your code. | |
triggers | string[] | Cron schedules to attach to the deployed Worker. Refer to Cron Trigger Examples. | |
routes | string[] | Routes where this Worker will be deployed. | |
tsConfig | string | Path to a custom tsconfig.json file. | |
minify | boolean | Minify the bundled script before deploying. | |
nodeCompat | boolean | Enable node.js compatibility. | |
keepVars | boolean | It is recommended best practice to treat your Wrangler developer environment as a source of truth for your Worker configuration, and avoid making changes via the Cloudflare dashboard. If you change your environment variables or bindings in the Cloudflare dashboard, Wrangler will override them the next time you deploy. If you want to disable this behavior set keepVars to true. |
Serve a worker locally for development using the Wrangler CLI
This executor can be used by executing the following in a command line utility:
nx run my-project:serve
Please note: The serve executor should be included in the desired projects's project.json
file.
The following executor options are available:
Option | Type | Description | Default |
---|---|---|---|
name | string | Name of the Worker. | |
noBundle | boolean | Skip Wrangler’s build steps and show a preview of the script without modification. Particularly useful when using custom builds. | |
env | string | Perform on a specific environment. | |
compatibilityDate | string | A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. | |
compatibilityFlags | string[] | Flags to use for compatibility checks. | |
latest | boolean | Use the latest version of the Workers runtime. | true |
ip | string | IP address to listen on, defaults to localhost. | |
port | number | Port to listen on. | 8787 |
inspectorPort | number | Port for devtools to connect to. | |
routes | string[] | Routes to upload. | |
host | string | Host to forward requests to, defaults to the zone of the project. | |
localProtocol | "http" | "https" | Protocol to listen to requests on. | "http" |
localUpstream | string | Host to act as origin in local mode, defaults to dev.host or route. | |
assets | string | Root folder of static assets to be served. Unlike --site, --assets does not require a Worker script to serve your assets. | |
site | string | Root folder of static assets for Workers Sites. | |
siteInclude | string[] | Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded. | |
siteExclude | string[] | Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded. | |
upstreamProtocol | "http" | "https" | Protocol to forward requests to host on. | "https" |
var | string[] | Array of key:value pairs to inject as variables into your code. The value will always be passed as a string to your Worker. | |
define | string[] | Array of key:value pairs to replace global identifiers in your code. | |
tsconfig | string | Path to a custom tsconfig.json file. | |
minify | boolean | Minify the script. | |
nodeCompat | boolean | Enable node.js compatibility. | |
persistTo | string | Specify directory to use for local persistence. | |
remote | boolean | Develop against remote resources and data stored on Cloudflare’s network. | |
testScheduled | boolean | Exposes a /__scheduled fetch route which will trigger a scheduled event (cron trigger) for testing during development. | |
logLevel | "debug" | "info" | "log" | "warn" | "error" | "none" | Specify Wrangler’s logging level. | "log" |
Publish files in a package by uploading the contents to a Cloudflare R2 bucket
This executor can be used by executing the following in a command line utility:
nx run my-project:r2-upload-publish
Please note: The r2-upload-publish executor should be included in the desired projects's project.json
file.All required options must be included in the options
property of the json.
The following executor options are available:
Option | Type | Description | Default |
---|---|---|---|
registry * | string | The URL of the R2 bucket to publish the package to. | |
bucketId | string | The ID of the R2 Bucket in Cloudflare. | |
packageRoot | string | The root directory of the directory (containing a manifest file at its root) to publish. Defaults to the project root. | |
tsConfig * | string | The path to the `tsconfig.json` file. | "{projectRoot}/tsconfig.json" |
dryRun | boolean | Whether to run the command without actually publishing the package to the registry. | |
verbose | boolean | Should write extra log outputs with details from the executor. |
Please note: Option names followed by * above are required, and must be provided to run the executor.
The following generators are available with this package to assist in workspace management:
Init Cloudflare tools Nx Plugin in the Storm Workspace
The following executor options are available:
Option | Type | Description | Default |
---|---|---|---|
unitTestRunner | "vitest" | "jest" | "none" | Test runner to use for unit tests. | "vitest" |
skipFormat | boolean | Skip formatting files. | |
js | boolean | Use JavaScript instead of TypeScript | |
template | "fetch-handler" | "scheduled-handler" | "hono" | "none" | Generate the initial worker using a template. |
Please note: Option names followed by * above are required, and must be provided to run the executor.
Create a Cloudflare Worker Application
The following executor options are available:
Option | Type | Description | Default |
---|---|---|---|
name * | string | The name of the worker | |
js | boolean | Use JavaScript instead of TypeScript | |
projectNameAndRootFormat | "as-provided" | "derived" | Whether to generate the project name and root directory as provided (as-provided ) or generate them composing their values and taking the configured layout into account (derived ). | |
tags | string | Add tags to the application (used for linting). | |
frontendProject | string | Frontend project that needs to access this application. This sets up proxy configuration. | |
unitTestRunner | "vitest" | "none" | Test runner to use for unit tests. | "vitest" |
template | "fetch-handler" | "scheduled-handler" | "hono" | "none" | Generate the initial worker using a template. | "fetch-handler" |
port | number | The port in which the worker will be run on development mode | 8787 |
accountId | string | The Cloudflare account identifier where the worker will be deployed | |
directory | string | The directory of the new application. | |
rootProject | boolean | Create worker application at the root of the workspace | |
skipFormat | boolean | Skip formatting files. |
Please note: Option names followed by * above are required, and must be provided to run the executor.
Run nx build cloudflare-tools
to build the library.
Run nx test cloudflare-tools
to execute the unit tests via
Jest.
Storm workspaces are built using Nx, a set of extensible dev tools for monorepos, which helps you develop like Google, Facebook, and Microsoft. Building on top of Nx, the Open System provides a set of tools and patterns that help you scale your monorepo to many teams while keeping the codebase maintainable.
See the open issues for a list of proposed features (and known issues).
Reach out to the maintainer at one of the following places:
This project is licensed under the Apache License 2.0. Feel free to edit and distribute this template as you like.
See LICENSE for more information.
This project adheres to Semantic Versioning. Every release, along with the migration instructions, is documented in the CHANGELOG file
First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please try to create bug reports that are:
Please adhere to this project's code of conduct.
You can use markdownlint-cli to check for common markdown style inconsistency.
Thanks goes to these wonderful people (emoji key):
Patrick Sullivan 🎨 💻 🔧 📖 ⚠️ | Tyler Benning 🎨 | Stormie 🚧 |
Add your contributions |
This project follows the all-contributors specification. Contributions of any kind welcome!
Storm Software is an open source software development organization and creator of Acidic, StormStack and StormCloud.
Our mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
Join us on Discord to chat with the team, receive release notifications, ask questions, and get involved.
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our website or join our Slack channel!
FAQs
⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.
We found that @storm-software/cloudflare-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.