@epa-wg/custom-element-dist 0.0.36 → 0.0.38
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/.ai/mcp/mcp.json +0 -0
- package/.yarn/install-state.gz +0 -0
- package/AGENTS.md +1 -0
- package/CLAUDE.md +89 -0
- package/README.md +5 -5
- package/bin/postinstall.sh +12 -9
- package/coverage/coverage-final.json +4 -4
- package/coverage/index.html +25 -25
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +175 -160
- package/coverage/src/custom-element/http-request.js.html +10 -10
- package/coverage/src/custom-element/index.html +14 -14
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +1 -1
- package/coverage/src/custom-element/module-url.js.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/material/theme/colors.js.html +1 -1
- package/coverage/src/material/theme/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +54 -12
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +19 -19
- package/coverage/src/stories/testStoryBook.ts.html +7 -16
- package/coverage/src/sum.ts.html +1 -1
- package/dist/{custom-element-BqBcmDiN.js → custom-element-Cr_I3Xd-.js} +69 -65
- package/dist/custom-element-D5IF46oF.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +3 -3
- package/dist/demo/a.html +41 -64
- package/dist/demo/s.xslt +94 -350
- package/dist/{local-storage-DzmNKzgN.js → local-storage-w0k66UWM.js} +4 -4
- package/package.json +3 -2
- package/public/demo/a.html +41 -64
- package/public/demo/s.xslt +94 -350
- package/src/custom-element/custom-element.js +9 -4
- package/src/custom-element/demo/a.html +41 -64
- package/src/custom-element/demo/s.xslt +94 -350
- package/src/custom-element/ide/customData-dce.json +8 -8
- package/src/custom-element/ide/web-types-dce.json +8 -8
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/material/components/action.html +77 -22
- package/src/material/components/autocomplete.html +7 -6
- package/src/material/components/badge.html +33 -34
- package/src/material/components/cem-theme-components.css +131 -0
- package/src/material/components/dropdown.html +27 -12
- package/src/material/components/icon-link.html +25 -18
- package/src/material/components/icon.html +15 -14
- package/src/material/components/input.html +27 -24
- package/src/material/components/menu.html +23 -18
- package/src/material/components.html +19 -18
- package/src/material/demo.css +24 -12
- package/src/material/index.html +15 -9
- package/src/material/theme/colors-native.html +32 -1
- package/src/material/theme/consumer-theme.css +0 -733
- package/src/material/theme/semantic.css +1 -85
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/__screenshots__/location-element.test.stories.ts/location-element-location-element-Demo-1.png +0 -0
- package/src/stories/frame.canvas.ts +17 -4
- package/src/stories/testStoryBook.ts +2 -5
- package/storybook-static/assets/{Color-F6OSRLHC-D1CN2nnQ.js → Color-F6OSRLHC-CGlEPECH.js} +1 -1
- package/storybook-static/assets/{Configure-BD0b2x9E.js → Configure-RleqRiQ0.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-VjrP5Ir6.js → DocsRenderer-CFRXHY34-Bz2y61tp.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-CrDC-RXf.js → attributes.test.stories-Bs0zZtYO.js} +1 -1
- package/storybook-static/assets/{css.test.stories-ChWnZJwa.js → css.test.stories-CK4N9Fqq.js} +1 -1
- package/storybook-static/assets/custom-element-PxTx2W9y.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-DkarPqD_.js → dom-merge.test.stories-DLFviA8F.js} +1 -1
- package/storybook-static/assets/{external-template.test.stories-DCboR8sG.js → external-template.test.stories-CqR1aaHv.js} +1 -1
- package/storybook-static/assets/{form.test.stories-BjeeUu0b.js → form.test.stories-Cinvg_DI.js} +1 -1
- package/storybook-static/assets/frame.canvas-BB4_DNn6.js +1 -0
- package/storybook-static/assets/handlers-CxSWbsdK.js +291 -0
- package/storybook-static/assets/{http-request.stories-Boz_yWek.js → http-request.stories-_1_UMvj-.js} +1 -1
- package/storybook-static/assets/{iframe-BN389ZL5.js → iframe-fXv0bS2C.js} +2 -2
- package/storybook-static/assets/{index-C4PGem3Z.js → index-Dm-gke4Y.js} +3 -3
- package/storybook-static/assets/{index-PzQAcTTK.js → index-DxjDM4Ny.js} +1 -1
- package/storybook-static/assets/{local-storage.test.stories-DLMK0p2s.js → local-storage.test.stories-M4WOSQC5.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-BroqoLMS.js → location-element.test.stories-Ce6Ma8hE.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-B-0dibET.js → module-url.test.stories-PwnZWqKL.js} +1 -1
- package/storybook-static/assets/{preview-idY559eZ.js → preview-Dq4-5PA5.js} +2 -2
- package/storybook-static/assets/{preview-DXd5xnQg.js → preview-kbHljohz.js} +1 -1
- package/storybook-static/assets/{set-url.test.stories-Dhq4YQyr.js → set-url.test.stories-BdNTYEwI.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BZJGIFku.js → slice-events.test.stories-BdvLtK0h.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-DKivHwZH.js → slots.test.stories-CoTPvRog.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-Dntyd7qb.js → version-select.test.stories-hs-HsDVE.js} +1 -1
- package/storybook-static/assets/{xslt-conditionals.test.stories-Iq5iQNRj.js → xslt-conditionals.test.stories-C4oXVQWa.js} +1 -1
- package/storybook-static/assets/{xslt-for-each.test.stories-BMygBmj8.js → xslt-for-each.test.stories-Da4vCZe1.js} +1 -1
- package/storybook-static/assets/{xslt-if.test.stories-CVrFWdAX.js → xslt-if.test.stories-CMlnBGX2.js} +1 -1
- package/storybook-static/demo/a.html +41 -64
- package/storybook-static/demo/s.xslt +94 -350
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/project.json +1 -1
- package/dist/custom-element-jpOyXHF6.cjs +0 -97
- package/storybook-static/assets/custom-element-wuk8gYiP.js +0 -97
- package/storybook-static/assets/frame.canvas-E5n9h6j1.js +0 -1
- package/storybook-static/assets/handlers-B8a2v6Dv.js +0 -291
package/.ai/mcp/mcp.json
ADDED
|
File without changes
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
use CLAUDE.md for codex session.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## What This Repo Is
|
|
6
|
+
|
|
7
|
+
`@epa-wg/custom-element-dist` is a **distribution and test harness** for the `@epa-wg/custom-element` library. It does not own the core source — `src/custom-element/*.js` and `*.d.ts` files are **copied from the `@epa-wg/custom-element` npm package** by `bin/postinstall.sh` at install time. Do not edit those copied files directly.
|
|
8
|
+
|
|
9
|
+
The repo exists to:
|
|
10
|
+
- Run tests with coverage against the library
|
|
11
|
+
- Build and publish the Storybook static site
|
|
12
|
+
- Produce the `dist/` bundle for CDN use
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn cache clean @epa-wg/custom-element # if checksum mismatch on install
|
|
18
|
+
yarn install # installs deps + runs postinstall (copies src/custom-element files)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`postinstall` resolves `@epa-wg/custom-element` via `node -e "require.resolve(...)"` — works with both yarn PnP and node-modules linker.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
| Command | Purpose |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `yarn test` | Full test suite with coverage (chromium, headless) |
|
|
28
|
+
| `yarn test:ff` | Same but Firefox |
|
|
29
|
+
| `yarn test:watch` | Interactive watch mode, browser visible |
|
|
30
|
+
| `yarn t` | Watch a single file: `module-url.test.stories.ts` |
|
|
31
|
+
| `yarn tt` | Watch a single file: `external-template.test.stories.ts` |
|
|
32
|
+
| `yarn storybook` / `yarn sb` | Dev storybook on port 6006 |
|
|
33
|
+
| `yarn build` | `tsc` + vite library build → `dist/` |
|
|
34
|
+
| `yarn build-storybook` | Static storybook → `storybook-static/` |
|
|
35
|
+
| `bash bin/build.sh` | Full CI build: clean + test + build + build-storybook |
|
|
36
|
+
| `bash bin/clean.sh` | Nuke `node_modules/`, `dist/`, `coverage/`, `storybook-static/` |
|
|
37
|
+
|
|
38
|
+
To run a single test file:
|
|
39
|
+
```bash
|
|
40
|
+
vitest --no-file-parallelism --watch=false src/stories/some-feature.test.stories.ts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Architecture
|
|
44
|
+
|
|
45
|
+
### Source layout
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
src/
|
|
49
|
+
custom-element/ ← copied from @epa-wg/custom-element by postinstall (do not edit)
|
|
50
|
+
index.js ← library entry point (used by vite build)
|
|
51
|
+
custom-element.js ← core DCE implementation
|
|
52
|
+
demo/ ← also copied to public/demo/
|
|
53
|
+
ide/ ← web-types for IDE integration
|
|
54
|
+
stories/ ← Storybook stories AND tests
|
|
55
|
+
mocks/ ← MSW handlers (shared by storybook + vitest)
|
|
56
|
+
material/ ← Material design theme layer (independent)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Testing approach
|
|
60
|
+
|
|
61
|
+
Tests live in `src/stories/` and follow two patterns:
|
|
62
|
+
- `*.test.stories.ts` — Storybook stories used as vitest browser tests via `testStoryBook.ts` helper
|
|
63
|
+
- `*.test.ts` — standard vitest unit tests
|
|
64
|
+
|
|
65
|
+
Tests run **without file parallelism** (`--no-file-parallelism`) due to shared browser/DOM state.
|
|
66
|
+
|
|
67
|
+
Before running tests, `bin/vitest/vitest-browser-importmaps.mjs` patches the vitest browser HTML to inject import maps for `lib-root/` → `demo/lib-dir/` resolution (needed by `module-url.test.stories.ts`).
|
|
68
|
+
|
|
69
|
+
MSW is active in both Storybook and vitest. Handlers are in `src/mocks/handlers.ts`. The vitest config sets `dangerouslyIgnoreUnhandledErrors: true` to suppress MSW service worker noise.
|
|
70
|
+
|
|
71
|
+
### Build output
|
|
72
|
+
|
|
73
|
+
Vite builds in **lib mode**: entry `src/custom-element/index.js`, outputs `dist/assets/custom-element-bundle.js` (ESM) and `.cjs`. Each source file also gets its own hashed chunk via `manualChunks`.
|
|
74
|
+
|
|
75
|
+
`dist/`, `coverage/`, and `storybook-static/` are **committed to git** as compliance/release artifacts.
|
|
76
|
+
|
|
77
|
+
## Package manager
|
|
78
|
+
|
|
79
|
+
Yarn 4.12.0 with `nodeLinker: node-modules` (see `.yarnrc.yml`). Use `yarn` for all package operations, not `npm`.
|
|
80
|
+
|
|
81
|
+
## CEM Theme
|
|
82
|
+
Apply CEM theme styling to this existing project using the installed `@epa-wg/cem-theme` package.
|
|
83
|
+
|
|
84
|
+
Before changing styles, read the installed package-local AI instructions:
|
|
85
|
+
`node_modules/@epa-wg/cem-theme/dist/lib/tokens/cem-theme-ai-instructions.md`.
|
|
86
|
+
|
|
87
|
+
Follow that file's read order, token-selection rules, stylesheet setup, theme scoping, and verification checklist.
|
|
88
|
+
Prefer these installed Markdown docs over GitHub because they match the installed npm package version. Do not infer CEM
|
|
89
|
+
semantics from generated CSS values alone.
|
package/README.md
CHANGED
|
@@ -27,8 +27,8 @@ CDN version of StoryBook.
|
|
|
27
27
|
[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg
|
|
28
28
|
[npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element-dist.svg
|
|
29
29
|
[npm-url]: https://npmjs.org/package/@epa-wg/custom-element-dist
|
|
30
|
-
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
31
|
-
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
32
|
-
[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
33
|
-
[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
34
|
-
[cem-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
30
|
+
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/coverage/src/custom-element/coverage.svg
|
|
31
|
+
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/coverage/src/custom-element/index.html
|
|
32
|
+
[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/storybook-static/index.html
|
|
33
|
+
[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/dist/custom-element-bundle.js
|
|
34
|
+
[cem-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.38/src/material/components.html
|
package/bin/postinstall.sh
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
# to be treated as internal by test coverage
|
|
3
3
|
#npm link @epa-wg/custom-element
|
|
4
4
|
|
|
5
|
+
# Resolve package path — works with yarn PnP, yarn node-modules linker, and npm
|
|
6
|
+
PKG_DIR=$(node -e "console.log(require.resolve('@epa-wg/custom-element/package.json').replace(/[\/\\\\]package\\.json\$/, '').replace(/\\\\/g, '/'))")
|
|
7
|
+
|
|
5
8
|
cd src/custom-element
|
|
6
|
-
mkdir demo
|
|
7
|
-
mkdir ide
|
|
9
|
+
mkdir -p demo
|
|
10
|
+
mkdir -p ide
|
|
8
11
|
|
|
9
|
-
rm *.d.ts
|
|
10
|
-
rm *.js
|
|
12
|
+
rm -f *.d.ts
|
|
13
|
+
rm -f *.js
|
|
11
14
|
pwd
|
|
12
|
-
cp
|
|
13
|
-
cp
|
|
14
|
-
cp
|
|
15
|
-
cp -r
|
|
16
|
-
cp -r
|
|
15
|
+
cp "$PKG_DIR"/*.d.ts .
|
|
16
|
+
cp "$PKG_DIR"/*.js .
|
|
17
|
+
cp "$PKG_DIR"/index.html index.html
|
|
18
|
+
cp -r "$PKG_DIR"/demo/* demo/
|
|
19
|
+
cp -r "$PKG_DIR"/ide/* ide/
|
|
17
20
|
|
|
18
21
|
cp -r demo ../../public
|