All files / packages/sds-metadata/src/generators release-info.ts

0% Statements 0/4
0% Branches 0/4
100% Functions 0/0
0% Lines 0/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                               
import { readFileSync } from "fs";
import { SupportedFileFormat } from "../types";
import { writeData } from '../services/file-service.js';
import { DESIGN_SYSTEM_PACKAGE_PATH, STYLING_HOOKS_PACKAGE_PATH } from "../constants.js";
 
 
const designSystemPkg = JSON.parse(readFileSync(DESIGN_SYSTEM_PACKAGE_PATH, "utf-8"));
const stylingHooksPkg = JSON.parse(readFileSync(STYLING_HOOKS_PACKAGE_PATH, "utf-8"));
 
const releaseInfo = {
  slds: {
    id: designSystemPkg.slds.id,
    name: designSystemPkg.slds.name.replace(/’/g, "'"),
    type: designSystemPkg.config.slds.internal ? "Internal" : "External",
  },
  packages: {
    "@salesforce-ux/design-system": designSystemPkg.version,
    "@salesforce-ux/sds-styling-hooks": stylingHooksPkg.version,
  },
};
 
export async function generateReleaseInfo(outputDir: string = process.cwd(), format: SupportedFileFormat = 'json') {
  await writeData("release-info", releaseInfo, outputDir, format);
}