chore: import upstream snapshot with attribution
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import path from 'path';
|
||||
import {
|
||||
getBlockStructure,
|
||||
writeBlockStructure
|
||||
} from '@freecodecamp/curriculum/file-handler';
|
||||
import type { BlockLabel } from '@freecodecamp/shared/config/blocks';
|
||||
import { getProjectPath } from './get-project-info.js';
|
||||
|
||||
export type Meta = {
|
||||
blockLayout: string;
|
||||
blockLabel?: BlockLabel;
|
||||
isUpcomingChange: boolean;
|
||||
dashedName: string;
|
||||
helpCategory: string;
|
||||
time: string;
|
||||
template: string;
|
||||
required: string[];
|
||||
challengeOrder: { id: string; title: string }[];
|
||||
};
|
||||
|
||||
function getMetaData() {
|
||||
const block = getBlock(getProjectPath());
|
||||
return getBlockStructure(block) as Meta;
|
||||
}
|
||||
|
||||
function getBlock(filePath: string) {
|
||||
return path.basename(filePath);
|
||||
}
|
||||
|
||||
async function updateMetaData(newMetaData: Record<string, unknown>) {
|
||||
const block = getBlock(getProjectPath());
|
||||
await writeBlockStructure(block, newMetaData);
|
||||
}
|
||||
|
||||
export { getMetaData, updateMetaData, getBlock };
|
||||
Reference in New Issue
Block a user