projen 0.92.9 → 0.92.11

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.
Files changed (254) hide show
  1. package/.jsii +13854 -408
  2. package/lib/awscdk/auto-discover.js +5 -5
  3. package/lib/awscdk/awscdk-app-java.js +1 -1
  4. package/lib/awscdk/awscdk-app-py.js +1 -1
  5. package/lib/awscdk/awscdk-app-ts.js +3 -3
  6. package/lib/awscdk/awscdk-construct.js +2 -2
  7. package/lib/awscdk/awscdk-deps-java.js +1 -1
  8. package/lib/awscdk/awscdk-deps-js.js +1 -1
  9. package/lib/awscdk/awscdk-deps-py.js +1 -1
  10. package/lib/awscdk/awscdk-deps.js +1 -1
  11. package/lib/awscdk/cdk-config.js +1 -1
  12. package/lib/awscdk/cdk-tasks.js +1 -1
  13. package/lib/awscdk/integration-test.js +1 -1
  14. package/lib/awscdk/lambda-extension.js +1 -1
  15. package/lib/awscdk/lambda-function.js +2 -2
  16. package/lib/build/build-workflow.js +1 -1
  17. package/lib/cdk/auto-discover-base.js +4 -4
  18. package/lib/cdk/construct-lib.js +1 -1
  19. package/lib/cdk/integration-test-base.js +1 -1
  20. package/lib/cdk/jsii-docgen.js +1 -1
  21. package/lib/cdk/jsii-project.js +1 -1
  22. package/lib/cdk8s/auto-discover.js +2 -2
  23. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  24. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  25. package/lib/cdk8s/cdk8s-construct.js +1 -1
  26. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps.js +1 -1
  28. package/lib/cdk8s/integration-test.js +1 -1
  29. package/lib/cdktf/cdktf-construct.js +1 -1
  30. package/lib/circleci/circleci.js +3 -2
  31. package/lib/circleci/model.d.ts +2 -0
  32. package/lib/circleci/model.js +1 -1
  33. package/lib/cleanup.js +4 -3
  34. package/lib/component.js +1 -1
  35. package/lib/dependencies.js +1 -1
  36. package/lib/dev-env.js +1 -1
  37. package/lib/docker-compose/docker-compose-service.js +1 -1
  38. package/lib/docker-compose/docker-compose.js +1 -1
  39. package/lib/file.js +1 -1
  40. package/lib/gitattributes.js +1 -1
  41. package/lib/github/actions-provider.js +1 -1
  42. package/lib/github/auto-approve.js +1 -1
  43. package/lib/github/auto-merge.js +1 -1
  44. package/lib/github/auto-queue.js +1 -1
  45. package/lib/github/dependabot.js +1 -1
  46. package/lib/github/github-credentials.js +1 -1
  47. package/lib/github/github-project.js +1 -1
  48. package/lib/github/github.js +1 -1
  49. package/lib/github/merge-queue.js +1 -1
  50. package/lib/github/mergify.js +1 -1
  51. package/lib/github/pr-template.js +1 -1
  52. package/lib/github/pull-request-backport.js +1 -1
  53. package/lib/github/pull-request-lint.js +1 -1
  54. package/lib/github/stale.js +1 -1
  55. package/lib/github/task-workflow-job.js +1 -1
  56. package/lib/github/task-workflow.js +1 -1
  57. package/lib/github/workflow-actions.js +1 -1
  58. package/lib/github/workflow-jobs.js +1 -1
  59. package/lib/github/workflow-steps.js +1 -1
  60. package/lib/github/workflows.js +1 -1
  61. package/lib/gitlab/configuration.js +1 -1
  62. package/lib/gitlab/gitlab-configuration.js +1 -1
  63. package/lib/gitlab/nested-configuration.js +1 -1
  64. package/lib/gitpod.js +1 -1
  65. package/lib/ignore-file.js +1 -1
  66. package/lib/ini.js +1 -1
  67. package/lib/java/java-project.js +1 -1
  68. package/lib/java/junit.js +1 -1
  69. package/lib/java/maven-compile.js +1 -1
  70. package/lib/java/maven-packaging.js +1 -1
  71. package/lib/java/maven-sample.js +1 -1
  72. package/lib/java/pom.js +2 -2
  73. package/lib/java/projenrc.js +1 -1
  74. package/lib/javascript/biome/biome-config.d.ts +2522 -0
  75. package/lib/javascript/biome/biome-config.js +10 -0
  76. package/lib/javascript/biome/biome.d.ts +67 -0
  77. package/lib/javascript/biome/biome.js +128 -0
  78. package/lib/javascript/bundler.js +1 -1
  79. package/lib/javascript/eslint.js +1 -1
  80. package/lib/javascript/index.d.ts +2 -0
  81. package/lib/javascript/index.js +4 -1
  82. package/lib/javascript/jest.js +4 -4
  83. package/lib/javascript/license-checker.js +1 -1
  84. package/lib/javascript/node-package.js +1 -1
  85. package/lib/javascript/node-project.d.ts +13 -0
  86. package/lib/javascript/node-project.js +9 -2
  87. package/lib/javascript/npm-config.js +1 -1
  88. package/lib/javascript/prettier.js +1 -1
  89. package/lib/javascript/projenrc.d.ts +1 -1
  90. package/lib/javascript/projenrc.js +5 -2
  91. package/lib/javascript/typescript-config.js +2 -2
  92. package/lib/javascript/upgrade-dependencies.js +2 -2
  93. package/lib/javascript/yarnrc.js +1 -1
  94. package/lib/json-patch.js +1 -1
  95. package/lib/json.js +1 -1
  96. package/lib/license.js +1 -1
  97. package/lib/logger.js +1 -1
  98. package/lib/makefile.js +1 -1
  99. package/lib/object-file.js +3 -3
  100. package/lib/project-build.js +1 -1
  101. package/lib/project-tree.js +1 -1
  102. package/lib/project.js +5 -4
  103. package/lib/projects.js +1 -1
  104. package/lib/projenrc-json.js +2 -2
  105. package/lib/projenrc.js +1 -1
  106. package/lib/python/pip.js +1 -1
  107. package/lib/python/poetry.js +2 -2
  108. package/lib/python/projenrc.js +1 -1
  109. package/lib/python/pytest-sample.js +1 -1
  110. package/lib/python/pytest.js +1 -1
  111. package/lib/python/python-project.js +1 -1
  112. package/lib/python/python-sample.js +1 -1
  113. package/lib/python/requirements-file.js +1 -1
  114. package/lib/python/setuppy.js +1 -1
  115. package/lib/python/setuptools.js +1 -1
  116. package/lib/python/venv.js +1 -1
  117. package/lib/readme.js +1 -1
  118. package/lib/release/publisher.d.ts +3 -1
  119. package/lib/release/publisher.js +5 -2
  120. package/lib/release/release-trigger.js +1 -1
  121. package/lib/release/release.js +1 -1
  122. package/lib/renovatebot.js +1 -1
  123. package/lib/sample-file.js +6 -5
  124. package/lib/semver.js +1 -1
  125. package/lib/source-code.js +1 -1
  126. package/lib/task-runtime.js +1 -1
  127. package/lib/task.js +1 -1
  128. package/lib/tasks.js +1 -1
  129. package/lib/testing.js +1 -1
  130. package/lib/textfile.js +1 -1
  131. package/lib/toml.js +1 -1
  132. package/lib/typescript/projenrc-ts.js +1 -1
  133. package/lib/typescript/projenrc.js +4 -2
  134. package/lib/typescript/typescript-typedoc.js +1 -1
  135. package/lib/typescript/typescript.js +13 -7
  136. package/lib/util/synth.js +5 -4
  137. package/lib/util.d.ts +20 -2
  138. package/lib/util.js +20 -8
  139. package/lib/version.js +2 -2
  140. package/lib/vscode/devcontainer.js +1 -1
  141. package/lib/vscode/extensions.js +1 -1
  142. package/lib/vscode/launch-config.js +1 -1
  143. package/lib/vscode/settings.js +1 -1
  144. package/lib/vscode/vscode.js +1 -1
  145. package/lib/web/next.js +3 -3
  146. package/lib/web/postcss.js +1 -1
  147. package/lib/web/react.js +4 -4
  148. package/lib/web/tailwind.js +1 -1
  149. package/lib/xmlfile.js +1 -1
  150. package/lib/yaml.js +1 -1
  151. package/node_modules/pump/index.js +1 -1
  152. package/node_modules/pump/package.json +1 -1
  153. package/package.json +6 -3
  154. package/node_modules/balanced-match/.github/FUNDING.yml +0 -2
  155. package/node_modules/balanced-match/LICENSE.md +0 -21
  156. package/node_modules/balanced-match/README.md +0 -97
  157. package/node_modules/balanced-match/index.js +0 -62
  158. package/node_modules/balanced-match/package.json +0 -48
  159. package/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  160. package/node_modules/brace-expansion/LICENSE +0 -21
  161. package/node_modules/brace-expansion/README.md +0 -135
  162. package/node_modules/brace-expansion/index.js +0 -203
  163. package/node_modules/brace-expansion/package.json +0 -46
  164. package/node_modules/fs.realpath/LICENSE +0 -43
  165. package/node_modules/fs.realpath/README.md +0 -33
  166. package/node_modules/fs.realpath/index.js +0 -66
  167. package/node_modules/fs.realpath/old.js +0 -303
  168. package/node_modules/fs.realpath/package.json +0 -26
  169. package/node_modules/glob/LICENSE +0 -15
  170. package/node_modules/glob/README.md +0 -399
  171. package/node_modules/glob/common.js +0 -244
  172. package/node_modules/glob/glob.js +0 -790
  173. package/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
  174. package/node_modules/glob/node_modules/minimatch/README.md +0 -259
  175. package/node_modules/glob/node_modules/minimatch/lib/path.js +0 -4
  176. package/node_modules/glob/node_modules/minimatch/minimatch.js +0 -944
  177. package/node_modules/glob/node_modules/minimatch/package.json +0 -35
  178. package/node_modules/glob/package.json +0 -55
  179. package/node_modules/glob/sync.js +0 -486
  180. package/node_modules/inflight/LICENSE +0 -15
  181. package/node_modules/inflight/README.md +0 -37
  182. package/node_modules/inflight/inflight.js +0 -54
  183. package/node_modules/inflight/package.json +0 -29
  184. package/node_modules/inherits/LICENSE +0 -16
  185. package/node_modules/inherits/README.md +0 -42
  186. package/node_modules/inherits/inherits.js +0 -9
  187. package/node_modules/inherits/inherits_browser.js +0 -27
  188. package/node_modules/inherits/package.json +0 -29
  189. /package/node_modules/{fast-glob/node_modules/glob-parent → glob-parent}/LICENSE +0 -0
  190. /package/node_modules/{fast-glob/node_modules/glob-parent → glob-parent}/README.md +0 -0
  191. /package/node_modules/{fast-glob/node_modules/glob-parent → glob-parent}/index.js +0 -0
  192. /package/node_modules/{fast-glob/node_modules/glob-parent → glob-parent}/package.json +0 -0
  193. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/LICENSE +0 -0
  194. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/README.md +0 -0
  195. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/index.js +0 -0
  196. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/append/constant.js +0 -0
  197. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/append.js +0 -0
  198. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/count.js +0 -0
  199. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/help.js +0 -0
  200. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/store/constant.js +0 -0
  201. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/store/false.js +0 -0
  202. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/store/true.js +0 -0
  203. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/store.js +0 -0
  204. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/subparsers.js +0 -0
  205. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action/version.js +0 -0
  206. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action.js +0 -0
  207. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/action_container.js +0 -0
  208. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/argparse.js +0 -0
  209. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/argument/error.js +0 -0
  210. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/argument/exclusive.js +0 -0
  211. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/argument/group.js +0 -0
  212. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/argument_parser.js +0 -0
  213. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/const.js +0 -0
  214. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/help/added_formatters.js +0 -0
  215. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/help/formatter.js +0 -0
  216. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/namespace.js +0 -0
  217. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/lib/utils.js +0 -0
  218. /package/node_modules/{argparse → xmlbuilder2/node_modules/argparse}/package.json +0 -0
  219. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/LICENSE +0 -0
  220. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/README.md +0 -0
  221. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/bin/js-yaml.js +0 -0
  222. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/dist/js-yaml.js +0 -0
  223. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/dist/js-yaml.min.js +0 -0
  224. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/index.js +0 -0
  225. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/common.js +0 -0
  226. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/dumper.js +0 -0
  227. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/exception.js +0 -0
  228. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/loader.js +0 -0
  229. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/mark.js +0 -0
  230. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema/core.js +0 -0
  231. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema/default_full.js +0 -0
  232. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema/default_safe.js +0 -0
  233. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema/failsafe.js +0 -0
  234. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema/json.js +0 -0
  235. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/schema.js +0 -0
  236. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/binary.js +0 -0
  237. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/bool.js +0 -0
  238. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/float.js +0 -0
  239. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/int.js +0 -0
  240. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/js/function.js +0 -0
  241. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/js/regexp.js +0 -0
  242. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/js/undefined.js +0 -0
  243. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/map.js +0 -0
  244. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/merge.js +0 -0
  245. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/null.js +0 -0
  246. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/omap.js +0 -0
  247. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/pairs.js +0 -0
  248. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/seq.js +0 -0
  249. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/set.js +0 -0
  250. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/str.js +0 -0
  251. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type/timestamp.js +0 -0
  252. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml/type.js +0 -0
  253. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/lib/js-yaml.js +0 -0
  254. /package/node_modules/{js-yaml → xmlbuilder2/node_modules/js-yaml}/package.json +0 -0
