Skip to content

Commit

Permalink
fix npx not working with cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mimarz committed Jun 19, 2024
1 parent 69e96d4 commit 1b73a43
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/colors/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './colorUtils';
export * from './themeUtils';
export * from './types';
export * from './colorUtils.js';
export * from './themeUtils.js';
export * from './types.js';
2 changes: 1 addition & 1 deletion packages/cli/src/colors/themeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BackgroundColor, Color, Theme } from '@adobe/leonardo-contrast-colors';
import { Hsluv } from 'hsluv';

import type { ContrastMode, Mode, ColorInfo, ColorNumber, ThemeInfo, ColorType } from './types.ts';
import { getContrastFromHex, getContrastFromLightness, getLightnessFromHex } from './colorUtils';
import { getContrastFromHex, getContrastFromLightness, getLightnessFromHex } from './colorUtils.js';

const blueBaseColor = '#0A71C0';
const greenBaseColor = '#078D19';
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/tokens/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type { Config, TransformedToken } from 'style-dictionary/types';
import * as R from 'ramda';
import type { ThemeObject } from '@tokens-studio/types';

import { permutateThemes as permutateThemes_ } from './utils/permutateThemes';
import { permutateThemes as permutateThemes_ } from './utils/permutateThemes.js';
import { nameKebab, typographyShorthand, sizeRem } from './transformers.js';
import { jsTokens } from './formats/js-tokens.js';
import { cssVariables } from './formats/css-variables.js';
import { cssClassesTypography } from './formats/css-classes';
import { cssClassesTypography } from './formats/css-classes.js';
import { makeEntryFile } from './actions.js';
import { typeEquals } from './utils/utils';
import { typeEquals } from './utils/utils.js';

void tokenStudio.registerTransforms(StyleDictionary);

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/tokens/formats/css-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { TransformedToken } from 'style-dictionary';
import type { Format } from 'style-dictionary/types';
import { fileHeader, createPropertyFormatter, getReferences } from 'style-dictionary/utils';

import { getValue, typeEquals } from '../utils/utils';
import { prefix } from '../configs';
import { getValue, typeEquals } from '../utils/utils.js';
import { prefix } from '../configs.js';

type Typgraphy = {
fontWeight: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/tokens/formats/css-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { TransformedToken } from 'style-dictionary';
import type { Format } from 'style-dictionary/types';
import { fileHeader, createPropertyFormatter, usesReferences } from 'style-dictionary/utils';

import type { IsCalculatedToken } from '../configs';
import { getValue } from '../utils/utils';
import type { IsCalculatedToken } from '../configs.js';
import { getValue } from '../utils/utils.js';

const calculatedVariable = R.pipe(R.split(/:(.*?);/g), (split) => `${split[0]}: calc(${R.trim(split[1])});`);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/tokens/formats/js-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as R from 'ramda';
import type { TransformedToken, Format } from 'style-dictionary/types';
import { fileHeader, createPropertyFormatter } from 'style-dictionary/utils';

import { getType } from '../utils/utils';
import { getType } from '../utils/utils.js';

const groupByType = R.groupBy((token: TransformedToken) => getType(token));

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/tokens/transformers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as R from 'ramda';
import type { Transform } from 'style-dictionary/types';

import { noCase } from './utils/noCase';
import { getValue, typeEquals } from './utils/utils';
import { noCase } from './utils/noCase.js';
import { getValue, typeEquals } from './utils/utils.js';

const isPx = R.test(/\b\d+px\b/g);

Expand Down
5 changes: 3 additions & 2 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"emitDeclarationOnly": false,
"noEmit": false,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"target": "esnext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"sourceMap": false
},
"rootDir": "./src",
Expand Down

0 comments on commit 1b73a43

Please sign in to comment.