Skip to content

Commit

Permalink
Update dependencies and fix targetDir default (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-romanenko authored Oct 4, 2023
1 parent cafca2f commit 1dbadcf
Show file tree
Hide file tree
Showing 6 changed files with 2,047 additions and 1,410 deletions.
5 changes: 4 additions & 1 deletion .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"env": {
"node": true,
"es6": true
Expand All @@ -8,6 +8,9 @@
"umbrellio",
"plugin:promise/recommended"
],
"parserOptions": {
"requireConfigFile": false
},
"rules": {
"quotes": ["error", "double"],
"no-console": "off"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Available AWS regions can be viewed at https://docs.aws.amazon.com/sns/latest/dg
--exclude, -e excluded extenstions [default: ["html","gz"]]
--accessKeyId, --access-key-id AWS access key ID [required]
--secretAccessKey, --secret-access-key AWS secret access key [required]
--targetDir, --target-dir AWS bucket target directory [default: "/"]
--targetDir, --target-dir AWS bucket target directory [default: ""]
```

## Contributing
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umbrellio/ucdn",
"version": "0.5.0",
"version": "0.6.0",
"bin": "ucdn",
"main": "index.js",
"repository": "git@github.com:umbrellio/ucdn.git",
Expand All @@ -11,18 +11,19 @@
"lint": "eslint . ucdn"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.34.0",
"@aws-sdk/client-s3": "^3.421.0",
"js-yaml": "^4.1.0",
"mime-types": "^2.1.32",
"yargs": "^17.2.1"
"mime-types": "^2.1.35",
"yargs": "^17.7.2"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^7.32.0",
"@babel/core": "^7.23.0",
"@babel/eslint-parser": "^7.22.15",
"eslint": "^8.50.0",
"eslint-config-umbrellio": "^5.0.1",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-promise": "^5.1.0"
"eslint-plugin-promise": "^6.1.1"
}
}
10 changes: 4 additions & 6 deletions ucdn
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const pkg = require("./package")
const utils = require("./utils")
const upload = require("./upload")

const toDashCase = str => str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);

const yargsOptions = {
config: {
alias: "c",
Expand Down Expand Up @@ -59,7 +57,7 @@ const yargsOptions = {
alias: "target-dir",
describe: "AWS bucket target directory",
type: "string",
default: "/",
default: "",
},
}

Expand All @@ -77,10 +75,10 @@ yargs

Object
.entries(configObject)
.filter(([_, value]) => value != null)
.filter(([_, value]) => value !== null)
.forEach(([key, value]) => {
if (argv[key] == yargsOptions[key].default) argv[key] = value
// eslint-disable-next-line no-param-reassign
if (argv[key] === yargsOptions[key].default) argv[key] = value
})

}, true)
.parse()
3 changes: 0 additions & 3 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ const path = require("path")
const fs = require("fs")
const yaml = require("js-yaml")

const toDashCase = str => str.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`)

const loadYamlFile = filePath => {
const configPath = path.resolve(filePath)
const content = fs.readFileSync(configPath)
return yaml.load(content)
}

module.exports = {
toDashCase,
loadYamlFile,
}
Loading

0 comments on commit 1dbadcf

Please sign in to comment.