Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1548,9 +1548,12 @@ This will generate the following CSS :

<!-- /md:generate -->

Warnings never fail the build. The CLI prints each one to stderr as
`cssforge: warning: <message>` and still writes the outputs, and `getDiagnostics(config)`
returns them to programmatic callers (see [Programmatic Usage](#programmatic-usage)).
Warnings never fail the build: the CLI still writes the outputs and exits with `0`. On a
terminal, it prints each warning as `warning <path>: <message>` after the files written
(`cssforge generate` prints them to stderr, so that stdout has only the generated content).
In JSON output they are the `diagnostics` of the result (see [CLI Usage](#cli-usage)), and
`getDiagnostics(config)` returns them to programmatic callers (see
[Programmatic Usage](#programmatic-usage)).

#### Fluid Typography with pow()

Expand Down Expand Up @@ -2061,6 +2064,17 @@ const result = await session.call(tokensBuild, { mode: "css" });
if (!result.ok) console.error(result.error._tag, result.error.message);
```

A call prints nothing: the warnings are in `result.value.diagnostics` when `result.ok` is
`true`, and the caller reports them:

```typescript
if (result.ok) {
for (const { path, message } of result.value.diagnostics) {
console.warn(`warning ${path}: ${message}`);
}
}
```

## Programmatic Usage

You can also use CSS Forge programmatically:
Expand Down
20 changes: 17 additions & 3 deletions packages/cssforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1548,9 +1548,12 @@ This will generate the following CSS :

<!-- /md:generate -->

Warnings never fail the build. The CLI prints each one to stderr as
`cssforge: warning: <message>` and still writes the outputs, and `getDiagnostics(config)`
returns them to programmatic callers (see [Programmatic Usage](#programmatic-usage)).
Warnings never fail the build: the CLI still writes the outputs and exits with `0`. On a
terminal, it prints each warning as `warning <path>: <message>` after the files written
(`cssforge generate` prints them to stderr, so that stdout has only the generated content).
In JSON output they are the `diagnostics` of the result (see [CLI Usage](#cli-usage)), and
`getDiagnostics(config)` returns them to programmatic callers (see
[Programmatic Usage](#programmatic-usage)).

#### Fluid Typography with pow()

Expand Down Expand Up @@ -2061,6 +2064,17 @@ const result = await session.call(tokensBuild, { mode: "css" });
if (!result.ok) console.error(result.error._tag, result.error.message);
```

A call prints nothing: the warnings are in `result.value.diagnostics` when `result.ok` is
`true`, and the caller reports them:

```typescript
if (result.ok) {
for (const { path, message } of result.value.diagnostics) {
console.warn(`warning ${path}: ${message}`);
}
}
```

## Programmatic Usage

You can also use CSS Forge programmatically:
Expand Down
Loading