@xessa/cli 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +425 -24
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,43 +1,444 @@
|
|
|
1
1
|
# @xessa/cli
|
|
2
2
|
|
|
3
|
-
The Xessa command
|
|
4
|
-
|
|
3
|
+
The official Xessa command-line interface. It compiles `.cssx` sources to CSS, JavaScript class
|
|
4
|
+
maps, optional TypeScript declarations and optional source maps, and is a thin wrapper around
|
|
5
|
+
[`@xessa/compiler`](https://github.com/MARKjotep/xessa/blob/main/packages/compiler/README.md): the same parser, resolver and emitters that power the
|
|
6
|
+
API and the VS Code extension.
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
(
|
|
8
|
+
`@xessa/cli` is the command and operations reference. The complete language and compiler contract
|
|
9
|
+
lives in [`@xessa/compiler`](https://github.com/MARKjotep/xessa/blob/main/packages/compiler/README.md)
|
|
10
|
+
and the normative
|
|
11
|
+
[`SPECIFICATION.md`](https://github.com/MARKjotep/xessa/blob/main/SPECIFICATION.md); this page does
|
|
12
|
+
not restate the language.
|
|
13
|
+
|
|
14
|
+
The CLI depends on `@xessa/compiler`, so the complete spec and docs are installed at
|
|
15
|
+
`node_modules/@xessa/compiler/SPECIFICATION.md` and `node_modules/@xessa/compiler/docs/` — available
|
|
16
|
+
offline to npm and CLI users.
|
|
17
|
+
|
|
18
|
+
**0.1.1** is live on npm; **0.1.2** is release-ready, not yet published. Until 0.1.2 is live, use the
|
|
19
|
+
source-checkout workflow below or install the published 0.1.1.
|
|
20
|
+
|
|
21
|
+
## This README vs the language spec
|
|
22
|
+
|
|
23
|
+
| Question | Reference |
|
|
24
|
+
| ------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
25
|
+
| How do I install, run, configure and script it? | This page |
|
|
26
|
+
| What does a `.cssx` file mean? | [`@xessa/compiler`](https://github.com/MARKjotep/xessa/blob/main/packages/compiler/README.md) → [`SPECIFICATION.md`](https://github.com/MARKjotep/xessa/blob/main/SPECIFICATION.md) |
|
|
27
|
+
| How does the editor behave? | [`packages/vscode/README.md`](https://github.com/MARKjotep/xessa/blob/main/packages/vscode/README.md) |
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- **Node.js ≥ 20** or **Bun**. The CLI is ESM and ships built `dist` output; its `bin` entry is
|
|
32
|
+
`dist/index.js` with a `#!/usr/bin/env node` shebang, so a Node-only machine works.
|
|
33
|
+
- A runtime dependency on `@xessa/compiler` is installed with the CLI.
|
|
34
|
+
- Workspaces are ordinary directories. No framework, bundler or browser runtime is required.
|
|
8
35
|
|
|
9
36
|
## Install
|
|
10
37
|
|
|
11
|
-
|
|
12
|
-
|
|
38
|
+
### As a local development dependency
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm install -D @xessa/cli
|
|
42
|
+
# or
|
|
43
|
+
bun add -d @xessa/cli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This puts the `xessa` binary in `node_modules/.bin`. Use it directly or through your package
|
|
47
|
+
scripts:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
xessa build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`npx @xessa/cli build` also resolves the locally installed package when you prefer an explicit
|
|
54
|
+
scoped invocation.
|
|
55
|
+
|
|
56
|
+
### Globally
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm install -g @xessa/cli
|
|
60
|
+
xessa build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### One-off, without installing
|
|
13
64
|
|
|
14
65
|
```sh
|
|
15
|
-
npm install --global @xessa/cli
|
|
16
|
-
# or run it without installing
|
|
17
66
|
npx @xessa/cli build
|
|
67
|
+
bunx @xessa/cli build
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> **Important:** the unscoped `xessa` package on npm is the private repository root and is **not
|
|
71
|
+
> published**. Bare `npx xessa` therefore does not work. The `xessa` bin only exists after
|
|
72
|
+
> `@xessa/cli` is installed, or when you invoke the scoped package directly
|
|
73
|
+
> (`npx @xessa/cli`, `bunx @xessa/cli`).
|
|
74
|
+
|
|
75
|
+
### From a source checkout
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
bun install
|
|
79
|
+
bun run --cwd packages/compiler build
|
|
80
|
+
bun run --cwd packages/cli build
|
|
81
|
+
node packages/cli/dist/index.js --help
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The last command works without a global install; substitute its path for `xessa` anywhere below.
|
|
85
|
+
|
|
86
|
+
## 60-second quick start
|
|
87
|
+
|
|
88
|
+
### One file
|
|
89
|
+
|
|
90
|
+
Create `src/button.cssx`:
|
|
91
|
+
|
|
92
|
+
```cssx
|
|
93
|
+
@setup {
|
|
94
|
+
prefix: "ui";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.button {
|
|
98
|
+
display: flex;
|
|
99
|
+
padding: 12px @md 20px;
|
|
100
|
+
background: #2563eb;
|
|
101
|
+
&:hover { opacity: 0.85; }
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Compile it:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx @xessa/cli build src/button.cssx
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
With no configuration and no output overrides, both artifacts land next to the source:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
src/button.css # .ui-button rules, inline @md lowered to @media
|
|
115
|
+
src/button.map.js # export const button = "ui-button";
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Defaults: `css-dir` and `map-dir` are the source directory, CSS is `<stem>.css`, the map is
|
|
119
|
+
`<stem>.map.js`, and CSS is **minified** (`minify: true`). Add `map-types: true` in `@setup` to
|
|
120
|
+
emit `<stem>.map.d.ts`, and `source-map: true` for a `.map` artifact. Pass `--no-minify` for
|
|
121
|
+
readable CSS.
|
|
122
|
+
|
|
123
|
+
### A project
|
|
124
|
+
|
|
125
|
+
No configuration is required. From the workspace root:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npx @xessa/cli build
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`build` discovers `include: ["**/*.cssx"]` under the nearest workspace root and compiles every
|
|
132
|
+
entry. Add `xessa.config.json` only to change a default or scope discovery:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"include": ["src/**/*.cssx"],
|
|
137
|
+
"classes": { "strategy": "prefix", "prefix": "ui" }
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
See [Configuration](#configuration) below for the full shape.
|
|
142
|
+
|
|
143
|
+
## Command reference
|
|
144
|
+
|
|
145
|
+
Commands are `build`, `check`, `watch`, `format`, `clean` and the `help`/`version` shortcuts.
|
|
146
|
+
Parsing is strict: unknown flags, extra positional arguments, a missing flag value and a missing
|
|
147
|
+
command are invocation errors (exit 2). `-h/--help` and `-v/--version` short-circuit every other
|
|
148
|
+
rule and exit 0.
|
|
149
|
+
|
|
150
|
+
### `xessa build [file]`
|
|
151
|
+
|
|
152
|
+
Compile the project (config include globs) or one file, write artifacts, and update the manifest.
|
|
153
|
+
|
|
154
|
+
- **Writes:** CSS, class map and any enabled declaration/source-map artifacts, plus
|
|
155
|
+
`.cssx-manifest.json` at the workspace root.
|
|
156
|
+
- **Flags:** `--config <path>`, `--json`, `--dry-run`, `--minify`, `--no-minify`.
|
|
157
|
+
- A failed entry writes nothing for that entry and keeps its previous good outputs.
|
|
158
|
+
- `--dry-run` positions diagnostics and prints the plan but writes no files and does not update
|
|
159
|
+
the manifest.
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
npx @xessa/cli build
|
|
163
|
+
npx @xessa/cli build src/button.cssx --no-minify
|
|
164
|
+
npx @xessa/cli build --config config/xessa.config.json --json
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### `xessa check [file]`
|
|
168
|
+
|
|
169
|
+
Run the same compilation pipeline and diagnostics as `build`, but **never write**. Exit 1 when any
|
|
170
|
+
error diagnostic is reported, 0 otherwise (warnings are allowed).
|
|
171
|
+
|
|
172
|
+
- **Writes:** nothing.
|
|
173
|
+
- **Flags:** `--config <path>`, `--json`, `--minify`, `--no-minify`.
|
|
174
|
+
- `--dry-run` is rejected for `check` because it already performs no writes (exit 2).
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
npx @xessa/cli check
|
|
178
|
+
npx @xessa/cli check src/button.cssx --json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### `xessa watch [file]`
|
|
182
|
+
|
|
183
|
+
Build once, then rebuild affected entries on change until `SIGINT`/`SIGTERM`. Newly created
|
|
184
|
+
directories are included, and a config edit re-resolves the project.
|
|
185
|
+
|
|
186
|
+
- **Writes:** yes, like `build` (watch always writes; `--dry-run` does not apply).
|
|
187
|
+
- **Flags:** `--config <path>`, `--json`, `--minify`, `--no-minify`.
|
|
188
|
+
- **`--json`** emits **NDJSON**, one compact object per line: `{"type":"build",…}` after each
|
|
189
|
+
build generation, then `{"type":"watch","ready":true,"sources":N,"debounceMs":…}` once watchers
|
|
190
|
+
are attached. It is a stream, not a single JSON document.
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
npx @xessa/cli watch
|
|
194
|
+
npx @xessa/cli watch src/button.cssx
|
|
195
|
+
npx @xessa/cli watch --json | jq -c 'select(.type == "build")'
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### `xessa format [file]`
|
|
199
|
+
|
|
200
|
+
Reformat sources canonically in place. Formatting is parse→print: a file with parse errors is never
|
|
201
|
+
rewritten, and the errors are reported with their exit code.
|
|
202
|
+
|
|
203
|
+
- **Writes:** changed source files only (atomic replacement).
|
|
204
|
+
- **Flags:** `--check`, `--config <path>`, `--json`, `--dry-run`.
|
|
205
|
+
- **`--check`** writes nothing, lists files that would change, and exits **1** when any exist, 0
|
|
206
|
+
when everything is already canonical.
|
|
207
|
+
- `--dry-run` is accepted as an explicit no-write run; `--check` is the CI-friendly form.
|
|
208
|
+
- `--minify`/`--no-minify` have no effect on source formatting.
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
npx @xessa/cli format
|
|
212
|
+
npx @xessa/cli format --check
|
|
213
|
+
npx @xessa/cli format src/button.cssx --json
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `xessa clean`
|
|
217
|
+
|
|
218
|
+
Delete generated files that the manifest records as compiler-owned **and** whose content hash still
|
|
219
|
+
matches the recorded hash. Edited outputs are kept and their ownership released. Stale writer
|
|
220
|
+
temporaries are swept; files outside the workspace and untrusted manifest records are refused.
|
|
221
|
+
|
|
222
|
+
- **Writes:** deletes files, and rewrites `.cssx-manifest.json` with the remaining owned records.
|
|
223
|
+
- **Flags:** `--config <path>`, `--dry-run`, `--json`. No file argument (exit 2).
|
|
224
|
+
- `--dry-run` prints what would be removed, deletes nothing and leaves the manifest untouched.
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
npx @xessa/cli clean --dry-run
|
|
228
|
+
npx @xessa/cli clean --json
|
|
18
229
|
```
|
|
19
230
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
CLI
|
|
231
|
+
### `xessa --help`, `xessa --version`
|
|
232
|
+
|
|
233
|
+
Print usage or the CLI version and exit 0. `-h` and `-v` are the short forms. Both work before or
|
|
234
|
+
after a command and take precedence over command validation.
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
npx @xessa/cli --help
|
|
238
|
+
npx @xessa/cli -v
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Flags
|
|
242
|
+
|
|
243
|
+
| Flag | Value | Commands | Behaviour |
|
|
244
|
+
| ----------------- | -------- | --------------------------------- | ------------------------------------------------------------------------- |
|
|
245
|
+
| `--config` | `<path>` | `build`, `check`, `watch`, `format`, `clean` | Use this config file instead of the nearest `xessa.config.json`. Relative paths resolve from the working directory. May be given once; `--config=path` also works. |
|
|
246
|
+
| `--json` | none | `build`, `check`, `watch`, `clean`, `format` | Machine-readable output. One JSON document for build/check/clean/format; **NDJSON** for watch. |
|
|
247
|
+
| `--dry-run` | none | `build`, `clean` (also `format` as a no-write run) | Report planned work; write and delete nothing. Rejected by `check`; `watch` ignores it. |
|
|
248
|
+
| `--minify` | none | `build`, `check`, `watch` | Emit compact CSS (this is the default). |
|
|
249
|
+
| `--no-minify` | none | `build`, `check`, `watch` | Emit expanded, readable CSS. |
|
|
250
|
+
| `--check` | none | `format` only | Report files that would change; write nothing; exit 1 if any. |
|
|
251
|
+
| `-h`, `--help` | none | anywhere | Print usage and exit 0. |
|
|
252
|
+
| `-v`, `--version` | none | anywhere | Print the CLI version and exit 0. |
|
|
253
|
+
|
|
254
|
+
Notes:
|
|
255
|
+
|
|
256
|
+
- `--minify` / `--no-minify`: the last one on the command line wins.
|
|
257
|
+
- A value flag never consumes another option as its value: `--config --json` is a missing path, not
|
|
258
|
+
a config named `--json`. A bare `-` is a legal value.
|
|
259
|
+
- `--` ends flag parsing; later tokens are positional.
|
|
260
|
+
- Unknown options or commands, more than one file argument, a file argument to `clean`, `--check`
|
|
261
|
+
on a non-format command and a missing command all exit **2**.
|
|
262
|
+
|
|
263
|
+
## Project discovery and workspace root
|
|
264
|
+
|
|
265
|
+
- The CLI walks upward from the starting directory for the nearest **`xessa.config.json`**. The
|
|
266
|
+
directory containing that file is the workspace root.
|
|
267
|
+
- `--config <path>` overrides the walk; its directory becomes the workspace root.
|
|
268
|
+
- With no configuration file, the root is the nearest ancestor containing **`package.json`**; if
|
|
269
|
+
none exists, the starting directory itself.
|
|
270
|
+
- For `build`, `check` and `watch`, a **single-file** run still loads the nearest config for
|
|
271
|
+
project-level output, naming and media settings. The file must be inside the workspace root;
|
|
272
|
+
otherwise the CLI exits 2 and suggests `--config` for the containing project.
|
|
273
|
+
- **Project mode** discovers `.cssx` files via `include` (default `**/*.cssx`) minus `exclude`.
|
|
274
|
+
`node_modules` and `.git` are never walked, and only `.cssx` files are sources.
|
|
275
|
+
- An explicitly empty `include` array is an invocation error (exit 2). A project discovery that
|
|
276
|
+
matches no `.cssx` sources is also exit 2 (`No .cssx sources matched the project include globs.`),
|
|
277
|
+
not a silent success.
|
|
278
|
+
|
|
279
|
+
```sh
|
|
280
|
+
# run from anywhere, targeting a specific project
|
|
281
|
+
npx @xessa/cli build --config ../site/xessa.config.json
|
|
282
|
+
|
|
283
|
+
# one file inside a project whose config lives above it
|
|
284
|
+
npx @xessa/cli check --config ./xessa.config.json src/button.cssx
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Configuration
|
|
288
|
+
|
|
289
|
+
Configuration is optional. A minimal `xessa.config.json`:
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"include": ["src/**/*.cssx"],
|
|
294
|
+
"classes": { "strategy": "prefix", "prefix": "ui" },
|
|
295
|
+
"output": {
|
|
296
|
+
"cssDir": "generated/styles",
|
|
297
|
+
"mapDir": "generated/maps",
|
|
298
|
+
"minify": true
|
|
299
|
+
},
|
|
300
|
+
"media": { "tablet": "(min-width: 48rem)" },
|
|
301
|
+
"compiler": { "strict": true, "mediaGrouping": "safe" }
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Precedence:** built-in defaults < project `xessa.config.json` < file `@setup` < explicit CLI
|
|
306
|
+
overrides (`--minify` / `--no-minify`). CLI path overrides are not implemented; only minification
|
|
307
|
+
is overridable from the command line.
|
|
308
|
+
|
|
309
|
+
`compiler.strict` defaults to `true`: an unknown configuration key is an error (exit 2). Set
|
|
310
|
+
`"compiler": { "strict": false }` to downgrade unknown keys to warnings. Known keys are always
|
|
311
|
+
type-checked and range-checked.
|
|
312
|
+
|
|
313
|
+
**Imported modules** do not need an `exclude` entry. A token-only or rule-bearing module declares
|
|
314
|
+
itself:
|
|
315
|
+
|
|
316
|
+
```cssx
|
|
317
|
+
@setup {
|
|
318
|
+
module: true;
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
`module: true` suppresses the file's own artifacts unless it authors emission keys explicitly, while
|
|
323
|
+
its tokens and rules remain importable with `@use`.
|
|
324
|
+
|
|
325
|
+
Project output directories resolve relative to the workspace root and mirror source paths; `@setup`
|
|
326
|
+
directories resolve relative to the source file, exactly. The full key table, path safety rules and
|
|
327
|
+
examples are in
|
|
328
|
+
[`docs/configuration.md`](https://github.com/MARKjotep/xessa/blob/main/docs/configuration.md).
|
|
329
|
+
|
|
330
|
+
## Outputs, manifest and safety
|
|
331
|
+
|
|
332
|
+
With defaults, one entry produces:
|
|
333
|
+
|
|
334
|
+
| Artifact | Default path | Default | Opt-in key |
|
|
335
|
+
| ------------- | ------------------- | ------- | ----------------------- |
|
|
336
|
+
| Stylesheet | `<source dir>/<stem>.css` | on | `emit-css` / `output.emitCss` |
|
|
337
|
+
| JS class map | `<source dir>/<stem>.map.js` | on | `emit-map` / `output.emitMap` |
|
|
338
|
+
| Declarations | beside the map, `<stem>.map.d.ts` | off | `map-types` / `output.mapTypes` |
|
|
339
|
+
| CSS source map| beside the stylesheet | off | `source-map` / `output.sourceMap` |
|
|
340
|
+
|
|
341
|
+
- CSS is minified by default; `--no-minify`, `@setup { minify: false; }` or `output.minify: false`
|
|
342
|
+
expands it.
|
|
343
|
+
- The class map exports one `export const` per class and imports no CSS by default; set
|
|
344
|
+
`import-css: true` to prepend a side-effect import of the planned stylesheet.
|
|
345
|
+
- Writes are atomic (temporary file plus rename). A build that fails validation writes nothing for
|
|
346
|
+
that entry and leaves the previous good outputs in place.
|
|
347
|
+
- `.cssx-manifest.json` at the workspace root records owned artifacts and content hashes. After a
|
|
348
|
+
fully successful project build, obsolete owned outputs are pruned only when they are still
|
|
349
|
+
unmodified.
|
|
350
|
+
- `clean` uses the same ownership and hash rules, so hand-edited outputs are kept.
|
|
351
|
+
- `source-map: true` is planned and accepted in v0.1; the current writer reports the artifact as
|
|
352
|
+
not implemented rather than writing an incomplete map. Declarations (`map-types`) are fully
|
|
353
|
+
supported.
|
|
354
|
+
|
|
355
|
+
## JSON output
|
|
356
|
+
|
|
357
|
+
`build`, `check`, `clean` and `format` print exactly one JSON document with `--json` (pretty
|
|
358
|
+
printed, trailing newline). `watch --json` prints NDJSON instead.
|
|
359
|
+
|
|
360
|
+
A build/check document has this shape:
|
|
361
|
+
|
|
362
|
+
```json
|
|
363
|
+
{
|
|
364
|
+
"command": "build",
|
|
365
|
+
"success": false,
|
|
366
|
+
"exitCode": 1,
|
|
367
|
+
"dryRun": false,
|
|
368
|
+
"workspaceRoot": "/project",
|
|
369
|
+
"configFile": "/project/xessa.config.json",
|
|
370
|
+
"entries": [
|
|
371
|
+
{
|
|
372
|
+
"file": "src/button.cssx",
|
|
373
|
+
"dependencies": [],
|
|
374
|
+
"outputs": [
|
|
375
|
+
{ "kind": "css", "path": "src/button.css", "written": false, "reason": "error" }
|
|
376
|
+
],
|
|
377
|
+
"diagnostics": [
|
|
378
|
+
{
|
|
379
|
+
"code": "XESSA1002",
|
|
380
|
+
"severity": "error",
|
|
381
|
+
"message": "Expected \";\" after declaration.",
|
|
382
|
+
"file": "src/button.cssx",
|
|
383
|
+
"line": 6,
|
|
384
|
+
"column": 18
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"diagnostics": [],
|
|
390
|
+
"warnings": [],
|
|
391
|
+
"errors": []
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
`clean` reports `removed` and `skipped` arrays with `reason` values such as `deleted`,
|
|
396
|
+
`would-delete`, `missing`, `modified` or `untrusted`. `format` reports `files`, `changed` and
|
|
397
|
+
`written` per file. Invocation and configuration failures with `--json` still print a machine-readable
|
|
398
|
+
object (`command`, `success: false`, `exitCode: 2`, `error`) so scripts can parse every outcome.
|
|
399
|
+
|
|
400
|
+
## Exit codes
|
|
23
401
|
|
|
24
|
-
|
|
402
|
+
| Code | Meaning |
|
|
403
|
+
| ---- | ----------------------------------------------------------------------------------------------------------- |
|
|
404
|
+
| `0` | Success (warnings allowed; `check` and `format --check` with nothing to report). |
|
|
405
|
+
| `1` | Compile, validation or formatting error; write/manifest failure; or `format --check` found changes. |
|
|
406
|
+
| `2` | Invocation or configuration error: unknown flag/command, invalid config, missing flag value, empty include, empty discovery, file outside the workspace root. |
|
|
25
407
|
|
|
26
|
-
|
|
27
|
-
|---|---|
|
|
28
|
-
| `xessa build [file]` | Build one entry or the project from `xessa.config.json`. |
|
|
29
|
-
| `xessa watch [file]` | Rebuild affected entries on change. |
|
|
30
|
-
| `xessa check [file]` | Validate without writing. |
|
|
31
|
-
| `xessa format [file] [--check]` | Format source files or verify formatting. |
|
|
32
|
-
| `xessa clean` | Delete manifest-owned, unmodified generated files. |
|
|
408
|
+
## Common mistakes and troubleshooting
|
|
33
409
|
|
|
34
|
-
|
|
410
|
+
- **`npx xessa` fails.** The unscoped `xessa` package is not published. Use `npx @xessa/cli …`,
|
|
411
|
+
`bunx @xessa/cli …`, or install `@xessa/cli` first so the local `xessa` bin exists.
|
|
412
|
+
- **Old `chikx` commands or config files.** The project was renamed to Xessa; use `xessa …` and
|
|
413
|
+
`xessa.config.json`. `.cssx` is the source extension either way.
|
|
414
|
+
- **`XESSA1002: Expected ";"`.** Xessa declarations require semicolons, including the last one in a
|
|
415
|
+
block.
|
|
416
|
+
- **"Source file … is outside the workspace root".** The nearest config or `package.json` belongs to
|
|
417
|
+
a different project. Pass `--config` for the intended project, or run from inside it.
|
|
418
|
+
- **"No .cssx sources matched the project include globs".** Check `include`, the working directory
|
|
419
|
+
and the workspace root; this is exit 2 by design.
|
|
420
|
+
- **`format --check` exits 1 but changed nothing.** It reports files that *would* change. Run
|
|
421
|
+
`xessa format` to write them.
|
|
422
|
+
- **`clean` leaves a file behind.** It was edited after generation (hash mismatch), is outside the
|
|
423
|
+
workspace, or is not recorded as a compiler artifact. `clean` never deletes unowned files.
|
|
424
|
+
- **Unknown configuration key exits 2.** Fix the key, or opt into warnings with
|
|
425
|
+
`"compiler": { "strict": false }`.
|
|
426
|
+
- **Installing ahead of the release.** `0.1.1` is on npm; `0.1.2` is release-ready but not yet
|
|
427
|
+
published, so use the source checkout commands above to run the newest changes.
|
|
35
428
|
|
|
36
|
-
## Documentation
|
|
429
|
+
## Documentation map
|
|
37
430
|
|
|
38
|
-
|
|
39
|
-
|
|
431
|
+
| Topic | Where |
|
|
432
|
+
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
433
|
+
| Complete language and compiler spec (normative) | [`@xessa/compiler` README](https://github.com/MARKjotep/xessa/blob/main/packages/compiler/README.md) and [`SPECIFICATION.md`](https://github.com/MARKjotep/xessa/blob/main/SPECIFICATION.md) |
|
|
434
|
+
| Grammar and lexical rules | [`docs/grammar.md`](https://github.com/MARKjotep/xessa/blob/main/docs/grammar.md) |
|
|
435
|
+
| Cascade and emitted order | [`docs/cascade.md`](https://github.com/MARKjotep/xessa/blob/main/docs/cascade.md) |
|
|
436
|
+
| Configuration keys and precedence | [`docs/configuration.md`](https://github.com/MARKjotep/xessa/blob/main/docs/configuration.md) |
|
|
437
|
+
| Practical usage guide | [`docs/usage.md`](https://github.com/MARKjotep/xessa/blob/main/docs/usage.md) |
|
|
438
|
+
| Compatibility and known limitations | [`docs/compatibility.md`](https://github.com/MARKjotep/xessa/blob/main/docs/compatibility.md), [`docs/known-limitations.md`](https://github.com/MARKjotep/xessa/blob/main/docs/known-limitations.md) |
|
|
439
|
+
| Editor integration (VS Code) | [`packages/vscode/README.md`](https://github.com/MARKjotep/xessa/blob/main/packages/vscode/README.md) |
|
|
440
|
+
| Compiler API | [`packages/compiler/README.md`](https://github.com/MARKjotep/xessa/blob/main/packages/compiler/README.md) |
|
|
40
441
|
|
|
41
442
|
## License
|
|
42
443
|
|
|
43
|
-
MIT. See `LICENSE`
|
|
444
|
+
MIT. See [`LICENSE`](https://github.com/MARKjotep/xessa/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xessa/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Xessa command line interface: build, check, watch, format and clean.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@xessa/compiler": "0.1.
|
|
23
|
+
"@xessa/compiler": "0.1.2"
|
|
24
24
|
},
|
|
25
25
|
"bin": {
|
|
26
26
|
"xessa": "./dist/index.js"
|