Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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,242 changes: 1,358 additions & 884 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ catalog:
'@types/node': 25.6.2
'@types/react': 19.2.14
'@types/react-dom': 19.2.3
'@vitest/browser': 4.1.5
'@vitest/browser-playwright': 4.1.5
'@vitest/coverage-istanbul': 4.1.5
'@vitest/browser': 4.1.6
'@vitest/browser-playwright': 4.1.6
'@vitest/coverage-istanbul': 4.1.6
axe-core: 4.11.0
eslint: 10.3.0
glob: 13.0.6
Expand All @@ -101,17 +101,25 @@ catalog:
stylelint: 17.11.0
stylelint-config-standard: 40.0.0
ts-morph: 26.0.0
'@typescript/native-preview': 7.0.0-dev.20260518.1
typescript: 6.0.3
typescript-eslint: 8.58.1
vite: 8.0.11
vite-plugin-dts: 4.5.4
vitest: 4.1.5
vite: 8.0.13
vite-plugin-dts: 5.0.0
vitest: 4.1.6
zod: 4.4.3

minimumReleaseAge: 1140

minimumReleaseAgeExclude:
- '@types/node'
- '@typescript/native-preview'
- '@typescript/native-preview-linux-x64'
- '@typescript/native-preview-win32-x64'
- '@typescript/native-preview-win32-arm64'
- '@typescript/native-preview-darwin-arm64'
- '@typescript/native-preview-linux-arm64'
- '@typescript/native-preview-linux-arm'
- '@typescript/native-preview-darwin-x64'
- playwright
- playwright-core
- publint
Expand Down
1 change: 1 addition & 0 deletions projects/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noUncheckedSideEffectImports forces the compiler to verify that side-effect-only imports (import "./style.css") point to an actual existing file

"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/code/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/create/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/forms/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/internals/metadata/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "esnext",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/internals/patterns/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/internals/testing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"allowJs": true,
Expand Down
2 changes: 1 addition & 1 deletion projects/internals/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"minisearch": "7.2.0",
"open": "11.0.0",
"publint": "catalog:",
"sanitize-html": "2.17.0",
"sanitize-html": "2.17.4",
"ts-morph": "catalog:",
"zod": "catalog:"
},
Expand Down
1 change: 1 addition & 0 deletions projects/internals/tools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "esnext",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/internals/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"rollup-plugin-html-literals": "catalog:",
"rollup-plugin-visualizer": "7.0.1",
"ts-morph": "catalog:",
"@typescript/native-preview": "catalog:",
"vite-plugin-dts": "catalog:",
"vite-plugin-virtual-html": "1.2.7"
},
Expand Down
24 changes: 17 additions & 7 deletions projects/internals/vite/src/plugins/tsc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { execSync } from 'node:child_process';
import { resolve } from 'path';
import { execFileSync } from 'node:child_process';
import { createRequire } from 'node:module';
import { dirname, resolve } from 'node:path';

const require = createRequire(import.meta.url);
const tsgoPath = resolve(dirname(require.resolve('@typescript/native-preview/package.json')), 'bin/tsgo.js');
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some projects (mostly starters) rely on TS6. This allows our libraries/projects to be type checked with TS7 and get the benefits while preserving ts6 until those projects can be upgrades.

Comment thread
coryrylan marked this conversation as resolved.

/**
* Runs TSC type check on intial build
Expand All @@ -10,11 +14,17 @@ export function tsc() {
apply: 'build',
async buildStart() {
if (process.env.VITE_INITIAL_BUILD) {
execSync(
`tsc --project ${resolve(process.cwd(), './tsconfig.lib.json')} --noEmit --emitDeclarationOnly false`,
{
stdio: 'inherit'
}
execFileSync(
process.execPath,
[
tsgoPath,
'--project',
resolve(process.cwd(), './tsconfig.lib.json'),
'--noEmit',
'--emitDeclarationOnly',
'false'
],
{ stdio: 'inherit' }
);
}
}
Expand Down
1 change: 1 addition & 0 deletions projects/lint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "esnext",
"target": "es2022",
Expand Down
3 changes: 0 additions & 3 deletions projects/markdown/src/markdown/markdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import cssVars from '@nvidia-elements/themes/data.css-vars.json';
// Helper function to wait for async markdown parsing to complete
async function waitForMarkdownParsing(element: Markdown) {
await elementIsStable(element);
// Wait for async markdown parsing to complete
await new Promise(resolve => setTimeout(resolve, 100));
await elementIsStable(element);
}

describe(Markdown.metadata.tag, () => {
Expand Down
41 changes: 29 additions & 12 deletions projects/markdown/src/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export class Markdown extends LitElement {
*/
@state() private renderedHtml = '';

/**
* Tracks the currently pending markdown parse so tests and consumers can await
* `updateComplete` before reading rendered output.
*/
#pendingMarkdownParsing: Promise<void> = Promise.resolve();

