@pnpm/exe 11.0.0-dev.1005 → 11.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node-gyp-bin/node-gyp +6 -0
- package/dist/node-gyp-bin/node-gyp.cmd +5 -0
- package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
- package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
- package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
- package/dist/node_modules/@gar/promise-retry/package.json +45 -0
- package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
- package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
- package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
- package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
- package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
- package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
- package/dist/node_modules/@npmcli/agent/package.json +60 -0
- package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
- package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
- package/dist/node_modules/@npmcli/fs/package.json +54 -0
- package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
- package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
- package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
- package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
- package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
- package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
- package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
- package/dist/node_modules/@npmcli/redact/package.json +52 -0
- package/dist/node_modules/abbrev/LICENSE +46 -0
- package/dist/node_modules/abbrev/lib/index.js +53 -0
- package/dist/node_modules/abbrev/package.json +41 -0
- package/dist/node_modules/agent-base/LICENSE +22 -0
- package/dist/node_modules/agent-base/dist/helpers.js +66 -0
- package/dist/node_modules/agent-base/dist/index.js +178 -0
- package/dist/node_modules/agent-base/package.json +46 -0
- package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/dist/node_modules/balanced-match/package.json +68 -0
- package/dist/node_modules/brace-expansion/LICENSE +23 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/dist/node_modules/brace-expansion/package.json +64 -0
- package/dist/node_modules/cacache/lib/content/path.js +29 -0
- package/dist/node_modules/cacache/lib/content/read.js +165 -0
- package/dist/node_modules/cacache/lib/content/rm.js +18 -0
- package/dist/node_modules/cacache/lib/content/write.js +206 -0
- package/dist/node_modules/cacache/lib/entry-index.js +336 -0
- package/dist/node_modules/cacache/lib/get.js +170 -0
- package/dist/node_modules/cacache/lib/index.js +42 -0
- package/dist/node_modules/cacache/lib/memoization.js +72 -0
- package/dist/node_modules/cacache/lib/put.js +80 -0
- package/dist/node_modules/cacache/lib/rm.js +31 -0
- package/dist/node_modules/cacache/lib/util/glob.js +7 -0
- package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
- package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
- package/dist/node_modules/cacache/lib/verify.js +258 -0
- package/dist/node_modules/cacache/package.json +81 -0
- package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/dist/node_modules/chownr/dist/esm/index.js +85 -0
- package/dist/node_modules/chownr/dist/esm/package.json +3 -0
- package/dist/node_modules/chownr/package.json +69 -0
- package/dist/node_modules/debug/LICENSE +20 -0
- package/dist/node_modules/debug/package.json +64 -0
- package/dist/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/env-paths/index.js +74 -0
- package/dist/node_modules/env-paths/license +9 -0
- package/dist/node_modules/env-paths/package.json +45 -0
- package/dist/node_modules/exponential-backoff/LICENSE +202 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
- package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
- package/dist/node_modules/exponential-backoff/package.json +62 -0
- package/dist/node_modules/fdir/LICENSE +7 -0
- package/dist/node_modules/fdir/dist/index.cjs +588 -0
- package/dist/node_modules/fdir/dist/index.d.cts +155 -0
- package/dist/node_modules/fdir/dist/index.d.mts +155 -0
- package/dist/node_modules/fdir/dist/index.mjs +570 -0
- package/dist/node_modules/fdir/package.json +103 -0
- package/dist/node_modules/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/fs-minipass/lib/index.js +443 -0
- package/dist/node_modules/fs-minipass/package.json +54 -0
- package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
- package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
- package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
- package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
- package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/dist/node_modules/glob/dist/esm/glob.js +244 -0
- package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
- package/dist/node_modules/glob/dist/esm/index.js +55 -0
- package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
- package/dist/node_modules/glob/dist/esm/processor.js +294 -0
- package/dist/node_modules/glob/dist/esm/walker.js +381 -0
- package/dist/node_modules/glob/package.json +98 -0
- package/dist/node_modules/graceful-fs/LICENSE +15 -0
- package/dist/node_modules/graceful-fs/clone.js +23 -0
- package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/dist/node_modules/graceful-fs/package.json +53 -0
- package/dist/node_modules/graceful-fs/polyfills.js +355 -0
- package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
- package/dist/node_modules/http-cache-semantics/index.js +928 -0
- package/dist/node_modules/http-cache-semantics/package.json +22 -0
- package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
- package/dist/node_modules/http-proxy-agent/package.json +47 -0
- package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
- package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
- package/dist/node_modules/https-proxy-agent/package.json +50 -0
- package/dist/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/iconv-lite/lib/index.js +182 -0
- package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
- package/dist/node_modules/iconv-lite/package.json +70 -0
- package/dist/node_modules/ip-address/LICENSE +19 -0
- package/dist/node_modules/ip-address/dist/address-error.js +12 -0
- package/dist/node_modules/ip-address/dist/common.js +46 -0
- package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
- package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
- package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
- package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
- package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
- package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/dist/node_modules/ip-address/package.json +78 -0
- package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/dist/node_modules/isexe/dist/esm/index.js +16 -0
- package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/esm/options.js +2 -0
- package/dist/node_modules/isexe/dist/esm/package.json +3 -0
- package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
- package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
- package/dist/node_modules/isexe/package.json +78 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/dist/node_modules/lru-cache/dist/esm/index.js +1591 -0
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/dist/node_modules/lru-cache/package.json +93 -0
- package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
- package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
- package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
- package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
- package/dist/node_modules/make-fetch-happen/package.json +75 -0
- package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +846 -0
- package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/dist/node_modules/minimatch/dist/commonjs/index.js +1121 -0
- package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/dist/node_modules/minimatch/dist/esm/ast.js +842 -0
- package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/dist/node_modules/minimatch/dist/esm/index.js +1108 -0
- package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
- package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/dist/node_modules/minimatch/package.json +67 -0
- package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
- package/dist/node_modules/minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass/package.json +77 -0
- package/dist/node_modules/minipass-collect/LICENSE +15 -0
- package/dist/node_modules/minipass-collect/index.js +71 -0
- package/dist/node_modules/minipass-collect/package.json +30 -0
- package/dist/node_modules/minipass-fetch/LICENSE +28 -0
- package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
- package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
- package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
- package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
- package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
- package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
- package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
- package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
- package/dist/node_modules/minipass-fetch/package.json +70 -0
- package/dist/node_modules/minipass-flush/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/index.js +39 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-flush/package.json +39 -0
- package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/index.js +128 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-pipeline/package.json +29 -0
- package/dist/node_modules/minipass-sized/LICENSE +15 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
- package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass-sized/package.json +69 -0
- package/dist/node_modules/minizlib/LICENSE +26 -0
- package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
- package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
- package/dist/node_modules/minizlib/package.json +80 -0
- package/dist/node_modules/ms/index.js +162 -0
- package/dist/node_modules/ms/package.json +38 -0
- package/dist/node_modules/negotiator/LICENSE +24 -0
- package/dist/node_modules/negotiator/index.js +83 -0
- package/dist/node_modules/negotiator/lib/charset.js +169 -0
- package/dist/node_modules/negotiator/lib/encoding.js +205 -0
- package/dist/node_modules/negotiator/lib/language.js +179 -0
- package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
- package/dist/node_modules/negotiator/package.json +43 -0
- package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/LICENSE +24 -0
- package/dist/node_modules/node-gyp/addon.gypi +204 -0
- package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
- package/dist/node_modules/node-gyp/eslint.config.js +3 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
- package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
- package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
- package/dist/node_modules/node-gyp/gyp/gyp +8 -0
- package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
- package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
- package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
- package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
- package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
- package/dist/node_modules/node-gyp/lib/build.js +230 -0
- package/dist/node_modules/node-gyp/lib/clean.js +15 -0
- package/dist/node_modules/node-gyp/lib/configure.js +328 -0
- package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
- package/dist/node_modules/node-gyp/lib/download.js +39 -0
- package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
- package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
- package/dist/node_modules/node-gyp/lib/install.js +411 -0
- package/dist/node_modules/node-gyp/lib/list.js +26 -0
- package/dist/node_modules/node-gyp/lib/log.js +168 -0
- package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
- package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
- package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
- package/dist/node_modules/node-gyp/lib/remove.js +43 -0
- package/dist/node_modules/node-gyp/lib/util.js +81 -0
- package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
- package/dist/node_modules/node-gyp/package.json +52 -0
- package/dist/node_modules/node-gyp/release-please-config.json +40 -0
- package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
- package/dist/node_modules/nopt/LICENSE +15 -0
- package/dist/node_modules/nopt/bin/nopt.js +29 -0
- package/dist/node_modules/nopt/lib/debug.js +5 -0
- package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
- package/dist/node_modules/nopt/lib/nopt.js +34 -0
- package/dist/node_modules/nopt/lib/type-defs.js +91 -0
- package/dist/node_modules/nopt/package.json +52 -0
- package/dist/node_modules/p-map/index.js +283 -0
- package/dist/node_modules/p-map/license +9 -0
- package/dist/node_modules/p-map/package.json +57 -0
- package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/dist/node_modules/path-scurry/package.json +72 -0
- package/dist/node_modules/picomatch/LICENSE +21 -0
- package/dist/node_modules/picomatch/index.js +17 -0
- package/dist/node_modules/picomatch/lib/constants.js +184 -0
- package/dist/node_modules/picomatch/lib/parse.js +1386 -0
- package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
- package/dist/node_modules/picomatch/lib/scan.js +391 -0
- package/dist/node_modules/picomatch/lib/utils.js +72 -0
- package/dist/node_modules/picomatch/package.json +82 -0
- package/dist/node_modules/picomatch/posix.js +3 -0
- package/dist/node_modules/proc-log/LICENSE +15 -0
- package/dist/node_modules/proc-log/lib/index.js +158 -0
- package/dist/node_modules/proc-log/package.json +46 -0
- package/dist/node_modules/safer-buffer/LICENSE +21 -0
- package/dist/node_modules/safer-buffer/dangerous.js +58 -0
- package/dist/node_modules/safer-buffer/package.json +34 -0
- package/dist/node_modules/safer-buffer/safer.js +77 -0
- package/dist/node_modules/safer-buffer/tests.js +406 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/bin/semver.js +191 -0
- package/dist/node_modules/semver/classes/comparator.js +143 -0
- package/dist/node_modules/semver/classes/index.js +7 -0
- package/dist/node_modules/semver/classes/range.js +557 -0
- package/dist/node_modules/semver/classes/semver.js +333 -0
- package/dist/node_modules/semver/functions/clean.js +8 -0
- package/dist/node_modules/semver/functions/cmp.js +54 -0
- package/dist/node_modules/semver/functions/coerce.js +62 -0
- package/dist/node_modules/semver/functions/compare-build.js +9 -0
- package/dist/node_modules/semver/functions/compare-loose.js +5 -0
- package/dist/node_modules/semver/functions/compare.js +7 -0
- package/dist/node_modules/semver/functions/diff.js +60 -0
- package/dist/node_modules/semver/functions/eq.js +5 -0
- package/dist/node_modules/semver/functions/gt.js +5 -0
- package/dist/node_modules/semver/functions/gte.js +5 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +5 -0
- package/dist/node_modules/semver/functions/lte.js +5 -0
- package/dist/node_modules/semver/functions/major.js +5 -0
- package/dist/node_modules/semver/functions/minor.js +5 -0
- package/dist/node_modules/semver/functions/neq.js +5 -0
- package/dist/node_modules/semver/functions/parse.js +18 -0
- package/dist/node_modules/semver/functions/patch.js +5 -0
- package/dist/node_modules/semver/functions/prerelease.js +8 -0
- package/dist/node_modules/semver/functions/rcompare.js +5 -0
- package/dist/node_modules/semver/functions/rsort.js +5 -0
- package/dist/node_modules/semver/functions/satisfies.js +12 -0
- package/dist/node_modules/semver/functions/sort.js +5 -0
- package/dist/node_modules/semver/functions/valid.js +8 -0
- package/dist/node_modules/semver/index.js +91 -0
- package/dist/node_modules/semver/internal/constants.js +37 -0
- package/dist/node_modules/semver/internal/debug.js +11 -0
- package/dist/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/semver/internal/parse-options.js +17 -0
- package/dist/node_modules/semver/internal/re.js +223 -0
- package/dist/node_modules/semver/package.json +78 -0
- package/dist/node_modules/semver/preload.js +4 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +6 -0
- package/dist/node_modules/semver/ranges/intersects.js +9 -0
- package/dist/node_modules/semver/ranges/ltr.js +6 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/dist/node_modules/semver/ranges/min-version.js +63 -0
- package/dist/node_modules/semver/ranges/outside.js +82 -0
- package/dist/node_modules/semver/ranges/simplify.js +49 -0
- package/dist/node_modules/semver/ranges/subset.js +249 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
- package/dist/node_modules/semver/ranges/valid.js +13 -0
- package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/dist/node_modules/smart-buffer/LICENSE +20 -0
- package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/dist/node_modules/smart-buffer/build/utils.js +108 -0
- package/dist/node_modules/smart-buffer/package.json +79 -0
- package/dist/node_modules/socks/.eslintrc.cjs +11 -0
- package/dist/node_modules/socks/.prettierrc.yaml +7 -0
- package/dist/node_modules/socks/LICENSE +20 -0
- package/dist/node_modules/socks/build/client/socksclient.js +793 -0
- package/dist/node_modules/socks/build/common/constants.js +108 -0
- package/dist/node_modules/socks/build/common/helpers.js +167 -0
- package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/dist/node_modules/socks/build/common/util.js +25 -0
- package/dist/node_modules/socks/build/index.js +18 -0
- package/dist/node_modules/socks/package.json +58 -0
- package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
- package/dist/node_modules/socks-proxy-agent/package.json +142 -0
- package/dist/node_modules/ssri/lib/index.js +550 -0
- package/dist/node_modules/ssri/package.json +66 -0
- package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
- package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
- package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
- package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
- package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/dist/node_modules/tar/dist/esm/create.js +76 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/dist/node_modules/tar/dist/esm/extract.js +49 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/dist/node_modules/tar/dist/esm/header.js +275 -0
- package/dist/node_modules/tar/dist/esm/index.js +20 -0
- package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/dist/node_modules/tar/dist/esm/list.js +105 -0
- package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
- package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/dist/node_modules/tar/dist/esm/options.js +54 -0
- package/dist/node_modules/tar/dist/esm/pack.js +469 -0
- package/dist/node_modules/tar/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/dist/esm/parse.js +606 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/dist/node_modules/tar/dist/esm/pax.js +154 -0
- package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/dist/node_modules/tar/dist/esm/replace.js +221 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/dist/node_modules/tar/dist/esm/types.js +45 -0
- package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
- package/dist/node_modules/tar/dist/esm/update.js +30 -0
- package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
- package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
- package/dist/node_modules/tar/package.json +297 -0
- package/dist/node_modules/tinyglobby/LICENSE +21 -0
- package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
- package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
- package/dist/node_modules/tinyglobby/package.json +73 -0
- package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
- package/dist/node_modules/v8-compile-cache/package.json +34 -0
- package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
- package/dist/node_modules/which/LICENSE +15 -0
- package/dist/node_modules/which/bin/which.js +52 -0
- package/dist/node_modules/which/lib/index.js +111 -0
- package/dist/node_modules/which/package.json +52 -0
- package/dist/node_modules/yallist/LICENSE +15 -0
- package/dist/node_modules/yallist/iterator.js +8 -0
- package/dist/node_modules/yallist/package.json +29 -0
- package/dist/node_modules/yallist/yallist.js +426 -0
- package/dist/pnpm.mjs +266382 -0
- package/dist/pnpmrc +2 -0
- package/dist/templates/completion.bash +31 -0
- package/dist/templates/completion.fish +22 -0
- package/dist/templates/completion.ps1 +193 -0
- package/dist/templates/completion.zsh +27 -0
- package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
- package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
- package/dist/worker.js +10958 -0
- package/package.json +34 -11
- package/pn +2 -0
- package/pn.cmd +2 -0
- package/pn.ps1 +1 -0
- package/pnpx +2 -0
- package/pnpx.cmd +2 -0
- package/pnpx.ps1 +1 -0
- package/pnx +2 -0
- package/pnx.cmd +2 -0
- package/pnx.ps1 +1 -0
- package/prepare.js +26 -3
- package/setup.js +22 -11
- package/CHANGELOG.md +0 -15
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
// this file is a modified version of the code in node 17.2.0
|
|
2
|
+
// which is, in turn, a modified version of the fs-extra module on npm
|
|
3
|
+
// node core changes:
|
|
4
|
+
// - Use of the assert module has been replaced with core's error system.
|
|
5
|
+
// - All code related to the glob dependency has been removed.
|
|
6
|
+
// - Bring your own custom fs module is not currently supported.
|
|
7
|
+
// - Some basic code cleanup.
|
|
8
|
+
// changes here:
|
|
9
|
+
// - remove all callback related code
|
|
10
|
+
// - drop sync support
|
|
11
|
+
// - change assertions back to non-internal methods (see options.js)
|
|
12
|
+
// - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows
|
|
13
|
+
'use strict'
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
ERR_FS_CP_DIR_TO_NON_DIR,
|
|
17
|
+
ERR_FS_CP_EEXIST,
|
|
18
|
+
ERR_FS_CP_EINVAL,
|
|
19
|
+
ERR_FS_CP_FIFO_PIPE,
|
|
20
|
+
ERR_FS_CP_NON_DIR_TO_DIR,
|
|
21
|
+
ERR_FS_CP_SOCKET,
|
|
22
|
+
ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY,
|
|
23
|
+
ERR_FS_CP_UNKNOWN,
|
|
24
|
+
ERR_FS_EISDIR,
|
|
25
|
+
ERR_INVALID_ARG_TYPE,
|
|
26
|
+
} = require('./errors.js')
|
|
27
|
+
const {
|
|
28
|
+
constants: {
|
|
29
|
+
errno: {
|
|
30
|
+
EEXIST,
|
|
31
|
+
EISDIR,
|
|
32
|
+
EINVAL,
|
|
33
|
+
ENOTDIR,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
} = require('os')
|
|
37
|
+
const {
|
|
38
|
+
chmod,
|
|
39
|
+
copyFile,
|
|
40
|
+
lstat,
|
|
41
|
+
mkdir,
|
|
42
|
+
readdir,
|
|
43
|
+
readlink,
|
|
44
|
+
stat,
|
|
45
|
+
symlink,
|
|
46
|
+
unlink,
|
|
47
|
+
utimes,
|
|
48
|
+
} = require('fs/promises')
|
|
49
|
+
const {
|
|
50
|
+
dirname,
|
|
51
|
+
isAbsolute,
|
|
52
|
+
join,
|
|
53
|
+
parse,
|
|
54
|
+
resolve,
|
|
55
|
+
sep,
|
|
56
|
+
toNamespacedPath,
|
|
57
|
+
} = require('path')
|
|
58
|
+
const { fileURLToPath } = require('url')
|
|
59
|
+
|
|
60
|
+
const defaultOptions = {
|
|
61
|
+
dereference: false,
|
|
62
|
+
errorOnExist: false,
|
|
63
|
+
filter: undefined,
|
|
64
|
+
force: true,
|
|
65
|
+
preserveTimestamps: false,
|
|
66
|
+
recursive: false,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function cp (src, dest, opts) {
|
|
70
|
+
if (opts != null && typeof opts !== 'object') {
|
|
71
|
+
throw new ERR_INVALID_ARG_TYPE('options', ['Object'], opts)
|
|
72
|
+
}
|
|
73
|
+
return cpFn(
|
|
74
|
+
toNamespacedPath(getValidatedPath(src)),
|
|
75
|
+
toNamespacedPath(getValidatedPath(dest)),
|
|
76
|
+
{ ...defaultOptions, ...opts })
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function getValidatedPath (fileURLOrPath) {
|
|
80
|
+
const path = fileURLOrPath != null && fileURLOrPath.href
|
|
81
|
+
&& fileURLOrPath.origin
|
|
82
|
+
? fileURLToPath(fileURLOrPath)
|
|
83
|
+
: fileURLOrPath
|
|
84
|
+
return path
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function cpFn (src, dest, opts) {
|
|
88
|
+
// Warn about using preserveTimestamps on 32-bit node
|
|
89
|
+
// istanbul ignore next
|
|
90
|
+
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
|
91
|
+
const warning = 'Using the preserveTimestamps option in 32-bit ' +
|
|
92
|
+
'node is not recommended'
|
|
93
|
+
process.emitWarning(warning, 'TimestampPrecisionWarning')
|
|
94
|
+
}
|
|
95
|
+
const stats = await checkPaths(src, dest, opts)
|
|
96
|
+
const { srcStat, destStat } = stats
|
|
97
|
+
await checkParentPaths(src, srcStat, dest)
|
|
98
|
+
if (opts.filter) {
|
|
99
|
+
return handleFilter(checkParentDir, destStat, src, dest, opts)
|
|
100
|
+
}
|
|
101
|
+
return checkParentDir(destStat, src, dest, opts)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function checkPaths (src, dest, opts) {
|
|
105
|
+
const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts)
|
|
106
|
+
if (destStat) {
|
|
107
|
+
if (areIdentical(srcStat, destStat)) {
|
|
108
|
+
throw new ERR_FS_CP_EINVAL({
|
|
109
|
+
message: 'src and dest cannot be the same',
|
|
110
|
+
path: dest,
|
|
111
|
+
syscall: 'cp',
|
|
112
|
+
errno: EINVAL,
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
116
|
+
throw new ERR_FS_CP_DIR_TO_NON_DIR({
|
|
117
|
+
message: `cannot overwrite directory ${src} ` +
|
|
118
|
+
`with non-directory ${dest}`,
|
|
119
|
+
path: dest,
|
|
120
|
+
syscall: 'cp',
|
|
121
|
+
errno: EISDIR,
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
125
|
+
throw new ERR_FS_CP_NON_DIR_TO_DIR({
|
|
126
|
+
message: `cannot overwrite non-directory ${src} ` +
|
|
127
|
+
`with directory ${dest}`,
|
|
128
|
+
path: dest,
|
|
129
|
+
syscall: 'cp',
|
|
130
|
+
errno: ENOTDIR,
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
136
|
+
throw new ERR_FS_CP_EINVAL({
|
|
137
|
+
message: `cannot copy ${src} to a subdirectory of self ${dest}`,
|
|
138
|
+
path: dest,
|
|
139
|
+
syscall: 'cp',
|
|
140
|
+
errno: EINVAL,
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
return { srcStat, destStat }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function areIdentical (srcStat, destStat) {
|
|
147
|
+
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino &&
|
|
148
|
+
destStat.dev === srcStat.dev
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getStats (src, dest, opts) {
|
|
152
|
+
const statFunc = opts.dereference ?
|
|
153
|
+
(file) => stat(file, { bigint: true }) :
|
|
154
|
+
(file) => lstat(file, { bigint: true })
|
|
155
|
+
return Promise.all([
|
|
156
|
+
statFunc(src),
|
|
157
|
+
statFunc(dest).catch((err) => {
|
|
158
|
+
// istanbul ignore next: unsure how to cover.
|
|
159
|
+
if (err.code === 'ENOENT') {
|
|
160
|
+
return null
|
|
161
|
+
}
|
|
162
|
+
// istanbul ignore next: unsure how to cover.
|
|
163
|
+
throw err
|
|
164
|
+
}),
|
|
165
|
+
])
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function checkParentDir (destStat, src, dest, opts) {
|
|
169
|
+
const destParent = dirname(dest)
|
|
170
|
+
const dirExists = await pathExists(destParent)
|
|
171
|
+
if (dirExists) {
|
|
172
|
+
return getStatsForCopy(destStat, src, dest, opts)
|
|
173
|
+
}
|
|
174
|
+
await mkdir(destParent, { recursive: true })
|
|
175
|
+
return getStatsForCopy(destStat, src, dest, opts)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function pathExists (dest) {
|
|
179
|
+
return stat(dest).then(
|
|
180
|
+
() => true,
|
|
181
|
+
// istanbul ignore next: not sure when this would occur
|
|
182
|
+
(err) => (err.code === 'ENOENT' ? false : Promise.reject(err)))
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Recursively check if dest parent is a subdirectory of src.
|
|
186
|
+
// It works for all file types including symlinks since it
|
|
187
|
+
// checks the src and dest inodes. It starts from the deepest
|
|
188
|
+
// parent and stops once it reaches the src parent or the root path.
|
|
189
|
+
async function checkParentPaths (src, srcStat, dest) {
|
|
190
|
+
const srcParent = resolve(dirname(src))
|
|
191
|
+
const destParent = resolve(dirname(dest))
|
|
192
|
+
if (destParent === srcParent || destParent === parse(destParent).root) {
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
let destStat
|
|
196
|
+
try {
|
|
197
|
+
destStat = await stat(destParent, { bigint: true })
|
|
198
|
+
} catch (err) {
|
|
199
|
+
// istanbul ignore else: not sure when this would occur
|
|
200
|
+
if (err.code === 'ENOENT') {
|
|
201
|
+
return
|
|
202
|
+
}
|
|
203
|
+
// istanbul ignore next: not sure when this would occur
|
|
204
|
+
throw err
|
|
205
|
+
}
|
|
206
|
+
if (areIdentical(srcStat, destStat)) {
|
|
207
|
+
throw new ERR_FS_CP_EINVAL({
|
|
208
|
+
message: `cannot copy ${src} to a subdirectory of self ${dest}`,
|
|
209
|
+
path: dest,
|
|
210
|
+
syscall: 'cp',
|
|
211
|
+
errno: EINVAL,
|
|
212
|
+
})
|
|
213
|
+
}
|
|
214
|
+
return checkParentPaths(src, srcStat, destParent)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const normalizePathToArray = (path) =>
|
|
218
|
+
resolve(path).split(sep).filter(Boolean)
|
|
219
|
+
|
|
220
|
+
// Return true if dest is a subdir of src, otherwise false.
|
|
221
|
+
// It only checks the path strings.
|
|
222
|
+
function isSrcSubdir (src, dest) {
|
|
223
|
+
const srcArr = normalizePathToArray(src)
|
|
224
|
+
const destArr = normalizePathToArray(dest)
|
|
225
|
+
return srcArr.every((cur, i) => destArr[i] === cur)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async function handleFilter (onInclude, destStat, src, dest, opts, cb) {
|
|
229
|
+
const include = await opts.filter(src, dest)
|
|
230
|
+
if (include) {
|
|
231
|
+
return onInclude(destStat, src, dest, opts, cb)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function startCopy (destStat, src, dest, opts) {
|
|
236
|
+
if (opts.filter) {
|
|
237
|
+
return handleFilter(getStatsForCopy, destStat, src, dest, opts)
|
|
238
|
+
}
|
|
239
|
+
return getStatsForCopy(destStat, src, dest, opts)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
async function getStatsForCopy (destStat, src, dest, opts) {
|
|
243
|
+
const statFn = opts.dereference ? stat : lstat
|
|
244
|
+
const srcStat = await statFn(src)
|
|
245
|
+
// istanbul ignore else: can't portably test FIFO
|
|
246
|
+
if (srcStat.isDirectory() && opts.recursive) {
|
|
247
|
+
return onDir(srcStat, destStat, src, dest, opts)
|
|
248
|
+
} else if (srcStat.isDirectory()) {
|
|
249
|
+
throw new ERR_FS_EISDIR({
|
|
250
|
+
message: `${src} is a directory (not copied)`,
|
|
251
|
+
path: src,
|
|
252
|
+
syscall: 'cp',
|
|
253
|
+
errno: EINVAL,
|
|
254
|
+
})
|
|
255
|
+
} else if (srcStat.isFile() ||
|
|
256
|
+
srcStat.isCharacterDevice() ||
|
|
257
|
+
srcStat.isBlockDevice()) {
|
|
258
|
+
return onFile(srcStat, destStat, src, dest, opts)
|
|
259
|
+
} else if (srcStat.isSymbolicLink()) {
|
|
260
|
+
return onLink(destStat, src, dest)
|
|
261
|
+
} else if (srcStat.isSocket()) {
|
|
262
|
+
throw new ERR_FS_CP_SOCKET({
|
|
263
|
+
message: `cannot copy a socket file: ${dest}`,
|
|
264
|
+
path: dest,
|
|
265
|
+
syscall: 'cp',
|
|
266
|
+
errno: EINVAL,
|
|
267
|
+
})
|
|
268
|
+
} else if (srcStat.isFIFO()) {
|
|
269
|
+
throw new ERR_FS_CP_FIFO_PIPE({
|
|
270
|
+
message: `cannot copy a FIFO pipe: ${dest}`,
|
|
271
|
+
path: dest,
|
|
272
|
+
syscall: 'cp',
|
|
273
|
+
errno: EINVAL,
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
// istanbul ignore next: should be unreachable
|
|
277
|
+
throw new ERR_FS_CP_UNKNOWN({
|
|
278
|
+
message: `cannot copy an unknown file type: ${dest}`,
|
|
279
|
+
path: dest,
|
|
280
|
+
syscall: 'cp',
|
|
281
|
+
errno: EINVAL,
|
|
282
|
+
})
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function onFile (srcStat, destStat, src, dest, opts) {
|
|
286
|
+
if (!destStat) {
|
|
287
|
+
return _copyFile(srcStat, src, dest, opts)
|
|
288
|
+
}
|
|
289
|
+
return mayCopyFile(srcStat, src, dest, opts)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
async function mayCopyFile (srcStat, src, dest, opts) {
|
|
293
|
+
if (opts.force) {
|
|
294
|
+
await unlink(dest)
|
|
295
|
+
return _copyFile(srcStat, src, dest, opts)
|
|
296
|
+
} else if (opts.errorOnExist) {
|
|
297
|
+
throw new ERR_FS_CP_EEXIST({
|
|
298
|
+
message: `${dest} already exists`,
|
|
299
|
+
path: dest,
|
|
300
|
+
syscall: 'cp',
|
|
301
|
+
errno: EEXIST,
|
|
302
|
+
})
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
async function _copyFile (srcStat, src, dest, opts) {
|
|
307
|
+
await copyFile(src, dest)
|
|
308
|
+
if (opts.preserveTimestamps) {
|
|
309
|
+
return handleTimestampsAndMode(srcStat.mode, src, dest)
|
|
310
|
+
}
|
|
311
|
+
return setDestMode(dest, srcStat.mode)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
async function handleTimestampsAndMode (srcMode, src, dest) {
|
|
315
|
+
// Make sure the file is writable before setting the timestamp
|
|
316
|
+
// otherwise open fails with EPERM when invoked with 'r+'
|
|
317
|
+
// (through utimes call)
|
|
318
|
+
if (fileIsNotWritable(srcMode)) {
|
|
319
|
+
await makeFileWritable(dest, srcMode)
|
|
320
|
+
return setDestTimestampsAndMode(srcMode, src, dest)
|
|
321
|
+
}
|
|
322
|
+
return setDestTimestampsAndMode(srcMode, src, dest)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function fileIsNotWritable (srcMode) {
|
|
326
|
+
return (srcMode & 0o200) === 0
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function makeFileWritable (dest, srcMode) {
|
|
330
|
+
return setDestMode(dest, srcMode | 0o200)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async function setDestTimestampsAndMode (srcMode, src, dest) {
|
|
334
|
+
await setDestTimestamps(src, dest)
|
|
335
|
+
return setDestMode(dest, srcMode)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function setDestMode (dest, srcMode) {
|
|
339
|
+
return chmod(dest, srcMode)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
async function setDestTimestamps (src, dest) {
|
|
343
|
+
// The initial srcStat.atime cannot be trusted
|
|
344
|
+
// because it is modified by the read(2) system call
|
|
345
|
+
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
|
346
|
+
const updatedSrcStat = await stat(src)
|
|
347
|
+
return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function onDir (srcStat, destStat, src, dest, opts) {
|
|
351
|
+
if (!destStat) {
|
|
352
|
+
return mkDirAndCopy(srcStat.mode, src, dest, opts)
|
|
353
|
+
}
|
|
354
|
+
return copyDir(src, dest, opts)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
async function mkDirAndCopy (srcMode, src, dest, opts) {
|
|
358
|
+
await mkdir(dest)
|
|
359
|
+
await copyDir(src, dest, opts)
|
|
360
|
+
return setDestMode(dest, srcMode)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
async function copyDir (src, dest, opts) {
|
|
364
|
+
const dir = await readdir(src)
|
|
365
|
+
for (let i = 0; i < dir.length; i++) {
|
|
366
|
+
const item = dir[i]
|
|
367
|
+
const srcItem = join(src, item)
|
|
368
|
+
const destItem = join(dest, item)
|
|
369
|
+
const { destStat } = await checkPaths(srcItem, destItem, opts)
|
|
370
|
+
await startCopy(destStat, srcItem, destItem, opts)
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
async function onLink (destStat, src, dest) {
|
|
375
|
+
let resolvedSrc = await readlink(src)
|
|
376
|
+
if (!isAbsolute(resolvedSrc)) {
|
|
377
|
+
resolvedSrc = resolve(dirname(src), resolvedSrc)
|
|
378
|
+
}
|
|
379
|
+
if (!destStat) {
|
|
380
|
+
return symlink(resolvedSrc, dest)
|
|
381
|
+
}
|
|
382
|
+
let resolvedDest
|
|
383
|
+
try {
|
|
384
|
+
resolvedDest = await readlink(dest)
|
|
385
|
+
} catch (err) {
|
|
386
|
+
// Dest exists and is a regular file or directory,
|
|
387
|
+
// Windows may throw UNKNOWN error. If dest already exists,
|
|
388
|
+
// fs throws error anyway, so no need to guard against it here.
|
|
389
|
+
// istanbul ignore next: can only test on windows
|
|
390
|
+
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') {
|
|
391
|
+
return symlink(resolvedSrc, dest)
|
|
392
|
+
}
|
|
393
|
+
// istanbul ignore next: should not be possible
|
|
394
|
+
throw err
|
|
395
|
+
}
|
|
396
|
+
if (!isAbsolute(resolvedDest)) {
|
|
397
|
+
resolvedDest = resolve(dirname(dest), resolvedDest)
|
|
398
|
+
}
|
|
399
|
+
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
400
|
+
throw new ERR_FS_CP_EINVAL({
|
|
401
|
+
message: `cannot copy ${resolvedSrc} to a subdirectory of self ` +
|
|
402
|
+
`${resolvedDest}`,
|
|
403
|
+
path: dest,
|
|
404
|
+
syscall: 'cp',
|
|
405
|
+
errno: EINVAL,
|
|
406
|
+
})
|
|
407
|
+
}
|
|
408
|
+
// Do not copy if src is a subdir of dest since unlinking
|
|
409
|
+
// dest in this case would result in removing src contents
|
|
410
|
+
// and therefore a broken symlink would be created.
|
|
411
|
+
const srcStat = await stat(src)
|
|
412
|
+
if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
413
|
+
throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({
|
|
414
|
+
message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`,
|
|
415
|
+
path: dest,
|
|
416
|
+
syscall: 'cp',
|
|
417
|
+
errno: EINVAL,
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
return copyLink(resolvedSrc, dest)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
async function copyLink (resolvedSrc, dest) {
|
|
424
|
+
await unlink(dest)
|
|
425
|
+
return symlink(resolvedSrc, dest)
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
module.exports = cp
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const cp = require('./cp/index.js')
|
|
4
|
+
const withTempDir = require('./with-temp-dir.js')
|
|
5
|
+
const readdirScoped = require('./readdir-scoped.js')
|
|
6
|
+
const moveFile = require('./move-file.js')
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
cp,
|
|
10
|
+
withTempDir,
|
|
11
|
+
readdirScoped,
|
|
12
|
+
moveFile,
|
|
13
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const { dirname, join, resolve, relative, isAbsolute } = require('path')
|
|
2
|
+
const fs = require('fs/promises')
|
|
3
|
+
|
|
4
|
+
const pathExists = async path => {
|
|
5
|
+
try {
|
|
6
|
+
await fs.access(path)
|
|
7
|
+
return true
|
|
8
|
+
} catch (er) {
|
|
9
|
+
return er.code !== 'ENOENT'
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const moveFile = async (source, destination, options = {}, root = true, symlinks = []) => {
|
|
14
|
+
if (!source || !destination) {
|
|
15
|
+
throw new TypeError('`source` and `destination` file required')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
options = {
|
|
19
|
+
overwrite: true,
|
|
20
|
+
...options,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!options.overwrite && await pathExists(destination)) {
|
|
24
|
+
throw new Error(`The destination file exists: ${destination}`)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await fs.mkdir(dirname(destination), { recursive: true })
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
await fs.rename(source, destination)
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (error.code === 'EXDEV' || error.code === 'EPERM') {
|
|
33
|
+
const sourceStat = await fs.lstat(source)
|
|
34
|
+
if (sourceStat.isDirectory()) {
|
|
35
|
+
const files = await fs.readdir(source)
|
|
36
|
+
await Promise.all(files.map((file) =>
|
|
37
|
+
moveFile(join(source, file), join(destination, file), options, false, symlinks)
|
|
38
|
+
))
|
|
39
|
+
} else if (sourceStat.isSymbolicLink()) {
|
|
40
|
+
symlinks.push({ source, destination })
|
|
41
|
+
} else {
|
|
42
|
+
await fs.copyFile(source, destination)
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
throw error
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (root) {
|
|
50
|
+
await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
|
|
51
|
+
let target = await fs.readlink(symSource)
|
|
52
|
+
// junction symlinks in windows will be absolute paths, so we need to
|
|
53
|
+
// make sure they point to the symlink destination
|
|
54
|
+
if (isAbsolute(target)) {
|
|
55
|
+
target = resolve(symDestination, relative(symSource, target))
|
|
56
|
+
}
|
|
57
|
+
// try to determine what the actual file is so we can create the correct
|
|
58
|
+
// type of symlink in windows
|
|
59
|
+
let targetStat = 'file'
|
|
60
|
+
try {
|
|
61
|
+
targetStat = await fs.stat(resolve(dirname(symSource), target))
|
|
62
|
+
if (targetStat.isDirectory()) {
|
|
63
|
+
targetStat = 'junction'
|
|
64
|
+
}
|
|
65
|
+
} catch {
|
|
66
|
+
// targetStat remains 'file'
|
|
67
|
+
}
|
|
68
|
+
await fs.symlink(
|
|
69
|
+
target,
|
|
70
|
+
symDestination,
|
|
71
|
+
targetStat
|
|
72
|
+
)
|
|
73
|
+
}))
|
|
74
|
+
await fs.rm(source, { recursive: true, force: true })
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = moveFile
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { readdir } = require('fs/promises')
|
|
2
|
+
const { join } = require('path')
|
|
3
|
+
|
|
4
|
+
const readdirScoped = async (dir) => {
|
|
5
|
+
const results = []
|
|
6
|
+
|
|
7
|
+
for (const item of await readdir(dir)) {
|
|
8
|
+
if (item.startsWith('@')) {
|
|
9
|
+
for (const scopedItem of await readdir(join(dir, item))) {
|
|
10
|
+
results.push(join(item, scopedItem))
|
|
11
|
+
}
|
|
12
|
+
} else {
|
|
13
|
+
results.push(item)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return results
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = readdirScoped
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { join, sep } = require('path')
|
|
2
|
+
|
|
3
|
+
const getOptions = require('./common/get-options.js')
|
|
4
|
+
const { mkdir, mkdtemp, rm } = require('fs/promises')
|
|
5
|
+
|
|
6
|
+
// create a temp directory, ensure its permissions match its parent, then call
|
|
7
|
+
// the supplied function passing it the path to the directory. clean up after
|
|
8
|
+
// the function finishes, whether it throws or not
|
|
9
|
+
const withTempDir = async (root, fn, opts) => {
|
|
10
|
+
const options = getOptions(opts, {
|
|
11
|
+
copy: ['tmpPrefix'],
|
|
12
|
+
})
|
|
13
|
+
// create the directory
|
|
14
|
+
await mkdir(root, { recursive: true })
|
|
15
|
+
|
|
16
|
+
const target = await mkdtemp(join(`${root}${sep}`, options.tmpPrefix || ''))
|
|
17
|
+
let err
|
|
18
|
+
let result
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
result = await fn(target)
|
|
22
|
+
} catch (_err) {
|
|
23
|
+
err = _err
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
await rm(target, { force: true, recursive: true })
|
|
28
|
+
} catch {
|
|
29
|
+
// ignore errors
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (err) {
|
|
33
|
+
throw err
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = withTempDir
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@npmcli/fs",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "filesystem utilities for the npm cli",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"bin/",
|
|
8
|
+
"lib/"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"snap": "tap",
|
|
12
|
+
"test": "tap",
|
|
13
|
+
"npmclilint": "npmcli-lint",
|
|
14
|
+
"lint": "npm run eslint",
|
|
15
|
+
"lintfix": "npm run eslint -- --fix",
|
|
16
|
+
"posttest": "npm run lint",
|
|
17
|
+
"postsnap": "npm run lintfix --",
|
|
18
|
+
"postlint": "template-oss-check",
|
|
19
|
+
"template-oss-apply": "template-oss-apply --force",
|
|
20
|
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/npm/fs.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"npm",
|
|
28
|
+
"oss"
|
|
29
|
+
],
|
|
30
|
+
"author": "GitHub Inc.",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@npmcli/eslint-config": "^5.0.0",
|
|
34
|
+
"@npmcli/template-oss": "4.27.1",
|
|
35
|
+
"tap": "^16.0.1"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"semver": "^7.3.5"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": "^20.17.0 || >=22.9.0"
|
|
42
|
+
},
|
|
43
|
+
"templateOSS": {
|
|
44
|
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
45
|
+
"version": "4.27.1",
|
|
46
|
+
"publish": true
|
|
47
|
+
},
|
|
48
|
+
"tap": {
|
|
49
|
+
"nyc-arg": [
|
|
50
|
+
"--exclude",
|
|
51
|
+
"tap-snapshots/**"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 npm
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|