JSPM

  • Created
  • Published
  • Downloads 1935
  • Score
    100M100P100Q125375F
  • License MIT

Nx plugin for Cloudflare

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@naxodev/nx-cloudflare) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    MIT commitizen PRs styled with prettier Nx Cloudflare is an Nx plugin for Cloudflare, in particular Cloudflare workers.

    Features

    • ✅ Generate Cloudflare Worker Application
    • ✅ Include Fetch Handler template
    • ✅ Include Scheduled Handler template
    • ✅ Vitest tests support
    • ✅ Serve and Publish executors

    Installation

    Nx Cloudflare is published as the @naxodev/nx-cloudflare package.

    Toolchain Command
    NPM CLI npm install @naxodev/nx-cloudflare
    PNPM CLI pnpm add @naxodev/nx-cloudflare
    Yarn CLI yarn add @naxodev/nx-cloudflare

    Usage

    Generating new Cloudflare Worker Application

    nx g @naxodev/nx-cloudflare:application my-worker-app

    The available options are the following:

    Option Type Default Description
    name string *required What name would you like to use?
    template fetch-handler, scheduled-handler, none fetch-handler Which worker template do you want to use?
    port number 8787 The port in which the worker will be run on development mode
    js boolean false Use JavaScript instead of TypeScript
    tags string null Add tags to the application (used for linting).
    frontendProject string null Frontend project that needs to access this application. This sets up proxy configuration.
    unitTestRunner vitest, none vitest Test runner to use for unit tests.
    directory string null The directory of the new application.
    rootProject boolean false Create worker application at the root of the workspace
    skipFormat boolean false Skip formatting files.

    Serve worker on dev mode

    nx serve <my-app>

    The available options are the following:

    Option Type Default Description
    port number 8787 The port in which the worker will be run on development mode

    Publish worker to Cloudflare

    nx publish <my-app>

    Acknowledgement

    This project is heavily inspired in the work done by other Nx Champions, check out their projects.

    Contributors

    Thanks goes to these wonderful people (emoji key):

    Nacho Vazquez
    Nacho Vazquez

    🐛 💻 📖 💡 🤔 🧑‍🏫 🚧 📆 👀 ⚠️ 🔧 📓

    Collaborators

    • nacho_vazquez

    Keywords

    Dependencies