A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
2 folders · 18 files

src
test
.gitignore
build.mjs
COMMANDS.md
COMPONENT.md
entry.mjs
fluentci-module.toml
fluentci.lock
legacy-entry.mjs
legacy-schema.json
LICENSE
module-dependencies.json
OPTIONS.md
package-lock.json
package.json
README.md
schema.json
spago.lock
spago.yaml
README.md

Prisma #

Validate schemas, generate clients, inspect migration state, and deploy committed Prisma ORM migrations. PureScript typed Wasm component for FluentCI v0.17.3+.

fluentci run prisma validate --project . --run-dir /tmp/prisma-validate-1 --config prisma.config.ts
fluentci run prisma generate --project . --run-dir /tmp/prisma-generate-1 --generators client,reporting
fluentci run prisma migrate-deploy --project . --run-dir /tmp/prisma-deploy-1 --config prisma.config.ts
fluentci run prisma run --run-dir /tmp/prisma-help-1 --arguments migrate,deploy,--help

Functions: run, version, init, generate, validate, format, db-pull, db-push, db-seed, db-execute, migrate-deploy, migrate-status, migrate-dev, migrate-reset, migrate-resolve, migrate-diff, debug, studio. All named arguments and typed return values are described in COMPONENT.md; native flag mappings are in OPTIONS.md.

The component depends on setup-prisma. If prisma is missing, it invokes setup automatically and verifies that the executable is available. An existing CLI is reused. To select an exact version, run setup first; to use the project-local CLI, pass --executable ./node_modules/.bin/prisma. Explicit executable overrides skip automatic setup. Publishing composes the dependency; the relative source path is not required on consumers' machines. See module dependencies.

Install project dependencies with the project lockfile before running these functions. Setup installs the CLI only, not the project's ORM/client, adapters, drivers or generated code. Run from the project directory using --project. A supplied --config must exist before setup or database operations start. Omitted config uses native discovery.

Named functions target Prisma ORM 7.x, with setup default 7.8.0. The npm latest tag currently points to a v8 release candidate with a different command surface. Pin compatible versions of Prisma CLI and your project client. Use prisma.config.ts for datasource and migrations configuration; Prisma 7 requires explicit environment loading in this config (for example import "dotenv/config"). migrate-diff delegates source exclusivity checks to Prisma. With --exit-code, drift exits 2 and fails the module call. migrate-dev and migrate-reset are for disposable development databases. Production jobs should use migrate-deploy. studio is a foreground service bounded by timeout-ms.

Credentials such as DATABASE_URL belong in the runner environment and project configuration. The wrapper inherits this environment without copying credentials into argument reports. Native CLI output can still contain connection details; protect the execution logs.

No destructive approval is enabled by default. Explicit force/data-loss/reset arguments retain upstream behavior. Each call requires a fresh --run-dir; failures propagate as module errors. Successful calls return typed outcome, run-dir, report-path, stdout-path and stderr-path, rather than claiming to return rows or SQL. Read generated SQL from stdout or a configured output file. Collect outputs using comma-separated --artifacts NAME=PATH entries.

Optional --arguments appends literal tokens for flags beyond the named contract. Lists use comma-separated strings; whitespace is trimmed and empty entries are rejected. For a token containing a comma, use CSV double quotes inside the argument string. No shell evaluation occurs.

Official CLI documentation · MIT license.

Compose this module from code #

Requires FluentCI 0.17.6 or newer for generated pipeline bindings. From your caller module's directory, add the dependency:

fluentci add prisma --path /path/to/fluentci-modules/databases/prisma

For a published module, use fluentci add @fluentci.io/prisma@VERSION with an available version. Commit the caller's manifest and lockfile. FluentCI generates named bindings from the installed component's WIT; no handwritten FFI or CLI subprocess is needed. Include generated source directories in the caller's SDK project. The callee can use a different SDK from the caller.

Validate the project Prisma schema.

Replace the sample organization, paths and identifiers with your own. Configure credentials through your CI secret provider before running authenticated operations. Optional arguments use the callee's defaults, and public list fields use comma-separated strings. See COMPONENT.md for argument descriptions and return types.

