Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warn on element redefinitions, point to resolution docs #3136

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e5d9bc5
feat: warn on element redefinitions
hunterloftis Apr 20, 2023
f043ef1
chore: move define-element into base package, update icons build scripts
hunterloftis Apr 26, 2023
ac763bf
test: dev mode registration for A and B components
hunterloftis Apr 26, 2023
0c739a1
test: dev mode registration for C components
hunterloftis Apr 26, 2023
2d50e41
test: dev mode registration for D components
hunterloftis Apr 26, 2023
5fcf584
test: dev mode registration for F,H components
hunterloftis Apr 26, 2023
5805453
test: dev mode registration for I components
hunterloftis Apr 26, 2023
4c9f7ce
test: dev mode registration for L,M,N,O components
hunterloftis Apr 26, 2023
51a726e
test: dev mode registration for P,Q,R components
hunterloftis Apr 26, 2023
6cdff56
test: dev mode registration for S components
hunterloftis Apr 26, 2023
ff4ed2f
test: dev mode registration for T components
hunterloftis Apr 26, 2023
41a3060
test: resolve lingering export mis-mappings
hunterloftis Apr 27, 2023
91efa40
test: find a new way to validate defineElement warnings without throw…
hunterloftis Apr 27, 2023
f5d7dd6
test: use specific error messages for specific browsers
hunterloftis Apr 27, 2023
dd3522e
test: migrate all defineElement tests into base
hunterloftis Apr 27, 2023
621cb9d
test: match coverage threshold
hunterloftis Apr 27, 2023
da8bce9
fix: only use JS-compatible syntax related to debug mode
hunterloftis May 2, 2023
96f22a3
fix(swatch): restore relative imports
hunterloftis May 2, 2023
f28f0eb
docs: add registry-conflicts doc
hunterloftis May 2, 2023
7e8e33c
docs: link to future URL for registry-conflicts
hunterloftis May 2, 2023
4a47450
docs: update registry-conflicts
hunterloftis May 2, 2023
060e120
docs: update registry-conflicts
hunterloftis May 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*", "projects/*", "tools/*"],
"version": "independent",
"version": "0.30.0",
"granularPathspec": false,
"npmClient": "yarn",
"useWorkspaces": true,
Expand Down
3 changes: 2 additions & 1 deletion packages/accordion/sp-accordion-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { AccordionItem } from './src/AccordionItem.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-accordion-item', AccordionItem);
defineElement('sp-accordion-item', AccordionItem);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/accordion/sp-accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Accordion } from './src/Accordion.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-accordion', Accordion);
defineElement('sp-accordion', Accordion);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/action-bar/sp-action-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ActionBar } from './src/ActionBar.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-action-bar', ActionBar);
defineElement('sp-action-bar', ActionBar);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/action-button/sp-action-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ActionButton } from './src/ActionButton.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-action-button', ActionButton);
defineElement('sp-action-button', ActionButton);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/action-group/sp-action-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ActionGroup } from './src/ActionGroup.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-action-group', ActionGroup);
defineElement('sp-action-group', ActionGroup);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/action-menu/sp-action-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ActionMenu } from './src/ActionMenu.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-action-menu', ActionMenu);
defineElement('sp-action-menu', ActionMenu);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/asset/sp-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { Asset } from './src/Asset.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-asset', Asset);
defineElement('sp-asset', Asset);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/avatar/sp-avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Avatar } from './src/Avatar.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-avatar', Avatar);
defineElement('sp-avatar', Avatar);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/badge/sp-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { Badge } from './src/Badge.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-badge', Badge);
defineElement('sp-badge', Badge);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/banner/sp-banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Banner } from './src/Banner.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-banner', Banner);
defineElement('sp-banner', Banner);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/button-group/sp-button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { ButtonGroup } from './src/ButtonGroup.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-button-group', ButtonGroup);
defineElement('sp-button-group', ButtonGroup);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/button/sp-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Button } from './src/Button.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-button', Button);
defineElement('sp-button', Button);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/button/sp-clear-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { ClearButton } from './src/ClearButton.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-clear-button', ClearButton);
defineElement('sp-clear-button', ClearButton);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/button/sp-close-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { CloseButton } from './src/CloseButton.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-close-button', CloseButton);
defineElement('sp-close-button', CloseButton);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/card/sp-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { Card } from './src/Card.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-card', Card);
defineElement('sp-card', Card);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/checkbox/sp-checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Checkbox } from './src/Checkbox.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-checkbox', Checkbox);
defineElement('sp-checkbox', Checkbox);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/coachmark/sp-coachmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Coachmark } from './src/Coachmark.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-coachmark', Coachmark);
defineElement('sp-coachmark', Coachmark);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/color-area/sp-color-area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ColorArea } from './src/ColorArea.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-color-area', ColorArea);
defineElement('sp-color-area', ColorArea);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/color-handle/sp-color-handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ColorHandle } from './src/ColorHandle.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-color-handle', ColorHandle);
defineElement('sp-color-handle', ColorHandle);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/color-loupe/sp-color-loupe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ColorLoupe } from './src/ColorLoupe.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-color-loupe', ColorLoupe);
defineElement('sp-color-loupe', ColorLoupe);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/color-slider/sp-color-slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ColorSlider } from './src/ColorSlider.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-color-slider', ColorSlider);
defineElement('sp-color-slider', ColorSlider);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/color-wheel/sp-color-wheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { ColorWheel } from './src/ColorWheel.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-color-wheel', ColorWheel);
defineElement('sp-color-wheel', ColorWheel);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/dialog/sp-dialog-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { DialogBase } from './src/DialogBase.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-dialog-base', DialogBase);
defineElement('sp-dialog-base', DialogBase);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/dialog/sp-dialog-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { DialogWrapper } from './src/DialogWrapper.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-dialog-wrapper', DialogWrapper);
defineElement('sp-dialog-wrapper', DialogWrapper);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/dialog/sp-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Dialog } from './src/Dialog.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-dialog', Dialog);
defineElement('sp-dialog', Dialog);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/divider/sp-divider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { Divider } from './src/Divider.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-divider', Divider);
defineElement('sp-divider', Divider);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/dropzone/sp-dropzone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Dropzone } from './src/Dropzone.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-dropzone', Dropzone);
defineElement('sp-dropzone', Dropzone);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/field-group/sp-field-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { FieldGroup } from './src/FieldGroup.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-field-group', FieldGroup);
defineElement('sp-field-group', FieldGroup);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/field-label/sp-field-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { FieldLabel } from './src/FieldLabel.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-field-label', FieldLabel);
defineElement('sp-field-label', FieldLabel);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/help-text/sp-help-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ governing permissions and limitations under the License.
*/

