Skip to content
Draft
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ Current truth lives in:
Historical changelog details remain available through git history and release
evidence.

## Unreleased

- Narrows `@openelement/adapter-vite` to its documented root,
`nitro-mount`, and `cli/build` interfaces. Import `openElement`, build
helpers, MDX helpers, and sitemap generation from the package root; internal
plugin factories and individual build phases are no longer published.
- Refreshes the Mastodon dogfood lockfile to the current five-package
`0.41.0-alpha.15` dependency graph so clean verification is reproducible.

## 0.41.0-alpha.13 (unreleased)

- Removes the alpha-only `defineLayout` alias; use `defineElement` with the same
Expand Down
95 changes: 2 additions & 93 deletions docs/release/v0.41.0-interface-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
]
},
"./i18n": {
"sha256": "56dd01445bd8ada8b9ca5489eb8d0cb83a911f105c1226cd093ded19fdf8b505",
"sha256": "3ad65c2d8218586e85d556dd013c6e08ab17d741a1b544886c52f34ae63dfb7c",
"publicDeclarations": [
"export type { OpenElementI18nOptions } from './i18n-runtime.ts';",
"export type { LocalePath } from './internal/router/i18n.ts';"
Expand Down Expand Up @@ -136,19 +136,8 @@
"name": "@openelement/adapter-vite",
"exports": {
".": "./src/index.ts",
"./app-vite": "./src/app-vite.ts",
"./build-context": "./src/build-context.ts",
"./cli/build": "./src/cli/build.ts",
"./cli/build-client": "./src/cli/build-client.ts",
"./cli/build-ssg": "./src/cli/build-ssg.ts",
"./generated-data-resolver": "./src/generated-data-resolver.ts",
"./head-injection": "./src/head-injection.ts",
"./i18n-plugin": "./src/i18n-plugin.ts",
"./nitro-mount": "./src/nitro-mount.ts",
"./plugin": "./src/plugin.ts",
"./plugin-mdx": "./src/plugin-mdx.ts",
"./route-manifest": "./src/route-manifest.ts",
"./sitemap": "./src/sitemap.ts"
"./nitro-mount": "./src/nitro-mount.ts"
},
"declarations": {
".": {
Expand All @@ -164,62 +153,10 @@
"export type { OpenMdxPluginOptions } from './plugin-mdx.ts';"
]
},
"./app-vite": {
"sha256": "57646b30b6aef837c2929b4e0ac5cf19247cac2261ab2049fad306309f2ae64b",
"publicDeclarations": [
"export interface OpenElementOptions extends FrameworkOptions {",
"export function openElement(options: OpenElementOptions = {}): Plugin[] {"
]
},
"./build-context": {
"sha256": "3a58c9c14a9ad04bce324e2877c81e826a5339c2497eab8b014c2cbeda921c5b",
"publicDeclarations": [
"export type Phase = 1 | 2 | 3;",
"export class Phase1Meta {",
"export class Phase2Meta {",
"export class Phase3Meta {",
"export class OpenElementBuildContext {"
]
},
"./cli/build": {
"sha256": "19b817d8d114f0b107b7708675754de3fdc12c76c85c4dd3333814b6643894bd",
"publicDeclarations": []
},
"./cli/build-client": {
"sha256": "14e89ab366b2a2230c872baffb3519042fd1ac39cac15326906da537098a36ae",
"publicDeclarations": []
},
"./cli/build-ssg": {
"sha256": "55fed1e0cf8265222329dd036c709fc967054e1f1f3dd3e4f9b3856382a3ad42",
"publicDeclarations": []
},
"./generated-data-resolver": {
"sha256": "d18395cfa3eca7cd72f2e5481b24a0e76d49284d717a9c08274c085adf80788c",
"publicDeclarations": [
"export const GENERATED_NAV_ID = '@openelement/generated/nav';",
"export const GENERATED_BLOG_DATA_ID = '@openelement/generated/blog-data';",
"export const GENERATED_I18N_ID = '@openelement/generated/i18n';",
"export type GeneratedDataResolverOptions = {",
"export function generatedDataPath(",
"export function createGeneratedDataResolverPlugin("
]
},
"./head-injection": {
"sha256": "28dab8f1b72b612847e1a158869ad8afc8fe89a242684ffffb44997c022a66e0",
"publicDeclarations": [
"export function assertNoScriptTags(html: string, context: string): void {",
"export function validateSafeUrl(url: string, context: string): string {",
"export interface HeadExtrasResult {",
"export function buildHeadExtras(options: FrameworkOptions): HeadExtrasResult {"
]
},
"./i18n-plugin": {
"sha256": "b24544efcdc71ff563a6a5ad4745bbfa3c3152a4694d42bdae2ec929a5f47cb3",
"publicDeclarations": [
"export function writeI18nDataModule(locales: string[], defaultLocale: string): string {",
"export function openI18n("
]
},
"./nitro-mount": {
"sha256": "13667f6d4b8db527d5f5cf4f7f21e8764aa92732d48a7d2601760d81e5321a39",
"publicDeclarations": [
Expand All @@ -228,34 +165,6 @@
"export interface OpenElementNitroMountOptions<",
"export function createOpenElementNitroHandler<"
]
},
"./plugin": {
"sha256": "86180df73bccca4e4527599ff948e98f0cf49b3764bde8d844f4fb409e58c0d2",
"publicDeclarations": [
"export function optionalPackageStubsPlugin(): Plugin {",
"export function createOpenPlugin("
]
},
"./plugin-mdx": {
"sha256": "5acc04ce17016f446a66384f859e24ef914743a71fa02c0cb10cdfa3adcc84eb",
"publicDeclarations": [
"export interface OpenMdxPluginOptions {",
"export function mdxPlugin(options: OpenMdxPluginOptions = {}): Plugin {"
]
},
"./route-manifest": {
"sha256": "383a1fdf94c5df10b62fbbdcc3e9d021dfbab222e7c232c3358718d8a866a8f8",
"publicDeclarations": [
"export interface GenerateRouteManifestOptions {",
"export const routeManifest = {} as const;",
"export const routeManifest = {"
]
},
"./sitemap": {
"sha256": "2c24151329624e9adde127f4762580ff3ac75fff4a66818fc83d7100d91a9135",
"publicDeclarations": [
"export type { SitemapOptions } from './internal/content/types.ts';"
]
}
}
},
Expand Down
32 changes: 8 additions & 24 deletions examples/deno-desktop-mastodon/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions packages/adapter-vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

