Open11

open-wc/open-wc のパッケージ全部読む

odanodan

@open-wc/building-rollup

rollup 用の config を生成してくれる createSpaConfig 関数などを提供するパッケージ

デモを見るのがわかりやすそう
https://github.com/open-wc/open-wc/blob/master/packages/building-rollup/demo/cjs/rollup.spa.config.js

レガシー向けのブラウザに nomodule で JS をロードする script を追加する機能がある
https://github.com/open-wc/open-wc/blob/06e4e892132d73882679206f2cf55a749dbe5af8/packages/building-rollup/src/createSpaConfig.js#L58

rollup だけどライブラリ用じゃなくてアプリ用の config っぽい

odanodan

@open-wc/eslint-config

ドキュメント: https://github.com/open-wc/open-wc/blob/master/docs/guides/tools/linting-and-formatting.md

We recommend @open-wc/eslint-config for a good default configuration for web component projects.

らしい

入っているプラグイン

  • eslint-config-airbnb-base (with some modifications)
  • eslint-plugin-wc
  • eslint-plugin-lit
  • eslint-plugin-html
  • eslint-plugin-mocha-no-only

https://www.npmjs.com/package/eslint-plugin-wc も含まれているっぽい

eslint-plugin-mocha-no-only が含まれているのはちょっと使いにくいなあ

odanodan

@open-wc/lit-helpers

helper 関数たち

mixin の型定義参考になるかも
https://github.com/open-wc/open-wc/blob/7ae8ebf1716ec347fe867219a713a2b58b6fed28/packages/lit-helpers/src/read-only-properties-mixin.d.ts#L5

ドキュメント: https://github.com/open-wc/open-wc/blob/master/docs/docs/development/lit-helpers.md

プロパティが readOnly になる mixin が提供されていたりする

spread はコンポーネントに付与する属性をオブジェクト形式で書ける君?