Skip to content

Commit

Permalink
refactor: introduce respective enum files
Browse files Browse the repository at this point in the history
import paths updated to enum barrel file
  • Loading branch information
Dario Soller committed Oct 28, 2024
1 parent 7926485 commit 87cb861
Show file tree
Hide file tree
Showing 81 changed files with 238 additions and 249 deletions.
2 changes: 1 addition & 1 deletion __integration__/async.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { transforms, propertyFormatNames, transformTypes } from '../lib/enums/buildInEnums.js';
import { transforms, propertyFormatNames, transformTypes } from '../lib/enums/index.js';

const sleep = async (time) => {
await new Promise((resolve) => setTimeout(resolve, time));
Expand Down
2 changes: 1 addition & 1 deletion __integration__/compose.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats } from '../lib/enums/buildInEnums.js';
import { fileFormats } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, transformGroups } from '../lib/enums/buildInEnums.js';
import { fileFormats, transformGroups } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/customFormats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { transformGroups } from '../lib/enums/buildInEnums.js';
import { transformGroups } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/flutter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats } from '../lib/enums/buildInEnums.js';
import { fileFormats } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/iOSObjectiveC.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats } from '../lib/enums/buildInEnums.js';
import { fileFormats } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/logging/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { restore, stubMethod } from 'hanbi';
import StyleDictionary from 'style-dictionary';
import { buildPath, cleanConsoleOutput } from '../_constants.js';
import { clearOutput } from '../../__tests__/__helpers.js';
import { logWarningLevels, logVerbosityLevels } from '../../lib/enums/buildInEnums.js';
import { logWarningLevels, logVerbosityLevels } from '../../lib/enums/index.js';

/**
* These integration tests will verify the behavior and logging at the *config*
Expand Down
2 changes: 1 addition & 1 deletion __integration__/logging/file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { restore, stubMethod } from 'hanbi';
import StyleDictionary from 'style-dictionary';
import { buildPath, cleanConsoleOutput } from '../_constants.js';
import { clearOutput } from '../../__tests__/__helpers.js';
import { logWarningLevels, logVerbosityLevels } from '../../lib/enums/buildInEnums.js';
import { logWarningLevels, logVerbosityLevels } from '../../lib/enums/index.js';
/**
* The last and final level of logging: file.
* These logs happen when a file is being built and will notify the user
Expand Down
2 changes: 1 addition & 1 deletion __integration__/nameCollisions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import StyleDictionary from 'style-dictionary';
import { stubMethod, restore } from 'hanbi';
import { buildPath, cleanConsoleOutput } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, logVerbosityLevels } from '../lib/enums/buildInEnums.js';
import { fileFormats, logVerbosityLevels } from '../lib/enums/index.js';

const tokens = {
color: {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/objectValues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, transformTypes } from '../lib/enums/buildInEnums.js';
import { fileFormats, transformTypes } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/outputReferences.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
fileFormats,
transformGroups,
transformTypes,
} from '../lib/enums/buildInEnums.js';
} from '../lib/enums/index.js';

describe('integration', async () => {
let stub;
Expand Down
2 changes: 1 addition & 1 deletion __integration__/showFileHeader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, transformGroups } from '../lib/enums/buildInEnums.js';
import { fileFormats, transformGroups } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/swift.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { fs } from 'style-dictionary/fs';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats } from '../lib/enums/buildInEnums.js';
import { fileFormats } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/w3c-forward-compat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Color from 'tinycolor2';
import { resolve } from '../lib/resolve.js';
import { buildPath } from './_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, transforms, transformTypes } from '../lib/enums/buildInEnums.js';
import { fileFormats, transforms, transformTypes } from '../lib/enums/index.js';

describe('integration', async () => {
before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion __perf_tests__/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { buildPath } from '../__integration__/_constants.js';
import { clearOutput } from '../__tests__/__helpers.js';
import { fileFormats, transformGroups } from '../lib/enums/buildInEnums.js';
import { fileFormats, transformGroups } from '../lib/enums/index.js';

/**
* Utility to programmatically generate large sets of tokens
Expand Down
2 changes: 1 addition & 1 deletion __tests__/StyleDictionary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
logBrokenReferenceLevels,
fileFormats,
transformGroups,
} from '../lib/enums/buildInEnums.js';
} from '../lib/enums/index.js';

function traverseObj(obj, fn) {
for (let key in obj) {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__configs/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fileFormats, actions, transformGroups } from '../../lib/enums/buildInEnums.js';
import { fileFormats, actions, transformGroups } from '../../lib/enums/index.js';

export default {
source: ['__tests__/__tokens/**/*.json'],
Expand Down
2 changes: 1 addition & 1 deletion __tests__/buildAllPlatforms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import StyleDictionary from 'style-dictionary';
import { fs } from 'style-dictionary/fs';
import { clearOutput, fileExists } from './__helpers.js';
import memfs from '@bundled-es-modules/memfs';
import { fileFormats, transformGroups } from '../lib/enums/buildInEnums.js';
import { fileFormats, transformGroups } from '../lib/enums/index.js';

