-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that paths exist before looking for
*.less
files in them (#817)
- Loading branch information
Showing
5 changed files
with
54 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'sku': patch | ||
--- | ||
|
||
Check that paths exist before looking for `*.less` files in them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const glob = require('fast-glob'); | ||
const chalk = require('chalk'); | ||
|
||
const printBanner = require('./banner'); | ||
const exists = require('./exists'); | ||
const { paths } = require('../context'); | ||
|
||
module.exports = async () => { | ||
const srcPathsExist = await Promise.all( | ||
paths.src.map(async (srcPath) => (await exists(srcPath)) && srcPath), | ||
); | ||
const lessFileGlobResults = await Promise.all( | ||
srcPathsExist | ||
.filter((srcPath) => srcPath && fs.statSync(srcPath).isDirectory()) | ||
.map(async (srcPath) => await glob(path.join(srcPath, '**/*.less'))), | ||
); | ||
const srcHasLessFiles = lessFileGlobResults.some( | ||
(fileArray) => fileArray.length > 0, | ||
); | ||
if (srcHasLessFiles) { | ||
printBanner('warning', 'LESS styles detected', [ | ||
`Support for ${chalk.bold('LESS')} has been deprecated.`, | ||
`${chalk.bold( | ||
'Vanilla Extract', | ||
)} is the preferred styling solution supported by ${chalk.bold( | ||
'sku', | ||
)}, and support for ${chalk.bold( | ||
'LESS', | ||
)} will be removed in a future release.`, | ||
`Consumers are encouraged to migrate to ${chalk.bold( | ||
'Vanilla Extract', | ||
)} at the earliest opportunity.`, | ||
'https://seek-oss.github.io/sku/#/./docs/styling?id=vanilla-extract', | ||
]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters