Skip to content

Commit

Permalink
- support optional in module format.
Browse files Browse the repository at this point in the history
 - bump version
  • Loading branch information
zbryikt committed Mar 12, 2024
1 parent b1c8b92 commit e3f4ce2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Logs

## v1.3.0

- support `optional` in module format.


## v1.2.0

- support transpilation on demand.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ If object is used, it contains following fields:
- always false if `browserify` is set to true.
- `transpile`: add this object if you need to transpile module file, which contains following fields:
- `files`: a list of file to transpile.
- `optional`: default false. if true, ignore this entry if it can't be found, even if it's not in `optionalDependencies`.


## Publish
Expand Down
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cmds['default'] = {
root = path.relative('.', root);
}
if (!fs.existsSync(path.join(root, 'package.json'))) {
if (!(pkg.optionalDependencies || {})[obj.name]) {
if (!(pkg.optionalDependencies || {})[obj.name] && !obj.optional) {
quit(" -- [ERROR] Module `".red, obj.name.brightYellow, "` is not found. Failed.".red);
}
skips.push({
Expand Down
2 changes: 1 addition & 1 deletion lib/main.ls
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ cmds.default =
root = path.relative('.', root)
if !fs.exists-sync(path.join root, \package.json) =>
if !(pkg.optionalDependencies or {})[obj.name] =>
if !(pkg.optionalDependencies or {})[obj.name] and !obj.optional =>
quit " -- [ERROR] Module `".red, obj.name.brightYellow, "` is not found. Failed.".red
skips.push(name: obj.name, reason: "it is an optional dependency and is not installed")
return console.warn [
Expand Down
4 changes: 2 additions & 2 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
Expand Up @@ -6,7 +6,7 @@
"cli.js"
],
"description": "Frontend dependency installer",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/plotdb/fedep",
"repository": {
"type": "git",
Expand Down

0 comments on commit e3f4ce2

Please sign in to comment.