Repository: karen-irc/option-t
Pull request #1401 (2022-08-18 10:43:51)

Remove `@pkgjs/parseargs`
[Node v16.17 also supports `parseArgs()`](https://nodejs.org/uk/blog/release/v16.17.0/). It's the time to switch it.


Patch:
diff --git a/package.json b/package.json
index 82f2270d..4210dbd3 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,6 @@
     "@babel/cli": "^7.18.10",
     "@babel/core": "^7.18.10",
     "@babel/preset-env": "^7.18.10",
-    "@pkgjs/parseargs": "^0.10.0",
     "@typescript-eslint/eslint-plugin": "^5.33.0",
     "@typescript-eslint/parser": "^5.33.0",
     "ava": "^4.3.1",
diff --git a/tools/cp_files.mjs b/tools/cp_files.mjs
index 6ea8e509..0deee3b1 100644
--- a/tools/cp_files.mjs
+++ b/tools/cp_files.mjs
@@ -1,7 +1,7 @@
 import * as assert from 'node:assert/strict';
 import fs from 'node:fs/promises';
 import path from 'node:path';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 import { getAllGlobMatchedFiles } from './glob.mjs';
 
diff --git a/tools/extension_renamer.mjs b/tools/extension_renamer.mjs
index 33f77b6f..43c9dfcd 100644
--- a/tools/extension_renamer.mjs
+++ b/tools/extension_renamer.mjs
@@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
 import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 const FROM_EXTENSION = 'js';
 const TO_EXTENSION = 'mjs';
diff --git a/tools/generate_import_path_list_markdown.mjs b/tools/generate_import_path_list_markdown.mjs
index 47b85452..3503ba47 100644
--- a/tools/generate_import_path_list_markdown.mjs
+++ b/tools/generate_import_path_list_markdown.mjs
@@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
 import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 import {
     generateExposedPathSequence,
diff --git a/tools/package_json_rewriter/main.mjs b/tools/package_json_rewriter/main.mjs
index ff0dc4d9..ad2c9f46 100644
--- a/tools/package_json_rewriter/main.mjs
+++ b/tools/package_json_rewriter/main.mjs
@@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
 import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 import { addExportsFields } from './transformer/add_exports_field/main.mjs';
 import { loadJSON } from './json.mjs';
diff --git a/yarn.lock b/yarn.lock
index 6ea46b40..786e2998 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1060,11 +1060,6 @@
     "@nodelib/fs.scandir" "2.1.5"
     fastq "^1.6.0"
 
-"@pkgjs/parseargs@^0.10.0":
-  version "0.10.0"
-  resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.10.0.tgz#02605e33f8bc4d76efae9b660edc67902f9a0396"
-  integrity sha512-gcLFrTC3mgIWeDk+eJySEz9unk8XNKi0i2lyppi36qOrW54wBEtOVdGle71ssm5E+vauNwyGKQuWJ2psgTYRVQ==
-
 "@types/json-schema@^7.0.9":
   version "7.0.9"
   resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"


Test patch:
diff --git a/tools/test_esmodule_path_rewrite.mjs b/tools/test_esmodule_path_rewrite.mjs
index f0c2e76d..b02bbe45 100644
--- a/tools/test_esmodule_path_rewrite.mjs
+++ b/tools/test_esmodule_path_rewrite.mjs
@@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
 import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 const THIS_FILENAME = fileURLToPath(import.meta.url);
 const THIS_DIRNAME = path.dirname(THIS_FILENAME);
diff --git a/tools/test_package_contains_expected_all.mjs b/tools/test_package_contains_expected_all.mjs
index 4b4dccd1..9119aa55 100644
--- a/tools/test_package_contains_expected_all.mjs
+++ b/tools/test_package_contains_expected_all.mjs
@@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
 import * as fs from 'node:fs/promises';
 import * as path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { parseArgs } from '@pkgjs/parseargs';
+import { parseArgs } from 'node:util';
 
 const THIS_FILENAME = fileURLToPath(import.meta.url);
 const THIS_DIRNAME = path.dirname(THIS_FILENAME);