@@ -1,33 +0,0 @@
1
- # fs.realpath
2
-
3
- A backwards-compatible fs.realpath for Node v6 and above
4
-
5
- In Node v6, the JavaScript implementation of fs.realpath was replaced
6
- with a faster (but less resilient) native implementation. That raises
7
- new and platform-specific errors and cannot handle long or excessively
8
- symlink-looping paths.
9
-
10
- This module handles those cases by detecting the new errors and
11
- falling back to the JavaScript implementation. On versions of Node
12
- prior to v6, it has no effect.
13
-
14
- ## USAGE
15
-
16
- ```js
17
- var rp = require('fs.realpath')
18
-
19
- // async version
20
- rp.realpath(someLongAndLoopingPath, function (er, real) {
21
- // the ELOOP was handled, but it was a bit slower
22
- })
23
-
24
- // sync version
25
- var real = rp.realpathSync(someLongAndLoopingPath)
26
-
27
- // monkeypatch at your own risk!
28
- // This replaces the fs.realpath/fs.realpathSync builtins
29
- rp.monkeypatch()
30
-
31
- // un-do the monkeypatching
32
- rp.unmonkeypatch()
33
- ```
@@ -1,66 +0,0 @@
1
- module.exports = realpath
2
- realpath.realpath = realpath
3
- realpath.sync = realpathSync
4
- realpath.realpathSync = realpathSync
5
- realpath.monkeypatch = monkeypatch
6
- realpath.unmonkeypatch = unmonkeypatch
7
-
8
- var fs = require('fs')
9
- var origRealpath = fs.realpath
10
- var origRealpathSync = fs.realpathSync
11
-
12
- var version = process.version
13
- var ok = /^v[0-5]\./.test(version)
14
- var old = require('./old.js')
15
-
16
- function newError (er) {
17
- return er && er.syscall === 'realpath' && (
18
- er.code === 'ELOOP' ||
19
- er.code === 'ENOMEM' ||
20
- er.code === 'ENAMETOOLONG'
21
- )
22
- }
23
-
24
- function realpath (p, cache, cb) {
25
- if (ok) {
26
- return origRealpath(p, cache, cb)
27
- }
28
-
29
- if (typeof cache === 'function') {
30
- cb = cache
31
- cache = null
32
- }
33
- origRealpath(p, cache, function (er, result) {
34
- if (newError(er)) {
35
- old.realpath(p, cache, cb)
36
- } else {
37
- cb(er, result)
38
- }
39
- })
40
- }
41
-
42
- function realpathSync (p, cache) {
43
- if (ok) {
44
- return origRealpathSync(p, cache)
45
- }
46
-
47
- try {
48
- return origRealpathSync(p, cache)
49
- } catch (er) {
50
- if (newError(er)) {
51
- return old.realpathSync(p, cache)
52
- } else {
53
- throw er
54
- }
55
- }
56
- }
57
-
58
- function monkeypatch () {
59
- fs.realpath = realpath
60
- fs.realpathSync = realpathSync
61
- }
62
-
63
- function unmonkeypatch () {
64
- fs.realpath = origRealpath
65
- fs.realpathSync = origRealpathSync
66
- }
@@ -1,303 +0,0 @@
1
- // Copyright Joyent, Inc. and other Node contributors.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a
4
- // copy of this software and associated documentation files (the
5
- // "Software"), to deal in the Software without restriction, including
6
- // without limitation the rights to use, copy, modify, merge, publish,
7
- // distribute, sublicense, and/or sell copies of the Software, and to permit
8
- // persons to whom the Software is furnished to do so, subject to the
9
- // following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included
12
- // in all copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- var pathModule = require('path');
23
- var isWindows = process.platform === 'win32';
24
- var fs = require('fs');
25
-
26
- // JavaScript implementation of realpath, ported from node pre-v6
27
-
28
- var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
29
-
30
- function rethrow() {
31
- // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
32
- // is fairly slow to generate.
33
- var callback;
34
- if (DEBUG) {
35
- var backtrace = new Error;
36
- callback = debugCallback;
37
- } else
38
- callback = missingCallback;
39
-
40
- return callback;
41
-
42
- function debugCallback(err) {
43
- if (err) {
44
- backtrace.message = err.message;
45
- err = backtrace;
46
- missingCallback(err);
47
- }
48
- }
49
-
50
- function missingCallback(err) {
51
- if (err) {
52
- if (process.throwDeprecation)
53
- throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
54
- else if (!process.noDeprecation) {
55
- var msg = 'fs: missing callback ' + (err.stack || err.message);
56
- if (process.traceDeprecation)
57
- console.trace(msg);
58
- else
59
- console.error(msg);
60
- }
61
- }
62
- }
63
- }
64
-
65
- function maybeCallback(cb) {
66
- return typeof cb === 'function' ? cb : rethrow();
67
- }
68
-
69
- var normalize = pathModule.normalize;
70
-
71
- // Regexp that finds the next partion of a (partial) path
72
- // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
73
- if (isWindows) {
74
- var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
75
- } else {
76
- var nextPartRe = /(.*?)(?:[\/]+|$)/g;
77
- }
78
-
79
- // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
80
- if (isWindows) {
81
- var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
82
- } else {
83
- var splitRootRe = /^[\/]*/;
84
- }
85
-
86
- exports.realpathSync = function realpathSync(p, cache) {
87
- // make p is absolute
88
- p = pathModule.resolve(p);
89
-
90
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
91
- return cache[p];
92
- }
93
-
94
- var original = p,
95
- seenLinks = {},
96
- knownHard = {};
97
-
98
- // current character position in p
99
- var pos;
100
- // the partial path so far, including a trailing slash if any
101
- var current;
102
- // the partial path without a trailing slash (except when pointing at a root)
103
- var base;
104
- // the partial path scanned in the previous round, with slash
105
- var previous;
106
-
107
- start();
108
-
109
- function start() {
110
- // Skip over roots
111
- var m = splitRootRe.exec(p);
112
- pos = m[0].length;
113
- current = m[0];
114
- base = m[0];
115
- previous = '';
116
-
117
- // On windows, check that the root exists. On unix there is no need.
118
- if (isWindows && !knownHard[base]) {
119
- fs.lstatSync(base);
120
- knownHard[base] = true;
121
- }
122
- }
123
-
124
- // walk down the path, swapping out linked pathparts for their real
125
- // values
126
- // NB: p.length changes.
127
- while (pos < p.length) {
128
- // find the next part
129
- nextPartRe.lastIndex = pos;
130
- var result = nextPartRe.exec(p);
131
- previous = current;
132
- current += result[0];
133
- base = previous + result[1];
134
- pos = nextPartRe.lastIndex;
135
-
136
- // continue if not a symlink
137
- if (knownHard[base] || (cache && cache[base] === base)) {
138
- continue;
139
- }
140
-
141
- var resolvedLink;
142
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
143
- // some known symbolic link. no need to stat again.
144
- resolvedLink = cache[base];
145
- } else {
146
- var stat = fs.lstatSync(base);
147
- if (!stat.isSymbolicLink()) {
148
- knownHard[base] = true;
149
- if (cache) cache[base] = base;
150
- continue;
151
- }
152
-
153
- // read the link if it wasn't read before
154
- // dev/ino always return 0 on windows, so skip the check.
155
- var linkTarget = null;
156
- if (!isWindows) {
157
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
158
- if (seenLinks.hasOwnProperty(id)) {
159
- linkTarget = seenLinks[id];
160
- }
161
- }
162
- if (linkTarget === null) {
163
- fs.statSync(base);
164
- linkTarget = fs.readlinkSync(base);
165
- }
166
- resolvedLink = pathModule.resolve(previous, linkTarget);
167
- // track this, if given a cache.
168
- if (cache) cache[base] = resolvedLink;
169
- if (!isWindows) seenLinks[id] = linkTarget;
170
- }
171
-
172
- // resolve the link, then start over
173
- p = pathModule.resolve(resolvedLink, p.slice(pos));
174
- start();
175
- }
176
-
177
- if (cache) cache[original] = p;
178
-
179
- return p;
180
- };
181
-
182
-
183
- exports.realpath = function realpath(p, cache, cb) {
184
- if (typeof cb !== 'function') {
185
- cb = maybeCallback(cache);
186
- cache = null;
187
- }
188
-
189
- // make p is absolute
190
- p = pathModule.resolve(p);
191
-
192
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
193
- return process.nextTick(cb.bind(null, null, cache[p]));
194
- }
195
-
196
- var original = p,
197
- seenLinks = {},
198
- knownHard = {};
199
-
200
- // current character position in p
201
- var pos;
202
- // the partial path so far, including a trailing slash if any
203
- var current;
204
- // the partial path without a trailing slash (except when pointing at a root)
205
- var base;
206
- // the partial path scanned in the previous round, with slash
207
- var previous;
208
-
209
- start();
210
-
211
- function start() {
212
- // Skip over roots
213
- var m = splitRootRe.exec(p);
214
- pos = m[0].length;
215
- current = m[0];
216
- base = m[0];
217
- previous = '';
218
-
219
- // On windows, check that the root exists. On unix there is no need.
220
- if (isWindows && !knownHard[base]) {
221
- fs.lstat(base, function(err) {
222
- if (err) return cb(err);
223
- knownHard[base] = true;
224
- LOOP();
225
- });
226
- } else {
227
- process.nextTick(LOOP);
228
- }
229
- }
230
-
231
- // walk down the path, swapping out linked pathparts for their real
232
- // values
233
- function LOOP() {
234
- // stop if scanned past end of path
235
- if (pos >= p.length) {
236
- if (cache) cache[original] = p;
237
- return cb(null, p);
238
- }
239
-
240
- // find the next part
241
- nextPartRe.lastIndex = pos;
242
- var result = nextPartRe.exec(p);
243
- previous = current;
244
- current += result[0];
245
- base = previous + result[1];
246
- pos = nextPartRe.lastIndex;
247
-
248
- // continue if not a symlink
249
- if (knownHard[base] || (cache && cache[base] === base)) {
250
- return process.nextTick(LOOP);
251
- }
252
-
253
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
254
- // known symbolic link. no need to stat again.
255
- return gotResolvedLink(cache[base]);
256
- }
257
-
258
- return fs.lstat(base, gotStat);
259
- }
260
-
261
- function gotStat(err, stat) {
262
- if (err) return cb(err);
263
-
264
- // if not a symlink, skip to the next path part
265
- if (!stat.isSymbolicLink()) {
266
- knownHard[base] = true;
267
- if (cache) cache[base] = base;
268
- return process.nextTick(LOOP);
269
- }
270
-
271
- // stat & read the link if not read before
272
- // call gotTarget as soon as the link target is known
273
- // dev/ino always return 0 on windows, so skip the check.
274
- if (!isWindows) {
275
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
276
- if (seenLinks.hasOwnProperty(id)) {
277
- return gotTarget(null, seenLinks[id], base);
278
- }
279
- }
280
- fs.stat(base, function(err) {
281
- if (err) return cb(err);
282
-
283
- fs.readlink(base, function(err, target) {
284
- if (!isWindows) seenLinks[id] = target;
285
- gotTarget(err, target);
286
- });
287
- });
288
- }
289
-
290
- function gotTarget(err, target, base) {
291
- if (err) return cb(err);
292
-
293
- var resolvedLink = pathModule.resolve(previous, target);
294
- if (cache) cache[base] = resolvedLink;
295
- gotResolvedLink(resolvedLink);
296
- }
297
-
298
- function gotResolvedLink(resolvedLink) {
299
- // resolve the link, then start over
300
- p = pathModule.resolve(resolvedLink, p.slice(pos));
301
- start();
302
- }
303
- };
@@ -1,26 +0,0 @@
1
- {
2
- "name": "fs.realpath",
3
- "version": "1.0.0",
4
- "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails",
5
- "main": "index.js",
6
- "dependencies": {},
7
- "devDependencies": {},
8
- "scripts": {
9
- "test": "tap test/*.js --cov"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/isaacs/fs.realpath.git"
14
- },
15
- "keywords": [
16
- "realpath",
17
- "fs",
18
- "polyfill"
19
- ],
20
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
21
- "license": "ISC",
22
- "files": [
23
- "old.js",
24
- "index.js"
25
- ]
26
- }
@@ -1,15 +0,0 @@
1
- The ISC License
2
-
3
- Copyright (c) 2009-2022 Isaac Z. Schlueter and Contributors
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.