feat: v4.0.0 (#1016)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Mathieu COSYNS <64072917+Mathieu-COSYNS@users.noreply.github.com>
This commit is contained in:
Daniel Lautzenheiser
2024-01-03 15:14:09 -05:00
committed by GitHub
parent 682576ffc4
commit 799c7e6936
732 changed files with 48477 additions and 10886 deletions

View File

@ -1,5 +1,6 @@
/* eslint-disable import/prefer-default-export */
import type { Entry } from '@staticcms/core';
import { WorkflowStatus } from '@staticcms/core/constants/publishModes';
import type { Entry, UnpublishedEntry } from '@staticcms/core';
export const createMockEntry = (
options: Omit<Partial<Entry>, 'data'> & Pick<Entry, 'data'>,
@ -14,5 +15,38 @@ export const createMockEntry = (
mediaFiles: [],
author: 'Some Person',
updatedOn: '20230-02-09T00:00:00.000Z',
openAuthoring: false,
...options,
});
export const createMockExpandedEntry = (
options: Omit<Partial<Entry>, 'data'> & Pick<Entry, 'data'> & { field: string },
): Entry & { field: string } => ({
collection: 'mock_collection',
slug: 'slug-value',
path: '/path/to/entry',
partial: false,
raw: JSON.stringify(options.data),
label: 'Entry',
isModification: false,
mediaFiles: [],
author: 'Some Person',
updatedOn: '20230-02-09T00:00:00.000Z',
openAuthoring: false,
...options,
});
export const createMockUnpublishedEntry = (
options: Partial<UnpublishedEntry>,
): UnpublishedEntry => ({
slug: 'unpublished-entry.md',
collection: 'posts',
status: WorkflowStatus.DRAFT,
diffs: [
{ id: 'index.md', path: 'src/posts/index.md', newFile: false },
{ id: 'netlify.png', path: 'netlify.png', newFile: true },
],
updatedAt: '20230-02-09T00:00:00.000Z',
openAuthoring: false,
...options,
});