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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | 9x 9x 45x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x 9x | import { dirname, resolve, join } from 'path';
import { fileURLToPath } from 'url';
const moduleFilename = fileURLToPath(import.meta.url);
const moduleDirname = dirname(moduleFilename);
const fromSdsMetadata = (...pathSegments: string[]) => resolve(moduleDirname, ...pathSegments);
// Filenames
export const SLDS_CLASSES_FILENAME = 'sldsClasses';
export const SLDS_PLUS_CLASSES_FILENAME = 'sldsPlusClasses';
export const BEM_NAMING_FILENAME = 'bem-naming';
export const SLDS_DEPRECATED_CLASSES_FILENAME = 'deprecatedClasses';
export const LWC_TO_SLDS_FILENAME = 'lwc-to-slds';
export const SLDS_STYLING_HOOKS_FILENAME = 'sldsStylingHooks';
export const SLDS_PLUS_STYLING_HOOKS_FILENAME = 'sldsPlusStylingHooks';
export const SLDS_DEPRECATED_STYLING_HOOKS_FILENAME = 'deprecatedStylingHooks';
export const GLOBAL_STYLING_HOOKS_FILENAME = 'globalStylingHooks.metadata';
export const VALUE_TO_SLDS_STYLING_HOOKS_FILENAME = 'valueToStylingHooks.slds';
export const VALUE_TO_SLDS_PLUS_STYLING_HOOKS_FILENAME = 'valueToStylingHooks.cosmos';
export const AURA_TO_LWC_TOKENS_MAPPING_FILENAME = 'auraToLwcTokensMapping';
export const ICONS_METADATA_FILENAME = 'icons';
export const COLOR_STYLING_HOOKS_METADATA_FILENAME = 'colorStylingHooks';
export const SLDS_DELTA_FILENAME = 'sldsDelta';
export const SLDS_EXCLUDED_VARS_FILENAME = 'slds1ExcludedVars';
export const SLDS_DEPRECATED_COMPONENT_HOOKS_FILENAME = 'slds1DeprecatedComponentHooks';
// Sources
const designSystemDir = fromSdsMetadata('../../design-system');
const designTokensDir = fromSdsMetadata('../../design-tokens');
const designSystem2Dir = fromSdsMetadata('../../design-system-2');
const sandboxDir = fromSdsMetadata('../../sds-sandbox');
const resourcesDir = fromSdsMetadata('../resources');
const designTokensThemesDir = resolve(designTokensDir, 'dist/themes');
// design-system (used when reading compiled SLDS outputs + metadata)
export const DESIGN_SYSTEM_PACKAGE_PATH = resolve(designSystemDir, 'package.json');
export const SLDS_CSS_PATH = resolve(
designSystemDir,
'dist/assets/styles/', // dist folder
'salesforce-lightning-design-system.css'
);
export const AURA_TOKENS_PATH = resolve(designSystemDir, 'dist/ui.aura-tokens.json');
export const ICONS_RAW_JSON = resolve(designSystemDir, 'dist/ui.icons.json');
export const ICONS_METADATA_DIR_PATH = join(dirname(ICONS_RAW_JSON), 'metadata', 'icons');
export const PALLET_COLORS_RAW_JSON = resolve(
designSystemDir,
'dist/design-tokens/dist/',
'palettes.json'
);
// sds-sandbox (used for final lwc-to-slds mapping)
export const LWC_MAPPINGS_FINAL_JSON = resolve(sandboxDir, 'data', 'final-token-mapping.json');
/**
This file is used in SLDS Validator and UI Assessment tools
### Usecase
This document is used to indentify
- deprecated `--lwc` tokens
- find possible replacement for `--lwc` with `--slds-` token
- find possible replacement for `--lwc` with static value
*/
export const DESIGN_TOKEN_MAPPINGS_CSV = resolve(sandboxDir, 'data-raw', 'kondo-first-mapping.csv');
/**
*
This file is used to generate lwc to slds mapping json required by SLDS Linter
### Usecase
Entries in this document are use to identify
- deprecated `--lwc` tokens
- find possible replacement for `--lwc` with `--slds-` token
- find possible replacement for `--lwc` with static value
*/
export const LWC_MAPPINGS_CSV = resolve(sandboxDir, 'data-raw', 'kondo-monolith-new-mapping.csv');
// design-tokens global flat files contain every non-config token scope.
export const DESIGN_TOKENS_PACKAGE_PATH = resolve(designTokensDir, 'package.json');
export const COSMOS_GLOBAL_TOKENS_FLAT_JSON = resolve(
designTokensThemesDir,
'cosmos/cosmos.global.tokens.flat.json'
);
export const SLDS_GLOBAL_TOKENS_FLAT_JSON = resolve(
designTokensThemesDir,
'lightning-blue/lightning-blue.global.tokens.flat.json'
);
// design-system-2 (used for SLDS+ css input)
export const SLDS_PLUS_CSS_PATH = resolve(designSystem2Dir, 'dist/css/bundled/slds2.cosmos.css');
export const DESIGN_SYSTEM_2_PACKAGE_PATH = resolve(designSystem2Dir, 'package.json');
// sds-metadata local resources (used to drive mapping + allowlists)
export const SLDSStylingHooksCSV = resolve(resourcesDir, 'SLDSStylingHooks.csv');
export const ALLOWED_SLDS_CLASSES_JSON = resolve(resourcesDir, 'allowedSLDSClasses.json');
export const SLDS1_EXCLUDED_VARS_JSON = resolve(resourcesDir, 'slds1ExcludedVars.json');
export const SLDS1_DEPRECATED_COMPONENT_HOOKS_JSON = resolve(resourcesDir, 'slds1DeprecatedComponentHooks.json');
|