openElement build orchestration for Vite.

> v0.39 surface: advanced Framework infrastructure. First-run apps should use
> `@openelement/adapter-vite/app-vite` or generated `@openelement/create` tasks instead of
> importing this package directly.
The package root is the supported Vite interface. Generated
`@openelement/create` projects use the same interface.

This package scans routes and islands, generates virtual entries, builds client
island chunks, runs SSG, and writes post-processed HTML. It is build-time
Expand All @@ -19,12 +18,12 @@ npm install @openelement/adapter-vite
## Usage

```ts
import { createOpenPlugin } from '@openelement/adapter-vite/plugin';
import { openElement } from '@openelement/adapter-vite';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [
createOpenPlugin({
openElement({
routesDir: 'app/routes',
islandsDir: 'app/islands',
componentsDir: 'app/components',
Expand All @@ -34,9 +33,9 @@ export default defineConfig({
});
```

Most applications should use `openElement()` from `@openelement/adapter-vite/app-vite`
instead; it combines the core adapter, content pipeline, and i18n with one
shared build context.
`openElement()` combines the core adapter, content pipeline, and i18n behind one
shared build context. Internal plugin factories and build phases are not
published as package subpaths.

## Nitro Deploy Adapter

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-vite/__tests__/app-vite.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @openelement/adapter-vite/app-vite - Unified entry tests
* @openelement/adapter-vite unified entry tests.
*
* Tests that openElement() correctly combines openPipeline() + openContent() + openI18n()
* with a shared OpenElementBuildContext. This is the primary user-facing API.
Expand Down
12 changes: 12 additions & 0 deletions packages/adapter-vite/__tests__/index-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ import { createOpenPlugin } from '../src/plugin.ts';

import { openPipeline } from '../src/index.ts';

Deno.test('package exposes only the supported deep build interface', async () => {
const manifest = JSON.parse(
await Deno.readTextFile(new URL('../deno.json', import.meta.url)),
) as { exports: Record<string, string> };

assertEquals(Object.keys(manifest.exports).sort(), [
'.',
'./cli/build',
'./nitro-mount',
]);
});

type CallablePluginHook = (...args: unknown[]) => unknown;

