Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Compile MDX Content Blocks in hosted builds (#6455)

Oleg Isonen8a46350c9a69
diff --git a/docs/university/foundations/content-engine.md b/docs/university/foundations/content-engine.md
index e978c48c67..799e51392f 100644
--- a/docs/university/foundations/content-engine.md
+++ b/docs/university/foundations/content-engine.md
@@ -51,7 +51,11 @@ Hosted builds receive a content database for their Assets queries. Markdown
body-reference queries use stored frontmatter for that database and fetch the
selected body when a visitor opens the page. Static exports download article
sources and build the database in the publish runner; this transfer and any
-MDX compilation still take time. Use [Content Block](../core-components/content-block.md) when visual
+MDX compilation still take time. Hosted pages using MDX Content Blocks also
+download article sources and compile the required MDX in the publish runner.
+If required MDX content is unavailable or compilation reports an error, the
+build fails instead of publishing an incomplete page.
+Use [Content Block](../core-components/content-block.md) when visual
article editing matters, or [Markdown Embed](../core-components/markdown-embed.md)
when source editing is enough.
diff --git a/packages/cli/src/commands/sync.test.ts b/packages/cli/src/commands/sync.test.ts
index 3e1f6cca8c..891727e7b6 100644
--- a/packages/cli/src/commands/sync.test.ts
+++ b/packages/cli/src/commands/sync.test.ts
@@ -10,6 +10,17 @@ import {
import { join } from "node:path";
import { tmpdir } from "node:os";
import { createServer } from "node:http";
+import { execFile } from "node:child_process";
+import { promisify } from "node:util";
+import { build } from "esbuild";
+import {
+ createStructuredAssetQueryResourceBody,
+ encodeDataSourceVariable,
+} from "@webstudio-is/sdk";
+import {
+ createAssetIndex,
+ createCanonicalAssetFileEntry,
+} from "@webstudio-is/content-engine/compiler";
import { bundleVersion } from "@webstudio-is/protocol";
import {
createImageAssetFixture,
@@ -218,7 +229,6 @@ test.each([
{
name: "hosted",
deployment: { destination: "saas" as const, domains: [] },
- compilesArticles: false,
},
{
name: "SSG",
@@ -228,11 +238,10 @@ test.each([
assetsDomain: "https://assets.example.com",
templates: ["ssg" as const],
},
- compilesArticles: true,
},
])(
- "$name publish sync $compilesArticles articles only for SSG",
- async ({ deployment, compilesArticles }) => {
+ "$name publish sync compiles required MDX articles",
+ async ({ deployment }) => {
const source = "# Published from the runner";
const article = {
...createImageAssetFixture(),
@@ -315,32 +324,268 @@ test.each([
);
const data = JSON.parse(await readFile(".webstudio/data.json", "utf8"));
- if (compilesArticles) {
- expect(downloadAssetFiles).toHaveBeenCalledWith({
- assets: [article, image],
- origin: "https://example.com",
- });
- expect(data.assetIndex.documents).toContainEqual(
- expect.objectContaining({ _id: article.id, extension: "mdx" })
- );
- expect(Object.values(data.assetIndex.contents)).toContain(source);
+ expect(downloadAssetFiles).toHaveBeenCalledWith({
+ assets: [article, image],
+ origin: "https://example.com",
+ });
+ expect(data.assetIndex.documents).toContainEqual(
+ expect.objectContaining({ _id: article.id, extension: "mdx" })
+ );
+ expect(Object.values(data.assetIndex.contents)).toContain(source);
- await prebuild({ assets: false, template: ["ssg"] });
- const generatedPage = await readFile(
- "app/__generated__/_index.tsx",
- "utf8"
- );
- expect(generatedPage).toContain("Published from the runner");
- } else {
- expect(downloadAssetFiles).toHaveBeenCalledWith({
- assets: [image],
- origin: "https://example.com",
- });
- expect(data.assetIndex).toBeUndefined();
- }
+ await prebuild({
+ assets: false,
+ template: [deployment.destination === "static" ? "ssg" : "react-router"],
+ });
+ const generatedPage = await readFile(
+ "app/__generated__/_index.tsx",
+ "utf8"
+ );
+ expect(generatedPage).toContain("Published from the runner");
}
);
+test("hosted sync compiles metadata-only dynamic MDX into a server-rendered page", async () => {
+ const source =
+ "---\nslug: post\ntitle: Article title\n---\n# Published article body";
+ const article = {
+ ...createImageAssetFixture(),
+ id: "article",
+ name: "article.mdx",
+ type: "file" as const,
+ format: "mdx",
+ size: new TextEncoder().encode(source).byteLength,
+ meta: {},
+ };
+ const project = createProjectBundle({
+ assets: [article],
+ build: {
+ deployment: { destination: "saas", domains: [] },
+ instances: [
+ [
+ "root",
+ {
+ id: "root",
+ type: "instance",
+ component: "Box",
+ children: [{ type: "id", value: "content" }],
+ },
+ ],
+ [
+ "content",
+ {
+ id: "content",
+ type: "instance",
+ component: "ws:block",
+ children: [
+ { type: "id", value: "title" },
+ { type: "id", value: "templates" },
+ { type: "id", value: "body" },
+ ],
+ },
+ ],
+ [
+ "body",
+ {
+ id: "body",
+ type: "instance",
+ component: "ws:content-block-body",
+ children: [],
+ },
+ ],
+ [
+ "title",
+ {
+ id: "title",
+ type: "instance",
+ component: "Heading",
+ children: [
+ {
+ type: "expression",
+ value: `${encodeDataSourceVariable("document")}.frontmatter.title`,
+ },
+ ],
+ },
+ ],
+ [
+ "templates",
+ {
+ id: "templates",
+ type: "instance",
+ component: "ws:block-template",
+ children: [],
+ },
+ ],
+ ],
+ props: [
+ [
+ "src",
+ {
+ id: "src",
+ instanceId: "content",
+ name: "src",
+ type: "expression",
+ value: `${encodeDataSourceVariable("article-data")}.data.id`,
+ },
+ ],
+ [
+ "document",
+ {
+ id: "document",
+ instanceId: "content",
+ name: "document",
+ type: "parameter",
+ value: "document",
+ },
+ ],
+ ],
+ dataSources: [
+ [
+ "article-data",
+ {
+ id: "article-data",
+ type: "resource",
+ name: "article",
+ scopeInstanceId: "root",
+ resourceId: "article-query",
+ },
+ ],
+ [
+ "document",
+ {
+ id: "document",
+ type: "parameter",
+ name: "document",
+ scopeInstanceId: "content",
+ },
+ ],
+ ],
+ resources: [
+ [
+ "article-query",
+ {
+ id: "article-query",
+ name: "Article",
+ control: "system",
+ method: "post",
+ url: '"/$resources/assets"',
+ headers: [],
+ body: createStructuredAssetQueryResourceBody({
+ result: "one",
+ limit: "1",
+ offset: "0",
+ where: {
+ field: ["properties", "slug"],
+ operator: "eq",
+ value: "$ws$system.params.slug",
+ },
+ sort: [],
+ output: { mode: "all", includeMetadata: true },
+ content: { mode: "none" },
+ }),
+ },
+ ],
+ ],
+ },
+ });
+ project.assetIndex = await createAssetIndex({
+ projectId: project.build.projectId,
+ entries: [
+ createCanonicalAssetFileEntry({
+ projectId: project.build.projectId,
+ document: {
+ _id: article.id,
+ _type: "asset.file",
+ name: article.name,
+ path: article.name,
+ key: "article",
+ extension: "mdx",
+ mimeType: "text/mdx",
+ size: article.size,
+ revision: "article-revision",
+ contentRef: article.name,
+ properties: { slug: "post", title: "Article title" },
+ },
+ }),
+ ],
+ });
+ loadProjectBundleByBuildId.mockResolvedValue(project);
+ downloadAssetFiles.mockImplementation(async () => {
+ await mkdir(".webstudio/assets", { recursive: true });
+ await writeFile(".webstudio/assets/article.mdx", source);
+ });
+ await sync(
+ { authToken: "token", buildId: "build-1", origin: "https://example.com" },
+ dependencies
+ );
+ await prebuild({ assets: false, template: ["react-router"] });
+ // Execute the generated resource graph and server-render its actual React page.
+ await build({
+ stdin: {
+ contents: `
+ import React from "react";
+ import { renderToString } from "react-dom/server";
+ import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
+ import { loadResources } from "@webstudio-is/sdk/runtime";
+ import { Page } from "./app/__generated__/_index";
+ import { getResources } from "./app/__generated__/_index.server";
+ import { createGeneratedAssetResourceFetch } from "./app/__generated__/$resources.asset-query-runtime";
+ (async () => {
+ const system = { params: { slug: "post" }, search: {}, origin: "https://example.com", pathname: "/post" };
+ const resourceFetch = await createGeneratedAssetResourceFetch({ request: new Request("https://example.com/post"), context: {}, fallback: fetch });
+ const resources = await loadResources(resourceFetch, getResources({system}).data);
+ console.log(renderToString(<ReactSdkContext.Provider value={{resources, assetBaseUrl: "/", imageLoader: ({src}) => src, breakpoints: [], onError: (error) => {throw error} }}><Page system={system} /></ReactSdkContext.Provider>));
+ })().catch((error) => { console.error(error); process.exitCode = 1; });
+ `,
+ loader: "tsx",
+ resolveDir: tempDir,
+ },
+ outfile: join(tempDir, "render.cjs"),
+ bundle: true,
+ platform: "node",
+ format: "cjs",
+ jsx: "automatic",
+ conditions: ["webstudio"],
+ nodePaths: [join(originalCwd, "node_modules")],
+ });
+ const { stdout } = await promisify(execFile)(process.execPath, [
+ join(tempDir, "render.cjs"),
+ ]);
+ expect(stdout).toContain("Article title");
+ expect(stdout).toContain("Published article body");
+}, 30_000);
+
+test("hosted sync keeps article bodies remote without MDX Content Blocks", async () => {
+ const image = createImageAssetFixture();
+ const articles = ["md", "mdx"].map((format) => ({
+ ...image,
+ id: format,
+ name: `article.${format}`,
+ format,
+ type: "file" as const,
+ meta: {},
+ }));
+ const project = createProjectBundle({
+ assets: [...articles, image],
+ build: { deployment: { destination: "saas", domains: [] } },
+ });
+ project.assetIndex = await createAssetIndex({
+ projectId: project.build.projectId,
+ entries: [],
+ });
+ loadProjectBundleByBuildId.mockResolvedValue(project);
+ await sync(
+ { authToken: "token", buildId: "build-1", origin: "https://example.com" },
+ dependencies
+ );
+ expect(downloadAssetFiles).toHaveBeenCalledWith({
+ assets: [image],
+ origin: "https://example.com",
+ });
+ const data = JSON.parse(await readFile(".webstudio/data.json", "utf8"));
+ expect(data.assetIndex).toEqual(project.assetIndex);
+});
+
test("sends linked share token when synchronizing by build id", async () => {
const resolveApiConnection = vi.fn(async () => ({
authToken: "share-token",
diff --git a/packages/cli/src/commands/sync.ts b/packages/cli/src/commands/sync.ts
index 3964949ab8..c16e78937d 100644
--- a/packages/cli/src/commands/sync.ts
+++ b/packages/cli/src/commands/sync.ts
@@ -252,8 +252,28 @@ export const sync = async (
});
const isStaticBuild = project.build.deployment?.destination === "static";
+ const publicationBuild = {
+ ...project.build,
+ pages: migratePages(project.build.pages),
+ };
+ const projectCandidates = resolvePublishedMdxAssetCandidates({
+ build: publicationBuild,
+ artifact: project.assetIndex,
+ allowUnresolved: true,
+ });
+ const dynamicBlockIds =
+ getDynamicPublishedMdxSourceBlockIds(publicationBuild);
+ const publicationPlan = createPublishedBuildContentCompilationPlan(
+ publicationBuild,
+ projectCandidates
+ );
+ const needsMdxCompilation =
+ dynamicBlockIds.length > 0 ||
+ publicationPlan?.queries.some(({ id }) =>
+ id.startsWith("__content-block-mdx__:")
+ ) === true;
const assetsToDownload =
- options.buildId !== undefined && isStaticBuild === false
+ options.buildId !== undefined && !isStaticBuild && !needsMdxCompilation
? project.assets.filter(
(asset) => asset.format !== "md" && asset.format !== "mdx"
)
@@ -282,29 +302,15 @@ export const sync = async (
if (
options.buildId !== undefined &&
- isStaticBuild &&
- project.assetIndex === undefined
+ ((isStaticBuild && project.assetIndex === undefined) || needsMdxCompilation)
) {
- const publicationBuild = {
- ...project.build,
- pages: migratePages(project.build.pages),
- };
- const projectCandidates = resolvePublishedMdxAssetCandidates({
- build: publicationBuild,
- allowUnresolved: true,
- });
- const needsCandidateDiscovery = getDynamicPublishedMdxSourceBlockIds(
- publicationBuild
- ).some((blockId) => projectCandidates.has(blockId) === false);
+ const needsCandidateDiscovery = dynamicBlockIds.some(
+ (blockId) => projectCandidates.has(blockId) === false
+ );
const candidateDiscoveryPlan = needsCandidateDiscovery
? createBuildContentCompilationPlan(publicationBuild)
: undefined;
- let plan =
- candidateDiscoveryPlan ??
- createPublishedBuildContentCompilationPlan(
- publicationBuild,
- projectCandidates
- );
+ const plan = candidateDiscoveryPlan ?? publicationPlan;
if (plan !== undefined) {
syncing.message("Preparing local content index");
const source = createContentSource();
diff --git a/packages/cli/src/prebuild.test.ts b/packages/cli/src/prebuild.test.ts
index 77ced49795..5c7f20254a 100644
--- a/packages/cli/src/prebuild.test.ts
+++ b/packages/cli/src/prebuild.test.ts
@@ -883,79 +883,101 @@ describe("prebuild", () => {
}
);
- test("materializes direct MDX Content Blocks into generated page code", async () => {
- const source = "# Published from MDX";
- const article: AssetFileDocument = {
- ...indexedDocument,
- _id: "article",
- name: "article.mdx",
- path: "article.mdx",
- key: "article",
- extension: "mdx",
- mimeType: "text/mdx",
- size: new TextEncoder().encode(source).byteLength,
- revision: "article-revision",
- contentRef: "article.mdx",
- properties: {},
- };
- const siteData = createSiteData({
- assets: [createAssetForIndexedDocument(article)],
- instances: [
- [
- "root",
- {
- id: "root",
- component: "Box",
- children: [{ type: "id", value: "content" }],
- },
- ],
- [
- "content",
- {
- id: "content",
- component: "ws:block",
- children: [{ type: "id", value: "content-templates" }],
- },
- ],
- [
- "content-templates",
- {
- id: "content-templates",
- component: "ws:block-template",
- children: [],
- },
+ test.each([true, false, undefined])(
+ "requires direct MDX source content (available: %s)",
+ async (hasSource) => {
+ const source = "# Published from MDX";
+ const article: AssetFileDocument = {
+ ...indexedDocument,
+ _id: "article",
+ name: "article.mdx",
+ path: "article.mdx",
+ key: "article",
+ extension: "mdx",
+ mimeType: "text/mdx",
+ size: new TextEncoder().encode(source).byteLength,
+ revision: "article-revision",
+ contentRef: "article.mdx",
+ properties: {},
+ };
+ const siteData = createSiteData({
+ assets: [createAssetForIndexedDocument(article)],
+ instances: [
+ [
+ "root",
+ {
+ id: "root",
+ component: "Box",
+ children: [{ type: "id", value: "content" }],
+ },
+ ],
+ [
+ "content",
+ {
+ id: "content",
+ component: "ws:block",
+ children: [{ type: "id", value: "content-templates" }],
+ },
+ ],
+ [
+ "content-templates",
+ {
+ id: "content-templates",
+ component: "ws:block-template",
+ children: [],
+ },
+ ],
],
- ],
- props: [
- [
- "content-src",
- {
- id: "content-src",
- instanceId: "content",
- name: "src",
- type: "asset",
- value: "article",
- },
+ props: [
+ [
+ "content-src",
+ {
+ id: "content-src",
+ instanceId: "content",
+ name: "src",
+ type: "asset",
+ value: "article",
+ },
+ ],
],
- ],
- });
- const siteDataWithIndex = {
- ...siteData,
- assetIndex: await createTestAssetIndex(article, {
- "article.mdx": source,
- }),
- };
- await writeSiteData(siteDataWithIndex);
+ });
+ const siteDataWithIndex = {
+ ...siteData,
+ assetIndex:
+ hasSource === undefined
+ ? undefined
+ : await createTestAssetIndex(
+ article,
+ hasSource
+ ? {
+ "article.mdx": source,
+ }
+ : {}
+ ),
+ };
+ await writeSiteData(siteDataWithIndex);
- await prebuild({ assets: false, template: ["react-router"] });
+ if (!hasSource) {
+ await expect(
+ prebuild({ assets: false, template: ["react-router"] })
+ ).rejects.toThrow(
+ hasSource === undefined
+ ? "require a content database"
+ : 'Published MDX Asset "article" content is unavailable'
+ );
+ return;
+ }
- const generatedPage = await readFile(
- "app/__generated__/_index.tsx",
- "utf8"
- );
- expect(generatedPage).toContain("Published from MDX");
- expect(generatedPage).not.toContain("fetch(");
- });
+ await prebuild({ assets: false, template: ["react-router"] });
+
+ const generatedPage = await readFile(
+ "app/__generated__/_index.tsx",
+ "utf8"
+ );
+ expect(generatedPage).toContain("Published from MDX");
+ expect(generatedPage).not.toContain("fetch(");
+ }
+ );
test("materializes Content Blocks introduced by an MDX template", async () => {
const outerSource = '<ws.element ws:name="Nested" />';
@@ -1321,8 +1343,7 @@ describe("prebuild", () => {
expect(generatedPage).not.toContain('"dynamic.png"');
});
- test("warns and skips a dynamic MDX source without finite candidates", async () => {
- const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
+ test("rejects a dynamic MDX source without a content database", async () => {
const siteData = createSiteData({
instances: [
[
@@ -1350,17 +1371,9 @@ describe("prebuild", () => {
});
await writeSiteData(siteData);
- await prebuild({ assets: false, template: ["react-router"] });
-
- expect(
- warn.mock.calls
- .map(([message]) => JSON.parse(String(message)))
- .find(({ feature }) => feature === "content-block-mdx")
- ).toMatchObject({
- type: "webstudio-build-warning",
- code: "invalid-mdx",
- blockInstanceId: "content",
- });
+ await expect(
+ prebuild({ assets: false, template: ["react-router"] })
+ ).rejects.toThrow("require a content database");
});
test("excludes resources in statically hidden subtrees", async () => {
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index 2734cd20a1..c28deb334c 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -73,7 +73,6 @@ import {
createAssetUrlsByPath,
} from "@webstudio-is/project-build/runtime";
import {
- createBuildContentCompilationPlan,
createPublishedBuildContentCompilationPlan,
getDynamicPublishedMdxSourceBlockIds,
hasDynamicPublishedMdxSources,
@@ -979,7 +978,9 @@ export const prebuild = async (options: {
const publicationBuild = { ...siteData.build, pages };
if (
siteData.assetIndex === undefined &&
- createBuildContentCompilationPlan(publicationBuild) !== undefined
+ (createPublishedBuildContentCompilationPlan(publicationBuild) !==
+ undefined ||
+ hasDynamicPublishedMdxSources(publicationBuild))
) {
throw new Error(
"Assets queries require a content database. Sync the project again before building."
@@ -1465,6 +1466,9 @@ export const prebuild = async (options: {
...warning.diagnostic,
})
);
+ if (warning.diagnostic.severity === "error") {
+ throw new Error(warning.diagnostic.message);
+ }
}
}
pageData.build.instances = Array.from(pageInstances);
diff --git a/packages/project-build/src/db/build.test.ts b/packages/project-build/src/db/build.test.ts
index 83bc0fed17..f69f43fdf1 100644
--- a/packages/project-build/src/db/build.test.ts
+++ b/packages/project-build/src/db/build.test.ts
@@ -116,6 +116,32 @@ describe("loadBuildById (msw)", () => {
expect(result.marketplaceProduct).toBeUndefined();
});
+ test("drops persisted response-header rules with a null value", async () => {
+ server.use(
+ db.get("Build", () =>
+ json([
+ {
+ ...buildRow,
+ projectSettings: JSON.stringify({
+ meta: {
+ customHeaders: [
+ { name: "X-Frame-Options", value: null },
+ { name: "Referrer-Policy", value: "no-referrer" },
+ ],
+ },
+ compiler: {},
+ }),
+ },
+ ])
+ )
+ );
+
+ const result = await loadBuildById(createContext(), "build-1");
+ expect(result.projectSettings.meta.customHeaders).toEqual([
+ { name: "Referrer-Policy", value: "no-referrer" },
+ ]);
+ });
+
test("rejects invalid persisted data sources", async () => {
server.use(
db.get("Build", () =>
@@ -430,6 +456,14 @@ describe("createProductionBuild (msw)", () => {
denied: false,
checkPlan: false,
},
+ {
+ label: "Free owner, legacy null header value",
+ allowed: false,
+ domains: ["example.com"],
+ headers: [{ name: "X-Frame-Options", value: null }],
+ denied: false,
+ checkPlan: false,
+ },
{
label: "Free owner, explicit defaults",
allowed: false,
diff --git a/packages/project-build/src/db/build.ts b/packages/project-build/src/db/build.ts
index 0a205bb20e..1fa5fdf871 100644
--- a/packages/project-build/src/db/build.ts
+++ b/packages/project-build/src/db/build.ts
@@ -30,7 +30,7 @@ import { parseDeployment } from "./deployment";
import { marketplaceProduct } from "../shared/marketplace";
import {
createProjectSettingsFromPages,
- projectSettings,
+ parseProjectSettings,
removeLegacyProjectSettingsFromPages,
} from "../shared/project-settings";
import { breakCyclesMutable } from "../shared/graph-utils";
@@ -100,7 +100,7 @@ const parseCompactBuild = async (
const parsedProjectSettings =
build.projectSettings === undefined || build.projectSettings === null
? createProjectSettingsFromPages(pages)
- : projectSettings.parse(parseConfig<unknown>(build.projectSettings));
+ : parseProjectSettings(parseConfig<unknown>(build.projectSettings));
return {
id: build.id,
projectId: build.projectId,
@@ -455,7 +455,7 @@ export const createProductionBuild = async (
if (snapshot.data.length !== 1) {
throw new Error("Cannot verify published response headers");
}
- const settings = projectSettings.parse(
+ const settings = parseProjectSettings(
parseConfig<unknown>(snapshot.data[0].projectSettings)
);
if (!hasCustomResponseHeaders(settings.meta.customHeaders)) {
diff --git a/packages/project-build/src/shared/project-settings.ts b/packages/project-build/src/shared/project-settings.ts
index 5dc2ec2e9c..ace1650166 100644
--- a/packages/project-build/src/shared/project-settings.ts
+++ b/packages/project-build/src/shared/project-settings.ts
@@ -8,6 +8,39 @@ export const projectSettings = z.object({
export type ProjectSettings = z.infer<typeof projectSettings>;
+/**
+ * Reads persisted settings while discarding response-header rows written by
+ * older clients with a null value. Writes still use the strict projectSettings
+ * schema, so new invalid values are rejected.
+ */
+export const parseProjectSettings = (value: unknown): ProjectSettings => {
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
+ const settings = value as Record<string, unknown>;
+ const meta = settings.meta;
+ if (typeof meta === "object" && meta !== null && !Array.isArray(meta)) {
+ const metaRecord = meta as Record<string, unknown>;
+ const customHeaders = metaRecord.customHeaders;
+ if (Array.isArray(customHeaders)) {
+ value = {
+ ...settings,
+ meta: {
+ ...metaRecord,
+ customHeaders: customHeaders.filter(
+ (header) =>
+ typeof header !== "object" ||
+ header === null ||
+ Array.isArray(header) ||
+ !("value" in header) ||
+ header.value !== null
+ ),
+ },
+ };
+ }
+ }
+ }
+ return projectSettings.parse(value);
+};
+
export const createProjectSettingsFromPages = (
pages: Pick<Pages, "meta" | "compiler">
): ProjectSettings => ({