Skip to content

Commit

Permalink
extract createSiteStorage to external file
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed May 9, 2024
1 parent 1e2291c commit 9f4fb68
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 22 deletions.
15 changes: 15 additions & 0 deletions packages/docusaurus-types/src/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import type {SiteStorage} from './context';
import type {RuleSetRule} from 'webpack';
import type {Required as RequireKeys, DeepPartial} from 'utility-types';
import type {I18nConfig} from './i18n';
Expand Down Expand Up @@ -115,6 +116,15 @@ export type MarkdownConfig = {
anchors: MarkdownAnchorsConfig;
};

export type StorageOption = {
type: SiteStorage['type'];
namespace: boolean | string;
};

export type DocusaurusFuture = {
experimental_storage: StorageOption;
};

/**
* Docusaurus config, after validation/normalization.
*/
Expand Down Expand Up @@ -171,6 +181,11 @@ export type DocusaurusConfig = {
* @see https://docusaurus.io/docs/api/docusaurus-config#i18n
*/
i18n: I18nConfig;
/**
* Docusaurus future flags and experimental features.
* Similar to Remix future flags, see https://remix.run/blog/future-flags
*/
future: DocusaurusFuture;
/**
* This option adds `<meta name="robots" content="noindex, nofollow">` to
* every page to tell search engines to avoid indexing your site.
Expand Down
5 changes: 1 addition & 4 deletions packages/docusaurus-types/src/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ export type SiteMetadata = {
readonly pluginVersions: {[pluginName: string]: PluginVersionInformation};
};

// Should we have a value to disable storage?
export type SiteStorageType = 'localStorage' | 'sessionStorage';

export type SiteStorage = {
/**
* Which browser storage do you want to use?
* Between "localStorage" and "sessionStorage".
* The default is "localStorage".
*/
type: SiteStorageType;
type: 'localStorage' | 'sessionStorage';

/**
* Applies a namespace to the theme storage key
Expand Down
19 changes: 1 addition & 18 deletions packages/docusaurus/src/server/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
localizePath,
DEFAULT_BUILD_DIR_NAME,
GENERATED_FILES_DIR_NAME,
normalizeUrl,
simpleHash,
} from '@docusaurus/utils';
import combinePromises from 'combine-promises';
import {loadSiteConfig} from './config';
Expand All @@ -27,14 +25,14 @@ import {
import {PerfLogger} from '../utils';
import {generateSiteFiles} from './codegen/codegen';
import {getRoutesPaths, handleDuplicateRoutes} from './routes';
import {createSiteStorage} from './storage';
import type {LoadPluginsResult} from './plugins/plugins';
import type {
DocusaurusConfig,
GlobalData,
LoadContext,
Props,
PluginIdentifier,
SiteStorage,
} from '@docusaurus/types';

export type LoadContextParams = {
Expand Down Expand Up @@ -62,21 +60,6 @@ export type Site = {
params: LoadSiteParams;
};

function defaultNamespace(config: DocusaurusConfig): string {
return simpleHash(normalizeUrl([config.url, config.baseUrl]), 3);
}

function createSiteStorage(config: DocusaurusConfig): SiteStorage {
// TODO make it configurable, default to ""
const namespaceSuffix = defaultNamespace(config);

const namespace = `-${namespaceSuffix}`;
return {
type: 'localStorage',
namespace,
};
}

/**
* Loading context is the very first step in site building. Its params are
* directly acquired from CLI options. It mainly loads `siteConfig` and the i18n
Expand Down
36 changes: 36 additions & 0 deletions packages/docusaurus/src/server/storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import {normalizeUrl, simpleHash} from '@docusaurus/utils';
import type {DocusaurusConfig, SiteStorage} from '@docusaurus/types';

type Params = Pick<DocusaurusConfig, 'url' | 'baseUrl' | 'future'>;

function automaticNamespace(params: Params): string {
return simpleHash(normalizeUrl([params.url, params.baseUrl]), 3);
}

function getNamespaceString(params: Params): string | null {
if (params.future.experimental_storage.namespace === true) {
return automaticNamespace(params);
} else if (params.future.experimental_storage.namespace === false) {
return null;
} else {
return params.future.experimental_storage.namespace;
}
}

export function createSiteStorage(config: DocusaurusConfig): SiteStorage {
const {type} = config.future.experimental_storage;

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › readVersionDocs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:241:39)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › normal docs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:272:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:322:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with custom editUrl & unrelated frontMatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:371:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with function editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:397:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with last update time and author

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:455:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with draft frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:490:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with unlisted frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:512:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with last_update front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:550:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18.0)

simple site › docs with only last_update author front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:589:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › readVersionDocs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:241:39)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › normal docs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:272:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:322:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with custom editUrl & unrelated frontMatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:371:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with function editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:397:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with last update time and author

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:455:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with draft frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:490:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with unlisted frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:512:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with last_update front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:550:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (18)

simple site › docs with only last_update author front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:589:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › readVersionDocs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:241:39)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › normal docs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:272:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:322:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with custom editUrl & unrelated frontMatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:371:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with function editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:397:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with last update time and author

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:455:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with draft frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:490:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with unlisted frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:512:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with last_update front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:550:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

simple site › docs with only last_update author front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:589:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › readVersionDocs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:241:39)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › normal docs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:272:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:322:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with custom editUrl & unrelated frontMatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:371:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with function editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:397:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with last update time and author

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:455:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with draft frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:490:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with unlisted frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:512:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with last_update front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:550:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18.0)

simple site › docs with only last_update author front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:589:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › readVersionDocs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:241:39)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › normal docs

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:272:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:322:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with custom editUrl & unrelated frontMatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:371:32)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with function editUrl

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:397:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with last update time and author

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:455:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with draft frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:490:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with unlisted frontmatter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:512:38)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with last_update front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:550:7)

Check failure on line 28 in packages/docusaurus/src/server/storage.ts

View workflow job for this annotation

GitHub Actions / Windows Tests (18)

simple site › docs with only last_update author front matter

TypeError: Cannot read properties of undefined (reading 'experimental_storage') at Object.experimental_storage [as createSiteStorage] (packages/docusaurus/src/server/storage.ts:28:32) at Object.loadContext (packages/docusaurus/src/server/site.ts:115:52) at loadSite (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:204:21) at Object.<anonymous> (packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts:589:7)
const namespaceString = getNamespaceString(config);

const namespace = namespaceString ? `-${namespaceString}` : '';
return {
type,
namespace,
};
}

0 comments on commit 9f4fb68

Please sign in to comment.