import { HelpText } from './src/HelpText.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-help-text', HelpText);
defineElement('sp-help-text', HelpText);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/icon/sp-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { Icon } from './src/Icon.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-icon', Icon);
defineElement('sp-icon', Icon);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/icons-ui/bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ glob(`${rootDir}/node_modules/${iconsPath}/**.svg`, (error, icons) => {
${disclaimer}

import { Icon${ComponentName} } from '../src/elements/Icon${id}.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('${iconElementName}', Icon${ComponentName});
defineElement('${iconElementName}', Icon${ComponentName});

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/icons-workflow/bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ glob(`${rootDir}/node_modules/${iconsPath}/**.svg`, (error, icons) => {
${disclaimer}

import { Icon${ComponentName} } from '../src/elements/Icon${id}.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('${iconElementName}', Icon${ComponentName});
defineElement('${iconElementName}', Icon${ComponentName});

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/icons/sp-icons-large.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { IconsLarge } from './src/IconsLarge.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-icons-large', IconsLarge);
defineElement('sp-icons-large', IconsLarge);

declare global {
interface HTMLElementTagNameMap {
Expand Down
3 changes: 2 additions & 1 deletion packages/icons/sp-icons-medium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
import { IconsMedium } from './src/IconsMedium.js';
import { defineElement } from '@spectrum-web-components/base/src/define-element.js';

customElements.define('sp-icons-medium', IconsMedium);
defineElement('sp-icons-medium', IconsMedium);

declare global {
interface HTMLElementTagNameMap {
Expand Down
Loading