You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/03/17 11:03:31 UTC

[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #1665: ci(bindings/nodejs): Enable formatter

Xuanwo commented on code in PR #1665:
URL: https://github.com/apache/incubator-opendal/pull/1665#discussion_r1140089017


##########
bindings/nodejs/package.json:
##########
@@ -49,9 +47,23 @@
     "build:debug": "napi build --platform --js generated.js --js-package-name @opendal/lib",
     "docs": "typedoc",
     "prepublishOnly": "napi prepublish -t npm",
+    "format": "run-p format:md format:json format:yaml format:source format:rs",
+    "format:md": "prettier --parser markdown --write './**/*.md'",
+    "format:json": "prettier --parser json --write './**/*.json'",
+    "format:rs": "cargo fmt",
+    "format:source": "prettier --config ./package.json --write './**/*.{js,ts,mjs}'",
+    "format:yaml": "prettier --parser yaml --write './**/*.{yml,yaml}'",

Review Comment:
   I prefer fewer tasks, and a single format command is sufficient for me.



##########
bindings/nodejs/package.json:
##########
@@ -26,17 +26,15 @@
     "webdav",
     "webhdfs"
   ],
-  "files": [
-    "index.d.ts",
-    "index.js",
-    "generated.js"
-  ],
+  "files": ["index.d.ts", "index.js", "generated.js"],
   "devDependencies": {
     "@cucumber/cucumber": "^9.0.1",
     "@napi-rs/cli": "^2.14.8",
     "@swc-node/register": "^1.6.2",
     "@swc/core": "^1.3.38",
     "@types/node": "^18.14.5",
+    "npm-run-all": "^4.1.5",

Review Comment:
   I prefer to remove it as we don't have a strong need for this package.



##########
bindings/nodejs/package.json:
##########
@@ -49,9 +47,23 @@
     "build:debug": "napi build --platform --js generated.js --js-package-name @opendal/lib",
     "docs": "typedoc",
     "prepublishOnly": "napi prepublish -t npm",
+    "format": "run-p format:md format:json format:yaml format:source format:rs",
+    "format:md": "prettier --parser markdown --write './**/*.md'",
+    "format:json": "prettier --parser json --write './**/*.json'",
+    "format:rs": "cargo fmt",

Review Comment:
   Not needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org