From fb9229a28bfdfca85d23a550e0490a0029c3c780 Mon Sep 17 00:00:00 2001 From: Omar Adobati Date: Wed, 1 Jan 2025 16:30:22 +0100 Subject: [PATCH] refactor: use @src/ and @config/ alias import --- tests/unit/buildFigmaData.test.ts | 2 +- tests/unit/exportRawTokenArray.test.ts | 46 +++++++++---------- tests/unit/extractBorders.test.ts | 2 +- tests/unit/extractBreakpoints.test.ts | 2 +- tests/unit/extractColors.test.ts | 2 +- tests/unit/extractEffects.test.ts | 2 +- tests/unit/extractFonts.test.ts | 2 +- tests/unit/extractGrids.test.ts | 2 +- tests/unit/extractMotion.test.ts | 2 +- tests/unit/extractOpacitites.test.ts | 2 +- tests/unit/extractSizes.test.ts | 2 +- tests/unit/extractSpacing.test.ts | 2 +- tests/unit/extractUtilities.test.ts | 2 +- tests/unit/getFileId.test.ts | 2 +- tests/unit/groupByName.test.ts | 2 +- tests/unit/prefixTokenName.test.ts | 2 +- tests/unit/settings.test.ts | 2 +- ...nsformer.originalFormatTransformer.test.ts | 2 +- .../transformer.standardTransformer.test.ts | 2 +- types/pluginEvent.ts | 2 +- 20 files changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/unit/buildFigmaData.test.ts b/tests/unit/buildFigmaData.test.ts index 82910ada..92b3ed7c 100644 --- a/tests/unit/buildFigmaData.test.ts +++ b/tests/unit/buildFigmaData.test.ts @@ -1,4 +1,4 @@ -import { defaultSettings } from '../../src/config/defaultSettings' +import { defaultSettings } from '@config/defaultSettings' import buildFigmaData from '@utils/buildFigmaData' import getTokenNodes from '@utils/getTokenNodes' jest.mock('@utils/getTokenNodes', () => jest.fn()) diff --git a/tests/unit/exportRawTokenArray.test.ts b/tests/unit/exportRawTokenArray.test.ts index 6424c60a..8d3bc249 100644 --- a/tests/unit/exportRawTokenArray.test.ts +++ b/tests/unit/exportRawTokenArray.test.ts @@ -1,29 +1,29 @@ import { exportRawTokenArray } from '@utils/getTokenJson' -import extractFonts from '../../src/extractor/extractFonts' -import extractEffects from '../../src/extractor/extractEffects' -import extractGrids from '../../src/extractor/extractGrids' -import extractColors from '../../src/extractor/extractColors' -import extractSizes from '../../src/extractor/extractSizes' -import extractSpacing from '../../src/extractor/extractSpacing' -import extractBorders from '../../src/extractor/extractBorders' -import extractRadii from '../../src/extractor/extractRadii' -import extractMotion from '../../src/extractor/extractMotion' -import extractBreakpoints from '../../src/extractor/extractBreakpoints' -import extractOpacities from '../../src/extractor/extractOpacities' +import extractFonts from '@src/extractor/extractFonts' +import extractEffects from '@src/extractor/extractEffects' +import extractGrids from '@src/extractor/extractGrids' +import extractColors from '@src/extractor/extractColors' +import extractSizes from '@src/extractor/extractSizes' +import extractSpacing from '@src/extractor/extractSpacing' +import extractBorders from '@src/extractor/extractBorders' +import extractRadii from '@src/extractor/extractRadii' +import extractMotion from '@src/extractor/extractMotion' +import extractBreakpoints from '@src/extractor/extractBreakpoints' +import extractOpacities from '@src/extractor/extractOpacities' import buildFigmaData from '@utils/buildFigmaData' -import { defaultSettings } from '../../src/config/defaultSettings' -jest.mock('../../src/extractor/extractFonts', () => jest.fn()) -jest.mock('../../src/extractor/extractEffects', () => jest.fn()) -jest.mock('../../src/extractor/extractGrids', () => jest.fn()) -jest.mock('../../src/extractor/extractColors', () => jest.fn()) -jest.mock('../../src/extractor/extractSizes', () => jest.fn()) -jest.mock('../../src/extractor/extractSpacing', () => jest.fn()) -jest.mock('../../src/extractor/extractBorders', () => jest.fn()) -jest.mock('../../src/extractor/extractRadii', () => jest.fn()) -jest.mock('../../src/extractor/extractMotion', () => jest.fn()) -jest.mock('../../src/extractor/extractBreakpoints', () => jest.fn()) -jest.mock('../../src/extractor/extractOpacities', () => jest.fn()) +import { defaultSettings } from '@config/defaultSettings' +jest.mock('@src/extractor/extractFonts', () => jest.fn()) +jest.mock('@src/extractor/extractEffects', () => jest.fn()) +jest.mock('@src/extractor/extractGrids', () => jest.fn()) +jest.mock('@src/extractor/extractColors', () => jest.fn()) +jest.mock('@src/extractor/extractSizes', () => jest.fn()) +jest.mock('@src/extractor/extractSpacing', () => jest.fn()) +jest.mock('@src/extractor/extractBorders', () => jest.fn()) +jest.mock('@src/extractor/extractRadii', () => jest.fn()) +jest.mock('@src/extractor/extractMotion', () => jest.fn()) +jest.mock('@src/extractor/extractBreakpoints', () => jest.fn()) +jest.mock('@src/extractor/extractOpacities', () => jest.fn()) jest.mock('@utils/buildFigmaData', () => jest.fn()) describe('exportRawTokenArray', () => { diff --git a/tests/unit/extractBorders.test.ts b/tests/unit/extractBorders.test.ts index 7deabe04..33bb0ab0 100644 --- a/tests/unit/extractBorders.test.ts +++ b/tests/unit/extractBorders.test.ts @@ -1,4 +1,4 @@ -import extractBorders from '../../src/extractor/extractBorders' +import extractBorders from '@src/extractor/extractBorders' import { customTokenNode } from './data/customTokenNode.data' describe('extracting borders', () => { diff --git a/tests/unit/extractBreakpoints.test.ts b/tests/unit/extractBreakpoints.test.ts index 64bcd8e4..407a189a 100644 --- a/tests/unit/extractBreakpoints.test.ts +++ b/tests/unit/extractBreakpoints.test.ts @@ -1,4 +1,4 @@ -import extractBreakpoints from '../../src/extractor/extractBreakpoints' +import extractBreakpoints from '@src/extractor/extractBreakpoints' import { customTokenNode } from './data/customTokenNode.data' describe('extracting breakpoints', () => { diff --git a/tests/unit/extractColors.test.ts b/tests/unit/extractColors.test.ts index 27563f0b..99393fb6 100644 --- a/tests/unit/extractColors.test.ts +++ b/tests/unit/extractColors.test.ts @@ -1,4 +1,4 @@ -import extractColors from '../../src/extractor/extractColors' +import extractColors from '@src/extractor/extractColors' import { paintStyleObjects } from './data/paintStyleObjects.data' describe('extracting color fills', () => { diff --git a/tests/unit/extractEffects.test.ts b/tests/unit/extractEffects.test.ts index d13826f9..208ecabd 100644 --- a/tests/unit/extractEffects.test.ts +++ b/tests/unit/extractEffects.test.ts @@ -1,4 +1,4 @@ -import extractEffects from '../../src/extractor/extractEffects' +import extractEffects from '@src/extractor/extractEffects' import { effectStyleObjects } from './data/effectStyleObjects.data' describe('extracting effects', () => { diff --git a/tests/unit/extractFonts.test.ts b/tests/unit/extractFonts.test.ts index 061c5b86..60b13649 100644 --- a/tests/unit/extractFonts.test.ts +++ b/tests/unit/extractFonts.test.ts @@ -1,4 +1,4 @@ -import extractFonts from '../../src/extractor/extractFonts' +import extractFonts from '@src/extractor/extractFonts' import { textStyleObjects, extractFontsOutput } from './data/textStyleObjects.data' describe('extracting fonts', () => { diff --git a/tests/unit/extractGrids.test.ts b/tests/unit/extractGrids.test.ts index 6bfd1b6f..2aa7798a 100644 --- a/tests/unit/extractGrids.test.ts +++ b/tests/unit/extractGrids.test.ts @@ -1,4 +1,4 @@ -import extractGrids from '../../src/extractor/extractGrids' +import extractGrids from '@src/extractor/extractGrids' import { gridStyleObjects } from './data/gridStyleObjects.data' describe('extracting grids', () => { diff --git a/tests/unit/extractMotion.test.ts b/tests/unit/extractMotion.test.ts index 67790aa9..af0f88ce 100644 --- a/tests/unit/extractMotion.test.ts +++ b/tests/unit/extractMotion.test.ts @@ -1,4 +1,4 @@ -import extractMotion, { __testing } from '../../src/extractor/extractMotion' +import extractMotion, { __testing } from '@src/extractor/extractMotion' import { customTokenNode } from './data/customTokenNode.data' describe('extracting motion tokens', () => { diff --git a/tests/unit/extractOpacitites.test.ts b/tests/unit/extractOpacitites.test.ts index bd77ee09..79165b14 100644 --- a/tests/unit/extractOpacitites.test.ts +++ b/tests/unit/extractOpacitites.test.ts @@ -1,4 +1,4 @@ -import extractOpacities from '../../src/extractor/extractOpacities' +import extractOpacities from '@src/extractor/extractOpacities' import { customTokenNode } from './data/customTokenNode.data' describe('extracting opacities', () => { diff --git a/tests/unit/extractSizes.test.ts b/tests/unit/extractSizes.test.ts index febc1ee9..084445d4 100644 --- a/tests/unit/extractSizes.test.ts +++ b/tests/unit/extractSizes.test.ts @@ -1,4 +1,4 @@ -import extractSizes from '../../src/extractor/extractSizes' +import extractSizes from '@src/extractor/extractSizes' import { customTokenNode } from './data/customTokenNode.data' describe('extracting sizes', () => { diff --git a/tests/unit/extractSpacing.test.ts b/tests/unit/extractSpacing.test.ts index a3cabfb1..f372d621 100644 --- a/tests/unit/extractSpacing.test.ts +++ b/tests/unit/extractSpacing.test.ts @@ -1,4 +1,4 @@ -import extractSpacing from '../../src/extractor/extractSpacing' +import extractSpacing from '@src/extractor/extractSpacing' import { customTokenNode } from './data/customTokenNode.data' describe('extracting spacing', () => { diff --git a/tests/unit/extractUtilities.test.ts b/tests/unit/extractUtilities.test.ts index ae0af7aa..990481df 100644 --- a/tests/unit/extractUtilities.test.ts +++ b/tests/unit/extractUtilities.test.ts @@ -1,4 +1,4 @@ -import { filterByPrefix } from '../../src/extractor/extractUtilities' +import { filterByPrefix } from '@src/extractor/extractUtilities' describe('filterByPrefix', () => { const nodeList = [{ diff --git a/tests/unit/getFileId.test.ts b/tests/unit/getFileId.test.ts index dd304d98..2fb369ce 100644 --- a/tests/unit/getFileId.test.ts +++ b/tests/unit/getFileId.test.ts @@ -1,5 +1,5 @@ import getFileId from '@utils/getFileId' -import config from '../../src/config/config' +import config from '@config/config' describe('getFileId', () => { const figmaMock = { diff --git a/tests/unit/groupByName.test.ts b/tests/unit/groupByName.test.ts index f2c90d7c..f02cdb3b 100644 --- a/tests/unit/groupByName.test.ts +++ b/tests/unit/groupByName.test.ts @@ -1,5 +1,5 @@ import { groupByKeyAndName } from '@utils/groupByName' -import { defaultSettings } from '../../src/config/defaultSettings' +import { defaultSettings } from '@config/defaultSettings' describe('groupByName', () => { test('group tokens with name', () => { diff --git a/tests/unit/prefixTokenName.test.ts b/tests/unit/prefixTokenName.test.ts index de383abf..7ff5d904 100644 --- a/tests/unit/prefixTokenName.test.ts +++ b/tests/unit/prefixTokenName.test.ts @@ -1,4 +1,4 @@ -import { defaultSettings } from '../../src/config/defaultSettings' +import { defaultSettings } from '@config/defaultSettings' import { prefixTokenName } from '@utils/prefixTokenName' describe('prefixTokenName', () => { diff --git a/tests/unit/settings.test.ts b/tests/unit/settings.test.ts index cf2ba9f6..a5669ca8 100644 --- a/tests/unit/settings.test.ts +++ b/tests/unit/settings.test.ts @@ -1,7 +1,7 @@ import { getSettings, setSettings } from '@utils/settings' import { stringifyJson } from '@utils/stringifyJson' import { nameConversionType, tokenFormatType } from '@typings/settings' -import { defaultSettings } from '@src/config/defaultSettings' +import { defaultSettings } from '@config/defaultSettings' beforeAll(() => { // @ts-ignore diff --git a/tests/unit/transformer.originalFormatTransformer.test.ts b/tests/unit/transformer.originalFormatTransformer.test.ts index 6fc8f04f..b38f506a 100644 --- a/tests/unit/transformer.originalFormatTransformer.test.ts +++ b/tests/unit/transformer.originalFormatTransformer.test.ts @@ -1,4 +1,4 @@ -import { transformer } from '../../src/transformer/originalFormatTransformer' +import { transformer } from '@src/transformer/originalFormatTransformer' import { extractedFigmaTokens } from './data/extractedFigmaTokens.data' import { transformedOriginalTokens } from './data/transformedOriginalFormatTokens.data' diff --git a/tests/unit/transformer.standardTransformer.test.ts b/tests/unit/transformer.standardTransformer.test.ts index 13229f9f..d2bb4f5d 100644 --- a/tests/unit/transformer.standardTransformer.test.ts +++ b/tests/unit/transformer.standardTransformer.test.ts @@ -1,4 +1,4 @@ -import { transformer } from '../../src/transformer/standardTransformer' +import { transformer } from '@src/transformer/standardTransformer' import { extractedFigmaTokens } from './data/extractedFigmaTokens.data' import { transformedStandardTokens } from './data/transformedStandardTokens.data' diff --git a/types/pluginEvent.ts b/types/pluginEvent.ts index 8f3051a5..bc6107ff 100644 --- a/types/pluginEvent.ts +++ b/types/pluginEvent.ts @@ -1,4 +1,4 @@ -import { PluginCommands } from '../src/config/commands' +import { PluginCommands } from '@config/commands' export type PluginMessage = { command: PluginCommands