Skip to content

Commit

Permalink
chore Polish deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh95 committed Jun 11, 2022
1 parent c17e250 commit 473a380
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/configure.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import fs from 'fs';
import { exec } from 'child_process';

import chalk from 'chalk';
import { CACHE_FOLDER, SASS_LOAD_PATHS_CONFIG } from './constants';
import { createCacheFolderIfNeeded } from './utils';
import { debug } from './preview';
Expand Down Expand Up @@ -53,16 +53,14 @@ export async function jestPreviewConfigure(
}

externalCss?.forEach((cssFile) => {
// TODO: To add a yellow warning here
// `chalk` is installed in https://github.com/nvh95/jest-preview/pull/129, so we can merge that PR first
// Link to migration guide (haven't written yet)
// https://github.com/nvh95/jest-preview/issues/124
// Avoid name collision
// Example: src/common/styles.css => cache-src___common___styles.css
console.log(
'externalCss is deprecated. Please import css files directly in your setup file.',
chalk.yellow(
'externalCss is deprecated. Please import css files directly in your setup file.',
'See the migration guide at www.jest-preview.com/blog/deprecate-externalCss',
),
);
console.log('See the instruction to migrate here: TODO');
const delimiter = '___';
const destinationBasename = `cache-${cssFile.replace(/\//g, delimiter)}`;
const destinationFile = path.join(CACHE_FOLDER, destinationBasename);
Expand Down

0 comments on commit 473a380

Please sign in to comment.