Skip to content

Commit

Permalink
Update error / debug message when requested package cannot be resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
omacranger committed Sep 8, 2022
1 parent a606a8f commit 934c935
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.3.1](https://github.com/omacranger/fontawesome-subset/compare/4.3.0...4.3.1)

- Update error / debug message when requested package cannot be resolved. Provide typical resolution if attempting to use pro features without specifying pro package in options.

## [4.3.0](https://github.com/omacranger/fontawesome-subset/compare/4.2.0...4.3.0)

- Support FontAwesome 6.2.0+ including new `sharp-solid` subset
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fontawesome-subset",
"version": "4.3.0",
"version": "4.3.1",
"description": "Utility to create subsets for FontAwesome and FontAwesome Pro.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ function fontawesomeSubset(
packageLocation = require.resolve(`@fortawesome/fontawesome-${packageType}`);
} catch (e) {
console.error(
"Unable to find either the Free or Pro FontAwesome files in node_modules folder. Double-check that you have your preferred fontawesome package as a dependency in `package.json` and rerun the installation."
`Unable to resolve the module '@fortawesome/fontawesome-${packageType}'. Double-check that you have your preferred fontawesome package installed as a dependency and the package type passed into the options if using Pro features.\n\n\`fontawesomeSubset(..., ..., { package: 'pro' })\``
);
return Promise.resolve(false);
}

// Check that we have atleast one target format for output
// Check that we have at least one target format for output
if (!Array.isArray(targetFormats) || targetFormats.length === 0) {
console.error("One or more target formats are required. Exiting.");

Expand Down

0 comments on commit 934c935

Please sign in to comment.