All files / constants config.ts

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

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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59                      11x 11x     11x     11x     11x     11x     11x     11x     11x                 11x     11x     11x     11x     11x     11x  
// SPDX-FileCopyrightText: 2024-2026 Hack23 AB
// SPDX-License-Identifier: Apache-2.0
 
/**
 * @module Constants/Config
 * @description Shared configuration constants
 */
 
import path from 'path';
import { fileURLToPath } from 'url';
 
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
 
/** Project root directory */
export const PROJECT_ROOT: string = path.resolve(__dirname, '..', '..');
 
/** News directory */
export const NEWS_DIR: string = path.join(PROJECT_ROOT, 'news');
 
/** Metadata directory */
export const METADATA_DIR: string = path.join(NEWS_DIR, 'metadata');
 
/** Base URL for the production site */
export const BASE_URL = 'https://euparliamentmonitor.com';
 
/** Article filename pattern regex */
export const ARTICLE_FILENAME_PATTERN = /^(\d{4}-\d{2}-\d{2})-(.+)-([a-z]{2})\.html$/;
 
/** Words per minute for read time calculation */
export const WORDS_PER_MINUTE = 250;
 
/** Valid article types for generation */
export const VALID_ARTICLE_TYPES = [
  'week-ahead',
  'committee-reports',
  'propositions',
  'motions',
  'breaking',
] as const;
 
/** Week ahead article type constant */
export const ARTICLE_TYPE_WEEK_AHEAD = 'week-ahead';
 
/** Breaking news article type constant */
export const ARTICLE_TYPE_BREAKING = 'breaking';
 
/** Committee reports article type constant */
export const ARTICLE_TYPE_COMMITTEE_REPORTS = 'committee-reports';
 
/** Propositions article type constant */
export const ARTICLE_TYPE_PROPOSITIONS = 'propositions';
 
/** Motions article type constant */
export const ARTICLE_TYPE_MOTIONS = 'motions';
 
/** CLI argument separator */
export const ARG_SEPARATOR = '=';