describe('buildAllPlatforms', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/buildPlatform.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { fileToJSON, clearOutput, fileExists } from './__helpers.js';
import { fileFormats, transforms, transformGroups } from '../lib/enums/buildInEnums.js';
import { fileFormats, transforms, transformGroups } from '../lib/enums/index.js';

const config = fileToJSON('__tests__/__configs/test.json');
const StyleDictionaryExtended = new StyleDictionary(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import { expect } from 'chai';
import createPropertyFormatter from '../../../lib/common/formatHelpers/createPropertyFormatter.js';
import flattenTokens from '../../../lib/utils/flattenTokens.js';
import { outputReferencesFilter } from '../../../lib/utils/references/outputReferencesFilter.js';
import {
commentStyles,
commentPositions,
propertyFormatNames,
} from '../../../lib/enums/buildInEnums.js';
import { commentStyles, commentPositions, propertyFormatNames } from '../../../lib/enums/index.js';

const dictionary = {
foo: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/common/formatHelpers/fileHeader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { expect } from 'chai';
import { fixDate } from '../../__helpers.js';
import fileHeader from '../../../lib/common/formatHelpers/fileHeader.js';
import { commentStyles } from '../../../lib/enums/buildInEnums.js';
import { commentStyles } from '../../../lib/enums/index.js';

const defaultLine1 = `Do not edit directly, this file was auto-generated.`;
const defaultLine2 = `Generated on Sat, 01 Jan 2000 00:00:00 GMT`;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/common/transforms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import { join } from 'path-unified';
import Color from 'tinycolor2';
import transforms, { isColor } from '../../lib/common/transforms.js';
import { transforms as transformNames } from '../../lib/enums/buildInEnums.js';
import { transforms as transformNames } from '../../lib/enums/index.js';

describe('common', () => {
describe('transforms', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/exportPlatform.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
transforms,
transformGroups,
transformTypes,
} from '../lib/enums/buildInEnums.js';
} from '../lib/enums/index.js';

const config = fileToJSON('__tests__/__configs/test.json');

Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { deepmerge } from '../../lib/utils/deepmerge.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/androidResources.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const tokens = {
size: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/es6Constants.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/javascriptModule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/javascriptModuleFlat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/javascriptObject.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/javascriptUmd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/json.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/lessIcons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { isNode } from '../../lib/utils/isNode.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/lessVariables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { isNode } from '../../lib/utils/isNode.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/scssIcons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { compileString } from 'sass';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/scssMaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { compileString } from 'sass';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { commentStyles, commentPositions, fileFormats } from '../../lib/enums/buildInEnums.js';
import { commentStyles, commentPositions, fileFormats } from '../../lib/enums/index.js';

const tokens = {
size: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/scssVariables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { compileString } from 'sass';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/stylusVariable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/swiftFile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const originalFile = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/typeScriptEs6Declarations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/formats/typeScriptModuleDeclarations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import formats from '../../lib/common/formats.js';
import createFormatArgs from '../../lib/utils/createFormatArgs.js';
import flattenTokens from '../../lib/utils/flattenTokens.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

const file = {
destination: '__output/',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/register/overwrite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import StyleDictionary from 'style-dictionary';
import { expect } from 'chai';
import transformBuiltins from '../../lib/common/transforms.js';
import { isNode } from '../../lib/utils/isNode.js';
import { transforms, transformTypes } from '../lib/enums/buildInEnums.js';
import { transforms, transformTypes } from '../lib/enums/index.js';

describe('Register overwrites', () => {
const reset = () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/register/preprocessor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { registerSuite } from './register.suite.js';
import { fileFormats } from '../../lib/enums/buildInEnums.js';
import { fileFormats } from '../../lib/enums/index.js';

registerSuite({
config: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/register/transform.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { registerSuite } from './register.suite.js';
import transformBuiltins from '../../lib/common/transforms.js';
import { transformTypes } from '../../lib/enums/buildInEnums.js';
import { transformTypes } from '../../lib/enums/index.js';

const transformPxAppender = {
name: 'px-appender',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/register/transformGroup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { expect } from 'chai';
import StyleDictionary from 'style-dictionary';
import { registerSuite } from './register.suite.js';
import { transforms } from '../../lib/enums/buildInEnums.js';
import { transforms } from '../../lib/enums/index.js';

const dummyTransformName = 'transformGroup.test.js';

Expand Down
Loading

0 comments on commit 87cb861

Please sign in to comment.