@diagonal-hq/cli 0.10.2 → 0.12.0
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 +6 -0
- package/dist/cli.mjs +466 -178
- package/dist/workflow/generated/capabilities.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -425,6 +425,12 @@ Use `background: url(asset:hero)` in a CSS file. The hosted build replaces it wi
|
|
|
425
425
|
|
|
426
426
|
The check follows CSS imports from pages, layouts, and components. An unknown `asset:` key fails with its file, line, and column. `asset:` in `@import` fails. A `url(asset:` value in a TypeScript or TSX module also fails. Move that value to a CSS file.
|
|
427
427
|
|
|
428
|
+
The check refuses binary imports from workspace modules, including images, fonts, SVG, video, audio, and PDF files. Binary files in `pages/`, `layouts/`, and `components/` also fail when no module imports them. Upload an image as an Application Asset and use `url(asset:<key>)` in CSS. For icons, use `Sdk.Icon` or an SVG written as a TSX component. SVG and font uploads are not supported yet; use an https: URL for those files.
|
|
429
|
+
|
|
430
|
+
A CSS `url()` can name an Application Asset as `url(asset:<key>)`, a data URL, an HTTP or HTTPS URL, or a fragment. Relative, root-relative, and protocol-relative file URLs fail. CSS `@import` and `composes` cannot name binary files or Application Assets. Import a CSS file instead.
|
|
431
|
+
|
|
432
|
+
npm packages cannot bring media files either. A package stylesheet or module that imports an image, font, video, audio, or PDF file fails the hosted build. `diagonal check` does not read package files. Use an https: URL or an Application Asset in your own CSS.
|
|
433
|
+
|
|
428
434
|
## Editor types
|
|
429
435
|
|
|
430
436
|
A page, layout, component, or workflow can import any other file of the workspace by its path from the root with `@app/`, for example `import { formatPrice } from '@app/lib/money'`. The extension is optional, and a folder's `index` file is found. The build links each imported file into the importing page or workflow, so the files need no folder of their own; a file outside the build's folders, such as `lib/`, is built only when something imports it. An imported module can import other `@app/` files, `@diagonal-hq/cli`, and, in a workflow, `@diagonal/workflow`. Add `"@app/*": ["./*"]` to the `paths` of `tsconfig.json` so the editor resolves them too.
|