@anvil-works/anvil-cli 0.8.0-canary.24 → 0.8.0-canary.26

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 CHANGED
@@ -213,6 +213,7 @@ When given a file, the command chooses the validator from the file path. When gi
213
213
  - `anvil.yaml`
214
214
  - `.yaml` files under `client_code/`, including `client_code/**/form_template.yaml`
215
215
  - `.html` files under `client_code/`, including `client_code/**/form_template.html` and module-form `client_code/<Form>.html`
216
+ - `.css` files under `theme/assets/`, including `theme.css`: warns about selectors targeting the removed `anvil-dropzone` wrappers. These warnings do not fail validation; general CSS syntax is not checked.
216
217
  - `.py` files under `client_code/` and `server_code/`
217
218
 
218
219
  Common examples:
@@ -225,6 +226,7 @@ anvil validate client_code/Form1/form_template.html
225
226
  anvil validate client_code/Form1.html
226
227
  anvil validate client_code/Helpers.py
227
228
  anvil validate server_code/ServerModule.py
229
+ anvil validate theme/assets/theme.css
228
230
  anvil validate .
229
231
  ```
230
232
 
@@ -262,6 +264,25 @@ Use `--json` with `anvil convert-template` to emit the source path, output path,
262
264
 
263
265
  Conversion uses `@anvil-works/form-template-parser`. When package-qualified form specs such as `form:MyForm` or dependency `item_template` values are present, the command reads `anvil.yaml` (and `.anvil/deps/manifest.json` when needed) to canonicalize them before serializing HTML.
264
266
 
267
+ ### `anvil test`
268
+
269
+ Run your app's server tests (`tests/server_tests`) on Anvil, and print pytest's output as they run.
270
+
271
+ ```bash
272
+ anvil test
273
+ anvil test tests/server_tests/test_orders.py::test_refund
274
+ anvil test -k "login and not slow"
275
+ anvil test --collect-only
276
+ ```
277
+
278
+ The tests run on the commit you have checked out (`HEAD`), which must already be pushed to Anvil. If you have uncommitted changes, the command warns you that they aren't included.
279
+
280
+ Targets are paths or pytest node IDs in `tests/server_tests`, relative to the current directory. `-k` takes a pytest keyword expression.
281
+
282
+ The app, server and account are chosen as `anvil watch` chooses them, including asking you when there's a choice. In CI, use `-A, --appid <APP_ID>`, `-u, --url <ANVIL_URL>` and `-U, --user <USERNAME>` when the choice is ambiguous. `--json` disables prompts.
283
+
284
+ The command exits with pytest's exit code, for example `0` if every test passed and `1` if any failed, so you can use it in CI. If the run couldn't start or finish, for example because the server runtime failed to launch, it prints the error and exits `1`. Press Ctrl-C to cancel the run.
285
+
265
286
  ### Other useful commands
266
287
 
267
288
  ```bash
@@ -274,6 +295,7 @@ anvil config set <key> <value>
274
295
  anvil config reset
275
296
  anvil validate <file>
276
297
  anvil convert-template <file>
298
+ anvil test
277
299
  anvil version
278
300
  anvil update
279
301
  anvil --help
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Find the root directory of the Anvil app (the directory holding its anvil.yaml) that
3
+ * contains `filePath`, or null if `filePath` doesn't exist or isn't inside an app.
4
+ */
5
+ export declare function findAnvilAppRoot(filePath: string): string | null;
6
+ /**
7
+ * The root of the Anvil app containing `startPath`, so that app commands work from any of its subdirectories.
8
+ * Throws if `startPath` isn't inside an app.
9
+ */
10
+ export declare function resolveAppRoot(startPath?: string): string;
11
+ //# sourceMappingURL=appRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appRoot.d.ts","sourceRoot":"","sources":["../src/appRoot.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuChE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,CAQxE"}