@pwrs/cem-win32-arm64 0.1.9
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 +163 -0
- package/cem.exe +1 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# cem
|
|
2
|
+
|
|
3
|
+
**cem** is a command-line tool for generating [Custom Elements Manifest][cem]
|
|
4
|
+
(CEM) files from TypeScript sources. It analyzes your codebase and generates
|
|
5
|
+
rich metadata for your custom elements, facilitating documentation, tooling, and
|
|
6
|
+
integration.
|
|
7
|
+
|
|
8
|
+
> [!NOTE]
|
|
9
|
+
> `cem` currently supports LitElements written in idiomatic style with
|
|
10
|
+
> TypeScript decorators. If you need something more specific,
|
|
11
|
+
> [open an issue][issuenew].
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### `cem generate`
|
|
16
|
+
|
|
17
|
+
- **Generates CEM files** from source code using syntax analysis powered by
|
|
18
|
+
[go][go] and [tree-sitter][treesitter].
|
|
19
|
+
- Identifies custom elements, classes, variables, functions, and exports.
|
|
20
|
+
- Supports elements written in idiomatic Lit typescript style, with a
|
|
21
|
+
`@customElement` decorator, and `@property` decorators on class fields.
|
|
22
|
+
|
|
23
|
+
#### JSDoc
|
|
24
|
+
Use JSDoc comments to add metadata to your element classes, similar to other
|
|
25
|
+
tools.
|
|
26
|
+
|
|
27
|
+
- `@attr` / `@attribute` — Custom element attributes
|
|
28
|
+
- `@csspart` — CSS shadow parts
|
|
29
|
+
- `@cssprop` / `@cssproperty` — Custom CSS properties
|
|
30
|
+
- `@cssstate` — Custom CSS states
|
|
31
|
+
- `@deprecated` — Marks a feature or member as deprecated
|
|
32
|
+
- `@event` — Custom events dispatched by the element
|
|
33
|
+
- `@slot` — Named or default slots
|
|
34
|
+
- `@summary` — Short summary for documentation
|
|
35
|
+
|
|
36
|
+
#### HTML Template Analysis for Slots and Parts
|
|
37
|
+
|
|
38
|
+
- **Automatically detects `<slot>` elements and `part` attributes in your element’s
|
|
39
|
+
`render()` template.**
|
|
40
|
+
- Merges slot and part information found in templates with any provided
|
|
41
|
+
via JSDoc, ensuring comprehensive documentation in the generated manifest.
|
|
42
|
+
- **Deprecation and other metadata** for slots and parts can be specified via
|
|
43
|
+
YAML in HTML comments.
|
|
44
|
+
- **Supports documenting slots and parts inline in your template HTML** using
|
|
45
|
+
HTML comments with YAML blocks.
|
|
46
|
+
- YAML comments are not necessary to detect slots and parts, but help in
|
|
47
|
+
documenting them for your users.
|
|
48
|
+
|
|
49
|
+
##### Examples
|
|
50
|
+
```html
|
|
51
|
+
<!--
|
|
52
|
+
summary: The main slot for content
|
|
53
|
+
description: |
|
|
54
|
+
This slot displays user-provided content.
|
|
55
|
+
Supports multiline **markdown**.
|
|
56
|
+
deprecated: true
|
|
57
|
+
-->
|
|
58
|
+
<slot></slot>
|
|
59
|
+
<!-- slot:
|
|
60
|
+
summary: Named slot summary
|
|
61
|
+
part:
|
|
62
|
+
summary: Part summary
|
|
63
|
+
-->
|
|
64
|
+
<slot name="info" part="info-part"></slot>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### CSS Custom Properties
|
|
68
|
+
Supports CSS Custom Properties by scanning css files and css tagged-template-literals
|
|
69
|
+
|
|
70
|
+
- Custom properties beginning with `_` will be ignored (treated as "private")
|
|
71
|
+
e.g. `var(--_private)`
|
|
72
|
+
- If you provide a [Design Tokens Community Group][dtcg] format module (JSON) to
|
|
73
|
+
`cem` via the `--design-tokens` flag,
|
|
74
|
+
`cem` will add metadata from your design system to any matching css variables it
|
|
75
|
+
finds in your elements
|
|
76
|
+
- You can use jsdoc-like comment syntax before each var call to document your
|
|
77
|
+
variables
|
|
78
|
+
|
|
79
|
+
##### Example
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
:host {
|
|
83
|
+
color:
|
|
84
|
+
/**
|
|
85
|
+
* custom color for use in this element
|
|
86
|
+
* @summary color
|
|
87
|
+
* @deprecated just use the `color` property
|
|
88
|
+
*/
|
|
89
|
+
var(--custom-color);
|
|
90
|
+
border:
|
|
91
|
+
1px
|
|
92
|
+
solid
|
|
93
|
+
/** Border color of the element */
|
|
94
|
+
var(--border-color);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Installation
|
|
99
|
+
|
|
100
|
+
For go binaries:
|
|
101
|
+
```sh
|
|
102
|
+
go install bennypowers.dev/cem@latest
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For NPM projects:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npm install --save-dev @pwrs/cem
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Or clone this repository and build from source:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
git clone https://github.com/bennypowers/cem.git
|
|
115
|
+
cd cem
|
|
116
|
+
make
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
Generate a custom elements manifest from your files:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
cem generate \
|
|
125
|
+
"src/**/*.ts" \
|
|
126
|
+
--design-tokens npm:@my-ds/tokens/tokens.json \
|
|
127
|
+
--exclude "src/**/*.test.ts" \
|
|
128
|
+
--output custom-elements.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For npm projects you can use `npx @pwrs/cem generate ...`.
|
|
132
|
+
### Arguments
|
|
133
|
+
| Argument | Type | Description |
|
|
134
|
+
| ---------------------------- | ------------------ | ------------------------------------------------------------------------------------------------- |
|
|
135
|
+
| `<files or globs>` | positional (array) | Files or glob patterns to include |
|
|
136
|
+
| `--exclude, -e` | array | Files or glob patterns to exclude |
|
|
137
|
+
| `--design-tokens, -t` | string | Path or npm specifier for DTCG-format design tokens |
|
|
138
|
+
| `--design-tokens-prefix, -p` | string | CSS custom property prefix for design tokens |
|
|
139
|
+
| `--output, -o` | string | Write the manifest to this file instead of stdout |
|
|
140
|
+
| `--no-default-excludes` | bool | Do not exclude files by default (e.g., `.d.ts` files will be included unless excluded explicitly) |
|
|
141
|
+
|
|
142
|
+
By default, some files (like `.d.ts` TypeScript declaration files) are excluded from the manifest.
|
|
143
|
+
Use `--no-default-excludes` if you want to include all matching files and manage excludes yourself.
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
For information on building and testing, please see
|
|
148
|
+
[CONTRIBUTING.md][contributingmd].
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
153
|
+
the terms of the [GNU General Public License v3.0][gpl3].
|
|
154
|
+
|
|
155
|
+
© 2025 Benny Powers <web@bennypowers.com>
|
|
156
|
+
|
|
157
|
+
[cem]: https://github.com/webcomponents/custom-elements-manifest
|
|
158
|
+
[dtcg]: https://tr.designtokens.org/format/
|
|
159
|
+
[go]: https://go.dev
|
|
160
|
+
[treesitter]: https://tree-sitter.github.io/tree-sitter/
|
|
161
|
+
[gpl3]: https://www.gnu.org/licenses/gpl-3.0.html
|
|
162
|
+
[contributingmd]: ./CONTRIBUTING.md
|
|
163
|
+
[issuenew]: https://github.com/bennypowers/cem/issues/new
|
package/cem.exe
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node\nconsole.error("cem does not yet support Windows on ARM64. Please use x64 or another operating system.");process.exit(1);
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pwrs/cem-win32-arm64",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"os": [
|
|
6
|
+
"windows"
|
|
7
|
+
],
|
|
8
|
+
"cpu": [
|
|
9
|
+
"arm64"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
"cem",
|
|
13
|
+
"cem.exe"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=22.0.0"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"description": "win32-arm64 binary for cem - a Custom Elements Manifest CLI"
|
|
20
|
+
}
|