function callPluginHook(hook: unknown, ...args: unknown[]): unknown {
Expand Down
13 changes: 1 addition & 12 deletions packages/adapter-vite/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,8 @@
"version": "0.41.0-alpha.15",
"exports": {
".": "./src/index.ts",
"./app-vite": "./src/app-vite.ts",
"./build-context": "./src/build-context.ts",
"./head-injection": "./src/head-injection.ts",
"./i18n-plugin": "./src/i18n-plugin.ts",
"./nitro-mount": "./src/nitro-mount.ts",
"./plugin": "./src/plugin.ts",
"./generated-data-resolver": "./src/generated-data-resolver.ts",
"./plugin-mdx": "./src/plugin-mdx.ts",
"./route-manifest": "./src/route-manifest.ts",
"./sitemap": "./src/sitemap.ts",
"./cli/build": "./src/cli/build.ts",
"./cli/build-client": "./src/cli/build-client.ts",
"./cli/build-ssg": "./src/cli/build-ssg.ts"
"./cli/build": "./src/cli/build.ts"
},
"imports": {
"@mdx-js/rollup": "npm:@mdx-js/rollup@^3.1.1",
Expand Down
11 changes: 0 additions & 11 deletions packages/adapter-vite/src/generated-export-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,8 @@
export const OPENELEMENT_EXPORT_FILES: Record<string, Record<string, string>> = {
'adapter-vite': {
'.': 'src/index.ts',
'app-vite': 'src/app-vite.ts',
'build-context': 'src/build-context.ts',
'cli/build': 'src/cli/build.ts',
'cli/build-client': 'src/cli/build-client.ts',
'cli/build-ssg': 'src/cli/build-ssg.ts',
'generated-data-resolver': 'src/generated-data-resolver.ts',
'head-injection': 'src/head-injection.ts',
'i18n-plugin': 'src/i18n-plugin.ts',
'nitro-mount': 'src/nitro-mount.ts',
'plugin': 'src/plugin.ts',
'plugin-mdx': 'src/plugin-mdx.ts',
'route-manifest': 'src/route-manifest.ts',
'sitemap': 'src/sitemap.ts',
},
'app': {
'.': 'src/index.ts',
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-vite/src/i18n-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// deno-api-free:ignore
/**
* @openelement/adapter-vite/i18n-plugin - Node-only Vite plugin for i18n
* Internal Node-only Vite plugin for i18n.
*
* Build-time Vite plugin, allowed to use node:*.
*
Expand Down
1 change: 0 additions & 1 deletion packages/adapter-vite/src/internal/ssg/entry-render-ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function renderSsgSection(desc: EntryDescriptor): string {
lines.push(
'export { posts, getPostBySlug, getBlogOptions } from "@openelement/generated/blog-data"',
);
lines.push('export { generateSitemap } from "@openelement/adapter-vite/sitemap"');
lines.push(
'export { locales, getDefaultLocale, getI18nOptions } from "@openelement/generated/i18n"',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-vite/src/internal/ssg/entry-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* H-16 KNOWN ISSUE: Circular dependency between adapter-vite <-> content
* adapter-vite generates code that imports its public sitemap utility
* content package imports @openelement/adapter-vite/build-context
* adapter internals share the private OpenElementBuildContext implementation
* Shared contracts now live in @openelement/element and adapter internals.
* so consumer import maps can be checked.
*
Expand Down
6 changes: 3 additions & 3 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default definePage({
});
```

Use the Vite facade from `@openelement/adapter-vite/app-vite` in `vite.config.ts`:
Use the Vite facade from `@openelement/adapter-vite` in `vite.config.ts`:

```ts
import { openElement } from '@openelement/adapter-vite/app-vite';
import { openElement } from '@openelement/adapter-vite';
import { defineConfig } from 'vite';

export default defineConfig({
Expand Down Expand Up @@ -58,7 +58,7 @@ parameters, and wildcards remain supported.
authors should start from this package.

Build configuration is owned by `@openelement/adapter-vite`; generated projects
and docs import its `app-vite` facade rather than an app-package Vite subpath.
and docs import its package root rather than an implementation subpath.

## Install

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/i18n-runtime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @openelement/app/i18n-runtime - Runtime-safe i18n helpers (no node:* modules)
*
* Separated from @openelement/adapter-vite/i18n-plugin to prevent node built-ins from
* Separated from the adapter-vite internal i18n plugin to prevent node built-ins from
* being pulled into client island bundles via @openelement/app main re-exports.
*
* Route-level helpers:
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @openelement/app/i18n - Runtime-safe i18n helpers (no node:* modules)
*
* Thin re-export barrel from i18n-runtime.ts.
* The node-only Vite plugin is in @openelement/adapter-vite/i18n-plugin and
* The node-only Vite plugin is internal to @openelement/adapter-vite and
* must NOT be re-exported here,
* to prevent node:process/node:path/node:fs from being pulled into client
* island bundles via @openelement/app main re-exports.
Expand Down
Loading
Loading