@oneblink/release-cli 1.2.0-beta.2 → 1.2.0-beta.3
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/node_modules/@yarnpkg/lockfile/README.md +22 -0
- package/node_modules/@yarnpkg/lockfile/index.js +10273 -0
- package/node_modules/@yarnpkg/lockfile/package.json +19 -0
- package/node_modules/ansi-styles/index.js +165 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +60 -0
- package/node_modules/ansi-styles/readme.md +147 -0
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +52 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/brace-expansion/package.json +51 -0
- package/node_modules/braces/CHANGELOG.md +184 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +593 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +57 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +333 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +112 -0
- package/node_modules/braces/package.json +81 -0
- package/node_modules/chalk/index.js +228 -0
- package/node_modules/chalk/index.js.flow +93 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +75 -0
- package/node_modules/chalk/readme.md +314 -0
- package/node_modules/chalk/templates.js +128 -0
- package/node_modules/chalk/types/index.d.ts +97 -0
- package/node_modules/changelog-parser/.DS_Store +0 -0
- package/node_modules/changelog-parser/.travis.yml +7 -0
- package/node_modules/changelog-parser/CHANGELOG.md +128 -0
- package/node_modules/changelog-parser/CONTRIBUTING.md +55 -0
- package/node_modules/changelog-parser/LICENSE.md +15 -0
- package/node_modules/changelog-parser/README.md +247 -0
- package/node_modules/changelog-parser/bin/cli.js +19 -0
- package/node_modules/changelog-parser/index.js +201 -0
- package/node_modules/changelog-parser/package.json +54 -0
- package/node_modules/changelog-parser/test/fixtures/CHANGELOG.md +44 -0
- package/node_modules/changelog-parser/test/fixtures/expected.js +113 -0
- package/node_modules/changelog-parser/test/fixtures/remove-markdown-expected.js +113 -0
- package/node_modules/changelog-parser/test/index.js +105 -0
- package/node_modules/ci-info/CHANGELOG.md +78 -0
- package/node_modules/ci-info/LICENSE +21 -0
- package/node_modules/ci-info/README.md +108 -0
- package/node_modules/ci-info/index.js +66 -0
- package/node_modules/ci-info/package.json +40 -0
- package/node_modules/ci-info/vendors.json +153 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +868 -0
- package/node_modules/color-convert/index.js +78 -0
- package/node_modules/color-convert/package.json +50 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/.eslintrc.json +43 -0
- package/node_modules/color-name/.npmignore +107 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +29 -0
- package/node_modules/color-name/test.js +7 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +47 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/escape-string-regexp/index.js +11 -0
- package/node_modules/escape-string-regexp/license +21 -0
- package/node_modules/escape-string-regexp/package.json +45 -0
- package/node_modules/escape-string-regexp/readme.md +27 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +249 -0
- package/node_modules/fill-range/package.json +73 -0
- package/node_modules/find-yarn-workspace-root/CHANGELOG.md +53 -0
- package/node_modules/find-yarn-workspace-root/LICENSE +201 -0
- package/node_modules/find-yarn-workspace-root/README.md +56 -0
- package/node_modules/find-yarn-workspace-root/index.d.ts +3 -0
- package/node_modules/find-yarn-workspace-root/index.js +53 -0
- package/node_modules/find-yarn-workspace-root/package.json +38 -0
- package/node_modules/fs-extra/CHANGELOG.md +842 -0
- package/node_modules/fs-extra/LICENSE +15 -0
- package/node_modules/fs-extra/README.md +261 -0
- package/node_modules/fs-extra/lib/copy/copy.js +246 -0
- package/node_modules/fs-extra/lib/copy/index.js +6 -0
- package/node_modules/fs-extra/lib/copy-sync/copy-sync.js +193 -0
- package/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
- package/node_modules/fs-extra/lib/empty/index.js +48 -0
- package/node_modules/fs-extra/lib/ensure/file.js +49 -0
- package/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/node_modules/fs-extra/lib/ensure/link.js +61 -0
- package/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
- package/node_modules/fs-extra/lib/fs/index.js +104 -0
- package/node_modules/fs-extra/lib/index.js +28 -0
- package/node_modules/fs-extra/lib/json/index.js +16 -0
- package/node_modules/fs-extra/lib/json/jsonfile.js +12 -0
- package/node_modules/fs-extra/lib/json/output-json-sync.js +18 -0
- package/node_modules/fs-extra/lib/json/output-json.js +27 -0
- package/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js +54 -0
- package/node_modules/fs-extra/lib/mkdirs/mkdirs.js +63 -0
- package/node_modules/fs-extra/lib/mkdirs/win32.js +25 -0
- package/node_modules/fs-extra/lib/move/index.js +82 -0
- package/node_modules/fs-extra/lib/move-sync/index.js +117 -0
- package/node_modules/fs-extra/lib/output/index.js +40 -0
- package/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/node_modules/fs-extra/lib/remove/index.js +9 -0
- package/node_modules/fs-extra/lib/remove/rimraf.js +314 -0
- package/node_modules/fs-extra/lib/util/buffer.js +12 -0
- package/node_modules/fs-extra/lib/util/utimes.js +79 -0
- package/node_modules/fs-extra/package.json +72 -0
- package/node_modules/fs.realpath/LICENSE +43 -0
- package/node_modules/fs.realpath/README.md +33 -0
- package/node_modules/fs.realpath/index.js +66 -0
- package/node_modules/fs.realpath/old.js +303 -0
- package/node_modules/fs.realpath/package.json +30 -0
- package/node_modules/glob/LICENSE +21 -0
- package/node_modules/glob/README.md +375 -0
- package/node_modules/glob/changelog.md +67 -0
- package/node_modules/glob/common.js +240 -0
- package/node_modules/glob/glob.js +790 -0
- package/node_modules/glob/package.json +50 -0
- package/node_modules/glob/sync.js +486 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +133 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +373 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +54 -0
- package/node_modules/graceful-fs/polyfills.js +346 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +48 -0
- package/node_modules/has-flag/readme.md +70 -0
- package/node_modules/inflight/LICENSE +15 -0
- package/node_modules/inflight/README.md +37 -0
- package/node_modules/inflight/inflight.js +54 -0
- package/node_modules/inflight/package.json +33 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +33 -0
- package/node_modules/is-ci/CHANGELOG.md +14 -0
- package/node_modules/is-ci/LICENSE +21 -0
- package/node_modules/is-ci/README.md +50 -0
- package/node_modules/is-ci/bin.js +4 -0
- package/node_modules/is-ci/index.js +3 -0
- package/node_modules/is-ci/package.json +42 -0
- package/node_modules/is-docker/cli.js +5 -0
- package/node_modules/is-docker/index.d.ts +15 -0
- package/node_modules/is-docker/index.js +29 -0
- package/node_modules/is-docker/license +9 -0
- package/node_modules/is-docker/package.json +46 -0
- package/node_modules/is-docker/readme.md +27 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +86 -0
- package/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/is-wsl/index.js +31 -0
- package/node_modules/is-wsl/license +9 -0
- package/node_modules/is-wsl/package.json +49 -0
- package/node_modules/is-wsl/readme.md +36 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +35 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jsonfile/CHANGELOG.md +145 -0
- package/node_modules/jsonfile/LICENSE +15 -0
- package/node_modules/jsonfile/README.md +168 -0
- package/node_modules/jsonfile/index.js +134 -0
- package/node_modules/jsonfile/package.json +41 -0
- package/node_modules/klaw-sync/CHANGELOG.md +73 -0
- package/node_modules/klaw-sync/LICENSE +20 -0
- package/node_modules/klaw-sync/README.md +164 -0
- package/node_modules/klaw-sync/klaw-sync.js +29 -0
- package/node_modules/klaw-sync/package.json +51 -0
- package/node_modules/line-reader/LICENSE +20 -0
- package/node_modules/line-reader/README.md +75 -0
- package/node_modules/line-reader/lib/line_reader.js +174 -0
- package/node_modules/line-reader/package.json +18 -0
- package/node_modules/line-reader/test/data/empty_file.txt +0 -0
- package/node_modules/line-reader/test/data/multi_separator_file.txt +2 -0
- package/node_modules/line-reader/test/data/multibyte_file.txt +2 -0
- package/node_modules/line-reader/test/data/normal_file.txt +6 -0
- package/node_modules/line-reader/test/data/one_line_file.txt +1 -0
- package/node_modules/line-reader/test/data/separator_file.txt +2 -0
- package/node_modules/line-reader/test/data/three_line_file.txt +3 -0
- package/node_modules/line-reader/test/line_reader.js +222 -0
- package/node_modules/lru-cache/LICENSE +15 -0
- package/node_modules/lru-cache/README.md +166 -0
- package/node_modules/lru-cache/index.js +334 -0
- package/node_modules/lru-cache/package.json +38 -0
- package/node_modules/micromatch/CHANGELOG.md +109 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1008 -0
- package/node_modules/micromatch/index.js +467 -0
- package/node_modules/micromatch/package.json +123 -0
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +209 -0
- package/node_modules/minimatch/minimatch.js +923 -0
- package/node_modules/minimatch/package.json +34 -0
- package/node_modules/minimist/.travis.yml +8 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/example/parse.js +2 -0
- package/node_modules/minimist/index.js +245 -0
- package/node_modules/minimist/package.json +49 -0
- package/node_modules/minimist/readme.markdown +95 -0
- package/node_modules/minimist/test/all_bool.js +32 -0
- package/node_modules/minimist/test/bool.js +178 -0
- package/node_modules/minimist/test/dash.js +31 -0
- package/node_modules/minimist/test/default_bool.js +35 -0
- package/node_modules/minimist/test/dotted.js +22 -0
- package/node_modules/minimist/test/kv_short.js +16 -0
- package/node_modules/minimist/test/long.js +31 -0
- package/node_modules/minimist/test/num.js +36 -0
- package/node_modules/minimist/test/parse.js +197 -0
- package/node_modules/minimist/test/parse_modified.js +9 -0
- package/node_modules/minimist/test/proto.js +44 -0
- package/node_modules/minimist/test/short.js +67 -0
- package/node_modules/minimist/test/stop_early.js +15 -0
- package/node_modules/minimist/test/unknown.js +102 -0
- package/node_modules/minimist/test/whitespace.js +8 -0
- package/node_modules/nice-try/CHANGELOG.md +21 -0
- package/node_modules/nice-try/LICENSE +21 -0
- package/node_modules/nice-try/README.md +32 -0
- package/node_modules/nice-try/package.json +37 -0
- package/node_modules/nice-try/src/index.js +12 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +37 -0
- package/node_modules/open/index.d.ts +88 -0
- package/node_modules/open/index.js +195 -0
- package/node_modules/open/license +9 -0
- package/node_modules/open/package.json +64 -0
- package/node_modules/open/readme.md +154 -0
- package/node_modules/open/xdg-open +1066 -0
- package/node_modules/os-tmpdir/index.js +25 -0
- package/node_modules/os-tmpdir/license +21 -0
- package/node_modules/os-tmpdir/package.json +45 -0
- package/node_modules/os-tmpdir/readme.md +32 -0
- package/node_modules/patch-package/CHANGELOG.md +389 -0
- package/node_modules/patch-package/LICENSE +19 -0
- package/node_modules/patch-package/README.md +269 -0
- package/node_modules/patch-package/dist/PackageDetails.js +102 -0
- package/node_modules/patch-package/dist/PackageDetails.test.js +228 -0
- package/node_modules/patch-package/dist/applyPatches.js +261 -0
- package/node_modules/patch-package/dist/assertNever.js +8 -0
- package/node_modules/patch-package/dist/createIssue.js +83 -0
- package/node_modules/patch-package/dist/detectPackageManager.js +64 -0
- package/node_modules/patch-package/dist/filterFiles.js +17 -0
- package/node_modules/patch-package/dist/getAppRootPath.js +22 -0
- package/node_modules/patch-package/dist/getPackageResolution.js +85 -0
- package/node_modules/patch-package/dist/getPackageVersion.js +9 -0
- package/node_modules/patch-package/dist/index.js +161 -0
- package/node_modules/patch-package/dist/makePatch.js +231 -0
- package/node_modules/patch-package/dist/makeRegExp.js +28 -0
- package/node_modules/patch-package/dist/packageIsDevDependency.js +15 -0
- package/node_modules/patch-package/dist/packageIsDevDependency.test.js +32 -0
- package/node_modules/patch-package/dist/patch/apply.js +197 -0
- package/node_modules/patch-package/dist/patch/parse.js +330 -0
- package/node_modules/patch-package/dist/patch/read.js +49 -0
- package/node_modules/patch-package/dist/patch/reverse.js +96 -0
- package/node_modules/patch-package/dist/patchFs.js +20 -0
- package/node_modules/patch-package/dist/path.js +17 -0
- package/node_modules/patch-package/dist/resolveRelativeFileDependencies.js +21 -0
- package/node_modules/patch-package/dist/resolveRelativeFileDependencies.test.js +22 -0
- package/node_modules/patch-package/dist/spawnSafe.js +28 -0
- package/node_modules/patch-package/index.js +3 -0
- package/node_modules/patch-package/node_modules/cross-spawn/CHANGELOG.md +100 -0
- package/node_modules/patch-package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/patch-package/node_modules/cross-spawn/README.md +94 -0
- package/node_modules/patch-package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/parse.js +125 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/escape.js +45 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/resolveCommand.js +47 -0
- package/node_modules/patch-package/node_modules/cross-spawn/package.json +80 -0
- package/node_modules/patch-package/node_modules/path-key/index.js +13 -0
- package/node_modules/patch-package/node_modules/path-key/license +21 -0
- package/node_modules/patch-package/node_modules/path-key/package.json +43 -0
- package/node_modules/patch-package/node_modules/path-key/readme.md +51 -0
- package/node_modules/patch-package/node_modules/rimraf/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/rimraf/README.md +101 -0
- package/node_modules/patch-package/node_modules/rimraf/bin.js +50 -0
- package/node_modules/patch-package/node_modules/rimraf/package.json +33 -0
- package/node_modules/patch-package/node_modules/rimraf/rimraf.js +372 -0
- package/node_modules/patch-package/node_modules/semver/CHANGELOG.md +39 -0
- package/node_modules/patch-package/node_modules/semver/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/semver/README.md +412 -0
- package/node_modules/patch-package/node_modules/semver/bin/semver +160 -0
- package/node_modules/patch-package/node_modules/semver/package.json +32 -0
- package/node_modules/patch-package/node_modules/semver/range.bnf +16 -0
- package/node_modules/patch-package/node_modules/semver/semver.js +1483 -0
- package/node_modules/patch-package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/patch-package/node_modules/shebang-command/license +21 -0
- package/node_modules/patch-package/node_modules/shebang-command/package.json +43 -0
- package/node_modules/patch-package/node_modules/shebang-command/readme.md +39 -0
- package/node_modules/patch-package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/patch-package/node_modules/shebang-regex/license +21 -0
- package/node_modules/patch-package/node_modules/shebang-regex/package.json +36 -0
- package/node_modules/patch-package/node_modules/shebang-regex/readme.md +29 -0
- package/node_modules/patch-package/node_modules/slash/index.js +11 -0
- package/node_modules/patch-package/node_modules/slash/license +9 -0
- package/node_modules/patch-package/node_modules/slash/package.json +38 -0
- package/node_modules/patch-package/node_modules/slash/readme.md +44 -0
- package/node_modules/patch-package/node_modules/which/CHANGELOG.md +152 -0
- package/node_modules/patch-package/node_modules/which/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/which/README.md +51 -0
- package/node_modules/patch-package/node_modules/which/bin/which +52 -0
- package/node_modules/patch-package/node_modules/which/package.json +34 -0
- package/node_modules/patch-package/node_modules/which/which.js +135 -0
- package/node_modules/patch-package/package.json +100 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +47 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/picomatch/CHANGELOG.md +120 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +691 -0
- package/node_modules/picomatch/index.js +3 -0
- package/node_modules/picomatch/lib/constants.js +179 -0
- package/node_modules/picomatch/lib/parse.js +1078 -0
- package/node_modules/picomatch/lib/picomatch.js +339 -0
- package/node_modules/picomatch/lib/scan.js +385 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +85 -0
- package/node_modules/remove-markdown/.npmignore +1 -0
- package/node_modules/remove-markdown/LICENSE +21 -0
- package/node_modules/remove-markdown/README.md +44 -0
- package/node_modules/remove-markdown/index.js +60 -0
- package/node_modules/remove-markdown/package.json +31 -0
- package/node_modules/remove-markdown/test/remove-markdown.js +139 -0
- package/node_modules/semver/CHANGELOG.md +111 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +566 -0
- package/node_modules/semver/bin/semver.js +173 -0
- package/node_modules/semver/classes/comparator.js +135 -0
- package/node_modules/semver/classes/index.js +5 -0
- package/node_modules/semver/classes/range.js +510 -0
- package/node_modules/semver/classes/semver.js +287 -0
- package/node_modules/semver/functions/clean.js +6 -0
- package/node_modules/semver/functions/cmp.js +48 -0
- package/node_modules/semver/functions/coerce.js +51 -0
- package/node_modules/semver/functions/compare-build.js +7 -0
- package/node_modules/semver/functions/compare-loose.js +3 -0
- package/node_modules/semver/functions/compare.js +5 -0
- package/node_modules/semver/functions/diff.js +23 -0
- package/node_modules/semver/functions/eq.js +3 -0
- package/node_modules/semver/functions/gt.js +3 -0
- package/node_modules/semver/functions/gte.js +3 -0
- package/node_modules/semver/functions/inc.js +15 -0
- package/node_modules/semver/functions/lt.js +3 -0
- package/node_modules/semver/functions/lte.js +3 -0
- package/node_modules/semver/functions/major.js +3 -0
- package/node_modules/semver/functions/minor.js +3 -0
- package/node_modules/semver/functions/neq.js +3 -0
- package/node_modules/semver/functions/parse.js +33 -0
- package/node_modules/semver/functions/patch.js +3 -0
- package/node_modules/semver/functions/prerelease.js +6 -0
- package/node_modules/semver/functions/rcompare.js +3 -0
- package/node_modules/semver/functions/rsort.js +3 -0
- package/node_modules/semver/functions/satisfies.js +10 -0
- package/node_modules/semver/functions/sort.js +3 -0
- package/node_modules/semver/functions/valid.js +6 -0
- package/node_modules/semver/index.js +48 -0
- package/node_modules/semver/internal/constants.js +17 -0
- package/node_modules/semver/internal/debug.js +9 -0
- package/node_modules/semver/internal/identifiers.js +23 -0
- package/node_modules/semver/internal/parse-options.js +11 -0
- package/node_modules/semver/internal/re.js +182 -0
- package/node_modules/semver/package.json +45 -0
- package/node_modules/semver/preload.js +2 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +4 -0
- package/node_modules/semver/ranges/intersects.js +7 -0
- package/node_modules/semver/ranges/ltr.js +4 -0
- package/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/node_modules/semver/ranges/min-version.js +60 -0
- package/node_modules/semver/ranges/outside.js +80 -0
- package/node_modules/semver/ranges/simplify.js +44 -0
- package/node_modules/semver/ranges/subset.js +222 -0
- package/node_modules/semver/ranges/to-comparators.js +8 -0
- package/node_modules/semver/ranges/valid.js +11 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +131 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +57 -0
- package/node_modules/supports-color/readme.md +66 -0
- package/node_modules/tmp/LICENSE +21 -0
- package/node_modules/tmp/README.md +314 -0
- package/node_modules/tmp/lib/tmp.js +611 -0
- package/node_modules/tmp/package.json +42 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +92 -0
- package/node_modules/universalify/LICENSE +20 -0
- package/node_modules/universalify/README.md +76 -0
- package/node_modules/universalify/index.js +25 -0
- package/node_modules/universalify/package.json +38 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +33 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/yallist/LICENSE +15 -0
- package/node_modules/yallist/README.md +204 -0
- package/node_modules/yallist/iterator.js +8 -0
- package/node_modules/yallist/package.json +33 -0
- package/node_modules/yallist/yallist.js +426 -0
- package/package.json +5 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('graceful-fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const mkdirpSync = require('../mkdirs').mkdirsSync
|
|
6
|
+
const utimesSync = require('../util/utimes.js').utimesMillisSync
|
|
7
|
+
|
|
8
|
+
const notExist = Symbol('notExist')
|
|
9
|
+
|
|
10
|
+
function copySync (src, dest, opts) {
|
|
11
|
+
if (typeof opts === 'function') {
|
|
12
|
+
opts = {filter: opts}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
opts = opts || {}
|
|
16
|
+
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
|
17
|
+
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
|
18
|
+
|
|
19
|
+
// Warn about using preserveTimestamps on 32-bit node
|
|
20
|
+
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
|
21
|
+
console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
|
|
22
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const destStat = checkPaths(src, dest)
|
|
26
|
+
|
|
27
|
+
if (opts.filter && !opts.filter(src, dest)) return
|
|
28
|
+
|
|
29
|
+
const destParent = path.dirname(dest)
|
|
30
|
+
if (!fs.existsSync(destParent)) mkdirpSync(destParent)
|
|
31
|
+
return startCopy(destStat, src, dest, opts)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function startCopy (destStat, src, dest, opts) {
|
|
35
|
+
if (opts.filter && !opts.filter(src, dest)) return
|
|
36
|
+
return getStats(destStat, src, dest, opts)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getStats (destStat, src, dest, opts) {
|
|
40
|
+
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
|
41
|
+
const srcStat = statSync(src)
|
|
42
|
+
|
|
43
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
|
44
|
+
else if (srcStat.isFile() ||
|
|
45
|
+
srcStat.isCharacterDevice() ||
|
|
46
|
+
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
|
47
|
+
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function onFile (srcStat, destStat, src, dest, opts) {
|
|
51
|
+
if (destStat === notExist) return copyFile(srcStat, src, dest, opts)
|
|
52
|
+
return mayCopyFile(srcStat, src, dest, opts)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function mayCopyFile (srcStat, src, dest, opts) {
|
|
56
|
+
if (opts.overwrite) {
|
|
57
|
+
fs.unlinkSync(dest)
|
|
58
|
+
return copyFile(srcStat, src, dest, opts)
|
|
59
|
+
} else if (opts.errorOnExist) {
|
|
60
|
+
throw new Error(`'${dest}' already exists`)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function copyFile (srcStat, src, dest, opts) {
|
|
65
|
+
if (typeof fs.copyFileSync === 'function') {
|
|
66
|
+
fs.copyFileSync(src, dest)
|
|
67
|
+
fs.chmodSync(dest, srcStat.mode)
|
|
68
|
+
if (opts.preserveTimestamps) {
|
|
69
|
+
return utimesSync(dest, srcStat.atime, srcStat.mtime)
|
|
70
|
+
}
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
return copyFileFallback(srcStat, src, dest, opts)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function copyFileFallback (srcStat, src, dest, opts) {
|
|
77
|
+
const BUF_LENGTH = 64 * 1024
|
|
78
|
+
const _buff = require('../util/buffer')(BUF_LENGTH)
|
|
79
|
+
|
|
80
|
+
const fdr = fs.openSync(src, 'r')
|
|
81
|
+
const fdw = fs.openSync(dest, 'w', srcStat.mode)
|
|
82
|
+
let pos = 0
|
|
83
|
+
|
|
84
|
+
while (pos < srcStat.size) {
|
|
85
|
+
const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
|
|
86
|
+
fs.writeSync(fdw, _buff, 0, bytesRead)
|
|
87
|
+
pos += bytesRead
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)
|
|
91
|
+
|
|
92
|
+
fs.closeSync(fdr)
|
|
93
|
+
fs.closeSync(fdw)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function onDir (srcStat, destStat, src, dest, opts) {
|
|
97
|
+
if (destStat === notExist) return mkDirAndCopy(srcStat, src, dest, opts)
|
|
98
|
+
if (destStat && !destStat.isDirectory()) {
|
|
99
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
|
100
|
+
}
|
|
101
|
+
return copyDir(src, dest, opts)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function mkDirAndCopy (srcStat, src, dest, opts) {
|
|
105
|
+
fs.mkdirSync(dest)
|
|
106
|
+
copyDir(src, dest, opts)
|
|
107
|
+
return fs.chmodSync(dest, srcStat.mode)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function copyDir (src, dest, opts) {
|
|
111
|
+
fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function copyDirItem (item, src, dest, opts) {
|
|
115
|
+
const srcItem = path.join(src, item)
|
|
116
|
+
const destItem = path.join(dest, item)
|
|
117
|
+
const destStat = checkPaths(srcItem, destItem)
|
|
118
|
+
return startCopy(destStat, srcItem, destItem, opts)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function onLink (destStat, src, dest, opts) {
|
|
122
|
+
let resolvedSrc = fs.readlinkSync(src)
|
|
123
|
+
|
|
124
|
+
if (opts.dereference) {
|
|
125
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (destStat === notExist) {
|
|
129
|
+
return fs.symlinkSync(resolvedSrc, dest)
|
|
130
|
+
} else {
|
|
131
|
+
let resolvedDest
|
|
132
|
+
try {
|
|
133
|
+
resolvedDest = fs.readlinkSync(dest)
|
|
134
|
+
} catch (err) {
|
|
135
|
+
// dest exists and is a regular file or directory,
|
|
136
|
+
// Windows may throw UNKNOWN error. If dest already exists,
|
|
137
|
+
// fs throws error anyway, so no need to guard against it here.
|
|
138
|
+
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
|
|
139
|
+
throw err
|
|
140
|
+
}
|
|
141
|
+
if (opts.dereference) {
|
|
142
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
143
|
+
}
|
|
144
|
+
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
145
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// prevent copy if src is a subdir of dest since unlinking
|
|
149
|
+
// dest in this case would result in removing src contents
|
|
150
|
+
// and therefore a broken symlink would be created.
|
|
151
|
+
if (fs.statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
152
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
153
|
+
}
|
|
154
|
+
return copyLink(resolvedSrc, dest)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function copyLink (resolvedSrc, dest) {
|
|
159
|
+
fs.unlinkSync(dest)
|
|
160
|
+
return fs.symlinkSync(resolvedSrc, dest)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// return true if dest is a subdir of src, otherwise false.
|
|
164
|
+
function isSrcSubdir (src, dest) {
|
|
165
|
+
const srcArray = path.resolve(src).split(path.sep)
|
|
166
|
+
const destArray = path.resolve(dest).split(path.sep)
|
|
167
|
+
return srcArray.reduce((acc, current, i) => acc && destArray[i] === current, true)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function checkStats (src, dest) {
|
|
171
|
+
const srcStat = fs.statSync(src)
|
|
172
|
+
let destStat
|
|
173
|
+
try {
|
|
174
|
+
destStat = fs.statSync(dest)
|
|
175
|
+
} catch (err) {
|
|
176
|
+
if (err.code === 'ENOENT') return {srcStat, destStat: notExist}
|
|
177
|
+
throw err
|
|
178
|
+
}
|
|
179
|
+
return {srcStat, destStat}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function checkPaths (src, dest) {
|
|
183
|
+
const {srcStat, destStat} = checkStats(src, dest)
|
|
184
|
+
if (destStat.ino && destStat.ino === srcStat.ino) {
|
|
185
|
+
throw new Error('Source and destination must not be the same.')
|
|
186
|
+
}
|
|
187
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
188
|
+
throw new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`)
|
|
189
|
+
}
|
|
190
|
+
return destStat
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
module.exports = copySync
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const u = require('universalify').fromCallback
|
|
4
|
+
const fs = require('fs')
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const mkdir = require('../mkdirs')
|
|
7
|
+
const remove = require('../remove')
|
|
8
|
+
|
|
9
|
+
const emptyDir = u(function emptyDir (dir, callback) {
|
|
10
|
+
callback = callback || function () {}
|
|
11
|
+
fs.readdir(dir, (err, items) => {
|
|
12
|
+
if (err) return mkdir.mkdirs(dir, callback)
|
|
13
|
+
|
|
14
|
+
items = items.map(item => path.join(dir, item))
|
|
15
|
+
|
|
16
|
+
deleteItem()
|
|
17
|
+
|
|
18
|
+
function deleteItem () {
|
|
19
|
+
const item = items.pop()
|
|
20
|
+
if (!item) return callback()
|
|
21
|
+
remove.remove(item, err => {
|
|
22
|
+
if (err) return callback(err)
|
|
23
|
+
deleteItem()
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
function emptyDirSync (dir) {
|
|
30
|
+
let items
|
|
31
|
+
try {
|
|
32
|
+
items = fs.readdirSync(dir)
|
|
33
|
+
} catch (err) {
|
|
34
|
+
return mkdir.mkdirsSync(dir)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
items.forEach(item => {
|
|
38
|
+
item = path.join(dir, item)
|
|
39
|
+
remove.removeSync(item)
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
emptyDirSync,
|
|
45
|
+
emptydirSync: emptyDirSync,
|
|
46
|
+
emptyDir,
|
|
47
|
+
emptydir: emptyDir
|
|
48
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const u = require('universalify').fromCallback
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const fs = require('graceful-fs')
|
|
6
|
+
const mkdir = require('../mkdirs')
|
|
7
|
+
const pathExists = require('../path-exists').pathExists
|
|
8
|
+
|
|
9
|
+
function createFile (file, callback) {
|
|
10
|
+
function makeFile () {
|
|
11
|
+
fs.writeFile(file, '', err => {
|
|
12
|
+
if (err) return callback(err)
|
|
13
|
+
callback()
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
|
|
18
|
+
if (!err && stats.isFile()) return callback()
|
|
19
|
+
const dir = path.dirname(file)
|
|
20
|
+
pathExists(dir, (err, dirExists) => {
|
|
21
|
+
if (err) return callback(err)
|
|
22
|
+
if (dirExists) return makeFile()
|
|
23
|
+
mkdir.mkdirs(dir, err => {
|
|
24
|
+
if (err) return callback(err)
|
|
25
|
+
makeFile()
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function createFileSync (file) {
|
|
32
|
+
let stats
|
|
33
|
+
try {
|
|
34
|
+
stats = fs.statSync(file)
|
|
35
|
+
} catch (e) {}
|
|
36
|
+
if (stats && stats.isFile()) return
|
|
37
|
+
|
|
38
|
+
const dir = path.dirname(file)
|
|
39
|
+
if (!fs.existsSync(dir)) {
|
|
40
|
+
mkdir.mkdirsSync(dir)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fs.writeFileSync(file, '')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
createFile: u(createFile),
|
|
48
|
+
createFileSync
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const file = require('./file')
|
|
4
|
+
const link = require('./link')
|
|
5
|
+
const symlink = require('./symlink')
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
// file
|
|
9
|
+
createFile: file.createFile,
|
|
10
|
+
createFileSync: file.createFileSync,
|
|
11
|
+
ensureFile: file.createFile,
|
|
12
|
+
ensureFileSync: file.createFileSync,
|
|
13
|
+
// link
|
|
14
|
+
createLink: link.createLink,
|
|
15
|
+
createLinkSync: link.createLinkSync,
|
|
16
|
+
ensureLink: link.createLink,
|
|
17
|
+
ensureLinkSync: link.createLinkSync,
|
|
18
|
+
// symlink
|
|
19
|
+
createSymlink: symlink.createSymlink,
|
|
20
|
+
createSymlinkSync: symlink.createSymlinkSync,
|
|
21
|
+
ensureSymlink: symlink.createSymlink,
|
|
22
|
+
ensureSymlinkSync: symlink.createSymlinkSync
|
|
23
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const u = require('universalify').fromCallback
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const fs = require('graceful-fs')
|
|
6
|
+
const mkdir = require('../mkdirs')
|
|
7
|
+
const pathExists = require('../path-exists').pathExists
|
|
8
|
+
|
|
9
|
+
function createLink (srcpath, dstpath, callback) {
|
|
10
|
+
function makeLink (srcpath, dstpath) {
|
|
11
|
+
fs.link(srcpath, dstpath, err => {
|
|
12
|
+
if (err) return callback(err)
|
|
13
|
+
callback(null)
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
pathExists(dstpath, (err, destinationExists) => {
|
|
18
|
+
if (err) return callback(err)
|
|
19
|
+
if (destinationExists) return callback(null)
|
|
20
|
+
fs.lstat(srcpath, (err) => {
|
|
21
|
+
if (err) {
|
|
22
|
+
err.message = err.message.replace('lstat', 'ensureLink')
|
|
23
|
+
return callback(err)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const dir = path.dirname(dstpath)
|
|
27
|
+
pathExists(dir, (err, dirExists) => {
|
|
28
|
+
if (err) return callback(err)
|
|
29
|
+
if (dirExists) return makeLink(srcpath, dstpath)
|
|
30
|
+
mkdir.mkdirs(dir, err => {
|
|
31
|
+
if (err) return callback(err)
|
|
32
|
+
makeLink(srcpath, dstpath)
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function createLinkSync (srcpath, dstpath) {
|
|
40
|
+
const destinationExists = fs.existsSync(dstpath)
|
|
41
|
+
if (destinationExists) return undefined
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
fs.lstatSync(srcpath)
|
|
45
|
+
} catch (err) {
|
|
46
|
+
err.message = err.message.replace('lstat', 'ensureLink')
|
|
47
|
+
throw err
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const dir = path.dirname(dstpath)
|
|
51
|
+
const dirExists = fs.existsSync(dir)
|
|
52
|
+
if (dirExists) return fs.linkSync(srcpath, dstpath)
|
|
53
|
+
mkdir.mkdirsSync(dir)
|
|
54
|
+
|
|
55
|
+
return fs.linkSync(srcpath, dstpath)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
createLink: u(createLink),
|
|
60
|
+
createLinkSync
|
|
61
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const fs = require('graceful-fs')
|
|
5
|
+
const pathExists = require('../path-exists').pathExists
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Function that returns two types of paths, one relative to symlink, and one
|
|
9
|
+
* relative to the current working directory. Checks if path is absolute or
|
|
10
|
+
* relative. If the path is relative, this function checks if the path is
|
|
11
|
+
* relative to symlink or relative to current working directory. This is an
|
|
12
|
+
* initiative to find a smarter `srcpath` to supply when building symlinks.
|
|
13
|
+
* This allows you to determine which path to use out of one of three possible
|
|
14
|
+
* types of source paths. The first is an absolute path. This is detected by
|
|
15
|
+
* `path.isAbsolute()`. When an absolute path is provided, it is checked to
|
|
16
|
+
* see if it exists. If it does it's used, if not an error is returned
|
|
17
|
+
* (callback)/ thrown (sync). The other two options for `srcpath` are a
|
|
18
|
+
* relative url. By default Node's `fs.symlink` works by creating a symlink
|
|
19
|
+
* using `dstpath` and expects the `srcpath` to be relative to the newly
|
|
20
|
+
* created symlink. If you provide a `srcpath` that does not exist on the file
|
|
21
|
+
* system it results in a broken symlink. To minimize this, the function
|
|
22
|
+
* checks to see if the 'relative to symlink' source file exists, and if it
|
|
23
|
+
* does it will use it. If it does not, it checks if there's a file that
|
|
24
|
+
* exists that is relative to the current working directory, if does its used.
|
|
25
|
+
* This preserves the expectations of the original fs.symlink spec and adds
|
|
26
|
+
* the ability to pass in `relative to current working direcotry` paths.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
function symlinkPaths (srcpath, dstpath, callback) {
|
|
30
|
+
if (path.isAbsolute(srcpath)) {
|
|
31
|
+
return fs.lstat(srcpath, (err) => {
|
|
32
|
+
if (err) {
|
|
33
|
+
err.message = err.message.replace('lstat', 'ensureSymlink')
|
|
34
|
+
return callback(err)
|
|
35
|
+
}
|
|
36
|
+
return callback(null, {
|
|
37
|
+
'toCwd': srcpath,
|
|
38
|
+
'toDst': srcpath
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
} else {
|
|
42
|
+
const dstdir = path.dirname(dstpath)
|
|
43
|
+
const relativeToDst = path.join(dstdir, srcpath)
|
|
44
|
+
return pathExists(relativeToDst, (err, exists) => {
|
|
45
|
+
if (err) return callback(err)
|
|
46
|
+
if (exists) {
|
|
47
|
+
return callback(null, {
|
|
48
|
+
'toCwd': relativeToDst,
|
|
49
|
+
'toDst': srcpath
|
|
50
|
+
})
|
|
51
|
+
} else {
|
|
52
|
+
return fs.lstat(srcpath, (err) => {
|
|
53
|
+
if (err) {
|
|
54
|
+
err.message = err.message.replace('lstat', 'ensureSymlink')
|
|
55
|
+
return callback(err)
|
|
56
|
+
}
|
|
57
|
+
return callback(null, {
|
|
58
|
+
'toCwd': srcpath,
|
|
59
|
+
'toDst': path.relative(dstdir, srcpath)
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function symlinkPathsSync (srcpath, dstpath) {
|
|
68
|
+
let exists
|
|
69
|
+
if (path.isAbsolute(srcpath)) {
|
|
70
|
+
exists = fs.existsSync(srcpath)
|
|
71
|
+
if (!exists) throw new Error('absolute srcpath does not exist')
|
|
72
|
+
return {
|
|
73
|
+
'toCwd': srcpath,
|
|
74
|
+
'toDst': srcpath
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
const dstdir = path.dirname(dstpath)
|
|
78
|
+
const relativeToDst = path.join(dstdir, srcpath)
|
|
79
|
+
exists = fs.existsSync(relativeToDst)
|
|
80
|
+
if (exists) {
|
|
81
|
+
return {
|
|
82
|
+
'toCwd': relativeToDst,
|
|
83
|
+
'toDst': srcpath
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
exists = fs.existsSync(srcpath)
|
|
87
|
+
if (!exists) throw new Error('relative srcpath does not exist')
|
|
88
|
+
return {
|
|
89
|
+
'toCwd': srcpath,
|
|
90
|
+
'toDst': path.relative(dstdir, srcpath)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
module.exports = {
|
|
97
|
+
symlinkPaths,
|
|
98
|
+
symlinkPathsSync
|
|
99
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('graceful-fs')
|
|
4
|
+
|
|
5
|
+
function symlinkType (srcpath, type, callback) {
|
|
6
|
+
callback = (typeof type === 'function') ? type : callback
|
|
7
|
+
type = (typeof type === 'function') ? false : type
|
|
8
|
+
if (type) return callback(null, type)
|
|
9
|
+
fs.lstat(srcpath, (err, stats) => {
|
|
10
|
+
if (err) return callback(null, 'file')
|
|
11
|
+
type = (stats && stats.isDirectory()) ? 'dir' : 'file'
|
|
12
|
+
callback(null, type)
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function symlinkTypeSync (srcpath, type) {
|
|
17
|
+
let stats
|
|
18
|
+
|
|
19
|
+
if (type) return type
|
|
20
|
+
try {
|
|
21
|
+
stats = fs.lstatSync(srcpath)
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return 'file'
|
|
24
|
+
}
|
|
25
|
+
return (stats && stats.isDirectory()) ? 'dir' : 'file'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
symlinkType,
|
|
30
|
+
symlinkTypeSync
|
|
31
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const u = require('universalify').fromCallback
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const fs = require('graceful-fs')
|
|
6
|
+
const _mkdirs = require('../mkdirs')
|
|
7
|
+
const mkdirs = _mkdirs.mkdirs
|
|
8
|
+
const mkdirsSync = _mkdirs.mkdirsSync
|
|
9
|
+
|
|
10
|
+
const _symlinkPaths = require('./symlink-paths')
|
|
11
|
+
const symlinkPaths = _symlinkPaths.symlinkPaths
|
|
12
|
+
const symlinkPathsSync = _symlinkPaths.symlinkPathsSync
|
|
13
|
+
|
|
14
|
+
const _symlinkType = require('./symlink-type')
|
|
15
|
+
const symlinkType = _symlinkType.symlinkType
|
|
16
|
+
const symlinkTypeSync = _symlinkType.symlinkTypeSync
|
|
17
|
+
|
|
18
|
+
const pathExists = require('../path-exists').pathExists
|
|
19
|
+
|
|
20
|
+
function createSymlink (srcpath, dstpath, type, callback) {
|
|
21
|
+
callback = (typeof type === 'function') ? type : callback
|
|
22
|
+
type = (typeof type === 'function') ? false : type
|
|
23
|
+
|
|
24
|
+
pathExists(dstpath, (err, destinationExists) => {
|
|
25
|
+
if (err) return callback(err)
|
|
26
|
+
if (destinationExists) return callback(null)
|
|
27
|
+
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
|
28
|
+
if (err) return callback(err)
|
|
29
|
+
srcpath = relative.toDst
|
|
30
|
+
symlinkType(relative.toCwd, type, (err, type) => {
|
|
31
|
+
if (err) return callback(err)
|
|
32
|
+
const dir = path.dirname(dstpath)
|
|
33
|
+
pathExists(dir, (err, dirExists) => {
|
|
34
|
+
if (err) return callback(err)
|
|
35
|
+
if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
|
|
36
|
+
mkdirs(dir, err => {
|
|
37
|
+
if (err) return callback(err)
|
|
38
|
+
fs.symlink(srcpath, dstpath, type, callback)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createSymlinkSync (srcpath, dstpath, type) {
|
|
47
|
+
const destinationExists = fs.existsSync(dstpath)
|
|
48
|
+
if (destinationExists) return undefined
|
|
49
|
+
|
|
50
|
+
const relative = symlinkPathsSync(srcpath, dstpath)
|
|
51
|
+
srcpath = relative.toDst
|
|
52
|
+
type = symlinkTypeSync(relative.toCwd, type)
|
|
53
|
+
const dir = path.dirname(dstpath)
|
|
54
|
+
const exists = fs.existsSync(dir)
|
|
55
|
+
if (exists) return fs.symlinkSync(srcpath, dstpath, type)
|
|
56
|
+
mkdirsSync(dir)
|
|
57
|
+
return fs.symlinkSync(srcpath, dstpath, type)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = {
|
|
61
|
+
createSymlink: u(createSymlink),
|
|
62
|
+
createSymlinkSync
|
|
63
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
// This is adapted from https://github.com/normalize/mz
|
|
3
|
+
// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
|
|
4
|
+
const u = require('universalify').fromCallback
|
|
5
|
+
const fs = require('graceful-fs')
|
|
6
|
+
|
|
7
|
+
const api = [
|
|
8
|
+
'access',
|
|
9
|
+
'appendFile',
|
|
10
|
+
'chmod',
|
|
11
|
+
'chown',
|
|
12
|
+
'close',
|
|
13
|
+
'copyFile',
|
|
14
|
+
'fchmod',
|
|
15
|
+
'fchown',
|
|
16
|
+
'fdatasync',
|
|
17
|
+
'fstat',
|
|
18
|
+
'fsync',
|
|
19
|
+
'ftruncate',
|
|
20
|
+
'futimes',
|
|
21
|
+
'lchown',
|
|
22
|
+
'lchmod',
|
|
23
|
+
'link',
|
|
24
|
+
'lstat',
|
|
25
|
+
'mkdir',
|
|
26
|
+
'mkdtemp',
|
|
27
|
+
'open',
|
|
28
|
+
'readFile',
|
|
29
|
+
'readdir',
|
|
30
|
+
'readlink',
|
|
31
|
+
'realpath',
|
|
32
|
+
'rename',
|
|
33
|
+
'rmdir',
|
|
34
|
+
'stat',
|
|
35
|
+
'symlink',
|
|
36
|
+
'truncate',
|
|
37
|
+
'unlink',
|
|
38
|
+
'utimes',
|
|
39
|
+
'writeFile'
|
|
40
|
+
].filter(key => {
|
|
41
|
+
// Some commands are not available on some systems. Ex:
|
|
42
|
+
// fs.copyFile was added in Node.js v8.5.0
|
|
43
|
+
// fs.mkdtemp was added in Node.js v5.10.0
|
|
44
|
+
// fs.lchown is not available on at least some Linux
|
|
45
|
+
return typeof fs[key] === 'function'
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
// Export all keys:
|
|
49
|
+
Object.keys(fs).forEach(key => {
|
|
50
|
+
if (key === 'promises') {
|
|
51
|
+
// fs.promises is a getter property that triggers ExperimentalWarning
|
|
52
|
+
// Don't re-export it here, the getter is defined in "lib/index.js"
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
exports[key] = fs[key]
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Universalify async methods:
|
|
59
|
+
api.forEach(method => {
|
|
60
|
+
exports[method] = u(fs[method])
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// We differ from mz/fs in that we still ship the old, broken, fs.exists()
|
|
64
|
+
// since we are a drop-in replacement for the native module
|
|
65
|
+
exports.exists = function (filename, callback) {
|
|
66
|
+
if (typeof callback === 'function') {
|
|
67
|
+
return fs.exists(filename, callback)
|
|
68
|
+
}
|
|
69
|
+
return new Promise(resolve => {
|
|
70
|
+
return fs.exists(filename, resolve)
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// fs.read() & fs.write need special treatment due to multiple callback args
|
|
75
|
+
|
|
76
|
+
exports.read = function (fd, buffer, offset, length, position, callback) {
|
|
77
|
+
if (typeof callback === 'function') {
|
|
78
|
+
return fs.read(fd, buffer, offset, length, position, callback)
|
|
79
|
+
}
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
|
|
82
|
+
if (err) return reject(err)
|
|
83
|
+
resolve({ bytesRead, buffer })
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Function signature can be
|
|
89
|
+
// fs.write(fd, buffer[, offset[, length[, position]]], callback)
|
|
90
|
+
// OR
|
|
91
|
+
// fs.write(fd, string[, position[, encoding]], callback)
|
|
92
|
+
// We need to handle both cases, so we use ...args
|
|
93
|
+
exports.write = function (fd, buffer, ...args) {
|
|
94
|
+
if (typeof args[args.length - 1] === 'function') {
|
|
95
|
+
return fs.write(fd, buffer, ...args)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
|
|
100
|
+
if (err) return reject(err)
|
|
101
|
+
resolve({ bytesWritten, buffer })
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
}
|