These examples use the generated composition API and builder chaining in FluentCI 0.17.6; full cross-SDK compilation and execution coverage is still pending. See composition support and limitations.

PureScript #

module Main where

import Prelude
import Effect (Effect)
import FluentCI.Flow as Flow
import FluentCI.Modules.Prisma as Prisma

run :: Effect String
run =
  Flow.pipeline "prisma-validate"
    # Flow.workdir "."
    # Prisma.validate (Prisma.validateArgs)
    # Flow.map (\result -> result.reportPath)
    # Flow.run

Gleam #

import fluentci/flow
import fluentci_modules/prisma

pub fn run() -> String {
  flow.pipeline("prisma-validate")
  |> flow.workdir(".")
  |> prisma.validate(prisma.validate_args())
  |> flow.map(fn(result) { result.report_path })
  |> flow.run
}

Use Gleam's JavaScript target for the Wasm guest. BEAM escripts used for repository automation are separate from component guests.

Elixir #

defmodule Main do
  use FluentCI.Plugin
  alias FluentCI.Flow
  alias FluentCI.Modules.Prisma

  defplugin run do
    Flow.pipeline("prisma-validate")
    |> Flow.workdir(".")
    |> Prisma.validate(%{})
    |> Flow.stdout()
  end
end

Elixir compiles this sequence to Rust/Wasm. Its initial Flow API does not yet provide the typed result callbacks or cleanup combinators of the other examples.

ClojureScript #

(ns main.plugin
  (:require [fluentci.flow :as flow]
            [fluentci-modules.prisma :as prisma]))

(defn run []
  (-> (flow/pipeline "prisma-validate")
      (flow/workdir ".")
      (prisma/validate {})
      flow/run!))

ReScript #

let run = (): string =>
  Flow.pipeline("prisma-validate")
  ->Flow.workdir(".")
  ->FluentciModulesPrisma.validate(FluentciModulesPrisma.validateArgs)
  ->Flow.map(result => result.reportPath)
  ->Flow.run

Python #

from fluentci.flow import pipeline
from fluentci_modules import prisma


def run() -> str:
    return (
        pipeline("prisma-validate")
        .workdir(".")
        .pipe(prisma.validate, {})
        .map(lambda result: result.report_path)
        .run()
    )

TypeScript #

import * as flow from "./fluentci_modules/flow";
import * as prisma from "./fluentci_modules/prisma/index";

export function run(): string {
  return flow.pipeline("prisma-validate")
    .workdir(".")
    .pipe(prisma.validate, {})
    .map(result => result.reportPath)
    .run();
}

Python and TypeScript use FluentCI builder chains: .pipe(module.function, args) composes generated module functions with .workdir, .env, and .exec. Functions return a pipeline carrying their typed result. Use a generated result callback (With/_with, or a callback argument in TypeScript/Python) when a later module needs a preceding result; use Flow's map operation to select a result field. Execution begins at run (or the Elixir plugin terminal), in declared order.

Exported functions #

Function Purpose
run Execute literal Prisma CLI arguments, including version-specific features.
version Print the Prisma CLI and engine versions.
init Initialize a Prisma project; configure the datasource explicitly for unattended jobs.
generate Generate project clients from the Prisma schema without applying migrations.
validate Validate the project Prisma schema.
format Format schemas or fail a formatting check without writing changes.
db_pull Introspect the database; print avoids rewriting the project schema.
db_push Synchronize schema without migrations; data loss and reset flags are explicit.
db_seed Run the project seed command configured in Prisma config.
db_execute Execute an existing SQL script using the configured datasource.
migrate_deploy Apply pending committed migrations noninteractively in deployment pipelines.
migrate_status Report migration status; propagate divergence and pending-migration failures.
migrate_dev Create and apply development migrations; use migrate-deploy for production.
migrate_reset Reset a disposable development database; destructive confirmation is explicit.
migrate_resolve Record a migration as applied or rolled back; choose exactly one in Prisma.
migrate_diff Compare schema sources; native Prisma requires exactly one from and one to source.
debug Print Prisma diagnostic information for troubleshooting.
studio Run the long-lived Studio server within a scoped service lifecycle.