/**
* Query assigned elements in the default slot
*/
Expand All @@ -83,21 +89,23 @@ export class Markdown extends LitElement {
`;
}

protected override async getUpdateComplete(): Promise<boolean> {
const result = await super.getUpdateComplete();
const pendingMarkdownParsing = this.#pendingMarkdownParsing;

await pendingMarkdownParsing;
await super.getUpdateComplete();

return result;
}

protected updated(changedProperties: Map<string | number | symbol, unknown>) {
if (changedProperties.has('source')) {
if (this.source) {
// Process markdown content from source property
void this.#parseMarkdown(this.source)
.then(parsed => {
this.renderedHtml = parsed;
})
.catch(_error => {
// Don't update renderedHtml on parsing error - keep previous content
console.debug('Markdown parsing failed, keeping previous content');
});
this.#renderMarkdown(this.source);
} else {
// Source cleared, check for slotted content or clear rendered output
this.renderedHtml = '';
this.#clearRenderedHtml();
this.#processSlottedContent();
}
}
Expand All @@ -114,13 +122,17 @@ export class Markdown extends LitElement {
const templateElement = this.slotElements.find(e => e.localName === 'template') as HTMLTemplateElement | undefined;

if (!templateElement) {
this.renderedHtml = '';
this.#clearRenderedHtml();
return;
}

const content = templateElement.innerHTML.trim();

void this.#parseMarkdown(content)
this.#renderMarkdown(content);
}

#renderMarkdown(markdown: string): void {
this.#pendingMarkdownParsing = this.#parseMarkdown(markdown)
.then(parsed => {
this.renderedHtml = parsed;
})
Expand All @@ -130,6 +142,11 @@ export class Markdown extends LitElement {
});
}

#clearRenderedHtml(): void {
this.#pendingMarkdownParsing = Promise.resolve();
this.renderedHtml = '';
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This improves the getUpdateComplete check so tests can reliably use it for render completion instead of a flakey timeout

/**
* Parse markdown content to HTML using markdown-it.
* Lazy-loads the markdown-it instance only when needed for better performance.
Expand Down
1 change: 1 addition & 0 deletions projects/markdown/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/media/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
1 change: 1 addition & 0 deletions projects/monaco/build/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"target": "es2022",
"lib": ["es2022"],
Expand Down
1 change: 1 addition & 0 deletions projects/monaco/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"skipLibCheck": true,
"module": "es2022",
"target": "es2022",
Expand Down
2 changes: 1 addition & 1 deletion projects/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cpSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
import { cpSync, existsSync, mkdirSync } from 'node:fs';

if (!existsSync('./dist')) {
mkdirSync('./dist/starters', { recursive: true });
Expand Down
20 changes: 0 additions & 20 deletions projects/site/src/_11ty/layouts/docs.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,17 @@ export async function render(data) {
import '/_11ty/layouts/docs.ts';
</script>
</head>

<body nve-text="body trim:none" data-pagefind-meta="section:${section}">
<div class="visually-hidden" aria-hidden="true">${ELEMENTS_PAGES_BASE_URL}/llms.txt is available optimized for AI and LLM tools.</div>
<!-- nve-page component, anchors for internal navigation links -->
<nve-page style="anchor-name: --page-anchor;">
<!-- renders nve-page-header (logo, top nav buttons, system themes btn...) -->
${renderBasePageHeader(data)}

<!-- Left (aside) sidebar, search functionality, and tree navigation -->
<nve-page-panel slot="left-aside" id="sidenav-panel" style="width: 250px;">
<nve-page-panel-content>
<nvd-search id="docs-search" base-url="${BASE_URL}"></nvd-search>
${renderDocsNav(data)}
</nve-page-panel-content>
</nve-page-panel>

<nve-resize-handle slot="left-aside" min="5" max="460" value="250" step="5" orientation="vertical"></nve-resize-handle>

<!-- Subheader: component title, summary, and tab navigation (Overview/API/Examples) -->
${
data.tag
? `
Expand Down Expand Up @@ -112,11 +104,8 @@ export async function render(data) {
`
: ''
}

<!-- Main content area -->
<main id="docs-main">
<div id="doc-content" nve-layout="column gap:xl align:horizontal-stretch pad-bottom:xl" style="anchor-name: --doc-content-anchor;">
<!-- Component description, default example, and support links (Overview tab only) -->
${
data.tag && !(data.page.url.includes('api') || data.page.url.includes('examples'))
? `
Expand All @@ -133,19 +122,10 @@ export async function render(data) {
`
: ''
}

<!-- Markdown page content -->
${data.content}

<!-- Component status (Overview tab only) -->
${data.tag && !data.hideStatus && !(data.page.url.includes('api') || data.page.url.includes('examples')) ? `${elementStatus(data.tag)}` : ''}
</div>
</main>

<!-- An 11ty transform that generates anchor links for the page content -->
<!-- ANCHOR-GENERATOR -->

<!-- Right sidebar: system settings panel -->
<nve-page-panel closable hidden slot="right-aside" size="sm" id="system-options-panel">
<nve-page-panel-content>
<nvd-system-settings></nvd-system-settings>
Expand Down
7 changes: 0 additions & 7 deletions projects/site/src/_11ty/layouts/page.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function render(data) {
</head>
<body>
<nve-page>
<!-- Main navigation header -->
<nve-page-header slot="header">
<nve-logo slot="prefix" color="brand-green" size="sm">NV</nve-logo>
<a slot="prefix" href=".">Elements</a>
Expand All @@ -27,19 +26,13 @@ export function render(data) {
<nve-button container="flat"><a href="${ELEMENTS_REPO_BASE_URL}" target="_blank">Repo</a></nve-button>
<nve-button slot="suffix" id="system-options-panel-btn" container="flat">System Themes</nve-button>
</nve-page-header>

<!-- Main content area -->
${data.content}

<!-- System theme settings panel -->
<nve-page-panel closable hidden slot="right" size="sm" id="system-options-panel">
<nve-page-panel-content>
<nvd-system-settings></nvd-system-settings>
</nve-page-panel-content>
</nve-page-panel>
</nve-page>

<!-- System settings initialization script -->
<script type="module">
import '/_internal/system-settings/system-settings.js';
const systemOptionsPanel = globalThis.document.querySelector('#system-options-panel');
Expand Down
1 change: 1 addition & 0 deletions projects/site/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"target": "esnext",
"experimentalDecorators": true,
"useDefineForClassFields": false,
Expand Down
1 change: 1 addition & 0 deletions projects/starters/lit-library/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"target": "ESNext",
"experimentalDecorators": true,
"useDefineForClassFields": false,
Expand Down
1 change: 1 addition & 0 deletions projects/starters/mpa/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"noUncheckedSideEffectImports": true,
"target": "ESNext",
"experimentalDecorators": true,
"useDefineForClassFields": false,
Expand Down
Loading