From 7041357bf5a67466f9a8f36e46e8b867a15d2728 Mon Sep 17 00:00:00 2001 From: Christian Schilling Date: Fri, 13 Oct 2023 08:15:45 +0200 Subject: [PATCH] Updated @lit-labs/react to @lit/react now as this is stable --- docs/pages/resources/changelog.md | 1 + package-lock.json | 18 +----------------- package.json | 18 ++++++++++++++---- scripts/build.js | 4 ++-- scripts/make-react.js | 5 ++--- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index 07238177..13abc520 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -21,6 +21,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Fixed a bug in `` that caused it not to fire the `sl-select` event if you clicked an element inside of a `` [#1599] - Improved submenu selection by implementing the [safe triangle](https://www.smashingmagazine.com/2023/08/better-context-menus-safe-triangles/) method [#1550] - Updated `@shoelace-style/localize` to 3.1.0 +- Updated `@lib-labs/react` to stable `@lit/react` - Updated Bootstrap Icons to 1.11.1 - Updated Lit to 3.0.0 - Updated TypeScript to 5.2.2 diff --git a/package-lock.json b/package-lock.json index 735d20f9..e2b305bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@ctrl/tinycolor": "^4.0.2", "@floating-ui/dom": "^1.5.3", - "@lit-labs/react": "^2.1.1", + "@lit/react": "^1.0.0", "@shoelace-style/animations": "^1.1.0", "@shoelace-style/localize": "^3.1.2", "composed-offset-position": "^0.0.4", @@ -1569,14 +1569,6 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, - "node_modules/@lit-labs/react": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.1.1.tgz", - "integrity": "sha512-wr15ZOCZ7t2yB8UEfQ6oSRCmfxpIjhzDkN8DlgSOwsbJzWQTk8hxHRLy7Rra6mxrIajqvrMWQB2VskUU2uuoRA==", - "dependencies": { - "@lit/react": "1.0.0" - } - }, "node_modules/@lit-labs/ssr-dom-shim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.2.tgz", @@ -19696,14 +19688,6 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, - "@lit-labs/react": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.1.1.tgz", - "integrity": "sha512-wr15ZOCZ7t2yB8UEfQ6oSRCmfxpIjhzDkN8DlgSOwsbJzWQTk8hxHRLy7Rra6mxrIajqvrMWQB2VskUU2uuoRA==", - "requires": { - "@lit/react": "1.0.0" - } - }, "@lit-labs/ssr-dom-shim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.2.tgz", diff --git a/package.json b/package.json index 6f105307..3ab412a8 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,15 @@ "./dist/react/*": "./dist/react/*", "./dist/translations/*": "./dist/translations/*" }, - "files": ["dist", "cdn"], - "keywords": ["web components", "custom elements", "components"], + "files": [ + "dist", + "cdn" + ], + "keywords": [ + "web components", + "custom elements", + "components" + ], "repository": { "type": "git", "url": "git+https://github.com/shoelace-style/shoelace.git" @@ -62,7 +69,7 @@ "dependencies": { "@ctrl/tinycolor": "^4.0.2", "@floating-ui/dom": "^1.5.3", - "@lit-labs/react": "^2.1.1", + "@lit/react": "^1.0.0", "@shoelace-style/animations": "^1.1.0", "@shoelace-style/localize": "^3.1.2", "composed-offset-position": "^0.0.4", @@ -133,6 +140,9 @@ "user-agent-data-types": "^0.3.1" }, "lint-staged": { - "*.{ts,js}": ["eslint --max-warnings 0 --cache --fix", "prettier --write"] + "*.{ts,js}": [ + "eslint --max-warnings 0 --cache --fix", + "prettier --write" + ] } } diff --git a/scripts/build.js b/scripts/build.js index ef6c2846..51029fc3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -87,7 +87,7 @@ async function buildTheDocs(watch = false) { // Builds the source with esbuild. // async function buildTheSource() { - const alwaysExternal = ['@lit-labs/react', 'react']; + const alwaysExternal = ['@lit/react', 'react']; const cdnConfig = { format: 'esm', @@ -122,7 +122,7 @@ async function buildTheSource() { // We don't bundle certain dependencies in the unbundled build. This ensures we ship bare module specifiers, // allowing end users to better optimize when using a bundler. (Only packages that ship ESM can be external.) // - // We never bundle React or @lit-labs/react though! + // We never bundle React or @lit/react though! // external: alwaysExternal, splitting: true, diff --git a/scripts/make-react.js b/scripts/make-react.js index 8fd8406d..d9a23da7 100644 --- a/scripts/make-react.js +++ b/scripts/make-react.js @@ -31,8 +31,7 @@ components.forEach(async component => { const eventExports = (component.events || []) .map(event => `export type { ${event.eventName} } from '../../../src/events/events';`) .join('\n'); - const eventNameImport = - (component.events || []).length > 0 ? `import { type EventName } from '@lit-labs/react';` : ``; + const eventNameImport = (component.events || []).length > 0 ? `import { type EventName } from '@lit/react';` : ``; const events = (component.events || []) .map(event => `${event.reactName}: '${event.name}' as EventName<${event.eventName}>`) .join(',\n'); @@ -44,7 +43,7 @@ components.forEach(async component => { const source = await prettier.format( ` import * as React from 'react'; - import { createComponent } from '@lit-labs/react'; + import { createComponent } from '@lit/react'; import Component from '../../${importPath}'; ${eventNameImport}