From 713bc4fbf874c1ce60acaaa6ac986531d20e05c6 Mon Sep 17 00:00:00 2001 From: Elliott Marquez <5981958+e111077@users.noreply.github.com> Date: Fri, 16 May 2025 19:50:42 -0700 Subject: [PATCH 1/2] [ci] fix release image sandbox error CI is broken based on the kernel used by GH Actions. We are using unbuntu-latest. [See this CI error](https://github.com/lit/lit/actions/runs/15080547701/job/42397010351?pr=4970). Pretty sure we can trust the content we are running so we should be able to just turn the sandbox off since this just generates an image. --- .changeset/lovely-mangos-deny.md | 5 ++++ .changeset/witty-masks-begin.md | 5 ++++ .../internal-scripts/src/release-image.ts | 5 +++- packages/labs/vue-utils/src/wrapper-utils.ts | 24 ++++++++++++------- 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 .changeset/lovely-mangos-deny.md create mode 100644 .changeset/witty-masks-begin.md diff --git a/.changeset/lovely-mangos-deny.md b/.changeset/lovely-mangos-deny.md new file mode 100644 index 0000000000..043f4be13b --- /dev/null +++ b/.changeset/lovely-mangos-deny.md @@ -0,0 +1,5 @@ +--- +'@lit-labs/vue-utils': patch +--- + +Fixed an issue where assignSlotNodes would throw an error due to it processing an internal Vue implementation slotname diff --git a/.changeset/witty-masks-begin.md b/.changeset/witty-masks-begin.md new file mode 100644 index 0000000000..bde4906585 --- /dev/null +++ b/.changeset/witty-masks-begin.md @@ -0,0 +1,5 @@ +--- +'@lit-internal/scripts': patch +--- + +Fix CI issue regarding release image diff --git a/packages/internal-scripts/src/release-image.ts b/packages/internal-scripts/src/release-image.ts index 5280a2a59d..b7dd9b08ad 100644 --- a/packages/internal-scripts/src/release-image.ts +++ b/packages/internal-scripts/src/release-image.ts @@ -153,7 +153,10 @@ async function generateReleaseImage(contents: string) { `; - const browser = await puppeteer.launch({headless: true}); + const browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox'], + }); const page = await browser.newPage(); await page.setViewport({width: 800, height: 800, deviceScaleFactor: 2}); await page.setContent(html); diff --git a/packages/labs/vue-utils/src/wrapper-utils.ts b/packages/labs/vue-utils/src/wrapper-utils.ts index 944623846d..2cd454d533 100644 --- a/packages/labs/vue-utils/src/wrapper-utils.ts +++ b/packages/labs/vue-utils/src/wrapper-utils.ts @@ -45,12 +45,18 @@ const assignWrappedNode = (v: VNode, name: string) => // Converts Vue slot data to native slot-able nodes by directly manipulating // vNodes. export const assignSlotNodes = (slots: Slots) => - Object.keys(slots).map((name) => - slots[name]().map((v: VNode) => - name === 'default' - ? v - : isElementNode(v) - ? assignNode(v, name) - : assignWrappedNode(v, name) - ) - ); + Object.keys(slots) + // Vue seems to have introduced a `__` slot name that holds metadata + // in the form of number[] rather than vNodes. + .filter((name) => name !== '__') + .map((name) => { + const slotValue = slots[name]; + const nodes = Array.isArray(slotValue) ? slotValue : slotValue(); + return nodes.map((v: VNode) => + name === 'default' + ? v + : isElementNode(v) + ? assignNode(v, name) + : assignWrappedNode(v, name) + ); + }); From 83e7f0bb33880fdc38cc86ccb1bd15348ea4462b Mon Sep 17 00:00:00 2001 From: Elliott Marquez <5981958+e111077@users.noreply.github.com> Date: Fri, 11 Apr 2025 00:09:17 -0700 Subject: [PATCH 2/2] style(copilot-instructions): add a copilot instructions file --- .github/copilot-instructions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..4971cfc893 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,19 @@ +# Repository Technical Context + +This repository is a monorepo that uses Lit for building web components and no other frontend frameworks unless otherwise specified. + +## Coding Patterns + +- Uses standard ESM imports +- TypeScript imports end with `.js` extension +- Decorators are used, but other TypeScript features that are not standard JavaScript are avoided +- Focuses on native, modern browser features, including custom elements, Shadow DOM, and css custom properties. + +## Build System + +- Google Wireit orchestrates npm scripts +- Wireit script configurations: + - Declare file inputs and outputs + - Specify script dependencies + - Cache build artifacts in `.wireit` directories + - Prepending `WIREIT_LOGGER=simple npm run ` outputs the full logs to the console