Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Commit 1dbadcf

Browse files
authored
Update dependencies and fix targetDir default (#9)
1 parent cafca2f commit 1dbadcf

File tree

6 files changed

+2047
-1410
lines changed

6 files changed

+2047
-1410
lines changed

.eslintrc renamed to .eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@babel/eslint-parser",
33
"env": {
44
"node": true,
55
"es6": true
@@ -8,6 +8,9 @@
88
"umbrellio",
99
"plugin:promise/recommended"
1010
],
11+
"parserOptions": {
12+
"requireConfigFile": false
13+
},
1114
"rules": {
1215
"quotes": ["error", "double"],
1316
"no-console": "off"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Available AWS regions can be viewed at https://docs.aws.amazon.com/sns/latest/dg
3737
--exclude, -e excluded extenstions [default: ["html","gz"]]
3838
--accessKeyId, --access-key-id AWS access key ID [required]
3939
--secretAccessKey, --secret-access-key AWS secret access key [required]
40-
--targetDir, --target-dir AWS bucket target directory [default: "/"]
40+
--targetDir, --target-dir AWS bucket target directory [default: ""]
4141
```
4242

4343
## Contributing

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@umbrellio/ucdn",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"bin": "ucdn",
55
"main": "index.js",
66
"repository": "git@github.com:umbrellio/ucdn.git",
@@ -11,18 +11,19 @@
1111
"lint": "eslint . ucdn"
1212
},
1313
"dependencies": {
14-
"@aws-sdk/client-s3": "^3.34.0",
14+
"@aws-sdk/client-s3": "^3.421.0",
1515
"js-yaml": "^4.1.0",
16-
"mime-types": "^2.1.32",
17-
"yargs": "^17.2.1"
16+
"mime-types": "^2.1.35",
17+
"yargs": "^17.7.2"
1818
},
1919
"devDependencies": {
20-
"babel-eslint": "^10.1.0",
21-
"eslint": "^7.32.0",
20+
"@babel/core": "^7.23.0",
21+
"@babel/eslint-parser": "^7.22.15",
22+
"eslint": "^8.50.0",
2223
"eslint-config-umbrellio": "^5.0.1",
2324
"eslint-plugin-import": "^2.24.2",
2425
"eslint-plugin-node": "^11.1.0",
2526
"eslint-plugin-prefer-object-spread": "^1.2.1",
26-
"eslint-plugin-promise": "^5.1.0"
27+
"eslint-plugin-promise": "^6.1.1"
2728
}
2829
}

ucdn

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ const pkg = require("./package")
66
const utils = require("./utils")
77
const upload = require("./upload")
88

9-
const toDashCase = str => str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
10-
119
const yargsOptions = {
1210
config: {
1311
alias: "c",
@@ -59,7 +57,7 @@ const yargsOptions = {
5957
alias: "target-dir",
6058
describe: "AWS bucket target directory",
6159
type: "string",
62-
default: "/",
60+
default: "",
6361
},
6462
}
6563

@@ -77,10 +75,10 @@ yargs
7775

7876
Object
7977
.entries(configObject)
80-
.filter(([_, value]) => value != null)
78+
.filter(([_, value]) => value !== null)
8179
.forEach(([key, value]) => {
82-
if (argv[key] == yargsOptions[key].default) argv[key] = value
80+
// eslint-disable-next-line no-param-reassign
81+
if (argv[key] === yargsOptions[key].default) argv[key] = value
8382
})
84-
8583
}, true)
8684
.parse()

utils.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ const path = require("path")
22
const fs = require("fs")
33
const yaml = require("js-yaml")
44

5-
const toDashCase = str => str.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`)
6-
75
const loadYamlFile = filePath => {
86
const configPath = path.resolve(filePath)
97
const content = fs.readFileSync(configPath)
108
return yaml.load(content)
119
}
1210

1311
module.exports = {
14-
toDashCase,
1512
loadYamlFile,
1613
}

0 commit comments

Comments
 (0)